fix 不再支持老系统档案号
This commit is contained in:
@@ -132,7 +132,9 @@ public class AppointmentAreaService : IAppointmentAreaService
|
||||
public async Task<List<Guid>> GetAssignmentsAsync(string customCode)
|
||||
{
|
||||
return await _dbContext.Queryable<AppointmentAreaAssignmentEntity>()
|
||||
.Where(x => x.CustomCode == customCode).Select(x => x.DeviceGroupCode)
|
||||
.LeftJoin<DeviceGroupEntity>((x, dg) => x.DeviceGroupCode == dg.Code)
|
||||
.Where((x, dg) => x.CustomCode == customCode && dg.AsAppointment)
|
||||
.Select(x => x.DeviceGroupCode)
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
using Dlhis.Basic.Organization.Request;
|
||||
using Dlhis.Basic.Organization.Services;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Dlhis.Basic.Organization.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// 老系统档案表
|
||||
/// </summary>
|
||||
[Authorize]
|
||||
[Route("api/[controller]")]
|
||||
[ApiController]
|
||||
public class OldDeviceGainfosController : ControllerBase
|
||||
{
|
||||
private readonly IOldDeviceGainfoService _oldGainfoService;
|
||||
|
||||
public OldDeviceGainfosController(IOldDeviceGainfoService oldGainfoService)
|
||||
{
|
||||
_oldGainfoService = oldGainfoService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 上传
|
||||
/// </summary>
|
||||
/// <param name="requests"></param>
|
||||
[HttpPost("upload")]
|
||||
public async Task BatchUploadAsync(List<OldDeviceGainfoUploadRequest> requests)
|
||||
{
|
||||
await _oldGainfoService.BatchUploadAsync(requests);
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
using Dlhis.Basic.Organization.Request;
|
||||
using Dlhis.Entity.Basic.Entity;
|
||||
using Kurisu.AspNetCore.DataAccess.SqlSugar.Services;
|
||||
using Mapster;
|
||||
|
||||
namespace Dlhis.Basic.Organization.Services.Implements;
|
||||
|
||||
public class OldGainfoService : IOldDeviceGainfoService
|
||||
{
|
||||
private readonly IDbContext _dbContext;
|
||||
|
||||
public OldGainfoService(IDbContext dbContext)
|
||||
{
|
||||
_dbContext = dbContext;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task BatchUploadAsync(List<OldDeviceGainfoUploadRequest> requests)
|
||||
{
|
||||
var entities = requests.Adapt<List<OldDeviceGainfoEntity>>();
|
||||
|
||||
foreach (var entity in entities)
|
||||
{
|
||||
if (!await _dbContext.Queryable<OldDeviceGainfoEntity>().AnyAsync(x => x.No == entity.No && x.Code == entity.Code && x.DeviceUniqueNo == entity.DeviceUniqueNo))
|
||||
{
|
||||
await _dbContext.InsertAsync(entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user