fix 修改设备对应营业点
This commit is contained in:
@@ -37,7 +37,6 @@ public class DeviceService : IDeviceService
|
||||
FuncsStr = d.Funcs.ToString(),
|
||||
Brand = dt.Brand,
|
||||
Type = d.Type,
|
||||
|
||||
}, true)
|
||||
.ToPageListAsync(request);
|
||||
|
||||
@@ -59,6 +58,37 @@ public class DeviceService : IDeviceService
|
||||
})
|
||||
.ToListAsync();
|
||||
|
||||
var Registries = await _dbContext.Queryable<DeviceRegistryEntity>()
|
||||
.ToListAsync();
|
||||
var BusinessPlaces = await _dbContext.Queryable<BusinessPlaceEntity>()
|
||||
.ToListAsync();
|
||||
|
||||
foreach (var res in page.Data)
|
||||
{
|
||||
var list = new List<PlaceCodeNameDetil>();
|
||||
var regis = Registries.Where(x => x.DeviceUniqueNo == res.UniqueNo).ToList();
|
||||
if (regis!=null && regis.Count>0)
|
||||
{
|
||||
foreach (var re in regis)
|
||||
{
|
||||
var place = BusinessPlaces.Where(x => x.Code == re.BusinessPlaceCode)
|
||||
.FirstOrDefault();
|
||||
|
||||
if (place != null)
|
||||
{
|
||||
var detil = new PlaceCodeNameDetil
|
||||
{
|
||||
BusinessPlaceCode = re.BusinessPlaceCode.ToString(),
|
||||
BusinessPlaceName = place.Name
|
||||
};
|
||||
list.Add(detil);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
res.detils = list;
|
||||
|
||||
}
|
||||
page.Data.ForEach(device =>
|
||||
{
|
||||
device.Amount = balanceRecords.Sum(x => x.Amount);
|
||||
@@ -332,7 +362,7 @@ public class DeviceService : IDeviceService
|
||||
{
|
||||
var page = await _dbContext.Queryable<DeviceEntity>()
|
||||
.LeftJoin<DeviceTemplateEntity>((d, dt) => d.TemplateCode == dt.Code)
|
||||
.Where(d => d.Type == DeviceTypeEnumType.Attendance && d.Enable)
|
||||
.Where(x => x.Type == DeviceTypeEnumType.Attendance || (x.Type == DeviceTypeEnumType.Door && x.AsAttendance))
|
||||
.Select((d, dt) => new DevicePageResponse
|
||||
{
|
||||
FuncsStr = d.Funcs.ToString(),
|
||||
|
||||
Reference in New Issue
Block a user