fix 人脸修改任务生成

This commit is contained in:
2024-01-16 14:36:44 +08:00
parent 9758f3e4b5
commit c2b5e12ffe
4 changed files with 56 additions and 8 deletions

View File

@@ -72,6 +72,7 @@ public class GainfoGroupService : IGainfoGroupService
var relations = await _dbContext.Queryable<GainfoGroupRelationshipEntity>().Where(x => x.GroupCode == request.GroupCode).ToListAsync();
await _dbContext.DeleteReallyAsync(relations);
request.UserNos = await _dbContext.Queryable<GainfoEntity>().Where(x => request.UserNos.Contains(x.No)).Select(x => x.No).ToListAsync();
var entities = request.UserNos.Select(x => new GainfoGroupRelationshipEntity
{
GroupCode = request.GroupCode,

View File

@@ -1,8 +1,10 @@
using System.Threading.Tasks;
using Dlhis.Basic.Device.Services;
using Dlhis.Basic.Device.Services.Implements;
using Dlhis.Basic.Organization.Request;
using Dlhis.Basic.Organization.Response;
using Dlhis.Entity.Basic.Entity;
using Dlhis.Entity.Basic.Enums;
using Dlhis.Entity.Device.Enums;
using Kurisu.AspNetCore.Scope;
using Kurisu.AspNetCore.UnifyResultAndValidation;
using Kurisu.AspNetCore.Utils.Extensions;
@@ -14,8 +16,6 @@ using Kurisu.SqlSugar.Services;
using Mapster;
using Microsoft.AspNetCore.DataProtection;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
using NetTaste;
namespace Dlhis.Basic.Organization.Services.Implements;
@@ -24,12 +24,14 @@ public class GainfoService : IGainfoService
private readonly IGainfoStore _gainfoStore;
private readonly IDbContext _dbContext;
private readonly ICurrentUser _currentUser;
private readonly IDevicePermissionService _devicePermissionService;
public GainfoService(IGainfoStore gainfoStore, IDbContext dbContext, ICurrentUser currentUser)
public GainfoService(IGainfoStore gainfoStore, IDbContext dbContext, ICurrentUser currentUser, IDevicePermissionService devicePermissionService)
{
_gainfoStore = gainfoStore;
_dbContext = dbContext;
_currentUser = currentUser;
_devicePermissionService = devicePermissionService;
}
/// <summary>
@@ -196,8 +198,6 @@ public class GainfoService : IGainfoService
gainfo.ThrowIfNull("人员档案信息不存在");
await Scoped.Request.Value.CreateAsync(async (sp) =>
{
var configuration = sp.GetService<IConfiguration>();
@@ -212,6 +212,9 @@ public class GainfoService : IGainfoService
dbContext.Client.CurrentConnectionConfig.ConnectionString = faceConnectionString;
var face = await dbContext.Queryable<GainfoFaceEntity>().Where(x => x.UserCode == gainfo.Code).SingleAsync();
//生成任务
await _devicePermissionService.GenerateDeviceTasksAsync(gainfo.No, face == null ? DeviceTaskEnumType.Add : DeviceTaskEnumType.AddAfterDelete);
if (face == null)
{
face = new GainfoFaceEntity