fix 补充代码
This commit is contained in:
@@ -31,4 +31,14 @@ public class WerksController : ControllerBase
|
||||
{
|
||||
return await _werkService.GetListAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取当前组织信息
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("current")]
|
||||
public async Task<WerkResponse> GetCurrentAsync()
|
||||
{
|
||||
return await _werkService.GetCurrentAsync();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,19 @@
|
||||
using Dlhis.Entity.Basic.Enums;
|
||||
using Dlhis.Entity.Canteen.Enums;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Dlhis.Basic.Organization.Request
|
||||
namespace Dlhis.Basic.Organization.Request;
|
||||
|
||||
public class GainfoPageRequest : PageDto
|
||||
{
|
||||
public class GainfoPageRequest : PageDto
|
||||
{
|
||||
[EnumDataType(typeof(GainfoStatusEnumType))]
|
||||
public GainfoStatusEnumType gainfoStatus { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 档案类型
|
||||
/// </summary>
|
||||
[EnumDataType(typeof(GainfoStatusEnumType))]
|
||||
public GainfoStatusEnumType Status { get; set; } = GainfoStatusEnumType.Working;
|
||||
|
||||
/// <summary>
|
||||
/// 部门号(部门树传入)
|
||||
/// </summary>
|
||||
public List<string> DepartmentNos { get; set; }
|
||||
}
|
||||
|
||||
@@ -2,45 +2,47 @@
|
||||
|
||||
public class GainfoPageResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 档案号
|
||||
/// </summary>
|
||||
public string Guestno { get; set; }
|
||||
public string No { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// SAP内部编号
|
||||
/// </summary>
|
||||
public string Ano { get; set; }
|
||||
public string SapNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 人员类型
|
||||
/// </summary>
|
||||
public string Class { get; set; }
|
||||
public string GType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 姓名
|
||||
/// </summary>
|
||||
public string Gname { get; set; }
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 外文名字
|
||||
/// </summary>
|
||||
public string NameEn { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 工号
|
||||
/// </summary>
|
||||
public string Ename { get; set; }
|
||||
public string Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 国家代码
|
||||
/// </summary>
|
||||
public string Country { get; set; }
|
||||
public string CountryNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 证件类型代码
|
||||
/// </summary>
|
||||
public string Idcls { get; set; }
|
||||
public string IdClass { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 身份证号
|
||||
/// </summary>
|
||||
public string IdNO { get; set; }
|
||||
public string IdNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 身份证籍贯区域代码
|
||||
@@ -50,7 +52,7 @@ public class GainfoPageResponse
|
||||
/// <summary>
|
||||
/// 性别
|
||||
/// </summary>
|
||||
public string Sex { get; set; }
|
||||
public string Gender { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 生日
|
||||
@@ -65,12 +67,12 @@ public class GainfoPageResponse
|
||||
/// <summary>
|
||||
/// 已婚/未婚
|
||||
/// </summary>
|
||||
public string Postcode { get; set; }
|
||||
public string Marital { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 部门编码
|
||||
/// </summary>
|
||||
public string Appellation { get; set; }
|
||||
public string DepartmentNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 民族代码
|
||||
@@ -82,11 +84,6 @@ public class GainfoPageResponse
|
||||
/// </summary>
|
||||
public string Phone { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 联系电话
|
||||
/// </summary>
|
||||
public string Mobile { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 学历
|
||||
/// </summary>
|
||||
@@ -95,7 +92,12 @@ public class GainfoPageResponse
|
||||
/// <summary>
|
||||
/// 岗位
|
||||
/// </summary>
|
||||
public string Web { get; set; }
|
||||
public string Position { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 卡号
|
||||
/// </summary>
|
||||
public string CarNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
@@ -103,42 +105,12 @@ public class GainfoPageResponse
|
||||
public string Remark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 操作账号
|
||||
/// 人事范围
|
||||
/// </summary>
|
||||
public string Log_id { get; set; }
|
||||
public string Werks { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 操作班次
|
||||
/// 在职状态
|
||||
/// </summary>
|
||||
public string Log_shift { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 操作时间
|
||||
/// </summary>
|
||||
public DateTime Log_date { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 操作IP
|
||||
/// </summary>
|
||||
public string Log_ip { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否在职 F 在职 T离职
|
||||
/// </summary>
|
||||
public string Isowner { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
public DateTime Createdate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 外文名字
|
||||
/// </summary>
|
||||
public string Gname_en { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 卡号
|
||||
/// </summary>
|
||||
public string CarNo { get; set; }
|
||||
public string Employed { get; set; }
|
||||
}
|
||||
|
||||
@@ -5,4 +5,6 @@ namespace Dlhis.Basic.Organization.Services;
|
||||
public interface IWerkService : IScopeDependency
|
||||
{
|
||||
Task<List<WerkResponse>> GetListAsync();
|
||||
|
||||
Task<WerkResponse> GetCurrentAsync();
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ public class GainfoService : IGainfoService
|
||||
/// <returns></returns>
|
||||
public Task<Pagination<GainfoPageResponse>> GetPageAsync(GainfoPageRequest request)
|
||||
{
|
||||
var page = _gainfoStore.Queryable(request.gainfoStatus)
|
||||
var page = _gainfoStore.Queryable(request.Status)
|
||||
.Select<GainfoPageResponse>()
|
||||
.ToPageListAsync(request);
|
||||
|
||||
@@ -44,7 +44,7 @@ public class GainfoService : IGainfoService
|
||||
var gainfos = new List<GainfoEntity>();
|
||||
GainfoEntity aginfoEntity = request.Adapt<GainfoEntity>();
|
||||
|
||||
aginfoEntity.Guestno = "F" + Guid.NewGuid().ToString();
|
||||
aginfoEntity.No = "F" + Guid.NewGuid().ToString();
|
||||
gainfos.Add(aginfoEntity);
|
||||
|
||||
await _gainfoStore.InsertAsync(GainfoStatusEnumType.Working, gainfos);
|
||||
@@ -81,7 +81,7 @@ public class GainfoService : IGainfoService
|
||||
public async Task DimissionAsync(GainfoDImissionRequest request)
|
||||
{
|
||||
var gainfo = await _gainfoStore.Queryable(GainfoStatusEnumType.Working)
|
||||
.Where(x => x.Guestno == request.UserId)
|
||||
.Where(x => x.No == request.UserId)
|
||||
.FirstAsync();
|
||||
gainfo.ThrowIfNull($"该档案不存在");
|
||||
|
||||
@@ -106,7 +106,7 @@ public class GainfoService : IGainfoService
|
||||
public async Task OnboardingAsync(GainfoDImissionRequest request)
|
||||
{
|
||||
var gainfo = await _gainfoStore.Queryable(GainfoStatusEnumType.External)
|
||||
.Where(x => x.Guestno == request.UserId)
|
||||
.Where(x => x.No == request.UserId)
|
||||
.FirstAsync();
|
||||
gainfo.ThrowIfNull($"该档案不存在");
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ public class GainfoStore : IGainfoStore
|
||||
if (gainfoStatus.HasValue && gainfoStatus != GainfoStatusEnumType.Working)
|
||||
{
|
||||
var tableName = typeof(GainfoEntity).GetCustomAttribute<SugarTable>().TableName;
|
||||
return _dbContext.Queryable<GainfoEntity>().AS(tableName + "_" + gainfoStatus);
|
||||
return _dbContext.Queryable<GainfoEntity>().AS(tableName + gainfoStatus);
|
||||
}
|
||||
|
||||
return _dbContext.Queryable<GainfoEntity>();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Dlhis.Basic.Organization.Response;
|
||||
using Dlhis.Entity.Basic.Entity;
|
||||
using Kurisu.Core.User.Abstractions;
|
||||
using Kurisu.SqlSugar.Services;
|
||||
|
||||
namespace Dlhis.Basic.Organization.Services.Implements;
|
||||
@@ -7,10 +8,12 @@ namespace Dlhis.Basic.Organization.Services.Implements;
|
||||
public class WerkService : IWerkService
|
||||
{
|
||||
private readonly IDbContext _dbContext;
|
||||
private readonly ICurrentUser _currentUser;
|
||||
|
||||
public WerkService(IDbContext dbContext)
|
||||
public WerkService(IDbContext dbContext, ICurrentUser currentUser)
|
||||
{
|
||||
_dbContext = dbContext;
|
||||
_currentUser = currentUser;
|
||||
}
|
||||
|
||||
public async Task<List<WerkResponse>> GetListAsync()
|
||||
@@ -19,4 +22,13 @@ public class WerkService : IWerkService
|
||||
.Select<WerkResponse>()
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<WerkResponse> GetCurrentAsync()
|
||||
{
|
||||
var tenant = _currentUser.GetStringTenantId();
|
||||
return await _dbContext.Queryable<WerkEntity>()
|
||||
.Where(x => x.Code == tenant)
|
||||
.Select<WerkResponse>()
|
||||
.FirstAsync();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,10 +63,10 @@ public class OrderService : IOrderService
|
||||
.FirstAsync();
|
||||
|
||||
var gafinfo = await _dbContext.Queryable<GainfoEntity>()
|
||||
.Where(x => x.Guestno == canteenUser.UserId)
|
||||
.Where(x => x.No == canteenUser.UserId)
|
||||
.FirstAsync();
|
||||
|
||||
var settings = await _canteenSettingService.GetUserSettingAsync(gafinfo.Guestno);
|
||||
var settings = await _canteenSettingService.GetUserSettingAsync(gafinfo.No);
|
||||
var switchTime = GetSetting<TimeOnly>(settings, CanteenSettingItemEnumType.BusinessSwitchTime);
|
||||
//金额处理
|
||||
request.Amount = request.Type == BalanceRecordTypeEnumType.In ? Math.Abs(request.Amount) : -Math.Abs(request.Amount);
|
||||
@@ -100,7 +100,7 @@ public class OrderService : IOrderService
|
||||
ThirdNo = request.ThirdNo,
|
||||
Type = request.Type.Value,
|
||||
OrderStatus = CanteenOrderStatusEnumType.Wait,
|
||||
Name = gafinfo.Gname,
|
||||
Name = gafinfo.Name,
|
||||
Source = request.Source,
|
||||
UserId = canteenUser.UserId,
|
||||
UserCode = canteenUser.UserCode,
|
||||
@@ -109,7 +109,7 @@ public class OrderService : IOrderService
|
||||
BusinessShiftCode = shift?.Code,
|
||||
CostDate = costDate.Date,
|
||||
CostId = canteenUser.CostId,
|
||||
DepartmentNo = gafinfo.Appellation,
|
||||
DepartmentNo = gafinfo.DepartmentNo,
|
||||
DeviceInfo = device.Code.ToString(),
|
||||
|
||||
No = "O" + SnowFlakeHelper.Instance.NextId(),
|
||||
|
||||
@@ -8,5 +8,28 @@
|
||||
"InternalRequest": {
|
||||
"CommonRequestUrl": "http://common",
|
||||
"UserRequestUrl": "http://localhost:5010"
|
||||
},
|
||||
"SwaggerOptions": {
|
||||
"Enable": true,
|
||||
"Authority": "https://yikatong.isawesome.cn/oauth2",
|
||||
"ClientId": "4fb184324eac4180",
|
||||
"ClientSecret": "8ac8f235152f1524",
|
||||
"Scopes": {
|
||||
"openid": "openid",
|
||||
"profile": "profile",
|
||||
"yikatong": "yikatong"
|
||||
}
|
||||
},
|
||||
"IdentityServerOptions": {
|
||||
"Authority": "https://yikatong.isawesome.cn/oauth2",
|
||||
"RequireHttpsMetadata": true,
|
||||
"Issuer": "identity.isawesome.cn",
|
||||
"Audience": "",
|
||||
"Pat": {
|
||||
"Enable": false,
|
||||
"Scheme": "token",
|
||||
"ClientId": "reference",
|
||||
"ClientSecret": "123456"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user