diff --git a/Src/Dlhis.Basic/Organization/Controllers/GainfoOutsourceController.cs b/Src/Dlhis.Basic/Organization/Controllers/GainfoOutsourceController.cs
index be411c7e..9836807f 100644
--- a/Src/Dlhis.Basic/Organization/Controllers/GainfoOutsourceController.cs
+++ b/Src/Dlhis.Basic/Organization/Controllers/GainfoOutsourceController.cs
@@ -1,4 +1,6 @@
-using Dlhis.Basic.Organization.Request;
+using System.ComponentModel.DataAnnotations;
+using Dlhis.Basic.Organization.Request;
+using Dlhis.Basic.Organization.Response;
using Dlhis.Basic.Organization.Services;
using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop;
using Microsoft.AspNetCore.Authorization;
@@ -31,7 +33,7 @@ public class GainfoOutsourceController : ControllerBase
{
await _gainfoOutSourceService.SaveAsync(request);
}
-
+
///
/// 编辑
///
@@ -42,4 +44,15 @@ public class GainfoOutsourceController : ControllerBase
{
await _gainfoOutSourceService.SaveAsync(request);
}
+
+ ///
+ /// 获取外包人员额外信息
+ ///
+ ///
+ ///
+ [HttpGet("info")]
+ public async Task GetExternalInfoAsync([Required] string userNo)
+ {
+ return await _gainfoOutSourceService.GetExternalInfoAsync(userNo);
+ }
}
\ No newline at end of file
diff --git a/Src/Dlhis.Basic/Organization/Request/GainfoOutsourceRequest.cs b/Src/Dlhis.Basic/Organization/Request/GainfoOutsourceRequest.cs
index ca34751c..35d9ef8a 100644
--- a/Src/Dlhis.Basic/Organization/Request/GainfoOutsourceRequest.cs
+++ b/Src/Dlhis.Basic/Organization/Request/GainfoOutsourceRequest.cs
@@ -55,13 +55,15 @@ public class GainfoOutsourceRequest
///
/// 入职日期
///
- public DateTime? EntryDate { 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/Response/GainfoOutSourceExternalInfoResponse.cs b/Src/Dlhis.Basic/Organization/Response/GainfoOutSourceExternalInfoResponse.cs
new file mode 100644
index 00000000..1a071002
--- /dev/null
+++ b/Src/Dlhis.Basic/Organization/Response/GainfoOutSourceExternalInfoResponse.cs
@@ -0,0 +1,11 @@
+using Dlhis.Basic.Organization.Dto;
+
+namespace Dlhis.Basic.Organization.Response;
+
+public class GainfoOutSourceExternalInfoResponse : GainfoOutSourceExternalInfoDto
+{
+ ///
+ /// 姓名
+ ///
+ public string Name { get; set; }
+}
\ No newline at end of file
diff --git a/Src/Dlhis.Basic/Organization/Services/IGainfoOutsourceService.cs b/Src/Dlhis.Basic/Organization/Services/IGainfoOutsourceService.cs
index f1427fd9..d160e9fc 100644
--- a/Src/Dlhis.Basic/Organization/Services/IGainfoOutsourceService.cs
+++ b/Src/Dlhis.Basic/Organization/Services/IGainfoOutsourceService.cs
@@ -1,8 +1,21 @@
using Dlhis.Basic.Organization.Request;
+using Dlhis.Basic.Organization.Response;
namespace Dlhis.Basic.Organization.Services;
public interface IGainfoOutsourceService : IScopeDependency
{
+ ///
+ /// 保存/编辑外包人员信息
+ ///
+ ///
+ ///
Task SaveAsync(GainfoOutsourceRequest request);
+
+ ///
+ /// 获取额外信息
+ ///
+ ///
+ ///
+ Task GetExternalInfoAsync(string userNo);
}
\ No newline at end of file
diff --git a/Src/Dlhis.Basic/Organization/Services/Implements/GainfoOutsourceService.cs b/Src/Dlhis.Basic/Organization/Services/Implements/GainfoOutsourceService.cs
index ec027ec7..7f3249aa 100644
--- a/Src/Dlhis.Basic/Organization/Services/Implements/GainfoOutsourceService.cs
+++ b/Src/Dlhis.Basic/Organization/Services/Implements/GainfoOutsourceService.cs
@@ -1,4 +1,5 @@
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;
@@ -13,7 +14,7 @@ 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;
@@ -55,6 +56,23 @@ public class GainfoOutsourceService : IGainfoOutsourceService
}
+ public async Task GetExternalInfoAsync(string userNo)
+ {
+ return await _dbContext.Queryable()
+ .LeftJoin((a, b) => a.Code == b.Code)
+ .LeftJoin((a, b, c) => a.SapCode == c.Code)
+ .Where((a, b, c) => b.No == userNo)
+ .Select((a, b, c) => new GainfoOutSourceExternalInfoResponse
+ {
+ Supplier = a.Supplier,
+ SapCode = a.SapCode,
+ SapPhone = a.SapPhone,
+ Name = c.Name
+ })
+ .SingleAsync();
+ }
+
+
//********************************************************************** help methods ***********************************************************************************
private async Task GetOutSourceCodeAsync()