fix 下发任务数据补充
This commit is contained in:
@@ -203,7 +203,7 @@ public class GainfoPermissionService : IGainfoPermissionService
|
||||
.Where(x => x.No == request.UserNo)
|
||||
.SingleAsync();
|
||||
|
||||
if (request.IsLeave)
|
||||
if (gainfo == null && request.IsLeave)
|
||||
{
|
||||
gainfo = await _dbContext.Queryable<GainfoEntity>().AS("GainfoLeave")
|
||||
.Where(x => x.No == request.UserNo)
|
||||
|
||||
@@ -9,7 +9,7 @@ using Dlhis.ScheduledTask.Common.Dto;
|
||||
using Dlhis.ScheduledTask.Common.Comparers;
|
||||
using Kurisu.AspNetCore.Utils.Extensions;
|
||||
using Dlhis.Basic.Api.Dtos;
|
||||
using Microsoft.AspNetCore.Mvc.Formatters;
|
||||
using Dlhis.Basic.Api.Request;
|
||||
|
||||
namespace Dlhis.ScheduledTask.Common.Services.Implements;
|
||||
|
||||
@@ -199,15 +199,22 @@ public class GainfoUpdateService : IGainfoUpdateService
|
||||
var dtoResult = await _devicePermissionApi.GetPermissionUsersInfoAsync(new List<string> { no });
|
||||
var dto = dtoResult.Data;
|
||||
|
||||
await UpdatePersonAsync(item);
|
||||
var gainfoNo = await UpdatePersonAsync(item);
|
||||
_logger.LogWarning("执行更新成功 工号:{code},姓名:{name}", item.ename, item.gname);
|
||||
|
||||
await _devicePermissionApi.RePermissionUsersInfoAsync(dto);
|
||||
if (gainfoNo.IsPresent())
|
||||
{
|
||||
await _devicePermissionApi.RePermissionUsersInfoAsync(dto);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
await UpdatePersonAsync(item);
|
||||
no = await UpdatePersonAsync(item);
|
||||
_logger.LogWarning("执行更新成功 工号:{code},姓名:{name}", item.ename, item.gname);
|
||||
await _businessPlacePermissionsApi.ResetAsync(new GainfoPermissionResetRequest
|
||||
{
|
||||
UserNo = no
|
||||
});
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -343,7 +350,7 @@ public class GainfoUpdateService : IGainfoUpdateService
|
||||
{
|
||||
try
|
||||
{
|
||||
await _businessPlacePermissionsApi.ResetAsync(new Basic.Api.Request.GainfoPermissionResetRequest
|
||||
await _businessPlacePermissionsApi.ResetAsync(new GainfoPermissionResetRequest
|
||||
{
|
||||
IsLeave = true,
|
||||
UserNo = gainfo.No
|
||||
@@ -364,8 +371,14 @@ public class GainfoUpdateService : IGainfoUpdateService
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return gainfo?.No;
|
||||
if (item.isowner == "T")
|
||||
{
|
||||
return gainfo?.No;
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private async Task<List<SapPersonItem>> GetModifiedPersonAsync(List<SapPersonItem> sapList)
|
||||
|
||||
@@ -44,7 +44,8 @@ public class AssignmentService : IAssignmentService
|
||||
.LeftJoin<DeviceEntity>((deviceTask, deivce) => deviceTask.DeviceUniqueNo == deivce.UniqueNo)
|
||||
.LeftJoin<DeviceTemplateEntity>((deviceTask, deivce, deivceTamplate) => deivceTamplate.Code == deivce.TemplateCode)
|
||||
.LeftJoin<GainfoEntity>((deviceTask, deivce, deivceTamplate, ga) => deviceTask.UserNo == ga.No)
|
||||
.LeftJoin<DepartmentEntity>((deviceTask, deivce, deivceTamplate, ga, department) => department.No == ga.DepartmentNo)
|
||||
.LeftJoin<GainfoLeaveEntity>((deviceTask, deivce, deivceTamplate, ga, galeave) => deviceTask.UserNo == galeave.No)
|
||||
.LeftJoin<DepartmentEntity>((deviceTask, deivce, deivceTamplate, ga, galeave, department) => department.No == ga.DepartmentNo)
|
||||
.WhereIF(request.Brand.IsPresent(), (deviceTask, deivce, deivceTamplate) => deivceTamplate.Brand == request.Brand)
|
||||
.WhereIF(request.DeviceUniqueNo.IsPresent(), (deviceTask, deivce) => deviceTask.DeviceUniqueNo == request.DeviceUniqueNo)
|
||||
.WhereIF(request.Types.IsPresent(), deviceTask => request.Types.Contains(deviceTask.Type))
|
||||
@@ -52,7 +53,7 @@ public class AssignmentService : IAssignmentService
|
||||
.WhereIF(request.IsProcess, deviceTask => deviceTask.Status == DeviceTaskStatusEnumType.Process)
|
||||
//.Where(deviceTask => heartbeatDeviceNos.Contains(deviceTask.DeviceUniqueNo))
|
||||
.OrderBy(deviceTask => deviceTask.CreateTime)
|
||||
.Select((deviceTask, deivce, deivceTamplate, ga, department) => new
|
||||
.Select((deviceTask, deivce, deivceTamplate, ga, galeave, department) => new
|
||||
{
|
||||
UserId = SqlFunc.IsNull(deviceTask.UserId, ga.Id),
|
||||
TaskId = deviceTask.Id,
|
||||
@@ -62,8 +63,8 @@ public class AssignmentService : IAssignmentService
|
||||
deivceTamplate.Brand,
|
||||
FuncStr = deivce.Funcs.ToString(),
|
||||
deviceTask.UserNo,
|
||||
UserCode = ga.Code,
|
||||
UserName = ga.Name,
|
||||
UserCode = SqlFunc.IsNull(ga.Code, galeave.Code),
|
||||
UserName = SqlFunc.IsNull(ga.Name, galeave.Name),
|
||||
ga.DepartmentNo,
|
||||
DepartmentName = department.Name,
|
||||
ga.CardNo,
|
||||
|
||||
Reference in New Issue
Block a user