feat 创建系统默认分组

This commit is contained in:
2024-02-22 14:30:03 +08:00
parent 9345cc6441
commit 170b6a1202
8 changed files with 212 additions and 20 deletions

View File

@@ -2,12 +2,10 @@
using Dlhis.Basic.Organization.Request;
using Dlhis.Basic.Organization.Response;
using Dlhis.Basic.Organization.Services;
using Dlhis.Entity.Basic.Entity;
using Kurisu.AspNetCore.MVC;
using Kurisu.Core.DataAccess.Dto;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Org.BouncyCastle.Asn1.Ocsp;
namespace Dlhis.Basic.MealUser.Controllers;
@@ -142,7 +140,7 @@ public class GainfosController : ControllerBase
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[HttpGet("gainfolist")]
[HttpGet("list")]
public async Task<Pagination<GainfoListResponse>> GetGainfoListTaskAsync([FromQuery]GainfoListRequest request)
{
return await _gainfoService.GetGainfoListTaskAsync(request);
@@ -152,7 +150,7 @@ public class GainfosController : ControllerBase
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[HttpGet("gainfodetail")]
[HttpGet("detail")]
public async Task<GainfoDetailResponse> GetGainfoDetailTaskAsync([FromQuery] GainfoDetailRequest request)
{
return await _gainfoService.GetGainfoDetailTaskAsync(request);

View File

@@ -1,4 +1,7 @@
namespace Dlhis.Basic.Organization.Response;
using Dlhis.Entity.Basic.Enums;
using Kurisu.AspNetCore.Utils.Extensions;
namespace Dlhis.Basic.Organization.Response;
public class GainfoPageResponse
{
@@ -52,7 +55,8 @@ public class GainfoPageResponse
/// <summary>
/// 性别
/// </summary>
public string Gender { get; set; }
public GenderEnumType Gender { get; set; }
public string GenderDesc => Gender.GetDescription();
/// <summary>
/// 生日

View File

@@ -53,9 +53,9 @@ public class GainfoService : IGainfoService
var tenant = _currentUser.GetStringTenantId();
var page = await _gainfoStore.Queryable(request.Status)
.WhereIF(request.DepartmentNos?.Any() == true, gainfo => request.DepartmentNos.Contains(gainfo.DepartmentNo))
.WhereIF(request.DepartmentNos.IsPresent(), gainfo => request.DepartmentNos.Contains(gainfo.DepartmentNo))
.WhereIF(request.Search.IsPresent(), gainfo =>
gainfo.Name.Contains(request.Search)
gainfo.Name.Contains(request.Search)
|| gainfo.Code.Contains(request.Search))
.Where(gainfo => gainfo.Werks == tenant)
.Select<GainfoPageResponse>()
@@ -561,7 +561,7 @@ public class GainfoService : IGainfoService
/// <returns></returns>
private async Task<List<string>> GetRecursionDepartmentNosAsync(List<string> departmentNos)
{
if (departmentNos == null || departmentNos.Count == 0)
if (departmentNos.IsEmpty())
{
return new List<string>();
}

View File

@@ -17,14 +17,14 @@ public class SqlSugarPack : BaseAppPack
public override void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
//using var scope = app.ApplicationServices.CreateScope();
//var db = scope.ServiceProvider.GetService<ISqlSugarClient>();
//var tables = App.ActiveTyps.Where(x => x.IsDefined(typeof(SugarTable), false))
// .Where(x => !x.IsDefined(typeof(SkipScanAttribute), false))
// .ToArray();
using var scope = app.ApplicationServices.CreateScope();
var db = scope.ServiceProvider.GetService<ISqlSugarClient>();
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);
db.DbMaintenance.CreateDatabase();
db.CodeFirst.InitTables(tables);
//using var scopeFace = app.ApplicationServices.CreateScope();
//var dbFace = scopeFace.ServiceProvider.GetService<ISqlSugarClient>();