fix 修正语法错误

This commit is contained in:
cheche
2024-03-06 14:05:36 +08:00
parent 41d4807cca
commit 11690623a4
3 changed files with 4 additions and 3 deletions

View File

@@ -1,6 +1,7 @@
using Dlhis.Basic.Device.Request; using Dlhis.Basic.Device.Request;
using Dlhis.Basic.Device.Response; using Dlhis.Basic.Device.Response;
using Kurisu.Core.DataAccess.Dto; using Kurisu.Core.DataAccess.Dto;
using Microsoft.AspNetCore.Mvc;
namespace Dlhis.Basic.Device.Services; namespace Dlhis.Basic.Device.Services;

View File

@@ -11,6 +11,7 @@ using Kurisu.Core.DataAccess.Dto;
using Kurisu.SqlSugar.Extensions; using Kurisu.SqlSugar.Extensions;
using Kurisu.SqlSugar.Services; using Kurisu.SqlSugar.Services;
using Mapster; using Mapster;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using SqlSugar; using SqlSugar;
@@ -311,7 +312,7 @@ public class DeviceService : IDeviceService
{ {
var page = await _dbContext.Queryable<DeviceEntity>() var page = await _dbContext.Queryable<DeviceEntity>()
.LeftJoin<DeviceTemplateEntity>((d, dt) => d.TemplateCode == dt.Code) .LeftJoin<DeviceTemplateEntity>((d, dt) => d.TemplateCode == dt.Code)
.Where(x => x.Type == DeviceTypeEnumType.Attendance || (x.Type == DeviceTypeEnumType.Door && x.AsAttendance)) .Where(d => d.Type == DeviceTypeEnumType.Attendance || (d.Type == DeviceTypeEnumType.Door && d.AsAttendance))
.Select((d, dt) => new DevicePageResponse .Select((d, dt) => new DevicePageResponse
{ {
FuncsStr = d.Funcs.ToString(), FuncsStr = d.Funcs.ToString(),
@@ -397,6 +398,5 @@ public class DeviceService : IDeviceService
return list; return list;
} }
} }

View File

@@ -746,7 +746,7 @@ public class BalanceService : IBalanceService
foreach (var no in request.UniqueNos) foreach (var no in request.UniqueNos)
{ {
var device = devices.Where(x => x.UniqueNo == no).First(); var device = devices.Where(x => x.UniqueNo == no).First();
device.ThrowIfNull("设备不存在"); device.ThrowIfNull($"{no}:设备不存在");
} }
var regiss = await _dbContext.Queryable<DeviceRegistryEntity>() var regiss = await _dbContext.Queryable<DeviceRegistryEntity>()
.Where(x => request.UniqueNos.Contains(x.DeviceUniqueNo)) .Where(x => request.UniqueNos.Contains(x.DeviceUniqueNo))