fix 处理已知问题
This commit is contained in:
@@ -28,7 +28,6 @@ public class GainfoUpdateService : IGainfoUpdateService
|
||||
IIdentityUserSyncService identityUserSyncService)
|
||||
{
|
||||
_dbContext = dbContext;
|
||||
_dbContext.Client.QueryFilter.Clear();
|
||||
_logger = logger;
|
||||
_jinkoSapService = jinkoSapService;
|
||||
_gainfoPermissionService = gainfoPermissionService;
|
||||
|
||||
@@ -142,7 +142,13 @@ public class WorkGridService : IWorkGridService
|
||||
.LeftJoin<GainfoEntity>((x, ga) => x.LeaderUserCode == ga.Code)
|
||||
.WhereIF(!isAll, x => x.LeaderUserCode == userCode)
|
||||
.WhereIF(request.Search.IsPresent(), x => x.Name.Contains(request.Search) || x.LeaderUserCode == request.Search)
|
||||
.Where(x => SqlFunc.Subqueryable<GainfoEntity>().Where(p => p.Code == x.LeaderUserCode && p.Factory == factory).Any())
|
||||
.Where(x => SqlFunc.Subqueryable<WorkGridUserEntity>()
|
||||
.LeftJoin<GainfoEntity>((p, pga) => p.UserCode == pga.Code)
|
||||
.Where(p => p.WorkGridCode == x.Code)
|
||||
.Where((p, pga) => pga.Factory == factory)
|
||||
.Where(p => p.IsDeleted == false)
|
||||
.Any()
|
||||
)
|
||||
.Select((x, ga) => new WorkGridPageResponse
|
||||
{
|
||||
Id = x.Id,
|
||||
|
||||
@@ -227,7 +227,7 @@ public class DeviceUploadLogService : IDeviceUploadLogService
|
||||
{
|
||||
await _dingTalkApi.SendWorkMessageAsync(new JinkoSendWorkMessageRequest
|
||||
{
|
||||
Content = $"{workGridInfo.WorkGrid.WorkGridName}的网格长,你好,检测到你网格中 {currentGainfo.Name}({currentGainfo.Code})今日未排班,但是有考勤记录,请前往系统处理!",
|
||||
Content = $"{workGridInfo.WorkGrid.WorkGridName}的网格长,你好,检测到你网格中 {currentGainfo.Name}({currentGainfo.Code}){request.RaiseDateTime.ToString("yyyy年MM月dd日")}未排班,但是有考勤记录,请前往系统处理!",
|
||||
WorkCodes = new List<string> { workGridInfo.WorkGrid.LeaderUserCode }
|
||||
});
|
||||
|
||||
|
||||
38
Src/Dlhis.ScheduledTask/Jobs/SendMsgToWorkGridLeaderJob.cs
Normal file
38
Src/Dlhis.ScheduledTask/Jobs/SendMsgToWorkGridLeaderJob.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using Dlhis.Basic.Api;
|
||||
using Dlhis.Basic.Api.Requests;
|
||||
using Dlhis.Entity.Basic.Entity;
|
||||
using Dlhis.ScheduledTask.Attributes;
|
||||
|
||||
namespace Dlhis.ScheduledTask.Jobs;
|
||||
|
||||
/// <summary>
|
||||
/// 发送信息到网格长
|
||||
/// </summary>
|
||||
[RecurringJob(nameof(SendMsgToWorkGridLeaderJob), "0 0 18 * * ? ", Name = "发送信息到网格长")]
|
||||
public class SendMsgToWorkGridLeaderJob : BaseJob
|
||||
{
|
||||
public SendMsgToWorkGridLeaderJob(IServiceProvider serviceProvider) : base(serviceProvider)
|
||||
{
|
||||
}
|
||||
|
||||
protected override async Task RunAsync(IServiceProvider serviceProvider)
|
||||
{
|
||||
//
|
||||
var infos = await DbContext.Queryable<WorkGridEntity>()
|
||||
.LeftJoin<GainfoEntity>((x, ga) => x.LeaderUserCode == ga.Code)
|
||||
.Select((x, ga) => new
|
||||
{
|
||||
x.LeaderUserCode,
|
||||
WorkGridName = x.Name,
|
||||
UserName = x.Name,
|
||||
})
|
||||
.ToListAsync();
|
||||
|
||||
var dingtalkApi = serviceProvider.GetService<IDingTalkApi>();
|
||||
await dingtalkApi.SendWorkMessageAsync(new JinkoSendWorkMessageRequest
|
||||
{
|
||||
Content = "你好,网格长,请看到消息后,前往人脸应用平台,执行明天的排班,已排班的请忽略!",
|
||||
WorkCodes = infos.Select(x => x.LeaderUserCode).ToList()
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user