diff --git a/Src/Dlhis.Basic/Device/Request/DevicePageRequest.cs b/Src/Dlhis.Basic/Device/Request/DevicePageRequest.cs
index 6811b1bf..ff56245f 100644
--- a/Src/Dlhis.Basic/Device/Request/DevicePageRequest.cs
+++ b/Src/Dlhis.Basic/Device/Request/DevicePageRequest.cs
@@ -8,6 +8,4 @@ public class DevicePageRequest : PageDto
/// 平台
///
public string Brand { get; set; }
-
- public string MyProperty { get; set; }
}
diff --git a/Src/Dlhis.Basic/Device/Response/DeviceUnderGroupResponse.cs b/Src/Dlhis.Basic/Device/Response/DeviceUnderGroupResponse.cs
index 8313672e..806a7d9b 100644
--- a/Src/Dlhis.Basic/Device/Response/DeviceUnderGroupResponse.cs
+++ b/Src/Dlhis.Basic/Device/Response/DeviceUnderGroupResponse.cs
@@ -14,6 +14,8 @@ public class DeviceUnderGroupResponse
///
public string Brand { get; set; }
-
+ ///
+ /// 是否启用
+ ///
public bool Enable { get; set; }
}
diff --git a/Src/Dlhis.Basic/Dlhis.Basic.csproj b/Src/Dlhis.Basic/Dlhis.Basic.csproj
index d70ce740..d1819b46 100644
--- a/Src/Dlhis.Basic/Dlhis.Basic.csproj
+++ b/Src/Dlhis.Basic/Dlhis.Basic.csproj
@@ -23,6 +23,7 @@
+
diff --git a/Src/Dlhis.Basic/MealUser/Services/Implements/MealUserService.cs b/Src/Dlhis.Basic/MealUser/Services/Implements/MealUserService.cs
index 00c933af..d62df67e 100644
--- a/Src/Dlhis.Basic/MealUser/Services/Implements/MealUserService.cs
+++ b/Src/Dlhis.Basic/MealUser/Services/Implements/MealUserService.cs
@@ -32,7 +32,7 @@ public class MealUserService : IMealUserService
public async Task AddAsync(MealUserAddRequest request)
{
- // 获取档案信息
+ //todo 获取档案信息
var gainfoEntity = await _gainfoStore.Queryable(GainfoStatusEnumType.Working)
.Where(x => x.No.ToString() == request.UserId)
@@ -42,7 +42,7 @@ public class MealUserService : IMealUserService
var entity = new CanteenUserEntity
{
- UserId = request.UserId,
+ UserNo = request.UserId,
UserType = request.UserType,
UserCode = gainfoEntity.Code,
CarNo = gainfoEntity.CarNo,
@@ -57,7 +57,7 @@ public class MealUserService : IMealUserService
public async Task GetMealUserAsync(string userId)
{
return await _dbContext.Queryable()
- .Where(x => x.UserId == userId)
+ .Where(x => x.UserNo == userId)
.Select()
.FirstAsync();
}
diff --git a/Src/Dlhis.Basic/Organization/Controllers/GainfosController.cs b/Src/Dlhis.Basic/Organization/Controllers/GainfosController.cs
index 93590dd6..798db5e4 100644
--- a/Src/Dlhis.Basic/Organization/Controllers/GainfosController.cs
+++ b/Src/Dlhis.Basic/Organization/Controllers/GainfosController.cs
@@ -78,5 +78,15 @@ public class GainfosController : ControllerBase
{
await _gainfoService.OnboardingAsync(request);
}
+
+ ///
+ /// 当前人员信息
+ ///
+ ///
+ [HttpGet("current")]
+ public async Task CurrentUserInfoAsync()
+ {
+ return await _gainfoService.CurrentUserInfoAsync();
+ }
}
diff --git a/Src/Dlhis.Basic/Organization/Controllers/WerksController.cs b/Src/Dlhis.Basic/Organization/Controllers/WerksController.cs
index bf6b57ca..5f7522dd 100644
--- a/Src/Dlhis.Basic/Organization/Controllers/WerksController.cs
+++ b/Src/Dlhis.Basic/Organization/Controllers/WerksController.cs
@@ -1,5 +1,6 @@
using Dlhis.Basic.Organization.Response;
using Dlhis.Basic.Organization.Services;
+using Dlhis.User.Api.Response;
using Kurisu.AspNetCore.MVC;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
@@ -27,7 +28,7 @@ public class WerksController : ControllerBase
///
///
[HttpGet("list")]
- public async Task> GetListAsync()
+ public async Task> GetListAsync()
{
return await _werkService.GetListAsync();
}
@@ -37,7 +38,7 @@ public class WerksController : ControllerBase
///
///
[HttpGet("current")]
- public async Task GetCurrentAsync()
+ public async Task GetCurrentAsync()
{
return await _werkService.GetCurrentAsync();
}
diff --git a/Src/Dlhis.Basic/Organization/Response/DepartmentTreeResponse.cs b/Src/Dlhis.Basic/Organization/Response/DepartmentTreeResponse.cs
index 6aafe244..c30d68b1 100644
--- a/Src/Dlhis.Basic/Organization/Response/DepartmentTreeResponse.cs
+++ b/Src/Dlhis.Basic/Organization/Response/DepartmentTreeResponse.cs
@@ -5,7 +5,7 @@ public class DepartmentTreeResponse
///
/// 部门号
///
- public string Code { get; set; }
+ public string No { get; set; }
///
/// 部门名称
diff --git a/Src/Dlhis.Basic/Organization/Response/GainfoCurrentMealInfoResponse.cs b/Src/Dlhis.Basic/Organization/Response/GainfoCurrentMealInfoResponse.cs
new file mode 100644
index 00000000..4ccf513f
--- /dev/null
+++ b/Src/Dlhis.Basic/Organization/Response/GainfoCurrentMealInfoResponse.cs
@@ -0,0 +1,9 @@
+namespace Dlhis.Basic.Organization.Response;
+
+public class GainfoCurrentMealInfoResponse
+{
+ ///
+ /// 余额
+ ///
+ public decimal Balance { get; set; }
+}
diff --git a/Src/Dlhis.Basic/Organization/Response/GainfoCurrentResponse.cs b/Src/Dlhis.Basic/Organization/Response/GainfoCurrentResponse.cs
new file mode 100644
index 00000000..774a39bc
--- /dev/null
+++ b/Src/Dlhis.Basic/Organization/Response/GainfoCurrentResponse.cs
@@ -0,0 +1,52 @@
+using Dlhis.Entity.Basic.Enums;
+using Kurisu.AspNetCore.Utils.Extensions;
+
+namespace Dlhis.Basic.Organization.Response;
+
+public class GainfoCurrentResponse
+{
+ ///
+ /// 用户档案号
+ ///
+ public string UserNo { get; set; }
+
+ ///
+ /// 用户姓名
+ ///
+ public string UserName { get; set; }
+
+ ///
+ /// 性别枚举
+ ///
+ public GenderEnumType Gender { get; set; }
+
+ ///
+ /// 性别描述
+ ///
+ public string GenderDesc => Gender.GetDescription();
+
+ ///
+ /// 工号
+ ///
+ public string UserCode { get; set; }
+
+ ///
+ /// 部门号
+ ///
+ public string DepartmentNo { get; set; }
+
+ ///
+ /// 部门名称
+ ///
+ public string DepartmentName { get; set; }
+
+ ///
+ /// 出生日期/生日
+ ///
+ public DateTime Birthday { get; set; }
+
+ ///
+ /// 就餐信息
+ ///
+ public GainfoCurrentMealInfoResponse MealInfo { get; set; }
+}
diff --git a/Src/Dlhis.Basic/Organization/Response/WerkResponse.cs b/Src/Dlhis.Basic/Organization/Response/WerkResponse.cs
deleted file mode 100644
index 9ab6f83e..00000000
--- a/Src/Dlhis.Basic/Organization/Response/WerkResponse.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-using SqlSugar;
-
-namespace Dlhis.Basic.Organization.Response;
-
-public class WerkResponse
-{
- public long Id { get; set; }
-
- ///
- /// 代号
- ///
- public string Code { get; set; }
-
- ///
- /// 名称
- ///
- public string Name { get; set; }
-
- ///
- /// 是否可见
- ///
- public bool Visible { get; set; }
-}
diff --git a/Src/Dlhis.Basic/Organization/Services/IGainfoService.cs b/Src/Dlhis.Basic/Organization/Services/IGainfoService.cs
index 43fbd0f8..81c198a0 100644
--- a/Src/Dlhis.Basic/Organization/Services/IGainfoService.cs
+++ b/Src/Dlhis.Basic/Organization/Services/IGainfoService.cs
@@ -16,4 +16,6 @@ public interface IGainfoService : IScopeDependency
Task DimissionAsync(GainfoDImissionRequest request);
Task OnboardingAsync(GainfoDImissionRequest request);
+
+ Task CurrentUserInfoAsync();
}
diff --git a/Src/Dlhis.Basic/Organization/Services/IWerkService.cs b/Src/Dlhis.Basic/Organization/Services/IWerkService.cs
index 0114d2e7..8f8ecc4b 100644
--- a/Src/Dlhis.Basic/Organization/Services/IWerkService.cs
+++ b/Src/Dlhis.Basic/Organization/Services/IWerkService.cs
@@ -1,10 +1,10 @@
-using Dlhis.Basic.Organization.Response;
+using Dlhis.User.Api.Response;
namespace Dlhis.Basic.Organization.Services;
public interface IWerkService : IScopeDependency
{
- Task> GetListAsync();
+ Task> GetListAsync();
- Task GetCurrentAsync();
+ Task GetCurrentAsync();
}
diff --git a/Src/Dlhis.Basic/Organization/Services/Implements/DepartmentService.cs b/Src/Dlhis.Basic/Organization/Services/Implements/DepartmentService.cs
index 0bdf65b5..3c207dc8 100644
--- a/Src/Dlhis.Basic/Organization/Services/Implements/DepartmentService.cs
+++ b/Src/Dlhis.Basic/Organization/Services/Implements/DepartmentService.cs
@@ -18,7 +18,7 @@ public class DepartmentService : IDepartmentService
public async Task> GetTreeAsync()
{
var departments = await _dbContext.Queryable().ToListAsync();
- var tops = departments.Where(x => x.PCode.IsEmpty()).Adapt>();
+ var tops = departments.Where(x => x.PNo.IsEmpty()).Adapt>();
tops.ForEach(x =>
{
@@ -31,7 +31,7 @@ public class DepartmentService : IDepartmentService
private void RecursionGetNext(DepartmentTreeResponse current, List departments)
{
- var next = departments.Where(x => x.PCode == current.Code).ToList();
+ var next = departments.Where(x => x.PNo == current.No).ToList();
current.Next = next.Adapt>();
foreach (var item in next)
{
diff --git a/Src/Dlhis.Basic/Organization/Services/Implements/GainfoService.cs b/Src/Dlhis.Basic/Organization/Services/Implements/GainfoService.cs
index 97404be6..ab4afbf5 100644
--- a/Src/Dlhis.Basic/Organization/Services/Implements/GainfoService.cs
+++ b/Src/Dlhis.Basic/Organization/Services/Implements/GainfoService.cs
@@ -4,6 +4,7 @@ using Dlhis.Entity.Basic.Entity;
using Dlhis.Entity.Basic.Enums;
using Kurisu.AspNetCore.Utils.Extensions;
using Kurisu.Core.DataAccess.Dto;
+using Kurisu.Core.User.Abstractions;
using Kurisu.SqlSugar.Attributes;
using Kurisu.SqlSugar.Extensions;
using Kurisu.SqlSugar.Services;
@@ -15,11 +16,13 @@ public class GainfoService : IGainfoService
{
private readonly IGainfoStore _gainfoStore;
private readonly IDbContext _dbContext;
+ private readonly ICurrentUser _currentUser;
- public GainfoService(IGainfoStore gainfoStore, IDbContext dbContext)
+ public GainfoService(IGainfoStore gainfoStore, IDbContext dbContext, ICurrentUser currentUser)
{
_gainfoStore = gainfoStore;
_dbContext = dbContext;
+ _currentUser = currentUser;
}
///
@@ -32,9 +35,9 @@ public class GainfoService : IGainfoService
request.DepartmentNos = await GetRecursionDepartmentNosAsync(request.DepartmentNos);
var page = await _gainfoStore.Queryable(request.Status)
- .WhereIF(request.DepartmentNos.Any(), gainfo => request.DepartmentNos.Contains(gainfo.DepartmentNo))
+ .WhereIF(request.DepartmentNos.IsPresent(), gainfo => request.DepartmentNos.Contains(gainfo.DepartmentNo))
.Select()
- .ToPageListAsync(request);
+ .ToPageListAsync(request);
return page;
}
@@ -112,6 +115,33 @@ public class GainfoService : IGainfoService
await _gainfoStore.InsertAsync(gainfo);
}
+ public async Task CurrentUserInfoAsync()
+ {
+ var identityId = _currentUser.GetIntSubjectId();
+
+ var gainfo = await _gainfoStore.Queryable(GainfoStatusEnumType.Working)
+ .LeftJoin((ga, department) => ga.DepartmentNo == department.No)
+ .LeftJoin((ga, department, mealUser) => ga.No == mealUser.UserNo)
+ .Where((ga, department) => ga.IdentityUserId == identityId)
+ .Select((ga, department, mealUser) => new GainfoCurrentResponse
+ {
+ UserNo = ga.No,
+ Birthday = ga.Birthday,
+ DepartmentNo = department.No,
+ DepartmentName = department.Name,
+ Gender = ga.Gender,
+ UserCode = ga.Code,
+ UserName = ga.Name,
+ MealInfo = new GainfoCurrentMealInfoResponse
+ {
+ Balance = mealUser.Balance
+ }
+ })
+ .FirstAsync();
+
+ return gainfo;
+ }
+
//-------------------------------------------help methods ------------------------------------------------
@@ -128,26 +158,26 @@ public class GainfoService : IGainfoService
}
var departments = await _dbContext.Queryable().ToListAsync();
- var currentNos = departments.Where(x => departmentNos.Contains(x.Code)).ToList();
+ var currentNos = departments.Where(x => departmentNos.Contains(x.No)).ToList();
foreach (var item in currentNos)
{
- RecursionGetNext(item.Code, departments, departmentNos);
+ RecursionGetNext(item.No, departments, departmentNos);
}
return departmentNos.Distinct().ToList();
void RecursionGetNext(string currentCode, List departments, List result)
{
- var next = departments.Where(x => x.PCode == currentCode).ToList();
+ var next = departments.Where(x => x.PNo == currentCode).ToList();
foreach (var item in next)
{
- result.Add(item.Code);
+ result.Add(item.No);
}
foreach (var item in next)
{
- RecursionGetNext(item.Code, departments, result);
+ RecursionGetNext(item.No, departments, result);
}
}
}
diff --git a/Src/Dlhis.Basic/Organization/Services/Implements/WerkService.cs b/Src/Dlhis.Basic/Organization/Services/Implements/WerkService.cs
index 37c53331..12c3bc68 100644
--- a/Src/Dlhis.Basic/Organization/Services/Implements/WerkService.cs
+++ b/Src/Dlhis.Basic/Organization/Services/Implements/WerkService.cs
@@ -1,35 +1,39 @@
-/*using Dlhis.Basic.Organization.Response;
-using Dlhis.Entity.Basic.Entity;
+using Dlhis.User.Api;
+using Dlhis.User.Api.Response;
+using Kurisu.AspNetCore.Utils.Extensions;
+using Kurisu.Core.Result;
using Kurisu.Core.User.Abstractions;
-using Kurisu.SqlSugar.Services;
namespace Dlhis.Basic.Organization.Services.Implements;
public class WerkService : IWerkService
{
- private readonly IDbContext _dbContext;
private readonly ICurrentUser _currentUser;
+ private readonly ITenantApi _tenantApi;
- public WerkService(IDbContext dbContext, ICurrentUser currentUser)
+ public WerkService(ICurrentUser currentUser, ITenantApi tenantApi)
{
- _dbContext = dbContext;
_currentUser = currentUser;
+ _tenantApi = tenantApi;
}
- public async Task> GetListAsync()
+ public async Task> GetListAsync()
{
- return await _dbContext.Queryable()
- .Select()
- .ToListAsync();
+ var tenantResult = await _tenantApi.GetTenantsAsync();
+ (tenantResult.Code == ApiStateCode.Success).ThrowIfFalse(tenantResult.Msg);
+
+ var tenants = tenantResult.Data;
+ return tenants;
}
- public async Task GetCurrentAsync()
+ public async Task GetCurrentAsync()
{
var tenant = _currentUser.GetStringTenantId();
- return await _dbContext.Queryable()
- .Where(x => x.Code == tenant)
- .Select()
- .FirstAsync();
+ var tenantResult = await _tenantApi.GetTenantsAsync();
+ (tenantResult.Code == ApiStateCode.Success).ThrowIfFalse(tenantResult.Msg);
+
+ var tenants = tenantResult.Data;
+ return tenants.FirstOrDefault(x => x.Code == tenant);
}
}
*/
\ No newline at end of file
diff --git a/Src/Dlhis.Basic/SqlSugarPack.cs b/Src/Dlhis.Basic/SqlSugarPack.cs
index 3145a868..5adc1505 100644
--- a/Src/Dlhis.Basic/SqlSugarPack.cs
+++ b/Src/Dlhis.Basic/SqlSugarPack.cs
@@ -19,7 +19,10 @@ public class SqlSugarPack : BaseAppPack
#if DEBUG
using var scope = app.ApplicationServices.CreateScope();
var db = scope.ServiceProvider.GetService();
- var tables = App.ActiveTyps.Where(x => x.IsDefined(typeof(SugarTable), false)).ToArray();
+ var tables = App.ActiveTyps.Where(x => x.IsDefined(typeof(SugarTable), false))
+ .Where(x => !x.IsDefined(typeof(SkipScanAttribute), false))
+ .ToArray();
+
db.DbMaintenance.CreateDatabase();
db.CodeFirst.InitTables(tables);
#endif
diff --git a/Src/Dlhis.Basic/appsettings.Development.json b/Src/Dlhis.Basic/appsettings.Development.json
index 20ab3f6d..e5eed0cf 100644
--- a/Src/Dlhis.Basic/appsettings.Development.json
+++ b/Src/Dlhis.Basic/appsettings.Development.json
@@ -6,7 +6,8 @@
}
},
"InternalRequest": {
- "CommonRequestUrl": "http://localhost:5001"
+ "CommonRequestUrl": "http://localhost:5001",
+ "UserRequestUrl": "http://localhost:5004"
},
"SwaggerOptions": {
"Enable": true,
diff --git a/Src/Dlhis.Basic/appsettings.json b/Src/Dlhis.Basic/appsettings.json
index c244b003..1b5c78f0 100644
--- a/Src/Dlhis.Basic/appsettings.json
+++ b/Src/Dlhis.Basic/appsettings.json
@@ -7,7 +7,8 @@
},
"AllowedHosts": "*",
"InternalRequest": {
- "CommonRequestUrl": "http://common"
+ "CommonRequestUrl": "http://common",
+ "UserRequestUrl": "http://user"
},
"SqlSugarOptions": {
"DefaultConnectionString": "server=192.168.199.124;port=3306;userid=root;password=dlhis123;database=yikatong;charset=utf8mb4;",
diff --git a/Src/Dlhis.Canteen/Order/Controllers/BalancesController.cs b/Src/Dlhis.Canteen/Order/Controllers/BalancesController.cs
index ee4c5d16..0781b29d 100644
--- a/Src/Dlhis.Canteen/Order/Controllers/BalancesController.cs
+++ b/Src/Dlhis.Canteen/Order/Controllers/BalancesController.cs
@@ -7,6 +7,9 @@ using Microsoft.AspNetCore.Mvc;
namespace Dlhis.Canteen.Order.Controllers;
+///
+/// 充值/消费
+///
[Authorize]
[Route("api/[controller]")]
[ApiController]
diff --git a/Src/Dlhis.Canteen/Order/Services/Implements/OrderService.cs b/Src/Dlhis.Canteen/Order/Services/Implements/OrderService.cs
index be9e880c..ac151542 100644
--- a/Src/Dlhis.Canteen/Order/Services/Implements/OrderService.cs
+++ b/Src/Dlhis.Canteen/Order/Services/Implements/OrderService.cs
@@ -61,11 +61,11 @@ public class OrderService : IOrderService
//根据档案号
var canteenUser = await _dbContext.Queryable()
- .Where(x => x.UserId == request.UserUniqueNo || x.UserCode == request.UserUniqueNo)
+ .Where(x => x.UserNo == request.UserUniqueNo || x.UserCode == request.UserUniqueNo)
.FirstAsync();
var gafinfo = await _dbContext.Queryable()
- .Where(x => x.No == canteenUser.UserId)
+ .Where(x => x.No == canteenUser.UserNo)
.FirstAsync();
var settings = await _canteenSettingService.GetUserSettingAsync(gafinfo.No);
@@ -104,7 +104,7 @@ public class OrderService : IOrderService
OrderStatus = CanteenOrderStatusEnumType.Wait,
Name = gafinfo.Name,
Source = request.Source,
- UserId = canteenUser.UserId,
+ UserId = canteenUser.UserNo,
UserCode = canteenUser.UserCode,
Amount = request.Amount,
BusinessPlaceCode = businessPlace.Code,
@@ -209,7 +209,7 @@ public class OrderService : IOrderService
{
try
{
- var canteenUser = await _dbContext.Queryable().Where(x => x.UserId == order.UserId).FirstAsync();
+ var canteenUser = await _dbContext.Queryable().Where(x => x.UserNo == order.UserId).FirstAsync();
//金额+-
canteenUser.Balance += order.Amount;
@@ -224,7 +224,7 @@ public class OrderService : IOrderService
var effect = await _dbContext.Updateable()
.SetColumns(x => x.Balance == canteenUser.Balance + order.Amount)
.SetColumns(x => x.Version == x.Version + 1)
- .Where(x => x.UserId == order.UserId && x.Version == canteenUser.Version)//必须与查询时的version一致
+ .Where(x => x.UserNo == order.UserId && x.Version == canteenUser.Version)//必须与查询时的version一致
.ExecuteCommandAsync();
if (effect <= 0)
diff --git a/Src/Dlhis.Canteen/Setting/Services/Implements/CanteenSettingService.cs b/Src/Dlhis.Canteen/Setting/Services/Implements/CanteenSettingService.cs
index b23ea9b7..af5cc8c2 100644
--- a/Src/Dlhis.Canteen/Setting/Services/Implements/CanteenSettingService.cs
+++ b/Src/Dlhis.Canteen/Setting/Services/Implements/CanteenSettingService.cs
@@ -25,7 +25,7 @@ public class CanteenSettingService : ICanteenSettingService
public async Task> GetPageAsync(CanteenSettingPageRequest request)
{
var page = await _context.Queryable()
- .LeftJoin((setting, user) => setting.UniqueValue == user.UserId)
+ .LeftJoin((setting, user) => setting.UniqueValue == user.UserNo)
.WhereIF(request.UniqueType.HasValue, setting => setting.UniqueType == request.UniqueType)
.WhereIF(request.Item.HasValue, setting => setting.Item == request.Item)
.WhereIF(request.Search.IsPresent(), setting => setting.UniqueValue.Contains(request.Search))
diff --git a/Src/Dlhis.Canteen/SqlSugarPack.cs b/Src/Dlhis.Canteen/SqlSugarPack.cs
index 03c33fa6..3abac33b 100644
--- a/Src/Dlhis.Canteen/SqlSugarPack.cs
+++ b/Src/Dlhis.Canteen/SqlSugarPack.cs
@@ -11,9 +11,4 @@ public class SqlSugarPack : BaseAppPack
{
services.AddSqlSugar();
}
-
- public override void Configure(IApplicationBuilder app, IWebHostEnvironment env)
- {
-
- }
}
diff --git a/Src/Dlhis.Entity/Basic/Entity/CanteenUserEntity.cs b/Src/Dlhis.Entity/Basic/Entity/CanteenUserEntity.cs
index e227b0d6..0b518021 100644
--- a/Src/Dlhis.Entity/Basic/Entity/CanteenUserEntity.cs
+++ b/Src/Dlhis.Entity/Basic/Entity/CanteenUserEntity.cs
@@ -16,7 +16,7 @@ public class CanteenUserEntity : SugarBaseEntity, IVersion, ITenantId
/// 档案号
///
[SugarColumn(IsNullable = false, ColumnDescription = "档案号")]
- public string UserId { get; set; }
+ public string UserNo { get; set; }
///
diff --git a/Src/Dlhis.Entity/Basic/Entity/DepartmentEntity.cs b/Src/Dlhis.Entity/Basic/Entity/DepartmentEntity.cs
index 7e4018e0..bf4dc26c 100644
--- a/Src/Dlhis.Entity/Basic/Entity/DepartmentEntity.cs
+++ b/Src/Dlhis.Entity/Basic/Entity/DepartmentEntity.cs
@@ -13,13 +13,13 @@ public class DepartmentEntity : SugarBaseEntity
/// 部门号
///
[SugarColumn(ColumnDescription = "部门号")]
- public string Code { get; set; }
+ public string No { get; set; }
///
/// 上级部门号
///
[SugarColumn(ColumnDescription = "上级部门号")]
- public string PCode { get; set; }
+ public string PNo { get; set; }
///
/// 部门名称
diff --git a/Src/Dlhis.Entity/Basic/Entity/GainfoEntity.cs b/Src/Dlhis.Entity/Basic/Entity/GainfoEntity.cs
index db2c1efc..1768d42e 100644
--- a/Src/Dlhis.Entity/Basic/Entity/GainfoEntity.cs
+++ b/Src/Dlhis.Entity/Basic/Entity/GainfoEntity.cs
@@ -148,6 +148,12 @@ public class GainfoEntity : SugarBaseEntity
///
[SugarColumn(ColumnDescription = "在职状态")]
public string Employed { get; set; }
+
+ ///
+ /// 身份认证用户Id
+ ///
+ [SugarColumn(ColumnDescription = "身份认证用户Id")]
+ public int IdentityUserId { get; set; }
}
//[SugarTable(TableName = "GainfoLeave", TableDescription = "离职人员档案表")]
diff --git a/Src/Dlhis.Entity/Basic/Enums/GenderEnumType.cs b/Src/Dlhis.Entity/Basic/Enums/GenderEnumType.cs
index 51b3e6fc..25fedcb5 100644
--- a/Src/Dlhis.Entity/Basic/Enums/GenderEnumType.cs
+++ b/Src/Dlhis.Entity/Basic/Enums/GenderEnumType.cs
@@ -8,13 +8,13 @@ public enum GenderEnumType
///
/// 女性
///
- [Description("女性")]
+ [Description("女")]
Female = 0,
///
/// 男性
///
- [Description("男性")]
+ [Description("男")]
Male = 1,
///
diff --git a/Src/Dlhis.Entity/Canteen/Entities/CanteenOrderEntity.cs b/Src/Dlhis.Entity/Canteen/Entities/CanteenOrderEntity.cs
index 0e6cf988..38195904 100644
--- a/Src/Dlhis.Entity/Canteen/Entities/CanteenOrderEntity.cs
+++ b/Src/Dlhis.Entity/Canteen/Entities/CanteenOrderEntity.cs
@@ -1,5 +1,4 @@
using Dlhis.Entity.Canteen.Enums;
-using Kurisu.Core.DataAccess.Entity;
using SqlSugar;
using SqlSugar.DbConvert;
@@ -9,7 +8,7 @@ namespace Dlhis.Entity.Canteen.Entities;
/// 就餐订单
///
[SugarTable(TableName = "CanteenOrder", TableDescription = "就餐订单")]
-public class CanteenOrderEntity : BalanceRecordEntity, ITenantId
+public class CanteenOrderEntity : BalanceRecordEntity
{
///
/// 请求json
@@ -40,5 +39,4 @@ public class CanteenOrderEntity : BalanceRecordEntity, ITenantId
///
[SugarColumn(ColumnDescription = "处理结果")]
public string Result { get; set; }
- public string TenantId { get; set; }
}
\ No newline at end of file
diff --git a/Src/Dlhis.Entity/Device/Entities/DeviceTask.cs b/Src/Dlhis.Entity/Device/Entities/DeviceTask.cs
index 0ed03883..94df132e 100644
--- a/Src/Dlhis.Entity/Device/Entities/DeviceTask.cs
+++ b/Src/Dlhis.Entity/Device/Entities/DeviceTask.cs
@@ -1,5 +1,7 @@
-using Kurisu.SqlSugar;
+using Dlhis.Entity.Device.Enums;
+using Kurisu.SqlSugar;
using SqlSugar;
+using SqlSugar.DbConvert;
namespace Dlhis.Entity.Device.Entities;
@@ -9,10 +11,16 @@ namespace Dlhis.Entity.Device.Entities;
[SugarTable(TableName = "DeviceTask")]
public class DeviceTaskEntity : SugarBaseEntity
{
+ ///
+ /// 任务类型
+ ///
+ [SugarColumn(ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert))]
+ public DeviceTaskEnumType Type { get; set; }
+
///
/// 用户档案号
///
- public string UserId { get; set; }
+ public string UserNo { get; set; }
///
/// 用户学工号
@@ -34,6 +42,11 @@ public class DeviceTaskEntity : SugarBaseEntity
///
public int RetryCount { get; set; }
+ ///
+ /// 任务下发状态
+ ///
+ [SugarColumn(ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert))]
+ public DeviceTaskStatusEnumType Status { get; set; }
///
/// 处理结果
diff --git a/Src/Dlhis.Entity/Device/Enums/DeviceTaskEnumType.cs b/Src/Dlhis.Entity/Device/Enums/DeviceTaskEnumType.cs
new file mode 100644
index 00000000..780ff55d
--- /dev/null
+++ b/Src/Dlhis.Entity/Device/Enums/DeviceTaskEnumType.cs
@@ -0,0 +1,30 @@
+using System.ComponentModel;
+
+namespace Dlhis.Entity.Device.Enums;
+
+///
+/// 设备任务类型
+///
+[Description("设备任务类型")]
+public enum DeviceTaskEnumType
+{
+ // 状态:ADD-准备下发;ADDOK-下发成功;DEL-准备删除;DELOK-删除成功;AERR-下发错误;DERR-删除错误;UUU-先删除后下发;
+
+ ///
+ /// 添加
+ ///
+ [Description("添加")]
+ Add = 1,
+
+ ///
+ /// 删除
+ ///
+ [Description("删除")]
+ Delete = 2,
+
+ ///
+ /// 删除后添加
+ ///
+ [Description("删除后添加")]
+ AddAfterDelete = 3,
+}
diff --git a/Src/Dlhis.Entity/Device/Enums/DeviceTaskStatusEnumType.cs b/Src/Dlhis.Entity/Device/Enums/DeviceTaskStatusEnumType.cs
new file mode 100644
index 00000000..3c2009af
--- /dev/null
+++ b/Src/Dlhis.Entity/Device/Enums/DeviceTaskStatusEnumType.cs
@@ -0,0 +1,34 @@
+using System.ComponentModel;
+
+namespace Dlhis.Entity.Device.Enums;
+
+///
+/// 设备任务下发状态
+///
+[Description("设备任务下发状态")]
+public enum DeviceTaskStatusEnumType
+{
+ ///
+ /// 待下发
+ ///
+ [Description("待下发")]
+ Wait = 0,
+
+ ///
+ /// 处理中
+ ///
+ [Description("处理中")]
+ Process = 5,
+
+ ///
+ /// 下发完成
+ ///
+ [Description("下发完成")]
+ Success = 10,
+
+ ///
+ /// 异常
+ ///
+ [Description("异常")]
+ Error = 99,
+}
diff --git a/Src/Dlhis.ScheduledTask/App.config b/Src/Dlhis.ScheduledTask/App.config
deleted file mode 100644
index fb37bfe6..00000000
--- a/Src/Dlhis.ScheduledTask/App.config
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Src/Dlhis.ScheduledTask/Dlhis.ScheduledTask.csproj b/Src/Dlhis.ScheduledTask/Dlhis.ScheduledTask.csproj
index 7a7f1fcc..1ea33e79 100644
--- a/Src/Dlhis.ScheduledTask/Dlhis.ScheduledTask.csproj
+++ b/Src/Dlhis.ScheduledTask/Dlhis.ScheduledTask.csproj
@@ -2,7 +2,7 @@
net6.0
- enable
+ disable
enable
Linux
..\..
diff --git a/Src/Dlhis.ScheduledTask/Entities/GainfoSap.cs b/Src/Dlhis.ScheduledTask/Entities/GainfoSap.cs
index a32ce79f..5a7b95e9 100644
--- a/Src/Dlhis.ScheduledTask/Entities/GainfoSap.cs
+++ b/Src/Dlhis.ScheduledTask/Entities/GainfoSap.cs
@@ -1,115 +1,113 @@
-namespace Dlhis.ScheduledTask.Entities
+using SqlSugar;
+
+namespace Dlhis.ScheduledTask.Entities;
+
+[SugarTable(TableName = "GainfoSap")]
+public class GainfoSapEntity
{
- public class GainfoSap
- {
- public GainfoSap()
- {
- }
+ [PkColumn]
+ public int id { get; set; }
- [PkColumn]
- public int id { get; set; }
+ public string ano { get; set; }
+ public string @class { get; set; }
- public string ano { get; set; }
- public string @class { get; set; }
+ public string passwd { get; set; }
+ public string question { get; set; }
- public string passwd { get; set; }
- public string question { get; set; }
+ public string answer { get; set; }
+ public string gname { get; set; }
- public string answer { get; set; }
- public string gname { get; set; }
+ [UpdateColumn]
+ public string ename { 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 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 int amount { get; set; }
- public int days { get; set; }
- public decimal consume01 { get; set; }
+ public decimal consume02 { get; set; }
- public decimal consume02 { get; set; }
+ public decimal consume03 { 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 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 PERNR { get; set; }
+ public string WERKS { get; set; }
- public string WERKS { get; set; }
+ public string ZSTATUS { get; set; }
- public string ZSTATUS { get; set; }
+ public string KOSTL { get; set; }
- public string KOSTL { get; set; }
+ public string ZZ_ZD { get; set; }
- public string ZZ_ZD { get; set; }
+ public string Z_ZJ { get; set; }
- public string Z_ZJ { get; set; }
+ public string STELL { get; set; }
- public string STELL { get; set; }
+ public string STELL_NM { get; set; }
- public string STELL_NM { get; set; }
+ public DateTime? ZLZRQ { 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 class UpdateColumnAttribute : Attribute
+{
+
+}
+
+public class PkColumnAttribute : Attribute
+{
+
+}
+
+
+public class IgnoreColumnAttribute : Attribute
+{
- 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 class UpdateColumnAttribute : Attribute
- {
-
- }
-
- public class PkColumnAttribute : Attribute
- {
-
- }
-
-
- public class IgnoreColumnAttribute : Attribute
- {
-
- }
}
diff --git a/Src/Dlhis.ScheduledTask/Job/SyncPersonJob.cs b/Src/Dlhis.ScheduledTask/Job/SyncPersonJob.cs
index a5d68382..c7e27c9b 100644
--- a/Src/Dlhis.ScheduledTask/Job/SyncPersonJob.cs
+++ b/Src/Dlhis.ScheduledTask/Job/SyncPersonJob.cs
@@ -10,19 +10,18 @@ using System.Text;
using Dlhis.ScheduledTask.Configurations;
using Kurisu.SqlSugar.Services;
using Dlhis.Entity.Basic.Entity;
-using Dlhis.ScheduledTask.Wsproxy.Dlhis.JinkoHr.WsProxy;
using Dlhis.Entity.Basic.Enums;
namespace Dlhis.ScheduledTask.Job
{
- public class SyncPersonJob
+ public class SyncPersonJob
{
private List lastUpdatedPersonList = new List();
private List lastUpdatedOrgList = new List();
private List lastUpdatedPositionList = new List();
private readonly ServiceSettings serviceSettings;
- private readonly ZHRS_WERKS[] werks;
+
private readonly IDbContext _dbContext;
public SyncPersonJob(IDbContext dbContext)
{
@@ -141,7 +140,7 @@ namespace Dlhis.ScheduledTask.Job
return failure;
}
- private async Task SavePerson(GainfoSap item)
+ private async Task SavePerson(GainfoSapEntity item)
{
var gainfo = await _dbContext.Queryable().Where(x => x.IdNo == item.idno).FirstAsync();
if (gainfo != null)
@@ -191,7 +190,7 @@ namespace Dlhis.ScheduledTask.Job
await _dbContext.InsertAsync(info);
}
}
- private async Task UpdatePerson(GainfoSap item)
+ private async Task UpdatePerson(GainfoSapEntity item)
{
var gainfo = await _dbContext.Queryable().Where(x => x.IdNo == item.idno).FirstAsync();
if (gainfo != null)
@@ -242,58 +241,58 @@ namespace Dlhis.ScheduledTask.Job
var headerValue = Convert.ToBase64String(Encoding.UTF8.GetBytes(credentials));
httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", headerValue);
- List persons = new List();
- foreach (var item in werks)
- {
- try
- {
- var body = new
- {
- T_WERKS = new
- {
- item = new List
diff --git a/Src/Dlhis.User/Identity/Controllers/TenantsController.cs b/Src/Dlhis.User/Identity/Controllers/TenantsController.cs
new file mode 100644
index 00000000..52b02d55
--- /dev/null
+++ b/Src/Dlhis.User/Identity/Controllers/TenantsController.cs
@@ -0,0 +1,42 @@
+using Dlhis.User.Identity.Request;
+using Dlhis.User.Identity.Response;
+using Dlhis.User.Identity.Services;
+using Kurisu.Core.DataAccess.Dto;
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Mvc;
+
+namespace Dlhis.User.Identity.Controllers;
+
+[Authorize]
+[Route("api/[controller]")]
+[ApiController]
+public class TenantsController : ControllerBase
+{
+ private readonly ITenantService _tenantService;
+
+ public TenantsController(ITenantService tenantService)
+ {
+ _tenantService = tenantService;
+ }
+
+ ///
+ /// 获取租户分页
+ ///
+ ///
+ ///
+ [HttpGet("page")]
+ public async Task> GetPageAsync([FromQuery] TenantPageRequest request)
+ {
+ return await _tenantService.GetPageAsync(request);
+ }
+
+ ///
+ /// 获取所有租户
+ ///
+ ///
+ [HttpGet("list")]
+ public async Task> GetListAsync()
+ {
+ return await _tenantService.GetListAsync();
+ }
+}
diff --git a/Src/Dlhis.User/Identity/Request/TenantPageRequest.cs b/Src/Dlhis.User/Identity/Request/TenantPageRequest.cs
new file mode 100644
index 00000000..6dbe5a50
--- /dev/null
+++ b/Src/Dlhis.User/Identity/Request/TenantPageRequest.cs
@@ -0,0 +1,8 @@
+using Kurisu.Core.DataAccess.Dto;
+
+namespace Dlhis.User.Identity.Request
+{
+ public class TenantPageRequest : PageDto
+ {
+ }
+}
diff --git a/Src/Dlhis.User/Identity/Response/TenantResponse.cs b/Src/Dlhis.User/Identity/Response/TenantResponse.cs
new file mode 100644
index 00000000..46b131c5
--- /dev/null
+++ b/Src/Dlhis.User/Identity/Response/TenantResponse.cs
@@ -0,0 +1,10 @@
+namespace Dlhis.User.Identity.Response;
+
+public class TenantResponse
+{
+ public int Id { get; set; }
+
+ public string Code { get; set; }
+
+ public string Name { get; set; }
+}
diff --git a/Src/Dlhis.User/Identity/Services/ITenantService.cs b/Src/Dlhis.User/Identity/Services/ITenantService.cs
new file mode 100644
index 00000000..72c4bd87
--- /dev/null
+++ b/Src/Dlhis.User/Identity/Services/ITenantService.cs
@@ -0,0 +1,12 @@
+using Dlhis.User.Identity.Request;
+using Dlhis.User.Identity.Response;
+using Kurisu.Core.DataAccess.Dto;
+
+namespace Dlhis.User.Identity.Services;
+
+public interface ITenantService : IScopeDependency
+{
+ Task> GetPageAsync(TenantPageRequest request);
+
+ Task> GetListAsync();
+}
diff --git a/Src/Dlhis.User/Identity/Services/Implements/RoleService.cs b/Src/Dlhis.User/Identity/Services/Implements/RoleService.cs
new file mode 100644
index 00000000..d501d200
--- /dev/null
+++ b/Src/Dlhis.User/Identity/Services/Implements/RoleService.cs
@@ -0,0 +1,27 @@
+using Dlhis.Entity.Sys.Entities;
+using Dlhis.User.Identity.Request;
+using Dlhis.User.Identity.Response;
+using Kurisu.AspNetCore.Utils.Extensions;
+using Kurisu.Core.DataAccess.Dto;
+using Kurisu.SqlSugar.Extensions;
+using Kurisu.SqlSugar.Services;
+
+namespace Dlhis.User.Identity.Services.Implements;
+
+public class RoleService : IRoleService
+{
+ private readonly IDbContext _dbContext;
+
+ public RoleService(IDbContext dbContext)
+ {
+ _dbContext = dbContext;
+ }
+
+ public async Task> GetPageAsync(RolePageRequest request)
+ {
+ return await _dbContext.Queryable()
+ .WhereIF(request.Search.IsPresent(), x => x.Name.Contains(request.Search) || x.NormalizedName.Contains(request.Search))
+ .Select()
+ .ToPageListAsync(request);
+ }
+}
diff --git a/Src/Dlhis.User/Identity/Services/Implements/TenantService.cs b/Src/Dlhis.User/Identity/Services/Implements/TenantService.cs
new file mode 100644
index 00000000..a6ec9b54
--- /dev/null
+++ b/Src/Dlhis.User/Identity/Services/Implements/TenantService.cs
@@ -0,0 +1,34 @@
+using Dlhis.Entity.Sys.Entities;
+using Dlhis.User.Identity.Request;
+using Dlhis.User.Identity.Response;
+using Kurisu.AspNetCore.Utils.Extensions;
+using Kurisu.Core.DataAccess.Dto;
+using Kurisu.SqlSugar.Extensions;
+using Kurisu.SqlSugar.Services;
+
+namespace Dlhis.User.Identity.Services.Implements;
+
+public class TenantService : ITenantService
+{
+ private readonly IDbContext _dbContext;
+
+ public TenantService(IDbContext dbContext)
+ {
+ _dbContext = dbContext;
+ }
+
+ public async Task> GetPageAsync(TenantPageRequest request)
+ {
+ return await _dbContext.Queryable()
+ .WhereIF(request.Search.IsPresent(), (tenant) => tenant.Name.Contains(request.Search))
+ .Select()
+ .ToPageListAsync(request);
+ }
+
+ public async Task> GetListAsync()
+ {
+ return await _dbContext.Queryable()
+ .Select()
+ .ToListAsync();
+ }
+}
diff --git a/Src/Dlhis.User/Properties/launchSettings.json b/Src/Dlhis.User/Properties/launchSettings.json
index 67846e57..5ea15179 100644
--- a/Src/Dlhis.User/Properties/launchSettings.json
+++ b/Src/Dlhis.User/Properties/launchSettings.json
@@ -6,7 +6,7 @@
"ASPNETCORE_ENVIRONMENT": "Development"
},
"dotnetRunMessages": true,
- "applicationUrl": "http://localhost:5010"
+ "applicationUrl": "http://localhost:5004"
}
},
"$schema": "https://json.schemastore.org/launchsettings.json"
diff --git a/Src/Dlhis.User/appsettings.Development.json b/Src/Dlhis.User/appsettings.Development.json
index d4cafc4f..20ab3f6d 100644
--- a/Src/Dlhis.User/appsettings.Development.json
+++ b/Src/Dlhis.User/appsettings.Development.json
@@ -16,7 +16,6 @@
"Scopes": {
"openid": "openid",
"profile": "profile",
- "role": "role",
"yikatong": "yikatong"
}
},
diff --git a/Src/Dlhis.User/appsettings.json b/Src/Dlhis.User/appsettings.json
index adb68f64..393b8739 100644
--- a/Src/Dlhis.User/appsettings.json
+++ b/Src/Dlhis.User/appsettings.json
@@ -22,7 +22,6 @@
"Scopes": {
"openid": "openid",
"profile": "profile",
- "role": "role",
"yikatong": "yikatong"
}
},