fix 增加image记录,移除balance负数处理
This commit is contained in:
@@ -5,6 +5,7 @@ using Dlhis.Canteen.Setting.Services;
|
||||
using Dlhis.Entity.Basic.Entity;
|
||||
using Dlhis.Entity.Canteen.Entities;
|
||||
using Dlhis.Entity.Canteen.Enums;
|
||||
using Dlhis.Entity.Device;
|
||||
using Dlhis.Entity.Device.Entities;
|
||||
using Dlhis.Entity.Device.Enums;
|
||||
using Dlhis.Sys.Api;
|
||||
@@ -137,11 +138,13 @@ public class BalanceService : IBalanceService
|
||||
.LeftJoin<GainfoEntity>((record, ga) => record.UserNo == ga.No)
|
||||
.LeftJoin<DepartmentEntity>((record, ga, department) => ga.DepartmentNo == department.No)
|
||||
.LeftJoin<BusinessPlaceEntity>((record, ga, department, bPlace) => record.BusinessPlaceCode == bPlace.Code)
|
||||
.LeftJoin<ImageRecordEntity>((record, ga, department, bPlace, imageRecord) => imageRecord.No == record.No)
|
||||
.WhereIF(request.UserCode.IsPresent(), record => record.UserCode == request.UserCode)
|
||||
.Where(record => record.CostDate >= request.Start && record.CostDate <= request.End)
|
||||
.Where(record => record.DeviceUniqueNo == device.UniqueNo || record.DeviceUniqueNo == device.Code.ToString())
|
||||
.Where(record => record.Type == BalanceRecordTypeEnumType.Out && record.Status == BalanceRecordStatusEnumType.Valid)
|
||||
.OrderBy(record => record.CreateTime, OrderByType.Desc)
|
||||
.Select((record, ga, department, bPlace) => new BalanceRecordDeviceResponse
|
||||
.Select((record, ga, department, bPlace, imageRecord) => new BalanceRecordDeviceResponse
|
||||
{
|
||||
Id = record.Id,
|
||||
Amount = SqlFunc.Abs(record.Amount),
|
||||
@@ -159,6 +162,7 @@ public class BalanceService : IBalanceService
|
||||
ShiftType = record.ShiftType,
|
||||
CostDateTime = record.CostDateTime,
|
||||
TenantId = record.TenantId,
|
||||
Image = imageRecord.Image
|
||||
})
|
||||
.ToPageListAsync(request);
|
||||
|
||||
@@ -225,6 +229,7 @@ public class BalanceService : IBalanceService
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
//ignore
|
||||
}
|
||||
|
||||
|
||||
@@ -631,7 +636,7 @@ public class BalanceService : IBalanceService
|
||||
})
|
||||
.ToListAsync();
|
||||
|
||||
var OnlineDevices = deviceRegistries
|
||||
var onlineDevices = deviceRegistries
|
||||
.Where(x =>
|
||||
{
|
||||
if (x.HeartbeatInterval <= 0)
|
||||
@@ -647,7 +652,7 @@ public class BalanceService : IBalanceService
|
||||
})
|
||||
.ToList();
|
||||
var onlineUniqueNos = new List<string>();
|
||||
OnlineDevices.ForEach(x => onlineUniqueNos.Add(x.UniqueNo));
|
||||
onlineDevices.ForEach(x => onlineUniqueNos.Add(x.UniqueNo));
|
||||
|
||||
var offUniqueNos = deviceUniqueNos.Except(onlineUniqueNos).ToList();
|
||||
var list = devices.Where(x => offUniqueNos.Contains(x.UniqueNo)).ToList();
|
||||
|
||||
Reference in New Issue
Block a user