From d71f080cd332edb7feb916f952d162d9f82319a4 Mon Sep 17 00:00:00 2001 From: liguoyang Date: Tue, 26 Mar 2024 11:27:27 +0800 Subject: [PATCH 01/11] =?UTF-8?q?fix=20=E5=A2=9E=E5=8A=A0=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E8=8F=9C=E5=93=81=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Order/Response/OrderBookingResponse.cs | 4 +++- .../Order/Services/Implements/BookingOrderService.cs | 10 ++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) 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; From f9ea61ba495a92f316195170dd2b33d7d832f469 Mon Sep 17 00:00:00 2001 From: liguoyang Date: Tue, 26 Mar 2024 11:43:13 +0800 Subject: [PATCH 02/11] =?UTF-8?q?fix=20=E4=BC=98=E5=8C=96=E6=A1=A3?= =?UTF-8?q?=E6=A1=88=E8=AF=A6=E6=83=85=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Services/Implements/GainfoService.cs | 28 +++++++++++-------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/Src/Dlhis.Basic/Organization/Services/Implements/GainfoService.cs b/Src/Dlhis.Basic/Organization/Services/Implements/GainfoService.cs index 01cac923..9640d7f3 100644 --- a/Src/Dlhis.Basic/Organization/Services/Implements/GainfoService.cs +++ b/Src/Dlhis.Basic/Organization/Services/Implements/GainfoService.cs @@ -424,13 +424,9 @@ 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.Position == pos.Name) .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, @@ -440,26 +436,34 @@ public class GainfoService : IGainfoService 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 = pos.Grade, Degree = ga.Degree, Werks = ga.Werks, CostId = ga.CostId, Marital = ga.Marital == "Single" ? "未婚" : "已婚", - CountryName = type2.Display, - NationName = type3.Display, - ClassName = type4.Display, + NativeName = ga.Native, + CountryName = ga.CountryNo, + NationName = ga.Nation, + ClassName = ga.IdClass, Factory = ga.Factory, OnboardingDate = ga.CreateTime, }) - .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(); From 0a4cf134d8059eb18b6b947ded73a07a11d79950 Mon Sep 17 00:00:00 2001 From: liguoyang Date: Tue, 26 Mar 2024 11:57:26 +0800 Subject: [PATCH 03/11] =?UTF-8?q?fix=20=E6=9F=A5=E8=AF=A2=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../GainfoPermissionsController.cs | 8 ++------ .../Organization/Request/DeviceAssRequest.cs | 20 ++++++++++++------- .../Services/Implements/GainfoPermissions.cs | 3 +-- .../Basic/Entity/DepartmentEntity.cs | 4 ++-- 4 files changed, 18 insertions(+), 17 deletions(-) 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/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.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; } } From 325e6bdf36e199083b92437c0d64e6aae4682c18 Mon Sep 17 00:00:00 2001 From: liguoyang Date: Tue, 26 Mar 2024 11:59:27 +0800 Subject: [PATCH 04/11] fix job --- Src/Dlhis.ScheduledTask/SyncSapInfo/Job/SyncPositionJob.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Src/Dlhis.ScheduledTask/SyncSapInfo/Job/SyncPositionJob.cs b/Src/Dlhis.ScheduledTask/SyncSapInfo/Job/SyncPositionJob.cs index 96ff9411..9fb683b9 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); } } From 66e5043822cc32a05c8727f946a4dd90f39a8be0 Mon Sep 17 00:00:00 2001 From: liguoyang Date: Tue, 26 Mar 2024 12:01:16 +0800 Subject: [PATCH 05/11] =?UTF-8?q?fix=20=E5=B2=97=E4=BD=8D=E5=90=8C?= =?UTF-8?q?=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Src/Dlhis.ScheduledTask/SyncSapInfo/Job/SyncPositionJob.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Src/Dlhis.ScheduledTask/SyncSapInfo/Job/SyncPositionJob.cs b/Src/Dlhis.ScheduledTask/SyncSapInfo/Job/SyncPositionJob.cs index 9fb683b9..346668a5 100644 --- a/Src/Dlhis.ScheduledTask/SyncSapInfo/Job/SyncPositionJob.cs +++ b/Src/Dlhis.ScheduledTask/SyncSapInfo/Job/SyncPositionJob.cs @@ -41,7 +41,7 @@ public class SyncPositionJob { position = new PositionEntity { - No = item.ZDEPID, + No = item.ZJOBID, Name = item.ZJOBNAME, DepartmentNo = item.ZDEPID, Grade = item.ZZWID From b617e6cdc9c2d385f0a8cc8cea83e0a4aa2d387b Mon Sep 17 00:00:00 2001 From: liguoyang Date: Tue, 26 Mar 2024 12:06:54 +0800 Subject: [PATCH 06/11] =?UTF-8?q?fix=20=E5=B2=97=E4=BD=8D=E8=A1=A8?= =?UTF-8?q?=E7=B4=A2=E5=BC=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Src/Dlhis.Entity/Basic/Entity/PositionEntity.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } /// From 521543a79ee4733f0b40fdbe2c420f49d733736b Mon Sep 17 00:00:00 2001 From: liguoyang Date: Tue, 26 Mar 2024 12:40:34 +0800 Subject: [PATCH 07/11] =?UTF-8?q?fix=20=E4=BC=98=E5=8C=96gainfo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Response/GainfoDetailResponse.cs | 12 +++++----- .../Services/Implements/GainfoService.cs | 20 ++++++++++------ Src/Dlhis.Entity/Basic/Entity/GainfoEntity.cs | 24 ++++++++++++++----- .../SyncSapInfo/Job/SyncPersonJob.cs | 11 +++++++-- 4 files changed, 46 insertions(+), 21 deletions(-) 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/GainfoService.cs b/Src/Dlhis.Basic/Organization/Services/Implements/GainfoService.cs index 9640d7f3..a2ca22a7 100644 --- a/Src/Dlhis.Basic/Organization/Services/Implements/GainfoService.cs +++ b/Src/Dlhis.Basic/Organization/Services/Implements/GainfoService.cs @@ -424,7 +424,7 @@ public class GainfoService : IGainfoService { var info = await _gainfoStore.Queryable(request.Status) .LeftJoin((ga, de) => ga.DepartmentNo == de.No) - .LeftJoin((ga, de, pos) => ga.Position == pos.Name) + .LeftJoin((ga, de, pos) => ga.PositionNo == pos.No) .Where(ga => ga.No == request.No) .Select((ga, de, pos) => new GainfoDetailResponse { @@ -432,25 +432,27 @@ public class GainfoService : IGainfoService SapNo = ga.SapNo, Name = ga.Name, Code = ga.Code, - DepartmentName = de.Name, IdClass = ga.IdClass, IdNo = ga.IdNo, Gender = ga.Gender, Address = ga.Address, Birthday = ga.Birthday, Phone = ga.Phone, - Position = ga.Position, - Grade = pos.Grade, + Grade = ga.Grade, + Title = ga.Title, Degree = ga.Degree, Werks = ga.Werks, CostId = ga.CostId, - Marital = ga.Marital == "Single" ? "未婚" : "已婚", + 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, }) .SingleAsync(); @@ -460,14 +462,18 @@ public class GainfoService : IGainfoService 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.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; + 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.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.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, From b3549a266e6815caa77df739d9ed70400d40123c Mon Sep 17 00:00:00 2001 From: liguoyang Date: Tue, 26 Mar 2024 14:18:05 +0800 Subject: [PATCH 08/11] =?UTF-8?q?fix=20=E6=9F=A5=E8=AF=A2=E6=97=A5?= =?UTF-8?q?=E6=9C=9F=E8=8C=83=E5=9B=B4=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Request/DeviceUploadLogPageRequest.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) 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; } From 97ccd723386aabe6ebb0f411b6a3a106297f9669 Mon Sep 17 00:00:00 2001 From: liguoyang Date: Tue, 26 Mar 2024 19:01:31 +0800 Subject: [PATCH 09/11] =?UTF-8?q?fix=20gateway=E6=9C=AC=E5=9C=B0=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Src/Gateway/Gateway.csproj | 8 ++ Src/Gateway/Program.cs | 3 +- Src/Gateway/Properties/launchSettings.json | 2 +- Src/Gateway/ocelot.Development.json | 93 ++++++++++++++++++++++ 4 files changed, 104 insertions(+), 2 deletions(-) create mode 100644 Src/Gateway/ocelot.Development.json 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 From c75a58c5c442322516ed9ff01d78463a46d50e78 Mon Sep 17 00:00:00 2001 From: liguoyang Date: Wed, 27 Mar 2024 10:21:47 +0800 Subject: [PATCH 10/11] =?UTF-8?q?fix=20=E8=B0=83=E6=95=B4=E9=A4=90?= =?UTF-8?q?=E8=A1=A5=E5=A4=84=E7=90=86=E9=97=B4=E9=9A=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Src/Dlhis.ScheduledTask/Packs/JobPack.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 }); From e6d1fc16dd4173d2dc2c9dd8aa6172be4494b871 Mon Sep 17 00:00:00 2001 From: cheche <717840555@qq.com> Date: Wed, 27 Mar 2024 14:15:21 +0800 Subject: [PATCH 11/11] =?UTF-8?q?fix=20=E8=B4=A6=E6=88=B7=E5=85=B3?= =?UTF-8?q?=E8=81=94=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Identity/Response/UserResponse.cs | 5 +++++ .../Services/Implements/UserService.cs | 19 +++++++++++++++++-- Src/Dlhis.Sys/SqlSugarPack.cs | 14 ++++++++++++++ 3 files changed, 36 insertions(+), 2 deletions(-) diff --git a/Src/Dlhis.Sys/Identity/Response/UserResponse.cs b/Src/Dlhis.Sys/Identity/Response/UserResponse.cs index 15c1fe33..f152ac30 100644 --- a/Src/Dlhis.Sys/Identity/Response/UserResponse.cs +++ b/Src/Dlhis.Sys/Identity/Response/UserResponse.cs @@ -9,6 +9,11 @@ public class UserResponse /// public string UserName { get; set; } + /// + /// 操作员名称 + /// + public string GainfoName { get; set; } + /// /// 规范化账号名称 /// diff --git a/Src/Dlhis.Sys/Identity/Services/Implements/UserService.cs b/Src/Dlhis.Sys/Identity/Services/Implements/UserService.cs index 0576c9fe..e4f3f747 100644 --- a/Src/Dlhis.Sys/Identity/Services/Implements/UserService.cs +++ b/Src/Dlhis.Sys/Identity/Services/Implements/UserService.cs @@ -1,4 +1,5 @@ using System.Security.Claims; +using Dlhis.Entity.Basic.Entity; using Dlhis.Entity.Sys.Entities; using Dlhis.Sys.Identity.Request; using Dlhis.Sys.Identity.Response; @@ -13,15 +14,17 @@ namespace Dlhis.Sys.Identity.Services.Implements; public class UserService : IUserService { private readonly IDbContext _dbContext; + private readonly IDbContext _dbContext1; - public UserService(IDbContext dbContext) + public UserService(IDbContext dbContext, IDbContext dbContext1) { _dbContext = dbContext.ChangeDb("identity"); + _dbContext1 = dbContext1; } public async Task> GetPageAsync(UserPageRequest request) { - return await _dbContext.Queryable() + var page = await _dbContext.Queryable() .LeftJoin((x, ur) => x.Id == ur.UserId) .LeftJoin((x, ur, r) => ur.RoleId == r.Id) .WhereIF(request.Search.IsPresent(), x => x.UserName.Contains(request.Search) @@ -36,6 +39,18 @@ public class UserService : IUserService Role = r.Name }, true) .ToPageListAsync(request); + + var gainfos = await _dbContext1.ChangeDb("default").Queryable() + .Where(x => x.IdentityUserId > 0) + .ToListAsync(); + + page.Data.ForEach(item => + { + item.GainfoName = gainfos.Where(x => x.IdentityUserId == item.Id) + .FirstOrDefault()?.Name; + }); + + return page; } public async Task ResetAccessFailedCountAsync(int id) diff --git a/Src/Dlhis.Sys/SqlSugarPack.cs b/Src/Dlhis.Sys/SqlSugarPack.cs index 98f4153a..b71cf8f5 100644 --- a/Src/Dlhis.Sys/SqlSugarPack.cs +++ b/Src/Dlhis.Sys/SqlSugarPack.cs @@ -25,6 +25,20 @@ public class SqlSugarPack : BaseAppPack InitKeyType = InitKeyType.Attribute, IsAutoCloseConnection = true, + MoreSettings = new ConnMoreSettings + { + DisableNvarchar = true, + } + }, + new() + { + ConfigId = "default", + + ConnectionString = configuration.GetSection("SqlSugarOptions:DefaultConnectionString").Value, + DbType = DbType.MySql, + InitKeyType = InitKeyType.Attribute, + IsAutoCloseConnection = true, + MoreSettings = new ConnMoreSettings { DisableNvarchar = true,