diff --git a/Src/Dlhis.Basic/Organization/Controllers/GainfoPermissionsController.cs b/Src/Dlhis.Basic/Organization/Controllers/GainfoPermissionsController.cs index a5a9a006..728e48a9 100644 --- a/Src/Dlhis.Basic/Organization/Controllers/GainfoPermissionsController.cs +++ b/Src/Dlhis.Basic/Organization/Controllers/GainfoPermissionsController.cs @@ -1,15 +1,11 @@ using Dlhis.Basic.BusinessPlace.Response; using Dlhis.Basic.Device.Response; -using Dlhis.Basic.Device.Services; using Dlhis.Basic.Organization.Request; using Dlhis.Basic.Organization.Response; using Dlhis.Basic.Organization.Services; -using Dlhis.Basic.Organization.Services.Implements; -using Dlhis.Entity.Device.Entities; using Kurisu.Core.DataAccess.Dto; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; -using Org.BouncyCastle.Asn1.Ocsp; namespace Dlhis.Basic.Organization.Controllers; @@ -32,7 +28,7 @@ public class GainfoPermissionsController : ControllerBase /// /// [HttpGet("placesByGainfo")] - public async Task> GetPlaceByGainfoAsync([FromQuery]DeviceAssRequest request) + public async Task> GetPlaceByGainfoAsync([FromQuery] DeviceAssRequest request) { return await _gainfoPermissions.GetPlaceByGainfoAsync(request); } @@ -55,7 +51,7 @@ public class GainfoPermissionsController : ControllerBase /// /// [HttpGet("assignDeviceCodes")] - public async Task> GetAssignDeviceCodesAsync([FromQuery]DeviceAssRequest request) + public async Task> GetAssignDeviceCodesAsync([FromQuery] DeviceAssRequest request) { return await _gainfoPermissions.GetAssignDeviceCodesAsync(request); } diff --git a/Src/Dlhis.Basic/Organization/Request/DeviceAssRequest.cs b/Src/Dlhis.Basic/Organization/Request/DeviceAssRequest.cs index 095b49f7..d750b485 100644 --- a/Src/Dlhis.Basic/Organization/Request/DeviceAssRequest.cs +++ b/Src/Dlhis.Basic/Organization/Request/DeviceAssRequest.cs @@ -1,11 +1,17 @@ -using Kurisu.Core.DataAccess.Dto; +using Dlhis.Entity.Device.Enums; +using Kurisu.Core.DataAccess.Dto; using System.ComponentModel.DataAnnotations; -namespace Dlhis.Basic.Organization.Request +namespace Dlhis.Basic.Organization.Request; + +public class DeviceAssRequest : PageDto { - public class DeviceAssRequest : PageDto - { - [Required] - public string UserNo { get; set; } - } + [Required] + public string UserNo { get; set; } + + /// + /// 设备类型 + /// + [EnumDataType(typeof(DeviceTypeEnumType))] + public DeviceTypeEnumType? DeviceType { get; set; } } diff --git a/Src/Dlhis.Basic/Organization/Response/GainfoDetailResponse.cs b/Src/Dlhis.Basic/Organization/Response/GainfoDetailResponse.cs index af1460b3..e3c21c36 100644 --- a/Src/Dlhis.Basic/Organization/Response/GainfoDetailResponse.cs +++ b/Src/Dlhis.Basic/Organization/Response/GainfoDetailResponse.cs @@ -25,11 +25,6 @@ public class GainfoDetailResponse /// public string Code { get; set; } - /// - /// 部门 - /// - public string DepartmentNo { get; set; } - /// /// 部门名称 /// @@ -71,7 +66,7 @@ public class GainfoDetailResponse public string Address { get; set; } /// - /// 生日 + /// 出生日期 /// public DateTime Birthday { get; set; } @@ -95,6 +90,11 @@ public class GainfoDetailResponse /// public string Degree { get; set; } + /// + /// 职级 + /// + public string Title { get; set; } + /// /// 人事范围 /// diff --git a/Src/Dlhis.Basic/Organization/Services/Implements/GainfoPermissions.cs b/Src/Dlhis.Basic/Organization/Services/Implements/GainfoPermissions.cs index deab9327..83d9bf4a 100644 --- a/Src/Dlhis.Basic/Organization/Services/Implements/GainfoPermissions.cs +++ b/Src/Dlhis.Basic/Organization/Services/Implements/GainfoPermissions.cs @@ -1,5 +1,4 @@ using Dlhis.Basic.BusinessPlace.Response; -using Dlhis.Basic.Device.Request; using Dlhis.Basic.Device.Response; using Dlhis.Basic.Device.Services; using Dlhis.Basic.Organization.Request; @@ -10,7 +9,6 @@ using Dlhis.Entity.Canteen.Enums; using Dlhis.Entity.Device.Entities; using Dlhis.Entity.Device.Enums; using Dlhis.Entity.Sys.Enums; -using Kurisu.AspNetCore.Utils.Extensions; using Kurisu.Core.DataAccess.Dto; using Kurisu.SqlSugar.Extensions; using Kurisu.SqlSugar.Services; @@ -157,6 +155,7 @@ public class GainfoPermissions : IGainfoPermissions .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 { diff --git a/Src/Dlhis.Basic/Organization/Services/Implements/GainfoService.cs b/Src/Dlhis.Basic/Organization/Services/Implements/GainfoService.cs index 01cac923..a2ca22a7 100644 --- a/Src/Dlhis.Basic/Organization/Services/Implements/GainfoService.cs +++ b/Src/Dlhis.Basic/Organization/Services/Implements/GainfoService.cs @@ -424,46 +424,56 @@ public class GainfoService : IGainfoService { var info = await _gainfoStore.Queryable(request.Status) .LeftJoin((ga, de) => ga.DepartmentNo == de.No) - .LeftJoin((ga, de, type) => ga.Native == type.Code && type.Type == "native") - .LeftJoin((ga, de, type, posi) => ga.Position == posi.Name) - .LeftJoin((ga, de, type, posi, type2) => ga.CountryNo == type2.Code && type2.Type == "country") - .LeftJoin((ga, de, type, posi, type2, type3) => ga.Nation == type3.Code && type3.Type == "nation") - .LeftJoin((ga, de, type, posi, type2, type3, type4) => ga.IdClass == type4.Code && type4.Type == "cls") + .LeftJoin((ga, de, pos) => ga.PositionNo == pos.No) .Where(ga => ga.No == request.No) - .Select((ga, de, type, posi, type2, type3, type4) => new GainfoDetailResponse + .Select((ga, de, pos) => new GainfoDetailResponse { No = ga.No, SapNo = ga.SapNo, Name = ga.Name, Code = ga.Code, - DepartmentName = de.Name, IdClass = ga.IdClass, IdNo = ga.IdNo, Gender = ga.Gender, - NativeName = type.Display, Address = ga.Address, Birthday = ga.Birthday, Phone = ga.Phone, - Position = ga.Position, - Grade = posi.Grade, + Grade = ga.Grade, + Title = ga.Title, Degree = ga.Degree, Werks = ga.Werks, CostId = ga.CostId, - Marital = ga.Marital == "Single" ? "未婚" : "已婚", - CountryName = type2.Display, - NationName = type3.Display, - ClassName = type4.Display, + Marital = "未知", + NativeName = ga.Native, + CountryName = ga.CountryNo, + NationName = ga.Nation, + ClassName = ga.IdClass, Factory = ga.Factory, OnboardingDate = ga.CreateTime, + + DepartmentName = de.Name, + Position = pos.Name, }) - .FirstAsync(); + .SingleAsync(); if (info != null) { + var searchTypes = new List() { "native", "country", "nation", "cls" }; + var types = await _dbContext.Queryable().Where(x => searchTypes.Contains(x.Type)).ToListAsync(); + + info.NativeName = types.Where(x => x.Type == "native").FirstOrDefault(x => x.Code == info.NativeName)?.Display; + info.CountryName = types.Where(x => x.Type == "country").FirstOrDefault(x => x.Code == info.CountryName)?.Display ?? "中国"; + info.NationName = types.Where(x => x.Type == "nation").FirstOrDefault(x => x.Code == info.NationName)?.Display; + info.ClassName = types.Where(x => x.Type == "cls").FirstOrDefault(x => x.Code == info.ClassName)?.Display ?? "身份证"; + if (request.WithFace) { info.Face = await _dbContext.ChangeDb("face").Queryable().Where(x => x.UserCode == info.Code).Select(x => x.Face).SingleAsync(); } + + var tenantsResult = await _tenantApi.GetTenantsInternalAsync(); + var tenants = tenantsResult.Data; + info.FactoryName = tenants.FirstOrDefault(x => x.Code == info.Factory)?.Name; } return info; diff --git a/Src/Dlhis.Canteen/Order/Response/OrderBookingResponse.cs b/Src/Dlhis.Canteen/Order/Response/OrderBookingResponse.cs index f93f288c..f6ee796e 100644 --- a/Src/Dlhis.Canteen/Order/Response/OrderBookingResponse.cs +++ b/Src/Dlhis.Canteen/Order/Response/OrderBookingResponse.cs @@ -34,7 +34,7 @@ public class OrderBookingResponse /// 用户 /// public string UserName { get; set; } - + /// /// 部门名称 /// @@ -76,4 +76,6 @@ public class OrderBookingResponse /// 汇总数量 /// public int TotalNumber { get; set; } + + public object DishesInfos { get; set; } } diff --git a/Src/Dlhis.Canteen/Order/Services/Implements/BookingOrderService.cs b/Src/Dlhis.Canteen/Order/Services/Implements/BookingOrderService.cs index 7116dee7..9ea6e736 100644 --- a/Src/Dlhis.Canteen/Order/Services/Implements/BookingOrderService.cs +++ b/Src/Dlhis.Canteen/Order/Services/Implements/BookingOrderService.cs @@ -201,20 +201,26 @@ public class BookingOrderService : BaseOrderService, IBookingOrderService UserCode = x.UserCode, UserName = ga.Name, Source = x.Source, - DepartmentName = dept.Name + DepartmentName = dept.Name, }) .ToPageListAsync(request); var nos = page.Data.Select(x => x.No).ToList(); var details = await DbContext.Queryable() + .LeftJoin((x, dishes) => x.DishesCode == dishes.CustomCode) .Where(x => nos.Contains(x.OrderNo)) - .Select(x => new { x.OrderNo, x.BookingDate, x.Number }). + .Select((x, dishes) => new { x.OrderNo, x.BookingDate, x.Number, dishes.Name }). ToListAsync(); page.Data.ForEach(x => { x.BookingDate = details.FirstOrDefault(item => item.OrderNo == x.No).BookingDate; x.TotalNumber = details.Where(item => item.OrderNo == x.No).Sum(item => item.Number); + x.DishesInfos = details.Where(item => item.OrderNo == x.No).Select(item => new + { + item.Name + }) + .ToList(); }); return page; diff --git a/Src/Dlhis.Entity/Basic/Entity/DepartmentEntity.cs b/Src/Dlhis.Entity/Basic/Entity/DepartmentEntity.cs index ddf4eb7c..5b0ee202 100644 --- a/Src/Dlhis.Entity/Basic/Entity/DepartmentEntity.cs +++ b/Src/Dlhis.Entity/Basic/Entity/DepartmentEntity.cs @@ -12,7 +12,7 @@ public class DepartmentEntity : SugarBaseEntity /// /// 部门号 /// - [SugarColumn(ColumnDescription = "部门号", IsNullable = false)] + [SugarColumn(ColumnDescription = "部门号", IsNullable = false, UniqueGroupNameList = new[] { "idx_Department_No" })] public string No { get; set; } /// @@ -24,6 +24,6 @@ public class DepartmentEntity : SugarBaseEntity /// /// 部门名称 /// - [SugarColumn(ColumnDescription = "部门名称" , IsNullable = false)] + [SugarColumn(ColumnDescription = "部门名称", IsNullable = false)] public string Name { get; set; } } diff --git a/Src/Dlhis.Entity/Basic/Entity/GainfoEntity.cs b/Src/Dlhis.Entity/Basic/Entity/GainfoEntity.cs index 63631b17..e1fbc481 100644 --- a/Src/Dlhis.Entity/Basic/Entity/GainfoEntity.cs +++ b/Src/Dlhis.Entity/Basic/Entity/GainfoEntity.cs @@ -89,11 +89,11 @@ public class GainfoEntity : SugarBaseEntity [SugarColumn(ColumnDescription = "身份证地址")] public string Address { get; set; } - /// - /// 已婚/未婚 - /// - [SugarColumn(ColumnDescription = "已婚/未婚")] - public string Marital { get; set; } + ///// + ///// 已婚/未婚 + ///// + //[SugarColumn(ColumnDescription = "已婚/未婚")] + //public string Marital { get; set; } /// /// 部门编码 @@ -123,7 +123,19 @@ public class GainfoEntity : SugarBaseEntity /// 岗位 /// [SugarColumn(ColumnDescription = "岗位")] - public string Position { get; set; } + public string PositionNo { get; set; } + + /// + /// 职等 + /// + [SugarColumn(ColumnDescription = "职等")] + public string Grade { get; set; } + + /// + /// 职级 + /// + [SugarColumn(ColumnDescription = "职级")] + public string Title { get; set; } /// /// 卡号 diff --git a/Src/Dlhis.Entity/Basic/Entity/PositionEntity.cs b/Src/Dlhis.Entity/Basic/Entity/PositionEntity.cs index 7dfb3d33..b20abe31 100644 --- a/Src/Dlhis.Entity/Basic/Entity/PositionEntity.cs +++ b/Src/Dlhis.Entity/Basic/Entity/PositionEntity.cs @@ -12,7 +12,7 @@ public class PositionEntity : SugarBaseEntity /// /// 岗位编码 /// - [SugarColumn(ColumnDescription = "岗位编码")] + [SugarColumn(ColumnDescription = "岗位编码", IndexGroupNameList = new[] { "idx_position_No" })] public string No { get; set; } /// diff --git a/Src/Dlhis.ScheduledTask/DeviceUploadLog/Request/DeviceUploadLogPageRequest.cs b/Src/Dlhis.ScheduledTask/DeviceUploadLog/Request/DeviceUploadLogPageRequest.cs index e2f7af01..5efaab5a 100644 --- a/Src/Dlhis.ScheduledTask/DeviceUploadLog/Request/DeviceUploadLogPageRequest.cs +++ b/Src/Dlhis.ScheduledTask/DeviceUploadLog/Request/DeviceUploadLogPageRequest.cs @@ -68,6 +68,16 @@ public class DeviceUploadLogPageRequest : PageDto, IValidatableObject SearchDateTimePeriod.Start = SearchDateTimePeriod.Start.Value; SearchDateTimePeriod.End = SearchDateTimePeriod.End.Value; } + else + { + if (SearchDateTimePeriod != null) + { + if (SearchDateTimePeriod.End.HasValue) + { + SearchDateTimePeriod.End = SearchDateTimePeriod.End.Value.AddDays(1).AddSeconds(-1); + } + } + } yield break; } diff --git a/Src/Dlhis.ScheduledTask/Packs/JobPack.cs b/Src/Dlhis.ScheduledTask/Packs/JobPack.cs index a1c827b2..ba1cb6b0 100644 --- a/Src/Dlhis.ScheduledTask/Packs/JobPack.cs +++ b/Src/Dlhis.ScheduledTask/Packs/JobPack.cs @@ -72,7 +72,7 @@ public class JobPack : BaseAppPack }); //处理餐补 - RecurringJob.AddOrUpdate("MealSupplementHandler", s => s.RunAsync(), "0 0/1 * * * ?", new RecurringJobOptions + RecurringJob.AddOrUpdate("MealSupplementHandler", s => s.RunAsync(), "0 0 0/1 * * ?", new RecurringJobOptions { TimeZone = TimeZoneInfo.Local }); diff --git a/Src/Dlhis.ScheduledTask/SyncSapInfo/Job/SyncPersonJob.cs b/Src/Dlhis.ScheduledTask/SyncSapInfo/Job/SyncPersonJob.cs index f6aa1900..1d7e09af 100644 --- a/Src/Dlhis.ScheduledTask/SyncSapInfo/Job/SyncPersonJob.cs +++ b/Src/Dlhis.ScheduledTask/SyncSapInfo/Job/SyncPersonJob.cs @@ -174,7 +174,9 @@ public class SyncPersonJob Nation = item.nation, Phone = item.phone, Degree = item.email, - Position = item.web, + Grade = item.ZZ_ZD, + Title = item.Z_ZJ, + PositionNo = item.STELL, Remark = item.remark, Werks = item.WERKS, CostId = item.KOSTL, @@ -200,6 +202,9 @@ public class SyncPersonJob email = item.email, WERKS = item.WERKS, KOSTL = item.KOSTL, + STELL = item.STELL, + Z_ZJ = item.Z_ZJ, + ZZ_ZD = item.ZZ_ZD, ZZ_GZDJDNM = item.ZZ_GZDJDNM, ZZ_GZDCQNM = item.ZZ_GZDCQNM, }) @@ -217,7 +222,9 @@ public class SyncPersonJob { SapNo = item.PERNR, Name = item.gname, - Position = item.web, + PositionNo = item.STELL, + Grade = item.ZZ_ZD, + Title = item.Z_ZJ, Phone = item.phone, DepartmentNo = item.appellation, Remark = item.remark, diff --git a/Src/Dlhis.ScheduledTask/SyncSapInfo/Job/SyncPositionJob.cs b/Src/Dlhis.ScheduledTask/SyncSapInfo/Job/SyncPositionJob.cs index 96ff9411..346668a5 100644 --- a/Src/Dlhis.ScheduledTask/SyncSapInfo/Job/SyncPositionJob.cs +++ b/Src/Dlhis.ScheduledTask/SyncSapInfo/Job/SyncPositionJob.cs @@ -12,11 +12,13 @@ public class SyncPositionJob { private readonly IDbContext _dbContext; private readonly IJinkoSapService _jinkoSapService; + private readonly ILogger _logger; - public SyncPositionJob(IDbContext dbContext, IJinkoSapService jinkoSapService) + public SyncPositionJob(IDbContext dbContext, IJinkoSapService jinkoSapService, ILogger logger) { _dbContext = dbContext; _jinkoSapService = jinkoSapService; + _logger = logger; } public async Task RunAsync() @@ -25,6 +27,7 @@ public class SyncPositionJob if (positionResult.Position != null && positionResult.Position.Items.Count > 0) { + _logger.LogWarning("SAP岗位数量:{count}", positionResult.Position.Items.Count); await SaveOrg(positionResult.Position.Items); } } @@ -38,7 +41,7 @@ public class SyncPositionJob { position = new PositionEntity { - No = item.ZDEPID, + No = item.ZJOBID, Name = item.ZJOBNAME, DepartmentNo = item.ZDEPID, Grade = item.ZZWID diff --git a/Src/Gateway/Gateway.csproj b/Src/Gateway/Gateway.csproj index 4dc2203d..b68b6edf 100644 --- a/Src/Gateway/Gateway.csproj +++ b/Src/Gateway/Gateway.csproj @@ -14,4 +14,12 @@ + + + PreserveNewest + true + PreserveNewest + + + diff --git a/Src/Gateway/Program.cs b/Src/Gateway/Program.cs index 5e1e7a63..e96a2582 100644 --- a/Src/Gateway/Program.cs +++ b/Src/Gateway/Program.cs @@ -6,9 +6,10 @@ public class Program public static void Main(string[] args) { Host.CreateDefaultBuilder(args) - .ConfigureAppConfiguration(builder => + .ConfigureAppConfiguration((context, builder) => { builder.AddJsonFile("ocelot.json", true, true); + builder.AddJsonFile($"ocelot.{context.HostingEnvironment.EnvironmentName}.json", true, true); }) .ConfigureWebHostDefaults(webBuilder => { diff --git a/Src/Gateway/Properties/launchSettings.json b/Src/Gateway/Properties/launchSettings.json index 4384f481..34ddc54f 100644 --- a/Src/Gateway/Properties/launchSettings.json +++ b/Src/Gateway/Properties/launchSettings.json @@ -7,7 +7,7 @@ "ASPNETCORE_ENVIRONMENT": "Development" }, "dotnetRunMessages": true, - "applicationUrl": "http://localhost:5001" + "applicationUrl": "http://*:6000" } }, "$schema": "https://json.schemastore.org/launchsettings.json" diff --git a/Src/Gateway/ocelot.Development.json b/Src/Gateway/ocelot.Development.json new file mode 100644 index 00000000..7e569f4e --- /dev/null +++ b/Src/Gateway/ocelot.Development.json @@ -0,0 +1,93 @@ +{ + "Routes": [ + { + "UpstreamPathTemplate": "/api/oauth2/{url}", + "DownstreamPathTemplate": "/api/{url}", + "DownstreamScheme": "http", + "DownstreamHostAndPorts": [ + { + "Host": "localhost", + "Port": 5000 + } + ] + }, + { + "UpstreamPathTemplate": "/api/common/{url}", + "DownstreamPathTemplate": "/api/{url}", + "DownstreamScheme": "http", + "DownstreamHostAndPorts": [ + { + "Host": "localhost", + "Port": 5001 + } + ] + }, + { + "UpstreamPathTemplate": "/api/sys/{url}", + "DownstreamPathTemplate": "/api/{url}", + "DownstreamScheme": "http", + "DownstreamHostAndPorts": [ + { + "Host": "localhost", + "Port": 5003 + } + ] + }, + { + "UpstreamPathTemplate": "/api/user/{url}", + "DownstreamPathTemplate": "/api/{url}", + "DownstreamScheme": "http", + "DownstreamHostAndPorts": [ + { + "Host": "localhost", + "Port": 5004 + } + ] + }, + { + "UpstreamPathTemplate": "/api/basic/{url}", + "DownstreamPathTemplate": "/api/{url}", + "DownstreamScheme": "http", + "DownstreamHostAndPorts": [ + { + "Host": "localhost", + "Port": 5002 + } + ] + }, + { + "UpstreamPathTemplate": "/api/scheduled/{url}", + "DownstreamPathTemplate": "/api/{url}", + "DownstreamScheme": "http", + "DownstreamHostAndPorts": [ + { + "Host": "localhost", + "Port": 5010 + } + ] + }, + { + "UpstreamPathTemplate": "/api/canteen/{url}", + "DownstreamPathTemplate": "/api/{url}", + "DownstreamScheme": "http", + "DownstreamHostAndPorts": [ + { + "Host": "localhost", + "Port": 5008 + } + ] + }, + { + "UpstreamPathTemplate": "/{url}/swagger/v1/swagger.json", + "DownstreamPathTemplate": "/{url}/swagger/v1/swagger.json", + "DownstreamScheme": "http", + "DownstreamHostAndPorts": [ + { + "Host": "localhost", + "Port": 6000 + } + ] + } + ], + "GlobalConfiguration": {} +} \ No newline at end of file