|
|
|
|
@@ -43,46 +43,46 @@ public class BalanceService : IBalanceService
|
|
|
|
|
public async Task<Pagination<BalanceRecordResponse>> GetPageAsync(BalanceRecordPageRequest request)
|
|
|
|
|
{
|
|
|
|
|
var page = await _dbContext.Queryable<BalanceRecordEntity>()
|
|
|
|
|
.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<CanteenOrderEntity>((record, ga, department, bplace, order) => record.No == order.No)
|
|
|
|
|
.WhereIF(request.SearchDateTimePeriod?.Start.HasValue == true, record => record.CostDate >= request.SearchDateTimePeriod.Start)
|
|
|
|
|
.WhereIF(request.SearchDateTimePeriod?.End.HasValue == true, record => record.CostDate <= request.SearchDateTimePeriod.End)
|
|
|
|
|
.WhereIF(request.ShiftTypes.IsPresent(), record => request.ShiftTypes.Contains(record.ShiftType))
|
|
|
|
|
.WhereIF(request.Type.HasValue, record => record.Type == request.Type)
|
|
|
|
|
.WhereIF(request.Factory.IsPresent(), record => record.TenantId == request.Factory)
|
|
|
|
|
.WhereIF(request.Search.IsPresent(), (record, ga) =>
|
|
|
|
|
ga.Name == request.Search
|
|
|
|
|
.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<CanteenOrderEntity>((record, ga, department, bplace, order) => record.No == order.No)
|
|
|
|
|
.WhereIF(request.SearchDateTimePeriod?.Start.HasValue == true, record => record.CostDate >= request.SearchDateTimePeriod.Start)
|
|
|
|
|
.WhereIF(request.SearchDateTimePeriod?.End.HasValue == true, record => record.CostDate <= request.SearchDateTimePeriod.End)
|
|
|
|
|
.WhereIF(request.ShiftTypes.IsPresent(), record => request.ShiftTypes.Contains(record.ShiftType))
|
|
|
|
|
.WhereIF(request.Type.HasValue, record => record.Type == request.Type)
|
|
|
|
|
.WhereIF(request.Factory.IsPresent(), record => record.TenantId == request.Factory)
|
|
|
|
|
.WhereIF(request.Search.IsPresent(), (record, ga) =>
|
|
|
|
|
ga.Name == request.Search
|
|
|
|
|
|| ga.Code == request.Search
|
|
|
|
|
)
|
|
|
|
|
.OrderBy(record => record.CreateTime, OrderByType.Desc)
|
|
|
|
|
.Select((record, ga, department, bplace, order) => new BalanceRecordResponse
|
|
|
|
|
{
|
|
|
|
|
Id = record.Id,
|
|
|
|
|
No = record.No,
|
|
|
|
|
IsOffline = order.IsOffline,
|
|
|
|
|
Amount = SqlFunc.Abs(record.Amount),
|
|
|
|
|
CostDate = record.CostDate,
|
|
|
|
|
CostId = record.CostId,
|
|
|
|
|
DepartmentNo = record.DepartmentNo,
|
|
|
|
|
DeviceInfo = record.DeviceUniqueNo,
|
|
|
|
|
UserNo = record.UserNo,
|
|
|
|
|
UserCode = record.UserCode,
|
|
|
|
|
Type = record.Type,
|
|
|
|
|
Status = record.Status,
|
|
|
|
|
Source = record.Source,
|
|
|
|
|
OriginTenantId = record.OriginTenantId,
|
|
|
|
|
Name = record.Name,
|
|
|
|
|
DepartmentName = department.Name,
|
|
|
|
|
BusinessPlaceName = bplace.Name,
|
|
|
|
|
CostDateTime = record.CostDateTime,
|
|
|
|
|
Factory = record.TenantId,
|
|
|
|
|
ShiftType = record.ShiftType,
|
|
|
|
|
Remark = record.Remark,
|
|
|
|
|
Werks = ga.Werks
|
|
|
|
|
})
|
|
|
|
|
.ToPageListAsync(request);
|
|
|
|
|
)
|
|
|
|
|
.OrderBy(record => record.CreateTime, OrderByType.Desc)
|
|
|
|
|
.Select((record, ga, department, bplace, order) => new BalanceRecordResponse
|
|
|
|
|
{
|
|
|
|
|
Id = record.Id,
|
|
|
|
|
No = record.No,
|
|
|
|
|
IsOffline = order.IsOffline,
|
|
|
|
|
Amount = SqlFunc.Abs(record.Amount),
|
|
|
|
|
CostDate = record.CostDate,
|
|
|
|
|
CostId = record.CostId,
|
|
|
|
|
DepartmentNo = record.DepartmentNo,
|
|
|
|
|
DeviceInfo = record.DeviceUniqueNo,
|
|
|
|
|
UserNo = record.UserNo,
|
|
|
|
|
UserCode = record.UserCode,
|
|
|
|
|
Type = record.Type,
|
|
|
|
|
Status = record.Status,
|
|
|
|
|
Source = record.Source,
|
|
|
|
|
OriginTenantId = record.OriginTenantId,
|
|
|
|
|
Name = record.Name,
|
|
|
|
|
DepartmentName = department.Name,
|
|
|
|
|
BusinessPlaceName = bplace.Name,
|
|
|
|
|
CostDateTime = record.CostDateTime,
|
|
|
|
|
Factory = record.TenantId,
|
|
|
|
|
ShiftType = record.ShiftType,
|
|
|
|
|
Remark = record.Remark,
|
|
|
|
|
Werks = ga.Werks
|
|
|
|
|
})
|
|
|
|
|
.ToPageListAsync(request);
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
@@ -94,7 +94,6 @@ public class BalanceService : IBalanceService
|
|
|
|
|
item.OriginTenantId = tenants.FirstOrDefault(x => x.Code == item.OriginTenantId)?.Name;
|
|
|
|
|
item.Factory = tenants.FirstOrDefault(x => x.Code == item.Factory)?.Name;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
catch (Exception)
|
|
|
|
|
{
|
|
|
|
|
@@ -129,40 +128,40 @@ public class BalanceService : IBalanceService
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var page = await _dbContext.Queryable<BalanceRecordEntity>()
|
|
|
|
|
.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)
|
|
|
|
|
.Where(record => SqlFunc.DateIsSame(record.CostDate, date, DateType.Day))
|
|
|
|
|
.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
|
|
|
|
|
{
|
|
|
|
|
Id = record.Id,
|
|
|
|
|
Amount = SqlFunc.Abs(record.Amount),
|
|
|
|
|
CostDate = record.CostDate,
|
|
|
|
|
DepartmentNo = record.DepartmentNo,
|
|
|
|
|
UserNo = record.UserNo,
|
|
|
|
|
UserCode = record.UserCode,
|
|
|
|
|
Type = record.Type,
|
|
|
|
|
Status = record.Status,
|
|
|
|
|
Source = record.Source,
|
|
|
|
|
No = record.No,
|
|
|
|
|
Name = record.Name,
|
|
|
|
|
DepartmentName = department.Name,
|
|
|
|
|
BusinessPlaceName = bplace.Name,
|
|
|
|
|
ShiftType = record.ShiftType,
|
|
|
|
|
CostDateTime = record.CostDateTime,
|
|
|
|
|
TenantId = record.TenantId,
|
|
|
|
|
})
|
|
|
|
|
.ToPageListAsync(request);
|
|
|
|
|
.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)
|
|
|
|
|
.Where(record => SqlFunc.DateIsSame(record.CostDate, date, DateType.Day))
|
|
|
|
|
.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
|
|
|
|
|
{
|
|
|
|
|
Id = record.Id,
|
|
|
|
|
Amount = SqlFunc.Abs(record.Amount),
|
|
|
|
|
CostDate = record.CostDate,
|
|
|
|
|
DepartmentNo = record.DepartmentNo,
|
|
|
|
|
UserNo = record.UserNo,
|
|
|
|
|
UserCode = record.UserCode,
|
|
|
|
|
Type = record.Type,
|
|
|
|
|
Status = record.Status,
|
|
|
|
|
Source = record.Source,
|
|
|
|
|
No = record.No,
|
|
|
|
|
Name = record.Name,
|
|
|
|
|
DepartmentName = department.Name,
|
|
|
|
|
BusinessPlaceName = bplace.Name,
|
|
|
|
|
ShiftType = record.ShiftType,
|
|
|
|
|
CostDateTime = record.CostDateTime,
|
|
|
|
|
TenantId = record.TenantId,
|
|
|
|
|
})
|
|
|
|
|
.ToPageListAsync(request);
|
|
|
|
|
|
|
|
|
|
//消费总金额
|
|
|
|
|
var sum = await _dbContext.Queryable<BalanceRecordEntity>()
|
|
|
|
|
.Where(record => SqlFunc.DateIsSame(record.CostDate, date, DateType.Day))
|
|
|
|
|
.Where(record => record.DeviceUniqueNo == device.UniqueNo || record.DeviceUniqueNo == device.Code.ToString())
|
|
|
|
|
.Where(record => record.Type == BalanceRecordTypeEnumType.Out && record.Status == BalanceRecordStatusEnumType.Valid)
|
|
|
|
|
.SumAsync(record => SqlFunc.Abs(SqlFunc.IsNull(record.Amount, 0)));
|
|
|
|
|
.Where(record => SqlFunc.DateIsSame(record.CostDate, date, DateType.Day))
|
|
|
|
|
.Where(record => record.DeviceUniqueNo == device.UniqueNo || record.DeviceUniqueNo == device.Code.ToString())
|
|
|
|
|
.Where(record => record.Type == BalanceRecordTypeEnumType.Out && record.Status == BalanceRecordStatusEnumType.Valid)
|
|
|
|
|
.SumAsync(record => SqlFunc.Abs(SqlFunc.IsNull(record.Amount, 0)));
|
|
|
|
|
|
|
|
|
|
page.Data.ForEach(x => x.Sum = sum);
|
|
|
|
|
|
|
|
|
|
@@ -216,10 +215,7 @@ public class BalanceService : IBalanceService
|
|
|
|
|
var tenantResult = await _tenantApi.GetTenantsInternalAsync();
|
|
|
|
|
var tenants = tenantResult.Data;
|
|
|
|
|
|
|
|
|
|
page.Data.ForEach(item =>
|
|
|
|
|
{
|
|
|
|
|
item.Factory = tenants.FirstOrDefault(x => x.Code == item.Factory)?.Name;
|
|
|
|
|
});
|
|
|
|
|
page.Data.ForEach(item => { item.Factory = tenants.FirstOrDefault(x => x.Code == item.Factory)?.Name; });
|
|
|
|
|
}
|
|
|
|
|
catch (Exception)
|
|
|
|
|
{
|
|
|
|
|
@@ -242,7 +238,7 @@ public class BalanceService : IBalanceService
|
|
|
|
|
{
|
|
|
|
|
var balanceInfo = await _dbContext.Queryable<BalanceRecordEntity>().Where(x => x.No == request.No).SingleAsync();
|
|
|
|
|
balanceInfo.ThrowIfNull("明细数据不存在");
|
|
|
|
|
(balanceInfo.Status != BalanceRecordStatusEnumType.Valid && balanceInfo.Type != BalanceRecordTypeEnumType.Out).ThrowIfTrue("消费明细状态有误");
|
|
|
|
|
(balanceInfo.Status != BalanceRecordStatusEnumType.Valid || balanceInfo.Type != BalanceRecordTypeEnumType.Out).ThrowIfTrue("消费明细状态有误");
|
|
|
|
|
|
|
|
|
|
balanceInfo.Status = BalanceRecordStatusEnumType.Obsolute;
|
|
|
|
|
balanceInfo.Remark += request.Reason;
|
|
|
|
|
@@ -278,11 +274,11 @@ public class BalanceService : IBalanceService
|
|
|
|
|
var balance = gainfoMeal.Balance + Math.Abs(balanceInfo.Amount) + request.Amount;
|
|
|
|
|
|
|
|
|
|
await _dbContext.Updateable<GainfoMealEntity>()
|
|
|
|
|
.SetColumns(x => x.Balance == balance)
|
|
|
|
|
.SetColumns(x => x.Version == x.Version + 1)
|
|
|
|
|
.SetColumns(x => x.ModifiedTime == DateTime.Now)
|
|
|
|
|
.Where(x => x.UserCode == balanceInfo.UserCode && x.Version == gainfoMeal.Version)
|
|
|
|
|
.ExecuteCommandThrowVersionAsync();
|
|
|
|
|
.SetColumns(x => x.Balance == balance)
|
|
|
|
|
.SetColumns(x => x.Version == x.Version + 1)
|
|
|
|
|
.SetColumns(x => x.ModifiedTime == DateTime.Now)
|
|
|
|
|
.Where(x => x.UserCode == balanceInfo.UserCode && x.Version == gainfoMeal.Version)
|
|
|
|
|
.ExecuteCommandThrowVersionAsync();
|
|
|
|
|
}, 10);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -291,28 +287,28 @@ public class BalanceService : IBalanceService
|
|
|
|
|
var jinkoCode = _currentUser.GetUserClaim("jinko-code") ?? string.Empty;
|
|
|
|
|
|
|
|
|
|
var page = await _dbContext.Queryable<BalanceRecordEntity>()
|
|
|
|
|
.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)
|
|
|
|
|
.Where(record => record.Type == BalanceRecordTypeEnumType.Out)
|
|
|
|
|
.Where(record => record.Status == BalanceRecordStatusEnumType.Valid)
|
|
|
|
|
.WhereIF(request.SearchDateTimePeriod?.Start.HasValue == true, record => record.CostDate >= request.SearchDateTimePeriod.Start)
|
|
|
|
|
.WhereIF(request.SearchDateTimePeriod?.End.HasValue == true, record => record.CostDate <= request.SearchDateTimePeriod.End)
|
|
|
|
|
.WhereIF(request.ApplicationType.HasValue, record => record.ApplicationType == request.ApplicationType)
|
|
|
|
|
.Where((record, ga) => ga.Code == jinkoCode)
|
|
|
|
|
.OrderBy(record => record.CreateTime, OrderByType.Desc)
|
|
|
|
|
.Select((record, ga, department, bplace) => new BalanceRecordUserPageResponse
|
|
|
|
|
{
|
|
|
|
|
Id = record.Id,
|
|
|
|
|
CurrentAmount = SqlFunc.Abs(record.Amount),
|
|
|
|
|
Source = record.Source,
|
|
|
|
|
No = record.No,
|
|
|
|
|
BusinessPlaceName = bplace.Name,
|
|
|
|
|
ShiftType = record.ShiftType,
|
|
|
|
|
CostDateTime = record.CostDateTime,
|
|
|
|
|
ApplicationType = record.ApplicationType,
|
|
|
|
|
})
|
|
|
|
|
.ToPageListAsync(request);
|
|
|
|
|
.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)
|
|
|
|
|
.Where(record => record.Type == BalanceRecordTypeEnumType.Out)
|
|
|
|
|
.Where(record => record.Status == BalanceRecordStatusEnumType.Valid)
|
|
|
|
|
.WhereIF(request.SearchDateTimePeriod?.Start.HasValue == true, record => record.CostDate >= request.SearchDateTimePeriod.Start)
|
|
|
|
|
.WhereIF(request.SearchDateTimePeriod?.End.HasValue == true, record => record.CostDate <= request.SearchDateTimePeriod.End)
|
|
|
|
|
.WhereIF(request.ApplicationType.HasValue, record => record.ApplicationType == request.ApplicationType)
|
|
|
|
|
.Where((record, ga) => ga.Code == jinkoCode)
|
|
|
|
|
.OrderBy(record => record.CreateTime, OrderByType.Desc)
|
|
|
|
|
.Select((record, ga, department, bplace) => new BalanceRecordUserPageResponse
|
|
|
|
|
{
|
|
|
|
|
Id = record.Id,
|
|
|
|
|
CurrentAmount = SqlFunc.Abs(record.Amount),
|
|
|
|
|
Source = record.Source,
|
|
|
|
|
No = record.No,
|
|
|
|
|
BusinessPlaceName = bplace.Name,
|
|
|
|
|
ShiftType = record.ShiftType,
|
|
|
|
|
CostDateTime = record.CostDateTime,
|
|
|
|
|
ApplicationType = record.ApplicationType,
|
|
|
|
|
})
|
|
|
|
|
.ToPageListAsync(request);
|
|
|
|
|
|
|
|
|
|
var now = DateTime.Now;
|
|
|
|
|
var monthStart = new DateTime(now.Year, now.Month, 1);
|
|
|
|
|
@@ -371,7 +367,6 @@ public class BalanceService : IBalanceService
|
|
|
|
|
Months = months
|
|
|
|
|
};
|
|
|
|
|
return res;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
@@ -466,8 +461,8 @@ public class BalanceService : IBalanceService
|
|
|
|
|
{
|
|
|
|
|
//消费机离线设备
|
|
|
|
|
var devices = await _dbContext.Queryable<DeviceEntity>()
|
|
|
|
|
.Where(x => x.Type == DeviceTypeEnumType.Meal)
|
|
|
|
|
.ToListAsync();
|
|
|
|
|
.Where(x => x.Type == DeviceTypeEnumType.Meal)
|
|
|
|
|
.ToListAsync();
|
|
|
|
|
|
|
|
|
|
var offs = await GetOfflineDevicesCount(devices);
|
|
|
|
|
var offUniqueNos = offs.Select(x => x.UniqueNo).ToList();
|
|
|
|
|
@@ -480,23 +475,22 @@ public class BalanceService : IBalanceService
|
|
|
|
|
FuncsStr = d.Funcs.ToString(),
|
|
|
|
|
Brand = dt.Brand,
|
|
|
|
|
Type = d.Type,
|
|
|
|
|
|
|
|
|
|
}, true)
|
|
|
|
|
.ToPageListAsync(request);
|
|
|
|
|
return offpage;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//消费机总数
|
|
|
|
|
var page = await _dbContext.Queryable<DeviceEntity>()
|
|
|
|
|
.LeftJoin<DeviceTemplateEntity>((d, dt) => d.TemplateCode == dt.Code)
|
|
|
|
|
.Where(d => d.Type == DeviceTypeEnumType.Meal)
|
|
|
|
|
.Select((d, dt) => new DevicePageResponse
|
|
|
|
|
{
|
|
|
|
|
FuncsStr = d.Funcs.ToString(),
|
|
|
|
|
Brand = dt.Brand,
|
|
|
|
|
Type = d.Type,
|
|
|
|
|
|
|
|
|
|
}, true)
|
|
|
|
|
.ToPageListAsync(request);
|
|
|
|
|
.LeftJoin<DeviceTemplateEntity>((d, dt) => d.TemplateCode == dt.Code)
|
|
|
|
|
.Where(d => d.Type == DeviceTypeEnumType.Meal)
|
|
|
|
|
.Select((d, dt) => new DevicePageResponse
|
|
|
|
|
{
|
|
|
|
|
FuncsStr = d.Funcs.ToString(),
|
|
|
|
|
Brand = dt.Brand,
|
|
|
|
|
Type = d.Type,
|
|
|
|
|
}, true)
|
|
|
|
|
.ToPageListAsync(request);
|
|
|
|
|
return page;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -524,21 +518,20 @@ public class BalanceService : IBalanceService
|
|
|
|
|
.ToListAsync();
|
|
|
|
|
|
|
|
|
|
var OnlineDevices = deviceRegistries
|
|
|
|
|
.Where(x =>
|
|
|
|
|
.Where(x =>
|
|
|
|
|
{
|
|
|
|
|
if (x.HeartbeatInterval <= 0)
|
|
|
|
|
{
|
|
|
|
|
if (x.HeartbeatInterval <= 0)
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return x.LastHeartbeatTime.AddSeconds(x.HeartbeatInterval * 3) >= now;
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
.Select(x => new
|
|
|
|
|
{
|
|
|
|
|
x.UniqueNo,
|
|
|
|
|
})
|
|
|
|
|
.ToList();
|
|
|
|
|
return x.LastHeartbeatTime.AddSeconds(x.HeartbeatInterval * 3) >= now;
|
|
|
|
|
})
|
|
|
|
|
.Select(x => new
|
|
|
|
|
{
|
|
|
|
|
x.UniqueNo,
|
|
|
|
|
})
|
|
|
|
|
.ToList();
|
|
|
|
|
var onlineUniqueNos = new List<string>();
|
|
|
|
|
OnlineDevices.ForEach(x => onlineUniqueNos.Add(x.UniqueNo));
|
|
|
|
|
|
|
|
|
|
@@ -583,7 +576,7 @@ public class BalanceService : IBalanceService
|
|
|
|
|
foreach (var day in days)
|
|
|
|
|
{
|
|
|
|
|
var currentAmount = Math.Round(Math.Abs(bs.Where(x => x.CostDateTime.ToString("yyyy-MM-dd") == day)
|
|
|
|
|
.Sum(x => x.Amount)), 2);
|
|
|
|
|
.Sum(x => x.Amount)), 2);
|
|
|
|
|
|
|
|
|
|
var res = new ConsumptionTrendResponse
|
|
|
|
|
{
|
|
|
|
|
@@ -594,6 +587,7 @@ public class BalanceService : IBalanceService
|
|
|
|
|
list.Add(res);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return list;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -612,6 +606,7 @@ public class BalanceService : IBalanceService
|
|
|
|
|
var monthDate = new DateTime(year, month, 1);
|
|
|
|
|
months.Add(monthDate.ToString("yyyy-MM"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return months;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -639,4 +634,4 @@ public class BalanceService : IBalanceService
|
|
|
|
|
|
|
|
|
|
return days;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|