feat 出差人员筛选,移除无用代码
This commit is contained in:
@@ -8,10 +8,6 @@ namespace Dlhis.Basic.Api;
|
|||||||
[EnableRemoteClient(Name = "basic-service", BaseUrl = "${InternalRequest:BasicRequestUrl}")]
|
[EnableRemoteClient(Name = "basic-service", BaseUrl = "${InternalRequest:BasicRequestUrl}")]
|
||||||
public interface IDevicePermissionApi
|
public interface IDevicePermissionApi
|
||||||
{
|
{
|
||||||
[Auth]
|
|
||||||
[Get("/api/devicepermissions/canteen/uniqueNos")]
|
|
||||||
Task<DefaultApiResult<List<string>>> GetCanteenDeviceUniqueNosByUserNoAsync(string userNo);
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取所有人的权限信息
|
/// 获取所有人的权限信息
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -82,19 +82,16 @@ public class DevicePermissionsController : ControllerBase
|
|||||||
{
|
{
|
||||||
return await _devicePermissionService.GetAssignmentUniqueAsync(request);
|
return await _devicePermissionService.GetAssignmentUniqueAsync(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取就餐设备唯一号权限
|
/// 获取设备下人员分页
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="userNo"></param>
|
/// <param name="request"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[AllowAnonymous]
|
[HttpGet("gainfos/page")]
|
||||||
[HttpGet("canteen/uniqueNos")]
|
public async Task<Pagination<GainfoDto>> GetGainfoPageByDeviceAsync([FromQuery] DeviceWithGainfoRequest request)
|
||||||
[IgnoreTenant]
|
|
||||||
public async Task<List<string>> GetCanteenDeviceUniqueNosByUserNoAsync(string userNo)
|
|
||||||
{
|
{
|
||||||
return await _devicePermissionService.GetCanteenDeviceUniqueNosByUserNoAsync(userNo);
|
return await _devicePermissionService.GetGainfoPageByDeviceAsync(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -121,15 +118,4 @@ public class DevicePermissionsController : ControllerBase
|
|||||||
{
|
{
|
||||||
return await _devicePermissionService.ReGeneratePermissionUsersInfoAsync(beforeDto);
|
return await _devicePermissionService.ReGeneratePermissionUsersInfoAsync(beforeDto);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取设备下人员分页
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="request"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpGet("gainfos/page")]
|
|
||||||
public async Task<Pagination<GainfoDto>> GetGainfoPageByDeviceAsync([FromQuery] DeviceWithGainfoRequest request)
|
|
||||||
{
|
|
||||||
return await _devicePermissionService.GetGainfoPageByDeviceAsync(request);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -58,18 +58,8 @@ public interface IDevicePermissionService : IScopeDependency
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<List<Guid>> GetAssignDeviceCodesAsync(string userNo);
|
Task<List<Guid>> GetAssignDeviceCodesAsync(string userNo);
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取就餐权限唯一号
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="userNo"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<List<string>> GetCanteenDeviceUniqueNosByUserNoAsync(string userNo);
|
|
||||||
|
|
||||||
|
|
||||||
Task<PermissionUsersInfoDto> GetPermissionUsersInfoAsync(List<string> userNos);
|
Task<PermissionUsersInfoDto> GetPermissionUsersInfoAsync(List<string> userNos);
|
||||||
|
|
||||||
|
|
||||||
Task<int> ReGeneratePermissionUsersInfoAsync(PermissionUsersInfoDto beforeDto);
|
Task<int> ReGeneratePermissionUsersInfoAsync(PermissionUsersInfoDto beforeDto);
|
||||||
|
|
||||||
Task<Pagination<GainfoDto>> GetGainfoPageByDeviceAsync(DeviceWithGainfoRequest request);
|
Task<Pagination<GainfoDto>> GetGainfoPageByDeviceAsync(DeviceWithGainfoRequest request);
|
||||||
|
|||||||
@@ -335,18 +335,21 @@ public class DevicePermissionService : IDevicePermissionService
|
|||||||
|
|
||||||
var current = await GetAssignDeviceCodesInternalAsync(userNos);
|
var current = await GetAssignDeviceCodesInternalAsync(userNos);
|
||||||
|
|
||||||
var deivces = await _dbContext.Queryable<DeviceEntity>().Where(x => x.Enable).ToListAsync();
|
var devices = await _dbContext.Queryable<DeviceEntity>().Where(x => x.Enable).ToListAsync();
|
||||||
var waitTasks = new List<DeviceTaskEntity>();
|
var waitTasks = new List<DeviceTaskEntity>();
|
||||||
|
|
||||||
foreach (var userNo in userNos)
|
foreach (var userNo in userNos)
|
||||||
{
|
{
|
||||||
before.TryGetValue(userNo, out var beforeTenantDeviceCodes);
|
before.TryGetValue(userNo, out var beforeTenantDeviceCodes);
|
||||||
beforeTenantDeviceCodes ??= new();
|
beforeTenantDeviceCodes ??= new();
|
||||||
|
|
||||||
current.TryGetValue(userNo, out var currentTenantDeviceCodes);
|
current.TryGetValue(userNo, out var currentTenantDeviceCodes);
|
||||||
currentTenantDeviceCodes ??= new();
|
currentTenantDeviceCodes ??= new();
|
||||||
|
|
||||||
var tenants = beforeTenantDeviceCodes.Select(x => x.Tenant).Concat(currentTenantDeviceCodes.Select(x => x.Tenant)).Distinct().ToList();
|
var tenants = new HashSet<string>();
|
||||||
|
foreach (var item in beforeTenantDeviceCodes)
|
||||||
|
tenants.Add(item.Tenant);
|
||||||
|
foreach (var item in currentTenantDeviceCodes)
|
||||||
|
tenants.Add(item.Tenant);
|
||||||
|
|
||||||
foreach (var tenant in tenants)
|
foreach (var tenant in tenants)
|
||||||
{
|
{
|
||||||
@@ -363,34 +366,33 @@ public class DevicePermissionService : IDevicePermissionService
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
var deviceCodes = deivces.Where(x => deletedItems.Contains(x.Code) || addItems.Contains(x.Code)).Select(x => x.Code).ToList();
|
var deviceCodes = devices.Where(x => deletedItems.Contains(x.Code) || addItems.Contains(x.Code)).Select(x => x.Code).ToList();
|
||||||
deletedItems = deletedItems.Where(x => deviceCodes.Contains(x)).ToList();
|
deletedItems = deletedItems.Where(x => deviceCodes.Contains(x)).ToList();
|
||||||
addItems = addItems.Where(x => deviceCodes.Contains(x)).ToList();
|
addItems = addItems.Where(x => deviceCodes.Contains(x)).ToList();
|
||||||
|
|
||||||
//下发任务创建
|
//下发任务创建
|
||||||
var toDeleted = deletedItems.Select(x => new DeviceTaskEntity
|
deletedItems.ForEach(x => waitTasks.Add(new DeviceTaskEntity
|
||||||
{
|
{
|
||||||
DeviceUniqueNo = deivces.First(item => item.Code == x).UniqueNo,
|
DeviceUniqueNo = devices.First(item => item.Code == x).UniqueNo,
|
||||||
Status = DeviceTaskStatusEnumType.Wait,
|
Status = DeviceTaskStatusEnumType.Wait,
|
||||||
Type = DeviceTaskEnumType.Delete,
|
Type = DeviceTaskEnumType.Delete,
|
||||||
DeviceType = deivces.First(item => item.Code == x).Type,
|
CancellationId = 0,
|
||||||
|
DeviceType = devices.First(item => item.Code == x).Type,
|
||||||
UserNo = userNo,
|
UserNo = userNo,
|
||||||
Version = 0,
|
Version = 0,
|
||||||
TenantId = tenant,
|
TenantId = tenant,
|
||||||
}).ToList();
|
}));
|
||||||
|
|
||||||
var toAdd = addItems.Select(x => new DeviceTaskEntity
|
addItems.ForEach(x => waitTasks.Add(new DeviceTaskEntity
|
||||||
{
|
{
|
||||||
DeviceUniqueNo = deivces.First(item => item.Code == x).UniqueNo,
|
DeviceUniqueNo = devices.First(item => item.Code == x).UniqueNo,
|
||||||
Status = DeviceTaskStatusEnumType.Wait,
|
Status = DeviceTaskStatusEnumType.Wait,
|
||||||
Type = DeviceTaskEnumType.Add,
|
Type = DeviceTaskEnumType.Add,
|
||||||
DeviceType = deivces.First(item => item.Code == x).Type,
|
DeviceType = devices.First(item => item.Code == x).Type,
|
||||||
UserNo = userNo,
|
UserNo = userNo,
|
||||||
Version = 0,
|
Version = 0,
|
||||||
TenantId = tenant,
|
TenantId = tenant,
|
||||||
}).ToList();
|
}));
|
||||||
|
|
||||||
waitTasks.AddRange(toDeleted.Concat(toAdd).ToList());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -481,18 +483,6 @@ public class DevicePermissionService : IDevicePermissionService
|
|||||||
await _dbContext.InsertAsync(tasks);
|
await _dbContext.InsertAsync(tasks);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<List<string>> GetCanteenDeviceUniqueNosByUserNoAsync(string userNo)
|
|
||||||
{
|
|
||||||
var all = await GetAssignDeviceCodesAsync(userNo);
|
|
||||||
|
|
||||||
return await _dbContext.Queryable<DeviceEntity>()
|
|
||||||
.Where(x => x.Enable)
|
|
||||||
.Where(x => x.Type == DeviceTypeEnumType.Meal)
|
|
||||||
.Where(x => all.Contains(x.Code))
|
|
||||||
.Select(x => x.UniqueNo)
|
|
||||||
.ToListAsync();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取用户所有设备权限
|
/// 获取用户所有设备权限
|
||||||
|
|||||||
@@ -18,11 +18,11 @@ public class GainfoPageRequest : PageDto, IValidatableObject
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public List<TenantDepartmentRequest> DepartmentSelections { get; set; } = new();
|
public List<TenantDepartmentRequest> DepartmentSelections { get; set; } = new();
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否为外包
|
/// 查询类型 GainfoSearchEnumType
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool? IsOutsource { get; set; }
|
[EnumDataType(typeof(GainfoSearchEnumType))]
|
||||||
|
public GainfoSearchEnumType SearchType { get; set; }
|
||||||
|
|
||||||
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using Dlhis.Basic.Organization.Response;
|
|||||||
using Dlhis.Entity.Basic.Entity;
|
using Dlhis.Entity.Basic.Entity;
|
||||||
using Dlhis.Entity.Basic.Enums;
|
using Dlhis.Entity.Basic.Enums;
|
||||||
using Dlhis.Entity.Device.Enums;
|
using Dlhis.Entity.Device.Enums;
|
||||||
|
using Dlhis.Entity.Visitor.Entity;
|
||||||
using Dlhis.Scheduled.Api;
|
using Dlhis.Scheduled.Api;
|
||||||
using Dlhis.Scheduled.Api.Request;
|
using Dlhis.Scheduled.Api.Request;
|
||||||
using Dlhis.Sys.Api;
|
using Dlhis.Sys.Api;
|
||||||
@@ -57,8 +58,6 @@ public class GainfoService : IGainfoService
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<Pagination<GainfoPageResponse>> GetPageAsync(GainfoPageRequest request)
|
public async Task<Pagination<GainfoPageResponse>> GetPageAsync(GainfoPageRequest request)
|
||||||
{
|
{
|
||||||
var currentTenantId = _currentUser.GetStringTenantId();
|
|
||||||
|
|
||||||
//根据组织架构搜索档案
|
//根据组织架构搜索档案
|
||||||
var where = LinqExpressionExtensions.False<GainfoEntity>();
|
var where = LinqExpressionExtensions.False<GainfoEntity>();
|
||||||
foreach (var item in request.DepartmentSelections)
|
foreach (var item in request.DepartmentSelections)
|
||||||
@@ -69,11 +68,16 @@ public class GainfoService : IGainfoService
|
|||||||
: where.Or(gainfo => gainfo.Factory == item.Tenant);
|
: where.Or(gainfo => gainfo.Factory == item.Tenant);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//获取所有厂区
|
||||||
|
var factories = request.DepartmentSelections.Select(x => x.Tenant);
|
||||||
|
var today = DateTime.Today;
|
||||||
|
|
||||||
var page = await _gainfoStore.Queryable(request.Status)
|
var page = await _gainfoStore.Queryable(request.Status)
|
||||||
.WhereIF(request.DepartmentSelections?.Any() == true, where)
|
.WhereIF(request.SearchType != GainfoSearchEnumType.BusinessTrip && request.DepartmentSelections?.Any() == true, where)
|
||||||
.WhereIF(request.DepartmentSelections?.Any() != true, gainfo => gainfo.Factory == currentTenantId)
|
.WhereIF(request.SearchType == GainfoSearchEnumType.Internal, gainfo => SqlFunc.Subqueryable<OutsourceEntity>().Where(x => x.Code == gainfo.Code).NotAny())
|
||||||
.WhereIF(request.IsOutsource.HasValue && request.IsOutsource.Value, gainfo => SqlFunc.Subqueryable<OutsourceEntity>().Where(x => x.Code == gainfo.Code).Any())
|
.WhereIF(request.SearchType == GainfoSearchEnumType.Outsource, gainfo => SqlFunc.Subqueryable<OutsourceEntity>().Where(x => x.Code == gainfo.Code).Any())
|
||||||
.WhereIF(request.IsOutsource.HasValue && !request.IsOutsource.Value, gainfo => SqlFunc.Subqueryable<OutsourceEntity>().Where(x => x.Code == gainfo.Code).NotAny())
|
.WhereIF(request.SearchType == GainfoSearchEnumType.BusinessTrip, gainfo =>
|
||||||
|
SqlFunc.Subqueryable<BusinessTripEntity>().Where(x => x.Code == gainfo.Code && factories.Contains(x.Destination) && SqlFunc.DateIsSame(x.BeginDate, today)).Any())
|
||||||
.WhereIF(request.Search.IsPresent(), gainfo =>
|
.WhereIF(request.Search.IsPresent(), gainfo =>
|
||||||
gainfo.Name.Contains(request.Search)
|
gainfo.Name.Contains(request.Search)
|
||||||
|| gainfo.Code == request.Search
|
|| gainfo.Code == request.Search
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using Dlhis.Basic.Api;
|
using Dlhis.Canteen.Setting.Services;
|
||||||
using Dlhis.Canteen.Setting.Services;
|
|
||||||
using Dlhis.Entity.Basic.Entity;
|
using Dlhis.Entity.Basic.Entity;
|
||||||
using Dlhis.Entity.Canteen.Enums;
|
using Dlhis.Entity.Canteen.Enums;
|
||||||
using Kurisu.AspNetCore.Authentication.Abstractions;
|
using Kurisu.AspNetCore.Authentication.Abstractions;
|
||||||
@@ -14,20 +13,17 @@ public abstract class BaseOrderService
|
|||||||
private readonly ICanteenSettingService _canteenSettingService;
|
private readonly ICanteenSettingService _canteenSettingService;
|
||||||
private readonly IDbContext _dbContext;
|
private readonly IDbContext _dbContext;
|
||||||
private readonly ICurrentUser _currentUser;
|
private readonly ICurrentUser _currentUser;
|
||||||
private readonly IDevicePermissionApi _devicePermissionApi;
|
|
||||||
private readonly ILogger _logger;
|
private readonly ILogger _logger;
|
||||||
private Dictionary<CanteenSettingItemEnumType, string> _settings;
|
private Dictionary<CanteenSettingItemEnumType, string> _settings;
|
||||||
|
|
||||||
public BaseOrderService(ICanteenSettingService canteenSettingService,
|
public BaseOrderService(ICanteenSettingService canteenSettingService,
|
||||||
IDbContext dbContext,
|
IDbContext dbContext,
|
||||||
ICurrentUser currentUser,
|
ICurrentUser currentUser,
|
||||||
IDevicePermissionApi devicePermissionApi,
|
|
||||||
ILogger logger)
|
ILogger logger)
|
||||||
{
|
{
|
||||||
_canteenSettingService = canteenSettingService;
|
_canteenSettingService = canteenSettingService;
|
||||||
_dbContext = dbContext;
|
_dbContext = dbContext;
|
||||||
_currentUser = currentUser;
|
_currentUser = currentUser;
|
||||||
_devicePermissionApi = devicePermissionApi;
|
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -37,20 +33,6 @@ public abstract class BaseOrderService
|
|||||||
|
|
||||||
protected ICurrentUser CurrentUser => _currentUser;
|
protected ICurrentUser CurrentUser => _currentUser;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 检查权限
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="userNo"></param>
|
|
||||||
/// <param name="deviceUniqueNo"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
protected async Task CheckPermissionAsync(string userNo, string deviceUniqueNo)
|
|
||||||
{
|
|
||||||
var uniqueNosResult = await _devicePermissionApi.GetCanteenDeviceUniqueNosByUserNoAsync(userNo);
|
|
||||||
var uniqueNos = uniqueNosResult.Data;
|
|
||||||
|
|
||||||
uniqueNos.Contains(deviceUniqueNo).ThrowIfFalse("无消费权限");
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取参数配置
|
/// 获取参数配置
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -25,8 +25,8 @@ public class BookingOrderService : BaseOrderService, IBookingOrderService
|
|||||||
public BookingOrderService(ICanteenSettingService canteenSettingService, IDbContext dbContext,
|
public BookingOrderService(ICanteenSettingService canteenSettingService, IDbContext dbContext,
|
||||||
IDishesMenuApi dishesMenuApi,
|
IDishesMenuApi dishesMenuApi,
|
||||||
IBusinessPlacePermissionsApi businessPlacePermissionsApi,
|
IBusinessPlacePermissionsApi businessPlacePermissionsApi,
|
||||||
ICurrentUser currentUser, IDevicePermissionApi devicePermissionApi, ILogger<BookingOrderService> logger)
|
ICurrentUser currentUser, ILogger<BookingOrderService> logger)
|
||||||
: base(canteenSettingService, dbContext, currentUser, devicePermissionApi, logger)
|
: base(canteenSettingService, dbContext, currentUser, logger)
|
||||||
{
|
{
|
||||||
_dishesMenuApi = dishesMenuApi;
|
_dishesMenuApi = dishesMenuApi;
|
||||||
_businessPlacePermissionsApi = businessPlacePermissionsApi;
|
_businessPlacePermissionsApi = businessPlacePermissionsApi;
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using Dlhis.Basic.Api;
|
using Dlhis.Canteen.Setting.Services;
|
||||||
using Dlhis.Canteen.Setting.Services;
|
|
||||||
using Dlhis.Entity.Basic.Entity;
|
using Dlhis.Entity.Basic.Entity;
|
||||||
using Dlhis.Entity.Canteen.Entities;
|
using Dlhis.Entity.Canteen.Entities;
|
||||||
using Dlhis.Entity.Canteen.Enums;
|
using Dlhis.Entity.Canteen.Enums;
|
||||||
@@ -27,10 +26,9 @@ public class OrderService : BaseOrderService, IOrderService
|
|||||||
public OrderService(ICanteenSettingService canteenSettingService,
|
public OrderService(ICanteenSettingService canteenSettingService,
|
||||||
IDbContext dbContext,
|
IDbContext dbContext,
|
||||||
ICurrentUser currentUser,
|
ICurrentUser currentUser,
|
||||||
IDevicePermissionApi devicePermissionApi,
|
|
||||||
RedisCache redisCache,
|
RedisCache redisCache,
|
||||||
ILogger<OrderService> logger)
|
ILogger<OrderService> logger)
|
||||||
: base(canteenSettingService, dbContext, currentUser, devicePermissionApi, logger)
|
: base(canteenSettingService, dbContext, currentUser, logger)
|
||||||
{
|
{
|
||||||
_redisCache = redisCache;
|
_redisCache = redisCache;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,13 +21,13 @@ public class BusinessTripEntity : SugarBaseEntity
|
|||||||
/// 开始日期
|
/// 开始日期
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(IsNullable = false, UniqueGroupNameList = new[] { "unique_BusinessTrip_code_begin_end" })]
|
[SugarColumn(IsNullable = false, UniqueGroupNameList = new[] { "unique_BusinessTrip_code_begin_end" })]
|
||||||
public string BeginDate { get; set; }
|
public DateTime BeginDate { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 结束日期
|
/// 结束日期
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(IsNullable = false, UniqueGroupNameList = new[] { "unique_BusinessTrip_code_begin_end" })]
|
[SugarColumn(IsNullable = false, UniqueGroupNameList = new[] { "unique_BusinessTrip_code_begin_end" })]
|
||||||
public string EndDate { get; set; }
|
public DateTime EndDate { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 开始时间
|
/// 开始时间
|
||||||
|
|||||||
@@ -29,13 +29,13 @@ public class SapBusinessTripInfoItem
|
|||||||
/// 开始日期
|
/// 开始日期
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("OV_BEGDA")]
|
[JsonProperty("OV_BEGDA")]
|
||||||
public string BeginDate { get; set; }
|
public DateTime BeginDate { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 结束日期
|
/// 结束日期
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("OV_ENDDA")]
|
[JsonProperty("OV_ENDDA")]
|
||||||
public string EndDate { get; set; }
|
public DateTime EndDate { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 开始时间
|
/// 开始时间
|
||||||
|
|||||||
@@ -24,14 +24,16 @@ public class SyncPersonJob : BaseJob
|
|||||||
|
|
||||||
foreach (var werk in werks)
|
foreach (var werk in werks)
|
||||||
{
|
{
|
||||||
if (werk.BackgroundJobKey.IsEmpty())
|
if (!werk.BackgroundJobKey.IsEmpty())
|
||||||
{
|
{
|
||||||
var jobKey = BackgroundJob.Enqueue<IGainfoUpdateService>(x => x.TodoByWerkAsync(werk.Werk));
|
continue;
|
||||||
werk.BackgroundJobKey = jobKey;
|
|
||||||
await DbContext.UpdateAsync(werk);
|
|
||||||
|
|
||||||
Logger.LogInformation("SAP创建人事范围{werk}后台调度任务", werk.Werk);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var jobKey = BackgroundJob.Enqueue<IGainfoUpdateService>(x => x.TodoByWerkAsync(werk.Werk));
|
||||||
|
werk.BackgroundJobKey = jobKey;
|
||||||
|
await DbContext.UpdateAsync(werk);
|
||||||
|
|
||||||
|
Logger.LogInformation("SAP创建人事范围{werk}后台调度任务", werk.Werk);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user