diff --git a/Dlhis.Jinko.Face.sln b/Dlhis.Jinko.Face.sln index d1d15d0f..c33fc373 100644 --- a/Dlhis.Jinko.Face.sln +++ b/Dlhis.Jinko.Face.sln @@ -47,7 +47,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Message", "Message", "{65E7 EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Dlhis.Message", "Src\Dlhis.Message\Dlhis.Message.csproj", "{053BF7B2-B1A0-435F-9C77-2EF5622CC5C5}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dlhis.InfoCheck", "Src\Dlhis.InfoCheck\Dlhis.InfoCheck.csproj", "{4D656761-8CE7-4316-A3DF-8C1722D69CCE}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Dlhis.InfoCheck", "Src\Dlhis.InfoCheck\Dlhis.InfoCheck.csproj", "{4D656761-8CE7-4316-A3DF-8C1722D69CCE}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/Src/Dlhis.Basic.Api/Dlhis.Basic.Api.csproj b/Src/Dlhis.Basic.Api/Dlhis.Basic.Api.csproj index ae3784a1..3ce3fd2e 100644 --- a/Src/Dlhis.Basic.Api/Dlhis.Basic.Api.csproj +++ b/Src/Dlhis.Basic.Api/Dlhis.Basic.Api.csproj @@ -7,7 +7,7 @@ - + diff --git a/Src/Dlhis.Basic.Api/Dto/BusinessPlaceDto.cs b/Src/Dlhis.Basic.Api/Dto/BusinessPlaceDto.cs new file mode 100644 index 00000000..4a223435 --- /dev/null +++ b/Src/Dlhis.Basic.Api/Dto/BusinessPlaceDto.cs @@ -0,0 +1,7 @@ +namespace Dlhis.Basic.Api.Dto; + +public class BusinessPlaceDto +{ + public Guid Code { get; set; } + public string Name { get; set; } +} \ No newline at end of file diff --git a/Src/Dlhis.Basic.Api/Dtos/DishesMenuDetailDto.cs b/Src/Dlhis.Basic.Api/Dto/DishesMenuDetailDto.cs similarity index 91% rename from Src/Dlhis.Basic.Api/Dtos/DishesMenuDetailDto.cs rename to Src/Dlhis.Basic.Api/Dto/DishesMenuDetailDto.cs index cb960e51..4e5addef 100644 --- a/Src/Dlhis.Basic.Api/Dtos/DishesMenuDetailDto.cs +++ b/Src/Dlhis.Basic.Api/Dto/DishesMenuDetailDto.cs @@ -1,4 +1,4 @@ -namespace Dlhis.Basic.Api.Dtos; +namespace Dlhis.Basic.Api.Dto; public class DishesMenuDetailDto { diff --git a/Src/Dlhis.Basic.Api/Dtos/PermissionUsersInfoDto.cs b/Src/Dlhis.Basic.Api/Dto/PermissionUsersInfoDto.cs similarity index 89% rename from Src/Dlhis.Basic.Api/Dtos/PermissionUsersInfoDto.cs rename to Src/Dlhis.Basic.Api/Dto/PermissionUsersInfoDto.cs index 872ec843..e89b9c8a 100644 --- a/Src/Dlhis.Basic.Api/Dtos/PermissionUsersInfoDto.cs +++ b/Src/Dlhis.Basic.Api/Dto/PermissionUsersInfoDto.cs @@ -1,4 +1,4 @@ -namespace Dlhis.Basic.Api.Dtos; +namespace Dlhis.Basic.Api.Dto; public class PermissionUsersInfoDto { @@ -11,4 +11,4 @@ public class PermissionUsersInfoDto /// 用户对应的 [ 厂区--设备Code ] /// public Dictionary> PermissionInfos { get; set; } -} +} \ No newline at end of file diff --git a/Src/Dlhis.Basic.Api/Dtos/UserTenantDeviceCodeDto.cs b/Src/Dlhis.Basic.Api/Dto/UserTenantDeviceCodeDto.cs similarity index 86% rename from Src/Dlhis.Basic.Api/Dtos/UserTenantDeviceCodeDto.cs rename to Src/Dlhis.Basic.Api/Dto/UserTenantDeviceCodeDto.cs index 3d822559..70578e86 100644 --- a/Src/Dlhis.Basic.Api/Dtos/UserTenantDeviceCodeDto.cs +++ b/Src/Dlhis.Basic.Api/Dto/UserTenantDeviceCodeDto.cs @@ -1,4 +1,4 @@ -namespace Dlhis.Basic.Api.Dtos; +namespace Dlhis.Basic.Api.Dto; public class UserTenantDeviceCodeDto { diff --git a/Src/Dlhis.Basic.Api/Dtos/BusinessPlaceDto.cs b/Src/Dlhis.Basic.Api/Dtos/BusinessPlaceDto.cs deleted file mode 100644 index 15003d35..00000000 --- a/Src/Dlhis.Basic.Api/Dtos/BusinessPlaceDto.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Dlhis.Basic.Api.Dtos -{ - public class BusinessPlaceDto - { - public Guid Code { get; set; } - public string Name { get; set; } - } -} diff --git a/Src/Dlhis.Basic.Api/IBusinessPlacePermissionsApi.cs b/Src/Dlhis.Basic.Api/IBusinessPlacePermissionsApi.cs index ed81189b..68d1aa5d 100644 --- a/Src/Dlhis.Basic.Api/IBusinessPlacePermissionsApi.cs +++ b/Src/Dlhis.Basic.Api/IBusinessPlacePermissionsApi.cs @@ -1,7 +1,7 @@ -using Dlhis.Basic.Api.Dtos; +using Dlhis.Basic.Api.Dto; using Dlhis.Basic.Api.Request; -using Kurisu.Core.Result; using Kurisu.RemoteCall.Attributes; +using Kurisu.RemoteCall.Default; namespace Dlhis.Basic.Api; @@ -14,4 +14,4 @@ public interface IBusinessPlacePermissionsApi [Post("/api/gainfoPermissions/reset")] Task ResetAsync(GainfoPermissionResetRequest request); -} +} \ No newline at end of file diff --git a/Src/Dlhis.Basic.Api/IDeviceGroupApi.cs b/Src/Dlhis.Basic.Api/IDeviceGroupApi.cs index 790d3024..cd23e83d 100644 --- a/Src/Dlhis.Basic.Api/IDeviceGroupApi.cs +++ b/Src/Dlhis.Basic.Api/IDeviceGroupApi.cs @@ -1,6 +1,6 @@ using Dlhis.Basic.Api.Response; -using Kurisu.Core.Result; using Kurisu.RemoteCall.Attributes; +using Kurisu.RemoteCall.Default; namespace Dlhis.Basic.Api; diff --git a/Src/Dlhis.Basic.Api/IDevicePermissionApi.cs b/Src/Dlhis.Basic.Api/IDevicePermissionApi.cs index 18bb8a88..f8ba7dae 100644 --- a/Src/Dlhis.Basic.Api/IDevicePermissionApi.cs +++ b/Src/Dlhis.Basic.Api/IDevicePermissionApi.cs @@ -1,6 +1,6 @@ -using Dlhis.Basic.Api.Dtos; -using Kurisu.Core.Result; +using Dlhis.Basic.Api.Dto; using Kurisu.RemoteCall.Attributes; +using Kurisu.RemoteCall.Default; namespace Dlhis.Basic.Api; diff --git a/Src/Dlhis.Basic.Api/IDishesMenuApi.cs b/Src/Dlhis.Basic.Api/IDishesMenuApi.cs index 20b31c99..66cdecb3 100644 --- a/Src/Dlhis.Basic.Api/IDishesMenuApi.cs +++ b/Src/Dlhis.Basic.Api/IDishesMenuApi.cs @@ -1,6 +1,6 @@ -using Dlhis.Basic.Api.Dtos; -using Kurisu.Core.Result; +using Dlhis.Basic.Api.Dto; using Kurisu.RemoteCall.Attributes; +using Kurisu.RemoteCall.Default; namespace Dlhis.Basic.Api; diff --git a/Src/Dlhis.Basic.Api/Request/SaveBusinessPlacePermissionRequest.cs b/Src/Dlhis.Basic.Api/Request/SaveBusinessPlacePermissionRequest.cs deleted file mode 100644 index 084b595e..00000000 --- a/Src/Dlhis.Basic.Api/Request/SaveBusinessPlacePermissionRequest.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Dlhis.Basic.Api.Request -{ - public class SaveBusinessPlacePermissionRequest - { - public long? Id { get; set; } - - /// - /// 营业点 - /// - public Guid BusinessPlaceCode { get; set; } - } -} diff --git a/Src/Dlhis.Basic/BusinessShift/Controllers/BusinessShiftsController.cs b/Src/Dlhis.Basic/BusinessShift/Controllers/BusinessShiftsController.cs index d465d8bb..aa2ccfd3 100644 --- a/Src/Dlhis.Basic/BusinessShift/Controllers/BusinessShiftsController.cs +++ b/Src/Dlhis.Basic/BusinessShift/Controllers/BusinessShiftsController.cs @@ -1,8 +1,8 @@ using Dlhis.Basic.BusinessShift.Request; using Dlhis.Basic.BusinessShift.Response; using Dlhis.Basic.BusinessShift.Services; +using Kurisu.AspNetCore.DataAccess.Dto; using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop; -using Kurisu.Core.DataAccess.Dto; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; diff --git a/Src/Dlhis.Basic/BusinessShift/Request/BusinessPlaceShiftPageRequest.cs b/Src/Dlhis.Basic/BusinessShift/Request/BusinessPlaceShiftPageRequest.cs index 5ed2e3c2..00a975d2 100644 --- a/Src/Dlhis.Basic/BusinessShift/Request/BusinessPlaceShiftPageRequest.cs +++ b/Src/Dlhis.Basic/BusinessShift/Request/BusinessPlaceShiftPageRequest.cs @@ -1,4 +1,4 @@ -using Kurisu.Core.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.Dto; namespace Dlhis.Basic.BusinessShift.Request; diff --git a/Src/Dlhis.Basic/BusinessShift/Request/BusinessPlaceShiftSaveMealShiftRequest.cs b/Src/Dlhis.Basic/BusinessShift/Request/BusinessPlaceShiftSaveMealShiftRequest.cs index fd7be32d..a897d312 100644 --- a/Src/Dlhis.Basic/BusinessShift/Request/BusinessPlaceShiftSaveMealShiftRequest.cs +++ b/Src/Dlhis.Basic/BusinessShift/Request/BusinessPlaceShiftSaveMealShiftRequest.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; using Dlhis.Entity.Canteen.Enums; -using Kurisu.Core.CustomClass; +using Kurisu.AspNetCore.CustomClass; namespace Dlhis.Basic.BusinessShift.Request; diff --git a/Src/Dlhis.Basic/BusinessShift/Services/IBusinessPlaceShiftService.cs b/Src/Dlhis.Basic/BusinessShift/Services/IBusinessPlaceShiftService.cs index e8498c95..93bc40fe 100644 --- a/Src/Dlhis.Basic/BusinessShift/Services/IBusinessPlaceShiftService.cs +++ b/Src/Dlhis.Basic/BusinessShift/Services/IBusinessPlaceShiftService.cs @@ -1,8 +1,8 @@ using Dlhis.Basic.Places.Request; -using Dlhis.Basic.BusinessPlace.Response; using Dlhis.Basic.BusinessShift.Request; using Dlhis.Basic.BusinessShift.Response; -using Kurisu.Core.DataAccess.Dto; +using Dlhis.Basic.Places.Response; +using Kurisu.AspNetCore.DataAccess.Dto; namespace Dlhis.Basic.BusinessShift.Services; diff --git a/Src/Dlhis.Basic/BusinessShift/Services/Implements/BusinessPlaceShiftService.cs b/Src/Dlhis.Basic/BusinessShift/Services/Implements/BusinessPlaceShiftService.cs index 5e30bf53..91e3dc5d 100644 --- a/Src/Dlhis.Basic/BusinessShift/Services/Implements/BusinessPlaceShiftService.cs +++ b/Src/Dlhis.Basic/BusinessShift/Services/Implements/BusinessPlaceShiftService.cs @@ -1,16 +1,15 @@ using Dlhis.Basic.Places.Request; -using Dlhis.Basic.BusinessPlace.Response; using Dlhis.Basic.BusinessShift.Request; using Dlhis.Basic.BusinessShift.Response; +using Dlhis.Basic.Places.Response; using Dlhis.Entity.Basic.Entity; using Dlhis.Entity.Device.Entities; using Dlhis.Sys.Api; +using Kurisu.AspNetCore.CustomClass; +using Kurisu.AspNetCore.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Services; using Kurisu.AspNetCore.Utils.Extensions; -using Kurisu.Core.CustomClass; -using Kurisu.Core.DataAccess.Dto; -using Kurisu.Core.Result; -using Kurisu.SqlSugar.Extensions; -using Kurisu.SqlSugar.Services; using Mapster; namespace Dlhis.Basic.BusinessShift.Services.Implements; @@ -29,7 +28,7 @@ public class BusinessPlaceShiftService : IBusinessPlaceShiftService public async Task> GetPageAsync(BusinessPlaceShiftPageRequest request) { var page = await _dbContext.Queryable() - .WhereIF(request.Search.IsPresent(), (shift) => shift.CustomCode.Contains(request.Search) || shift.Name.Contains(request.Search)) + .WhereIF(request.Search.IsPresent(), shift => shift.CustomCode.Contains(request.Search) || shift.Name.Contains(request.Search)) .Select() .ToPageListAsync(request); @@ -133,8 +132,7 @@ public class BusinessPlaceShiftService : IBusinessPlaceShiftService } var tenantResult = await _tenantApi.GetTenantByCodeAsync(place.TenantId); - (tenantResult.Code == ApiStateCode.Success).ThrowIfFalse(tenantResult.Msg); - var tenantInfo = tenantResult.Data; + var tenantInfo = tenantResult.EnsureSuccessStatusCode(); var relationship = await _dbContext.Queryable().Where(x => x.PlaceCode == place.Code).FirstAsync(); if (relationship == null) diff --git a/Src/Dlhis.Basic/BusinessShift/TimePeriodExtensions.cs b/Src/Dlhis.Basic/BusinessShift/TimePeriodExtensions.cs index 8c371613..de255125 100644 --- a/Src/Dlhis.Basic/BusinessShift/TimePeriodExtensions.cs +++ b/Src/Dlhis.Basic/BusinessShift/TimePeriodExtensions.cs @@ -1,8 +1,7 @@ -using Kurisu.Core.CustomClass; +using Kurisu.AspNetCore.CustomClass; namespace Dlhis.Basic.BusinessShift; - /// /// 临时的扩展类 todo: 嵌入框架 /// @@ -38,4 +37,4 @@ public static class TimePeriodExtensions } } } -} +} \ No newline at end of file diff --git a/Src/Dlhis.Basic/Device/Controllers/DevicePermissionsController.cs b/Src/Dlhis.Basic/Device/Controllers/DevicePermissionsController.cs index 8606dc88..8dad892a 100644 --- a/Src/Dlhis.Basic/Device/Controllers/DevicePermissionsController.cs +++ b/Src/Dlhis.Basic/Device/Controllers/DevicePermissionsController.cs @@ -1,9 +1,7 @@ using Dlhis.Basic.Device.Dtos; using Dlhis.Basic.Device.Request; -using Dlhis.Basic.Device.Response; using Dlhis.Basic.Device.Services; using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop; -using Kurisu.Core.DataAccess.Dto; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; diff --git a/Src/Dlhis.Basic/Device/Controllers/DevicesController.cs b/Src/Dlhis.Basic/Device/Controllers/DevicesController.cs index a9dd8bc9..3fc6108b 100644 --- a/Src/Dlhis.Basic/Device/Controllers/DevicesController.cs +++ b/Src/Dlhis.Basic/Device/Controllers/DevicesController.cs @@ -1,8 +1,8 @@ using Dlhis.Basic.Device.Request; using Dlhis.Basic.Device.Response; using Dlhis.Basic.Device.Services; +using Kurisu.AspNetCore.DataAccess.Dto; using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop; -using Kurisu.Core.DataAccess.Dto; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; @@ -186,7 +186,7 @@ public class DevicesController : ControllerBase /// /// [HttpGet("attendancesoffline")] - public async Task> GetAttendanceOfflineAsync([FromQuery] DeviceOnlineAndofflineRequest request) + public async Task> GetAttendanceOfflineAsync([FromQuery] DeviceOnlineAndOfflineRequest request) { return await _deviceService.GetAttendanceOfflineAsync(request); } diff --git a/Src/Dlhis.Basic/Device/Request/AttendanceTotalRequest.cs b/Src/Dlhis.Basic/Device/Request/AttendanceTotalRequest.cs index df7fa9fa..be2fe7e6 100644 --- a/Src/Dlhis.Basic/Device/Request/AttendanceTotalRequest.cs +++ b/Src/Dlhis.Basic/Device/Request/AttendanceTotalRequest.cs @@ -1,4 +1,4 @@ -using Kurisu.Core.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.Dto; namespace Dlhis.Basic.Device.Request { diff --git a/Src/Dlhis.Basic/Device/Request/DeviceOnlineAndofflineRequest.cs b/Src/Dlhis.Basic/Device/Request/DeviceOnlineAndofflineRequest.cs index 0100289f..82bdea8b 100644 --- a/Src/Dlhis.Basic/Device/Request/DeviceOnlineAndofflineRequest.cs +++ b/Src/Dlhis.Basic/Device/Request/DeviceOnlineAndofflineRequest.cs @@ -1,8 +1,8 @@ -using Kurisu.Core.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.Dto; namespace Dlhis.Basic.Device.Request { - public class DeviceOnlineAndofflineRequest : PageDto + public class DeviceOnlineAndOfflineRequest : PageDto { public bool IsOnAndOff { get; set; } } diff --git a/Src/Dlhis.Basic/Device/Request/DevicePageRequest.cs b/Src/Dlhis.Basic/Device/Request/DevicePageRequest.cs index 111f857c..341af685 100644 --- a/Src/Dlhis.Basic/Device/Request/DevicePageRequest.cs +++ b/Src/Dlhis.Basic/Device/Request/DevicePageRequest.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; using Dlhis.Entity.Device.Enums; -using Kurisu.Core.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.Dto; namespace Dlhis.Basic.Device.Request; diff --git a/Src/Dlhis.Basic/Device/Request/DeviceTemplatePageRequest.cs b/Src/Dlhis.Basic/Device/Request/DeviceTemplatePageRequest.cs index 8adf81f2..67a594e3 100644 --- a/Src/Dlhis.Basic/Device/Request/DeviceTemplatePageRequest.cs +++ b/Src/Dlhis.Basic/Device/Request/DeviceTemplatePageRequest.cs @@ -1,4 +1,4 @@ -using Kurisu.Core.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.Dto; namespace Dlhis.Basic.Device.Request; diff --git a/Src/Dlhis.Basic/Device/Response/GetDoorOfflineRequest.cs b/Src/Dlhis.Basic/Device/Response/GetDoorOfflineRequest.cs index 89d4eff4..7a4506d9 100644 --- a/Src/Dlhis.Basic/Device/Response/GetDoorOfflineRequest.cs +++ b/Src/Dlhis.Basic/Device/Response/GetDoorOfflineRequest.cs @@ -1,4 +1,4 @@ -using Kurisu.Core.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.Dto; namespace Dlhis.Basic.Device.Response { diff --git a/Src/Dlhis.Basic/Device/Services/IDevicePermissionService.cs b/Src/Dlhis.Basic/Device/Services/IDevicePermissionService.cs index 547e591f..2cf5d7ce 100644 --- a/Src/Dlhis.Basic/Device/Services/IDevicePermissionService.cs +++ b/Src/Dlhis.Basic/Device/Services/IDevicePermissionService.cs @@ -1,9 +1,7 @@ using Dlhis.Basic.Device.Dtos; using Dlhis.Basic.Device.Request; -using Dlhis.Basic.Device.Response; using Dlhis.Entity.Device.Enums; using Dlhis.Entity.Sys.Enums; -using Kurisu.Core.DataAccess.Dto; namespace Dlhis.Basic.Device.Services; diff --git a/Src/Dlhis.Basic/Device/Services/IDeviceService.cs b/Src/Dlhis.Basic/Device/Services/IDeviceService.cs index b551ee6a..abf4cf44 100644 --- a/Src/Dlhis.Basic/Device/Services/IDeviceService.cs +++ b/Src/Dlhis.Basic/Device/Services/IDeviceService.cs @@ -1,7 +1,6 @@ using Dlhis.Basic.Device.Request; using Dlhis.Basic.Device.Response; -using Kurisu.Core.DataAccess.Dto; -using Microsoft.AspNetCore.Mvc; +using Kurisu.AspNetCore.DataAccess.Dto; namespace Dlhis.Basic.Device.Services; @@ -21,7 +20,7 @@ public interface IDeviceService : IScopeDependency Task> GetAttendanceTotalAsync(AttendanceTotalRequest request); - Task> GetAttendanceOfflineAsync(DeviceOnlineAndofflineRequest request); + Task> GetAttendanceOfflineAsync(DeviceOnlineAndOfflineRequest request); Task> GetDoorOfflineAsync(GetDoorOfflineRequest request); diff --git a/Src/Dlhis.Basic/Device/Services/IDeviceTemplateService.cs b/Src/Dlhis.Basic/Device/Services/IDeviceTemplateService.cs index e184fad5..14a9a295 100644 --- a/Src/Dlhis.Basic/Device/Services/IDeviceTemplateService.cs +++ b/Src/Dlhis.Basic/Device/Services/IDeviceTemplateService.cs @@ -1,6 +1,6 @@ using Dlhis.Basic.Device.Request; using Dlhis.Basic.Device.Response; -using Kurisu.Core.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.Dto; namespace Dlhis.Basic.Device.Services; diff --git a/Src/Dlhis.Basic/Device/Services/Implements/DeviceConnectService.cs b/Src/Dlhis.Basic/Device/Services/Implements/DeviceConnectService.cs index f8dd2acc..21bab18a 100644 --- a/Src/Dlhis.Basic/Device/Services/Implements/DeviceConnectService.cs +++ b/Src/Dlhis.Basic/Device/Services/Implements/DeviceConnectService.cs @@ -5,9 +5,9 @@ using Dlhis.Basic.Device.Response; using Dlhis.Entity.Basic.Entity; using Dlhis.Entity.Device.Entities; using Dlhis.Entity.Device.Enums; +using Kurisu.AspNetCore.CustomClass; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Services; using Kurisu.AspNetCore.Utils.Extensions; -using Kurisu.Core.CustomClass; -using Kurisu.SqlSugar.Services; using Mapster; namespace Dlhis.Basic.Device.Services.Implements; diff --git a/Src/Dlhis.Basic/Device/Services/Implements/DeviceGroupService.cs b/Src/Dlhis.Basic/Device/Services/Implements/DeviceGroupService.cs index e883ef88..fe3dcbd2 100644 --- a/Src/Dlhis.Basic/Device/Services/Implements/DeviceGroupService.cs +++ b/Src/Dlhis.Basic/Device/Services/Implements/DeviceGroupService.cs @@ -3,9 +3,9 @@ using Dlhis.Basic.Device.Response; using Dlhis.Entity.Basic.Entity; using Dlhis.Entity.Device.Entities; using Dlhis.Entity.Device.Enums; +using Kurisu.AspNetCore.Authentication.Abstractions; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Services; using Kurisu.AspNetCore.Utils.Extensions; -using Kurisu.Core.User.Abstractions; -using Kurisu.SqlSugar.Services; using Mapster; namespace Dlhis.Basic.Device.Services.Implements; diff --git a/Src/Dlhis.Basic/Device/Services/Implements/DevicePermissionService.cs b/Src/Dlhis.Basic/Device/Services/Implements/DevicePermissionService.cs index 1599fae0..7736d3bb 100644 --- a/Src/Dlhis.Basic/Device/Services/Implements/DevicePermissionService.cs +++ b/Src/Dlhis.Basic/Device/Services/Implements/DevicePermissionService.cs @@ -5,10 +5,10 @@ using Dlhis.Entity.Device.Entities; using Dlhis.Entity.Device.Enums; using Dlhis.Entity.Sys.Entities; using Dlhis.Entity.Sys.Enums; +using Kurisu.AspNetCore.Authentication.Abstractions; +using Kurisu.AspNetCore.DataAccess.Entity; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Services; using Kurisu.AspNetCore.Utils.Extensions; -using Kurisu.Core.DataAccess.Entity; -using Kurisu.Core.User.Abstractions; -using Kurisu.SqlSugar.Services; using SqlSugar; namespace Dlhis.Basic.Device.Services.Implements; diff --git a/Src/Dlhis.Basic/Device/Services/Implements/DeviceService.cs b/Src/Dlhis.Basic/Device/Services/Implements/DeviceService.cs index 4fce1540..567b0d76 100644 --- a/Src/Dlhis.Basic/Device/Services/Implements/DeviceService.cs +++ b/Src/Dlhis.Basic/Device/Services/Implements/DeviceService.cs @@ -7,13 +7,13 @@ using Dlhis.Entity.Canteen.Enums; using Dlhis.Entity.Device.Entities; using Dlhis.Entity.Device.Enums; using Dlhis.Sys.Api; +using Kurisu.AspNetCore.Authentication.Abstractions; +using Kurisu.AspNetCore.CustomClass; +using Kurisu.AspNetCore.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.Entity; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Services; using Kurisu.AspNetCore.Utils.Extensions; -using Kurisu.Core.CustomClass; -using Kurisu.Core.DataAccess.Dto; -using Kurisu.Core.DataAccess.Entity; -using Kurisu.Core.User.Abstractions; -using Kurisu.SqlSugar.Extensions; -using Kurisu.SqlSugar.Services; using Mapster; using Newtonsoft.Json; using Newtonsoft.Json.Linq; @@ -419,7 +419,7 @@ public class DeviceService : IDeviceService return page; } - public async Task> GetAttendanceOfflineAsync(DeviceOnlineAndofflineRequest request) + public async Task> GetAttendanceOfflineAsync(DeviceOnlineAndOfflineRequest request) { var devices = await _dbContext.Queryable().Where(x => x.Type == DeviceTypeEnumType.Attendance || (x.Type == DeviceTypeEnumType.Door && x.AsAttendance)).ToListAsync(); diff --git a/Src/Dlhis.Basic/Device/Services/Implements/DeviceTemplateService.cs b/Src/Dlhis.Basic/Device/Services/Implements/DeviceTemplateService.cs index 3e06e718..64bc62ff 100644 --- a/Src/Dlhis.Basic/Device/Services/Implements/DeviceTemplateService.cs +++ b/Src/Dlhis.Basic/Device/Services/Implements/DeviceTemplateService.cs @@ -1,11 +1,11 @@ using Dlhis.Basic.Device.Request; using Dlhis.Basic.Device.Response; using Dlhis.Entity.Basic.Entity; +using Kurisu.AspNetCore.CustomClass; +using Kurisu.AspNetCore.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Services; using Kurisu.AspNetCore.Utils.Extensions; -using Kurisu.Core.CustomClass; -using Kurisu.Core.DataAccess.Dto; -using Kurisu.SqlSugar.Extensions; -using Kurisu.SqlSugar.Services; using Mapster; using Newtonsoft.Json; using Newtonsoft.Json.Linq; diff --git a/Src/Dlhis.Basic/Dishes/Controller/DishesMenusController.cs b/Src/Dlhis.Basic/Dishes/Controller/DishesMenusController.cs index f79d493e..33c2e2e0 100644 --- a/Src/Dlhis.Basic/Dishes/Controller/DishesMenusController.cs +++ b/Src/Dlhis.Basic/Dishes/Controller/DishesMenusController.cs @@ -3,8 +3,8 @@ using Dlhis.Basic.Dishes.Request; using Dlhis.Basic.Dishes.Response; using Dlhis.Basic.Dishes.Services; using Dlhis.Entity.Canteen.Enums; +using Kurisu.AspNetCore.DataAccess.Dto; using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop; -using Kurisu.Core.DataAccess.Dto; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; @@ -33,7 +33,7 @@ public class DishesMenusController : ControllerBase /// /// [HttpGet("page")] - public async Task> GetDishesMenuPageAsync([FromQuery] DisheMenuPageRequest request) + public async Task> GetDishesMenuPageAsync([FromQuery] DishesMenuPageRequest request) { return await _dishesMenuService.GetDishesMenuPageAsync(request); } diff --git a/Src/Dlhis.Basic/Dishes/Request/DishesMenuNameDateSaveRequest.cs b/Src/Dlhis.Basic/Dishes/Request/DishesMenuNameDateSaveRequest.cs index e4518ecb..50bdf811 100644 --- a/Src/Dlhis.Basic/Dishes/Request/DishesMenuNameDateSaveRequest.cs +++ b/Src/Dlhis.Basic/Dishes/Request/DishesMenuNameDateSaveRequest.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; +using Kurisu.AspNetCore.CustomClass; using Kurisu.AspNetCore.Utils.Extensions; -using Kurisu.Core.CustomClass; namespace Dlhis.Basic.Dishes.Request; diff --git a/Src/Dlhis.Basic/Dishes/Request/DisheMenuPageRequest.cs b/Src/Dlhis.Basic/Dishes/Request/DishesMenuPageRequest.cs similarity index 71% rename from Src/Dlhis.Basic/Dishes/Request/DisheMenuPageRequest.cs rename to Src/Dlhis.Basic/Dishes/Request/DishesMenuPageRequest.cs index 81da6fcf..f3213270 100644 --- a/Src/Dlhis.Basic/Dishes/Request/DisheMenuPageRequest.cs +++ b/Src/Dlhis.Basic/Dishes/Request/DishesMenuPageRequest.cs @@ -1,9 +1,9 @@ using System.ComponentModel.DataAnnotations; -using Kurisu.Core.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.Dto; namespace Dlhis.Basic.Dishes.Request; -public class DisheMenuPageRequest : PageDto +public class DishesMenuPageRequest : PageDto { /// /// 营业点code diff --git a/Src/Dlhis.Basic/Dishes/Request/DishesPageRequest.cs b/Src/Dlhis.Basic/Dishes/Request/DishesPageRequest.cs index eb9eac9a..75bedf96 100644 --- a/Src/Dlhis.Basic/Dishes/Request/DishesPageRequest.cs +++ b/Src/Dlhis.Basic/Dishes/Request/DishesPageRequest.cs @@ -1,4 +1,4 @@ -using Kurisu.Core.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.Dto; namespace Dlhis.Basic.Dishes.Request; diff --git a/Src/Dlhis.Basic/Dishes/Services/IDishesMenuService.cs b/Src/Dlhis.Basic/Dishes/Services/IDishesMenuService.cs index 718b1efc..8c0aaa9f 100644 --- a/Src/Dlhis.Basic/Dishes/Services/IDishesMenuService.cs +++ b/Src/Dlhis.Basic/Dishes/Services/IDishesMenuService.cs @@ -1,14 +1,14 @@ using Dlhis.Entity.Canteen.Enums; -using Kurisu.Core.DataAccess.Dto; using Dlhis.Basic.Dishes.Request; using Dlhis.Basic.Dishes.Dto; using Dlhis.Basic.Dishes.Response; +using Kurisu.AspNetCore.DataAccess.Dto; namespace Dlhis.Basic.Dishes.Services; public interface IDishesMenuService : IScopeDependency { - Task> GetDishesMenuPageAsync(DisheMenuPageRequest request); + Task> GetDishesMenuPageAsync(DishesMenuPageRequest request); Task GetDishesMenuDetailAsync(Guid businessPlaceCode, string customCode, DateTime startDate, DateTime endDate); diff --git a/Src/Dlhis.Basic/Dishes/Services/IDishesService.cs b/Src/Dlhis.Basic/Dishes/Services/IDishesService.cs index f9c0fbfd..6a51c8b9 100644 --- a/Src/Dlhis.Basic/Dishes/Services/IDishesService.cs +++ b/Src/Dlhis.Basic/Dishes/Services/IDishesService.cs @@ -1,6 +1,6 @@ using Dlhis.Basic.Dishes.Request; using Dlhis.Basic.Dishes.Response; -using Kurisu.Core.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.Dto; namespace Dlhis.Basic.Dishes.Services; diff --git a/Src/Dlhis.Basic/Dishes/Services/Implements/DishesCategoryService.cs b/Src/Dlhis.Basic/Dishes/Services/Implements/DishesCategoryService.cs index 092ce609..89b5eb7c 100644 --- a/Src/Dlhis.Basic/Dishes/Services/Implements/DishesCategoryService.cs +++ b/Src/Dlhis.Basic/Dishes/Services/Implements/DishesCategoryService.cs @@ -1,10 +1,10 @@ -using Dlhis.Basic.BusinessPlace.Services; -using Dlhis.Basic.Dishes.Request; +using Dlhis.Basic.Dishes.Request; using Dlhis.Basic.Dishes.Response; +using Dlhis.Basic.Places.Services; using Dlhis.Entity.Basic.Entity; using Dlhis.Entity.Canteen.Entities; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Services; using Kurisu.AspNetCore.Utils.Extensions; -using Kurisu.SqlSugar.Services; using Mapster; namespace Dlhis.Basic.Dishes.Services.Implements; diff --git a/Src/Dlhis.Basic/Dishes/Services/Implements/DishesMenuService.cs b/Src/Dlhis.Basic/Dishes/Services/Implements/DishesMenuService.cs index f89bb400..76fcdd18 100644 --- a/Src/Dlhis.Basic/Dishes/Services/Implements/DishesMenuService.cs +++ b/Src/Dlhis.Basic/Dishes/Services/Implements/DishesMenuService.cs @@ -1,16 +1,16 @@ using Dlhis.Entity.Canteen.Entities; using Dlhis.Entity.Canteen.Enums; using Kurisu.AspNetCore.Utils.Extensions; -using Kurisu.Core.DataAccess.Dto; -using Kurisu.SqlSugar.Extensions; -using Kurisu.SqlSugar.Services; using SqlSugar; using Dlhis.Basic.Dishes.Request; using Dlhis.Basic.Dishes.Response; -using Dlhis.Basic.BusinessPlace.Services; using Dlhis.Basic.Dishes.Dto; -using Kurisu.Core.CustomClass; using System.Linq.Expressions; +using Dlhis.Basic.Places.Services; +using Kurisu.AspNetCore.CustomClass; +using Kurisu.AspNetCore.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Services; namespace Dlhis.Basic.Dishes.Services.Implements; @@ -25,7 +25,7 @@ public class DishesMenuService : IDishesMenuService _businessPlacePermissionsService = businessPlacePermissionsService; } - public async Task> GetDishesMenuPageAsync(DisheMenuPageRequest request) + public async Task> GetDishesMenuPageAsync(DishesMenuPageRequest request) { return await _dbContext.Queryable() .Where(x => x.BusinessPlaceCode == request.BusinessPlaceCode) @@ -43,11 +43,11 @@ public class DishesMenuService : IDishesMenuService public async Task GetDishesMenuDetailAsync(Guid businessPlaceCode, string customCode, DateTime startDate, DateTime endDate) { var data = await _dbContext.Queryable() - .Where(x => x.BusinessPlaceCode == businessPlaceCode) - .Where(x => x.CustomCode == customCode) - .Where(x => x.StartDate == startDate) - .Where(x => x.EndDate == endDate) - .ToListAsync(); + .Where(x => x.BusinessPlaceCode == businessPlaceCode) + .Where(x => x.CustomCode == customCode) + .Where(x => x.StartDate == startDate) + .Where(x => x.EndDate == endDate) + .ToListAsync(); if (data.IsEmpty()) { @@ -71,7 +71,7 @@ public class DishesMenuService : IDishesMenuService Start = data[0].StartDate, End = data[0].EndDate, }, - ShiftTypes = data.GroupBy(x => x.ShiftType).Select(item => + ShiftTypes = data.GroupBy(x => x.ShiftType).Select(item => { var shiftType = item.Key; @@ -85,7 +85,6 @@ public class DishesMenuService : IDishesMenuService Price = x.Price, }).ToList() }; - }).ToList() } } @@ -168,10 +167,10 @@ public class DishesMenuService : IDishesMenuService keys.ForEach(x => { deleteWhere = deleteWhere.Or(item => item.BusinessPlaceCode == request.BusinessPlaceCode - && item.CustomCode == x.CustomCode - //&& SqlFunc.DateIsSame(item.StartDate, x.StartDate, DateType.Day) - //&& SqlFunc.DateIsSame(item.EndDate, x.EndDate, DateType.Day) - && item.ShiftType == x.ShiftType); + && item.CustomCode == x.CustomCode + //&& SqlFunc.DateIsSame(item.StartDate, x.StartDate, DateType.Day) + //&& SqlFunc.DateIsSame(item.EndDate, x.EndDate, DateType.Day) + && item.ShiftType == x.ShiftType); }); await _dbContext.Client.Deleteable().Where(deleteWhere).ExecuteCommandAsync(); @@ -182,7 +181,7 @@ public class DishesMenuService : IDishesMenuService request.Items.ForEach(p => { whereCheck = whereCheck.Or(x => x.BusinessPlaceCode == request.BusinessPlaceCode - && !(x.EndDate < p.Period.Start || x.StartDate > p.Period.End) + && !(x.EndDate < p.Period.Start || x.StartDate > p.Period.End) ); }); @@ -196,24 +195,24 @@ public class DishesMenuService : IDishesMenuService public async Task GetBookingDishesDetailAsync(DateTime date, Guid businessPlaceCode, ShiftEnumType shiftType, string dishesCode) { var detail = await _dbContext.Queryable() - .LeftJoin((x, d) => x.DishesCode == d.CustomCode) - .Where(x => x.StartDate <= date && date <= x.EndDate) - .Where(x => x.BusinessPlaceCode == businessPlaceCode) - .Where(x => x.ShiftType == shiftType) - .Where(x => x.DishesCode == dishesCode) - .Where((x, d) => d.Enable) - .Select((x, d) => new DishesMenuDetailDto - { - Date = date, - MenuId = x.Id, - DishesId = d.Id, - DishesCode = d.CustomCode, - DishesName = d.Name, - Price = x.Price == null || x.Price == 0 ? d.Price : x.Price.Value, - Number = x.Number, - Version = x.Version, - }) - .SingleAsync(); + .LeftJoin((x, d) => x.DishesCode == d.CustomCode) + .Where(x => x.StartDate <= date && date <= x.EndDate) + .Where(x => x.BusinessPlaceCode == businessPlaceCode) + .Where(x => x.ShiftType == shiftType) + .Where(x => x.DishesCode == dishesCode) + .Where((x, d) => d.Enable) + .Select((x, d) => new DishesMenuDetailDto + { + Date = date, + MenuId = x.Id, + DishesId = d.Id, + DishesCode = d.CustomCode, + DishesName = d.Name, + Price = x.Price == null || x.Price == 0 ? d.Price : x.Price.Value, + Number = x.Number, + Version = x.Version, + }) + .SingleAsync(); return detail; } @@ -237,4 +236,4 @@ public class DishesMenuService : IDishesMenuService } } } -} +} \ No newline at end of file diff --git a/Src/Dlhis.Basic/Dishes/Services/Implements/DishesService.cs b/Src/Dlhis.Basic/Dishes/Services/Implements/DishesService.cs index 7810608e..187f292b 100644 --- a/Src/Dlhis.Basic/Dishes/Services/Implements/DishesService.cs +++ b/Src/Dlhis.Basic/Dishes/Services/Implements/DishesService.cs @@ -1,14 +1,14 @@ -using Dlhis.Basic.BusinessPlace.Services; -using Dlhis.Basic.Dishes.Request; +using Dlhis.Basic.Dishes.Request; using Dlhis.Basic.Dishes.Response; +using Dlhis.Basic.Places.Services; using Dlhis.Entity.Basic.Entity; using Dlhis.Entity.Canteen.Entities; using Dlhis.Entity.Canteen.Enums; +using Kurisu.AspNetCore.Authentication.Abstractions; +using Kurisu.AspNetCore.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Services; using Kurisu.AspNetCore.Utils.Extensions; -using Kurisu.Core.DataAccess.Dto; -using Kurisu.Core.User.Abstractions; -using Kurisu.SqlSugar.Extensions; -using Kurisu.SqlSugar.Services; using Mapster; namespace Dlhis.Basic.Dishes.Services.Implements; @@ -31,19 +31,18 @@ public class DishesService : IDishesService var myCodes = await GetMyBusinessPlaceCodesAsync(); return await _dbContext.Queryable() - .LeftJoin((x, category) => x.CategoryCode == category.Code) - .WhereIF(request.Search.IsPresent(), x => x.CustomCode == request.Search || x.Name.Contains(request.Search)) - .WhereIF(request.BusinessPlaceCodes.IsPresent(), x => request.BusinessPlaceCodes.Contains(x.BusinessPlaceCode)) - .Where(x => myCodes.Contains(x.BusinessPlaceCode)) - .OrderBy(x => x.CreateTime, SqlSugar.OrderByType.Desc) - .Select((x, category) => new DishesResponse - { - Id = x.Id, - CurrnetUnits = x.Units.ToString(), - CategoryName = category.Name, - - }, true) - .ToPageListAsync(request); + .LeftJoin((x, category) => x.CategoryCode == category.Code) + .WhereIF(request.Search.IsPresent(), x => x.CustomCode == request.Search || x.Name.Contains(request.Search)) + .WhereIF(request.BusinessPlaceCodes.IsPresent(), x => request.BusinessPlaceCodes.Contains(x.BusinessPlaceCode)) + .Where(x => myCodes.Contains(x.BusinessPlaceCode)) + .OrderBy(x => x.CreateTime, SqlSugar.OrderByType.Desc) + .Select((x, category) => new DishesResponse + { + Id = x.Id, + CurrnetUnits = x.Units.ToString(), + CategoryName = category.Name, + }, true) + .ToPageListAsync(request); } @@ -85,13 +84,12 @@ public class DishesService : IDishesService deadline = new TimeOnly(8, 30); - var payTypes = new List() { new() { Type = BalanceRecordSourceEnumType.Cash } }; var selectTenantId = await _dbContext.Queryable() - .Where(x => x.Code == request.BusinessPlaceCode) - .Select(x => x.TenantId) - .FirstAsync(); + .Where(x => x.Code == request.BusinessPlaceCode) + .Select(x => x.TenantId) + .FirstAsync(); if (gainfo.Factory == selectTenantId) { @@ -115,8 +113,6 @@ public class DishesService : IDishesService } - - /// /// 获取我的营业点 /// @@ -125,5 +121,4 @@ public class DishesService : IDishesService { return (await _businessPlacePermissionsService.GetMyAsync()).Select(x => x.Code).ToList(); } -} - +} \ No newline at end of file diff --git a/Src/Dlhis.Basic/Dlhis.Basic.csproj b/Src/Dlhis.Basic/Dlhis.Basic.csproj index eb05152d..2710de0b 100644 --- a/Src/Dlhis.Basic/Dlhis.Basic.csproj +++ b/Src/Dlhis.Basic/Dlhis.Basic.csproj @@ -20,12 +20,10 @@ - - diff --git a/Src/Dlhis.Basic/Map/Controllers/PointMapsController.cs b/Src/Dlhis.Basic/Map/Controllers/PointMapsController.cs index eaf928eb..fc994dc3 100644 --- a/Src/Dlhis.Basic/Map/Controllers/PointMapsController.cs +++ b/Src/Dlhis.Basic/Map/Controllers/PointMapsController.cs @@ -1,7 +1,7 @@ using Dlhis.Basic.Map.Request; using Dlhis.Basic.Map.Response; using Dlhis.Basic.Map.Services; -using Kurisu.Core.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.Dto; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; diff --git a/Src/Dlhis.Basic/Map/Services/IPointMapService.cs b/Src/Dlhis.Basic/Map/Services/IPointMapService.cs index d91d8010..85195fd7 100644 --- a/Src/Dlhis.Basic/Map/Services/IPointMapService.cs +++ b/Src/Dlhis.Basic/Map/Services/IPointMapService.cs @@ -1,6 +1,6 @@ using Dlhis.Basic.Map.Request; using Dlhis.Basic.Map.Response; -using Kurisu.Core.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.Dto; namespace Dlhis.Basic.Map.Services; diff --git a/Src/Dlhis.Basic/Map/Services/Implements/PointMapDetailService.cs b/Src/Dlhis.Basic/Map/Services/Implements/PointMapDetailService.cs index 44563249..e18d8508 100644 --- a/Src/Dlhis.Basic/Map/Services/Implements/PointMapDetailService.cs +++ b/Src/Dlhis.Basic/Map/Services/Implements/PointMapDetailService.cs @@ -1,7 +1,7 @@ using Dlhis.Basic.Map.Request; using Dlhis.Basic.Map.Response; using Dlhis.Entity.Basic.Entity; -using Kurisu.SqlSugar.Services; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Services; using Mapster; namespace Dlhis.Basic.Map.Services.Implements; diff --git a/Src/Dlhis.Basic/Map/Services/Implements/PointMapService.cs b/Src/Dlhis.Basic/Map/Services/Implements/PointMapService.cs index fe5f1338..7838863c 100644 --- a/Src/Dlhis.Basic/Map/Services/Implements/PointMapService.cs +++ b/Src/Dlhis.Basic/Map/Services/Implements/PointMapService.cs @@ -1,10 +1,10 @@ using Dlhis.Basic.Map.Request; using Dlhis.Basic.Map.Response; using Dlhis.Entity.Basic.Entity; +using Kurisu.AspNetCore.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Services; using Kurisu.AspNetCore.Utils.Extensions; -using Kurisu.Core.DataAccess.Dto; -using Kurisu.SqlSugar.Extensions; -using Kurisu.SqlSugar.Services; using Mapster; namespace Dlhis.Basic.Map.Services.Implements; diff --git a/Src/Dlhis.Basic/MealUser/Controllers/MealUsersController.cs b/Src/Dlhis.Basic/MealUser/Controllers/MealUsersController.cs index 04e365ac..0798547e 100644 --- a/Src/Dlhis.Basic/MealUser/Controllers/MealUsersController.cs +++ b/Src/Dlhis.Basic/MealUser/Controllers/MealUsersController.cs @@ -1,6 +1,6 @@ using Dlhis.Basic.MealUser.Response; using Dlhis.Basic.MealUser.Services; -using Kurisu.Core.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.Dto; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; diff --git a/Src/Dlhis.Basic/MealUser/Services/IMealUserService.cs b/Src/Dlhis.Basic/MealUser/Services/IMealUserService.cs index 33dfe9f8..c7a84f5b 100644 --- a/Src/Dlhis.Basic/MealUser/Services/IMealUserService.cs +++ b/Src/Dlhis.Basic/MealUser/Services/IMealUserService.cs @@ -1,5 +1,5 @@ using Dlhis.Basic.MealUser.Response; -using Kurisu.Core.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.Dto; namespace Dlhis.Basic.MealUser.Services; diff --git a/Src/Dlhis.Basic/MealUser/Services/Implements/MealUserService.cs b/Src/Dlhis.Basic/MealUser/Services/Implements/MealUserService.cs index 2961aa75..30dfd26c 100644 --- a/Src/Dlhis.Basic/MealUser/Services/Implements/MealUserService.cs +++ b/Src/Dlhis.Basic/MealUser/Services/Implements/MealUserService.cs @@ -1,11 +1,10 @@ using Dlhis.Basic.MealUser.Response; using Dlhis.Entity.Basic.Entity; +using Kurisu.AspNetCore.Authentication.Abstractions; +using Kurisu.AspNetCore.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Services; using Kurisu.AspNetCore.Utils.Extensions; -using Kurisu.Core.DataAccess.Dto; -using Kurisu.Core.User.Abstractions; -using Kurisu.SqlSugar.Extensions; -using Kurisu.SqlSugar.Services; -using Microsoft.CodeAnalysis; namespace Dlhis.Basic.MealUser.Services.Implements; @@ -43,4 +42,4 @@ public class MealUserService : IMealUserService return page; } -} +} \ No newline at end of file diff --git a/Src/Dlhis.Basic/Organization/Controllers/GainfoOutSourceController.cs b/Src/Dlhis.Basic/Organization/Controllers/GainfoOutSourceController.cs deleted file mode 100644 index e3e7c690..00000000 --- a/Src/Dlhis.Basic/Organization/Controllers/GainfoOutSourceController.cs +++ /dev/null @@ -1,52 +0,0 @@ -using Dlhis.Basic.Organization.Request; -using Dlhis.Basic.Organization.Services; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; - -namespace Dlhis.Basic.Organization.Controllers; - -/// -/// 外包人员 -/// -[Authorize] -[Route("api/[controller]")] -[ApiController] -public class GainfoOutSourceController : ControllerBase -{ - private readonly IGainfoOutSourceService _gainfoOutSourceService; - - public GainfoOutSourceController(IGainfoOutSourceService gainfoOutSourceService) - { - _gainfoOutSourceService = gainfoOutSourceService; - } - - /// - /// 入职 - /// - /// - [HttpPost("entry")] - public async Task EntryAsync(GainfoOutEntryRequest request) - { - await _gainfoOutSourceService.EntryAsync(request); - } - - /// - /// 离职 - /// - /// - [HttpPost("resign")] - public async Task ResignAsync(GainfoOutResignRequest request) - { - await _gainfoOutSourceService.ResignAsync(request); - } - - /// - /// 编辑 - /// - /// - [HttpPost("edit")] - public async Task EditAsync(GainfoOutEntryRequest request) - { - await _gainfoOutSourceService.EditAsync(request); - } -} \ No newline at end of file diff --git a/Src/Dlhis.Basic/Organization/Controllers/GainfoOutsourceController.cs b/Src/Dlhis.Basic/Organization/Controllers/GainfoOutsourceController.cs new file mode 100644 index 00000000..be411c7e --- /dev/null +++ b/Src/Dlhis.Basic/Organization/Controllers/GainfoOutsourceController.cs @@ -0,0 +1,45 @@ +using Dlhis.Basic.Organization.Request; +using Dlhis.Basic.Organization.Services; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; + +namespace Dlhis.Basic.Organization.Controllers; + +/// +/// 外包人员 +/// +[Authorize] +[Route("api/[controller]")] +[ApiController] +public class GainfoOutsourceController : ControllerBase +{ + private readonly IGainfoOutsourceService _gainfoOutSourceService; + + public GainfoOutsourceController(IGainfoOutsourceService gainfoOutSourceService) + { + _gainfoOutSourceService = gainfoOutSourceService; + } + + /// + /// 入职 + /// + /// + [HttpPost("entry")] + [Transactional] + public async Task EntryAsync(GainfoOutsourceRequest request) + { + await _gainfoOutSourceService.SaveAsync(request); + } + + /// + /// 编辑 + /// + /// + [HttpPost("edit")] + [Transactional] + public async Task EditAsync(GainfoOutsourceRequest request) + { + await _gainfoOutSourceService.SaveAsync(request); + } +} \ No newline at end of file diff --git a/Src/Dlhis.Basic/Organization/Controllers/GainfoPermissionsController.cs b/Src/Dlhis.Basic/Organization/Controllers/GainfoPermissionsController.cs index d21ab296..4b135fba 100644 --- a/Src/Dlhis.Basic/Organization/Controllers/GainfoPermissionsController.cs +++ b/Src/Dlhis.Basic/Organization/Controllers/GainfoPermissionsController.cs @@ -1,10 +1,10 @@ -using Dlhis.Basic.BusinessPlace.Response; -using Dlhis.Basic.Device.Response; +using Dlhis.Basic.Device.Response; using Dlhis.Basic.Organization.Request; using Dlhis.Basic.Organization.Response; using Dlhis.Basic.Organization.Services; +using Dlhis.Basic.Places.Response; +using Kurisu.AspNetCore.DataAccess.Dto; using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop; -using Kurisu.Core.DataAccess.Dto; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; diff --git a/Src/Dlhis.Basic/Organization/Controllers/GainfosController.cs b/Src/Dlhis.Basic/Organization/Controllers/GainfosController.cs index 0ee1001e..240ff13a 100644 --- a/Src/Dlhis.Basic/Organization/Controllers/GainfosController.cs +++ b/Src/Dlhis.Basic/Organization/Controllers/GainfosController.cs @@ -2,8 +2,8 @@ using Dlhis.Basic.Organization.Request; using Dlhis.Basic.Organization.Response; using Dlhis.Basic.Organization.Services; +using Kurisu.AspNetCore.DataAccess.Dto; using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop; -using Kurisu.Core.DataAccess.Dto; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; @@ -188,5 +188,16 @@ public class GainfosController : ControllerBase { return await _gainfoService.CheckIdNoAndNameMatchAsync(request); } + + /// + /// 离职 + /// + /// + [HttpPost("resign")] + [Transactional] + public async Task ResignAsync(GainfoResignRequest request) + { + await _gainfoService.ResignAsync(request); + } } diff --git a/Src/Dlhis.Basic/Organization/Controllers/WerksController.cs b/Src/Dlhis.Basic/Organization/Controllers/WerksController.cs index 72066039..1bf51ecc 100644 --- a/Src/Dlhis.Basic/Organization/Controllers/WerksController.cs +++ b/Src/Dlhis.Basic/Organization/Controllers/WerksController.cs @@ -1,7 +1,7 @@ using Dlhis.Basic.Organization.Request; using Dlhis.Basic.Organization.Response; using Dlhis.Basic.Organization.Services; -using Kurisu.Core.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.Dto; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; diff --git a/Src/Dlhis.Basic/Organization/Dto/GainfoOutSourceExternalInfoDto.cs b/Src/Dlhis.Basic/Organization/Dto/GainfoOutSourceExternalInfoDto.cs new file mode 100644 index 00000000..9dc79dee --- /dev/null +++ b/Src/Dlhis.Basic/Organization/Dto/GainfoOutSourceExternalInfoDto.cs @@ -0,0 +1,27 @@ +using System.ComponentModel.DataAnnotations; + +namespace Dlhis.Basic.Organization.Dto; + +/// +/// 外包人员额外信息 +/// +public class GainfoOutSourceExternalInfoDto +{ + /// + /// 供应商 + /// + [Required(ErrorMessage = "供应商不可为空")] + public string Supplier { get; set; } + + /// + /// 对接人员工号 + /// + [Required(ErrorMessage = "对接人工号不可为空")] + public string SapCode { get; set; } + + /// + /// 对接人员手机号 + /// + [Required(ErrorMessage = "对接人手机号不可为空")] + public string SapPhone { get; set; } +} \ No newline at end of file diff --git a/Src/Dlhis.Basic/Organization/Filters/IgnoreDataCaseAttribute.cs b/Src/Dlhis.Basic/Organization/Filters/IgnoreDataCaseAttribute.cs index 620e0843..809af34a 100644 --- a/Src/Dlhis.Basic/Organization/Filters/IgnoreDataCaseAttribute.cs +++ b/Src/Dlhis.Basic/Organization/Filters/IgnoreDataCaseAttribute.cs @@ -1,6 +1,6 @@ using System.Text; -using Kurisu.Core.Result; -using Kurisu.Core.Result.Abstractions; +using Kurisu.AspNetCore.UnifyResultAndValidation; +using Kurisu.AspNetCore.UnifyResultAndValidation.Abstractions; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Filters; using Newtonsoft.Json; @@ -43,4 +43,4 @@ public class IgnoreDataCaseAttribute : Attribute, IAsyncResultFilter //eg:过滤器直接响应结果,此处进行短路 //await next(); } -} +} \ No newline at end of file diff --git a/Src/Dlhis.Basic/Organization/Filters/NotFoundAttribute.cs b/Src/Dlhis.Basic/Organization/Filters/NotFoundAttribute.cs index b622d7cb..98c98d7e 100644 --- a/Src/Dlhis.Basic/Organization/Filters/NotFoundAttribute.cs +++ b/Src/Dlhis.Basic/Organization/Filters/NotFoundAttribute.cs @@ -1,5 +1,5 @@ -using Kurisu.Core.Result; -using Kurisu.Core.Result.Abstractions; +using Kurisu.AspNetCore.UnifyResultAndValidation; +using Kurisu.AspNetCore.UnifyResultAndValidation.Abstractions; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Filters; diff --git a/Src/Dlhis.Basic/Organization/Request/DeviceAssRequest.cs b/Src/Dlhis.Basic/Organization/Request/DeviceAssRequest.cs index d750b485..d537e60f 100644 --- a/Src/Dlhis.Basic/Organization/Request/DeviceAssRequest.cs +++ b/Src/Dlhis.Basic/Organization/Request/DeviceAssRequest.cs @@ -1,6 +1,6 @@ using Dlhis.Entity.Device.Enums; -using Kurisu.Core.DataAccess.Dto; using System.ComponentModel.DataAnnotations; +using Kurisu.AspNetCore.DataAccess.Dto; namespace Dlhis.Basic.Organization.Request; diff --git a/Src/Dlhis.Basic/Organization/Request/GainfoListRequest.cs b/Src/Dlhis.Basic/Organization/Request/GainfoListRequest.cs index 4f9fee56..17796006 100644 --- a/Src/Dlhis.Basic/Organization/Request/GainfoListRequest.cs +++ b/Src/Dlhis.Basic/Organization/Request/GainfoListRequest.cs @@ -1,36 +1,35 @@ using Dlhis.Entity.Basic.Enums; -using Kurisu.Core.DataAccess.Dto; using System.ComponentModel.DataAnnotations; +using Kurisu.AspNetCore.DataAccess.Dto; -namespace Dlhis.Basic.Organization.Request +namespace Dlhis.Basic.Organization.Request; + +public class GainfoListRequest : PageDto { - public class GainfoListRequest:PageDto - { - /// - /// 档案类型 - /// - [Required] - [EnumDataType(typeof(GainfoStatusEnumType))] - public GainfoStatusEnumType Status { get; set; } + /// + /// 档案类型 + /// + [Required] + [EnumDataType(typeof(GainfoStatusEnumType))] + public GainfoStatusEnumType Status { get; set; } - /// - /// 姓名 - /// - public string Name { get; set; } + /// + /// 姓名 + /// + public string Name { get; set; } - /// - /// 身份证号 - /// - public string IdNo { get; set; } + /// + /// 身份证号 + /// + public string IdNo { get; set; } - /// - /// 部门编码 - /// - public string DepartmentNo { get; set; } + /// + /// 部门编码 + /// + public string DepartmentNo { get; set; } - /// - /// 学工号 - /// - public string Code { get; set; } - } -} + /// + /// 学工号 + /// + public string Code { get; set; } +} \ No newline at end of file diff --git a/Src/Dlhis.Basic/Organization/Request/GainfoOutEntryRequest.cs b/Src/Dlhis.Basic/Organization/Request/GainfoOutEntryRequest.cs deleted file mode 100644 index 4684a17d..00000000 --- a/Src/Dlhis.Basic/Organization/Request/GainfoOutEntryRequest.cs +++ /dev/null @@ -1,119 +0,0 @@ -using Dlhis.Entity.Basic.Enums; -using SqlSugar; - -namespace Dlhis.Basic.Organization.Request; - -public class GainfoOutEntryRequest -{ - public long? Id { get; set; } - - /// - /// 姓名 - /// - public string Name { get; set; } - - /// - /// 证件类型代码 - /// - public string IdClass { get; set; } - - /// - /// 身份证号 - /// - public string IdNo { get; set; } - - /// - /// 身份证籍贯区域代码 - /// - public string Native { get; set; } - - /// - /// 性别 GenderEnumType - /// - public GenderEnumType Gender { get; set; } - - /// - /// 生日 - /// - public DateTime Birthday { get; set; } - - /// - /// 身份证地址 - /// - public string Address { get; set; } - - /// - /// 部门编码 - /// - public string DepartmentNo { get; set; } - - /// - /// 民族代码 - /// - public string Nation { get; set; } - - /// - /// 手机号码 - /// - public string Phone { get; set; } - - /// - /// 学历 - /// - public string Degree { get; set; } - - /// - /// 岗位 - /// - public string PositionNo { get; set; } - - /// - /// 职等 - /// - public string Grade { get; set; } - - /// - /// 职级 - /// - public string Title { get; set; } - - /// - /// 卡号 - /// - public string CardNo { get; set; } - - /// - /// 备注 - /// - public string Remark { get; set; } - - /// - /// 人事范围 - /// - public string Werks { get; set; } - - /// - /// 工作地 - /// - public string Workplace { get; set; } - - /// - /// 厂区 - /// - public string Factory { get; set; } - - /// - /// 成本中心 - /// - public string CostId { get; set; } - - /// - /// 入职日期 - /// - public DateTime? EntryDate { get; set; } - - /// - /// 离职日期 - /// - public DateTime? ResignationDate { get; set; } -} \ No newline at end of file diff --git a/Src/Dlhis.Basic/Organization/Request/GainfoOutResignRequest.cs b/Src/Dlhis.Basic/Organization/Request/GainfoOutResignRequest.cs deleted file mode 100644 index 02e28332..00000000 --- a/Src/Dlhis.Basic/Organization/Request/GainfoOutResignRequest.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.ComponentModel.DataAnnotations; - -namespace Dlhis.Basic.Organization.Request -{ - public class GainfoOutResignRequest : IValidatableObject - { - public long Id { get; set; } - - [Required] - public string Reason { get; set; } - - public DateTime Date { get; set; } - - /// - public IEnumerable Validate(ValidationContext validationContext) - { - if (Date < DateTime.Now.Date) - { - yield return new ValidationResult("离职日期不能小于当前时间", new[] { nameof(Date) }); - } - } - } -} \ No newline at end of file diff --git a/Src/Dlhis.Basic/Organization/Request/GainfoOutsourceRequest.cs b/Src/Dlhis.Basic/Organization/Request/GainfoOutsourceRequest.cs new file mode 100644 index 00000000..ca34751c --- /dev/null +++ b/Src/Dlhis.Basic/Organization/Request/GainfoOutsourceRequest.cs @@ -0,0 +1,67 @@ +using System.ComponentModel.DataAnnotations; +using Dlhis.Basic.Organization.Dto; +using Dlhis.Entity.Basic.Enums; + +namespace Dlhis.Basic.Organization.Request; + +public class GainfoOutsourceRequest +{ + public long? Id { get; set; } + + /// + /// 姓名 + /// + [Required(ErrorMessage = "姓名不可为空")] + public string Name { get; set; } + + /// + /// 证件类型代码 + /// + public string IdClass { get; set; } + + /// + /// 证件号 + /// + [Required(ErrorMessage = "证件号不可为空")] + public string IdNo { get; set; } + + /// + /// 性别 GenderEnumType + /// + public GenderEnumType Gender { get; set; } + + /// + /// 生日 + /// + public DateTime Birthday { get; set; } + + /// + /// 手机号码 + /// + [Required(ErrorMessage = "手机号不可为空")] + public string Phone { get; set; } + + /// + /// 备注 + /// + public string Remark { get; set; } + + /// + /// 厂区 + /// + [Required(ErrorMessage = "厂区不可为空")] + public string Factory { get; set; } + + /// + /// 入职日期 + /// + public DateTime? EntryDate { get; set; } + + /// + /// 离职日期 + /// + public DateTime? ResignationDate { get; set; } + + + public GainfoOutSourceExternalInfoDto ExternalInfo { get; set; } +} \ No newline at end of file diff --git a/Src/Dlhis.Basic/Organization/Request/GainfoPageRequest.cs b/Src/Dlhis.Basic/Organization/Request/GainfoPageRequest.cs index 82262089..e99ce379 100644 --- a/Src/Dlhis.Basic/Organization/Request/GainfoPageRequest.cs +++ b/Src/Dlhis.Basic/Organization/Request/GainfoPageRequest.cs @@ -1,7 +1,7 @@ using Dlhis.Entity.Basic.Enums; using Kurisu.AspNetCore.Utils.Extensions; -using Kurisu.Core.DataAccess.Dto; using System.ComponentModel.DataAnnotations; +using Kurisu.AspNetCore.DataAccess.Dto; namespace Dlhis.Basic.Organization.Request; @@ -16,13 +16,13 @@ public class GainfoPageRequest : PageDto, IValidatableObject /// /// 部门选择 /// - public List DepartmentSelections { get; set; } = new List(); + public List DepartmentSelections { get; set; } = new(); /// /// 是否为外包 /// - public bool? IsOutSource { get; set; } + public bool? IsOutsource { get; set; } public IEnumerable Validate(ValidationContext validationContext) { @@ -36,7 +36,6 @@ public class GainfoPageRequest : PageDto, IValidatableObject }); - yield break; } -} +} \ No newline at end of file diff --git a/Src/Dlhis.Basic/Organization/Request/GainfoResignRequest.cs b/Src/Dlhis.Basic/Organization/Request/GainfoResignRequest.cs new file mode 100644 index 00000000..c05768ef --- /dev/null +++ b/Src/Dlhis.Basic/Organization/Request/GainfoResignRequest.cs @@ -0,0 +1,31 @@ +using System.ComponentModel.DataAnnotations; +using Newtonsoft.Json; + +namespace Dlhis.Basic.Organization.Request; + +public class GainfoResignRequest : IValidatableObject +{ + public long Id { get; set; } + + /// + /// 离职原因 + /// + [Required(ErrorMessage = "离职原因不能为空")] + public string Reason { get; set; } + + public DateTime Date { get; set; } = DateTime.Now; + + /// + /// 是否外包 + /// + public bool IsOutsource { get; set; } = true; + + + public IEnumerable Validate(ValidationContext validationContext) + { + if (Date < DateTime.Now.Date) + { + yield return new ValidationResult("离职日期不能小于当前时间", new[] { nameof(Date) }); + } + } +} \ No newline at end of file diff --git a/Src/Dlhis.Basic/Organization/Request/WeekNumberRequest.cs b/Src/Dlhis.Basic/Organization/Request/WeekNumberRequest.cs deleted file mode 100644 index 6bd60bc9..00000000 --- a/Src/Dlhis.Basic/Organization/Request/WeekNumberRequest.cs +++ /dev/null @@ -1,8 +0,0 @@ -using Kurisu.Core.DataAccess.Dto; - -namespace Dlhis.Basic.Organization.Request -{ - public class WeekNumberRequest : PageDto - { - } -} diff --git a/Src/Dlhis.Basic/Organization/Services/IGainfoOutSourceService.cs b/Src/Dlhis.Basic/Organization/Services/IGainfoOutSourceService.cs deleted file mode 100644 index a80d3843..00000000 --- a/Src/Dlhis.Basic/Organization/Services/IGainfoOutSourceService.cs +++ /dev/null @@ -1,12 +0,0 @@ -using Dlhis.Basic.Organization.Request; - -namespace Dlhis.Basic.Organization.Services; - -public interface IGainfoOutSourceService : IScopeDependency -{ - Task EntryAsync(GainfoOutEntryRequest request); - - Task ResignAsync(GainfoOutResignRequest request); - - Task EditAsync(GainfoOutEntryRequest request); -} \ No newline at end of file diff --git a/Src/Dlhis.Basic/Organization/Services/IGainfoOutsourceService.cs b/Src/Dlhis.Basic/Organization/Services/IGainfoOutsourceService.cs new file mode 100644 index 00000000..f1427fd9 --- /dev/null +++ b/Src/Dlhis.Basic/Organization/Services/IGainfoOutsourceService.cs @@ -0,0 +1,8 @@ +using Dlhis.Basic.Organization.Request; + +namespace Dlhis.Basic.Organization.Services; + +public interface IGainfoOutsourceService : IScopeDependency +{ + Task SaveAsync(GainfoOutsourceRequest request); +} \ No newline at end of file diff --git a/Src/Dlhis.Basic/Organization/Services/IGainfoPermissionService.cs b/Src/Dlhis.Basic/Organization/Services/IGainfoPermissionService.cs index f1feb8e5..e2fa9f2e 100644 --- a/Src/Dlhis.Basic/Organization/Services/IGainfoPermissionService.cs +++ b/Src/Dlhis.Basic/Organization/Services/IGainfoPermissionService.cs @@ -1,8 +1,8 @@ -using Dlhis.Basic.BusinessPlace.Response; -using Dlhis.Basic.Device.Response; +using Dlhis.Basic.Device.Response; using Dlhis.Basic.Organization.Request; using Dlhis.Basic.Organization.Response; -using Kurisu.Core.DataAccess.Dto; +using Dlhis.Basic.Places.Response; +using Kurisu.AspNetCore.DataAccess.Dto; namespace Dlhis.Basic.Organization.Services; diff --git a/Src/Dlhis.Basic/Organization/Services/IGainfoService.cs b/Src/Dlhis.Basic/Organization/Services/IGainfoService.cs index 43347e5c..f236ef7f 100644 --- a/Src/Dlhis.Basic/Organization/Services/IGainfoService.cs +++ b/Src/Dlhis.Basic/Organization/Services/IGainfoService.cs @@ -1,6 +1,6 @@ using Dlhis.Basic.Organization.Request; using Dlhis.Basic.Organization.Response; -using Kurisu.Core.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.Dto; namespace Dlhis.Basic.Organization.Services; @@ -19,4 +19,6 @@ public interface IGainfoService : IScopeDependency Task MigrationAsync(MigrationRequest request); Task CheckIdNoAndNameMatchAsync(GainfoCheckIdNoAndNameRequest request); + + Task ResignAsync(GainfoResignRequest request); } diff --git a/Src/Dlhis.Basic/Organization/Services/IWerkService.cs b/Src/Dlhis.Basic/Organization/Services/IWerkService.cs index ac34ff7b..baea8553 100644 --- a/Src/Dlhis.Basic/Organization/Services/IWerkService.cs +++ b/Src/Dlhis.Basic/Organization/Services/IWerkService.cs @@ -1,6 +1,6 @@ using Dlhis.Basic.Organization.Request; using Dlhis.Basic.Organization.Response; -using Kurisu.Core.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.Dto; namespace Dlhis.Basic.Organization.Services; diff --git a/Src/Dlhis.Basic/Organization/Services/Implements/DepartmentService.cs b/Src/Dlhis.Basic/Organization/Services/Implements/DepartmentService.cs index 8a8a510b..54647d5a 100644 --- a/Src/Dlhis.Basic/Organization/Services/Implements/DepartmentService.cs +++ b/Src/Dlhis.Basic/Organization/Services/Implements/DepartmentService.cs @@ -1,7 +1,7 @@ using Dlhis.Basic.Organization.Response; using Dlhis.Entity.Basic.Entity; using Dlhis.Sys.Api; -using Kurisu.SqlSugar.Services; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Services; using Mapster; namespace Dlhis.Basic.Organization.Services.Implements; diff --git a/Src/Dlhis.Basic/Organization/Services/Implements/GainfoCardService.cs b/Src/Dlhis.Basic/Organization/Services/Implements/GainfoCardService.cs index c9d3213e..8a826f5c 100644 --- a/Src/Dlhis.Basic/Organization/Services/Implements/GainfoCardService.cs +++ b/Src/Dlhis.Basic/Organization/Services/Implements/GainfoCardService.cs @@ -1,8 +1,8 @@ using Dlhis.Basic.Organization.Request; using Dlhis.Basic.Organization.Response; using Dlhis.Entity.Basic.Entity; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Services; using Kurisu.AspNetCore.Utils.Extensions; -using Kurisu.SqlSugar.Services; namespace Dlhis.Basic.Organization.Services.Implements; diff --git a/Src/Dlhis.Basic/Organization/Services/Implements/GainfoFaceService.cs b/Src/Dlhis.Basic/Organization/Services/Implements/GainfoFaceService.cs index c00b1641..0482febb 100644 --- a/Src/Dlhis.Basic/Organization/Services/Implements/GainfoFaceService.cs +++ b/Src/Dlhis.Basic/Organization/Services/Implements/GainfoFaceService.cs @@ -3,11 +3,11 @@ using Dlhis.Basic.Organization.Request; using Dlhis.Entity.Basic.Entity; using Dlhis.Entity.Basic.Enums; using Dlhis.Entity.Device.Enums; +using Kurisu.AspNetCore.Authentication.Abstractions; +using Kurisu.AspNetCore.CustomClass; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Services; using Kurisu.AspNetCore.Utils; using Kurisu.AspNetCore.Utils.Extensions; -using Kurisu.Core.CustomClass; -using Kurisu.Core.User.Abstractions; -using Kurisu.SqlSugar.Services; using Microsoft.AspNetCore.DataProtection; using Microsoft.AspNetCore.Mvc; diff --git a/Src/Dlhis.Basic/Organization/Services/Implements/GainfoGroupService.cs b/Src/Dlhis.Basic/Organization/Services/Implements/GainfoGroupService.cs index 3c00eeca..5c44750a 100644 --- a/Src/Dlhis.Basic/Organization/Services/Implements/GainfoGroupService.cs +++ b/Src/Dlhis.Basic/Organization/Services/Implements/GainfoGroupService.cs @@ -2,10 +2,10 @@ using Dlhis.Basic.Organization.Request; using Dlhis.Basic.Organization.Response; using Dlhis.Entity.Basic.Entity; +using Kurisu.AspNetCore.Authentication.Abstractions; +using Kurisu.AspNetCore.DataAccess.Entity; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Services; using Kurisu.AspNetCore.Utils.Extensions; -using Kurisu.Core.DataAccess.Entity; -using Kurisu.Core.User.Abstractions; -using Kurisu.SqlSugar.Services; using Mapster; namespace Dlhis.Basic.Organization.Services.Implements; diff --git a/Src/Dlhis.Basic/Organization/Services/Implements/GainfoOutSourceService.cs b/Src/Dlhis.Basic/Organization/Services/Implements/GainfoOutsourceService.cs similarity index 56% rename from Src/Dlhis.Basic/Organization/Services/Implements/GainfoOutSourceService.cs rename to Src/Dlhis.Basic/Organization/Services/Implements/GainfoOutsourceService.cs index 93bcca5d..ec027ec7 100644 --- a/Src/Dlhis.Basic/Organization/Services/Implements/GainfoOutSourceService.cs +++ b/Src/Dlhis.Basic/Organization/Services/Implements/GainfoOutsourceService.cs @@ -1,37 +1,57 @@ using Dlhis.Basic.Organization.Request; using Dlhis.Entity.Basic.Entity; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Services; using Kurisu.AspNetCore.Utils; using Kurisu.AspNetCore.Utils.Extensions; -using Kurisu.SqlSugar.Services; using Mapster; using SqlSugar; namespace Dlhis.Basic.Organization.Services.Implements; -public class GainfoOutSourceService : IGainfoOutSourceService +public class GainfoOutsourceService : IGainfoOutsourceService { private readonly IDbContext _dbContext; private readonly RedisCache _redisCache; - public GainfoOutSourceService(IDbContext dbContext, RedisCache redisCache) + public GainfoOutsourceService(IDbContext dbContext, RedisCache redisCache ) { _dbContext = dbContext; _redisCache = redisCache; } - public async Task EntryAsync(GainfoOutEntryRequest request) + public async Task SaveAsync(GainfoOutsourceRequest request) { - await SaveAsync(request); - } + await CheckIdNoDuplicate(request.IdNo); - public async Task ResignAsync(GainfoOutResignRequest request) - { - //todo 生成任务处理 - } + if (!request.Id.HasValue) + { + var entity = request.Adapt(); + entity.No = Guid.NewGuid().ToString(); + entity.Code = await GetOutSourceCodeAsync(); - public async Task EditAsync(GainfoOutEntryRequest request) - { - await SaveAsync(request); + await _dbContext.InsertAsync(entity); + await _dbContext.InsertAsync(new OutsourceEntity + { + Code = entity.Code, + Supplier = request.ExternalInfo.Supplier, + SapCode = request.ExternalInfo.SapCode, + SapPhone = request.ExternalInfo.SapPhone + }); + } + else + { + var entity = await _dbContext.Queryable().FirstAsync(x => x.Id == request.Id); + entity.ThrowIfNull("档案数据不存在"); + + var outsource = await _dbContext.Queryable().FirstAsync(x => x.Code == entity.Code); + (outsource == null).ThrowIfTrue("不可编辑非外包人员档案数据"); + + request.Adapt(entity); + request.ExternalInfo.Adapt(outsource); + + await _dbContext.UpdateAsync(entity); + await _dbContext.UpdateAsync(outsource); + } } @@ -41,45 +61,28 @@ public class GainfoOutSourceService : IGainfoOutSourceService { await using var handler = await _redisCache.LockAsync("gainfo:outsource:code-generate", expiry: TimeSpan.FromSeconds(3), retryInterval: TimeSpan.FromSeconds(1), retryCount: 3); handler.Acquired.ThrowIfFalse("生成虚拟工号失败"); - + int code; - var entity = await _dbContext.Queryable().OrderBy(x => x.Id, OrderByType.Desc).FirstAsync(); + var entity = await _dbContext.Queryable().OrderBy(x => x.Id, OrderByType.Desc).FirstAsync(); if (entity == null) { code = 1; } else { - code = int.Parse(entity.Code.Replace("LS", "").Replace("0", "")) + 1; + code = int.Parse(entity.Code.Replace("LS", "").TrimStart('0')) + 1; } return "LS" + code.ToString().PadLeft(6, '0'); } - private async Task SaveAsync(GainfoOutEntryRequest request) + /// + /// 检查证件号重复 + /// + /// + private async Task CheckIdNoDuplicate(string idNo) { - if (!request.Id.HasValue) - { - var entity = request.Adapt(); - entity.No = Guid.NewGuid().ToString(); - entity.Code = await GetOutSourceCodeAsync(); - - await _dbContext.InsertAsync(entity); - await _dbContext.InsertAsync(new OutSourceEntity - { - Code = entity.Code - }); - } - else - { - var entity = await _dbContext.Queryable().FirstAsync(x => x.Id == request.Id); - entity.ThrowIfNull("档案数据不存在"); - - (await _dbContext.Queryable().AnyAsync(x => x.Code == entity.Code)).ThrowIfFalse("不可编辑非外包人员档案数据"); - - request.Adapt(entity); - - await _dbContext.UpdateAsync(entity); - } + var exists = await _dbContext.Queryable().Where(x => x.IdNo == idNo).AnyAsync(); + exists.ThrowIfTrue($"证件号{idNo}重复"); } } \ No newline at end of file diff --git a/Src/Dlhis.Basic/Organization/Services/Implements/GainfoPermissionService.cs b/Src/Dlhis.Basic/Organization/Services/Implements/GainfoPermissionService.cs index 56e5ebb0..37724450 100644 --- a/Src/Dlhis.Basic/Organization/Services/Implements/GainfoPermissionService.cs +++ b/Src/Dlhis.Basic/Organization/Services/Implements/GainfoPermissionService.cs @@ -1,18 +1,18 @@ -using Dlhis.Basic.BusinessPlace.Response; -using Dlhis.Basic.Device.Response; +using Dlhis.Basic.Device.Response; using Dlhis.Basic.Device.Services; using Dlhis.Basic.Organization.Request; using Dlhis.Basic.Organization.Response; +using Dlhis.Basic.Places.Response; using Dlhis.Entity.Basic.Entity; using Dlhis.Entity.Canteen.Entities; using Dlhis.Entity.Canteen.Enums; using Dlhis.Entity.Device.Entities; using Dlhis.Entity.Device.Enums; using Dlhis.Entity.Sys.Enums; +using Kurisu.AspNetCore.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Services; using Kurisu.AspNetCore.Utils.Extensions; -using Kurisu.Core.DataAccess.Dto; -using Kurisu.SqlSugar.Extensions; -using Kurisu.SqlSugar.Services; using SqlSugar; namespace Dlhis.Basic.Organization.Services.Implements; @@ -33,8 +33,8 @@ public class GainfoPermissionService : IGainfoPermissionService public async Task> GetPlaceByGainfoAsync(DeviceAssRequest request) { var gainfo = await _gainfoStore.Queryable() - .Where(x => x.No == request.UserNo) - .FirstAsync(); + .Where(x => x.No == request.UserNo) + .FirstAsync(); if (gainfo == null) { @@ -53,26 +53,26 @@ public class GainfoPermissionService : IGainfoPermissionService .Where(x => deviceCodes.Contains(x.Code)) .Where((x, dr) => dr.BusinessPlaceCode.HasValue) .Select((x, dr, place, ps, s) => new BusinessPlaceResponse - { - Id = place.Id, - Code = place.Code, - Status = place.Status, - Name = place.Name, - Catalog = place.Catalog, - CustomCode = place.CustomCode, - Source = place.Source, + { + Id = place.Id, + Code = place.Code, + Status = place.Status, + Name = place.Name, + Catalog = place.Catalog, + CustomCode = place.CustomCode, + Source = place.Source, - ShiftCode = s.Code, - ShiftName = s.Name - }) - .Distinct() - .ToPageListAsync(request); + ShiftCode = s.Code, + ShiftName = s.Name + }) + .Distinct() + .ToPageListAsync(request); } public async Task> GetDevicesUnderGroupByUserNoAsync(string userNo, Guid deviceGroupCode) { var deviceGroups = await _dbContext.Queryable().ToListAsync(); - var currentGroup = deviceGroups.Where(x => x.Code == deviceGroupCode).FirstOrDefault(); + var currentGroup = deviceGroups.FirstOrDefault(x => x.Code == deviceGroupCode); if (currentGroup == null) { return new List(); @@ -87,46 +87,46 @@ public class GainfoPermissionService : IGainfoPermissionService foreach (var groupcode in groups) { var nos = await _dbContext.Queryable() - .LeftJoin((x, d) => x.DeviceCode == d.Code) - .Where(x => groupcode == x.GroupCode) - .Select((x, d) => d.UniqueNo) - .ToListAsync(); + .LeftJoin((x, d) => x.DeviceCode == d.Code) + .Where(x => groupcode == x.GroupCode) + .Select((x, d) => d.UniqueNo) + .ToListAsync(); var page = await _dbContext.Queryable() - .LeftJoin((d, dt) => d.TemplateCode == dt.Code) - .LeftJoin((d, dt, dr) => d.UniqueNo == dr.DeviceUniqueNo) - .LeftJoin((d, dt, dr, bp) => dr.BusinessPlaceCode == bp.Code) - .Where(d => nos.Contains(d.UniqueNo)) - .Select((d, dt, dr, bp) => new DevicePageResponse - { - FuncsStr = d.Funcs.ToString(), - Brand = dt.Brand, - Type = d.Type, - BusinessPlaceCode = bp.Code, - BusinessPlaceName = bp.Name, - LastHeartbeatTime = dr.LastHeartbeatTime, - UniqueNo = d.UniqueNo, - Supplier = d.Supplier, - DeployPlace = d.DeployPlace, - DeployPosition = d.DeployPosition, - DeployDirection = d.DeployDirection, - TemplateCode = dt.Code, - ConnectionInfo = d.ConnectionInfo, - Enable = d.Enable, - }) - .ToListAsync(); + .LeftJoin((d, dt) => d.TemplateCode == dt.Code) + .LeftJoin((d, dt, dr) => d.UniqueNo == dr.DeviceUniqueNo) + .LeftJoin((d, dt, dr, bp) => dr.BusinessPlaceCode == bp.Code) + .Where(d => nos.Contains(d.UniqueNo)) + .Select((d, dt, dr, bp) => new DevicePageResponse + { + FuncsStr = d.Funcs.ToString(), + Brand = dt.Brand, + Type = d.Type, + BusinessPlaceCode = bp.Code, + BusinessPlaceName = bp.Name, + LastHeartbeatTime = dr.LastHeartbeatTime, + UniqueNo = d.UniqueNo, + Supplier = d.Supplier, + DeployPlace = d.DeployPlace, + DeployPosition = d.DeployPosition, + DeployDirection = d.DeployDirection, + TemplateCode = dt.Code, + ConnectionInfo = d.ConnectionInfo, + Enable = d.Enable, + }) + .ToListAsync(); var deviceUniqueNos = page.Select(x => x.UniqueNo).ToList(); var balanceInfos = await _dbContext.Queryable().Where(x => x.Type == BalanceRecordTypeEnumType.Out) - .Where(x => deviceUniqueNos.Contains(x.DeviceUniqueNo)) - .Select(x => new - { - x.DeviceUniqueNo, - Amount = SqlFunc.AggregateSum(x.Amount), - UserCount = SqlFunc.AggregateDistinctCount(x.UserCode) - }) - .GroupBy(x => x.DeviceUniqueNo) - .ToListAsync(); + .Where(x => deviceUniqueNos.Contains(x.DeviceUniqueNo)) + .Select(x => new + { + x.DeviceUniqueNo, + Amount = SqlFunc.AggregateSum(x.Amount), + UserCount = SqlFunc.AggregateDistinctCount(x.UserCode) + }) + .GroupBy(x => x.DeviceUniqueNo) + .ToListAsync(); page.ForEach(device => { @@ -145,6 +145,7 @@ public class GainfoPermissionService : IGainfoPermissionService }; lst.Add(res); } + return lst; } @@ -153,21 +154,21 @@ public class GainfoPermissionService : IGainfoPermissionService var ids = await _devicePermissionService.GetAssignDeviceCodesAsync(request.UserNo); var page = await _dbContext.Queryable() - .LeftJoin((d, dt) => d.TemplateCode == dt.Code) - .LeftJoin((d, dt, dr) => d.UniqueNo == dr.DeviceUniqueNo) - .LeftJoin((d, dt, dr, bp) => dr.BusinessPlaceCode == bp.Code) - .WhereIF(request.DeviceType.HasValue, d => d.Type == request.DeviceType) - .Where(d => ids.Contains(d.Code)) - .Select((d, dt, dr, bp) => new DevicePageResponse - { - FuncsStr = d.Funcs.ToString(), - Brand = dt.Brand, - Type = d.Type, - BusinessPlaceCode = bp.Code, - BusinessPlaceName = bp.Name, - LastHeartbeatTime = dr.LastHeartbeatTime - }, true) - .ToPageListAsync(request); + .LeftJoin((d, dt) => d.TemplateCode == dt.Code) + .LeftJoin((d, dt, dr) => d.UniqueNo == dr.DeviceUniqueNo) + .LeftJoin((d, dt, dr, bp) => dr.BusinessPlaceCode == bp.Code) + .WhereIF(request.DeviceType.HasValue, d => d.Type == request.DeviceType) + .Where(d => ids.Contains(d.Code)) + .Select((d, dt, dr, bp) => new DevicePageResponse + { + FuncsStr = d.Funcs.ToString(), + Brand = dt.Brand, + Type = d.Type, + BusinessPlaceCode = bp.Code, + BusinessPlaceName = bp.Name, + LastHeartbeatTime = dr.LastHeartbeatTime + }, true) + .ToPageListAsync(request); var deviceUniqueNos = page.Data.Select(x => x.UniqueNo).ToList(); @@ -193,7 +194,6 @@ public class GainfoPermissionService : IGainfoPermissionService }); return page; - } @@ -206,8 +206,8 @@ public class GainfoPermissionService : IGainfoPermissionService if (gainfo == null && request.IsLeave) { gainfo = await _dbContext.Queryable().AS("GainfoLeave") - .Where(x => x.No == request.UserNo) - .SingleAsync(); + .Where(x => x.No == request.UserNo) + .SingleAsync(); if (gainfo != null) { @@ -217,23 +217,24 @@ public class GainfoPermissionService : IGainfoPermissionService gainfo.ThrowIfNull("档案数据不存在"); + //获取人员的设备权限 var deviceCodes = await _devicePermissionService.GetAssignDeviceCodesAsync(request.UserNo); var devices = await _dbContext.Queryable().Where(x => deviceCodes.Contains(x.Code)).ToListAsync(); var tasks = devices.Select(x => new DeviceTaskEntity { - UserId = gainfo.Id, - CancellationId = 0, - Version = 0, + UserId = gainfo!.Id, + Source = null, DeviceUniqueNo = x.UniqueNo, Status = DeviceTaskStatusEnumType.Wait, UserNo = request.UserNo, - Type = request.IsLeave ? DeviceTaskEnumType.Delete : DeviceTaskEnumType.Add, + Type = request.IsLeave + ? DeviceTaskEnumType.Delete + : DeviceTaskEnumType.Add, DeviceType = x.Type, TenantId = gainfo.Factory, Priority = 10 - }) - .ToList(); + }).ToList(); await _dbContext.InsertAsync(tasks); } @@ -258,4 +259,4 @@ public class GainfoPermissionService : IGainfoPermissionService yield return current.Code; } -} +} \ No newline at end of file diff --git a/Src/Dlhis.Basic/Organization/Services/Implements/GainfoService.cs b/Src/Dlhis.Basic/Organization/Services/Implements/GainfoService.cs index 7b9e22b8..f78c1ded 100644 --- a/Src/Dlhis.Basic/Organization/Services/Implements/GainfoService.cs +++ b/Src/Dlhis.Basic/Organization/Services/Implements/GainfoService.cs @@ -5,11 +5,11 @@ using Dlhis.Entity.Basic.Enums; using Dlhis.Scheduled.Api; using Dlhis.Scheduled.Api.Request; using Dlhis.Sys.Api; +using Kurisu.AspNetCore.Authentication.Abstractions; +using Kurisu.AspNetCore.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Services; using Kurisu.AspNetCore.Utils.Extensions; -using Kurisu.Core.DataAccess.Dto; -using Kurisu.Core.User.Abstractions; -using Kurisu.SqlSugar.Extensions; -using Kurisu.SqlSugar.Services; using Microsoft.AspNetCore.DataProtection; using SqlSugar; @@ -23,6 +23,7 @@ public class GainfoService : IGainfoService private readonly ICurrentUser _currentUser; private readonly ITenantApi _tenantApi; private readonly IHangfireApi _hangfireApi; + private readonly IGainfoPermissionService _gainfoPermissionService; private readonly ILogger _logger; public GainfoService(IGainfoStore gainfoStore, @@ -31,6 +32,7 @@ public class GainfoService : IGainfoService ICurrentUser currentUser, ITenantApi tenantApi, IHangfireApi hangfireApi, + IGainfoPermissionService gainfoPermissionService, ILogger logger) { _gainfoStore = gainfoStore; @@ -39,6 +41,7 @@ public class GainfoService : IGainfoService _currentUser = currentUser; _tenantApi = tenantApi; _hangfireApi = hangfireApi; + _gainfoPermissionService = gainfoPermissionService; _logger = logger; } @@ -55,18 +58,17 @@ public class GainfoService : IGainfoService var where = LinqExpressionExtensions.False(); foreach (var item in request.DepartmentSelections) { - var depts = await GetRecursionDepartmentNosAsync(item.DepartmentNos); - if (depts.Any()) - where = where.Or(gainfo => gainfo.Factory == item.Tenant && depts.Contains(gainfo.DepartmentNo)); - else - where = where.Or(gainfo => gainfo.Factory == item.Tenant); + var searchDepartments = await GetRecursionDepartmentNosAsync(item.DepartmentNos); + where = searchDepartments.Any() + ? where.Or(gainfo => gainfo.Factory == item.Tenant && searchDepartments.Contains(gainfo.DepartmentNo)) + : where.Or(gainfo => gainfo.Factory == item.Tenant); } var page = await _gainfoStore.Queryable(request.Status) .WhereIF(request.DepartmentSelections.IsPresent(), where) .WhereIF(request.DepartmentSelections.IsEmpty(), gainfo => gainfo.Factory == currentTenantId) - .WhereIF(request.IsOutSource.HasValue && request.IsOutSource.Value, gainfo => SqlFunc.Subqueryable().Where(x => x.Code == gainfo.Code).Any()) - .WhereIF(request.IsOutSource.HasValue && !request.IsOutSource.Value, gainfo => SqlFunc.Subqueryable().Where(x => x.Code == gainfo.Code).NotAny()) + .WhereIF(request.IsOutsource.HasValue && request.IsOutsource.Value, gainfo => SqlFunc.Subqueryable().Where(x => x.Code == gainfo.Code).Any()) + .WhereIF(request.IsOutsource.HasValue && !request.IsOutsource.Value, gainfo => SqlFunc.Subqueryable().Where(x => x.Code == gainfo.Code).NotAny()) .WhereIF(request.Search.IsPresent(), gainfo => gainfo.Name.Contains(request.Search) || gainfo.Code == request.Search @@ -106,7 +108,6 @@ public class GainfoService : IGainfoService } var gainfo = await _gainfoStore.Queryable().Where(x => x.Code == code).SingleAsync(); - if (gainfo == null) { //开启同步处理 @@ -132,21 +133,21 @@ public class GainfoService : IGainfoService { Balance = mealUser.Balance } - }) - .FirstAsync(); + }).SingleAsync(); if (info != null) { try { var tenantResult = await _tenantApi.GetTenantByCodeAsync(info.Factory); - if (tenantResult != null && tenantResult.Data != null) + if (tenantResult is { Data: not null }) { info.Factory = tenantResult.Data.Name; } } catch (Exception) { + // ignored } } @@ -167,6 +168,39 @@ public class GainfoService : IGainfoService return protector.Protect(request.IdNo); } + + public async Task ResignAsync(GainfoResignRequest request) + { + var gainfo = await _dbContext.Queryable().FirstAsync(x => x.Id == request.Id); + gainfo.ThrowIfNull("档案数据不存在"); + + if (request.IsOutsource) + { + var outsource = await _dbContext.Queryable().FirstAsync(x => x.Code == gainfo.Code); + (outsource == null).ThrowIfTrue("非外包人员不可手动离职"); + } + + await _gainfoPermissionService.ResetPermissionsAsync(new GainfoPermissionResetRequest + { + UserNo = gainfo.No, + IsLeave = true + }); + + //先写入离职表 + gainfo.IdentityUserId = (int)gainfo.Id; //记录原始id + gainfo.ResignationDate = request.Date; + gainfo.Remark = request.Reason; + gainfo.Id = 0; + + if (!await _dbContext.Queryable().AS("GainfoLeave").AnyAsync(x => x.Code == gainfo.Code)) + { + await _dbContext.Client.Insertable(gainfo).AS("GainfoLeave").ExecuteCommandAsync(); + } + + gainfo.Id = gainfo.IdentityUserId; + await _dbContext.DeleteReallyAsync(gainfo); + } + /// /// 档案列表 /// @@ -192,6 +226,7 @@ public class GainfoService : IGainfoService DepartmentName = de.Name, Address = ga.Address, }).ToPageListAsync(request); + return page; } diff --git a/Src/Dlhis.Basic/Organization/Services/Implements/GainfoStore.cs b/Src/Dlhis.Basic/Organization/Services/Implements/GainfoStore.cs index 76d22e58..4f260124 100644 --- a/Src/Dlhis.Basic/Organization/Services/Implements/GainfoStore.cs +++ b/Src/Dlhis.Basic/Organization/Services/Implements/GainfoStore.cs @@ -1,7 +1,7 @@ using System.Reflection; using Dlhis.Entity.Basic.Entity; using Dlhis.Entity.Basic.Enums; -using Kurisu.SqlSugar.Services; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Services; using SqlSugar; namespace Dlhis.Basic.Organization.Services.Implements; diff --git a/Src/Dlhis.Basic/Organization/Services/Implements/WerkService.cs b/Src/Dlhis.Basic/Organization/Services/Implements/WerkService.cs index 45f9d267..3b4fcab1 100644 --- a/Src/Dlhis.Basic/Organization/Services/Implements/WerkService.cs +++ b/Src/Dlhis.Basic/Organization/Services/Implements/WerkService.cs @@ -1,10 +1,10 @@ using Dlhis.Basic.Organization.Request; using Dlhis.Basic.Organization.Response; using Dlhis.Entity.Basic.Entity; +using Kurisu.AspNetCore.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Services; using Kurisu.AspNetCore.Utils.Extensions; -using Kurisu.Core.DataAccess.Dto; -using Kurisu.SqlSugar.Extensions; -using Kurisu.SqlSugar.Services; using Mapster; namespace Dlhis.Basic.Organization.Services.Implements; diff --git a/Src/Dlhis.Basic/Packs/SqlSugarPack.cs b/Src/Dlhis.Basic/Packs/SqlSugarPack.cs index 9df2950d..5d87d2d9 100644 --- a/Src/Dlhis.Basic/Packs/SqlSugarPack.cs +++ b/Src/Dlhis.Basic/Packs/SqlSugarPack.cs @@ -1,8 +1,8 @@ using Dlhis.Entity.Basic.Entity; using Kurisu.AspNetCore; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Services; using Kurisu.AspNetCore.Startup; -using Kurisu.SqlSugar.Extensions; -using Kurisu.SqlSugar.Services; using SqlSugar; namespace Dlhis.Basic.Packs; @@ -58,16 +58,16 @@ public class SqlSugarPack : BaseAppPack { using var scope = app.ApplicationServices.CreateScope(); var db = scope.ServiceProvider.GetService(); - var tables = App.ActiveTyps.Where(x => x.IsDefined(typeof(SugarTable), false)) - .Where(x => !x.IsDefined(typeof(SkipScanAttribute), false)) - .ToArray(); - - db.Client.DbMaintenance.CreateDatabase(); - db.Client.CodeFirst.InitTables(tables); - - var faceDb = db.ChangeDb("face"); - faceDb.Client.DbMaintenance.CreateDatabase(); - faceDb.Client.CodeFirst.InitTables(); + // var tables = App.ActiveTyps.Where(x => x.IsDefined(typeof(SugarTable), false)) + // .Where(x => !x.IsDefined(typeof(SkipScanAttribute), false)) + // .ToArray(); + // + // db.Client.DbMaintenance.CreateDatabase(); + // db.Client.CodeFirst.InitTables(tables); + // + // var faceDb = db.ChangeDb("face"); + // faceDb.Client.DbMaintenance.CreateDatabase(); + // faceDb.Client.CodeFirst.InitTables(); } } } \ No newline at end of file diff --git a/Src/Dlhis.Basic/Places/Controllers/BookingAddressController.cs b/Src/Dlhis.Basic/Places/Controllers/BookingAddressController.cs index 3f9eba2f..48559337 100644 --- a/Src/Dlhis.Basic/Places/Controllers/BookingAddressController.cs +++ b/Src/Dlhis.Basic/Places/Controllers/BookingAddressController.cs @@ -2,11 +2,10 @@ using Dlhis.Basic.Places.Request; using Dlhis.Basic.Places.Response; using Dlhis.Basic.Places.Services; +using Kurisu.AspNetCore.DataAccess.Dto; using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop; -using Kurisu.Core.DataAccess.Dto; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; -using Org.BouncyCastle.Asn1.Ocsp; namespace Dlhis.Basic.Places.Controllers; diff --git a/Src/Dlhis.Basic/Places/Controllers/BusinessPlacePermissionsController.cs b/Src/Dlhis.Basic/Places/Controllers/BusinessPlacePermissionsController.cs index e5e7e0c0..04544f98 100644 --- a/Src/Dlhis.Basic/Places/Controllers/BusinessPlacePermissionsController.cs +++ b/Src/Dlhis.Basic/Places/Controllers/BusinessPlacePermissionsController.cs @@ -1,12 +1,12 @@ -using Dlhis.Basic.Places.Request; -using Dlhis.Basic.BusinessPlace.Response; -using Dlhis.Basic.BusinessPlace.Services; -using Kurisu.Core.DataAccess.Dto; +using Dlhis.Basic.Places.Dto; +using Dlhis.Basic.Places.Request; +using Dlhis.Basic.Places.Response; +using Dlhis.Basic.Places.Services; +using Kurisu.AspNetCore.DataAccess.Dto; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; -using Dlhis.Basic.Places.Dtos; -namespace Dlhis.Basic.BusinessPlace.Controllers; +namespace Dlhis.Basic.Places.Controllers; /// /// 营业点权限管理 diff --git a/Src/Dlhis.Basic/Places/Controllers/BusinessPlacesController.cs b/Src/Dlhis.Basic/Places/Controllers/BusinessPlacesController.cs index 11a0dd6e..49600a9a 100644 --- a/Src/Dlhis.Basic/Places/Controllers/BusinessPlacesController.cs +++ b/Src/Dlhis.Basic/Places/Controllers/BusinessPlacesController.cs @@ -1,13 +1,13 @@ -using Dlhis.Basic.Places.Request; -using Dlhis.Basic.BusinessPlace.Response; -using Dlhis.Basic.BusinessPlace.Services; -using Dlhis.Basic.BusinessShift.Services; +using Dlhis.Basic.BusinessShift.Services; +using Dlhis.Basic.Places.Request; +using Dlhis.Basic.Places.Response; +using Dlhis.Basic.Places.Services; +using Kurisu.AspNetCore.DataAccess.Dto; using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop; -using Kurisu.Core.DataAccess.Dto; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; -namespace Dlhis.Basic.BusinessPlace.Controllers; +namespace Dlhis.Basic.Places.Controllers; /// /// 营业点 diff --git a/Src/Dlhis.Basic/Places/Dtos/BusinessPlaceDto.cs b/Src/Dlhis.Basic/Places/Dto/BusinessPlaceDto.cs similarity index 73% rename from Src/Dlhis.Basic/Places/Dtos/BusinessPlaceDto.cs rename to Src/Dlhis.Basic/Places/Dto/BusinessPlaceDto.cs index 1f8a04cd..f7c3980c 100644 --- a/Src/Dlhis.Basic/Places/Dtos/BusinessPlaceDto.cs +++ b/Src/Dlhis.Basic/Places/Dto/BusinessPlaceDto.cs @@ -1,4 +1,4 @@ -namespace Dlhis.Basic.Places.Dtos; +namespace Dlhis.Basic.Places.Dto; public class BusinessPlaceDto { diff --git a/Src/Dlhis.Basic/Places/Request/BookingAddressPageRequest.cs b/Src/Dlhis.Basic/Places/Request/BookingAddressPageRequest.cs index b08d1e3e..4a93b9e8 100644 --- a/Src/Dlhis.Basic/Places/Request/BookingAddressPageRequest.cs +++ b/Src/Dlhis.Basic/Places/Request/BookingAddressPageRequest.cs @@ -1,4 +1,4 @@ -using Kurisu.Core.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.Dto; namespace Dlhis.Basic.Places.Request; diff --git a/Src/Dlhis.Basic/Places/Request/BusinessPlaceGetByCodeRequest.cs b/Src/Dlhis.Basic/Places/Request/BusinessPlaceGetByCodeRequest.cs index 53ef9a11..a8087d14 100644 --- a/Src/Dlhis.Basic/Places/Request/BusinessPlaceGetByCodeRequest.cs +++ b/Src/Dlhis.Basic/Places/Request/BusinessPlaceGetByCodeRequest.cs @@ -1,5 +1,5 @@ -using Kurisu.Core.DataAccess.Dto; -using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations; +using Kurisu.AspNetCore.DataAccess.Dto; namespace Dlhis.Basic.Places.Request { @@ -11,4 +11,4 @@ namespace Dlhis.Basic.Places.Request [Required(ErrorMessage = "营业点号不能为空")] public string Code { get; set; } } -} +} \ No newline at end of file diff --git a/Src/Dlhis.Basic/Places/Request/BusinessPlacePageRequest.cs b/Src/Dlhis.Basic/Places/Request/BusinessPlacePageRequest.cs index 7fe65972..df90c191 100644 --- a/Src/Dlhis.Basic/Places/Request/BusinessPlacePageRequest.cs +++ b/Src/Dlhis.Basic/Places/Request/BusinessPlacePageRequest.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; using Dlhis.Entity.Canteen.Enums; -using Kurisu.Core.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.Dto; namespace Dlhis.Basic.Places.Request; diff --git a/Src/Dlhis.Basic/Places/Request/BusinessPlacePermissionPageRequest.cs b/Src/Dlhis.Basic/Places/Request/BusinessPlacePermissionPageRequest.cs index f3cdc557..e57b7c11 100644 --- a/Src/Dlhis.Basic/Places/Request/BusinessPlacePermissionPageRequest.cs +++ b/Src/Dlhis.Basic/Places/Request/BusinessPlacePermissionPageRequest.cs @@ -1,4 +1,4 @@ -using Kurisu.Core.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.Dto; namespace Dlhis.Basic.Places.Request; diff --git a/Src/Dlhis.Basic/Places/Response/BusinessPlaceListResponse.cs b/Src/Dlhis.Basic/Places/Response/BusinessPlaceListResponse.cs index e1ad436b..ddabae13 100644 --- a/Src/Dlhis.Basic/Places/Response/BusinessPlaceListResponse.cs +++ b/Src/Dlhis.Basic/Places/Response/BusinessPlaceListResponse.cs @@ -1,6 +1,4 @@ -using Dlhis.Entity.Canteen.Enums; - -namespace Dlhis.Basic.BusinessPlace.Response; +namespace Dlhis.Basic.Places.Response; public class BusinessPlaceListResponse : BusinessPlaceResponse { diff --git a/Src/Dlhis.Basic/Places/Response/BusinessPlacePermissionPageResponse.cs b/Src/Dlhis.Basic/Places/Response/BusinessPlacePermissionPageResponse.cs index 9a1273e2..860326c4 100644 --- a/Src/Dlhis.Basic/Places/Response/BusinessPlacePermissionPageResponse.cs +++ b/Src/Dlhis.Basic/Places/Response/BusinessPlacePermissionPageResponse.cs @@ -1,4 +1,4 @@ -namespace Dlhis.Basic.BusinessPlace.Response; +namespace Dlhis.Basic.Places.Response; public class BusinessPlacePermissionPageResponse { diff --git a/Src/Dlhis.Basic/Places/Response/BusinessPlaceResponse.cs b/Src/Dlhis.Basic/Places/Response/BusinessPlaceResponse.cs index acc4bf9f..a1da844a 100644 --- a/Src/Dlhis.Basic/Places/Response/BusinessPlaceResponse.cs +++ b/Src/Dlhis.Basic/Places/Response/BusinessPlaceResponse.cs @@ -1,7 +1,7 @@ using Dlhis.Entity.Canteen.Enums; using Kurisu.AspNetCore.Utils.Extensions; -namespace Dlhis.Basic.BusinessPlace.Response; +namespace Dlhis.Basic.Places.Response; public class BusinessPlaceResponse { diff --git a/Src/Dlhis.Basic/Places/Response/BusinessPlaceWithShiftResponse.cs b/Src/Dlhis.Basic/Places/Response/BusinessPlaceWithShiftResponse.cs index 9e346027..8866908b 100644 --- a/Src/Dlhis.Basic/Places/Response/BusinessPlaceWithShiftResponse.cs +++ b/Src/Dlhis.Basic/Places/Response/BusinessPlaceWithShiftResponse.cs @@ -1,6 +1,6 @@ using Dlhis.Basic.BusinessShift.Response; -namespace Dlhis.Basic.BusinessPlace.Response; +namespace Dlhis.Basic.Places.Response; public class BusinessPlaceWithShiftResponse { diff --git a/Src/Dlhis.Basic/Places/Response/DeviceCodeNameDetail.cs b/Src/Dlhis.Basic/Places/Response/DeviceCodeNameDetail.cs index 0841c315..2ccfd906 100644 --- a/Src/Dlhis.Basic/Places/Response/DeviceCodeNameDetail.cs +++ b/Src/Dlhis.Basic/Places/Response/DeviceCodeNameDetail.cs @@ -1,4 +1,4 @@ -namespace Dlhis.Basic.BusinessPlace.Response +namespace Dlhis.Basic.Places.Response { public class DeviceCodeNameDetail { diff --git a/Src/Dlhis.Basic/Places/Services/IBookingAddressService.cs b/Src/Dlhis.Basic/Places/Services/IBookingAddressService.cs index 9e558f2d..8ea13886 100644 --- a/Src/Dlhis.Basic/Places/Services/IBookingAddressService.cs +++ b/Src/Dlhis.Basic/Places/Services/IBookingAddressService.cs @@ -1,6 +1,6 @@ using Dlhis.Basic.Places.Request; using Dlhis.Basic.Places.Response; -using Kurisu.Core.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.Dto; namespace Dlhis.Basic.Places.Services; diff --git a/Src/Dlhis.Basic/Places/Services/IBusinessPlacePermissionsService.cs b/Src/Dlhis.Basic/Places/Services/IBusinessPlacePermissionsService.cs index 5d069b56..df5236a7 100644 --- a/Src/Dlhis.Basic/Places/Services/IBusinessPlacePermissionsService.cs +++ b/Src/Dlhis.Basic/Places/Services/IBusinessPlacePermissionsService.cs @@ -1,9 +1,9 @@ -using Dlhis.Basic.Places.Request; -using Dlhis.Basic.BusinessPlace.Response; -using Kurisu.Core.DataAccess.Dto; -using Dlhis.Basic.Places.Dtos; +using Dlhis.Basic.Places.Dto; +using Dlhis.Basic.Places.Request; +using Dlhis.Basic.Places.Response; +using Kurisu.AspNetCore.DataAccess.Dto; -namespace Dlhis.Basic.BusinessPlace.Services; +namespace Dlhis.Basic.Places.Services; public interface IBusinessPlacePermissionsService : IScopeDependency { diff --git a/Src/Dlhis.Basic/Places/Services/IBusinessPlaceService.cs b/Src/Dlhis.Basic/Places/Services/IBusinessPlaceService.cs index ce09d910..c711a6ba 100644 --- a/Src/Dlhis.Basic/Places/Services/IBusinessPlaceService.cs +++ b/Src/Dlhis.Basic/Places/Services/IBusinessPlaceService.cs @@ -1,8 +1,8 @@ using Dlhis.Basic.Places.Request; -using Dlhis.Basic.BusinessPlace.Response; -using Kurisu.Core.DataAccess.Dto; +using Dlhis.Basic.Places.Response; +using Kurisu.AspNetCore.DataAccess.Dto; -namespace Dlhis.Basic.BusinessPlace.Services; +namespace Dlhis.Basic.Places.Services; public interface IBusinessPlaceService : IScopeDependency { diff --git a/Src/Dlhis.Basic/Places/Services/Implements/BookingAddressService.cs b/Src/Dlhis.Basic/Places/Services/Implements/BookingAddressService.cs index c3fab27c..c86e99d5 100644 --- a/Src/Dlhis.Basic/Places/Services/Implements/BookingAddressService.cs +++ b/Src/Dlhis.Basic/Places/Services/Implements/BookingAddressService.cs @@ -1,10 +1,10 @@ using Dlhis.Basic.Places.Request; using Dlhis.Basic.Places.Response; using Dlhis.Entity.Basic.Entity; +using Kurisu.AspNetCore.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Services; using Kurisu.AspNetCore.Utils.Extensions; -using Kurisu.Core.DataAccess.Dto; -using Kurisu.SqlSugar.Extensions; -using Kurisu.SqlSugar.Services; using Mapster; namespace Dlhis.Basic.Places.Services.Implements; @@ -46,8 +46,8 @@ public class BookingAddressService : IBookingAddressService public async Task> GetAllAddressAsync(string tenant) { return await _dbContext.Queryable() - .Where(x => x.TenantId == tenant) - .Select() - .ToListAsync(); + .Where(x => x.TenantId == tenant) + .Select() + .ToListAsync(); } -} +} \ No newline at end of file diff --git a/Src/Dlhis.Basic/Places/Services/Implements/BusinessPlacePermissionsService.cs b/Src/Dlhis.Basic/Places/Services/Implements/BusinessPlacePermissionsService.cs index 6b0cd8e2..b1354be1 100644 --- a/Src/Dlhis.Basic/Places/Services/Implements/BusinessPlacePermissionsService.cs +++ b/Src/Dlhis.Basic/Places/Services/Implements/BusinessPlacePermissionsService.cs @@ -1,17 +1,15 @@ -using Dlhis.Basic.Places.Request; -using Dlhis.Basic.BusinessPlace.Response; +using System.Security.Claims; +using Dlhis.Basic.Places.Dto; +using Dlhis.Basic.Places.Request; +using Dlhis.Basic.Places.Response; using Dlhis.Entity.Basic.Entity; -using Kurisu.Core.DataAccess.Dto; -using Kurisu.Core.User.Abstractions; -using Kurisu.SqlSugar.Services; -using Mapster; -using Dlhis.Basic.Places.Dtos; -using Kurisu.SqlSugar.Extensions; using Dlhis.Sys.Api; -using Microsoft.AspNetCore.Mvc; -using System.Security.Claims; +using Kurisu.AspNetCore.Authentication.Abstractions; +using Kurisu.AspNetCore.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Services; -namespace Dlhis.Basic.BusinessPlace.Services.Implements; +namespace Dlhis.Basic.Places.Services.Implements; public class BusinessPlacePermissionsService : IBusinessPlacePermissionsService { @@ -41,10 +39,7 @@ public class BusinessPlacePermissionsService : IBusinessPlacePermissionsService var usersResult = await _userApi.GetUserByIdsAsync(page.Data.Select(x => x.UserId).Distinct().ToList()); var users = usersResult.Data; - page.Data.ForEach(item => - { - item.UserName = users.FirstOrDefault(x => x.Id == item.UserId)?.UserName; - }); + page.Data.ForEach(item => { item.UserName = users.FirstOrDefault(x => x.Id == item.UserId)?.UserName; }); return page; } @@ -59,16 +54,16 @@ public class BusinessPlacePermissionsService : IBusinessPlacePermissionsService if (isAdmin) { codes = await _dbContext.Queryable() - .Select(x => x.Code) - .ToListAsync(); + .Select(x => x.Code) + .ToListAsync(); } else { codes = await _dbContext.Queryable() - .Where(x => x.ManagerUserId == userId) - .Select(x => x.BusinessPlaceCode) - .Distinct() - .ToListAsync(); + .Where(x => x.ManagerUserId == userId) + .Select(x => x.BusinessPlaceCode) + .Distinct() + .ToListAsync(); } @@ -80,11 +75,9 @@ public class BusinessPlacePermissionsService : IBusinessPlacePermissionsService public async Task SaveBusinessPlacePermissionAsync(BusinessPlacePermissionSaveRequest request) { - var userId = _currentUser.GetIntSubjectId(); - await _dbContext.Client.Deleteable() - .Where(x => x.ManagerUserId == request.UserId) - .ExecuteCommandAsync(); + .Where(x => x.ManagerUserId == request.UserId) + .ExecuteCommandAsync(); await _dbContext.InsertAsync(request.BusinessPlaceCodes.Select(x => new BusinessPlaceManagerRelationshipEntity { @@ -96,23 +89,20 @@ public class BusinessPlacePermissionsService : IBusinessPlacePermissionsService public async Task> GetBusinessPlacePermissionByUserIdAsyc(int id) { var infos = await _dbContext.Queryable() - .LeftJoin((x, bplace) => x.BusinessPlaceCode == bplace.Code) - .Where(x => x.ManagerUserId == id) - .Select((x, bplace) => new BusinessPlacePermissionPageResponse - { - UserId = x.ManagerUserId, - BusinessPlaceCode = x.BusinessPlaceCode, - BusinessPlaceName = bplace.Name, - }) - .ToListAsync(); + .LeftJoin((x, bplace) => x.BusinessPlaceCode == bplace.Code) + .Where(x => x.ManagerUserId == id) + .Select((x, bplace) => new BusinessPlacePermissionPageResponse + { + UserId = x.ManagerUserId, + BusinessPlaceCode = x.BusinessPlaceCode, + BusinessPlaceName = bplace.Name, + }) + .ToListAsync(); var userResult = await _userApi.GetUserByIdAsync(id); var user = userResult.Data; - infos.ForEach(item => - { - item.UserName = user?.UserName; - }); + infos.ForEach(item => { item.UserName = user?.UserName; }); return infos; } @@ -121,4 +111,4 @@ public class BusinessPlacePermissionsService : IBusinessPlacePermissionsService { await _dbContext.Client.Deleteable().Where(x => x.Id == id).ExecuteCommandAsync(); } -} +} \ No newline at end of file diff --git a/Src/Dlhis.Basic/Places/Services/Implements/BusinessPlaceService.cs b/Src/Dlhis.Basic/Places/Services/Implements/BusinessPlaceService.cs index 901fd89c..f715b1f5 100644 --- a/Src/Dlhis.Basic/Places/Services/Implements/BusinessPlaceService.cs +++ b/Src/Dlhis.Basic/Places/Services/Implements/BusinessPlaceService.cs @@ -1,14 +1,14 @@ using Dlhis.Basic.Places.Request; -using Dlhis.Basic.BusinessPlace.Response; +using Dlhis.Basic.Places.Response; using Dlhis.Entity.Basic.Entity; using Dlhis.Entity.Canteen.Enums; +using Kurisu.AspNetCore.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Services; using Kurisu.AspNetCore.Utils.Extensions; -using Kurisu.Core.DataAccess.Dto; -using Kurisu.SqlSugar.Extensions; -using Kurisu.SqlSugar.Services; using Mapster; -namespace Dlhis.Basic.BusinessPlace.Services.Implements; +namespace Dlhis.Basic.Places.Services.Implements; public class BusinessPlaceService : IBusinessPlaceService { @@ -28,26 +28,27 @@ public class BusinessPlaceService : IBusinessPlaceService var page = await _dbContext.Queryable() .LeftJoin((x, ps) => x.Code == ps.PlaceCode) .LeftJoin((x, ps, s) => s.Code == ps.ShiftCode) - .WhereIF(request.Search.IsPresent(), x => x.CustomCode.Contains(request.Search) - || x.Code.ToString().Contains(request.Search) || x.Name.Contains(request.Search)) - .WhereIF(request.Catalog.HasValue, x => x.Catalog == request.Catalog) - .WhereIF(request.Status.HasValue, x => x.Status == request.Status) - .WhereIF(request.Source.HasValue, x => x.Source == request.Source) - .Where(x => myCodes.Contains(x.Code)) - .Select((x, ps, s) => new BusinessPlaceResponse - { - Id = x.Id, - Code = x.Code, - Status = x.Status, - Name = x.Name, - Catalog = x.Catalog, - CustomCode = x.CustomCode, - Source = x.Source, - Supplier = x.Supplier, - ShiftCode = s.Code, - ShiftName = s.Name - }) - .ToPageListAsync(request); + .WhereIF(request.Search.IsPresent(), x => x.CustomCode.Contains(request.Search) + || x.Code.ToString().Contains(request.Search) + || x.Name.Contains(request.Search)) + .WhereIF(request.Catalog.HasValue, x => x.Catalog == request.Catalog) + .WhereIF(request.Status.HasValue, x => x.Status == request.Status) + .WhereIF(request.Source.HasValue, x => x.Source == request.Source) + .Where(x => myCodes.Contains(x.Code)) + .Select((x, ps, s) => new BusinessPlaceResponse + { + Id = x.Id, + Code = x.Code, + Status = x.Status, + Name = x.Name, + Catalog = x.Catalog, + CustomCode = x.CustomCode, + Source = x.Source, + Supplier = x.Supplier, + ShiftCode = s.Code, + ShiftName = s.Name + }) + .ToPageListAsync(request); return page; } @@ -56,25 +57,25 @@ public class BusinessPlaceService : IBusinessPlaceService public async Task> GetOpenedListAsync(Guid? placeCode = null, string tenant = null) { var list = await _dbContext.Queryable() - .LeftJoin((x, ps) => x.Code == ps.PlaceCode) - .LeftJoin((x, ps, s) => s.Code == ps.ShiftCode) - .Where(x => x.Status == CanteenBusinessPlaceStatusEnumType.Opened) - .WhereIF(placeCode.HasValue, x => x.Code == placeCode) - .WhereIF(tenant.IsPresent(), x => x.TenantId == tenant) - .Select((x, ps, s) => new BusinessPlaceListResponse - { - Id = x.Id, - Code = x.Code, - Status = x.Status, - Name = x.Name, - Catalog = x.Catalog, - CustomCode = x.CustomCode, - Source = x.Source, - Supplier = x.Supplier, - ShiftCode = s.Code, - ShiftName = s.Name, - }) - .ToListAsync(); + .LeftJoin((x, ps) => x.Code == ps.PlaceCode) + .LeftJoin((x, ps, s) => s.Code == ps.ShiftCode) + .Where(x => x.Status == CanteenBusinessPlaceStatusEnumType.Opened) + .WhereIF(placeCode.HasValue, x => x.Code == placeCode) + .WhereIF(tenant.IsPresent(), x => x.TenantId == tenant) + .Select((x, ps, s) => new BusinessPlaceListResponse + { + Id = x.Id, + Code = x.Code, + Status = x.Status, + Name = x.Name, + Catalog = x.Catalog, + CustomCode = x.CustomCode, + Source = x.Source, + Supplier = x.Supplier, + ShiftCode = s.Code, + ShiftName = s.Name, + }) + .ToListAsync(); var shiftCodes = list.Where(x => x.ShiftCode.HasValue).Select(x => x.ShiftCode.Value).ToList(); @@ -88,8 +89,8 @@ public class BusinessPlaceService : IBusinessPlaceService if (item.ShiftCode.HasValue) { item.ShiftTypes = shiftTypes.Where(x => x.ShiftCode == item.ShiftCode.Value) - .Select(x => new Dictionary() { [(int)x.ShiftType] = x.ShiftType.GetDescription() }) - .ToList(); + .Select(x => new Dictionary() { [(int)x.ShiftType] = x.ShiftType.GetDescription() }) + .ToList(); } }); @@ -149,9 +150,9 @@ public class BusinessPlaceService : IBusinessPlaceService private async Task CheckExistsCustomCodeAsync(BusinessPlaceSaveRequest request) { var existsSameCustomCode = await _dbContext.Queryable() - .Where(x => x.CustomCode == request.CustomCode) - .WhereIF(request.Id.HasValue, x => x.Id != request.Id) - .AnyAsync(); + .Where(x => x.CustomCode == request.CustomCode) + .WhereIF(request.Id.HasValue, x => x.Id != request.Id) + .AnyAsync(); existsSameCustomCode.ThrowIfTrue($"自定义手工号[{request.CustomCode}]存在重复,请检查."); } @@ -164,4 +165,4 @@ public class BusinessPlaceService : IBusinessPlaceService { return (await _businessPlacePermissionsService.GetMyAsync()).Select(x => x.Code).ToList(); } -} +} \ No newline at end of file diff --git a/Src/Dlhis.Basic/Program.cs b/Src/Dlhis.Basic/Program.cs index 9453ed0e..882db25c 100644 --- a/Src/Dlhis.Basic/Program.cs +++ b/Src/Dlhis.Basic/Program.cs @@ -1,13 +1,14 @@ using Kurisu.AspNetCore.Startup; using Kurisu.AspNetCore.Utils.Extensions; -using Kurisu.Startup; using Microsoft.IdentityModel.Logging; class Program { static void Main(string[] args) { - KurisuHost.Run(args); + KurisuHost.Builder(args) + //.EnableAppSettingsReload() + .RunKurisu(); } } diff --git a/Src/Dlhis.Basic/Summary/Services/ISummaryService.cs b/Src/Dlhis.Basic/Summary/Services/ISummaryService.cs index 0b4046cf..ea0d21f4 100644 --- a/Src/Dlhis.Basic/Summary/Services/ISummaryService.cs +++ b/Src/Dlhis.Basic/Summary/Services/ISummaryService.cs @@ -1,5 +1,4 @@ -using Dlhis.Basic.Device.Response; -using Dlhis.Basic.Summary.Response; +using Dlhis.Basic.Summary.Response; namespace Dlhis.Basic.Summary.Services; diff --git a/Src/Dlhis.Basic/Summary/Services/Implements/SummaryService.cs b/Src/Dlhis.Basic/Summary/Services/Implements/SummaryService.cs index 3176ad01..5ce43d10 100644 --- a/Src/Dlhis.Basic/Summary/Services/Implements/SummaryService.cs +++ b/Src/Dlhis.Basic/Summary/Services/Implements/SummaryService.cs @@ -5,8 +5,8 @@ using Dlhis.Entity.Basic.Entity; using Dlhis.Entity.Basic.Enums; using Dlhis.Entity.Device.Entities; using Dlhis.Entity.Device.Enums; -using Kurisu.Core.User.Abstractions; -using Kurisu.SqlSugar.Services; +using Kurisu.AspNetCore.Authentication.Abstractions; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Services; namespace Dlhis.Basic.Summary.Services.Implements; @@ -63,11 +63,10 @@ public class SummaryService : ISummaryService } return x.LastHeartbeatTime.AddSeconds(x.HeartbeatInterval * 3) >= now; - }).Count(), Trend = FixTrend(devices.Where(x => x.CreateTime >= before30Day && x.CreateTime <= currentDay) - .GroupBy(x => x.CreateTime.Date) - .Select(x => new TrendDto { Date = x.Key, Count = x.Count() }), before30Day, currentDay) + .GroupBy(x => x.CreateTime.Date) + .Select(x => new TrendDto { Date = x.Key, Count = x.Count() }), before30Day, currentDay) }, AttendanceDetailSummary = new AttendanceDetailSummary { @@ -76,11 +75,11 @@ public class SummaryService : ISummaryService GainfoTrend = new GainfoTrendResponse { EmployedTrend = FixTrend(workingGainfos.Where(x => x.EntryDate >= before7Day && x.EntryDate <= currentDay) - .GroupBy(x => x.EntryDate) - .Select(x => new TrendDto { Date = x.Key.Value, Count = x.Count() }), before7Day, currentDay), + .GroupBy(x => x.EntryDate) + .Select(x => new TrendDto { Date = x.Key.Value, Count = x.Count() }), before7Day, currentDay), UnemployedTrend = FixTrend(leaveGainfos.Where(x => x.ResignationDate >= before7Day && x.ResignationDate <= currentDay) - .GroupBy(x => x.ResignationDate) - .Select(x => new TrendDto { Date = x.Key.Value, Count = x.Count() }), before7Day, currentDay), + .GroupBy(x => x.ResignationDate) + .Select(x => new TrendDto { Date = x.Key.Value, Count = x.Count() }), before7Day, currentDay), } } }; @@ -159,6 +158,7 @@ public class SummaryService : ISummaryService }; unemployedTrend.Add(unDto); } + var ginfoTrendResponse = new GainfoTrendResponse(); ginfoTrendResponse.EmployedTrend = employedTrend; ginfoTrendResponse.UnemployedTrend = unemployedTrend; @@ -214,21 +214,20 @@ public class SummaryService : ISummaryService .ToListAsync(); var OnlineDevices = deviceRegistries - .Where(x => + .Where(x => + { + if (x.HeartbeatInterval <= 0) { - if (x.HeartbeatInterval <= 0) - { - return true; - } + return true; + } - return x.LastHeartbeatTime.AddSeconds(x.HeartbeatInterval * 3) >= now; - - }) - .Select(x => new - { - UniqueNo = x.UniqueNo, - }) - .ToList(); + return x.LastHeartbeatTime.AddSeconds(x.HeartbeatInterval * 3) >= now; + }) + .Select(x => new + { + UniqueNo = x.UniqueNo, + }) + .ToList(); var onlineUniqueNos = new List(); OnlineDevices.ForEach(x => onlineUniqueNos.Add(x.UniqueNo)); @@ -236,4 +235,4 @@ public class SummaryService : ISummaryService var list = devices.Where(x => offUniqueNos.Contains(x.UniqueNo)).ToList(); return list; } -} +} \ No newline at end of file diff --git a/Src/Dlhis.Canteen.Api/Dlhis.Canteen.Api.csproj b/Src/Dlhis.Canteen.Api/Dlhis.Canteen.Api.csproj index 314a11ed..4babda46 100644 --- a/Src/Dlhis.Canteen.Api/Dlhis.Canteen.Api.csproj +++ b/Src/Dlhis.Canteen.Api/Dlhis.Canteen.Api.csproj @@ -8,7 +8,7 @@ - + diff --git a/Src/Dlhis.Canteen/Dlhis.Canteen.csproj b/Src/Dlhis.Canteen/Dlhis.Canteen.csproj index 96d5ca50..920938d7 100644 --- a/Src/Dlhis.Canteen/Dlhis.Canteen.csproj +++ b/Src/Dlhis.Canteen/Dlhis.Canteen.csproj @@ -35,8 +35,4 @@ - - - - diff --git a/Src/Dlhis.Canteen/MealSupplementRecord/Controller/MealSupplementsRecordController.cs b/Src/Dlhis.Canteen/MealSupplementRecord/Controller/MealSupplementsRecordController.cs index c37a5f1f..16ca8575 100644 --- a/Src/Dlhis.Canteen/MealSupplementRecord/Controller/MealSupplementsRecordController.cs +++ b/Src/Dlhis.Canteen/MealSupplementRecord/Controller/MealSupplementsRecordController.cs @@ -1,8 +1,8 @@ using Dlhis.Canteen.MealSupplementRecord.Request; using Dlhis.Canteen.MealSupplementRecord.Response; using Dlhis.Canteen.MealSupplementRecord.Services; +using Kurisu.AspNetCore.DataAccess.Dto; using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop; -using Kurisu.Core.DataAccess.Dto; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; diff --git a/Src/Dlhis.Canteen/MealSupplementRecord/Request/MealSupplementRecordMyRequest.cs b/Src/Dlhis.Canteen/MealSupplementRecord/Request/MealSupplementRecordMyRequest.cs index 38cbf6ca..e6433cad 100644 --- a/Src/Dlhis.Canteen/MealSupplementRecord/Request/MealSupplementRecordMyRequest.cs +++ b/Src/Dlhis.Canteen/MealSupplementRecord/Request/MealSupplementRecordMyRequest.cs @@ -1,5 +1,5 @@ using System.ComponentModel.DataAnnotations; -using Kurisu.Core.CustomClass; +using Kurisu.AspNetCore.CustomClass; namespace Dlhis.Canteen.MealSupplementRecord.Request; diff --git a/Src/Dlhis.Canteen/MealSupplementRecord/Request/MealSupplementRecordRequest.cs b/Src/Dlhis.Canteen/MealSupplementRecord/Request/MealSupplementRecordRequest.cs index 53df63c5..4fb105c3 100644 --- a/Src/Dlhis.Canteen/MealSupplementRecord/Request/MealSupplementRecordRequest.cs +++ b/Src/Dlhis.Canteen/MealSupplementRecord/Request/MealSupplementRecordRequest.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using Dlhis.Entity.Basic.Enums; -using Kurisu.Core.CustomClass; -using Kurisu.Core.DataAccess.Dto; +using Kurisu.AspNetCore.CustomClass; +using Kurisu.AspNetCore.DataAccess.Dto; namespace Dlhis.Canteen.MealSupplementRecord.Request; @@ -43,4 +43,4 @@ public class MealSupplementRecordRequest : PageDto, IValidatableObject yield break; } -} +} \ No newline at end of file diff --git a/Src/Dlhis.Canteen/MealSupplementRecord/Services/IMealSupplementRecordService.cs b/Src/Dlhis.Canteen/MealSupplementRecord/Services/IMealSupplementRecordService.cs index 0ca74ff9..3a94c5d4 100644 --- a/Src/Dlhis.Canteen/MealSupplementRecord/Services/IMealSupplementRecordService.cs +++ b/Src/Dlhis.Canteen/MealSupplementRecord/Services/IMealSupplementRecordService.cs @@ -1,6 +1,6 @@ using Dlhis.Canteen.MealSupplementRecord.Request; using Dlhis.Canteen.MealSupplementRecord.Response; -using Kurisu.Core.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.Dto; namespace Dlhis.Canteen.MealSupplementRecord.Services; diff --git a/Src/Dlhis.Canteen/MealSupplementRecord/Services/Implements/MealSupplementRecordService.cs b/Src/Dlhis.Canteen/MealSupplementRecord/Services/Implements/MealSupplementRecordService.cs index 44b184b3..1e54a38f 100644 --- a/Src/Dlhis.Canteen/MealSupplementRecord/Services/Implements/MealSupplementRecordService.cs +++ b/Src/Dlhis.Canteen/MealSupplementRecord/Services/Implements/MealSupplementRecordService.cs @@ -5,12 +5,12 @@ using Dlhis.Entity.Basic.Enums; using Dlhis.Entity.Canteen.Entities; using Dlhis.Entity.Canteen.Enums; using Dlhis.Sys.Api; +using Kurisu.AspNetCore.Authentication.Abstractions; +using Kurisu.AspNetCore.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Services; using Kurisu.AspNetCore.Utils; using Kurisu.AspNetCore.Utils.Extensions; -using Kurisu.Core.DataAccess.Dto; -using Kurisu.Core.User.Abstractions; -using Kurisu.SqlSugar.Extensions; -using Kurisu.SqlSugar.Services; using SqlSugar; namespace Dlhis.Canteen.MealSupplementRecord.Services.Implements; diff --git a/Src/Dlhis.Canteen/Order/Controllers/BalanceSummaryController.cs b/Src/Dlhis.Canteen/Order/Controllers/BalanceSummaryController.cs index 65c7555a..54a495de 100644 --- a/Src/Dlhis.Canteen/Order/Controllers/BalanceSummaryController.cs +++ b/Src/Dlhis.Canteen/Order/Controllers/BalanceSummaryController.cs @@ -1,10 +1,8 @@ -using Dlhis.Canteen.Dishes.Request; -using Dlhis.Canteen.Order.Request; +using Dlhis.Canteen.Order.Request; using Dlhis.Canteen.Order.Response; using Dlhis.Canteen.Order.Services; -using Kurisu.Core.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.Dto; using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; namespace Dlhis.Canteen.Order.Controllers; diff --git a/Src/Dlhis.Canteen/Order/Controllers/BalancesController.cs b/Src/Dlhis.Canteen/Order/Controllers/BalancesController.cs index 56341e2a..17830dd8 100644 --- a/Src/Dlhis.Canteen/Order/Controllers/BalancesController.cs +++ b/Src/Dlhis.Canteen/Order/Controllers/BalancesController.cs @@ -2,12 +2,12 @@ using Dlhis.Canteen.Order.Request; using Dlhis.Canteen.Order.Response; using Dlhis.Canteen.Order.Services; +using Kurisu.AspNetCore.DataAccess.Dto; using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop; -using Kurisu.Core.DataAccess.Dto; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; -namespace Dlhis.Canteen.Dishes.Controllers; +namespace Dlhis.Canteen.Order.Controllers; /// /// 充值/消费 diff --git a/Src/Dlhis.Canteen/Order/Controllers/OrdersController.cs b/Src/Dlhis.Canteen/Order/Controllers/OrdersController.cs index 5afd5d6f..ee13e8a9 100644 --- a/Src/Dlhis.Canteen/Order/Controllers/OrdersController.cs +++ b/Src/Dlhis.Canteen/Order/Controllers/OrdersController.cs @@ -2,9 +2,9 @@ using Dlhis.Canteen.Order.Request; using Dlhis.Canteen.Order.Response; using Dlhis.Canteen.Order.Services; +using Kurisu.AspNetCore.DataAccess.Dto; using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop; -using Kurisu.Core.DataAccess.Dto; -using Kurisu.Core.Result; +using Kurisu.AspNetCore.UnifyResultAndValidation; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; @@ -90,7 +90,6 @@ public class OrdersController : ControllerBase } - /// /// 取消订单 /// @@ -129,4 +128,4 @@ public class OrdersController : ControllerBase { return await _bookingOrderService.GetBookingPageAsync(request); } -} +} \ No newline at end of file diff --git a/Src/Dlhis.Canteen/Order/Request/AverageDailyRequest.cs b/Src/Dlhis.Canteen/Order/Request/AverageDailyRequest.cs index 01a91d70..9251037e 100644 --- a/Src/Dlhis.Canteen/Order/Request/AverageDailyRequest.cs +++ b/Src/Dlhis.Canteen/Order/Request/AverageDailyRequest.cs @@ -1,4 +1,4 @@ -using Kurisu.Core.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.Dto; namespace Dlhis.Canteen.Order.Request { diff --git a/Src/Dlhis.Canteen/Order/Request/BalanceRecordAnalysisRequest.cs b/Src/Dlhis.Canteen/Order/Request/BalanceRecordAnalysisRequest.cs index 01177303..e0cb0598 100644 --- a/Src/Dlhis.Canteen/Order/Request/BalanceRecordAnalysisRequest.cs +++ b/Src/Dlhis.Canteen/Order/Request/BalanceRecordAnalysisRequest.cs @@ -1,26 +1,25 @@ using System.ComponentModel.DataAnnotations; -using Kurisu.Core.CustomClass; -using Kurisu.Core.DataAccess.Dto; +using Kurisu.AspNetCore.CustomClass; +using Kurisu.AspNetCore.DataAccess.Dto; -namespace Dlhis.Canteen.Order.Request +namespace Dlhis.Canteen.Order.Request; + +public class BalanceRecordAnalysisRequest : PageDto, IValidatableObject { - public class BalanceRecordAnalysisRequest : PageDto, IValidatableObject + public DateTimePeriod SearchDateTimePeriod { get; set; } + + /// + /// 营业点 + /// + public Guid? BusinessPlaceCode { get; set; } + + public IEnumerable Validate(ValidationContext validationContext) { - public DateTimePeriod SearchDateTimePeriod { get; set; } - - /// - /// 营业点 - /// - public Guid? BusinessPlaceCode { get; set; } - - public IEnumerable Validate(ValidationContext validationContext) + if (SearchDateTimePeriod != null && SearchDateTimePeriod.End.HasValue) { - if (SearchDateTimePeriod != null && SearchDateTimePeriod.End.HasValue) - { - SearchDateTimePeriod.End = SearchDateTimePeriod.End.Value.AddDays(1).AddSeconds(-1); - } - - yield break; + SearchDateTimePeriod.End = SearchDateTimePeriod.End.Value.AddDays(1).AddSeconds(-1); } + + yield break; } -} +} \ No newline at end of file diff --git a/Src/Dlhis.Canteen/Order/Request/BalanceRecordPageByCostIdRequest.cs b/Src/Dlhis.Canteen/Order/Request/BalanceRecordPageByCostIdRequest.cs index 5ff829c8..a8a54e38 100644 --- a/Src/Dlhis.Canteen/Order/Request/BalanceRecordPageByCostIdRequest.cs +++ b/Src/Dlhis.Canteen/Order/Request/BalanceRecordPageByCostIdRequest.cs @@ -1,38 +1,36 @@ -using Kurisu.Core.DataAccess.Dto; -using System.ComponentModel.DataAnnotations; +using Kurisu.AspNetCore.DataAccess.Dto; -namespace Dlhis.Canteen.Dishes.Request +namespace Dlhis.Canteen.Order.Request; + +public class BalanceRecordPageByCostIdRequest :PageDto { - public class BalanceRecordPageByCostIdRequest :PageDto - { - /// - /// 成本中心 - /// - public string CostId { get; set; } + /// + /// 成本中心 + /// + public string CostId { get; set; } - /// - /// 学工号 - /// - public string UserCode { get; set; } + /// + /// 学工号 + /// + public string UserCode { get; set; } - /// - /// 开始日期 - /// - public DateTime? StartDatetime { get; set; } + /// + /// 开始日期 + /// + public DateTime? StartDatetime { get; set; } - /// - /// 结束日期 - /// - public DateTime? EndDatetime { get; set; } + /// + /// 结束日期 + /// + public DateTime? EndDatetime { get; set; } - /// - /// 部门号 - /// - public string DepartmentNo { get; set; } + /// + /// 部门号 + /// + public string DepartmentNo { get; set; } - /// - /// 人事范围 - /// - public string OriginTenantId { get; set; } - } -} + /// + /// 人事范围 + /// + public string OriginTenantId { get; set; } +} \ No newline at end of file diff --git a/Src/Dlhis.Canteen/Order/Request/BalanceRecordPageByDeviceUniqueNoRequest.cs b/Src/Dlhis.Canteen/Order/Request/BalanceRecordPageByDeviceUniqueNoRequest.cs index ff402cb9..97372ab2 100644 --- a/Src/Dlhis.Canteen/Order/Request/BalanceRecordPageByDeviceUniqueNoRequest.cs +++ b/Src/Dlhis.Canteen/Order/Request/BalanceRecordPageByDeviceUniqueNoRequest.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; -using Kurisu.Core.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.Dto; -namespace Dlhis.Canteen.Dishes.Request; +namespace Dlhis.Canteen.Order.Request; public class BalanceRecordPageByDeviceUniqueNoRequest : PageDto { diff --git a/Src/Dlhis.Canteen/Order/Request/BalanceRecordPageDetailRequest.cs b/Src/Dlhis.Canteen/Order/Request/BalanceRecordPageDetailRequest.cs index b7654eb1..6a6d33ed 100644 --- a/Src/Dlhis.Canteen/Order/Request/BalanceRecordPageDetailRequest.cs +++ b/Src/Dlhis.Canteen/Order/Request/BalanceRecordPageDetailRequest.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using Dlhis.Entity.Canteen.Enums; -using Kurisu.Core.CustomClass; -using Kurisu.Core.DataAccess.Dto; +using Kurisu.AspNetCore.CustomClass; +using Kurisu.AspNetCore.DataAccess.Dto; namespace Dlhis.Canteen.Order.Request; diff --git a/Src/Dlhis.Canteen/Order/Request/BalanceRecordPageRequest.cs b/Src/Dlhis.Canteen/Order/Request/BalanceRecordPageRequest.cs index 34887930..59e53968 100644 --- a/Src/Dlhis.Canteen/Order/Request/BalanceRecordPageRequest.cs +++ b/Src/Dlhis.Canteen/Order/Request/BalanceRecordPageRequest.cs @@ -1,9 +1,9 @@ -using Dlhis.Entity.Canteen.Enums; -using System.ComponentModel.DataAnnotations; -using Kurisu.Core.DataAccess.Dto; -using Kurisu.Core.CustomClass; +using System.ComponentModel.DataAnnotations; +using Dlhis.Entity.Canteen.Enums; +using Kurisu.AspNetCore.CustomClass; +using Kurisu.AspNetCore.DataAccess.Dto; -namespace Dlhis.Canteen.Dishes.Request; +namespace Dlhis.Canteen.Order.Request; public class BalanceRecordPageRequest : PageDto, IValidatableObject { diff --git a/Src/Dlhis.Canteen/Order/Request/BalanceRecordSummaryRequest.cs b/Src/Dlhis.Canteen/Order/Request/BalanceRecordSummaryRequest.cs index 1bd4c913..6cb857ef 100644 --- a/Src/Dlhis.Canteen/Order/Request/BalanceRecordSummaryRequest.cs +++ b/Src/Dlhis.Canteen/Order/Request/BalanceRecordSummaryRequest.cs @@ -1,7 +1,6 @@ -using Kurisu.Core.DataAccess.Dto; -using System.ComponentModel.DataAnnotations; +using Kurisu.AspNetCore.DataAccess.Dto; -namespace Dlhis.Canteen.Dishes.Request +namespace Dlhis.Canteen.Order.Request { public class BalanceRecordSummaryRequest : PageDto { diff --git a/Src/Dlhis.Canteen/Order/Request/BalanceRecordUserPageRequest.cs b/Src/Dlhis.Canteen/Order/Request/BalanceRecordUserPageRequest.cs index b83296f2..3231e4df 100644 --- a/Src/Dlhis.Canteen/Order/Request/BalanceRecordUserPageRequest.cs +++ b/Src/Dlhis.Canteen/Order/Request/BalanceRecordUserPageRequest.cs @@ -1,7 +1,7 @@ using Dlhis.Entity.Canteen.Enums; -using Kurisu.Core.CustomClass; using System.ComponentModel.DataAnnotations; -using Kurisu.Core.DataAccess.Dto; +using Kurisu.AspNetCore.CustomClass; +using Kurisu.AspNetCore.DataAccess.Dto; namespace Dlhis.Canteen.Order.Request; diff --git a/Src/Dlhis.Canteen/Order/Request/GetConsumeDeviceRequest.cs b/Src/Dlhis.Canteen/Order/Request/GetConsumeDeviceRequest.cs index 03407004..2497cf4b 100644 --- a/Src/Dlhis.Canteen/Order/Request/GetConsumeDeviceRequest.cs +++ b/Src/Dlhis.Canteen/Order/Request/GetConsumeDeviceRequest.cs @@ -1,6 +1,6 @@ -using Kurisu.Core.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.Dto; -namespace Dlhis.Canteen.Dishes.Request; +namespace Dlhis.Canteen.Order.Request; public class GetConsumeDeviceRequest : PageDto { diff --git a/Src/Dlhis.Canteen/Order/Request/OrderBookingPageRequest.cs b/Src/Dlhis.Canteen/Order/Request/OrderBookingPageRequest.cs index 863686a1..fa133477 100644 --- a/Src/Dlhis.Canteen/Order/Request/OrderBookingPageRequest.cs +++ b/Src/Dlhis.Canteen/Order/Request/OrderBookingPageRequest.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using Dlhis.Entity.Canteen.Enums; -using Kurisu.Core.CustomClass; -using Kurisu.Core.DataAccess.Dto; +using Kurisu.AspNetCore.CustomClass; +using Kurisu.AspNetCore.DataAccess.Dto; namespace Dlhis.Canteen.Order.Request; @@ -28,5 +28,5 @@ public class OrderBookingPageRequest : PageDto /// 餐次 /// [EnumDataType(typeof(ShiftEnumType))] - public ShiftEnumType? ShiftTpe { get; set; } + public ShiftEnumType? ShiftType { get; set; } } diff --git a/Src/Dlhis.Canteen/Order/Request/SpendingDetailRequest.cs b/Src/Dlhis.Canteen/Order/Request/SpendingDetailRequest.cs index 497fe859..6d994779 100644 --- a/Src/Dlhis.Canteen/Order/Request/SpendingDetailRequest.cs +++ b/Src/Dlhis.Canteen/Order/Request/SpendingDetailRequest.cs @@ -1,4 +1,4 @@ -using Kurisu.Core.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.Dto; namespace Dlhis.Canteen.Order.Request { diff --git a/Src/Dlhis.Canteen/Order/Response/BalanceRecordAnalysisResponse.cs b/Src/Dlhis.Canteen/Order/Response/BalanceRecordAnalysisResponse.cs index e0a5bd63..532a320b 100644 --- a/Src/Dlhis.Canteen/Order/Response/BalanceRecordAnalysisResponse.cs +++ b/Src/Dlhis.Canteen/Order/Response/BalanceRecordAnalysisResponse.cs @@ -1,5 +1,5 @@ using Dlhis.Entity.Canteen.Enums; -using Kurisu.Core.CustomClass; +using Kurisu.AspNetCore.CustomClass; namespace Dlhis.Canteen.Order.Response; @@ -19,4 +19,4 @@ public class BalanceRecordAnalysisResponse /// 总人数 /// public int Total { get; set; } -} +} \ No newline at end of file diff --git a/Src/Dlhis.Canteen/Order/Response/BalanceRecordDetailPageResponse.cs b/Src/Dlhis.Canteen/Order/Response/BalanceRecordDetailPageResponse.cs index 22f3ebe2..ec223cf7 100644 --- a/Src/Dlhis.Canteen/Order/Response/BalanceRecordDetailPageResponse.cs +++ b/Src/Dlhis.Canteen/Order/Response/BalanceRecordDetailPageResponse.cs @@ -1,6 +1,6 @@ using Dlhis.Entity.Canteen.Enums; +using Kurisu.AspNetCore.DataAccess.Dto; using Kurisu.AspNetCore.Utils.Extensions; -using Kurisu.Core.DataAccess.Dto; using Newtonsoft.Json; namespace Dlhis.Canteen.Order.Response; @@ -109,4 +109,4 @@ public class BalanceRecordDetailPageResponse /// 人事范围 /// public string Werks { get; set; } -} +} \ No newline at end of file diff --git a/Src/Dlhis.Canteen/Order/Response/BalanceRecordUserPageResponse.cs b/Src/Dlhis.Canteen/Order/Response/BalanceRecordUserPageResponse.cs index b1a09866..532b89d1 100644 --- a/Src/Dlhis.Canteen/Order/Response/BalanceRecordUserPageResponse.cs +++ b/Src/Dlhis.Canteen/Order/Response/BalanceRecordUserPageResponse.cs @@ -1,6 +1,6 @@ using Dlhis.Entity.Canteen.Enums; +using Kurisu.AspNetCore.DataAccess.Dto; using Kurisu.AspNetCore.Utils.Extensions; -using Kurisu.Core.DataAccess.Dto; using Newtonsoft.Json; namespace Dlhis.Canteen.Order.Response; diff --git a/Src/Dlhis.Canteen/Order/Services/BaseOrderService.cs b/Src/Dlhis.Canteen/Order/Services/BaseOrderService.cs index 04074c8d..46161d48 100644 --- a/Src/Dlhis.Canteen/Order/Services/BaseOrderService.cs +++ b/Src/Dlhis.Canteen/Order/Services/BaseOrderService.cs @@ -2,9 +2,9 @@ using Dlhis.Canteen.Setting.Services; using Dlhis.Entity.Basic.Entity; using Dlhis.Entity.Canteen.Enums; +using Kurisu.AspNetCore.Authentication.Abstractions; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Services; using Kurisu.AspNetCore.Utils.Extensions; -using Kurisu.Core.User.Abstractions; -using Kurisu.SqlSugar.Services; using Mapster; namespace Dlhis.Canteen.Order.Services; @@ -70,6 +70,7 @@ public abstract class BaseOrderService { gainfo = await _dbContext.Queryable().Where(x => x.Code == jinkoCode).FirstAsync(); } + _settings = await _canteenSettingService.GetUserSettingAsync(gainfo.No, tenantId); } @@ -93,4 +94,4 @@ public abstract class BaseOrderService return defaultValue; } -} +} \ No newline at end of file diff --git a/Src/Dlhis.Canteen/Order/Services/IBalanceService.cs b/Src/Dlhis.Canteen/Order/Services/IBalanceService.cs index 5acebbdf..a7cfb3d7 100644 --- a/Src/Dlhis.Canteen/Order/Services/IBalanceService.cs +++ b/Src/Dlhis.Canteen/Order/Services/IBalanceService.cs @@ -1,7 +1,7 @@ using Dlhis.Canteen.Dishes.Request; using Dlhis.Canteen.Order.Request; using Dlhis.Canteen.Order.Response; -using Kurisu.Core.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.Dto; namespace Dlhis.Canteen.Order.Services; diff --git a/Src/Dlhis.Canteen/Order/Services/IBalanceSummaryService.cs b/Src/Dlhis.Canteen/Order/Services/IBalanceSummaryService.cs index 41a9dd3e..360270e7 100644 --- a/Src/Dlhis.Canteen/Order/Services/IBalanceSummaryService.cs +++ b/Src/Dlhis.Canteen/Order/Services/IBalanceSummaryService.cs @@ -1,8 +1,6 @@ -using Dlhis.Canteen.Dishes.Request; -using Dlhis.Canteen.Order.Request; +using Dlhis.Canteen.Order.Request; using Dlhis.Canteen.Order.Response; -using Kurisu.Core.DataAccess.Dto; -using Microsoft.AspNetCore.Mvc; +using Kurisu.AspNetCore.DataAccess.Dto; namespace Dlhis.Canteen.Order.Services; diff --git a/Src/Dlhis.Canteen/Order/Services/IBookingOrderService.cs b/Src/Dlhis.Canteen/Order/Services/IBookingOrderService.cs index 3266c9ee..30ccaad0 100644 --- a/Src/Dlhis.Canteen/Order/Services/IBookingOrderService.cs +++ b/Src/Dlhis.Canteen/Order/Services/IBookingOrderService.cs @@ -1,7 +1,7 @@ using Dlhis.Canteen.Dishes.Request; using Dlhis.Canteen.Order.Request; using Dlhis.Canteen.Order.Response; -using Kurisu.Core.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.Dto; namespace Dlhis.Canteen.Order.Services; diff --git a/Src/Dlhis.Canteen/Order/Services/IOrderService.cs b/Src/Dlhis.Canteen/Order/Services/IOrderService.cs index 48923d36..929ef4d8 100644 --- a/Src/Dlhis.Canteen/Order/Services/IOrderService.cs +++ b/Src/Dlhis.Canteen/Order/Services/IOrderService.cs @@ -1,7 +1,7 @@ using Dlhis.Canteen.Order.Request; using Dlhis.Canteen.Order.Response; -using Kurisu.Core.DataAccess.Dto; -using Kurisu.Core.Result; +using Kurisu.AspNetCore.DataAccess.Dto; +using Kurisu.AspNetCore.UnifyResultAndValidation; namespace Dlhis.Canteen.Order.Services; diff --git a/Src/Dlhis.Canteen/Order/Services/Implements/BalanceService.cs b/Src/Dlhis.Canteen/Order/Services/Implements/BalanceService.cs index 57ce75e3..88db5ce8 100644 --- a/Src/Dlhis.Canteen/Order/Services/Implements/BalanceService.cs +++ b/Src/Dlhis.Canteen/Order/Services/Implements/BalanceService.cs @@ -1,5 +1,4 @@ using Dlhis.Basic.Api; -using Dlhis.Canteen.Dishes.Request; using Dlhis.Canteen.Order.Request; using Dlhis.Canteen.Order.Response; using Dlhis.Canteen.Setting.Services; @@ -9,12 +8,12 @@ using Dlhis.Entity.Canteen.Enums; using Dlhis.Entity.Device.Entities; using Dlhis.Entity.Device.Enums; using Dlhis.Sys.Api; +using Kurisu.AspNetCore.Authentication.Abstractions; +using Kurisu.AspNetCore.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Services; using Kurisu.AspNetCore.Utils; using Kurisu.AspNetCore.Utils.Extensions; -using Kurisu.Core.DataAccess.Dto; -using Kurisu.Core.User.Abstractions; -using Kurisu.SqlSugar.Extensions; -using Kurisu.SqlSugar.Services; using Mapster; using SqlSugar; diff --git a/Src/Dlhis.Canteen/Order/Services/Implements/BalanceSummaryService.cs b/Src/Dlhis.Canteen/Order/Services/Implements/BalanceSummaryService.cs index 4db4b983..714141a3 100644 --- a/Src/Dlhis.Canteen/Order/Services/Implements/BalanceSummaryService.cs +++ b/Src/Dlhis.Canteen/Order/Services/Implements/BalanceSummaryService.cs @@ -2,10 +2,10 @@ using Dlhis.Canteen.Order.Response; using Dlhis.Entity.Canteen.Entities; using Dlhis.Entity.Canteen.Enums; -using Kurisu.Core.CustomClass; -using Kurisu.Core.DataAccess.Dto; -using Kurisu.Core.DataAccess.Extensions; -using Kurisu.SqlSugar.Services; +using Kurisu.AspNetCore.CustomClass; +using Kurisu.AspNetCore.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.Extensions; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Services; namespace Dlhis.Canteen.Order.Services.Implements; diff --git a/Src/Dlhis.Canteen/Order/Services/Implements/BookingOrderService.cs b/Src/Dlhis.Canteen/Order/Services/Implements/BookingOrderService.cs index e9727865..bdcd7ae4 100644 --- a/Src/Dlhis.Canteen/Order/Services/Implements/BookingOrderService.cs +++ b/Src/Dlhis.Canteen/Order/Services/Implements/BookingOrderService.cs @@ -6,12 +6,12 @@ using Dlhis.Entity.Canteen.Entities; using Dlhis.Entity.Canteen.Enums; using Kurisu.AspNetCore.Utils.Extensions; using Kurisu.AspNetCore.Utils; -using Kurisu.Core.DataAccess.Dto; -using Kurisu.SqlSugar.Services; -using Kurisu.Core.User.Abstractions; using Dlhis.Canteen.Setting.Services; using Dlhis.Basic.Api; -using Kurisu.SqlSugar.Extensions; +using Kurisu.AspNetCore.Authentication.Abstractions; +using Kurisu.AspNetCore.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Services; using SqlSugar; using Mapster; @@ -171,7 +171,7 @@ public class BookingOrderService : BaseOrderService, IBookingOrderService .Where(p => p.BookingDate <= request.BookingPeriod.End) .Any() ) - .WhereIF(request.ShiftTpe.HasValue, x => x.ShiftType == request.ShiftTpe) + .WhereIF(request.ShiftType.HasValue, x => x.ShiftType == request.ShiftType) .Select((x, ga, dept) => new OrderBookingResponse { No = x.No, diff --git a/Src/Dlhis.Canteen/Order/Services/Implements/OrderService.cs b/Src/Dlhis.Canteen/Order/Services/Implements/OrderService.cs index 751c2f35..eb4bcfe1 100644 --- a/Src/Dlhis.Canteen/Order/Services/Implements/OrderService.cs +++ b/Src/Dlhis.Canteen/Order/Services/Implements/OrderService.cs @@ -7,18 +7,16 @@ using Dlhis.Entity.Canteen.Enums; using Dlhis.Entity.Device.Entities; using Kurisu.AspNetCore.Utils; using Kurisu.AspNetCore.Utils.Extensions; -using Kurisu.Core.CustomClass; -using Kurisu.Core.DataAccess.Dto; -using Kurisu.Core.User.Abstractions; -using Kurisu.SqlSugar.Extensions; -using Kurisu.SqlSugar.Services; using Mapster; using SqlSugar; using Dlhis.Canteen.Order.Response; -using Dlhis.Canteen.Dishes; using Dlhis.Canteen.Order.Request; -using Kurisu.Core.Result; -using Org.BouncyCastle.Asn1.Ocsp; +using Kurisu.AspNetCore.Authentication.Abstractions; +using Kurisu.AspNetCore.CustomClass; +using Kurisu.AspNetCore.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Services; +using Kurisu.AspNetCore.UnifyResultAndValidation; namespace Dlhis.Canteen.Order.Services.Implements; @@ -108,18 +106,18 @@ public class OrderService : BaseOrderService, IOrderService //获取人员余额 var data = await DbContext.Queryable() - .LeftJoin((ga, department) => ga.DepartmentNo == department.No) - .LeftJoin((ga, department, mealUser) => ga.No == mealUser.UserNo) - .Where(ga => ga.Id == gainfo.Id) - .Select((ga, department, mealUser) => new OrderResultResponse - { - UserCode = ga.Code, - UserName = ga.Name, - DepartmentNo = ga.DepartmentNo, - DepartmentName = department.Name, - CurrentBalance = mealUser.Balance - }) - .SingleAsync(); + .LeftJoin((ga, department) => ga.DepartmentNo == department.No) + .LeftJoin((ga, department, mealUser) => ga.No == mealUser.UserNo) + .Where(ga => ga.Id == gainfo.Id) + .Select((ga, department, mealUser) => new OrderResultResponse + { + UserCode = ga.Code, + UserName = ga.Name, + DepartmentNo = ga.DepartmentNo, + DepartmentName = department.Name, + CurrentBalance = mealUser.Balance + }) + .SingleAsync(); return new DefaultApiResult { @@ -132,9 +130,9 @@ public class OrderService : BaseOrderService, IOrderService private async Task ToCheckAsync(string thirdNo) { var order = await DbContext.Queryable() - .Where(x => x.ThirdNo == thirdNo) - .OrderBy(x => x.CreateTime, OrderByType.Desc) - .FirstAsync(); + .Where(x => x.ThirdNo == thirdNo) + .OrderBy(x => x.CreateTime, OrderByType.Desc) + .FirstAsync(); if (order == null) { @@ -152,10 +150,6 @@ public class OrderService : BaseOrderService, IOrderService private async Task HandleOfflineAsync(ConsumeRequest request, GainfoEntity gainfo) { - var device = await DbContext.Queryable() - .Where(x => x.UniqueNo == request.DeviceUniqueNo) - .FirstAsync(); - var registry = await DbContext.Queryable() .Where(x => x.DeviceUniqueNo == request.DeviceUniqueNo) .FirstAsync(); @@ -179,7 +173,6 @@ public class OrderService : BaseOrderService, IOrderService { Start = x.Start, End = x.End - }.IsPresent1(request.CostDateTime)); var costDate = await GetCostDateAsync(shift, request.CostDateTime); @@ -263,17 +256,16 @@ public class OrderService : BaseOrderService, IOrderService gainfoMeal.Balance += order.Amount; await DbContext.Updateable() - .SetColumns(x => x.Balance == gainfoMeal.Balance) - .SetColumns(x => x.Version == x.Version + 1) - .SetColumns(x => x.ModifiedTime == DateTime.Now) - .Where(x => x.UserNo == order.UserNo && x.Version == gainfoMeal.Version)//必须与查询时的version一致 - .ExecuteCommandThrowVersionAsync(); + .SetColumns(x => x.Balance == gainfoMeal.Balance) + .SetColumns(x => x.Version == x.Version + 1) + .SetColumns(x => x.ModifiedTime == DateTime.Now) + .Where(x => x.UserNo == order.UserNo && x.Version == gainfoMeal.Version) //必须与查询时的version一致 + .ExecuteCommandThrowVersionAsync(); } //写入记录 var balanceRecord = order.Adapt(); await DbContext.InsertAsync(balanceRecord); - }, 5); } @@ -312,7 +304,6 @@ public class OrderService : BaseOrderService, IOrderService { Start = x.Start, End = x.End - }.IsPresent1(request.CostDateTime)); shift.ThrowIfNull("非就餐时间,无法消费"); @@ -374,10 +365,10 @@ public class OrderService : BaseOrderService, IOrderService } await DbContext.Updateable() - .SetColumns(x => x.OrderStatus == CanteenOrderStatusEnumType.Success) - .SetColumns(x => x.ModifiedTime == DateTime.Now) - .Where(x => x.Id == orderId) - .ExecuteCommandAsync(); + .SetColumns(x => x.OrderStatus == CanteenOrderStatusEnumType.Success) + .SetColumns(x => x.ModifiedTime == DateTime.Now) + .Where(x => x.Id == orderId) + .ExecuteCommandAsync(); } public async Task> GetOrdersAggregationAsync(PageDto page) @@ -391,39 +382,36 @@ public class OrderService : BaseOrderService, IOrderService } var pageResult = await DbContext.Queryable().Where(x => x.UserNo == gainfo.No) - .LeftJoin((x, bplace) => x.BusinessPlaceCode == bplace.Code) - .Where(x => x.ApplicationType == CanteenApplicaitonTypeEnumType.Booking) - .OrderBy(x => x.CreateTime, OrderByType.Desc) - .Select((x, bplace) => new OrderAggregationResponse - { - No = x.No, - BusinessPlaceName = bplace.Name, - CreateTime = x.CreateTime, - Remark = x.Remark, - OrderStatus = x.OrderStatus, - }) - .ToPageListAsync(page); + .LeftJoin((x, bplace) => x.BusinessPlaceCode == bplace.Code) + .Where(x => x.ApplicationType == CanteenApplicaitonTypeEnumType.Booking) + .OrderBy(x => x.CreateTime, OrderByType.Desc) + .Select((x, bplace) => new OrderAggregationResponse + { + No = x.No, + BusinessPlaceName = bplace.Name, + CreateTime = x.CreateTime, + Remark = x.Remark, + OrderStatus = x.OrderStatus, + }) + .ToPageListAsync(page); var nos = pageResult.Data.Select(x => x.No).ToList(); var dtos = await DbContext.Queryable() - .LeftJoin((x, d) => x.DishesCode == d.CustomCode) - .Where(x => nos.Contains(x.OrderNo)) - .Select((x, d) => new DishesDto - { - No = x.OrderNo, - DishesCode = x.DishesCode, - Name = d.Name, - ImageUrl = d.ImageUrl, - Number = x.Number, - Price = x.Price, - }) - .ToListAsync(); + .LeftJoin((x, d) => x.DishesCode == d.CustomCode) + .Where(x => nos.Contains(x.OrderNo)) + .Select((x, d) => new DishesDto + { + No = x.OrderNo, + DishesCode = x.DishesCode, + Name = d.Name, + ImageUrl = d.ImageUrl, + Number = x.Number, + Price = x.Price, + }) + .ToListAsync(); - pageResult.Data.ForEach(item => - { - item.Dishes = dtos.Where(x => x.No == item.No).ToList(); - }); + pageResult.Data.ForEach(item => { item.Dishes = dtos.Where(x => x.No == item.No).ToList(); }); return pageResult; } @@ -432,19 +420,19 @@ public class OrderService : BaseOrderService, IOrderService public async Task UpdateOffline(UpdateOfflineRequest outRequest) { var orders = await DbContext.Queryable().Where(x => x.IsOffline) - .Where(x => x.Status == BalanceRecordStatusEnumType.Valid) - .Where(x => x.OrderStatus == CanteenOrderStatusEnumType.Success) - .Where(x => x.ApplicationType == CanteenApplicaitonTypeEnumType.Device) - .Where(x => SqlFunc.IsNullOrEmpty(x.BusinessShiftCode)) - .WhereIF(outRequest.No.IsPresent(), x => x.No == outRequest.No) - .ToListAsync(); + .Where(x => x.Status == BalanceRecordStatusEnumType.Valid) + .Where(x => x.OrderStatus == CanteenOrderStatusEnumType.Success) + .Where(x => x.ApplicationType == CanteenApplicaitonTypeEnumType.Device) + .Where(x => SqlFunc.IsNullOrEmpty(x.BusinessShiftCode)) + .WhereIF(outRequest.No.IsPresent(), x => x.No == outRequest.No) + .ToListAsync(); foreach (var item in orders) { var request = item.RequestJson.ToObject(); var device = await DbContext.Queryable() - .Where(x => x.UniqueNo == request.DeviceUniqueNo) - .FirstAsync(); + .Where(x => x.UniqueNo == request.DeviceUniqueNo) + .FirstAsync(); var registry = await DbContext.Queryable() .Where(x => x.DeviceUniqueNo == request.DeviceUniqueNo) @@ -469,7 +457,6 @@ public class OrderService : BaseOrderService, IOrderService { Start = x.Start, End = x.End - }.IsPresent1(request.CostDateTime)); var costDate = await GetCostDateAsync(shift, request.CostDateTime); @@ -521,7 +508,6 @@ public class OrderService : BaseOrderService, IOrderService } - /// /// 验证参数 /// @@ -543,9 +529,9 @@ public class OrderService : BaseOrderService, IOrderService //超市营业点 var supermarketCodes = await DbContext.Queryable() - .Where(x => x.Catalog == CanteenBusinessPlaceCatalogEnumType.Supermarket) - .Select(x => x.Code) - .ToListAsync(); + .Where(x => x.Catalog == CanteenBusinessPlaceCatalogEnumType.Supermarket) + .Select(x => x.Code) + .ToListAsync(); //一天消费金额 var dayCostMax = await GetSettingAsync(order.TenantId, CanteenSettingItemEnumType.DayCostMax); @@ -618,17 +604,16 @@ public class OrderService : BaseOrderService, IOrderService } await DbContext.Updateable() - .SetColumns(x => x.Balance == gainfoMeal.Balance) - .SetColumns(x => x.Version == x.Version + 1) - .SetColumns(x => x.ModifiedTime == DateTime.Now) - .Where(x => x.UserNo == order.UserNo && x.Version == gainfoMeal.Version)//必须与查询时的version一致 - .ExecuteCommandThrowVersionAsync(); + .SetColumns(x => x.Balance == gainfoMeal.Balance) + .SetColumns(x => x.Version == x.Version + 1) + .SetColumns(x => x.ModifiedTime == DateTime.Now) + .Where(x => x.UserNo == order.UserNo && x.Version == gainfoMeal.Version) //必须与查询时的version一致 + .ExecuteCommandThrowVersionAsync(); } //写入记录 var balanceRecord = order.Adapt(); await DbContext.InsertAsync(balanceRecord); - }, 5); } @@ -638,10 +623,10 @@ public class OrderService : BaseOrderService, IOrderService var nos = await DbContext.Queryable().Where(x => x.UserCode == request.UserCode).Select(x => x.No).ToListAsync(); var orders = await DbContext.Queryable() - .Where(x => x.IsOffline) - .Where(x => !nos.Contains(x.No)) - .Where(x => x.UserCode == request.UserCode) - .ToListAsync(); + .Where(x => x.IsOffline) + .Where(x => !nos.Contains(x.No)) + .Where(x => x.UserCode == request.UserCode) + .ToListAsync(); var gainfoMeal = await DbContext.Queryable().Where(x => x.UserNo == gainfo.No).FirstAsync(); @@ -674,17 +659,16 @@ public class OrderService : BaseOrderService, IOrderService gainfoMeal.Balance += order.Amount; await DbContext.Updateable() - .SetColumns(x => x.Balance == gainfoMeal.Balance) - .SetColumns(x => x.Version == x.Version + 1) - .SetColumns(x => x.ModifiedTime == DateTime.Now) - .Where(x => x.UserNo == order.UserNo && x.Version == gainfoMeal.Version)//必须与查询时的version一致 - .ExecuteCommandThrowVersionAsync(); + .SetColumns(x => x.Balance == gainfoMeal.Balance) + .SetColumns(x => x.Version == x.Version + 1) + .SetColumns(x => x.ModifiedTime == DateTime.Now) + .Where(x => x.UserNo == order.UserNo && x.Version == gainfoMeal.Version) //必须与查询时的version一致 + .ExecuteCommandThrowVersionAsync(); //写入记录 var balanceRecord = order.Adapt(); balanceRecord.Id = 0; await DbContext.InsertAsync(balanceRecord); - }, 5); } } -} +} \ No newline at end of file diff --git a/Src/Dlhis.Canteen/Order/TimePeriodExtensions.cs b/Src/Dlhis.Canteen/Order/TimePeriodExtensions.cs index 4c22294c..b4c9df6c 100644 --- a/Src/Dlhis.Canteen/Order/TimePeriodExtensions.cs +++ b/Src/Dlhis.Canteen/Order/TimePeriodExtensions.cs @@ -1,6 +1,6 @@ -using Kurisu.Core.CustomClass; +using Kurisu.AspNetCore.CustomClass; -namespace Dlhis.Canteen.Dishes; +namespace Dlhis.Canteen.Order; /// diff --git a/Src/Dlhis.Canteen/Program.cs b/Src/Dlhis.Canteen/Program.cs index 6857278b..8fa11358 100644 --- a/Src/Dlhis.Canteen/Program.cs +++ b/Src/Dlhis.Canteen/Program.cs @@ -1,6 +1,5 @@ using Kurisu.AspNetCore.Startup; using Kurisu.AspNetCore.Utils.Extensions; -using Kurisu.Startup; using Microsoft.IdentityModel.Logging; namespace Dlhis.Canteen; diff --git a/Src/Dlhis.Canteen/Setting/Controllers/SettingController.cs b/Src/Dlhis.Canteen/Setting/Controllers/SettingController.cs index 44a90461..f758dc8f 100644 --- a/Src/Dlhis.Canteen/Setting/Controllers/SettingController.cs +++ b/Src/Dlhis.Canteen/Setting/Controllers/SettingController.cs @@ -1,7 +1,7 @@ using Dlhis.Canteen.Setting.Request; using Dlhis.Canteen.Setting.Response; using Dlhis.Canteen.Setting.Services; -using Kurisu.Core.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.Dto; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; diff --git a/Src/Dlhis.Canteen/Setting/Request/CanteenSettingPageRequest.cs b/Src/Dlhis.Canteen/Setting/Request/CanteenSettingPageRequest.cs index 8dee1142..57aa5cb2 100644 --- a/Src/Dlhis.Canteen/Setting/Request/CanteenSettingPageRequest.cs +++ b/Src/Dlhis.Canteen/Setting/Request/CanteenSettingPageRequest.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; using Dlhis.Entity.Canteen.Enums; -using Kurisu.Core.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.Dto; namespace Dlhis.Canteen.Setting.Request; diff --git a/Src/Dlhis.Canteen/Setting/Request/CanteenSettingSaveRequest.cs b/Src/Dlhis.Canteen/Setting/Request/CanteenSettingSaveRequest.cs index 1d8fa4da..c866121d 100644 --- a/Src/Dlhis.Canteen/Setting/Request/CanteenSettingSaveRequest.cs +++ b/Src/Dlhis.Canteen/Setting/Request/CanteenSettingSaveRequest.cs @@ -1,8 +1,6 @@ -using System; -using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations; using Dlhis.Entity.Canteen.Enums; using Kurisu.AspNetCore.Utils.Extensions; -using Org.BouncyCastle.Asn1.X509.SigI; namespace Dlhis.Canteen.Setting.Request; diff --git a/Src/Dlhis.Canteen/Setting/Request/CanteenSettingSetEnableRequest.cs b/Src/Dlhis.Canteen/Setting/Request/CanteenSettingSetEnableRequest.cs index 33179db1..e89d6702 100644 --- a/Src/Dlhis.Canteen/Setting/Request/CanteenSettingSetEnableRequest.cs +++ b/Src/Dlhis.Canteen/Setting/Request/CanteenSettingSetEnableRequest.cs @@ -1,9 +1,8 @@ -namespace Dlhis.Canteen.Setting.Request -{ - public class CanteenSettingSetEnableRequest - { - public int Id { get; set; } +namespace Dlhis.Canteen.Setting.Request; - public bool Enable { get; set; } - } -} +public class CanteenSettingSetEnableRequest +{ + public int Id { get; set; } + + public bool Enable { get; set; } +} \ No newline at end of file diff --git a/Src/Dlhis.Canteen/Setting/Services/ICanteenSettingService.cs b/Src/Dlhis.Canteen/Setting/Services/ICanteenSettingService.cs index 355d681c..ecd8d69d 100644 --- a/Src/Dlhis.Canteen/Setting/Services/ICanteenSettingService.cs +++ b/Src/Dlhis.Canteen/Setting/Services/ICanteenSettingService.cs @@ -1,7 +1,7 @@ using Dlhis.Canteen.Setting.Request; using Dlhis.Canteen.Setting.Response; using Dlhis.Entity.Canteen.Enums; -using Kurisu.Core.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.Dto; namespace Dlhis.Canteen.Setting.Services; diff --git a/Src/Dlhis.Canteen/Setting/Services/Implements/CanteenSettingService.cs b/Src/Dlhis.Canteen/Setting/Services/Implements/CanteenSettingService.cs index cc08f7df..14d2f23c 100644 --- a/Src/Dlhis.Canteen/Setting/Services/Implements/CanteenSettingService.cs +++ b/Src/Dlhis.Canteen/Setting/Services/Implements/CanteenSettingService.cs @@ -2,10 +2,10 @@ using Dlhis.Canteen.Setting.Response; using Dlhis.Entity.Basic.Entity; using Dlhis.Entity.Canteen.Enums; +using Kurisu.AspNetCore.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Services; using Kurisu.AspNetCore.Utils.Extensions; -using Kurisu.Core.DataAccess.Dto; -using Kurisu.SqlSugar.Extensions; -using Kurisu.SqlSugar.Services; using Mapster; namespace Dlhis.Canteen.Setting.Services.Implements; @@ -42,10 +42,7 @@ public class CanteenSettingService : ICanteenSettingService var userNos = page.Data.Where(x => x.UniqueType == CanteenSettingUnqiueEnumType.Person).Select(x => x.UniqueValue).Distinct().ToList(); var gainfos = await _context.Queryable().Where(x => userNos.Contains(x.No)).ToListAsync(); - page.Data.ForEach(x => - { - x.UniqueValueDesc = gainfos.FirstOrDefault(item => item.No == x.UniqueValue)?.Name; - }); + page.Data.ForEach(x => { x.UniqueValueDesc = gainfos.FirstOrDefault(item => item.No == x.UniqueValue)?.Name; }); return page; } @@ -71,7 +68,6 @@ public class CanteenSettingService : ICanteenSettingService } - public async Task SetEnableAsync(CanteenSettingSetEnableRequest request) { var entity = await _context.Queryable().FirstAsync(x => x.Id == request.Id); @@ -85,10 +81,10 @@ public class CanteenSettingService : ICanteenSettingService public async Task> GetUserSettingAsync(string userNo, string tenantId) { var settings = await _context.Queryable() - .Where(x => x.Enable) - .Where(x => x.TenantId == tenantId) - .Where(x => (x.UniqueType == CanteenSettingUnqiueEnumType.Person && x.UniqueValue == userNo) || x.UniqueType == CanteenSettingUnqiueEnumType.Tenant) - .ToListAsync(); + .Where(x => x.Enable) + .Where(x => x.TenantId == tenantId) + .Where(x => (x.UniqueType == CanteenSettingUnqiueEnumType.Person && x.UniqueValue == userNo) || x.UniqueType == CanteenSettingUnqiueEnumType.Tenant) + .ToListAsync(); //从基地 -> 个人,确保下面循环做到覆盖,并且以个人配置为主 settings = settings.OrderBy(x => x.UniqueType).ToList(); @@ -113,10 +109,10 @@ public class CanteenSettingService : ICanteenSettingService public async Task GetBusinessSwitchTimeAsync(string tenantId) { var setting = await _context.Queryable() - .Where(x => x.Enable) - .Where(x => x.TenantId == tenantId) - .Where(x => x.Item == CanteenSettingItemEnumType.BusinessSwitchTime) - .FirstAsync(); + .Where(x => x.Enable) + .Where(x => x.TenantId == tenantId) + .Where(x => x.Item == CanteenSettingItemEnumType.BusinessSwitchTime) + .FirstAsync(); try { @@ -135,18 +131,17 @@ public class CanteenSettingService : ICanteenSettingService //Tenant只有一条数据, Person对应UniqueValue唯一 , Catalog不作为唯一判断 var exists = await _context.Queryable() - .Where(x => x.UniqueType == request.UniqueType) - .Where(x => x.Catalog == request.Catalog) - .Where(x => x.Item == request.Item) - .WhereIF(request.UniqueType != CanteenSettingUnqiueEnumType.Tenant, x => x.UniqueValue == request.UniqueValue) - .WhereIF(request.Id.HasValue, x => x.Id != request.Id) - .AnyAsync(); + .Where(x => x.UniqueType == request.UniqueType) + .Where(x => x.Catalog == request.Catalog) + .Where(x => x.Item == request.Item) + .WhereIF(request.UniqueType != CanteenSettingUnqiueEnumType.Tenant, x => x.UniqueValue == request.UniqueValue) + .WhereIF(request.Id.HasValue, x => x.Id != request.Id) + .AnyAsync(); exists.ThrowIfTrue("配置项重复,请检查."); } - /// /// 检验参数 /// @@ -174,14 +169,15 @@ public class CanteenSettingService : ICanteenSettingService return false; } } + if (type == CanteenSettingItemEnumType.BusinessSwitchTime) { var timeOnly = value.Adapt(); return timeOnly.Minute == 0 && timeOnly.Second == 0; } + //mapster value.Adapt(); - } catch (Exception) { @@ -222,4 +218,4 @@ public class CanteenSettingService : ICanteenSettingService result.ThrowIfFalse($"{request.Item.GetDescription()},参数值为[{value}],格式错误"); } -} +} \ No newline at end of file diff --git a/Src/Dlhis.Canteen/SqlSugarPack.cs b/Src/Dlhis.Canteen/SqlSugarPack.cs index a05817df..7bb48e6a 100644 --- a/Src/Dlhis.Canteen/SqlSugarPack.cs +++ b/Src/Dlhis.Canteen/SqlSugarPack.cs @@ -1,12 +1,10 @@ -using Kurisu.AspNetCore.Startup; -using Kurisu.SqlSugar.Extensions; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions; +using Kurisu.AspNetCore.Startup; namespace Dlhis.Canteen; public class SqlSugarPack : BaseAppPack { - public override bool IsBeforeUseRouting { get; } - public override void ConfigureServices(IServiceCollection services) { services.AddSqlSugar(); diff --git a/Src/Dlhis.Common.Api/Dlhis.Common.Api.csproj b/Src/Dlhis.Common.Api/Dlhis.Common.Api.csproj index 314a11ed..4babda46 100644 --- a/Src/Dlhis.Common.Api/Dlhis.Common.Api.csproj +++ b/Src/Dlhis.Common.Api/Dlhis.Common.Api.csproj @@ -8,7 +8,7 @@ - + diff --git a/Src/Dlhis.Common.Api/IEnumSettingApi.cs b/Src/Dlhis.Common.Api/IEnumSettingApi.cs index bcd561b5..31dd3677 100644 --- a/Src/Dlhis.Common.Api/IEnumSettingApi.cs +++ b/Src/Dlhis.Common.Api/IEnumSettingApi.cs @@ -1,5 +1,5 @@ -using Kurisu.Core.Result; -using Kurisu.RemoteCall.Attributes; +using Kurisu.RemoteCall.Attributes; +using Kurisu.RemoteCall.Default; namespace Dlhis.Common.Api; diff --git a/Src/Dlhis.Common/ApiLog/Controller/ApiLogController.cs b/Src/Dlhis.Common/ApiLog/Controller/ApiLogController.cs index 91478b33..ca55a64f 100644 --- a/Src/Dlhis.Common/ApiLog/Controller/ApiLogController.cs +++ b/Src/Dlhis.Common/ApiLog/Controller/ApiLogController.cs @@ -1,36 +1,35 @@ using Dlhis.Common.ApiLog.Request; using Dlhis.Common.ApiLog.Response; using Dlhis.Common.ApiLog.Services.Implements; -using Kurisu.Core.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.Dto; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; -namespace Dlhis.Common.ApiLog.Controller +namespace Dlhis.Common.ApiLog.Controller; + +/// +/// API日志控制器 +/// +[Authorize] +[Route("api/[controller]")] +[ApiController] +public class ApiLogController : ControllerBase { - /// - /// API日志控制器 - /// - [Authorize] - [Route("api/[controller]")] - [ApiController] - public class ApiLogController : ControllerBase + private readonly IApiLogService _apiLogService; + + public ApiLogController(IApiLogService apiLogService) { - private readonly IApiLogService _apiLogService; - - public ApiLogController(IApiLogService apiLogService) - { - _apiLogService = apiLogService; - } - - /// - /// 获取api日志 - /// - /// - [Authorize(Roles = "admin")] - [HttpGet("logs")] - public async Task> GetLogsAsync([FromQuery] ApiLogRequest request) - { - return await _apiLogService.GetLogsAsync(request); - } + _apiLogService = apiLogService; } -} + + /// + /// 获取api日志 + /// + /// + [Authorize(Roles = "admin")] + [HttpGet("logs")] + public async Task> GetLogsAsync([FromQuery] ApiLogRequest request) + { + return await _apiLogService.GetLogsAsync(request); + } +} \ No newline at end of file diff --git a/Src/Dlhis.Common/ApiLog/Request/ApiLogRequest.cs b/Src/Dlhis.Common/ApiLog/Request/ApiLogRequest.cs index e6cac2f1..3c3d30ae 100644 --- a/Src/Dlhis.Common/ApiLog/Request/ApiLogRequest.cs +++ b/Src/Dlhis.Common/ApiLog/Request/ApiLogRequest.cs @@ -1,6 +1,6 @@ -using Kurisu.Core.CustomClass; -using Kurisu.Core.DataAccess.Dto; -using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations; +using Kurisu.AspNetCore.CustomClass; +using Kurisu.AspNetCore.DataAccess.Dto; namespace Dlhis.Common.ApiLog.Request; @@ -24,4 +24,4 @@ public class ApiLogRequest : PageDto, IValidatableObject yield break; } -} +} \ No newline at end of file diff --git a/Src/Dlhis.Common/ApiLog/Response/ApiLogResponse.cs b/Src/Dlhis.Common/ApiLog/Response/ApiLogResponse.cs index 8d1aaf82..82bf8766 100644 --- a/Src/Dlhis.Common/ApiLog/Response/ApiLogResponse.cs +++ b/Src/Dlhis.Common/ApiLog/Response/ApiLogResponse.cs @@ -15,10 +15,7 @@ namespace Dlhis.Common.ApiLog.Response /// public DateTime RaiseTime { - get - { - return DateTime.Parse(Timestamp).ToLocalTime(); - } + get { return DateTime.Parse(Timestamp).ToLocalTime(); } } /// @@ -54,4 +51,4 @@ namespace Dlhis.Common.ApiLog.Response [JsonIgnore] public DateTime _TS { get; set; } } -} +} \ No newline at end of file diff --git a/Src/Dlhis.Common/ApiLog/Services/ApiLogService.cs b/Src/Dlhis.Common/ApiLog/Services/ApiLogService.cs index 54bdd9de..80d15567 100644 --- a/Src/Dlhis.Common/ApiLog/Services/ApiLogService.cs +++ b/Src/Dlhis.Common/ApiLog/Services/ApiLogService.cs @@ -2,10 +2,10 @@ using Dlhis.Common.ApiLog.Response; using Dlhis.Common.ApiLog.Services.Implements; using Dlhis.Entity.Common; +using Kurisu.AspNetCore.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Services; using Kurisu.AspNetCore.Utils.Extensions; -using Kurisu.Core.DataAccess.Dto; -using Kurisu.SqlSugar.Extensions; -using Kurisu.SqlSugar.Services; using SqlSugar; namespace Dlhis.Common.ApiLog.Services @@ -22,15 +22,15 @@ namespace Dlhis.Common.ApiLog.Services public async Task> GetLogsAsync(ApiLogRequest request) { var logs = await _dbContext.ChangeDb("log").Queryable() - .WhereIF(request.SearchDateTimePeriod?.Start.HasValue == true && request.SearchDateTimePeriod?.End.HasValue == true, + .WhereIF(request.SearchDateTimePeriod?.Start.HasValue == true && request.SearchDateTimePeriod?.End.HasValue == true, x => x._ts >= request.SearchDateTimePeriod.Start && x._ts <= request.SearchDateTimePeriod.End) - .WhereIF(request.Search.IsPresent(), x => x.Message.Contains(request.Search)) - .WhereIF(request.Level.HasValue, x => x.Level == request.Level) - .OrderBy(x => x.Timestamp, OrderByType.Desc) - .Select() - .ToPageListAsync(request); + .WhereIF(request.Search.IsPresent(), x => x.Message.Contains(request.Search)) + .WhereIF(request.Level.HasValue, x => x.Level == request.Level) + .OrderBy(x => x.Timestamp, OrderByType.Desc) + .Select() + .ToPageListAsync(request); return logs; } } -} +} \ No newline at end of file diff --git a/Src/Dlhis.Common/ApiLog/Services/Implements/IApiLogService.cs b/Src/Dlhis.Common/ApiLog/Services/Implements/IApiLogService.cs index b8f27280..6cd1d744 100644 --- a/Src/Dlhis.Common/ApiLog/Services/Implements/IApiLogService.cs +++ b/Src/Dlhis.Common/ApiLog/Services/Implements/IApiLogService.cs @@ -1,11 +1,10 @@ using Dlhis.Common.ApiLog.Request; using Dlhis.Common.ApiLog.Response; -using Kurisu.Core.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.Dto; -namespace Dlhis.Common.ApiLog.Services.Implements +namespace Dlhis.Common.ApiLog.Services.Implements; + +public interface IApiLogService : IScopeDependency { - public interface IApiLogService : IScopeDependency - { - Task> GetLogsAsync(ApiLogRequest request); - } -} + Task> GetLogsAsync(ApiLogRequest request); +} \ No newline at end of file diff --git a/Src/Dlhis.Common/Dlhis.Common.csproj b/Src/Dlhis.Common/Dlhis.Common.csproj index 4cab740e..70d8ea34 100644 --- a/Src/Dlhis.Common/Dlhis.Common.csproj +++ b/Src/Dlhis.Common/Dlhis.Common.csproj @@ -25,7 +25,6 @@ - diff --git a/Src/Dlhis.Common/EnumSetting/EnumsController.cs b/Src/Dlhis.Common/EnumSetting/EnumsController.cs index 1821b42f..61f33eef 100644 --- a/Src/Dlhis.Common/EnumSetting/EnumsController.cs +++ b/Src/Dlhis.Common/EnumSetting/EnumsController.cs @@ -1,9 +1,9 @@ using System.Reflection; using Dlhis.Common.FileOperation.Response; using Dlhis.Entity.Basic.Entity; +using Kurisu.AspNetCore.CustomClass; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Services; using Kurisu.AspNetCore.Utils.Extensions; -using Kurisu.Core.CustomClass; -using Kurisu.SqlSugar.Services; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; @@ -37,27 +37,27 @@ public class EnumsController : ControllerBase .Where(x => x.IsEnum); var result = types.Select(x => - { - var d = x.GetDescription(); - return new CommonEnumResponse - { - Code = x.Name, - Name = d, - Data = x.GetFields(BindingFlags.Public | BindingFlags.Static).Select(item => - { - var e = (Enum)Enum.Parse(item.FieldType, item.GetValue(null).ToString()); - var fd = e.GetDescription(); - return new KeyValueDto - { - Key = fd, - Value = (int)item.GetValue(null) - }; - }) - .OrderBy(x => x.Value) - .ToList() - }; - }) - .ToList(); + { + var d = x.GetDescription(); + return new CommonEnumResponse + { + Code = x.Name, + Name = d, + Data = x.GetFields(BindingFlags.Public | BindingFlags.Static).Select(item => + { + var e = (Enum)Enum.Parse(item.FieldType, item.GetValue(null).ToString()); + var fd = e.GetDescription(); + return new KeyValueDto + { + Key = fd, + Value = (int)item.GetValue(null) + }; + }) + .OrderBy(x => x.Value) + .ToList() + }; + }) + .ToList(); var dbTypes = _dbContext.Queryable().OrderBy(x => x.Sequence).ToList(); var dbResult = dbTypes.GroupBy(x => x.Type).Select(g => @@ -68,12 +68,12 @@ public class EnumsController : ControllerBase Code = type, Name = type, Data = g.AsEnumerable().Select(x => new KeyValueDto - { - Key = x.Display, - Value = x.Code - }) - .OrderBy(x => x.Value) - .ToList() + { + Key = x.Display, + Value = x.Code + }) + .OrderBy(x => x.Value) + .ToList() }; }); @@ -92,17 +92,17 @@ public class EnumsController : ControllerBase Code = code, Name = name, Data = enumType.GetFields(BindingFlags.Public | BindingFlags.Static).Select(item => - { - var e = (Enum)Enum.Parse(item.FieldType, item.GetValue(null).ToString()); - var fd = e.GetDescription(); - return new KeyValueDto { - Key = fd, - Value = (int)item.GetValue(null) - }; - }) - .OrderBy(x => x.Value) - .ToList() + var e = (Enum)Enum.Parse(item.FieldType, item.GetValue(null).ToString()); + var fd = e.GetDescription(); + return new KeyValueDto + { + Key = fd, + Value = (int)item.GetValue(null) + }; + }) + .OrderBy(x => x.Value) + .ToList() }; } -} +} \ No newline at end of file diff --git a/Src/Dlhis.Common/FileOperation/Configurations/MinIOOptions.cs b/Src/Dlhis.Common/FileOperation/Configurations/MinIOOptions.cs index 5d1cd799..f76d8e4d 100644 --- a/Src/Dlhis.Common/FileOperation/Configurations/MinIOOptions.cs +++ b/Src/Dlhis.Common/FileOperation/Configurations/MinIOOptions.cs @@ -1,5 +1,5 @@ using System.ComponentModel.DataAnnotations; -using Kurisu.Core.ConfigurableOptions.Attributes; +using Kurisu.AspNetCore.ConfigurableOptions.Attributes; namespace Dlhis.Common.FileOperation.Configurations; diff --git a/Src/Dlhis.Common/FileOperation/Controllers/FileController.cs b/Src/Dlhis.Common/FileOperation/Controllers/FileController.cs index 59bd8fc3..ecdd0b14 100644 --- a/Src/Dlhis.Common/FileOperation/Controllers/FileController.cs +++ b/Src/Dlhis.Common/FileOperation/Controllers/FileController.cs @@ -2,7 +2,7 @@ using Dlhis.Common.FileOperation.Request; using Dlhis.Common.FileOperation.Response; using Dlhis.Common.FileOperation.Services; -using Kurisu.Core.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.Dto; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; @@ -31,7 +31,7 @@ public class FileController : ControllerBase /// /// 相对路径 [HttpPost("{Bucket}/upload")] - public async Task UploadFileAsync([FromForm] UploadFileReuqest request) + public async Task UploadFileAsync([FromForm] UploadFileRequest request) { return await _minioService.UploadFileAsync(request.Bucket, request.File); } diff --git a/Src/Dlhis.Common/FileOperation/Request/UploadFileReuqest.cs b/Src/Dlhis.Common/FileOperation/Request/UploadFileRequest.cs similarity index 92% rename from Src/Dlhis.Common/FileOperation/Request/UploadFileReuqest.cs rename to Src/Dlhis.Common/FileOperation/Request/UploadFileRequest.cs index 767287bf..302f64f4 100644 --- a/Src/Dlhis.Common/FileOperation/Request/UploadFileReuqest.cs +++ b/Src/Dlhis.Common/FileOperation/Request/UploadFileRequest.cs @@ -4,7 +4,7 @@ using Microsoft.AspNetCore.Mvc; namespace Dlhis.Common.FileOperation.Request; -public class UploadFileReuqest : IValidatableObject +public class UploadFileRequest : IValidatableObject { /// /// bucket diff --git a/Src/Dlhis.Common/FileOperation/Response/CommonEnumResponse.cs b/Src/Dlhis.Common/FileOperation/Response/CommonEnumResponse.cs index 3d4ee959..77a620bf 100644 --- a/Src/Dlhis.Common/FileOperation/Response/CommonEnumResponse.cs +++ b/Src/Dlhis.Common/FileOperation/Response/CommonEnumResponse.cs @@ -1,4 +1,4 @@ -using Kurisu.Core.CustomClass; +using Kurisu.AspNetCore.CustomClass; namespace Dlhis.Common.FileOperation.Response; diff --git a/Src/Dlhis.Common/FileOperation/Services/IFileVersionService.cs b/Src/Dlhis.Common/FileOperation/Services/IFileVersionService.cs index 69c2bdb7..57dc6580 100644 --- a/Src/Dlhis.Common/FileOperation/Services/IFileVersionService.cs +++ b/Src/Dlhis.Common/FileOperation/Services/IFileVersionService.cs @@ -1,6 +1,6 @@ using Dlhis.Common.FileOperation.Request; using Dlhis.Common.FileOperation.Response; -using Kurisu.Core.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.Dto; namespace Dlhis.Common.FileOperation.Services; diff --git a/Src/Dlhis.Common/FileOperation/Services/Implements/FileVersionService.cs b/Src/Dlhis.Common/FileOperation/Services/Implements/FileVersionService.cs index 7466973c..3db3202a 100644 --- a/Src/Dlhis.Common/FileOperation/Services/Implements/FileVersionService.cs +++ b/Src/Dlhis.Common/FileOperation/Services/Implements/FileVersionService.cs @@ -1,9 +1,9 @@ using Dlhis.Common.FileOperation.Request; using Dlhis.Common.FileOperation.Response; using Dlhis.Entity.Common; -using Kurisu.Core.DataAccess.Dto; -using Kurisu.SqlSugar.Extensions; -using Kurisu.SqlSugar.Services; +using Kurisu.AspNetCore.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Services; namespace Dlhis.Common.FileOperation.Services.Implements; @@ -38,27 +38,27 @@ public class FileVersionService : IFileVersionService public async Task> GetPageAsync(PageDto request) { return await _dbContext.Queryable() - .OrderByDescending(x => x.CreateTime) - .Select() - .ToPageListAsync(request); + .OrderByDescending(x => x.CreateTime) + .Select() + .ToPageListAsync(request); } public async Task> GetListByCodeAsync(string code) { return await _dbContext.Queryable() - .Where(x => x.Code == code) - .OrderByDescending(x => x.CreateTime) - .Select() - .ToListAsync(); + .Where(x => x.Code == code) + .OrderByDescending(x => x.CreateTime) + .Select() + .ToListAsync(); } public async Task GetLastByCodeAsync(string code) { return await _dbContext.Queryable() - .Where(x => x.Code == code) - .OrderByDescending(x => x.Version) - .Select() - .FirstAsync(); + .Where(x => x.Code == code) + .OrderByDescending(x => x.Version) + .Select() + .FirstAsync(); } //************************************************************* help methods *************************************************************** @@ -71,4 +71,4 @@ public class FileVersionService : IFileVersionService .Select(x => x.Version) .FirstAsync(); } -} +} \ No newline at end of file diff --git a/Src/Dlhis.Common/Packs/MinioPack.cs b/Src/Dlhis.Common/Packs/MinioPack.cs index dd601657..b1989362 100644 --- a/Src/Dlhis.Common/Packs/MinioPack.cs +++ b/Src/Dlhis.Common/Packs/MinioPack.cs @@ -7,7 +7,6 @@ namespace Dlhis.Common.Packs; public class MinioPack : BaseAppPack { - public override bool IsBeforeUseRouting { get; } public override void ConfigureServices(IServiceCollection services) { @@ -15,11 +14,8 @@ public class MinioPack : BaseAppPack { var config = sp.GetService>().Value; return new MinioClient().WithEndpoint(new Uri(config.Endpoint)) - .WithCredentials(config.AccessKey, config.SecretKey) - .Build(); + .WithCredentials(config.AccessKey, config.SecretKey) + .Build(); }); } -} - - - +} \ No newline at end of file diff --git a/Src/Dlhis.Common/Packs/SqlSugarPack.cs b/Src/Dlhis.Common/Packs/SqlSugarPack.cs index fe5454cb..e3402b0d 100644 --- a/Src/Dlhis.Common/Packs/SqlSugarPack.cs +++ b/Src/Dlhis.Common/Packs/SqlSugarPack.cs @@ -1,37 +1,35 @@ -using Kurisu.AspNetCore.Startup; -using Kurisu.SqlSugar.Extensions; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions; +using Kurisu.AspNetCore.Startup; using SqlSugar; -namespace Dlhis.Common.Packs +namespace Dlhis.Common.Packs; + +public class SqlSugarPack : BaseAppPack { - public class SqlSugarPack : BaseAppPack + + public override void ConfigureServices(IServiceCollection services) { - public override bool IsBeforeUseRouting { get; } - - public override void ConfigureServices(IServiceCollection services) + services.AddSqlSugar(sp => { - services.AddSqlSugar(sp => + var configuration = sp.GetService(); + + return new List { - var configuration = sp.GetService(); - - return new List + new() { - new() - { - ConfigId = "log", + ConfigId = "log", - ConnectionString = configuration.GetSection("SqlSugarOptions:LogConnectionString").Value, - DbType = DbType.MySqlConnector, - InitKeyType = InitKeyType.Attribute, - IsAutoCloseConnection = true, + ConnectionString = configuration.GetSection("SqlSugarOptions:LogConnectionString").Value, + DbType = DbType.MySqlConnector, + InitKeyType = InitKeyType.Attribute, + IsAutoCloseConnection = true, - MoreSettings = new ConnMoreSettings - { - DisableNvarchar = true, - } - }, - }; - }); - } + MoreSettings = new ConnMoreSettings + { + DisableNvarchar = true, + } + }, + }; + }); } -} +} \ No newline at end of file diff --git a/Src/Dlhis.Common/Program.cs b/Src/Dlhis.Common/Program.cs index 280a0699..80065305 100644 --- a/Src/Dlhis.Common/Program.cs +++ b/Src/Dlhis.Common/Program.cs @@ -1,5 +1,4 @@ using Kurisu.AspNetCore.Startup; -using Kurisu.Startup; class Program { diff --git a/Src/Dlhis.Entity/Basic/Entity/BasicTypeEntity.cs b/Src/Dlhis.Entity/Basic/Entity/BasicTypeEntity.cs index 14e5a309..a0892972 100644 --- a/Src/Dlhis.Entity/Basic/Entity/BasicTypeEntity.cs +++ b/Src/Dlhis.Entity/Basic/Entity/BasicTypeEntity.cs @@ -1,4 +1,4 @@ -using Kurisu.SqlSugar; +using Kurisu.AspNetCore.DataAccess.SqlSugar; using SqlSugar; namespace Dlhis.Entity.Basic.Entity; @@ -44,5 +44,4 @@ public class BasicTypeEntity : SugarBaseEntity /// [SugarColumn(ColumnDescription = "排序", DefaultValue = "0")] public int Sequence { get; set; } - -} +} \ No newline at end of file diff --git a/Src/Dlhis.Entity/Basic/Entity/BookingAddressEntity.cs b/Src/Dlhis.Entity/Basic/Entity/BookingAddressEntity.cs index 54e8f17a..8e90230e 100644 --- a/Src/Dlhis.Entity/Basic/Entity/BookingAddressEntity.cs +++ b/Src/Dlhis.Entity/Basic/Entity/BookingAddressEntity.cs @@ -1,5 +1,5 @@ -using Kurisu.Core.DataAccess.Entity; -using Kurisu.SqlSugar; +using Kurisu.AspNetCore.DataAccess.Entity; +using Kurisu.AspNetCore.DataAccess.SqlSugar; using SqlSugar; namespace Dlhis.Entity.Basic.Entity; diff --git a/Src/Dlhis.Entity/Basic/Entity/BusinessPlaceEntity.cs b/Src/Dlhis.Entity/Basic/Entity/BusinessPlaceEntity.cs index 429930a1..bfb0a923 100644 --- a/Src/Dlhis.Entity/Basic/Entity/BusinessPlaceEntity.cs +++ b/Src/Dlhis.Entity/Basic/Entity/BusinessPlaceEntity.cs @@ -1,6 +1,6 @@ using Dlhis.Entity.Canteen.Enums; -using Kurisu.Core.DataAccess.Entity; -using Kurisu.SqlSugar; +using Kurisu.AspNetCore.DataAccess.Entity; +using Kurisu.AspNetCore.DataAccess.SqlSugar; using Mapster; using SqlSugar; using SqlSugar.DbConvert; diff --git a/Src/Dlhis.Entity/Basic/Entity/BusinessPlaceGroupEntity.cs b/Src/Dlhis.Entity/Basic/Entity/BusinessPlaceGroupEntity.cs index fdb19b6c..c92f0495 100644 --- a/Src/Dlhis.Entity/Basic/Entity/BusinessPlaceGroupEntity.cs +++ b/Src/Dlhis.Entity/Basic/Entity/BusinessPlaceGroupEntity.cs @@ -1,5 +1,5 @@ -using Kurisu.Core.DataAccess.Entity; -using Kurisu.SqlSugar; +using Kurisu.AspNetCore.DataAccess.Entity; +using Kurisu.AspNetCore.DataAccess.SqlSugar; using SqlSugar; namespace Dlhis.Entity.Basic.Entity; diff --git a/Src/Dlhis.Entity/Basic/Entity/BusinessPlaceGroupRelationshipEntity.cs b/Src/Dlhis.Entity/Basic/Entity/BusinessPlaceGroupRelationshipEntity.cs index 49a36419..6693abac 100644 --- a/Src/Dlhis.Entity/Basic/Entity/BusinessPlaceGroupRelationshipEntity.cs +++ b/Src/Dlhis.Entity/Basic/Entity/BusinessPlaceGroupRelationshipEntity.cs @@ -1,5 +1,5 @@ -using Kurisu.Core.DataAccess.Entity; -using Kurisu.SqlSugar; +using Kurisu.AspNetCore.DataAccess.Entity; +using Kurisu.AspNetCore.DataAccess.SqlSugar; using SqlSugar; namespace Dlhis.Entity.Basic.Entity; diff --git a/Src/Dlhis.Entity/Basic/Entity/BusinessPlaceManagerRelationshipEntity.cs b/Src/Dlhis.Entity/Basic/Entity/BusinessPlaceManagerRelationshipEntity.cs index 44fae7a8..a24d6402 100644 --- a/Src/Dlhis.Entity/Basic/Entity/BusinessPlaceManagerRelationshipEntity.cs +++ b/Src/Dlhis.Entity/Basic/Entity/BusinessPlaceManagerRelationshipEntity.cs @@ -1,4 +1,4 @@ -using Kurisu.SqlSugar; +using Kurisu.AspNetCore.DataAccess.SqlSugar; using Mapster; using SqlSugar; diff --git a/Src/Dlhis.Entity/Basic/Entity/BusinessPlaceShiftRelationshipEntity.cs b/Src/Dlhis.Entity/Basic/Entity/BusinessPlaceShiftRelationshipEntity.cs index e96e4a78..c87295fb 100644 --- a/Src/Dlhis.Entity/Basic/Entity/BusinessPlaceShiftRelationshipEntity.cs +++ b/Src/Dlhis.Entity/Basic/Entity/BusinessPlaceShiftRelationshipEntity.cs @@ -1,5 +1,5 @@ -using Kurisu.Core.DataAccess.Entity; -using Kurisu.SqlSugar; +using Kurisu.AspNetCore.DataAccess.Entity; +using Kurisu.AspNetCore.DataAccess.SqlSugar; using SqlSugar; namespace Dlhis.Entity.Basic.Entity; diff --git a/Src/Dlhis.Entity/Basic/Entity/BusinessShiftEntity.cs b/Src/Dlhis.Entity/Basic/Entity/BusinessShiftEntity.cs index e80d81ee..6475b614 100644 --- a/Src/Dlhis.Entity/Basic/Entity/BusinessShiftEntity.cs +++ b/Src/Dlhis.Entity/Basic/Entity/BusinessShiftEntity.cs @@ -1,5 +1,5 @@ -using Kurisu.Core.DataAccess.Entity; -using Kurisu.SqlSugar; +using Kurisu.AspNetCore.DataAccess.Entity; +using Kurisu.AspNetCore.DataAccess.SqlSugar; using Mapster; using SqlSugar; diff --git a/Src/Dlhis.Entity/Basic/Entity/BusinessShiftMealRelationshipEntity.cs b/Src/Dlhis.Entity/Basic/Entity/BusinessShiftMealRelationshipEntity.cs index 71912dd0..d2cc2328 100644 --- a/Src/Dlhis.Entity/Basic/Entity/BusinessShiftMealRelationshipEntity.cs +++ b/Src/Dlhis.Entity/Basic/Entity/BusinessShiftMealRelationshipEntity.cs @@ -1,6 +1,6 @@ using Dlhis.Entity.Canteen.Enums; -using Kurisu.Core.DataAccess.Entity; -using Kurisu.SqlSugar; +using Kurisu.AspNetCore.DataAccess.Entity; +using Kurisu.AspNetCore.DataAccess.SqlSugar; using SqlSugar; using SqlSugar.DbConvert; @@ -10,41 +10,41 @@ namespace Dlhis.Entity.Basic.Entity; public class BusinessShiftMealRelationshipEntity : SugarBaseEntity, ITenantId { /// - /// 餐别Code + /// 餐别Code /// [SugarColumn(ColumnDescription = "餐别Code", UniqueGroupNameList = new[] { "idx_CanteenBusinessShiftRelationship_shiftcode_shifttype" })] public Guid ShiftCode { get; set; } /// - /// 餐别手工号 + /// 餐别手工号 /// [SugarColumn(ColumnDescription = "餐别编码")] public string ShiftCustomCode { get; set; } /// - /// 餐次 + /// 餐次 /// [SugarColumn(ColumnDescription = "餐次", ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert), UniqueGroupNameList = new[] { "idx_CanteenBusinessShiftRelationship_shiftcode_shifttype" })] public ShiftEnumType ShiftType { get; set; } /// - /// 经营开始时间 + /// 经营开始时间 /// [SugarColumn(ColumnDescription = "经营开始时间")] public TimeOnly Start { get; set; } /// - /// 经营结束时间 + /// 经营结束时间 /// [SugarColumn(ColumnDescription = "经营结束时间")] public TimeOnly End { get; set; } /// - /// 序号 + /// 序号 /// [SugarColumn(ColumnDescription = "序号")] public int Sequence { get; set; } public string TenantId { get; set; } -} +} \ No newline at end of file diff --git a/Src/Dlhis.Entity/Basic/Entity/CanteenSettingEntity.cs b/Src/Dlhis.Entity/Basic/Entity/CanteenSettingEntity.cs index 93a6c612..a0b66588 100644 --- a/Src/Dlhis.Entity/Basic/Entity/CanteenSettingEntity.cs +++ b/Src/Dlhis.Entity/Basic/Entity/CanteenSettingEntity.cs @@ -1,52 +1,53 @@ using Dlhis.Entity.Canteen.Enums; -using Kurisu.Core.DataAccess.Entity; -using Kurisu.SqlSugar; +using Kurisu.AspNetCore.DataAccess.Entity; +using Kurisu.AspNetCore.DataAccess.SqlSugar; using SqlSugar; using SqlSugar.DbConvert; -namespace Dlhis.Entity.Basic.Entity; - -/// -/// 就餐配置 -/// -[SugarTable(TableName = "CanteenSetting", TableDescription = "就餐配置")] -public class CanteenSettingEntity : SugarBaseEntity, ITenantId +namespace Dlhis.Entity.Basic.Entity { /// - /// 唯一类型 + /// 就餐配置 /// - [SugarColumn(ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert), ColumnDescription = "唯一类型")] - public CanteenSettingUnqiueEnumType UniqueType { get; set; } + [SugarTable(TableName = "CanteenSetting", TableDescription = "就餐配置")] + public class CanteenSettingEntity : SugarBaseEntity, ITenantId + { + /// + /// 唯一类型 + /// + [SugarColumn(ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert), ColumnDescription = "唯一类型")] + public CanteenSettingUnqiueEnumType UniqueType { get; set; } - /// - /// 唯一值 - /// - [SugarColumn(ColumnDescription = "唯一值")] - public string UniqueValue { get; set; } + /// + /// 唯一值 + /// + [SugarColumn(ColumnDescription = "唯一值")] + public string UniqueValue { get; set; } - /// - /// 分类 - /// - [SugarColumn(ColumnDescription = "分类")] - public string Catalog { get; set; } + /// + /// 分类 + /// + [SugarColumn(ColumnDescription = "分类")] + public string Catalog { get; set; } - /// - /// 参数 - /// - [SugarColumn(ColumnDataType = "varchar(50)", ColumnDescription = "参数", SqlParameterDbType = typeof(EnumToStringConvert))] - public CanteenSettingItemEnumType Item { get; set; } + /// + /// 参数 + /// + [SugarColumn(ColumnDataType = "varchar(50)", ColumnDescription = "参数", SqlParameterDbType = typeof(EnumToStringConvert))] + public CanteenSettingItemEnumType Item { get; set; } - /// - /// 值 - /// - [SugarColumn(ColumnDescription = "值")] - public string Value { get; set; } + /// + /// 值 + /// + [SugarColumn(ColumnDescription = "值")] + public string Value { get; set; } - /// - /// 是否启用 - /// - [SugarColumn(ColumnDataType = "bit", ColumnDescription = "是否启用")] - public bool Enable { get; set; } + /// + /// 是否启用 + /// + [SugarColumn(ColumnDataType = "bit", ColumnDescription = "是否启用")] + public bool Enable { get; set; } - public string TenantId { get; set; } + public string TenantId { get; set; } + } } \ No newline at end of file diff --git a/Src/Dlhis.Entity/Basic/Entity/DepartmentEntity.cs b/Src/Dlhis.Entity/Basic/Entity/DepartmentEntity.cs index 5b0ee202..11db4561 100644 --- a/Src/Dlhis.Entity/Basic/Entity/DepartmentEntity.cs +++ b/Src/Dlhis.Entity/Basic/Entity/DepartmentEntity.cs @@ -1,29 +1,30 @@ -using Kurisu.SqlSugar; +using Kurisu.AspNetCore.DataAccess.SqlSugar; using SqlSugar; -namespace Dlhis.Entity.Basic.Entity; - -/// -/// 部门 -/// -[SugarTable(TableName = "Department", TableDescription = "部门")] -public class DepartmentEntity : SugarBaseEntity +namespace Dlhis.Entity.Basic.Entity { /// - /// 部门号 + /// 部门 /// - [SugarColumn(ColumnDescription = "部门号", IsNullable = false, UniqueGroupNameList = new[] { "idx_Department_No" })] - public string No { get; set; } + [SugarTable(TableName = "Department", TableDescription = "部门")] + public class DepartmentEntity : SugarBaseEntity + { + /// + /// 部门号 + /// + [SugarColumn(ColumnDescription = "部门号", IsNullable = false, UniqueGroupNameList = new[] { "idx_Department_No" })] + public string No { get; set; } - /// - /// 上级部门号 - /// - [SugarColumn(ColumnDescription = "上级部门号")] - public string PNo { get; set; } + /// + /// 上级部门号 + /// + [SugarColumn(ColumnDescription = "上级部门号")] + public string PNo { get; set; } - /// - /// 部门名称 - /// - [SugarColumn(ColumnDescription = "部门名称", IsNullable = false)] - public string Name { get; set; } -} + /// + /// 部门名称 + /// + [SugarColumn(ColumnDescription = "部门名称", IsNullable = false)] + public string Name { get; set; } + } +} \ No newline at end of file diff --git a/Src/Dlhis.Entity/Basic/Entity/DeviceEntity.cs b/Src/Dlhis.Entity/Basic/Entity/DeviceEntity.cs index 92a6dd54..ef074069 100644 --- a/Src/Dlhis.Entity/Basic/Entity/DeviceEntity.cs +++ b/Src/Dlhis.Entity/Basic/Entity/DeviceEntity.cs @@ -1,97 +1,98 @@ using Dlhis.Entity.Device.Enums; -using Kurisu.Core.DataAccess.Entity; -using Kurisu.SqlSugar; +using Kurisu.AspNetCore.DataAccess.Entity; +using Kurisu.AspNetCore.DataAccess.SqlSugar; using Mapster; using SqlSugar; using SqlSugar.DbConvert; -namespace Dlhis.Entity.Basic.Entity; - -/// -/// 设备 -/// -[SugarTable(TableName = "Device", TableDescription = "设备表")] -public class DeviceEntity : SugarBaseEntity, ITenantId +namespace Dlhis.Entity.Basic.Entity { /// - /// 设备code + /// 设备 /// - [SugarColumn(ColumnDescription = "设备code")] - public Guid Code { get; set; } + [SugarTable(TableName = "Device", TableDescription = "设备表")] + public class DeviceEntity : SugarBaseEntity, ITenantId + { + /// + /// 设备code + /// + [SugarColumn(ColumnDescription = "设备code")] + public Guid Code { get; set; } - /// - /// 设备唯一码,IP/MAC/SNO - /// - [AdaptIgnore(MemberSide.Destination)] - [SugarColumn(ColumnDescription = "设备唯一码", IsNullable = false, UniqueGroupNameList = new[] { "Idx_Device_UniqueNo" })] - public string UniqueNo { get; set; } + /// + /// 设备唯一码,IP/MAC/SNO + /// + [AdaptIgnore(MemberSide.Destination)] + [SugarColumn(ColumnDescription = "设备唯一码", IsNullable = false, UniqueGroupNameList = new[] { "Idx_Device_UniqueNo" })] + public string UniqueNo { get; set; } - /// - /// 心跳间隔 - /// - [SugarColumn(ColumnDescription = "心跳检查间隔")] - public int HeartbeatInterval { get; set; } + /// + /// 心跳间隔 + /// + [SugarColumn(ColumnDescription = "心跳检查间隔")] + public int HeartbeatInterval { get; set; } - /// - /// 供应商 - /// - [SugarColumn(ColumnDescription = "供应商")] - public string Supplier { get; set; } + /// + /// 供应商 + /// + [SugarColumn(ColumnDescription = "供应商")] + public string Supplier { get; set; } - /// - /// 设备功能 - /// - [SugarColumn(ColumnDataType = "varchar(150)", IsJson = true, ColumnDescription = "设备功能", DefaultValue = "[]")] - public List Funcs { get; set; } + /// + /// 设备功能 + /// + [SugarColumn(ColumnDataType = "varchar(150)", IsJson = true, ColumnDescription = "设备功能", DefaultValue = "[]")] + public List Funcs { get; set; } - /// - /// 设备类型 - /// - [SugarColumn(ColumnDescription = "设备类型", ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert))] - public DeviceTypeEnumType Type { get; set; } + /// + /// 设备类型 + /// + [SugarColumn(ColumnDescription = "设备类型", ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert))] + public DeviceTypeEnumType Type { get; set; } - /// - /// 部署点 - /// - [SugarColumn(ColumnDescription = "部署点")] - public string DeployPlace { get; set; } + /// + /// 部署点 + /// + [SugarColumn(ColumnDescription = "部署点")] + public string DeployPlace { get; set; } - /// - /// 部署坐标 - /// - [SugarColumn(ColumnDescription = "部署坐标")] - public string DeployPosition { get; set; } + /// + /// 部署坐标 + /// + [SugarColumn(ColumnDescription = "部署坐标")] + public string DeployPosition { get; set; } - /// - /// 部署方向 - /// - [SugarColumn(ColumnDescription = "部署方向", ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert))] - public DeviceDeployDirectionEnumType? DeployDirection { get; set; } + /// + /// 部署方向 + /// + [SugarColumn(ColumnDescription = "部署方向", ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert))] + public DeviceDeployDirectionEnumType? DeployDirection { get; set; } - /// - /// 模板code - /// - [SugarColumn(ColumnDescription = "模板code")] - public Guid? TemplateCode { get; set; } + /// + /// 模板code + /// + [SugarColumn(ColumnDescription = "模板code")] + public Guid? TemplateCode { get; set; } - /// - /// 连接信息 - /// - [SugarColumn(ColumnDescription = "连接信息")] - public string ConnectionInfo { get; set; } + /// + /// 连接信息 + /// + [SugarColumn(ColumnDescription = "连接信息")] + public string ConnectionInfo { get; set; } - /// - /// 是否启用 - /// - [SugarColumn(ColumnDataType = "bit", ColumnDescription = "是否启用")] - public bool Enable { get; set; } + /// + /// 是否启用 + /// + [SugarColumn(ColumnDataType = "bit", ColumnDescription = "是否启用")] + public bool Enable { get; set; } - /// - /// 是否作为考勤设备 - /// - [SugarColumn(ColumnDataType = "bit", ColumnDescription = "是否作为考勤设备")] - public bool AsAttendance { get; set; } + /// + /// 是否作为考勤设备 + /// + [SugarColumn(ColumnDataType = "bit", ColumnDescription = "是否作为考勤设备")] + public bool AsAttendance { get; set; } - public string TenantId { get; set; } + public string TenantId { get; set; } + } } \ No newline at end of file diff --git a/Src/Dlhis.Entity/Basic/Entity/DeviceTemplateEntity.cs b/Src/Dlhis.Entity/Basic/Entity/DeviceTemplateEntity.cs index 84cf035b..2fd396f4 100644 --- a/Src/Dlhis.Entity/Basic/Entity/DeviceTemplateEntity.cs +++ b/Src/Dlhis.Entity/Basic/Entity/DeviceTemplateEntity.cs @@ -1,35 +1,36 @@ -using Kurisu.SqlSugar; +using Kurisu.AspNetCore.DataAccess.SqlSugar; using SqlSugar; -namespace Dlhis.Entity.Basic.Entity; - -/// -/// 设备配置模板 -/// -[SugarTable(TableName = "DeviceTemplate", TableDescription = "设备配置模板")] -public class DeviceTemplateEntity : SugarBaseEntity +namespace Dlhis.Entity.Basic.Entity { /// - /// 模板code + /// 设备配置模板 /// - [SugarColumn(ColumnDescription = "模板code")] - public Guid Code { get; set; } + [SugarTable(TableName = "DeviceTemplate", TableDescription = "设备配置模板")] + public class DeviceTemplateEntity : SugarBaseEntity + { + /// + /// 模板code + /// + [SugarColumn(ColumnDescription = "模板code")] + public Guid Code { get; set; } - /// - /// 品牌 - /// - [SugarColumn(ColumnDescription = "品牌", UniqueGroupNameList = new string[] { "idx_DeviceTemplate_brand_name" })] - public string Brand { get; set; } + /// + /// 品牌 + /// + [SugarColumn(ColumnDescription = "品牌", UniqueGroupNameList = new[] { "idx_DeviceTemplate_brand_name" })] + public string Brand { get; set; } - /// - /// 模板名称 - /// - [SugarColumn(ColumnDescription = "型号", UniqueGroupNameList = new string[] { "idx_DeviceTemplate_brand_name" })] - public string Name { get; set; } + /// + /// 模板名称 + /// + [SugarColumn(ColumnDescription = "型号", UniqueGroupNameList = new[] { "idx_DeviceTemplate_brand_name" })] + public string Name { get; set; } - /// - /// 模板json - /// - [SugarColumn(ColumnDescription = "模板json")] - public string Template { get; set; } + /// + /// 模板json + /// + [SugarColumn(ColumnDescription = "模板json")] + public string Template { get; set; } + } } \ No newline at end of file diff --git a/Src/Dlhis.Entity/Basic/Entity/GainfoCardRecordEntity.cs b/Src/Dlhis.Entity/Basic/Entity/GainfoCardRecordEntity.cs index 59c4b49d..ccef0313 100644 --- a/Src/Dlhis.Entity/Basic/Entity/GainfoCardRecordEntity.cs +++ b/Src/Dlhis.Entity/Basic/Entity/GainfoCardRecordEntity.cs @@ -1,33 +1,34 @@ -using Kurisu.Core.DataAccess.Entity; -using Kurisu.SqlSugar; +using Kurisu.AspNetCore.DataAccess.Entity; +using Kurisu.AspNetCore.DataAccess.SqlSugar; using SqlSugar; -namespace Dlhis.Entity.Basic.Entity; - -[SugarTable(TableName = "GainfoCardRecord", TableDescription = "卡记录")] -public class GainfoCardRecordEntity : SugarBaseEntity, ITenantId +namespace Dlhis.Entity.Basic.Entity { - /// - /// 档案No - /// - [SugarColumn(IsNullable = false, IndexGroupNameList = new[] { "idx_GainfoCardRecord_userno" })] - public string UserNo { get; set; } + [SugarTable(TableName = "GainfoCardRecord", TableDescription = "卡记录")] + public class GainfoCardRecordEntity : SugarBaseEntity, ITenantId + { + /// + /// 档案No + /// + [SugarColumn(IsNullable = false, IndexGroupNameList = new[] { "idx_GainfoCardRecord_userno" })] + public string UserNo { get; set; } - /// - /// 卡号 - /// - [SugarColumn(IsNullable = false)] - public string CardNo { get; set; } + /// + /// 卡号 + /// + [SugarColumn(IsNullable = false)] + public string CardNo { get; set; } - /// - /// 更换原因 - /// - public string Reason { get; set; } + /// + /// 更换原因 + /// + public string Reason { get; set; } - /// - /// 备注 - /// - public string Remark { get; set; } + /// + /// 备注 + /// + public string Remark { get; set; } - public string TenantId { get; set; } -} + public string TenantId { get; set; } + } +} \ No newline at end of file diff --git a/Src/Dlhis.Entity/Basic/Entity/GainfoEntity.cs b/Src/Dlhis.Entity/Basic/Entity/GainfoEntity.cs index 6ae4192d..fdf970e8 100644 --- a/Src/Dlhis.Entity/Basic/Entity/GainfoEntity.cs +++ b/Src/Dlhis.Entity/Basic/Entity/GainfoEntity.cs @@ -1,5 +1,5 @@ using Dlhis.Entity.Basic.Enums; -using Kurisu.SqlSugar; +using Kurisu.AspNetCore.DataAccess.SqlSugar; using SqlSugar; using SqlSugar.DbConvert; @@ -12,79 +12,79 @@ namespace Dlhis.Entity.Basic.Entity; public class GainfoEntity : SugarBaseEntity { /// - /// 档案号 + /// 档案号 /// [SugarColumn(ColumnDescription = "档案号", UniqueGroupNameList = new[] { "idx_Gainfo_No" })] public string No { get; set; } /// - /// SAP内部编号 + /// SAP内部编号 /// [SugarColumn(ColumnDescription = "SAP内部编号")] public string SapNo { get; set; } /// - /// 人员类型 + /// 人员类型 /// [SugarColumn(ColumnDescription = "人员类型")] public string Type { get; set; } /// - /// 姓名 + /// 姓名 /// [SugarColumn(ColumnDescription = "姓名")] public string Name { get; set; } /// - /// 外文名字 + /// 外文名字 /// [SugarColumn(ColumnDescription = "外文名字")] public string NameEn { get; set; } /// - /// 学工号 + /// 学工号 /// [SugarColumn(ColumnDescription = "学工号", UniqueGroupNameList = new[] { "idx_Gainfo_Code" })] public string Code { get; set; } /// - /// 国家代码 + /// 国家代码 /// [SugarColumn(ColumnDescription = "国家代码")] public string CountryNo { get; set; } /// - /// 证件类型代码 + /// 证件类型代码 /// [SugarColumn(ColumnDescription = "证件类型代码")] public string IdClass { get; set; } /// - /// 身份证号 + /// 身份证号 /// [SugarColumn(ColumnDescription = "身份证号", UniqueGroupNameList = new[] { "idx_Gainfo_IdNo" })] public string IdNo { get; set; } /// - /// 身份证籍贯区域代码 + /// 身份证籍贯区域代码 /// [SugarColumn(ColumnDescription = "身份证籍贯区域代码")] public string Native { get; set; } /// - /// 性别 + /// 性别 /// [SugarColumn(ColumnDescription = "性别", ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert))] public GenderEnumType Gender { get; set; } /// - /// 生日 + /// 生日 /// [SugarColumn(ColumnDescription = "生日")] public DateTime Birthday { get; set; } /// - /// 身份证地址 + /// 身份证地址 /// [SugarColumn(ColumnDescription = "身份证地址")] public string Address { get; set; } @@ -96,104 +96,104 @@ public class GainfoEntity : SugarBaseEntity //public string Marital { get; set; } /// - /// 部门编码 + /// 部门编码 /// [SugarColumn(ColumnDescription = "部门编码")] public string DepartmentNo { get; set; } /// - /// 民族代码 + /// 民族代码 /// [SugarColumn(ColumnDescription = "民族代码")] public string Nation { get; set; } /// - /// 手机号码 + /// 手机号码 /// [SugarColumn(ColumnDescription = "手机号码")] public string Phone { get; set; } /// - /// 学历 + /// 学历 /// [SugarColumn(ColumnDescription = "学历")] public string Degree { get; set; } /// - /// 岗位 + /// 岗位 /// [SugarColumn(ColumnDescription = "岗位")] public string PositionNo { get; set; } /// - /// 职等 + /// 职等 /// [SugarColumn(ColumnDescription = "职等")] public string Grade { get; set; } /// - /// 职级 + /// 职级 /// [SugarColumn(ColumnDescription = "职级")] public string Title { get; set; } /// - /// 卡号 + /// 卡号 /// [SugarColumn(ColumnDescription = "卡号", IndexGroupNameList = new[] { "idx_Gainfo_CardNo" })] public string CardNo { get; set; } /// - /// 备注 + /// 备注 /// [SugarColumn(ColumnDescription = "备注")] public string Remark { get; set; } /// - /// 人事范围 + /// 人事范围 /// [SugarColumn(ColumnDescription = "人事范围")] public string Werks { get; set; } /// - /// 工作地 + /// 工作地 /// [SugarColumn(ColumnDescription = "工作地")] public string Workplace { get; set; } /// - /// 厂区 + /// 厂区 /// [SugarColumn(ColumnDescription = "厂区")] public string Factory { get; set; } /// - /// 成本中心 + /// 成本中心 /// [SugarColumn(ColumnDescription = "成本中心")] public string CostId { get; set; } /// - /// 入职日期 + /// 入职日期 /// [SugarColumn(IsNullable = true, ColumnDescription = "入职日期", ColumnDataType = "date")] public DateTime? EntryDate { get; set; } /// - /// 离职日期 + /// 离职日期 /// [SugarColumn(IsNullable = true, ColumnDescription = "离职日期", ColumnDataType = "date")] public DateTime? ResignationDate { get; set; } /// - /// 身份认证用户Id(如果为空匹配code) + /// 身份认证用户Id(如果为空匹配code) /// [SugarColumn(ColumnDescription = "身份认证用户Id", IsNullable = true)] public int IdentityUserId { get; set; } } /// -/// 离职人员档案表 +/// 离职人员档案表 /// [SugarTable(TableName = "GainfoLeave", TableDescription = "离职人员档案表")] public class GainfoLeaveEntity : GainfoEntity @@ -201,14 +201,14 @@ public class GainfoLeaveEntity : GainfoEntity } /// -/// 外部人员档案表 +/// 外部人员档案表 /// [SugarTable(TableName = "GainfoExternal", TableDescription = "外部人员档案表")] public class GainfoExternalEntity : GainfoEntity { /// - /// 公司 + /// 公司 /// [SugarColumn(ColumnDescription = "公司", IsNullable = false)] public string Company { get; set; } -} +} \ No newline at end of file diff --git a/Src/Dlhis.Entity/Basic/Entity/GainfoFaceEntity.cs b/Src/Dlhis.Entity/Basic/Entity/GainfoFaceEntity.cs index 967ce16f..b074232c 100644 --- a/Src/Dlhis.Entity/Basic/Entity/GainfoFaceEntity.cs +++ b/Src/Dlhis.Entity/Basic/Entity/GainfoFaceEntity.cs @@ -1,27 +1,27 @@ -using Kurisu.SqlSugar; +using Kurisu.AspNetCore.DataAccess.SqlSugar; using Microsoft.Extensions.DependencyInjection; using SqlSugar; -namespace Dlhis.Entity.Basic.Entity; - -/// -/// 档案人脸信息 -/// -[SkipScan] -[SugarTable(TableName = "GainfoFace", TableDescription = "档案人脸信息")] -public class GainfoFaceEntity : SugarBaseEntity +namespace Dlhis.Entity.Basic.Entity { - /// - /// 学工号 + /// 档案人脸信息 /// - [SugarColumn(IsNullable = false, UniqueGroupNameList = new[] { "idx_GainfoFace_UserCode" })] - public string UserCode { get; set; } + [SkipScan] + [SugarTable(TableName = "GainfoFace", TableDescription = "档案人脸信息")] + public class GainfoFaceEntity : SugarBaseEntity + { + /// + /// 学工号 + /// + [SugarColumn(IsNullable = false, UniqueGroupNameList = new[] { "idx_GainfoFace_UserCode" })] + public string UserCode { get; set; } - /// - /// 人脸 - /// - [SugarColumn(ColumnDataType = "longtext", IsNullable = false)] - public string Face { get; set; } -} + /// + /// 人脸 + /// + [SugarColumn(ColumnDataType = "longtext", IsNullable = false)] + public string Face { get; set; } + } +} \ No newline at end of file diff --git a/Src/Dlhis.Entity/Basic/Entity/GainfoGroupEntity.cs b/Src/Dlhis.Entity/Basic/Entity/GainfoGroupEntity.cs index 809c8727..77aee1e4 100644 --- a/Src/Dlhis.Entity/Basic/Entity/GainfoGroupEntity.cs +++ b/Src/Dlhis.Entity/Basic/Entity/GainfoGroupEntity.cs @@ -1,50 +1,51 @@ -using Kurisu.Core.DataAccess.Entity; -using Kurisu.SqlSugar; +using Kurisu.AspNetCore.DataAccess.Entity; +using Kurisu.AspNetCore.DataAccess.SqlSugar; using SqlSugar; -namespace Dlhis.Entity.Basic.Entity; - -/// -/// 档案组 -/// -[SugarTable(TableName = "GainfoGroup", TableDescription = "档案组")] -public class GainfoGroupEntity : SugarBaseEntity, ITenantId +namespace Dlhis.Entity.Basic.Entity { /// - /// 父级Code + /// 档案组 /// - public Guid? PCode { get; set; } + [SugarTable(TableName = "GainfoGroup", TableDescription = "档案组")] + public class GainfoGroupEntity : SugarBaseEntity, ITenantId + { + /// + /// 父级Code + /// + public Guid? PCode { get; set; } - /// - /// 分组code - /// - [SugarColumn(ColumnDescription = "分组code")] - public Guid Code { get; set; } + /// + /// 分组code + /// + [SugarColumn(ColumnDescription = "分组code")] + public Guid Code { get; set; } - /// - /// 名称 - /// - [SugarColumn(ColumnDescription = "名称")] - public string Name { get; set; } + /// + /// 名称 + /// + [SugarColumn(ColumnDescription = "名称")] + public string Name { get; set; } - /// - /// 备注 - /// - [SugarColumn(ColumnDescription = "备注")] - public string Remark { get; set; } + /// + /// 备注 + /// + [SugarColumn(ColumnDescription = "备注")] + public string Remark { get; set; } - /// - /// 是否默认分组 - /// - [SugarColumn(ColumnDescription = "是否默认分组", ColumnDataType = "bit", DefaultValue = "1")] - public bool IsDefault { get; set; } = true; + /// + /// 是否默认分组 + /// + [SugarColumn(ColumnDescription = "是否默认分组", ColumnDataType = "bit", DefaultValue = "1")] + public bool IsDefault { get; set; } = true; - /// - /// 是否可编辑 - /// - [SugarColumn(ColumnDescription = "是否可编辑", ColumnDataType = "bit", DefaultValue = "1")] - public bool Editable { get; set; } = true; + /// + /// 是否可编辑 + /// + [SugarColumn(ColumnDescription = "是否可编辑", ColumnDataType = "bit", DefaultValue = "1")] + public bool Editable { get; set; } = true; - public string TenantId { get; set; } -} + public string TenantId { get; set; } + } +} \ No newline at end of file diff --git a/Src/Dlhis.Entity/Basic/Entity/GainfoGroupRelationshipEntity.cs b/Src/Dlhis.Entity/Basic/Entity/GainfoGroupRelationshipEntity.cs index a8747085..360e7f29 100644 --- a/Src/Dlhis.Entity/Basic/Entity/GainfoGroupRelationshipEntity.cs +++ b/Src/Dlhis.Entity/Basic/Entity/GainfoGroupRelationshipEntity.cs @@ -1,22 +1,23 @@ -using Kurisu.SqlSugar; +using Kurisu.AspNetCore.DataAccess.SqlSugar; using SqlSugar; -namespace Dlhis.Entity.Basic.Entity; - -/// -/// 档案人员组关系 -/// -[SugarTable(TableName = "GainfoGroupRelationship", TableDescription = "档案人员组关系")] -public class GainfoGroupRelationshipEntity : SugarBaseEntity +namespace Dlhis.Entity.Basic.Entity { /// - /// 分组code + /// 档案人员组关系 /// - public Guid GroupCode { get; set; } + [SugarTable(TableName = "GainfoGroupRelationship", TableDescription = "档案人员组关系")] + public class GainfoGroupRelationshipEntity : SugarBaseEntity + { + /// + /// 分组code + /// + public Guid GroupCode { get; set; } - /// - /// 人员档案号 - /// - [SugarColumn(ColumnDescription = "人员档案号")] - public string UserNo { get; set; } -} + /// + /// 人员档案号 + /// + [SugarColumn(ColumnDescription = "人员档案号")] + public string UserNo { get; set; } + } +} \ No newline at end of file diff --git a/Src/Dlhis.Entity/Basic/Entity/GainfoMealEntity.cs b/Src/Dlhis.Entity/Basic/Entity/GainfoMealEntity.cs index c0fcba3d..75cd45b1 100644 --- a/Src/Dlhis.Entity/Basic/Entity/GainfoMealEntity.cs +++ b/Src/Dlhis.Entity/Basic/Entity/GainfoMealEntity.cs @@ -1,48 +1,49 @@ -using Kurisu.Core.DataAccess.Entity; -using Kurisu.SqlSugar; +using Kurisu.AspNetCore.DataAccess.Entity; +using Kurisu.AspNetCore.DataAccess.SqlSugar; using SqlSugar; -namespace Dlhis.Entity.Basic.Entity; - -/// -/// 就餐人员 -/// -[SugarTable(TableName = "GainfoMeal", TableDescription = "就餐人员")] -public class GainfoMealEntity : SugarBaseEntity, IVersion +namespace Dlhis.Entity.Basic.Entity { /// - /// 档案号 + /// 就餐人员 /// - [SugarColumn(IsNullable = false, ColumnDescription = "档案号", UniqueGroupNameList = new[] { "idx_CanteenUser_UserNo" })] - public string UserNo { get; set; } + [SugarTable(TableName = "GainfoMeal", TableDescription = "就餐人员")] + public class GainfoMealEntity : SugarBaseEntity, IVersion + { + /// + /// 档案号 + /// + [SugarColumn(IsNullable = false, ColumnDescription = "档案号", UniqueGroupNameList = new[] { "idx_CanteenUser_UserNo" })] + public string UserNo { get; set; } - /// - /// 工号 - /// - [SugarColumn(IsNullable = false, ColumnDescription = "工号", UniqueGroupNameList = new[] { "idx_CanteenUser_UserCode" })] - public string UserCode { get; set; } + /// + /// 工号 + /// + [SugarColumn(IsNullable = false, ColumnDescription = "工号", UniqueGroupNameList = new[] { "idx_CanteenUser_UserCode" })] + public string UserCode { get; set; } - /// - /// 余额 - /// - [SugarColumn(ColumnDescription = "余额")] - public decimal Balance { get; set; } + /// + /// 余额 + /// + [SugarColumn(ColumnDescription = "余额")] + public decimal Balance { get; set; } - /// - /// 余额(充值) - /// - [SugarColumn(ColumnDescription = "余额(充值)")] - public decimal BalanceOfRecharge { get; set; } + /// + /// 余额(充值) + /// + [SugarColumn(ColumnDescription = "余额(充值)")] + public decimal BalanceOfRecharge { get; set; } - /// - /// 余额(餐补) - /// - [SugarColumn(ColumnDescription = "余额(餐补)")] - public decimal BalanceOfSubsidies { get; set; } + /// + /// 余额(餐补) + /// + [SugarColumn(ColumnDescription = "余额(餐补)")] + public decimal BalanceOfSubsidies { get; set; } - /// - /// 版本号 - /// - [SugarColumn(ColumnDescription = "版本号")] - public int Version { get; set; } -} + /// + /// 版本号 + /// + [SugarColumn(ColumnDescription = "版本号")] + public int Version { get; set; } + } +} \ No newline at end of file diff --git a/Src/Dlhis.Entity/Basic/Entity/GainfoSap.cs b/Src/Dlhis.Entity/Basic/Entity/GainfoSap.cs deleted file mode 100644 index e6a22c77..00000000 --- a/Src/Dlhis.Entity/Basic/Entity/GainfoSap.cs +++ /dev/null @@ -1,125 +0,0 @@ -using SqlSugar; - -namespace Dlhis.Entity.Basic.Entity; - -[SugarTable(TableName = "GainfoSap")] -public class GainfoSapEntity -{ - - [PkColumn] - public int id { get; set; } - - public string ano { get; set; } - public string @class { get; set; } - - public string passwd { get; set; } - public string question { get; set; } - - public string answer { get; set; } - public string gname { get; set; } - - [UpdateColumn] - public string ename { get; set; } - - public string country { get; set; } - public string idcls { get; set; } - public string idno { get; set; } - public string native { get; set; } - public string sex { get; set; } - public DateTime birthday { get; set; } - public string address { get; set; } - public string postcode { get; set; } - public string occupation { get; set; } - public string appellation { get; set; } - public string nation { get; set; } - public string phone { get; set; } - public string fax { get; set; } - public string mobile { get; set; } - public string email { get; set; } - public string web { get; set; } - public string vip { get; set; } - public string sec { get; set; } - public string cropsno { get; set; } - public string cropname { get; set; } - public string fancy { get; set; } - public string remark { get; set; } - - public int amount { get; set; } - public int days { get; set; } - public decimal consume01 { get; set; } - - public decimal consume02 { get; set; } - - public decimal consume03 { get; set; } - - public decimal consume04 { get; set; } - public string log_id { get; set; } - public string log_shift { get; set; } - public DateTime? log_date { get; set; } - public string log_ip { get; set; } - public int times { get; set; } - public int logmark { get; set; } - public string rmcode { get; set; } - public string mkt { get; set; } - public string src { get; set; } - public string isowner { get; set; } - - /// - /// 入职日期 - /// - public DateTime createdate { get; set; } - - public string PERNR { get; set; } - - public string WERKS { get; set; } - - public string ZSTATUS { get; set; } - - public string KOSTL { get; set; } - - public string ZZ_ZD { get; set; } - - public string Z_ZJ { get; set; } - - public string STELL { get; set; } - - public string STELL_NM { get; set; } - - /// - /// 离职日期 - /// - public DateTime? ZLZRQ { get; set; } - - public string MASSN { get; set; } - - public string MNTXT { get; set; } - public string MASSG { get; set; } - public string MGTXT { get; set; } - public DateTime? logdate { get; set; } - public DateTime? updatelogdate { get; set; } - public string guestno { get; set; } - public string ZZ_KLX { get; set; } - public DateTime? DAT01 { get; set; } - - public string ZZ_COUNNM { get; set; } - public string ZZ_GZDJDNM { get; set; } - public string ZZ_GZDCQNM { get; set; } - -} - - -public class UpdateColumnAttribute : Attribute -{ - -} - -public class PkColumnAttribute : Attribute -{ - -} - - -public class IgnoreColumnAttribute : Attribute -{ - -} diff --git a/Src/Dlhis.Entity/Basic/Entity/GainfoSapEntity.cs b/Src/Dlhis.Entity/Basic/Entity/GainfoSapEntity.cs new file mode 100644 index 00000000..39b143e6 --- /dev/null +++ b/Src/Dlhis.Entity/Basic/Entity/GainfoSapEntity.cs @@ -0,0 +1,105 @@ +using SqlSugar; + +namespace Dlhis.Entity.Basic.Entity +{ + [SugarTable(TableName = "GainfoSap")] + public class GainfoSapEntity + { + public int id { get; set; } + + public string ano { get; set; } + public string @class { get; set; } + + public string passwd { get; set; } + public string question { get; set; } + + public string answer { get; set; } + public string gname { get; set; } + + public string ename { get; set; } + + public string country { get; set; } + public string idcls { get; set; } + public string idno { get; set; } + public string native { get; set; } + public string sex { get; set; } + public DateTime birthday { get; set; } + public string address { get; set; } + public string postcode { get; set; } + public string occupation { get; set; } + public string appellation { get; set; } + public string nation { get; set; } + public string phone { get; set; } + public string fax { get; set; } + public string mobile { get; set; } + public string email { get; set; } + public string web { get; set; } + public string vip { get; set; } + public string sec { get; set; } + public string cropsno { get; set; } + public string cropname { get; set; } + public string fancy { get; set; } + public string remark { get; set; } + + public int amount { get; set; } + public int days { get; set; } + public decimal consume01 { get; set; } + + public decimal consume02 { get; set; } + + public decimal consume03 { get; set; } + + public decimal consume04 { get; set; } + public string log_id { get; set; } + public string log_shift { get; set; } + public DateTime? log_date { get; set; } + public string log_ip { get; set; } + public int times { get; set; } + public int logmark { get; set; } + public string rmcode { get; set; } + public string mkt { get; set; } + public string src { get; set; } + public string isowner { get; set; } + + /// + /// 入职日期 + /// + public DateTime createdate { get; set; } + + public string PERNR { get; set; } + + public string WERKS { get; set; } + + public string ZSTATUS { get; set; } + + public string KOSTL { get; set; } + + public string ZZ_ZD { get; set; } + + public string Z_ZJ { get; set; } + + public string STELL { get; set; } + + public string STELL_NM { get; set; } + + /// + /// 离职日期 + /// + public DateTime? ZLZRQ { get; set; } + + public string MASSN { get; set; } + + public string MNTXT { get; set; } + public string MASSG { get; set; } + public string MGTXT { get; set; } + public DateTime? logdate { get; set; } + public DateTime? updatelogdate { get; set; } + public string guestno { get; set; } + public string ZZ_KLX { get; set; } + public DateTime? DAT01 { get; set; } + + public string ZZ_COUNNM { get; set; } + public string ZZ_GZDJDNM { get; set; } + public string ZZ_GZDCQNM { get; set; } + } +} \ No newline at end of file diff --git a/Src/Dlhis.Entity/Basic/Entity/OutSourceEntity.cs b/Src/Dlhis.Entity/Basic/Entity/OutSourceEntity.cs deleted file mode 100644 index afc507e7..00000000 --- a/Src/Dlhis.Entity/Basic/Entity/OutSourceEntity.cs +++ /dev/null @@ -1,10 +0,0 @@ -using Kurisu.SqlSugar; -using SqlSugar; - -namespace Dlhis.Entity.Basic.Entity; - -[SugarTable(TableName = "OutSources")] -public class OutSourceEntity : SugarBaseEntity -{ - public string Code { get; set; } -} \ No newline at end of file diff --git a/Src/Dlhis.Entity/Basic/Entity/OutsourceEntity.cs b/Src/Dlhis.Entity/Basic/Entity/OutsourceEntity.cs new file mode 100644 index 00000000..094240a7 --- /dev/null +++ b/Src/Dlhis.Entity/Basic/Entity/OutsourceEntity.cs @@ -0,0 +1,36 @@ +using Kurisu.AspNetCore.DataAccess.SqlSugar; +using SqlSugar; + +namespace Dlhis.Entity.Basic.Entity +{ + /// + /// 外包人员 + /// + [SugarTable(TableName = "Outsource", TableDescription = "外包人员")] + public class OutsourceEntity : SugarBaseEntity + { + /// + /// 外包人员工号 LS开头 + /// + [SugarColumn(IsNullable = false, ColumnDescription = "工号")] + public string Code { get; set; } + + /// + /// 供应商 + /// + [SugarColumn(IsNullable = false, ColumnDescription = "供应商")] + public string Supplier { get; set; } + + /// + /// 对接人员工号 + /// + [SugarColumn(IsNullable = false, ColumnDescription = "对接人工号")] + public string SapCode { get; set; } + + /// + /// 对接人员手机号 + /// + [SugarColumn(IsNullable = false, ColumnDescription = "对接人手机号")] + public string SapPhone { get; set; } + } +} \ No newline at end of file diff --git a/Src/Dlhis.Entity/Basic/Entity/PointMapDetailEntity.cs b/Src/Dlhis.Entity/Basic/Entity/PointMapDetailEntity.cs index eb95854f..c54e9b9b 100644 --- a/Src/Dlhis.Entity/Basic/Entity/PointMapDetailEntity.cs +++ b/Src/Dlhis.Entity/Basic/Entity/PointMapDetailEntity.cs @@ -1,44 +1,45 @@ using Dlhis.Entity.Basic.Enums; -using Kurisu.Core.DataAccess.Entity; -using Kurisu.SqlSugar; +using Kurisu.AspNetCore.DataAccess.Entity; +using Kurisu.AspNetCore.DataAccess.SqlSugar; using SqlSugar; using SqlSugar.DbConvert; -namespace Dlhis.Entity.Basic.Entity; - -/// -/// 点位图数据 -/// -[SugarTable(TableName = "PointMapDetail", TableDescription = "点位图数据")] -public class PointMapDetailEntity : SugarBaseEntity, ITenantId +namespace Dlhis.Entity.Basic.Entity { /// - /// 点位图code + /// 点位图数据 /// - [SugarColumn(IsNullable = false, ColumnDescription = "点位图code")] - public Guid PointMapCode { get; set; } + [SugarTable(TableName = "PointMapDetail", TableDescription = "点位图数据")] + public class PointMapDetailEntity : SugarBaseEntity, ITenantId + { + /// + /// 点位图code + /// + [SugarColumn(IsNullable = false, ColumnDescription = "点位图code")] + public Guid PointMapCode { get; set; } - /// - /// 数据code - /// - public Guid UniqueCode { get; set; } + /// + /// 数据code + /// + public Guid UniqueCode { get; set; } - /// - /// 数据类型 - /// - [SugarColumn(IsNullable = false, ColumnDescription = "数据类型", ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert))] - public PointMapDetailEnumType Type { get; set; } + /// + /// 数据类型 + /// + [SugarColumn(IsNullable = false, ColumnDescription = "数据类型", ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert))] + public PointMapDetailEnumType Type { get; set; } - /// - /// XYZ - /// - [SugarColumn(IsNullable = false, ColumnDescription = "XYZ")] - public string Position { get; set; } + /// + /// XYZ + /// + [SugarColumn(IsNullable = false, ColumnDescription = "XYZ")] + public string Position { get; set; } - /// - /// 备注 - /// - public string Remark { get; set; } + /// + /// 备注 + /// + public string Remark { get; set; } - public string TenantId { get; set; } -} + public string TenantId { get; set; } + } +} \ No newline at end of file diff --git a/Src/Dlhis.Entity/Basic/Entity/PointMapEntity.cs b/Src/Dlhis.Entity/Basic/Entity/PointMapEntity.cs index 53414e4e..7e4fb136 100644 --- a/Src/Dlhis.Entity/Basic/Entity/PointMapEntity.cs +++ b/Src/Dlhis.Entity/Basic/Entity/PointMapEntity.cs @@ -1,36 +1,37 @@ -using Kurisu.Core.DataAccess.Entity; -using Kurisu.SqlSugar; +using Kurisu.AspNetCore.DataAccess.Entity; +using Kurisu.AspNetCore.DataAccess.SqlSugar; using SqlSugar; -namespace Dlhis.Entity.Basic.Entity; - -/// -/// 点位图 -/// -[SugarTable(TableName = "PointMaps", TableDescription = "点位图")] -public class PointMapEntity : SugarBaseEntity, ITenantId, IImageUrl +namespace Dlhis.Entity.Basic.Entity { /// - /// code + /// 点位图 /// - [SugarColumn(IsNullable = false, ColumnDescription = "code")] - public Guid Code { get; set; } + [SugarTable(TableName = "PointMaps", TableDescription = "点位图")] + public class PointMapEntity : SugarBaseEntity, ITenantId, IImageUrl + { + /// + /// code + /// + [SugarColumn(IsNullable = false, ColumnDescription = "code")] + public Guid Code { get; set; } - /// - /// 位置名称 - /// - [SugarColumn(IsNullable = false, ColumnDescription = "点位名称")] - public string Name { get; set; } - - /// - /// 图 - /// - [SugarColumn(IsNullable = false, ColumnDescription = "图片地址")] - public string ImageUrl { get; set; } + /// + /// 位置名称 + /// + [SugarColumn(IsNullable = false, ColumnDescription = "点位名称")] + public string Name { get; set; } - [SugarColumn(ColumnDescription = "备注")] - public string Remark { get; set; } + [SugarColumn(ColumnDescription = "备注")] + public string Remark { get; set; } - public string TenantId { get; set; } -} + /// + /// 图 + /// + [SugarColumn(IsNullable = false, ColumnDescription = "图片地址")] + public string ImageUrl { get; set; } + + public string TenantId { get; set; } + } +} \ No newline at end of file diff --git a/Src/Dlhis.Entity/Basic/Entity/PositionEntity.cs b/Src/Dlhis.Entity/Basic/Entity/PositionEntity.cs index b20abe31..75c64692 100644 --- a/Src/Dlhis.Entity/Basic/Entity/PositionEntity.cs +++ b/Src/Dlhis.Entity/Basic/Entity/PositionEntity.cs @@ -1,4 +1,4 @@ -using Kurisu.SqlSugar; +using Kurisu.AspNetCore.DataAccess.SqlSugar; using SqlSugar; namespace Dlhis.Entity.Basic.Entity; diff --git a/Src/Dlhis.Entity/Basic/Entity/WerkEntity.cs b/Src/Dlhis.Entity/Basic/Entity/WerkEntity.cs index 6d8890bb..d275d96d 100644 --- a/Src/Dlhis.Entity/Basic/Entity/WerkEntity.cs +++ b/Src/Dlhis.Entity/Basic/Entity/WerkEntity.cs @@ -1,4 +1,4 @@ -using Kurisu.SqlSugar; +using Kurisu.AspNetCore.DataAccess.SqlSugar; using Mapster; using SqlSugar; diff --git a/Src/Dlhis.Entity/Canteen/Entities/BalanceRecordEntity.cs b/Src/Dlhis.Entity/Canteen/Entities/BalanceRecordEntity.cs index 6910ccef..49e0b2bd 100644 --- a/Src/Dlhis.Entity/Canteen/Entities/BalanceRecordEntity.cs +++ b/Src/Dlhis.Entity/Canteen/Entities/BalanceRecordEntity.cs @@ -1,6 +1,6 @@ using Dlhis.Entity.Canteen.Enums; -using Kurisu.Core.DataAccess.Entity; -using Kurisu.SqlSugar; +using Kurisu.AspNetCore.DataAccess.Entity; +using Kurisu.AspNetCore.DataAccess.SqlSugar; using SqlSugar; using SqlSugar.DbConvert; diff --git a/Src/Dlhis.Entity/Canteen/Entities/CanteenOrderDetailEntity.cs b/Src/Dlhis.Entity/Canteen/Entities/CanteenOrderDetailEntity.cs index e6a0285d..4c800916 100644 --- a/Src/Dlhis.Entity/Canteen/Entities/CanteenOrderDetailEntity.cs +++ b/Src/Dlhis.Entity/Canteen/Entities/CanteenOrderDetailEntity.cs @@ -1,5 +1,5 @@ -using Kurisu.Core.DataAccess.Entity; -using Kurisu.SqlSugar; +using Kurisu.AspNetCore.DataAccess.Entity; +using Kurisu.AspNetCore.DataAccess.SqlSugar; using SqlSugar; namespace Dlhis.Entity.Canteen.Entities; diff --git a/Src/Dlhis.Entity/Canteen/Entities/DishesCategoryEntity.cs b/Src/Dlhis.Entity/Canteen/Entities/DishesCategoryEntity.cs index 7ee20c16..1e980a86 100644 --- a/Src/Dlhis.Entity/Canteen/Entities/DishesCategoryEntity.cs +++ b/Src/Dlhis.Entity/Canteen/Entities/DishesCategoryEntity.cs @@ -1,5 +1,5 @@ -using Kurisu.Core.DataAccess.Entity; -using Kurisu.SqlSugar; +using Kurisu.AspNetCore.DataAccess.Entity; +using Kurisu.AspNetCore.DataAccess.SqlSugar; using SqlSugar; namespace Dlhis.Entity.Canteen.Entities; diff --git a/Src/Dlhis.Entity/Canteen/Entities/DishesEntity.cs b/Src/Dlhis.Entity/Canteen/Entities/DishesEntity.cs index 99fd60d5..f32b40fd 100644 --- a/Src/Dlhis.Entity/Canteen/Entities/DishesEntity.cs +++ b/Src/Dlhis.Entity/Canteen/Entities/DishesEntity.cs @@ -1,5 +1,5 @@ -using Kurisu.Core.DataAccess.Entity; -using Kurisu.SqlSugar; +using Kurisu.AspNetCore.DataAccess.Entity; +using Kurisu.AspNetCore.DataAccess.SqlSugar; using Mapster; using SqlSugar; diff --git a/Src/Dlhis.Entity/Canteen/Entities/DishesMenuEntity.cs b/Src/Dlhis.Entity/Canteen/Entities/DishesMenuEntity.cs index 237f2b01..e6538244 100644 --- a/Src/Dlhis.Entity/Canteen/Entities/DishesMenuEntity.cs +++ b/Src/Dlhis.Entity/Canteen/Entities/DishesMenuEntity.cs @@ -1,6 +1,6 @@ using Dlhis.Entity.Canteen.Enums; -using Kurisu.Core.DataAccess.Entity; -using Kurisu.SqlSugar; +using Kurisu.AspNetCore.DataAccess.Entity; +using Kurisu.AspNetCore.DataAccess.SqlSugar; using SqlSugar; using SqlSugar.DbConvert; diff --git a/Src/Dlhis.Entity/Canteen/Entities/MealSupplementRecordEntity.cs b/Src/Dlhis.Entity/Canteen/Entities/MealSupplementRecordEntity.cs index 45f29262..9292d21c 100644 --- a/Src/Dlhis.Entity/Canteen/Entities/MealSupplementRecordEntity.cs +++ b/Src/Dlhis.Entity/Canteen/Entities/MealSupplementRecordEntity.cs @@ -1,5 +1,5 @@ using Dlhis.Entity.Basic.Enums; -using Kurisu.SqlSugar; +using Kurisu.AspNetCore.DataAccess.SqlSugar; using SqlSugar; using SqlSugar.DbConvert; diff --git a/Src/Dlhis.Entity/Common/ApiLogEntity.cs b/Src/Dlhis.Entity/Common/ApiLogEntity.cs index 2f8fd03a..6b5132d7 100644 --- a/Src/Dlhis.Entity/Common/ApiLogEntity.cs +++ b/Src/Dlhis.Entity/Common/ApiLogEntity.cs @@ -1,7 +1,7 @@ -using SqlSugar; +using Kurisu.AspNetCore.DataAccess.SqlSugar; +using SqlSugar; using SqlSugar.DbConvert; using Microsoft.Extensions.Logging; -using Kurisu.SqlSugar; namespace Dlhis.Entity.Common; diff --git a/Src/Dlhis.Entity/Common/FileVersionEntity.cs b/Src/Dlhis.Entity/Common/FileVersionEntity.cs index 5755a41b..30699d36 100644 --- a/Src/Dlhis.Entity/Common/FileVersionEntity.cs +++ b/Src/Dlhis.Entity/Common/FileVersionEntity.cs @@ -1,4 +1,4 @@ -using Kurisu.SqlSugar; +using Kurisu.AspNetCore.DataAccess.SqlSugar; using SqlSugar; namespace Dlhis.Entity.Common; diff --git a/Src/Dlhis.Entity/Device/Entities/DeviceGroupEntity.cs b/Src/Dlhis.Entity/Device/Entities/DeviceGroupEntity.cs index c54f9911..1b7a35d3 100644 --- a/Src/Dlhis.Entity/Device/Entities/DeviceGroupEntity.cs +++ b/Src/Dlhis.Entity/Device/Entities/DeviceGroupEntity.cs @@ -1,6 +1,6 @@ using Dlhis.Entity.Device.Enums; -using Kurisu.Core.DataAccess.Entity; -using Kurisu.SqlSugar; +using Kurisu.AspNetCore.DataAccess.Entity; +using Kurisu.AspNetCore.DataAccess.SqlSugar; using SqlSugar; using SqlSugar.DbConvert; diff --git a/Src/Dlhis.Entity/Device/Entities/DeviceGroupRelationshipEntity.cs b/Src/Dlhis.Entity/Device/Entities/DeviceGroupRelationshipEntity.cs index d3d79fe0..b93ffc62 100644 --- a/Src/Dlhis.Entity/Device/Entities/DeviceGroupRelationshipEntity.cs +++ b/Src/Dlhis.Entity/Device/Entities/DeviceGroupRelationshipEntity.cs @@ -1,5 +1,5 @@ -using Kurisu.Core.DataAccess.Entity; -using Kurisu.SqlSugar; +using Kurisu.AspNetCore.DataAccess.Entity; +using Kurisu.AspNetCore.DataAccess.SqlSugar; using SqlSugar; namespace Dlhis.Entity.Device.Entities; diff --git a/Src/Dlhis.Entity/Device/Entities/DeviceRegistryEntity.cs b/Src/Dlhis.Entity/Device/Entities/DeviceRegistryEntity.cs index f8ee249b..8743f7c3 100644 --- a/Src/Dlhis.Entity/Device/Entities/DeviceRegistryEntity.cs +++ b/Src/Dlhis.Entity/Device/Entities/DeviceRegistryEntity.cs @@ -1,5 +1,5 @@ -using Kurisu.Core.DataAccess.Entity; -using Kurisu.SqlSugar; +using Kurisu.AspNetCore.DataAccess.Entity; +using Kurisu.AspNetCore.DataAccess.SqlSugar; using SqlSugar; namespace Dlhis.Entity.Device.Entities; diff --git a/Src/Dlhis.Entity/Device/Entities/DeviceTaskEntity.cs b/Src/Dlhis.Entity/Device/Entities/DeviceTaskEntity.cs index 60b50883..d558a4b0 100644 --- a/Src/Dlhis.Entity/Device/Entities/DeviceTaskEntity.cs +++ b/Src/Dlhis.Entity/Device/Entities/DeviceTaskEntity.cs @@ -1,6 +1,6 @@ using Dlhis.Entity.Device.Enums; -using Kurisu.Core.DataAccess.Entity; -using Kurisu.SqlSugar; +using Kurisu.AspNetCore.DataAccess.Entity; +using Kurisu.AspNetCore.DataAccess.SqlSugar; using SqlSugar; using SqlSugar.DbConvert; diff --git a/Src/Dlhis.Entity/Device/Entities/DeviceUploadLogEntity.cs b/Src/Dlhis.Entity/Device/Entities/DeviceUploadLogEntity.cs index 2b9c7aef..6572ee84 100644 --- a/Src/Dlhis.Entity/Device/Entities/DeviceUploadLogEntity.cs +++ b/Src/Dlhis.Entity/Device/Entities/DeviceUploadLogEntity.cs @@ -1,6 +1,6 @@ using Dlhis.Entity.Device.Enums; -using Kurisu.Core.DataAccess.Entity; -using Kurisu.SqlSugar; +using Kurisu.AspNetCore.DataAccess.Entity; +using Kurisu.AspNetCore.DataAccess.SqlSugar; using SqlSugar; using SqlSugar.DbConvert; diff --git a/Src/Dlhis.Entity/Dlhis.Entity.csproj b/Src/Dlhis.Entity/Dlhis.Entity.csproj index 36c0cf47..b3d64512 100644 --- a/Src/Dlhis.Entity/Dlhis.Entity.csproj +++ b/Src/Dlhis.Entity/Dlhis.Entity.csproj @@ -7,7 +7,7 @@ - + diff --git a/Src/Dlhis.Entity/Sys/Entities/DevicePermissionEntity.cs b/Src/Dlhis.Entity/Sys/Entities/DevicePermissionEntity.cs index 39135b68..04c56024 100644 --- a/Src/Dlhis.Entity/Sys/Entities/DevicePermissionEntity.cs +++ b/Src/Dlhis.Entity/Sys/Entities/DevicePermissionEntity.cs @@ -1,6 +1,6 @@ using Dlhis.Entity.Sys.Enums; -using Kurisu.Core.DataAccess.Entity; -using Kurisu.SqlSugar; +using Kurisu.AspNetCore.DataAccess.Entity; +using Kurisu.AspNetCore.DataAccess.SqlSugar; using SqlSugar; using SqlSugar.DbConvert; diff --git a/Src/Dlhis.Entity/Sys/Entities/MenuEntity.cs b/Src/Dlhis.Entity/Sys/Entities/MenuEntity.cs index b36858da..10a70c6e 100644 --- a/Src/Dlhis.Entity/Sys/Entities/MenuEntity.cs +++ b/Src/Dlhis.Entity/Sys/Entities/MenuEntity.cs @@ -1,5 +1,5 @@ using Dlhis.Entity.Sys.Enums; -using Kurisu.SqlSugar; +using Kurisu.AspNetCore.DataAccess.SqlSugar; using SqlSugar; using SqlSugar.DbConvert; diff --git a/Src/Dlhis.Entity/Sys/Entities/MenuPermissionEntity.cs b/Src/Dlhis.Entity/Sys/Entities/MenuPermissionEntity.cs index 12074745..a7660750 100644 --- a/Src/Dlhis.Entity/Sys/Entities/MenuPermissionEntity.cs +++ b/Src/Dlhis.Entity/Sys/Entities/MenuPermissionEntity.cs @@ -1,6 +1,5 @@ using Dlhis.Entity.Sys.Enums; -using Kurisu.Core.DataAccess.Entity; -using Kurisu.SqlSugar; +using Kurisu.AspNetCore.DataAccess.SqlSugar; using SqlSugar; using SqlSugar.DbConvert; @@ -10,7 +9,7 @@ namespace Dlhis.Entity.Sys.Entities; /// 菜单权限 /// [SugarTable(TableName = "MenuPermission", TableDescription = "菜单权限")] -public class MenuPermissionEntity : SugarBaseEntity, ITenantId +public class MenuPermissionEntity : SugarBaseEntity { /// /// 权限分配类型 @@ -29,7 +28,4 @@ public class MenuPermissionEntity : SugarBaseEntity, ITenantId /// [SugarColumn(ColumnDescription = "菜单code")] public string Code { get; set; } - - - public string TenantId { get; set; } } \ No newline at end of file diff --git a/Src/Dlhis.Entity/Visitor/Entity/AppointmentAreaAssignmentEntity.cs b/Src/Dlhis.Entity/Visitor/Entity/AppointmentAreaAssignmentEntity.cs index 320f9599..02c0eead 100644 --- a/Src/Dlhis.Entity/Visitor/Entity/AppointmentAreaAssignmentEntity.cs +++ b/Src/Dlhis.Entity/Visitor/Entity/AppointmentAreaAssignmentEntity.cs @@ -1,5 +1,5 @@ -using Kurisu.Core.DataAccess.Entity; -using Kurisu.SqlSugar; +using Kurisu.AspNetCore.DataAccess.Entity; +using Kurisu.AspNetCore.DataAccess.SqlSugar; using SqlSugar; namespace Dlhis.Entity.Visitor.Entity; diff --git a/Src/Dlhis.Entity/Visitor/Entity/AppointmentAreaEntity.cs b/Src/Dlhis.Entity/Visitor/Entity/AppointmentAreaEntity.cs index 704969a0..6dbd1adf 100644 --- a/Src/Dlhis.Entity/Visitor/Entity/AppointmentAreaEntity.cs +++ b/Src/Dlhis.Entity/Visitor/Entity/AppointmentAreaEntity.cs @@ -1,6 +1,6 @@ using Dlhis.Entity.Visitor.Enums; -using Kurisu.Core.DataAccess.Entity; -using Kurisu.SqlSugar; +using Kurisu.AspNetCore.DataAccess.Entity; +using Kurisu.AspNetCore.DataAccess.SqlSugar; using Mapster; using SqlSugar; using SqlSugar.DbConvert; diff --git a/Src/Dlhis.Entity/Visitor/Entity/ApponintmentAreaEntity.cs b/Src/Dlhis.Entity/Visitor/Entity/ApponintmentAreaEntity.cs deleted file mode 100644 index 9b006faf..00000000 --- a/Src/Dlhis.Entity/Visitor/Entity/ApponintmentAreaEntity.cs +++ /dev/null @@ -1,44 +0,0 @@ -using Dlhis.Entity.Visitor.Enums; -using Kurisu.Core.DataAccess.Entity; -using Kurisu.SqlSugar; -using SqlSugar; -using SqlSugar.DbConvert; - -namespace Dlhis.Entity.Visitor.Entity; - -/// -/// 预约区域 -/// -[SugarTable(TableName = "ApponintmentArea", TableDescription = "预约区域")] -public class ApponintmentAreaEntity : SugarBaseEntity, ITenantId -{ - /// - /// 区域类型 - /// - [SugarColumn(IsNullable = false, ColumnDescription = "区域类型", ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert))] - public AppointmentAreaEnumType Type { get; set; } - - /// - /// 自定义编码 - /// - [SugarColumn(IsNullable = false, ColumnDescription = "自定义编码", UniqueGroupNameList = new[] { "idx_aa_cc_tid" })] - public string CustomCode { get; set; } - - /// - /// 名称 - /// - [SugarColumn(IsNullable = false, ColumnDescription = "名称")] - public string Name { get; set; } - - /// - /// 备注 - /// - [SugarColumn(IsNullable = true, ColumnDescription = "备注")] - public string Remark { get; set; } - - /// - /// 基地/租户 - /// - [SugarColumn(IsNullable = false, ColumnDescription = " 基地/租户", UniqueGroupNameList = new[] { "idx_aa_cc_tid" })] - public string TenantId { get; set; } -} diff --git a/Src/Dlhis.Entity/Visitor/Entity/VisitorAppointmentDetailEntity.cs b/Src/Dlhis.Entity/Visitor/Entity/VisitorAppointmentDetailEntity.cs index ccbd5dbc..5ade578a 100644 --- a/Src/Dlhis.Entity/Visitor/Entity/VisitorAppointmentDetailEntity.cs +++ b/Src/Dlhis.Entity/Visitor/Entity/VisitorAppointmentDetailEntity.cs @@ -1,5 +1,5 @@ using Dlhis.Entity.Visitor.Enums; -using Kurisu.SqlSugar; +using Kurisu.AspNetCore.DataAccess.SqlSugar; using SqlSugar; using SqlSugar.DbConvert; diff --git a/Src/Dlhis.Entity/Visitor/Entity/VisitorAppointmentEntity.cs b/Src/Dlhis.Entity/Visitor/Entity/VisitorAppointmentEntity.cs index 55cc53cb..b895f0e5 100644 --- a/Src/Dlhis.Entity/Visitor/Entity/VisitorAppointmentEntity.cs +++ b/Src/Dlhis.Entity/Visitor/Entity/VisitorAppointmentEntity.cs @@ -1,4 +1,4 @@ -using Kurisu.SqlSugar; +using Kurisu.AspNetCore.DataAccess.SqlSugar; using SqlSugar; namespace Dlhis.Entity.Visitor.Entity; diff --git a/Src/Dlhis.External/Dlhis.External.csproj b/Src/Dlhis.External/Dlhis.External.csproj index 8d32d386..31384e4a 100644 --- a/Src/Dlhis.External/Dlhis.External.csproj +++ b/Src/Dlhis.External/Dlhis.External.csproj @@ -9,7 +9,6 @@ - diff --git a/Src/Dlhis.External/MealSupplement/Services/IMealSupplementService.cs b/Src/Dlhis.External/MealSupplement/Services/IMealSupplementService.cs index 9c186dca..f704c187 100644 --- a/Src/Dlhis.External/MealSupplement/Services/IMealSupplementService.cs +++ b/Src/Dlhis.External/MealSupplement/Services/IMealSupplementService.cs @@ -4,5 +4,5 @@ namespace Dlhis.External.MealSupplement.Services; public interface IMealSupplementService : IScopeDependency { - Task DoSupplementsAsync(List reuqests); -} + Task DoSupplementsAsync(List requests); +} \ No newline at end of file diff --git a/Src/Dlhis.External/MealSupplement/Services/Implements/MealSupplementService.cs b/Src/Dlhis.External/MealSupplement/Services/Implements/MealSupplementService.cs index a6932309..cb58621e 100644 --- a/Src/Dlhis.External/MealSupplement/Services/Implements/MealSupplementService.cs +++ b/Src/Dlhis.External/MealSupplement/Services/Implements/MealSupplementService.cs @@ -1,6 +1,6 @@ using Dlhis.Entity.Canteen.Entities; using Dlhis.External.MealSupplement.Request; -using Kurisu.SqlSugar.Services; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Services; using Mapster; namespace Dlhis.External.MealSupplement.Services.Implements; @@ -14,10 +14,10 @@ public class MealSupplementService : IMealSupplementService _dbContext = dbContext; } - public async Task DoSupplementsAsync(List reuqests) + public async Task DoSupplementsAsync(List requests) { - await _dbContext.InsertAsync(reuqests.Adapt>()); - var entities = reuqests.Adapt>(); + await _dbContext.InsertAsync(requests.Adapt>()); + var entities = requests.Adapt>(); foreach (var entity in entities) { try @@ -33,4 +33,4 @@ public class MealSupplementService : IMealSupplementService } //await _eventBus.PublishAsync(new MealSupplementMessage { Items = reuqests }); } -} +} \ No newline at end of file diff --git a/Src/Dlhis.External/OpenApi/Controllers/DepartmentsController.cs b/Src/Dlhis.External/OpenApi/Controllers/DepartmentsController.cs index 4641a78e..e5a24575 100644 --- a/Src/Dlhis.External/OpenApi/Controllers/DepartmentsController.cs +++ b/Src/Dlhis.External/OpenApi/Controllers/DepartmentsController.cs @@ -1,7 +1,6 @@ using Dlhis.External.OpenApi.Response; using Dlhis.External.OpenApi.Services; using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; namespace Dlhis.External.OpenApi.Controllers; diff --git a/Src/Dlhis.External/Program.cs b/Src/Dlhis.External/Program.cs index d68d2a8f..e53ad73a 100644 --- a/Src/Dlhis.External/Program.cs +++ b/Src/Dlhis.External/Program.cs @@ -1,7 +1,6 @@ +using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions; using Kurisu.AspNetCore.Startup; using Kurisu.AspNetCore.Utils.Extensions; -using Kurisu.SqlSugar.Extensions; -using Kurisu.Startup; using Microsoft.IdentityModel.Logging; class Program diff --git a/Src/Dlhis.InfoCheck/Dlhis.InfoCheck.csproj b/Src/Dlhis.InfoCheck/Dlhis.InfoCheck.csproj index e60f1e4e..3892e1f5 100644 --- a/Src/Dlhis.InfoCheck/Dlhis.InfoCheck.csproj +++ b/Src/Dlhis.InfoCheck/Dlhis.InfoCheck.csproj @@ -10,7 +10,7 @@ - + diff --git a/Src/Dlhis.Message/Dlhis.Message.csproj b/Src/Dlhis.Message/Dlhis.Message.csproj index 82051fc6..4b57436f 100644 --- a/Src/Dlhis.Message/Dlhis.Message.csproj +++ b/Src/Dlhis.Message/Dlhis.Message.csproj @@ -9,8 +9,11 @@ - + + + + diff --git a/Src/Dlhis.Message/Program.cs b/Src/Dlhis.Message/Program.cs index b2292f00..3c574499 100644 --- a/Src/Dlhis.Message/Program.cs +++ b/Src/Dlhis.Message/Program.cs @@ -1,12 +1,11 @@ using Kurisu.AspNetCore.Startup; -using Kurisu.Startup; using Microsoft.IdentityModel.Logging; class Program { static void Main(string[] args) { - KurisuHost.Run(true, args); + KurisuHost.Run(args); } } @@ -16,5 +15,4 @@ public class Startup : DefaultStartup { IdentityModelEventSource.ShowPII = true; } -} - +} \ No newline at end of file diff --git a/Src/Dlhis.Scheduled.Api/Dlhis.Scheduled.Api.csproj b/Src/Dlhis.Scheduled.Api/Dlhis.Scheduled.Api.csproj index 45601c93..3ce3fd2e 100644 --- a/Src/Dlhis.Scheduled.Api/Dlhis.Scheduled.Api.csproj +++ b/Src/Dlhis.Scheduled.Api/Dlhis.Scheduled.Api.csproj @@ -7,7 +7,7 @@ - + diff --git a/Src/Dlhis.Scheduled.Api/IHangfireApi.cs b/Src/Dlhis.Scheduled.Api/IHangfireApi.cs index 5119a1f2..6b16e37d 100644 --- a/Src/Dlhis.Scheduled.Api/IHangfireApi.cs +++ b/Src/Dlhis.Scheduled.Api/IHangfireApi.cs @@ -1,6 +1,6 @@ using Dlhis.Scheduled.Api.Request; -using Kurisu.Core.Result; using Kurisu.RemoteCall.Attributes; +using Kurisu.RemoteCall.Default; namespace Dlhis.Scheduled.Api; diff --git a/Src/Dlhis.ScheduledTask/BaseJob.cs b/Src/Dlhis.ScheduledTask/BaseJob.cs index c8dcaa44..150106f8 100644 --- a/Src/Dlhis.ScheduledTask/BaseJob.cs +++ b/Src/Dlhis.ScheduledTask/BaseJob.cs @@ -1,10 +1,10 @@ using System.Reflection; -using Kurisu.Core.DataAccess.Entity; +using Kurisu.AspNetCore.DataAccess.Entity; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Services; using Kurisu.Scheduled.Abstractions; using Kurisu.Scheduled.Attributes; -using Kurisu.SqlSugar.Services; -namespace Kurisu.Scheduled; +namespace Dlhis.ScheduledTask; public abstract class BaseJob : IJob { diff --git a/Src/Dlhis.ScheduledTask/Common/Request/UploadAttendanceRequest.cs b/Src/Dlhis.ScheduledTask/Common/Request/UploadAttendanceRequest.cs index 3ec862f6..f4784c1b 100644 --- a/Src/Dlhis.ScheduledTask/Common/Request/UploadAttendanceRequest.cs +++ b/Src/Dlhis.ScheduledTask/Common/Request/UploadAttendanceRequest.cs @@ -1,33 +1,32 @@ using Newtonsoft.Json; -namespace Dlhis.ScheduledTask.Common.Request +namespace Dlhis.ScheduledTask.Common.Request; + +public class UploadAttendanceRequest { - public class UploadAttendanceRequest - { - [JsonIgnore] - public long Id { get; set; } + [JsonIgnore] + public long Id { get; set; } - /// - /// item.CardNo.TrimEnd('\0') - /// - public string ZWORKCODE { get; set; } + /// + /// item.CardNo.TrimEnd('\0') + /// + public string ZWORKCODE { get; set; } - [JsonIgnore] - public DateTime RaiseDateTime { get; set; } + [JsonIgnore] + public DateTime RaiseDateTime { get; set; } - /// - /// yyyy-MM-dd - /// - public string ZDATE => RaiseDateTime.ToString("yyyy-MM-dd"); + /// + /// yyyy-MM-dd + /// + public string ZDATE => RaiseDateTime.ToString("yyyy-MM-dd"); - /// - /// HH:mm:ss - /// - public string ZTIME => RaiseDateTime.ToString("HH:mm:ss"); + /// + /// HH:mm:ss + /// + public string ZTIME => RaiseDateTime.ToString("HH:mm:ss"); - /// - /// 设备位置 - /// - public string ZNOTE { get; set; } - } -} + /// + /// 设备位置 + /// + public string ZNOTE { get; set; } +} \ No newline at end of file diff --git a/Src/Dlhis.ScheduledTask/Common/Services/Implements/GainfoUpdateService.cs b/Src/Dlhis.ScheduledTask/Common/Services/Implements/GainfoUpdateService.cs index 260e1186..6443f7f6 100644 --- a/Src/Dlhis.ScheduledTask/Common/Services/Implements/GainfoUpdateService.cs +++ b/Src/Dlhis.ScheduledTask/Common/Services/Implements/GainfoUpdateService.cs @@ -1,15 +1,14 @@ using Dlhis.Basic.Api; +using Dlhis.Basic.Api.Dto; using Dlhis.Entity.Basic.Entity; using Dlhis.Entity.Basic.Enums; using Dlhis.Sys.Api; -using Kurisu.SqlSugar.Services; -using SqlSugar; using Dlhis.Sys.Api.Response; using Dlhis.ScheduledTask.Common.Dto; using Dlhis.ScheduledTask.Common.Comparers; using Kurisu.AspNetCore.Utils.Extensions; -using Dlhis.Basic.Api.Dtos; using Dlhis.Basic.Api.Request; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Services; namespace Dlhis.ScheduledTask.Common.Services.Implements; @@ -149,9 +148,9 @@ public class GainfoUpdateService : IGainfoUpdateService { _logger.LogWarning("SAP分批处理Chunk数量:{count}", searchCodes.Length); var existsWorkCodes = await _dbContext.Queryable() - .Where(x => searchCodes.Contains(x.ename)) - .Select(x => x.ename) - .ToListAsync(); + .Where(x => searchCodes.Contains(x.ename)) + .Select(x => x.ename) + .ToListAsync(); var originUpdates = persons.Where(x => existsWorkCodes.Contains(x.ZWORKCODE)).ToList(); var existsUpdateWorkCodes = originUpdates.Select(x => x.ZWORKCODE).ToList(); @@ -241,6 +240,7 @@ public class GainfoUpdateService : IGainfoUpdateService { await _dbContext.Client.Insertable(info).AS("GainfoLeave").ExecuteCommandAsync(); } + return null; } } @@ -282,33 +282,32 @@ public class GainfoUpdateService : IGainfoUpdateService private async Task UpdatePersonAsync(GainfoSapEntity item) { - var gainfoSap = await _dbContext.Queryable().Where(x => x.ename == item.ename).FirstAsync(); await _dbContext.Updateable().SetColumns(g => new GainfoSapEntity - { - PERNR = item.PERNR, - gname = item.gname, - phone = item.phone, - appellation = item.appellation, - isowner = item.isowner, - remark = item.remark, - email = item.email, - WERKS = item.WERKS, - KOSTL = item.KOSTL, - STELL = item.STELL, - Z_ZJ = item.Z_ZJ, - ZZ_ZD = item.ZZ_ZD, - MNTXT = item.MNTXT, - MASSN = item.MASSN, - ZSTATUS = item.ZSTATUS, - ZLZRQ = item.ZLZRQ, - STELL_NM = item.STELL_NM, - ZZ_KLX = item.ZZ_KLX, - createdate = item.createdate, - ZZ_GZDJDNM = item.ZZ_GZDJDNM, - ZZ_GZDCQNM = item.ZZ_GZDCQNM, - }) - .Where(x => x.ename == item.ename) - .ExecuteCommandAsync(); + { + PERNR = item.PERNR, + gname = item.gname, + phone = item.phone, + appellation = item.appellation, + isowner = item.isowner, + remark = item.remark, + email = item.email, + WERKS = item.WERKS, + KOSTL = item.KOSTL, + STELL = item.STELL, + Z_ZJ = item.Z_ZJ, + ZZ_ZD = item.ZZ_ZD, + MNTXT = item.MNTXT, + MASSN = item.MASSN, + ZSTATUS = item.ZSTATUS, + ZLZRQ = item.ZLZRQ, + STELL_NM = item.STELL_NM, + ZZ_KLX = item.ZZ_KLX, + createdate = item.createdate, + ZZ_GZDJDNM = item.ZZ_GZDJDNM, + ZZ_GZDCQNM = item.ZZ_GZDCQNM, + }) + .Where(x => x.ename == item.ename) + .ExecuteCommandAsync(); //获取当前在职人员 var gainfo = await _dbContext.Queryable().Where(x => x.Code == item.ename).FirstAsync(); @@ -319,25 +318,25 @@ public class GainfoUpdateService : IGainfoUpdateService var workplace = _tenants.FirstOrDefault(x => x.Name == item.ZZ_GZDJDNM)?.Code ?? item.ZZ_GZDJDNM; var factory = _tenants.FirstOrDefault(x => x.Name == item.ZZ_GZDCQNM)?.Code ?? item.ZZ_GZDCQNM; await _dbContext.Updateable().SetColumns(g => new GainfoEntity - { - SapNo = item.PERNR, - Name = item.gname, - PositionNo = item.STELL, - Grade = item.ZZ_ZD, - Title = item.Z_ZJ, - Phone = item.phone, - DepartmentNo = item.appellation, - Remark = item.remark, - Degree = item.email, - Werks = item.WERKS, - CostId = item.KOSTL, - EntryDate = item.createdate, - ResignationDate = item.ZLZRQ, - Workplace = workplace, - Factory = factory - }) - .Where(x => x.Code == item.ename) - .ExecuteCommandAsync(); + { + SapNo = item.PERNR, + Name = item.gname, + PositionNo = item.STELL, + Grade = item.ZZ_ZD, + Title = item.Z_ZJ, + Phone = item.phone, + DepartmentNo = item.appellation, + Remark = item.remark, + Degree = item.email, + Werks = item.WERKS, + CostId = item.KOSTL, + EntryDate = item.createdate, + ResignationDate = item.ZLZRQ, + Workplace = workplace, + Factory = factory + }) + .Where(x => x.Code == item.ename) + .ExecuteCommandAsync(); } else { @@ -364,7 +363,7 @@ public class GainfoUpdateService : IGainfoUpdateService } //先写入离职表 - gainfo.IdentityUserId = (int)gainfo.Id;//记录原始id + gainfo.IdentityUserId = (int)gainfo.Id; //记录原始id gainfo.Id = 0; gainfo.ResignationDate = item.ZLZRQ; @@ -372,6 +371,8 @@ public class GainfoUpdateService : IGainfoUpdateService { await _dbContext.Client.Insertable(gainfo).AS("GainfoLeave").ExecuteCommandAsync(); } + + gainfo.Id = gainfo.IdentityUserId; await _dbContext.DeleteReallyAsync(gainfo); } else @@ -434,32 +435,32 @@ public class GainfoUpdateService : IGainfoUpdateService var gainfos = await _dbContext.Queryable().ToListAsync(); return gainfos.Select(x => new SapPersonItem - { - NAME = x.gname, - ZWORKCODE = x.ename, - ZZ_SFZH = x.idno, - GBDAT = x.birthday, - ZZ_KLX = x.ZZ_KLX, - ZXUELI = x.email, - ORGEH = x.appellation, - ZMOBILE = x.phone, - ZSTATUS = x.ZSTATUS, - ZRZRQ = x.createdate, - PERNR = x.PERNR, - WERKS = x.WERKS, - KOSTL = x.KOSTL, - ZZ_ZD = x.ZZ_ZD, - Z_ZJ = x.Z_ZJ, - STELL = x.STELL, - STELL_NM = x.STELL_NM, - ZLZRQ = x.ZLZRQ, - MASSN = x.MASSN, - MNTXT = x.MNTXT, - ZZ_COUNNM = x.ZZ_COUNNM, - ZZ_GZDJDNM = x.ZZ_GZDJDNM, - ZZ_GZDCQNM = x.ZZ_GZDCQNM - }) - .ToList(); + { + NAME = x.gname, + ZWORKCODE = x.ename, + ZZ_SFZH = x.idno, + GBDAT = x.birthday, + ZZ_KLX = x.ZZ_KLX, + ZXUELI = x.email, + ORGEH = x.appellation, + ZMOBILE = x.phone, + ZSTATUS = x.ZSTATUS, + ZRZRQ = x.createdate, + PERNR = x.PERNR, + WERKS = x.WERKS, + KOSTL = x.KOSTL, + ZZ_ZD = x.ZZ_ZD, + Z_ZJ = x.Z_ZJ, + STELL = x.STELL, + STELL_NM = x.STELL_NM, + ZLZRQ = x.ZLZRQ, + MASSN = x.MASSN, + MNTXT = x.MNTXT, + ZZ_COUNNM = x.ZZ_COUNNM, + ZZ_GZDJDNM = x.ZZ_GZDJDNM, + ZZ_GZDCQNM = x.ZZ_GZDCQNM + }) + .ToList(); } @@ -533,7 +534,6 @@ public class GainfoUpdateService : IGainfoUpdateService { throw; } - }).ToList(); } @@ -543,4 +543,4 @@ public class GainfoUpdateService : IGainfoUpdateService idno = idno.TrimStart(); return idno[..6]; } -} +} \ No newline at end of file diff --git a/Src/Dlhis.ScheduledTask/Common/Services/Implements/HangfireService.cs b/Src/Dlhis.ScheduledTask/Common/Services/Implements/HangfireService.cs index ce72897a..3d07c02c 100644 --- a/Src/Dlhis.ScheduledTask/Common/Services/Implements/HangfireService.cs +++ b/Src/Dlhis.ScheduledTask/Common/Services/Implements/HangfireService.cs @@ -1,9 +1,9 @@ using Dlhis.Entity.Basic.Entity; using Dlhis.ScheduledTask.Common.Request; using Hangfire; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Services; using Kurisu.AspNetCore.Utils; using Kurisu.AspNetCore.Utils.Extensions; -using Kurisu.SqlSugar.Services; namespace Dlhis.ScheduledTask.Common.Services.Implements; diff --git a/Src/Dlhis.ScheduledTask/Common/Services/Implements/JinkoSapService.cs b/Src/Dlhis.ScheduledTask/Common/Services/Implements/JinkoSapService.cs index 11fcd506..06db2208 100644 --- a/Src/Dlhis.ScheduledTask/Common/Services/Implements/JinkoSapService.cs +++ b/Src/Dlhis.ScheduledTask/Common/Services/Implements/JinkoSapService.cs @@ -3,8 +3,8 @@ using System.Text; using Dlhis.Entity.Basic.Entity; using Dlhis.ScheduledTask.Common.Dto; using Dlhis.ScheduledTask.Common.Response; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Services; using Kurisu.AspNetCore.Utils.Extensions; -using Kurisu.SqlSugar.Services; using Newtonsoft.Json; namespace Dlhis.ScheduledTask.Common.Services.Implements; diff --git a/Src/Dlhis.ScheduledTask/DeviceUploadLog/Controllers/DeviceUploadLogsController.cs b/Src/Dlhis.ScheduledTask/DeviceUploadLog/Controllers/DeviceUploadLogsController.cs index c28823c4..583071d0 100644 --- a/Src/Dlhis.ScheduledTask/DeviceUploadLog/Controllers/DeviceUploadLogsController.cs +++ b/Src/Dlhis.ScheduledTask/DeviceUploadLog/Controllers/DeviceUploadLogsController.cs @@ -1,8 +1,8 @@ using Dlhis.ScheduledTask.DeviceUploadLog.Request; using Dlhis.ScheduledTask.DeviceUploadLog.Response; using Dlhis.ScheduledTask.DeviceUploadLog.Services; +using Kurisu.AspNetCore.DataAccess.Dto; using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop; -using Kurisu.Core.DataAccess.Dto; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; diff --git a/Src/Dlhis.ScheduledTask/DeviceUploadLog/Request/DeviceUploadLogPageRequest.cs b/Src/Dlhis.ScheduledTask/DeviceUploadLog/Request/DeviceUploadLogPageRequest.cs index 95b76160..d2b91241 100644 --- a/Src/Dlhis.ScheduledTask/DeviceUploadLog/Request/DeviceUploadLogPageRequest.cs +++ b/Src/Dlhis.ScheduledTask/DeviceUploadLog/Request/DeviceUploadLogPageRequest.cs @@ -1,7 +1,7 @@ -using Kurisu.Core.CustomClass; -using System.ComponentModel.DataAnnotations; -using Kurisu.Core.DataAccess.Dto; +using System.ComponentModel.DataAnnotations; using Dlhis.Entity.Device.Enums; +using Kurisu.AspNetCore.CustomClass; +using Kurisu.AspNetCore.DataAccess.Dto; namespace Dlhis.ScheduledTask.DeviceUploadLog.Request; @@ -30,12 +30,9 @@ public class DeviceUploadLogPageRequest : PageDto, IValidatableObject public IEnumerable Validate(ValidationContext validationContext) { - if (SearchDateTimePeriod != null) + if (SearchDateTimePeriod is { End: not null }) { - if (SearchDateTimePeriod.End.HasValue) - { - SearchDateTimePeriod.End = SearchDateTimePeriod.End.Value.AddDays(1).AddSeconds(-1); - } + SearchDateTimePeriod.End = SearchDateTimePeriod.End.Value.AddDays(1).AddSeconds(-1); } yield break; diff --git a/Src/Dlhis.ScheduledTask/DeviceUploadLog/Services/IDeviceUploadLogService.cs b/Src/Dlhis.ScheduledTask/DeviceUploadLog/Services/IDeviceUploadLogService.cs index 0d41b450..1eceeb42 100644 --- a/Src/Dlhis.ScheduledTask/DeviceUploadLog/Services/IDeviceUploadLogService.cs +++ b/Src/Dlhis.ScheduledTask/DeviceUploadLog/Services/IDeviceUploadLogService.cs @@ -1,6 +1,6 @@ using Dlhis.ScheduledTask.DeviceUploadLog.Request; using Dlhis.ScheduledTask.DeviceUploadLog.Response; -using Kurisu.Core.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.Dto; namespace Dlhis.ScheduledTask.DeviceUploadLog.Services; diff --git a/Src/Dlhis.ScheduledTask/DeviceUploadLog/Services/Implements/DeviceUploadLogService.cs b/Src/Dlhis.ScheduledTask/DeviceUploadLog/Services/Implements/DeviceUploadLogService.cs index 40186005..92aec1fd 100644 --- a/Src/Dlhis.ScheduledTask/DeviceUploadLog/Services/Implements/DeviceUploadLogService.cs +++ b/Src/Dlhis.ScheduledTask/DeviceUploadLog/Services/Implements/DeviceUploadLogService.cs @@ -4,10 +4,10 @@ using Dlhis.Entity.Device.Entities; using Dlhis.Entity.Device.Enums; using Dlhis.ScheduledTask.DeviceUploadLog.Request; using Dlhis.ScheduledTask.DeviceUploadLog.Response; +using Kurisu.AspNetCore.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Services; using Kurisu.AspNetCore.Utils.Extensions; -using Kurisu.Core.DataAccess.Dto; -using Kurisu.SqlSugar.Extensions; -using Kurisu.SqlSugar.Services; using SqlSugar; namespace Dlhis.ScheduledTask.DeviceUploadLog.Services.Implements; @@ -38,8 +38,8 @@ public class DeviceUploadLogService : IDeviceUploadLogService .WhereIF(request.Sync.HasValue, deviceUp => deviceUp.Sync == request.Sync) .WhereIF(request.SearchDateTimePeriod?.Start.HasValue == true, deviceUp => deviceUp.RaiseDateTime >= request.SearchDateTimePeriod.Start) .WhereIF(request.SearchDateTimePeriod?.End.HasValue == true, deviceUp => deviceUp.RaiseDateTime <= request.SearchDateTimePeriod.End) - .WhereIF(request.IsOutSource.HasValue && request.IsOutSource.Value, deviceUp => SqlFunc.Subqueryable().Where(x => x.Code == deviceUp.UserUniqueNo).Any()) - .WhereIF(request.IsOutSource.HasValue && !request.IsOutSource.Value, deviceUp => SqlFunc.Subqueryable().Where(x => x.Code == deviceUp.UserUniqueNo).NotAny()) + .WhereIF(request.IsOutSource.HasValue && request.IsOutSource.Value, deviceUp => SqlFunc.Subqueryable().Where(x => x.Code == deviceUp.UserUniqueNo).Any()) + .WhereIF(request.IsOutSource.HasValue && !request.IsOutSource.Value, deviceUp => SqlFunc.Subqueryable().Where(x => x.Code == deviceUp.UserUniqueNo).NotAny()) .WhereIF(request.Search.IsPresent(), (deviceUp, device, ga) => ga.Code == request.Search || ga.Name == request.Search diff --git a/Src/Dlhis.ScheduledTask/Dlhis.ScheduledTask.csproj b/Src/Dlhis.ScheduledTask/Dlhis.ScheduledTask.csproj index ab4048ad..20f8028f 100644 --- a/Src/Dlhis.ScheduledTask/Dlhis.ScheduledTask.csproj +++ b/Src/Dlhis.ScheduledTask/Dlhis.ScheduledTask.csproj @@ -20,7 +20,6 @@ - diff --git a/Src/Dlhis.ScheduledTask/Jobs/CreateDefinitelyGroupJob.cs b/Src/Dlhis.ScheduledTask/Jobs/CreateDefinitelyGroupJob.cs index 0257b863..25e91e7d 100644 --- a/Src/Dlhis.ScheduledTask/Jobs/CreateDefinitelyGroupJob.cs +++ b/Src/Dlhis.ScheduledTask/Jobs/CreateDefinitelyGroupJob.cs @@ -4,12 +4,8 @@ using Dlhis.Entity.Device.Enums; using Dlhis.Sys.Api; using Dlhis.Sys.Api.Response; using Kurisu.AspNetCore.Utils.Extensions; -using Kurisu.Core.DataAccess.Entity; -using Kurisu.Scheduled; using Kurisu.Scheduled.Attributes; -using Kurisu.SqlSugar.Services; using Newtonsoft.Json; -using SqlSugar; namespace Dlhis.ScheduledTask.Jobs; diff --git a/Src/Dlhis.ScheduledTask/Jobs/HeartbeatJob.cs b/Src/Dlhis.ScheduledTask/Jobs/HeartbeatJob.cs index 1061aba7..cab4ee09 100644 --- a/Src/Dlhis.ScheduledTask/Jobs/HeartbeatJob.cs +++ b/Src/Dlhis.ScheduledTask/Jobs/HeartbeatJob.cs @@ -2,9 +2,8 @@ using System.Net.Sockets; using Dlhis.Entity.Basic.Entity; using Dlhis.Entity.Device.Entities; +using Kurisu.AspNetCore.CustomClass; using Kurisu.AspNetCore.Utils; -using Kurisu.Core.CustomClass; -using Kurisu.Scheduled; using Kurisu.Scheduled.Attributes; using Newtonsoft.Json; diff --git a/Src/Dlhis.ScheduledTask/Jobs/MealSupplementHandlerJob.cs b/Src/Dlhis.ScheduledTask/Jobs/MealSupplementHandlerJob.cs index 1f215c8c..47c70ce2 100644 --- a/Src/Dlhis.ScheduledTask/Jobs/MealSupplementHandlerJob.cs +++ b/Src/Dlhis.ScheduledTask/Jobs/MealSupplementHandlerJob.cs @@ -7,11 +7,10 @@ using Dlhis.Entity.Canteen.Enums; using Dlhis.ScheduledTask.Common.Request; using Dlhis.ScheduledTask.Common.Services; using Hangfire; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions; using Kurisu.AspNetCore.Utils; using Kurisu.AspNetCore.Utils.Extensions; -using Kurisu.Scheduled; using Kurisu.Scheduled.Attributes; -using Kurisu.SqlSugar.Extensions; namespace Dlhis.ScheduledTask.Jobs; diff --git a/Src/Dlhis.ScheduledTask/Jobs/SyncOriginCardInfoJob.cs b/Src/Dlhis.ScheduledTask/Jobs/SyncOriginCardInfoJob.cs index d7bf5a29..6c27d41a 100644 --- a/Src/Dlhis.ScheduledTask/Jobs/SyncOriginCardInfoJob.cs +++ b/Src/Dlhis.ScheduledTask/Jobs/SyncOriginCardInfoJob.cs @@ -39,7 +39,7 @@ public class SyncOriginCardInfoJob : BaseJob .Where(x => deviceUniqueNos.Contains(x.DeviceUniqueNo)) .Where(x => !string.IsNullOrEmpty(x.UserUniqueNo)) .Where(x => x.Sync == false) - .Where(x => SqlFunc.Subqueryable().Where(p => p.Code == x.UserUniqueNo).NotAny()) + .Where(x => SqlFunc.Subqueryable().Where(p => p.Code == x.UserUniqueNo).NotAny()) .Select((x, device) => new UploadAttendanceRequest { Id = x.Id, diff --git a/Src/Dlhis.ScheduledTask/Jobs/UpdateUserPasswordJob.cs b/Src/Dlhis.ScheduledTask/Jobs/UpdateUserPasswordJob.cs index c4b83275..7bd3f21c 100644 --- a/Src/Dlhis.ScheduledTask/Jobs/UpdateUserPasswordJob.cs +++ b/Src/Dlhis.ScheduledTask/Jobs/UpdateUserPasswordJob.cs @@ -1,9 +1,8 @@ using Dlhis.Entity.Basic.Entity; using Dlhis.Entity.Sys.Entities; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Services; using Kurisu.AspNetCore.Utils.Extensions; -using Kurisu.Scheduled; using Kurisu.Scheduled.Attributes; -using Kurisu.SqlSugar.Services; using Microsoft.AspNetCore.Identity; namespace Dlhis.ScheduledTask.Jobs; diff --git a/Src/Dlhis.ScheduledTask/Packs/SqlSugarPack.cs b/Src/Dlhis.ScheduledTask/Packs/SqlSugarPack.cs index 9953056c..322d0da9 100644 --- a/Src/Dlhis.ScheduledTask/Packs/SqlSugarPack.cs +++ b/Src/Dlhis.ScheduledTask/Packs/SqlSugarPack.cs @@ -1,13 +1,11 @@ -using Kurisu.AspNetCore.Startup; -using Kurisu.SqlSugar.Extensions; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions; +using Kurisu.AspNetCore.Startup; using SqlSugar; namespace Dlhis.ScheduledTask.Packs; public class SqlSugarPack : BaseAppPack { - public override bool IsBeforeUseRouting { get; } - public override void ConfigureServices(IServiceCollection services) { services.AddSqlSugar(sp => diff --git a/Src/Dlhis.ScheduledTask/Program.cs b/Src/Dlhis.ScheduledTask/Program.cs index e3670558..1a6d8cd5 100644 --- a/Src/Dlhis.ScheduledTask/Program.cs +++ b/Src/Dlhis.ScheduledTask/Program.cs @@ -1,8 +1,6 @@ -using Dlhis.ScheduledTask.Common.Services; using Kurisu.AspNetCore.Startup; using Kurisu.AspNetCore.Utils; using Kurisu.AspNetCore.Utils.Extensions; -using Kurisu.Startup; class Program { diff --git a/Src/Dlhis.ScheduledTask/TaskAssignment/Controllers/DeviceTaskAssignmentsController.cs b/Src/Dlhis.ScheduledTask/TaskAssignment/Controllers/DeviceTaskAssignmentsController.cs index 5d488ed9..1a016bf5 100644 --- a/Src/Dlhis.ScheduledTask/TaskAssignment/Controllers/DeviceTaskAssignmentsController.cs +++ b/Src/Dlhis.ScheduledTask/TaskAssignment/Controllers/DeviceTaskAssignmentsController.cs @@ -1,8 +1,8 @@ using Dlhis.ScheduledTask.TaskAssignment.Request; using Dlhis.ScheduledTask.TaskAssignment.Response; using Dlhis.ScheduledTask.TaskAssignment.Services; +using Kurisu.AspNetCore.DataAccess.Dto; using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop; -using Kurisu.Core.DataAccess.Dto; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; diff --git a/Src/Dlhis.ScheduledTask/TaskAssignment/FaceUrlOptions.cs b/Src/Dlhis.ScheduledTask/TaskAssignment/FaceUrlOptions.cs index 89d05a98..776e3a39 100644 --- a/Src/Dlhis.ScheduledTask/TaskAssignment/FaceUrlOptions.cs +++ b/Src/Dlhis.ScheduledTask/TaskAssignment/FaceUrlOptions.cs @@ -1,4 +1,4 @@ -using Kurisu.Core.ConfigurableOptions.Attributes; +using Kurisu.AspNetCore.ConfigurableOptions.Attributes; namespace Dlhis.ScheduledTask.TaskAssignment; diff --git a/Src/Dlhis.ScheduledTask/TaskAssignment/Request/DeviceTaskAssignmentRequest.cs b/Src/Dlhis.ScheduledTask/TaskAssignment/Request/DeviceTaskAssignmentRequest.cs index ed503508..1c9cb472 100644 --- a/Src/Dlhis.ScheduledTask/TaskAssignment/Request/DeviceTaskAssignmentRequest.cs +++ b/Src/Dlhis.ScheduledTask/TaskAssignment/Request/DeviceTaskAssignmentRequest.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using Dlhis.Entity.Device.Enums; -using Kurisu.Core.CustomClass; -using Kurisu.Core.DataAccess.Dto; +using Kurisu.AspNetCore.CustomClass; +using Kurisu.AspNetCore.DataAccess.Dto; namespace Dlhis.ScheduledTask.TaskAssignment.Request; diff --git a/Src/Dlhis.ScheduledTask/TaskAssignment/Request/DeviceTaskGetRequest.cs b/Src/Dlhis.ScheduledTask/TaskAssignment/Request/DeviceTaskGetRequest.cs index 84cf335e..21b75ef5 100644 --- a/Src/Dlhis.ScheduledTask/TaskAssignment/Request/DeviceTaskGetRequest.cs +++ b/Src/Dlhis.ScheduledTask/TaskAssignment/Request/DeviceTaskGetRequest.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using Dlhis.Entity.Device.Enums; +using Kurisu.AspNetCore.DataAccess.Dto; using Kurisu.AspNetCore.Utils.Extensions; -using Kurisu.Core.DataAccess.Dto; namespace Dlhis.ScheduledTask.TaskAssignment.Request; diff --git a/Src/Dlhis.ScheduledTask/TaskAssignment/Response/ScheduleDto.cs b/Src/Dlhis.ScheduledTask/TaskAssignment/Response/ScheduleDto.cs index 648262e6..357d80ca 100644 --- a/Src/Dlhis.ScheduledTask/TaskAssignment/Response/ScheduleDto.cs +++ b/Src/Dlhis.ScheduledTask/TaskAssignment/Response/ScheduleDto.cs @@ -1,4 +1,4 @@ -using Kurisu.Core.CustomClass; +using Kurisu.AspNetCore.CustomClass; namespace Dlhis.ScheduledTask.TaskAssignment.Response; diff --git a/Src/Dlhis.ScheduledTask/TaskAssignment/Response/TimePeriodToDeviceResponse.cs b/Src/Dlhis.ScheduledTask/TaskAssignment/Response/TimePeriodToDeviceResponse.cs index 8af46fd7..c914c91c 100644 --- a/Src/Dlhis.ScheduledTask/TaskAssignment/Response/TimePeriodToDeviceResponse.cs +++ b/Src/Dlhis.ScheduledTask/TaskAssignment/Response/TimePeriodToDeviceResponse.cs @@ -1,6 +1,4 @@ -using Kurisu.Core.CustomClass; - -namespace Dlhis.ScheduledTask.TaskAssignment.Response; +namespace Dlhis.ScheduledTask.TaskAssignment.Response; public class TimePeriodToDeviceResponse { diff --git a/Src/Dlhis.ScheduledTask/TaskAssignment/Response/TimePeriodWeekDaySection.cs b/Src/Dlhis.ScheduledTask/TaskAssignment/Response/TimePeriodWeekDaySection.cs index 99c6cb95..932891b9 100644 --- a/Src/Dlhis.ScheduledTask/TaskAssignment/Response/TimePeriodWeekDaySection.cs +++ b/Src/Dlhis.ScheduledTask/TaskAssignment/Response/TimePeriodWeekDaySection.cs @@ -1,4 +1,4 @@ -using Kurisu.Core.CustomClass; +using Kurisu.AspNetCore.CustomClass; namespace Dlhis.ScheduledTask.TaskAssignment.Response; diff --git a/Src/Dlhis.ScheduledTask/TaskAssignment/Response/UploadRecordToDeviceResponse.cs b/Src/Dlhis.ScheduledTask/TaskAssignment/Response/UploadRecordToDeviceResponse.cs index 6f22adc1..56aeb73a 100644 --- a/Src/Dlhis.ScheduledTask/TaskAssignment/Response/UploadRecordToDeviceResponse.cs +++ b/Src/Dlhis.ScheduledTask/TaskAssignment/Response/UploadRecordToDeviceResponse.cs @@ -1,4 +1,4 @@ -using Kurisu.Core.CustomClass; +using Kurisu.AspNetCore.CustomClass; namespace Dlhis.ScheduledTask.TaskAssignment.Response; diff --git a/Src/Dlhis.ScheduledTask/TaskAssignment/Response/UserToDeviceResponse.cs b/Src/Dlhis.ScheduledTask/TaskAssignment/Response/UserToDeviceResponse.cs index 7f857406..7a6254c6 100644 --- a/Src/Dlhis.ScheduledTask/TaskAssignment/Response/UserToDeviceResponse.cs +++ b/Src/Dlhis.ScheduledTask/TaskAssignment/Response/UserToDeviceResponse.cs @@ -1,4 +1,4 @@ -using Kurisu.Core.CustomClass; +using Kurisu.AspNetCore.CustomClass; namespace Dlhis.ScheduledTask.TaskAssignment.Response; @@ -63,4 +63,4 @@ public class UserToDeviceResponse /// 假期计划id /// public int Schedule { get; set; } -} +} \ No newline at end of file diff --git a/Src/Dlhis.ScheduledTask/TaskAssignment/Services/IDeviceTaskAssignmentService.cs b/Src/Dlhis.ScheduledTask/TaskAssignment/Services/IDeviceTaskAssignmentService.cs index 67c172dd..27fee27c 100644 --- a/Src/Dlhis.ScheduledTask/TaskAssignment/Services/IDeviceTaskAssignmentService.cs +++ b/Src/Dlhis.ScheduledTask/TaskAssignment/Services/IDeviceTaskAssignmentService.cs @@ -1,6 +1,6 @@ using Dlhis.ScheduledTask.TaskAssignment.Request; using Dlhis.ScheduledTask.TaskAssignment.Response; -using Kurisu.Core.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.Dto; namespace Dlhis.ScheduledTask.TaskAssignment.Services; diff --git a/Src/Dlhis.ScheduledTask/TaskAssignment/Services/Implements/AssignmentService.cs b/Src/Dlhis.ScheduledTask/TaskAssignment/Services/Implements/AssignmentService.cs index 7eaf6cf3..75194cf8 100644 --- a/Src/Dlhis.ScheduledTask/TaskAssignment/Services/Implements/AssignmentService.cs +++ b/Src/Dlhis.ScheduledTask/TaskAssignment/Services/Implements/AssignmentService.cs @@ -4,16 +4,16 @@ using Dlhis.Entity.Device.Enums; using Dlhis.ScheduledTask.TaskAssignment.Request; using Dlhis.ScheduledTask.TaskAssignment.Response; using Kurisu.AspNetCore.Utils.Extensions; -using Kurisu.SqlSugar.Services; using Microsoft.AspNetCore.DataProtection; using Microsoft.Extensions.Options; using SqlSugar; -using Kurisu.SqlSugar.Extensions; using Newtonsoft.Json.Linq; -using Kurisu.Core.CustomClass; using Kurisu.AspNetCore; using Kurisu.AspNetCore.Utils; using Dlhis.ScheduledTask.TaskAssignment.Dto; +using Kurisu.AspNetCore.CustomClass; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Services; namespace Dlhis.ScheduledTask.TaskAssignment.Services.Implements; @@ -40,46 +40,46 @@ public class AssignmentService : IAssignmentService var deviceUploadInfos = await GetDeviceUploadRecordInfosAsync(data); var timeLimitedDataProtector = _dataProtectionProvider - .CreateProtector("down:face") - .ToTimeLimitedDataProtector(); + .CreateProtector("down:face") + .ToTimeLimitedDataProtector(); return data.GroupBy(x => new { x.Brand, x.DeviceUniqueNo, x.DeviceConnectionInfo, x.FuncStr }) - .Select(x => - { - var b = x.Key.Brand; - var d = x.Key.DeviceUniqueNo; - var dc = x.Key.DeviceConnectionInfo ?? "{}"; - var func = x.Key.FuncStr ?? "[]"; - - var jobj = new JObject + .Select(x => { - { "connectionInfo", JToken.Parse(dc) }, - { "function", JArray.Parse(func) } - }; + var b = x.Key.Brand; + var d = x.Key.DeviceUniqueNo; + var dc = x.Key.DeviceConnectionInfo ?? "{}"; + var func = x.Key.FuncStr ?? "[]"; - return new DeviceTaskToDeviceByDeviceResponse - { - Brand = b, - DeviceUniqueNo = d, - DeviceInfo = jobj, - Tasks = x.Select(item => + var jobj = new JObject { - var key = $"face:{item.UserCode}"; - var token = item.Type == DeviceTaskEnumType.Delete - ? string.Empty - : timeLimitedDataProtector.Protect(key, TimeSpan.FromSeconds(_faceUrlOptions.Limit)); + { "connectionInfo", JToken.Parse(dc) }, + { "function", JArray.Parse(func) } + }; - var dto = new TaskCombineDto + return new DeviceTaskToDeviceByDeviceResponse + { + Brand = b, + DeviceUniqueNo = d, + DeviceInfo = jobj, + Tasks = x.Select(item => { - TaskId = item.TaskId, - Type = item.Type, - }; + var key = $"face:{item.UserCode}"; + var token = item.Type == DeviceTaskEnumType.Delete + ? string.Empty + : timeLimitedDataProtector.Protect(key, TimeSpan.FromSeconds(_faceUrlOptions.Limit)); - switch (dto.Type) - { - case DeviceTaskEnumType.Add: - case DeviceTaskEnumType.Delete: - case DeviceTaskEnumType.Update: + var dto = new TaskCombineDto + { + TaskId = item.TaskId, + Type = item.Type, + }; + + switch (dto.Type) + { + case DeviceTaskEnumType.Add: + case DeviceTaskEnumType.Delete: + case DeviceTaskEnumType.Update: { dto.Info = new UserToDeviceResponse { @@ -90,7 +90,7 @@ public class AssignmentService : IAssignmentService DepartmentNo = item.DepartmentNo, DepartmentName = item.DepartmentName, CardNo = item.Type == DeviceTaskEnumType.Delete ? string.Empty : item.CardNo, - Face = item.Type == DeviceTaskEnumType.Delete ? string.Empty : _faceUrlOptions.Url + token,//下发才附带照片信息 + Face = item.Type == DeviceTaskEnumType.Delete ? string.Empty : _faceUrlOptions.Url + token, //下发才附带照片信息 ValidDatePeriod = new DatePeriod { Start = DateOnly.FromDateTime(DateTime.Now.AddDays(-1)), @@ -101,9 +101,9 @@ public class AssignmentService : IAssignmentService Schedule = 1 }; } - break; - case DeviceTaskEnumType.TimePeriodAdd: - case DeviceTaskEnumType.TimePeriodDelete: + break; + case DeviceTaskEnumType.TimePeriodAdd: + case DeviceTaskEnumType.TimePeriodDelete: { dto.Info = new TimePeriodToDeviceResponse { @@ -112,24 +112,24 @@ public class AssignmentService : IAssignmentService Enable = true, Sections = new List() { - new() + new() + { + DayOfWeek = DayOfWeek.Monday, + TimePeriods = new List { - DayOfWeek= DayOfWeek.Monday, - TimePeriods = new List() + new() { - new() - { - Start = TimeOnly.Parse("08:00:00"), - End = TimeOnly.Parse("17:30:00"), - }, - } + Start = TimeOnly.Parse("08:00:00"), + End = TimeOnly.Parse("17:30:00"), + }, } + } } }; } - break; - case DeviceTaskEnumType.ScheduleAdd: - case DeviceTaskEnumType.ScheduleDelete: + break; + case DeviceTaskEnumType.ScheduleAdd: + case DeviceTaskEnumType.ScheduleDelete: { dto.Info = new ScheduleToDeviceResponse { @@ -138,21 +138,21 @@ public class AssignmentService : IAssignmentService Name = "计划的一部分", Schedules = new List { - new() - { + new() + { Name = "国庆节", DateTimePeriod = new DateTimePeriod { - Start = new DateTime(2024,10,1), - End = new DateTime(2024,10,7) - } + Start = new DateTime(2024, 10, 1), + End = new DateTime(2024, 10, 7) } + } } }; } - break; + break; - case DeviceTaskEnumType.UploadRecord: + case DeviceTaskEnumType.UploadRecord: { dto.Info = new UploadRecordToDeviceResponse { @@ -163,17 +163,15 @@ public class AssignmentService : IAssignmentService } }; } - break; - default: - break; - } + break; + default: + break; + } - return dto; - - }).ToList() - }; - - }).ToList(); + return dto; + }).ToList() + }; + }).ToList(); } /// @@ -234,38 +232,38 @@ public class AssignmentService : IAssignmentService var data = await CommonHelper.RetryAsync(async () => { var page = await _dbContext.Queryable() - .LeftJoin((deviceTask, deivce) => deviceTask.DeviceUniqueNo == deivce.UniqueNo) - .LeftJoin((deviceTask, deivce, deivceTamplate) => deivceTamplate.Code == deivce.TemplateCode) - .LeftJoin((deviceTask, deivce, deivceTamplate, ga) => deviceTask.UserNo == ga.No) - .LeftJoin((deviceTask, deivce, deivceTamplate, ga, galeave) => deviceTask.UserNo == galeave.No) - .LeftJoin((deviceTask, deivce, deivceTamplate, ga, galeave, department) => department.No == ga.DepartmentNo) - .LeftJoin((deviceTask, deivce, deivceTamplate, ga, galeave, department, gainfoEx) => deviceTask.UserNo == gainfoEx.No) - .WhereIF(!request.IsProcess, deviceTask => deviceTask.Status == DeviceTaskStatusEnumType.Wait) - .WhereIF(request.IsProcess, deviceTask => deviceTask.Status == DeviceTaskStatusEnumType.Process - && SqlFunc.DateDiff(DateType.Minute, deviceTask.ModifiedTime, DateTime.Now) > 30) - .WhereIF(request.DeviceUniqueNo.IsPresent(), (deviceTask, deivce) => deviceTask.DeviceUniqueNo == request.DeviceUniqueNo) - .WhereIF(request.Types.IsPresent(), deviceTask => request.Types.Contains(deviceTask.Type)) - .WhereIF(request.Brand.IsPresent(), (deviceTask, deivce, deivceTamplate) => deivceTamplate.Brand == request.Brand) - .OrderBy(deviceTask => new { Priority = SqlFunc.Desc(deviceTask.Priority), deviceTask.CreateTime }) - .Select((deviceTask, deivce, deivceTamplate, ga, galeave, department, gainfoEx) => new TaskDto - { - UserId = SqlFunc.IsNull(SqlFunc.IsNull(deviceTask.UserId, ga.Id), galeave.IdentityUserId), - TaskId = deviceTask.Id, - Type = deviceTask.Type, - DeviceUniqueNo = deviceTask.DeviceUniqueNo, - DeviceConnectionInfo = deivce.ConnectionInfo, - Brand = deivceTamplate.Brand, - FuncStr = deivce.Funcs.ToString(), - UserNo = deviceTask.UserNo, - UserCode = SqlFunc.IsNull(SqlFunc.IsNull(ga.Code, galeave.Code), gainfoEx.Code), - UserName = SqlFunc.IsNull(SqlFunc.IsNull(ga.Name, galeave.Name), gainfoEx.Name), - DepartmentNo = ga.DepartmentNo, - DepartmentName = department.Name, - CardNo = ga.CardNo, - Version = deviceTask.Version, - Status = deviceTask.Status - }) - .ToPageListAsync(request); + .LeftJoin((deviceTask, deivce) => deviceTask.DeviceUniqueNo == deivce.UniqueNo) + .LeftJoin((deviceTask, deivce, deivceTamplate) => deivceTamplate.Code == deivce.TemplateCode) + .LeftJoin((deviceTask, deivce, deivceTamplate, ga) => deviceTask.UserNo == ga.No) + .LeftJoin((deviceTask, deivce, deivceTamplate, ga, galeave) => deviceTask.UserNo == galeave.No) + .LeftJoin((deviceTask, deivce, deivceTamplate, ga, galeave, department) => department.No == ga.DepartmentNo) + .LeftJoin((deviceTask, deivce, deivceTamplate, ga, galeave, department, gainfoEx) => deviceTask.UserNo == gainfoEx.No) + .WhereIF(!request.IsProcess, deviceTask => deviceTask.Status == DeviceTaskStatusEnumType.Wait) + .WhereIF(request.IsProcess, deviceTask => deviceTask.Status == DeviceTaskStatusEnumType.Process + && SqlFunc.DateDiff(DateType.Minute, deviceTask.ModifiedTime, DateTime.Now) > 30) + .WhereIF(request.DeviceUniqueNo.IsPresent(), (deviceTask, deivce) => deviceTask.DeviceUniqueNo == request.DeviceUniqueNo) + .WhereIF(request.Types.IsPresent(), deviceTask => request.Types.Contains(deviceTask.Type)) + .WhereIF(request.Brand.IsPresent(), (deviceTask, deivce, deivceTamplate) => deivceTamplate.Brand == request.Brand) + .OrderBy(deviceTask => new { Priority = SqlFunc.Desc(deviceTask.Priority), deviceTask.CreateTime }) + .Select((deviceTask, deivce, deivceTamplate, ga, galeave, department, gainfoEx) => new TaskDto + { + UserId = SqlFunc.IsNull(SqlFunc.IsNull(deviceTask.UserId, ga.Id), galeave.IdentityUserId), + TaskId = deviceTask.Id, + Type = deviceTask.Type, + DeviceUniqueNo = deviceTask.DeviceUniqueNo, + DeviceConnectionInfo = deivce.ConnectionInfo, + Brand = deivceTamplate.Brand, + FuncStr = deivce.Funcs.ToString(), + UserNo = deviceTask.UserNo, + UserCode = SqlFunc.IsNull(SqlFunc.IsNull(ga.Code, galeave.Code), gainfoEx.Code), + UserName = SqlFunc.IsNull(SqlFunc.IsNull(ga.Name, galeave.Name), gainfoEx.Name), + DepartmentNo = ga.DepartmentNo, + DepartmentName = department.Name, + CardNo = ga.CardNo, + Version = deviceTask.Version, + Status = deviceTask.Status + }) + .ToPageListAsync(request); if (!page.Data.Any()) { @@ -274,22 +272,18 @@ public class AssignmentService : IAssignmentService var taskIdVs = page.Data.Select(x => new { x.TaskId, x.Version, x.Status }).ToList(); var where = LinqExpressionExtensions.False(); - taskIdVs.ForEach(p => - { - where = where.Or(x => x.Id == p.TaskId && x.Version == p.Version && x.Status == p.Status); - }); + taskIdVs.ForEach(p => { where = where.Or(x => x.Id == p.TaskId && x.Version == p.Version && x.Status == p.Status); }); var effecet = await _dbContext.Updateable() - .SetColumns(x => x.Version == x.Version + 1) - .SetColumns(x => x.Status == DeviceTaskStatusEnumType.Process) - .SetColumns(x => x.ModifiedTime == DateTime.Now) - .Where(where) - .ExecuteCommandAsync(); + .SetColumns(x => x.Version == x.Version + 1) + .SetColumns(x => x.Status == DeviceTaskStatusEnumType.Process) + .SetColumns(x => x.ModifiedTime == DateTime.Now) + .Where(where) + .ExecuteCommandAsync(); (taskIdVs.Count != effecet).ThrowIfTrue("获取任务失败"); return page.Data; - }, 5); return data; @@ -304,14 +298,14 @@ public class AssignmentService : IAssignmentService //日志数据最后一条 var logInfos = await _dbContext.Queryable().Select(it => new - { - RowNumber = SqlFunc.RowNumber(SqlFunc.Desc(it.Id), it.DeviceUniqueNo), - it.DeviceUniqueNo, - it.RaiseDateTime - }) - .MergeTable() - .Where(it => it.RowNumber == 1) - .ToListAsync(); + { + RowNumber = SqlFunc.RowNumber(SqlFunc.Desc(it.Id), it.DeviceUniqueNo), + it.DeviceUniqueNo, + it.RaiseDateTime + }) + .MergeTable() + .Where(it => it.RowNumber == 1) + .ToListAsync(); foreach (var item in deviceNos) { @@ -324,4 +318,4 @@ public class AssignmentService : IAssignmentService return new Dictionary(); } -} +} \ No newline at end of file diff --git a/Src/Dlhis.ScheduledTask/TaskAssignment/Services/Implements/DeviceTaskAssignmentService.cs b/Src/Dlhis.ScheduledTask/TaskAssignment/Services/Implements/DeviceTaskAssignmentService.cs index c8434fbe..e752ed7b 100644 --- a/Src/Dlhis.ScheduledTask/TaskAssignment/Services/Implements/DeviceTaskAssignmentService.cs +++ b/Src/Dlhis.ScheduledTask/TaskAssignment/Services/Implements/DeviceTaskAssignmentService.cs @@ -4,10 +4,10 @@ using Dlhis.Entity.Device.Enums; using Dlhis.ScheduledTask.TaskAssignment.Request; using Dlhis.ScheduledTask.TaskAssignment.Response; using Dlhis.Sys.Api; +using Kurisu.AspNetCore.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Services; using Kurisu.AspNetCore.Utils.Extensions; -using Kurisu.Core.DataAccess.Dto; -using Kurisu.SqlSugar.Extensions; -using Kurisu.SqlSugar.Services; using SqlSugar; namespace Dlhis.ScheduledTask.TaskAssignment.Services.Implements; @@ -30,15 +30,15 @@ public class DeviceTaskAssignmentService : IDeviceTaskAssignmentService .LeftJoin((deviceTask, ga, device) => deviceTask.DeviceUniqueNo == device.UniqueNo) .WhereIF(request.Type.HasValue, (deviceTask, ga, device) => deviceTask.DeviceType == request.Type) .WhereIF(request.SearchDateTimePeriod?.Start.HasValue == true && request.SearchDateTimePeriod?.End.HasValue == true, - deviceTask => deviceTask.ModifiedTime >= request.SearchDateTimePeriod.Start && deviceTask.ModifiedTime <= request.SearchDateTimePeriod.End + deviceTask => deviceTask.ModifiedTime >= request.SearchDateTimePeriod.Start && deviceTask.ModifiedTime <= request.SearchDateTimePeriod.End ) .WhereIF(request.TaskTypes.IsPresent(), deviceTask => request.TaskTypes.Contains(deviceTask.Type)) .WhereIF(request.Status.IsPresent(), deviceTask => request.Status.Contains(deviceTask.Status)) .WhereIF(request.UserNo.IsPresent(), deviceTask => deviceTask.UserNo == request.UserNo) .WhereIF(!request.Search.IsEmpty(), (deviceTask, ga, device) => - ga.Name == request.Search - || ga.Code == request.Search - || deviceTask.DeviceUniqueNo == request.Search + ga.Name == request.Search + || ga.Code == request.Search + || deviceTask.DeviceUniqueNo == request.Search ) .OrderBy(deviceTask => deviceTask.CreateTime, OrderByType.Desc) .Select((deviceTask, ga, device) => new DeviceTaskAssignmentResponse @@ -64,11 +64,7 @@ public class DeviceTaskAssignmentService : IDeviceTaskAssignmentService var tenantResult = await _tenantApi.GetTenantsInternalAsync(); var tenants = tenantResult.Data; - page.Data.ForEach(item => - { - item.TenantName = tenants.FirstOrDefault(x => x.Code == item.TenantId)?.Name; - }); - + page.Data.ForEach(item => { item.TenantName = tenants.FirstOrDefault(x => x.Code == item.TenantId)?.Name; }); } catch (Exception) { @@ -92,11 +88,9 @@ public class DeviceTaskAssignmentService : IDeviceTaskAssignmentService //更新任务状态 await _dbContext.Updateable() - .SetColumns(x => x.Status == DeviceTaskStatusEnumType.Wait) - .SetColumns(x => x.ModifiedTime == DateTime.Now) - .Where(x => request.Ids.Contains(x.Id)) - .ExecuteCommandAsync(); + .SetColumns(x => x.Status == DeviceTaskStatusEnumType.Wait) + .SetColumns(x => x.ModifiedTime == DateTime.Now) + .Where(x => request.Ids.Contains(x.Id)) + .ExecuteCommandAsync(); } -} - - +} \ No newline at end of file diff --git a/Src/Dlhis.Sys.Api/Dlhis.Sys.Api.csproj b/Src/Dlhis.Sys.Api/Dlhis.Sys.Api.csproj index 45601c93..3ce3fd2e 100644 --- a/Src/Dlhis.Sys.Api/Dlhis.Sys.Api.csproj +++ b/Src/Dlhis.Sys.Api/Dlhis.Sys.Api.csproj @@ -7,7 +7,7 @@ - + diff --git a/Src/Dlhis.Sys.Api/ITenantApi.cs b/Src/Dlhis.Sys.Api/ITenantApi.cs index 72feba3b..414caffd 100644 --- a/Src/Dlhis.Sys.Api/ITenantApi.cs +++ b/Src/Dlhis.Sys.Api/ITenantApi.cs @@ -1,6 +1,6 @@ using Dlhis.Sys.Api.Response; -using Kurisu.Core.Result; using Kurisu.RemoteCall.Attributes; +using Kurisu.RemoteCall.Default; namespace Dlhis.Sys.Api; diff --git a/Src/Dlhis.Sys.Api/IUserApi.cs b/Src/Dlhis.Sys.Api/IUserApi.cs index fba7db5f..d360ab05 100644 --- a/Src/Dlhis.Sys.Api/IUserApi.cs +++ b/Src/Dlhis.Sys.Api/IUserApi.cs @@ -1,6 +1,6 @@ -using Dlhis.User.Api.Response; -using Kurisu.Core.Result; +using Dlhis.Sys.Api.Response; using Kurisu.RemoteCall.Attributes; +using Kurisu.RemoteCall.Default; namespace Dlhis.Sys.Api; diff --git a/Src/Dlhis.Sys.Api/Response/UserResponse.cs b/Src/Dlhis.Sys.Api/Response/UserResponse.cs index 63e4f67e..56b87f7d 100644 --- a/Src/Dlhis.Sys.Api/Response/UserResponse.cs +++ b/Src/Dlhis.Sys.Api/Response/UserResponse.cs @@ -1,4 +1,4 @@ -namespace Dlhis.User.Api.Response; +namespace Dlhis.Sys.Api.Response; public class UserResponse { diff --git a/Src/Dlhis.Sys/Dlhis.Sys.csproj b/Src/Dlhis.Sys/Dlhis.Sys.csproj index 17cd8753..ff5b9084 100644 --- a/Src/Dlhis.Sys/Dlhis.Sys.csproj +++ b/Src/Dlhis.Sys/Dlhis.Sys.csproj @@ -16,10 +16,6 @@ - - - - diff --git a/Src/Dlhis.Sys/Identity/Controllers/RolesController.cs b/Src/Dlhis.Sys/Identity/Controllers/RolesController.cs index ebd9446a..e2638836 100644 --- a/Src/Dlhis.Sys/Identity/Controllers/RolesController.cs +++ b/Src/Dlhis.Sys/Identity/Controllers/RolesController.cs @@ -1,7 +1,7 @@ using Dlhis.Sys.Identity.Request; using Dlhis.Sys.Identity.Response; -using Dlhis.User.Identity.Services; -using Kurisu.Core.DataAccess.Dto; +using Dlhis.Sys.Identity.Services; +using Kurisu.AspNetCore.DataAccess.Dto; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; @@ -52,7 +52,7 @@ public class RolesController : ControllerBase /// [Authorize(Roles = "admin")] [HttpPost("assign")] - public async Task AssignRole(AssignRoleRequest request) + public async Task AssignRole(RoleAssignRequest request) { await _roleService.AssignRoleAsync(request); } @@ -75,7 +75,7 @@ public class RolesController : ControllerBase /// [Authorize(Roles = "admin")] [HttpPost("delete")] - public async Task RemoveRole(RoleRemoveRequest request) + public async Task RemoveRole(IdRequest request) { await _roleService.RemoveRoleAsync(request); } diff --git a/Src/Dlhis.Sys/Identity/Controllers/TenantsController.cs b/Src/Dlhis.Sys/Identity/Controllers/TenantsController.cs index e02834f2..bf30cf4c 100644 --- a/Src/Dlhis.Sys/Identity/Controllers/TenantsController.cs +++ b/Src/Dlhis.Sys/Identity/Controllers/TenantsController.cs @@ -1,7 +1,7 @@ using Dlhis.Sys.Identity.Request; using Dlhis.Sys.Identity.Response; using Dlhis.Sys.Identity.Services; -using Kurisu.Core.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.Dto; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; diff --git a/Src/Dlhis.Sys/Identity/Controllers/UsersController.cs b/Src/Dlhis.Sys/Identity/Controllers/UsersController.cs index d11a2293..58fb47b5 100644 --- a/Src/Dlhis.Sys/Identity/Controllers/UsersController.cs +++ b/Src/Dlhis.Sys/Identity/Controllers/UsersController.cs @@ -1,7 +1,7 @@ using Dlhis.Sys.Identity.Request; using Dlhis.Sys.Identity.Response; using Dlhis.Sys.Identity.Services; -using Kurisu.Core.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.Dto; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; diff --git a/Src/Dlhis.Sys/Identity/Request/AssignRoleRequest.cs b/Src/Dlhis.Sys/Identity/Request/AssignRoleRequest.cs deleted file mode 100644 index c66d25c5..00000000 --- a/Src/Dlhis.Sys/Identity/Request/AssignRoleRequest.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace Dlhis.Sys.Identity.Request; - -public class AssignRoleRequest -{ - public int UserId { get; set; } - - public int? RoleId { get; set; } -} diff --git a/Src/Dlhis.Sys/Identity/Request/ClientGrantRequest.cs b/Src/Dlhis.Sys/Identity/Request/ClientGrantRequest.cs deleted file mode 100644 index b91e5398..00000000 --- a/Src/Dlhis.Sys/Identity/Request/ClientGrantRequest.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace Dlhis.Sys.Identity.Request; - -public class ClientGrantRequest -{ - public string ClientId { get; set; } - - public string ClientSecret { get; set; } - - public string Scope { get; set; } = "yikatong"; -} diff --git a/Src/Dlhis.Sys/Identity/Request/IdRequest.cs b/Src/Dlhis.Sys/Identity/Request/IdRequest.cs new file mode 100644 index 00000000..27eb7b1a --- /dev/null +++ b/Src/Dlhis.Sys/Identity/Request/IdRequest.cs @@ -0,0 +1,6 @@ +namespace Dlhis.Sys.Identity.Request; + +public class IdRequest +{ + public int? Id { get; set; } +} diff --git a/Src/Dlhis.Sys/Identity/Request/RoleAssignRequest.cs b/Src/Dlhis.Sys/Identity/Request/RoleAssignRequest.cs new file mode 100644 index 00000000..7e2bf7cb --- /dev/null +++ b/Src/Dlhis.Sys/Identity/Request/RoleAssignRequest.cs @@ -0,0 +1,14 @@ +namespace Dlhis.Sys.Identity.Request; + +public class RoleAssignRequest +{ + /// + /// 用户id + /// + public int UserId { get; set; } + + /// + /// 角色id + /// + public int? RoleId { get; set; } +} diff --git a/Src/Dlhis.Sys/Identity/Request/RolePageRequest.cs b/Src/Dlhis.Sys/Identity/Request/RolePageRequest.cs index 2c0ceab3..f8d2b2ea 100644 --- a/Src/Dlhis.Sys/Identity/Request/RolePageRequest.cs +++ b/Src/Dlhis.Sys/Identity/Request/RolePageRequest.cs @@ -1,4 +1,4 @@ -using Kurisu.Core.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.Dto; namespace Dlhis.Sys.Identity.Request; diff --git a/Src/Dlhis.Sys/Identity/Request/RoleRemoveRequest.cs b/Src/Dlhis.Sys/Identity/Request/RoleRemoveRequest.cs deleted file mode 100644 index ade423a8..00000000 --- a/Src/Dlhis.Sys/Identity/Request/RoleRemoveRequest.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Dlhis.Sys.Identity.Request; - -public class RoleRemoveRequest -{ - public int Id { get; set; } -} diff --git a/Src/Dlhis.Sys/Identity/Request/RoleSaveRequest.cs b/Src/Dlhis.Sys/Identity/Request/RoleSaveRequest.cs index 52f6eda7..568cf3e1 100644 --- a/Src/Dlhis.Sys/Identity/Request/RoleSaveRequest.cs +++ b/Src/Dlhis.Sys/Identity/Request/RoleSaveRequest.cs @@ -2,13 +2,17 @@ namespace Dlhis.Sys.Identity.Request; -public class RoleSaveRequest +public class RoleSaveRequest : IdRequest { - public int? Id { get; set; } - + /// + /// 角色名称 + /// [Required(ErrorMessage = "角色标识不能为空")] public string Name { get; set; } + /// + /// 描述 + /// [Required(ErrorMessage = "描述不能为空")] public string Description { get; set; } -} +} \ No newline at end of file diff --git a/Src/Dlhis.Sys/Identity/Request/TenantPageRequest.cs b/Src/Dlhis.Sys/Identity/Request/TenantPageRequest.cs index f5a5704a..3eb45fd8 100644 --- a/Src/Dlhis.Sys/Identity/Request/TenantPageRequest.cs +++ b/Src/Dlhis.Sys/Identity/Request/TenantPageRequest.cs @@ -1,8 +1,7 @@ -using Kurisu.Core.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.Dto; -namespace Dlhis.Sys.Identity.Request +namespace Dlhis.Sys.Identity.Request; + +public class TenantPageRequest : PageDto { - public class TenantPageRequest : PageDto - { - } -} +} \ No newline at end of file diff --git a/Src/Dlhis.Sys/Identity/Request/TenantSaveRequest.cs b/Src/Dlhis.Sys/Identity/Request/TenantSaveRequest.cs index 700c3ba0..6945b6aa 100644 --- a/Src/Dlhis.Sys/Identity/Request/TenantSaveRequest.cs +++ b/Src/Dlhis.Sys/Identity/Request/TenantSaveRequest.cs @@ -2,10 +2,8 @@ namespace Dlhis.Sys.Identity.Request; -public class TenantSaveRequest +public class TenantSaveRequest : IdRequest { - public int? Id { get; set; } - /// /// 上级 /// @@ -22,4 +20,4 @@ public class TenantSaveRequest /// [Required(ErrorMessage = "基地/租户名称不能为空")] public string Name { get; set; } -} +} \ No newline at end of file diff --git a/Src/Dlhis.Sys/Identity/Request/UserAvatarUploadRequest.cs b/Src/Dlhis.Sys/Identity/Request/UserAvatarUploadRequest.cs index c0838d03..244b84d8 100644 --- a/Src/Dlhis.Sys/Identity/Request/UserAvatarUploadRequest.cs +++ b/Src/Dlhis.Sys/Identity/Request/UserAvatarUploadRequest.cs @@ -1,18 +1,18 @@ using System.ComponentModel.DataAnnotations; +using Dlhis.Entity; namespace Dlhis.Sys.Identity.Request; -public class UserAvatarUploadRequest +public class UserAvatarUploadRequest : IImageUrl { /// /// 用户id /// - [Range(1, int.MaxValue)] - public int UserNo { get; set; } + public int UserId { get; set; } /// /// 图片地址 /// [Required(ErrorMessage = "图片地址不能为空")] - public string Picture { get; set; } -} + public string ImageUrl { get; set; } +} \ No newline at end of file diff --git a/Src/Dlhis.Sys/Identity/Request/UserPageRequest.cs b/Src/Dlhis.Sys/Identity/Request/UserPageRequest.cs index 02136a5d..5b48e534 100644 --- a/Src/Dlhis.Sys/Identity/Request/UserPageRequest.cs +++ b/Src/Dlhis.Sys/Identity/Request/UserPageRequest.cs @@ -1,4 +1,4 @@ -using Kurisu.Core.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.Dto; namespace Dlhis.Sys.Identity.Request; diff --git a/Src/Dlhis.Sys/Identity/Request/UserTenantSaveRequest.cs b/Src/Dlhis.Sys/Identity/Request/UserTenantSaveRequest.cs index 2df4d8c5..7b41c066 100644 --- a/Src/Dlhis.Sys/Identity/Request/UserTenantSaveRequest.cs +++ b/Src/Dlhis.Sys/Identity/Request/UserTenantSaveRequest.cs @@ -1,9 +1,14 @@ -namespace Dlhis.Sys.Identity.Request -{ - public class UserTenantSaveRequest - { - public int UserId { get; set; } +namespace Dlhis.Sys.Identity.Request; - public List TenantCodes { get; set; } = new(); - } +public class UserTenantSaveRequest +{ + /// + /// 用户id + /// + public int UserId { get; set; } + + /// + /// 租户codes + /// + public List TenantCodes { get; set; } = new(); } \ No newline at end of file diff --git a/Src/Dlhis.Sys/Identity/Services/IRoleService.cs b/Src/Dlhis.Sys/Identity/Services/IRoleService.cs index 4cb1dba1..9590241c 100644 --- a/Src/Dlhis.Sys/Identity/Services/IRoleService.cs +++ b/Src/Dlhis.Sys/Identity/Services/IRoleService.cs @@ -1,8 +1,8 @@ using Dlhis.Sys.Identity.Request; using Dlhis.Sys.Identity.Response; -using Kurisu.Core.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.Dto; -namespace Dlhis.User.Identity.Services; +namespace Dlhis.Sys.Identity.Services; public interface IRoleService : IScopeDependency { @@ -14,7 +14,7 @@ public interface IRoleService : IScopeDependency Task GetMyRoleAsync(int? userId); - Task RemoveRoleAsync(RoleRemoveRequest request); + Task RemoveRoleAsync(IdRequest request); - Task AssignRoleAsync(AssignRoleRequest request); + Task AssignRoleAsync(RoleAssignRequest request); } diff --git a/Src/Dlhis.Sys/Identity/Services/ITenantService.cs b/Src/Dlhis.Sys/Identity/Services/ITenantService.cs index c7fb53d8..9b33740d 100644 --- a/Src/Dlhis.Sys/Identity/Services/ITenantService.cs +++ b/Src/Dlhis.Sys/Identity/Services/ITenantService.cs @@ -1,6 +1,6 @@ using Dlhis.Sys.Identity.Request; using Dlhis.Sys.Identity.Response; -using Kurisu.Core.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.Dto; namespace Dlhis.Sys.Identity.Services; diff --git a/Src/Dlhis.Sys/Identity/Services/IUserService.cs b/Src/Dlhis.Sys/Identity/Services/IUserService.cs index 02622619..f50a8977 100644 --- a/Src/Dlhis.Sys/Identity/Services/IUserService.cs +++ b/Src/Dlhis.Sys/Identity/Services/IUserService.cs @@ -1,6 +1,6 @@ using Dlhis.Sys.Identity.Request; using Dlhis.Sys.Identity.Response; -using Kurisu.Core.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.Dto; namespace Dlhis.Sys.Identity.Services; diff --git a/Src/Dlhis.Sys/Identity/Services/Implements/RoleService.cs b/Src/Dlhis.Sys/Identity/Services/Implements/RoleService.cs index c8248594..c4af0913 100644 --- a/Src/Dlhis.Sys/Identity/Services/Implements/RoleService.cs +++ b/Src/Dlhis.Sys/Identity/Services/Implements/RoleService.cs @@ -1,13 +1,12 @@ using Dlhis.Entity.Sys.Entities; using Dlhis.Sys.Identity.Request; using Dlhis.Sys.Identity.Response; -using Dlhis.User.Identity.Services; +using Kurisu.AspNetCore.Authentication.Abstractions; +using Kurisu.AspNetCore.CustomClass; +using Kurisu.AspNetCore.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Services; using Kurisu.AspNetCore.Utils.Extensions; -using Kurisu.Core.CustomClass; -using Kurisu.Core.DataAccess.Dto; -using Kurisu.Core.User.Abstractions; -using Kurisu.SqlSugar.Extensions; -using Kurisu.SqlSugar.Services; namespace Dlhis.Sys.Identity.Services.Implements; @@ -71,7 +70,7 @@ public class RoleService : IRoleService } - public async Task AssignRoleAsync(AssignRoleRequest request) + public async Task AssignRoleAsync(RoleAssignRequest request) { var myUserId = _currentUser.GetIntSubjectId(); @@ -113,7 +112,7 @@ public class RoleService : IRoleService } } - public async Task RemoveRoleAsync(RoleRemoveRequest request) + public async Task RemoveRoleAsync(IdRequest request) { var role = await _dbContext.Queryable().FirstAsync(x => x.Id == request.Id); role.ThrowIfNull("角色不存在"); diff --git a/Src/Dlhis.Sys/Identity/Services/Implements/TenantService.cs b/Src/Dlhis.Sys/Identity/Services/Implements/TenantService.cs index 9cda48e0..42ebbb7d 100644 --- a/Src/Dlhis.Sys/Identity/Services/Implements/TenantService.cs +++ b/Src/Dlhis.Sys/Identity/Services/Implements/TenantService.cs @@ -1,11 +1,11 @@ using Dlhis.Entity.Sys.Entities; using Dlhis.Sys.Identity.Request; using Dlhis.Sys.Identity.Response; +using Kurisu.AspNetCore.Authentication.Abstractions; +using Kurisu.AspNetCore.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Services; using Kurisu.AspNetCore.Utils.Extensions; -using Kurisu.Core.DataAccess.Dto; -using Kurisu.Core.User.Abstractions; -using Kurisu.SqlSugar.Extensions; -using Kurisu.SqlSugar.Services; namespace Dlhis.Sys.Identity.Services.Implements; diff --git a/Src/Dlhis.Sys/Identity/Services/Implements/UserService.cs b/Src/Dlhis.Sys/Identity/Services/Implements/UserService.cs index 86f5eb85..448f0d2a 100644 --- a/Src/Dlhis.Sys/Identity/Services/Implements/UserService.cs +++ b/Src/Dlhis.Sys/Identity/Services/Implements/UserService.cs @@ -2,11 +2,11 @@ using Dlhis.Entity.Sys.Entities; using Dlhis.Sys.Identity.Request; using Dlhis.Sys.Identity.Response; +using Kurisu.AspNetCore.Authentication.Abstractions; +using Kurisu.AspNetCore.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Services; using Kurisu.AspNetCore.Utils.Extensions; -using Kurisu.Core.DataAccess.Dto; -using Kurisu.Core.User.Abstractions; -using Kurisu.SqlSugar.Extensions; -using Kurisu.SqlSugar.Services; using Microsoft.AspNetCore.Identity; using SqlSugar; @@ -94,7 +94,7 @@ public class UserService : IUserService public async Task UploadUserAvatarAsync(UserAvatarUploadRequest request) { - var user = await _identityDbContext.Queryable().Where(x => x.Id == request.UserNo).Select().FirstAsync(); + var user = await _identityDbContext.Queryable().Where(x => x.Id == request.UserId).Select().FirstAsync(); } public async Task> GetUserByIdsAsync(List ids) diff --git a/Src/Dlhis.Sys/Identity/Services/Implements/UserTenantService.cs b/Src/Dlhis.Sys/Identity/Services/Implements/UserTenantService.cs index 3b10b794..e5caad4e 100644 --- a/Src/Dlhis.Sys/Identity/Services/Implements/UserTenantService.cs +++ b/Src/Dlhis.Sys/Identity/Services/Implements/UserTenantService.cs @@ -1,7 +1,7 @@ using Dlhis.Entity.Sys.Entities; using Dlhis.Sys.Identity.Request; using Dlhis.Sys.Identity.Response; -using Kurisu.SqlSugar.Services; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Services; namespace Dlhis.Sys.Identity.Services.Implements; diff --git a/Src/Dlhis.Sys/Menu/Request/MenuPermissionAssignmentRequest.cs b/Src/Dlhis.Sys/Menu/Request/MenuPermissionAssignmentRequest.cs index fc1c9253..1b168e62 100644 --- a/Src/Dlhis.Sys/Menu/Request/MenuPermissionAssignmentRequest.cs +++ b/Src/Dlhis.Sys/Menu/Request/MenuPermissionAssignmentRequest.cs @@ -21,5 +21,5 @@ public class MenuPermissionAssignmentRequest /// /// 权限code /// - public List Codes { get; set; } = new List(); + public List Codes { get; set; } = new(); } diff --git a/Src/Dlhis.Sys/Menu/Services/Implements/MenuService.cs b/Src/Dlhis.Sys/Menu/Services/Implements/MenuService.cs index 130efa5d..1cc4da2d 100644 --- a/Src/Dlhis.Sys/Menu/Services/Implements/MenuService.cs +++ b/Src/Dlhis.Sys/Menu/Services/Implements/MenuService.cs @@ -3,9 +3,9 @@ using Dlhis.Entity.Sys.Enums; using Dlhis.Sys.Identity.Services; using Dlhis.Sys.Menu.Request; using Dlhis.Sys.Menu.Response; +using Kurisu.AspNetCore.Authentication.Abstractions; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Services; using Kurisu.AspNetCore.Utils.Extensions; -using Kurisu.Core.User.Abstractions; -using Kurisu.SqlSugar.Services; using Mapster; namespace Dlhis.Sys.Menu.Services.Implements; diff --git a/Src/Dlhis.Sys/Program.cs b/Src/Dlhis.Sys/Program.cs index b534ae13..b01d30b3 100644 --- a/Src/Dlhis.Sys/Program.cs +++ b/Src/Dlhis.Sys/Program.cs @@ -1,5 +1,4 @@ using Kurisu.AspNetCore.Startup; -using Kurisu.Startup; using Microsoft.IdentityModel.Logging; namespace Dlhis.Sys; diff --git a/Src/Dlhis.Sys/SqlSugarPack.cs b/Src/Dlhis.Sys/SqlSugarPack.cs index bcdb702f..91ff172a 100644 --- a/Src/Dlhis.Sys/SqlSugarPack.cs +++ b/Src/Dlhis.Sys/SqlSugarPack.cs @@ -1,13 +1,11 @@ -using Kurisu.AspNetCore.Startup; -using Kurisu.SqlSugar.Extensions; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions; +using Kurisu.AspNetCore.Startup; using SqlSugar; namespace Dlhis.Sys; public class SqlSugarPack : BaseAppPack { - public override bool IsBeforeUseRouting { get; } - public override void ConfigureServices(IServiceCollection services) { services.AddSqlSugar(sp => @@ -16,8 +14,8 @@ public class SqlSugarPack : BaseAppPack return new List { - new() - { + new() + { ConfigId = "identity", ConnectionString = configuration.GetSection("SqlSugarOptions:IdentityConnectionString").Value, @@ -29,9 +27,9 @@ public class SqlSugarPack : BaseAppPack { DisableNvarchar = true, } - }, - new() - { + }, + new() + { ConfigId = "default", ConnectionString = configuration.GetSection("SqlSugarOptions:DefaultConnectionString").Value, @@ -43,7 +41,7 @@ public class SqlSugarPack : BaseAppPack { DisableNvarchar = true, } - } + } }; }); } diff --git a/Src/Dlhis.User/Dlhis.User.csproj b/Src/Dlhis.User/Dlhis.User.csproj index a2aac251..6a45a927 100644 --- a/Src/Dlhis.User/Dlhis.User.csproj +++ b/Src/Dlhis.User/Dlhis.User.csproj @@ -17,6 +17,6 @@ - + diff --git a/Src/Dlhis.User/Identity/Controllers/OAuth2Controller.cs b/Src/Dlhis.User/Identity/Controllers/OAuth2Controller.cs index fb12a3a3..35a2d7e8 100644 --- a/Src/Dlhis.User/Identity/Controllers/OAuth2Controller.cs +++ b/Src/Dlhis.User/Identity/Controllers/OAuth2Controller.cs @@ -35,4 +35,4 @@ public class OAuth2Controller : ControllerBase var result = await response.Content.ReadAsStringAsync(); return JObject.Parse(result); } -} +} \ No newline at end of file diff --git a/Src/Dlhis.User/Packs/OAuth2HttpClientPack.cs b/Src/Dlhis.User/Packs/OAuth2HttpClientPack.cs index bb921f98..c630707c 100644 --- a/Src/Dlhis.User/Packs/OAuth2HttpClientPack.cs +++ b/Src/Dlhis.User/Packs/OAuth2HttpClientPack.cs @@ -4,26 +4,24 @@ namespace Dlhis.User.Packs; public class OAuth2HttpClientPack : BaseAppPack { - public override bool IsBeforeUseRouting { get; } - public override void ConfigureServices(IServiceCollection services) { services.AddHttpClient("oauth2", (sp, httpClient) => - { - if (sp.GetService().IsProduction()) { - httpClient.DefaultRequestHeaders.Add("X-Requested-Internal", "internal"); - } - }) - .ConfigurePrimaryHttpMessageHandler(() => - { - var handler = new HttpClientHandler + if (sp.GetService().IsProduction()) + { + httpClient.DefaultRequestHeaders.Add("X-Requested-Internal", "internal"); + } + }) + .ConfigurePrimaryHttpMessageHandler(() => { - ClientCertificateOptions = ClientCertificateOption.Manual, - ServerCertificateCustomValidationCallback = (_, _, _, _) => true - }; + var handler = new HttpClientHandler + { + ClientCertificateOptions = ClientCertificateOption.Manual, + ServerCertificateCustomValidationCallback = (_, _, _, _) => true + }; - return handler; - }); + return handler; + }); } -} +} \ No newline at end of file diff --git a/Src/Dlhis.User/Program.cs b/Src/Dlhis.User/Program.cs index fa00530b..57ceb571 100644 --- a/Src/Dlhis.User/Program.cs +++ b/Src/Dlhis.User/Program.cs @@ -1,5 +1,4 @@ using Kurisu.AspNetCore.Startup; -using Kurisu.Startup; using Microsoft.IdentityModel.Logging; namespace Dlhis.User diff --git a/Src/Dlhis.Visitor/Appointment/Controllers/AppointmentAreasController.cs b/Src/Dlhis.Visitor/Appointment/Controllers/AppointmentAreasController.cs index fd465573..984da794 100644 --- a/Src/Dlhis.Visitor/Appointment/Controllers/AppointmentAreasController.cs +++ b/Src/Dlhis.Visitor/Appointment/Controllers/AppointmentAreasController.cs @@ -1,8 +1,8 @@ using Dlhis.Visitor.Appointment.Request; using Dlhis.Visitor.Appointment.Response; using Dlhis.Visitor.Appointment.Services; +using Kurisu.AspNetCore.DataAccess.Dto; using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop; -using Kurisu.Core.DataAccess.Dto; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; diff --git a/Src/Dlhis.Visitor/Appointment/Controllers/AppointmentsController.cs b/Src/Dlhis.Visitor/Appointment/Controllers/AppointmentsController.cs index 0f4ff10b..90678864 100644 --- a/Src/Dlhis.Visitor/Appointment/Controllers/AppointmentsController.cs +++ b/Src/Dlhis.Visitor/Appointment/Controllers/AppointmentsController.cs @@ -2,8 +2,8 @@ using System.ComponentModel.DataAnnotations; using Dlhis.Visitor.Appointment.Request; using Dlhis.Visitor.Appointment.Response; using Dlhis.Visitor.Appointment.Services; +using Kurisu.AspNetCore.DataAccess.Dto; using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop; -using Kurisu.Core.DataAccess.Dto; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; diff --git a/Src/Dlhis.Visitor/Appointment/Request/AppointmentIdNoPageRequest.cs b/Src/Dlhis.Visitor/Appointment/Request/AppointmentIdNoPageRequest.cs index bca1f311..bc8682e0 100644 --- a/Src/Dlhis.Visitor/Appointment/Request/AppointmentIdNoPageRequest.cs +++ b/Src/Dlhis.Visitor/Appointment/Request/AppointmentIdNoPageRequest.cs @@ -1,5 +1,5 @@ using System.ComponentModel.DataAnnotations; -using Kurisu.Core.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.Dto; namespace Dlhis.Visitor.Appointment.Request; @@ -11,4 +11,4 @@ public class AppointmentIdNoPageRequest : PageDto [StringLength(18, MinimumLength = 18, ErrorMessage = "身份证错误")] [Required(ErrorMessage = "身份证不可为空")] public string IdNo { get; set; } -} +} \ No newline at end of file diff --git a/Src/Dlhis.Visitor/Appointment/Request/AppointmentPageRequest.cs b/Src/Dlhis.Visitor/Appointment/Request/AppointmentPageRequest.cs index 88d7be1c..cec11f6d 100644 --- a/Src/Dlhis.Visitor/Appointment/Request/AppointmentPageRequest.cs +++ b/Src/Dlhis.Visitor/Appointment/Request/AppointmentPageRequest.cs @@ -1,5 +1,5 @@ -using Kurisu.Core.CustomClass; -using Kurisu.Core.DataAccess.Dto; +using Kurisu.AspNetCore.CustomClass; +using Kurisu.AspNetCore.DataAccess.Dto; namespace Dlhis.Visitor.Appointment.Request; diff --git a/Src/Dlhis.Visitor/Appointment/Request/ApponintmentAreaSaveRequest.cs b/Src/Dlhis.Visitor/Appointment/Request/ApponintmentAreaSaveRequest.cs deleted file mode 100644 index 40005e9d..00000000 --- a/Src/Dlhis.Visitor/Appointment/Request/ApponintmentAreaSaveRequest.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using Dlhis.Entity.Visitor.Enums; - -namespace Dlhis.Visitor.Appointment.Request -{ - public class ApponintmentAreaSaveRequest - { - public long? Id { get; set; } - - /// - /// - /// - [EnumDataType(typeof(AppointmentAreaEnumType))] - public AppointmentAreaEnumType Type { get; set; } - - public string CustomCode { get; set; } - } -} diff --git a/Src/Dlhis.Visitor/Appointment/Services/IAppointmentAreaService.cs b/Src/Dlhis.Visitor/Appointment/Services/IAppointmentAreaService.cs index 82763945..0a384e36 100644 --- a/Src/Dlhis.Visitor/Appointment/Services/IAppointmentAreaService.cs +++ b/Src/Dlhis.Visitor/Appointment/Services/IAppointmentAreaService.cs @@ -1,6 +1,6 @@ using Dlhis.Visitor.Appointment.Request; using Dlhis.Visitor.Appointment.Response; -using Kurisu.Core.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.Dto; namespace Dlhis.Visitor.Appointment.Services; diff --git a/Src/Dlhis.Visitor/Appointment/Services/IAppointmentService.cs b/Src/Dlhis.Visitor/Appointment/Services/IAppointmentService.cs index f020bfb9..1b0b83f7 100644 --- a/Src/Dlhis.Visitor/Appointment/Services/IAppointmentService.cs +++ b/Src/Dlhis.Visitor/Appointment/Services/IAppointmentService.cs @@ -1,6 +1,6 @@ using Dlhis.Visitor.Appointment.Request; using Dlhis.Visitor.Appointment.Response; -using Kurisu.Core.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.Dto; using Microsoft.AspNetCore.Mvc; namespace Dlhis.Visitor.Appointment.Services; @@ -39,4 +39,4 @@ public interface IAppointmentService : IScopeDependency Task> GetRecordPageByIdNoAsync([FromQuery] AppointmentIdNoPageRequest request); -} +} \ No newline at end of file diff --git a/Src/Dlhis.Visitor/Appointment/Services/Implements/AppointmentAreaService.cs b/Src/Dlhis.Visitor/Appointment/Services/Implements/AppointmentAreaService.cs index b3422518..599726d3 100644 --- a/Src/Dlhis.Visitor/Appointment/Services/Implements/AppointmentAreaService.cs +++ b/Src/Dlhis.Visitor/Appointment/Services/Implements/AppointmentAreaService.cs @@ -5,10 +5,10 @@ using Dlhis.Entity.Visitor.Entity; using Dlhis.Entity.Visitor.Enums; using Dlhis.Visitor.Appointment.Request; using Dlhis.Visitor.Appointment.Response; +using Kurisu.AspNetCore.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Services; using Kurisu.AspNetCore.Utils.Extensions; -using Kurisu.Core.DataAccess.Dto; -using Kurisu.SqlSugar.Extensions; -using Kurisu.SqlSugar.Services; using Mapster; namespace Dlhis.Visitor.Appointment.Services.Implements; diff --git a/Src/Dlhis.Visitor/Appointment/Services/Implements/AppointmentService.cs b/Src/Dlhis.Visitor/Appointment/Services/Implements/AppointmentService.cs index bfe29160..8e00af9c 100644 --- a/Src/Dlhis.Visitor/Appointment/Services/Implements/AppointmentService.cs +++ b/Src/Dlhis.Visitor/Appointment/Services/Implements/AppointmentService.cs @@ -5,11 +5,11 @@ using Dlhis.Entity.Visitor.Entity; using Dlhis.Entity.Visitor.Enums; using Dlhis.Visitor.Appointment.Request; using Dlhis.Visitor.Appointment.Response; +using Kurisu.AspNetCore.CustomClass; +using Kurisu.AspNetCore.DataAccess.Dto; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Services; using Kurisu.AspNetCore.Utils.Extensions; -using Kurisu.Core.CustomClass; -using Kurisu.Core.DataAccess.Dto; -using Kurisu.SqlSugar.Extensions; -using Kurisu.SqlSugar.Services; using Microsoft.AspNetCore.DataProtection; using Microsoft.AspNetCore.Mvc; using SqlSugar; @@ -134,7 +134,7 @@ public class AppointmentService : IAppointmentService detail.ThrowIfNull("预约信息不存在"); var mst = await _dbContext.Queryable().Where(x => x.Id == detail.AppointmentId).SingleAsync(); - + //当前分配的设备codes var deviceCodes = await _dbContext.Queryable() .Where(x => x.CustomCode == mst.AreaCustomCode) @@ -156,7 +156,7 @@ public class AppointmentService : IAppointmentService UserNo = userNo, Type = DeviceTaskEnumType.Add, Priority = 100, - Source = DeviceTaskSourceEnumType.Appointment, + Source = DeviceTaskSourceEnumType.Appointment, Version = 0 }).ToList()); diff --git a/Src/Dlhis.Visitor/Dlhis.Visitor.csproj b/Src/Dlhis.Visitor/Dlhis.Visitor.csproj index e76f0181..884581c7 100644 --- a/Src/Dlhis.Visitor/Dlhis.Visitor.csproj +++ b/Src/Dlhis.Visitor/Dlhis.Visitor.csproj @@ -14,7 +14,6 @@ - diff --git a/Src/Dlhis.Visitor/Packs/SqlSugarPack.cs b/Src/Dlhis.Visitor/Packs/SqlSugarPack.cs index fc4bf67f..a92ef941 100644 --- a/Src/Dlhis.Visitor/Packs/SqlSugarPack.cs +++ b/Src/Dlhis.Visitor/Packs/SqlSugarPack.cs @@ -1,13 +1,11 @@ -using Kurisu.AspNetCore.Startup; -using Kurisu.SqlSugar.Extensions; +using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions; +using Kurisu.AspNetCore.Startup; using SqlSugar; namespace Dlhis.Visitor.Packs; public class SqlSugarPack : BaseAppPack { - public override bool IsBeforeUseRouting { get; } - public override void ConfigureServices(IServiceCollection services) { services.AddSqlSugar(sp => @@ -16,8 +14,8 @@ public class SqlSugarPack : BaseAppPack return new List { - new() - { + new() + { ConfigId = "face", ConnectionString = configuration.GetSection("SqlSugarOptions:FaceConnectionString").Value, @@ -29,7 +27,7 @@ public class SqlSugarPack : BaseAppPack { DisableNvarchar = true, } - } + } }; }); } diff --git a/Src/Dlhis.Visitor/Program.cs b/Src/Dlhis.Visitor/Program.cs index db27a2eb..2da36e95 100644 --- a/Src/Dlhis.Visitor/Program.cs +++ b/Src/Dlhis.Visitor/Program.cs @@ -1,5 +1,4 @@ using Kurisu.AspNetCore.Startup; -using Kurisu.Startup; using Microsoft.IdentityModel.Logging; namespace Dlhis.Visitor;