新的问题修改
This commit is contained in:
parent
8ea5ba3123
commit
3df91527d8
|
|
@ -12,6 +12,6 @@ namespace Waste.Application
|
|||
{
|
||||
public static string CDNURL = App.Configuration["CDNURL"];
|
||||
|
||||
public static OperatorModel currentUser = OperatorProvider.Provider.GetCurrent();
|
||||
public OperatorModel currentUser = OperatorProvider.Provider.GetCurrent();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -75,11 +75,11 @@ namespace Waste.Application
|
|||
public async Task<List<W_Business>> GetAllList(int status = -1)
|
||||
{
|
||||
var tempquery = dbClient.Queryable<W_Business>();
|
||||
if(status >= 0)
|
||||
if (status >= 0)
|
||||
{
|
||||
tempquery = tempquery.Where(x => x.Status == status);
|
||||
}
|
||||
if(currentUser.AccountType != (int)AccountType.platform)
|
||||
if (currentUser.AccountType != (int)AccountType.platform)
|
||||
{
|
||||
tempquery = tempquery.Where(x => x.ParentId == currentUser.BusinessId || x.Id == currentUser.BusinessId);
|
||||
}
|
||||
|
|
@ -124,30 +124,34 @@ namespace Waste.Application
|
|||
{
|
||||
temquery = temquery.Where(x => SqlFunc.Subqueryable<W_Account>().Where(e => e.AccountType == 1 && e.BusinessId == x.Id).Any());
|
||||
}
|
||||
//针对非平台类型,则可以查看下面所有的子账户设备
|
||||
if (currentUser.AccountType != (int)AccountType.platform)
|
||||
{
|
||||
temquery = temquery.Where(x => x.ParentId == currentUser.BusinessId);
|
||||
var sql = $" code !={currentUser.BusinessCode} and code like '{currentUser.BusinessCode}'+'%' and id = x.id";
|
||||
temquery = temquery.Where(x => SqlFunc.Subqueryable<W_Business>().Where(sql).Any());
|
||||
}
|
||||
string sorts = string.Format("{0} {1}", param.sort, param.order);
|
||||
var query = await temquery.OrderBy(sorts)
|
||||
.Select(x=>new BusinessList {
|
||||
Id=x.Id,
|
||||
Address=x.Address,
|
||||
CreateTime=x.CreateTime,
|
||||
Status=x.Status,
|
||||
Name=x.Name,
|
||||
Phone=x.Phone
|
||||
.Select(x => new BusinessList
|
||||
{
|
||||
Id = x.Id,
|
||||
Address = x.Address,
|
||||
CreateTime = x.CreateTime,
|
||||
Status = x.Status,
|
||||
Name = x.Name,
|
||||
Phone = x.Phone
|
||||
})
|
||||
.Mapper((it, cache) =>
|
||||
{
|
||||
if (!noadmin)
|
||||
{
|
||||
var allrealdata = cache.Get(list => {
|
||||
var allrealdata = cache.Get(list =>
|
||||
{
|
||||
var ids = list.Select(x => x.Id).ToList();
|
||||
return repository.Change<W_BusinessRealData>().Context.Queryable<W_BusinessRealData>().Where(x => ids.Contains(x.BusinessId)).ToList();
|
||||
});
|
||||
var realdata = allrealdata.FirstOrDefault(x => x.BusinessId == it.Id);
|
||||
if(realdata != null)
|
||||
if (realdata != null)
|
||||
{
|
||||
it.BusinessCnt = realdata.BusinessCnt;
|
||||
it.DevCnt = realdata.DevCnt;
|
||||
|
|
@ -247,7 +251,7 @@ namespace Waste.Application
|
|||
buss.AccountType = (int)AccountType.agent;
|
||||
}
|
||||
Guid roleid = Guid.Parse("39FC70AA-652F-CE76-98A8-5C32D6E5D619");
|
||||
if (currentUser.AccountType == (int)AccountType.platform)
|
||||
if (buss.AccountType == (int)AccountType.platform)
|
||||
{
|
||||
roleid = Guid.Parse("39FC70AA-1CDA-B9CD-5275-3D144841BEDD");
|
||||
}
|
||||
|
|
@ -506,7 +510,7 @@ namespace Waste.Application
|
|||
{
|
||||
if (currentUser.AccountType != (int)AccountType.platform)
|
||||
{
|
||||
var data = await repository.Change<W_BusinessRealData>().Context.Queryable<W_BusinessRealData>().FirstAsync();
|
||||
var data = await repository.Change<W_BusinessRealData>().Context.Queryable<W_BusinessRealData>().FirstAsync(x => x.BusinessId == currentUser.BusinessId);
|
||||
if (data == null)
|
||||
return null;
|
||||
return new W_RealData
|
||||
|
|
@ -528,5 +532,48 @@ namespace Waste.Application
|
|||
return data;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取商户的昨天汇总信息
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<BusinessReport> GetBusinessTotalInfo()
|
||||
{
|
||||
DateTime yestodaytime = DateTime.Now.AddDays(-1);
|
||||
if (currentUser.AccountType != (int)AccountType.platform)
|
||||
{
|
||||
string basesql = $"code like '{currentUser.BusinessCode}'+'%' and id = x.id";
|
||||
string sql = $" code !={currentUser.BusinessCode} and {basesql}";
|
||||
string devicesql = $"code like '{currentUser.BusinessCode}'+'%' and id = x.businessid";
|
||||
int businesscnt = await dbClient.Queryable<W_Business>().Where(x => SqlFunc.Subqueryable<W_Business>().Where(sql).Any()).CountAsync();
|
||||
int devcnt = await repository.Change<W_Device>().Context.Queryable<W_Device>().Where(x => SqlFunc.Subqueryable<W_Business>().Where(devicesql).Any()).CountAsync();
|
||||
var tempquery = repository.Change<W_DeviceStatistics>().Context.Queryable<W_DeviceStatistics>().Where(x => SqlFunc.DateIsSame(x.CreateTime, yestodaytime) && SqlFunc.Subqueryable<W_Business>().Where(devicesql).Any());
|
||||
int count = await tempquery.Clone().SumAsync(x => x.DayCount);
|
||||
decimal weight = await tempquery.Clone().SumAsync(x => x.DayWeight);
|
||||
decimal pureweight = await tempquery.Clone().SumAsync(x => x.DayPureWeight);
|
||||
return new BusinessReport
|
||||
{
|
||||
BusinessCnt = businesscnt,
|
||||
DevCount = devcnt,
|
||||
YestodayCount = count,
|
||||
YestodayPureWeight = pureweight,
|
||||
YestodayWeight = weight
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
var tempquery = repository.Change<W_DeviceStatistics>().Where(x => SqlFunc.DateIsSame(x.CreateTime, yestodaytime));
|
||||
int count = await tempquery.Clone().SumAsync(x => x.DayCount);
|
||||
decimal weight = await tempquery.Clone().SumAsync(x => x.DayWeight);
|
||||
decimal pureweight = await tempquery.Clone().SumAsync(x => x.DayPureWeight);
|
||||
var data = await repository.Change<W_RealData>().Context.Queryable<W_RealData>().FirstAsync();
|
||||
return new BusinessReport {
|
||||
DevCount = data.DevCnt,
|
||||
BusinessCnt = data.BusinessCnt,
|
||||
YestodayCount = count,
|
||||
YestodayPureWeight = pureweight,
|
||||
YestodayWeight = weight
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,4 +78,30 @@ namespace Waste.Application
|
|||
/// </summary>
|
||||
public decimal TotalPureWeight { get; set; } = 0;
|
||||
}
|
||||
/// <summary>
|
||||
/// 商户汇总信息
|
||||
/// </summary>
|
||||
public class BusinessReport
|
||||
{
|
||||
/// <summary>
|
||||
/// 名下商户数量,包含所有级
|
||||
/// </summary>
|
||||
public int BusinessCnt { get; set; } = 0;
|
||||
/// <summary>
|
||||
/// 名下设备数量,包含所有级
|
||||
/// </summary>
|
||||
public int DevCount { get; set; } = 0;
|
||||
/// <summary>
|
||||
/// 昨日测量次数
|
||||
/// </summary>
|
||||
public int YestodayCount { get; set; } = 0;
|
||||
/// <summary>
|
||||
/// 昨日测量毛重
|
||||
/// </summary>
|
||||
public decimal YestodayWeight { get; set; } = 0;
|
||||
/// <summary>
|
||||
/// 昨日测量净重
|
||||
/// </summary>
|
||||
public decimal YestodayPureWeight { get; set; } = 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,5 +50,10 @@ namespace Waste.Application
|
|||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<W_RealData> GetTotalInfoAsync();
|
||||
/// <summary>
|
||||
/// 获取商户的昨天汇总信息
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<BusinessReport> GetBusinessTotalInfo();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -149,9 +149,11 @@ namespace Waste.Application.Device
|
|||
temquery = temquery.Where(conModels);
|
||||
}
|
||||
}
|
||||
//针对非平台类型,则可以查看下面所有的子账户设备
|
||||
if (currentUser.AccountType != (int)AccountType.platform)
|
||||
{
|
||||
temquery = temquery.Where(x => x.Businessid == currentUser.BusinessId);
|
||||
var sql = $"code like '{currentUser.BusinessCode}'+'%' and id = x.businessid";
|
||||
temquery = temquery.Where(x => SqlFunc.Subqueryable<W_Business>().Where(sql).Any());
|
||||
}
|
||||
string sorts = string.Format("{0} {1}", param.sort, param.order);
|
||||
var query = await temquery.OrderBy(sorts)
|
||||
|
|
@ -275,6 +277,8 @@ namespace Waste.Application.Device
|
|||
//更新平台信息
|
||||
var tdbclient = repository.Change<W_SZDevice>().Context;
|
||||
if (!await tdbclient.Queryable<W_SZDevice>().AnyAsync(x => x.DeviceId == role.Id))
|
||||
{
|
||||
if(!string.IsNullOrEmpty(role.Secret) && !string.IsNullOrEmpty(role.SecretHash) && !string.IsNullOrEmpty(role.DevId))
|
||||
{
|
||||
await tdbclient.Insertable<W_SZDevice>(new W_SZDevice
|
||||
{
|
||||
|
|
@ -284,6 +288,7 @@ namespace Waste.Application.Device
|
|||
DevId = role.DevId
|
||||
}).ExecuteCommandAsync();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
await tdbclient.Updateable<W_SZDevice>().SetColumns(x => new W_SZDevice
|
||||
|
|
@ -332,6 +337,8 @@ namespace Waste.Application.Device
|
|||
Tare = role.Tare
|
||||
}).ExecuteCommandAsync();
|
||||
//更新平台信息
|
||||
if (!string.IsNullOrEmpty(role.Secret) && !string.IsNullOrEmpty(role.SecretHash) && !string.IsNullOrEmpty(role.DevId))
|
||||
{
|
||||
var tdbclient = repository.Change<W_SZDevice>().Context;
|
||||
await tdbclient.Insertable<W_SZDevice>(new W_SZDevice
|
||||
{
|
||||
|
|
@ -340,7 +347,7 @@ namespace Waste.Application.Device
|
|||
SecretHash = role.SecretHash,
|
||||
DevId = role.DevId
|
||||
}).ExecuteCommandAsync();
|
||||
|
||||
}
|
||||
await _businessService.InsertOrUpdateRealDataAsync();
|
||||
return new ResultInfo() { code = ResultState.SUCCESS, message = "添加成功!" };
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,5 +24,19 @@ namespace Waste.Application
|
|||
/// 设备编号
|
||||
/// </summary>
|
||||
public string DevCode { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 合计测量次数
|
||||
/// </summary>
|
||||
public int TotalDayCount { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 合计测量净重
|
||||
/// </summary>
|
||||
public decimal TotalDayPureWeight { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 合计测量重量
|
||||
/// </summary>
|
||||
public decimal TotalDayWeight { get; set; } = 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,5 +18,11 @@ namespace Waste.Application
|
|||
/// <param name="param"></param>
|
||||
/// <returns></returns>
|
||||
Task<PageParms<ReportList>> GetListAsync(QueryParams param);
|
||||
/// <summary>
|
||||
/// 根据商户和垃圾类型进行汇总
|
||||
/// </summary>
|
||||
/// <param name="param"></param>
|
||||
/// <returns></returns>
|
||||
Task<PageParms<ReportList>> GetListByBusinessAsync(QueryParams param);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,5 +29,16 @@ namespace Waste.Application.ReportInfo
|
|||
{
|
||||
return await _reportService.GetListAsync(param);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据商户和垃圾类型进行汇总
|
||||
/// </summary>
|
||||
/// <param name="param"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<PageParms<ReportList>> GetListByBusinessAsync(QueryParams param)
|
||||
{
|
||||
return await _reportService.GetListByBusinessAsync(param);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,10 +60,15 @@ namespace Waste.Application
|
|||
temquery = temquery.Where(conModels);
|
||||
}
|
||||
}
|
||||
//针对非平台类型,则可以查看下面所有的子账户设备
|
||||
if (currentUser.AccountType != (int)AccountType.platform)
|
||||
{
|
||||
temquery = temquery.Where(x => x.Businessid == currentUser.BusinessId);
|
||||
var sql = $"code like '{currentUser.BusinessCode}'+'%' and id = x.businessid";
|
||||
temquery = temquery.Where(x => SqlFunc.Subqueryable<W_Business>().Where(sql).Any());
|
||||
}
|
||||
int totaldaycount = await temquery.Clone().SumAsync(x => x.DayCount);
|
||||
decimal totaldaypureweight = await temquery.Clone().SumAsync(x => x.DayPureWeight);
|
||||
decimal totaldayweight = await temquery.Clone().SumAsync(x => x.DayWeight);
|
||||
string sorts = string.Format("{0} {1}", param.sort, param.order);
|
||||
var query = await temquery.OrderBy(sorts)
|
||||
.Select(x => new ReportList
|
||||
|
|
@ -94,6 +99,81 @@ namespace Waste.Application
|
|||
var dev = alldev.FirstOrDefault(x => x.Id == it.DevId);
|
||||
it.DevName = dev != null ? dev.Name : "";
|
||||
it.DevCode = dev != null ? dev.Ecode : "";
|
||||
it.TotalDayCount = totaldaycount;
|
||||
it.TotalDayPureWeight = totaldaypureweight;
|
||||
it.TotalDayWeight = totaldayweight;
|
||||
})
|
||||
.ToPageListAsync(param.offset, param.limit, totalnum);
|
||||
return new PageParms<ReportList>
|
||||
{
|
||||
page = param.offset,
|
||||
Items = query,
|
||||
totalnum = totalnum,
|
||||
limit = param.limit
|
||||
};
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据商户和垃圾类型进行汇总
|
||||
/// </summary>
|
||||
/// <param name="param"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<PageParms<ReportList>> GetListByBusinessAsync(QueryParams param)
|
||||
{
|
||||
RefAsync<int> totalnum = 0;
|
||||
var temquery = repository.Change<W_BusinessStatistics>().Context.Queryable<W_BusinessStatistics>();
|
||||
if (param.queryParam != null && param.queryParam.Count > 0)
|
||||
{
|
||||
List<IConditionalModel> conModels = new List<IConditionalModel>();
|
||||
param.queryParam.ForEach(x =>
|
||||
{
|
||||
x.Value = x.Value.ToStr();
|
||||
if (!string.IsNullOrEmpty(x.Value))
|
||||
{
|
||||
conModels.Add(new ConditionalModel()
|
||||
{
|
||||
FieldName = x.Name,
|
||||
ConditionalType = (ConditionalType)x.Type,
|
||||
FieldValue = x.Value.Trim()
|
||||
});
|
||||
}
|
||||
});
|
||||
if (conModels.Count > 0)
|
||||
{
|
||||
temquery = temquery.Where(conModels);
|
||||
}
|
||||
}
|
||||
//针对非平台类型,则可以查看下面所有的子账户设备
|
||||
if (currentUser.AccountType != (int)AccountType.platform)
|
||||
{
|
||||
var sql = $"code like '{currentUser.BusinessCode}'+'%' and id = x.businessid";
|
||||
temquery = temquery.Where(x => SqlFunc.Subqueryable<W_Business>().Where(sql).Any());
|
||||
}
|
||||
int totaldaycount = await temquery.Clone().SumAsync(x => x.DayCount);
|
||||
decimal totaldaypureweight = await temquery.Clone().SumAsync(x => x.DayPureWeight);
|
||||
decimal totaldayweight = await temquery.Clone().SumAsync(x => x.DayWeight);
|
||||
string sorts = string.Format("{0} {1}", param.sort, param.order);
|
||||
var query = await temquery.Clone().OrderBy(sorts)
|
||||
.Select(x => new ReportList
|
||||
{
|
||||
Businessid = x.BusinessId,
|
||||
CreateTime = x.CreateTime,
|
||||
DayCount = x.DayCount,
|
||||
DayPureWeight = x.DayPureWeight,
|
||||
DayWeight = x.DayWeight,
|
||||
WasteType = x.WasteType
|
||||
})
|
||||
.Mapper((it, cache) =>
|
||||
{
|
||||
var allbus = cache.Get(list =>
|
||||
{
|
||||
var ids = list.Where(x => x.Businessid != Guid.Empty).Select(x => x.Businessid).ToList();
|
||||
return repository.Change<W_Business>().Context.Queryable<W_Business>().Where(e => ids.Contains(e.Id)).ToList();
|
||||
});
|
||||
var bus = allbus.FirstOrDefault(x => x.Id == it.Businessid);
|
||||
it.BusinessName = bus != null ? bus.Name : "";
|
||||
it.TotalDayCount = totaldaycount;
|
||||
it.TotalDayPureWeight = totaldaypureweight;
|
||||
it.TotalDayWeight = totaldayweight;
|
||||
})
|
||||
.ToPageListAsync(param.offset, param.limit, totalnum);
|
||||
return new PageParms<ReportList>
|
||||
|
|
|
|||
|
|
@ -69,9 +69,11 @@ namespace Waste.Application
|
|||
temquery = temquery.Where(conModels);
|
||||
}
|
||||
}
|
||||
//针对非平台类型,则可以查看下面所有的子账户设备
|
||||
if (currentUser.AccountType != (int)AccountType.platform)
|
||||
{
|
||||
temquery = temquery.Where(x => x.BusinessId == currentUser.BusinessId);
|
||||
var sql = $"code like '{currentUser.BusinessCode}'+'%' and id = x.businessid";
|
||||
temquery = temquery.Where(x => SqlFunc.Subqueryable<W_Business>().Where(sql).Any());
|
||||
}
|
||||
string sorts = string.Format("{0} {1}", param.sort, param.order);
|
||||
var query = await temquery.OrderBy(sorts)
|
||||
|
|
@ -183,7 +185,9 @@ namespace Waste.Application
|
|||
if (myPackage.IsWeight && myPackage.Weight.ToDecimal() >0)
|
||||
{
|
||||
var devicesecret = await repository.Change<W_SZDevice>().Context.Queryable<W_SZDevice>().FirstAsync(x => x.DeviceId == device.Id);
|
||||
if (devicesecret != null)
|
||||
if (devicesecret != null && !string.IsNullOrEmpty(devicesecret.Secret)
|
||||
&& !string.IsNullOrEmpty(devicesecret.SecretHash)
|
||||
&& !string.IsNullOrEmpty(devicesecret.DevId))
|
||||
{
|
||||
int timestamp = GetTimestamp(time);
|
||||
await _suZhouService.PostGarbagesAsync(new GarbagePltC2SDto
|
||||
|
|
|
|||
|
|
@ -248,6 +248,12 @@
|
|||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Waste.Application.BusinessService.GetBusinessTotalInfo">
|
||||
<summary>
|
||||
获取商户的昨天汇总信息
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="P:Waste.Application.BusinessInfo.Password">
|
||||
<summary>
|
||||
密码
|
||||
|
|
@ -328,6 +334,36 @@
|
|||
累计净重
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Waste.Application.BusinessReport">
|
||||
<summary>
|
||||
商户汇总信息
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.BusinessReport.BusinessCnt">
|
||||
<summary>
|
||||
名下商户数量,包含所有级
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.BusinessReport.DevCount">
|
||||
<summary>
|
||||
名下设备数量,包含所有级
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.BusinessReport.YestodayCount">
|
||||
<summary>
|
||||
昨日测量次数
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.BusinessReport.YestodayWeight">
|
||||
<summary>
|
||||
昨日测量毛重
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.BusinessReport.YestodayPureWeight">
|
||||
<summary>
|
||||
昨日测量净重
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Waste.Application.IBusinessService.ResetPwdAsync(System.Guid,System.String)">
|
||||
<summary>
|
||||
重置密码
|
||||
|
|
@ -367,6 +403,12 @@
|
|||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Waste.Application.IBusinessService.GetBusinessTotalInfo">
|
||||
<summary>
|
||||
获取商户的昨天汇总信息
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:Waste.Application.DeviceAppService">
|
||||
<summary>
|
||||
设备接口
|
||||
|
|
@ -1058,6 +1100,21 @@
|
|||
设备编号
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.ReportList.TotalDayCount">
|
||||
<summary>
|
||||
合计测量次数
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.ReportList.TotalDayPureWeight">
|
||||
<summary>
|
||||
合计测量净重
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.ReportList.TotalDayWeight">
|
||||
<summary>
|
||||
合计测量重量
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Waste.Application.IReportService">
|
||||
<summary>
|
||||
统计信息
|
||||
|
|
@ -1070,6 +1127,13 @@
|
|||
<param name="param"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Waste.Application.IReportService.GetListByBusinessAsync(Nirvana.Common.QueryParams)">
|
||||
<summary>
|
||||
根据商户和垃圾类型进行汇总
|
||||
</summary>
|
||||
<param name="param"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:Waste.Application.ReportInfo.ReportAppService">
|
||||
<summary>
|
||||
统计报表
|
||||
|
|
@ -1082,6 +1146,13 @@
|
|||
<param name="param"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Waste.Application.ReportInfo.ReportAppService.GetListByBusinessAsync(Nirvana.Common.QueryParams)">
|
||||
<summary>
|
||||
根据商户和垃圾类型进行汇总
|
||||
</summary>
|
||||
<param name="param"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:Waste.Application.ReportService">
|
||||
<summary>
|
||||
统计管理
|
||||
|
|
@ -1094,6 +1165,13 @@
|
|||
<param name="param"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Waste.Application.ReportService.GetListByBusinessAsync(Nirvana.Common.QueryParams)">
|
||||
<summary>
|
||||
根据商户和垃圾类型进行汇总
|
||||
</summary>
|
||||
<param name="param"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="P:Waste.Application.ResultList.BusinessName">
|
||||
<summary>
|
||||
商户名称
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,60 @@
|
|||
using SqlSugar;
|
||||
|
||||
namespace Waste.Domain
|
||||
{
|
||||
/// <summary>
|
||||
/// 商户统计
|
||||
/// </summary>
|
||||
public class W_BusinessStatistics
|
||||
{
|
||||
/// <summary>
|
||||
/// 商户统计
|
||||
/// </summary>
|
||||
public W_BusinessStatistics()
|
||||
{
|
||||
}
|
||||
|
||||
private System.Int32 _Id;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
|
||||
public System.Int32 Id { get { return this._Id; } set { this._Id = value; } }
|
||||
|
||||
private System.Guid _BusinessId;
|
||||
/// <summary>
|
||||
/// 商户ID
|
||||
/// </summary>
|
||||
public System.Guid BusinessId { get { return this._BusinessId; } set { this._BusinessId = value; } }
|
||||
|
||||
private System.String _WasteType;
|
||||
/// <summary>
|
||||
/// 垃圾类型
|
||||
/// </summary>
|
||||
public System.String WasteType { get { return this._WasteType; } set { this._WasteType = value?.Trim(); } }
|
||||
|
||||
private System.Int32 _DayCount;
|
||||
/// <summary>
|
||||
/// 测量次数
|
||||
/// </summary>
|
||||
public System.Int32 DayCount { get { return this._DayCount; } set { this._DayCount = value; } }
|
||||
|
||||
private System.Decimal _DayWeight;
|
||||
/// <summary>
|
||||
/// 测量重量
|
||||
/// </summary>
|
||||
public System.Decimal DayWeight { get { return this._DayWeight; } set { this._DayWeight = value; } }
|
||||
|
||||
private System.Decimal _DayPureWeight;
|
||||
/// <summary>
|
||||
/// 测量净重
|
||||
/// </summary>
|
||||
public System.Decimal DayPureWeight { get { return this._DayPureWeight; } set { this._DayPureWeight = value; } }
|
||||
|
||||
private System.DateTime _CreateTime;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.DateTime CreateTime { get { return this._CreateTime; } set { this._CreateTime = value; } }
|
||||
}
|
||||
}
|
||||
|
|
@ -4,7 +4,110 @@
|
|||
ViewData["Title"] = "统计报表";
|
||||
}
|
||||
<div class="layui-card">
|
||||
<div class="layui-form layui-card-header layuiadmin-card-header-auto">
|
||||
<div class="layui-card-header layuiadmin-card-header-auto">
|
||||
<h3>昨日整体汇总</h3>
|
||||
</div>
|
||||
<div class="layui-card-body">
|
||||
<div class="layui-row layui-col-space15">
|
||||
<div class="layui-col-sm2 layui-col-md2">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-header">
|
||||
商户数量
|
||||
</div>
|
||||
<div class="layui-card-body layuiadmin-card-list">
|
||||
<p class="layuiadmin-big-font">@Model.data.BusinessCnt</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-sm2 layui-col-md2">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-header">
|
||||
设备台数
|
||||
</div>
|
||||
<div class="layui-card-body layuiadmin-card-list">
|
||||
<p class="layuiadmin-big-font">@Model.data.DevCount</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-sm2 layui-col-md2">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-header">
|
||||
测量次数
|
||||
</div>
|
||||
<div class="layui-card-body layuiadmin-card-list">
|
||||
<p class="layuiadmin-big-font">@Model.data.YestodayCount</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-sm2 layui-col-md2">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-header">
|
||||
毛重
|
||||
</div>
|
||||
<div class="layui-card-body layuiadmin-card-list">
|
||||
<p class="layuiadmin-big-font">@Model.data.YestodayWeight</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-sm2 layui-col-md2">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-header">
|
||||
净重
|
||||
</div>
|
||||
<div class="layui-card-body layuiadmin-card-list">
|
||||
<p class="layuiadmin-big-font">@Model.data.YestodayPureWeight</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-header layuiadmin-card-header-auto">
|
||||
<h3>七日商户汇总</h3>
|
||||
</div>
|
||||
<div class="layui-card-body layui-form ">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" class="layui-input" value="@Model.defaulttime" data-time="ydatetime" autocomplete="off" name="time1" id="time1" placeholder="请选择时间" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<div class="layui-input-inline">
|
||||
<select id="BusinessId1" name="BusinessId1" lay-search>
|
||||
<option value="">请选择商户</option>
|
||||
@foreach (var item in Model.businesslist)
|
||||
{
|
||||
<option value="@item.Id">@item.Name</option>
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<div class="layui-input-inline">
|
||||
<select id="WasteType1" name="WasteType1" lay-search>
|
||||
<option value="">请选择物品编码</option>
|
||||
@foreach (var item in Model.wastetypelist)
|
||||
{
|
||||
<option value="@item.Name">@item.Name</option>
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<button class="btn btn-primary btn-lg js-search1" type="button">查询</button>
|
||||
</div>
|
||||
</div>
|
||||
<table class="layui-table" id="list1" lay-filter="list1">
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-header layuiadmin-card-header-auto">
|
||||
<h3>七日设备汇总</h3>
|
||||
</div>
|
||||
<div class="layui-card-body layui-form ">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<div class="layui-input-inline">
|
||||
|
|
@ -42,12 +145,20 @@
|
|||
<button class="btn btn-primary btn-lg js-search" type="button">查询</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-card-body">
|
||||
<table class="layui-table" id="list" lay-filter="list">
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/html" id="lefttoolbar">
|
||||
<div id="toolbar">
|
||||
合计:<span style="font-size:15px;color:#1798ca"></span>
|
||||
</div>
|
||||
</script>
|
||||
<script type="text/html" id="lefttoolbar1">
|
||||
<div id="toolbar1">
|
||||
合计:<span style="font-size:15px;color:#1798ca"></span>
|
||||
</div>
|
||||
</script>
|
||||
@section Scripts
|
||||
{
|
||||
<script type="text/javascript">
|
||||
|
|
@ -71,6 +182,15 @@
|
|||
common.initTable({
|
||||
url: '/api/report/getlist'
|
||||
, method: 'post',
|
||||
toolbar: "#lefttoolbar",
|
||||
ondone: function (res, curr, count) {
|
||||
if (count > 0) {
|
||||
var data = res.data[0];
|
||||
$("#toolbar").find("span").text("次数:" + data.totaldaycount + ",毛重:" + data.totaldayweight + "kg,净重:" + data.totaldaypureweight + "kg");
|
||||
} else {
|
||||
$("#toolbar").find("span").text("无");
|
||||
}
|
||||
},
|
||||
where: {
|
||||
queryParam: queryparam
|
||||
}
|
||||
|
|
@ -141,6 +261,96 @@
|
|||
}
|
||||
});
|
||||
});
|
||||
|
||||
queryparam = [];
|
||||
var starttime = $("#time1").val();
|
||||
if (starttime != "") {
|
||||
var times = starttime.split('~');
|
||||
queryparam.push({
|
||||
"Name": 'createtime',
|
||||
"Type": QueryCond.GreaterThanOrEqual,
|
||||
"Value": times[0].trim()
|
||||
});
|
||||
queryparam.push({
|
||||
"Name": 'createtime',
|
||||
"Type": QueryCond.LessThanOrEqual,
|
||||
"Value": times[1].trim()
|
||||
});
|
||||
}
|
||||
common.initTable({
|
||||
url: '/api/report/getlistbybusiness'
|
||||
, method: 'post',
|
||||
toolbar: "#lefttoolbar1",
|
||||
elem: "#list1",
|
||||
id: 'list1',
|
||||
ondone: function (res, curr, count) {
|
||||
if (count > 0) {
|
||||
var data = res.data[0];
|
||||
$("#toolbar1").find("span").text("次数:" + data.totaldaycount + ",毛重:" + data.totaldayweight + "kg,净重:" + data.totaldaypureweight + "kg");
|
||||
} else {
|
||||
$("#toolbar1").find("span").text("无");
|
||||
}
|
||||
},
|
||||
where: {
|
||||
queryParam: queryparam
|
||||
}
|
||||
, cols: [[
|
||||
{
|
||||
field: 'businessname', title: '商户'
|
||||
},
|
||||
{
|
||||
field: 'wastetype', title: '物品编码'
|
||||
}
|
||||
,
|
||||
{
|
||||
field: 'daycount', title: '测量次数'
|
||||
}
|
||||
,
|
||||
{
|
||||
field: 'dayweight', title: '毛重'
|
||||
}
|
||||
,
|
||||
{
|
||||
field: 'daypureweight', title: '净重'
|
||||
}
|
||||
,
|
||||
{
|
||||
field: 'createtime', title: '时间', templet: function (d) {
|
||||
return moment(d.createtime).format("YYYY/MM/DD");
|
||||
}
|
||||
}
|
||||
]]
|
||||
});
|
||||
$(".js-search1").on("click", function () {
|
||||
var queryparam = [{
|
||||
"Name": 'BusinessId',
|
||||
"Type": QueryCond.Equal,
|
||||
"Value": $("#BusinessId1").val()
|
||||
}, {
|
||||
"Name": 'WasteType',
|
||||
"Type": QueryCond.Equal,
|
||||
"Value": $("#WasteType1").val()
|
||||
}];
|
||||
var starttime = $("#time1").val();
|
||||
if (starttime != "") {
|
||||
var times = starttime.split('~');
|
||||
queryparam.push({
|
||||
"Name": 'createtime',
|
||||
"Type": QueryCond.GreaterThanOrEqual,
|
||||
"Value": times[0].trim()
|
||||
});
|
||||
queryparam.push({
|
||||
"Name": 'createtime',
|
||||
"Type": QueryCond.LessThanOrEqual,
|
||||
"Value": times[1].trim()
|
||||
});
|
||||
}
|
||||
common.reloadtable("list1", {
|
||||
where: {
|
||||
queryParam: queryparam
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
}
|
||||
|
|
@ -14,6 +14,7 @@ namespace Waste.Web.Entry.Pages.CountInfo
|
|||
public string defaulttime = "";
|
||||
public List<W_Business> businesslist = new List<W_Business>();
|
||||
public List<W_WasteType> wastetypelist = new List<W_WasteType>();
|
||||
public BusinessReport data = new BusinessReport();
|
||||
private IBusinessService _businessService;
|
||||
private IWasteService _wasteService;
|
||||
public IndexModel(IBusinessService businessService,IWasteService wasteService)
|
||||
|
|
@ -26,6 +27,7 @@ namespace Waste.Web.Entry.Pages.CountInfo
|
|||
defaulttime = $"{DateTime.Now.AddDays(-7).ToString("yyyy/MM/dd")} ~ {DateTime.Now.AddDays(-1).ToString("yyyy/MM/dd")}";
|
||||
businesslist = await _businessService.GetAllList();
|
||||
wastetypelist = await _wasteService.GetAllTypeList();
|
||||
data = await _businessService.GetBusinessTotalInfo();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,19 +51,19 @@
|
|||
<div class="layui-form-item row">
|
||||
<label class="layui-form-label col-md-2" for="SecretHash">SecretHash</label>
|
||||
<div class="col-md-4">
|
||||
<input type="text" class="layui-input" id="SecretHash" name="SecretHash" value="@Model.data.SecretHash" placeholder="请输入设备对应的secrethash" lay-verify="required" />
|
||||
<input type="text" class="layui-input" id="SecretHash" name="SecretHash" value="@Model.data.SecretHash" placeholder="请输入设备对应的secrethash" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item row">
|
||||
<label class="layui-form-label col-md-2" for="Secret">Secret</label>
|
||||
<div class="col-md-4">
|
||||
<input type="text" class="layui-input" id="Secret" name="Secret" value="@Model.data.Secret" placeholder="请输入设备对应的secret" lay-verify="required" />
|
||||
<input type="text" class="layui-input" id="Secret" name="Secret" value="@Model.data.Secret" placeholder="请输入设备对应的secret" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item row">
|
||||
<label class="layui-form-label col-md-2" for="DevId">设备ID</label>
|
||||
<div class="col-md-4">
|
||||
<input type="text" class="layui-input" id="DevId" name="DevId" value="@Model.data.DevId" placeholder="请输入设备对应的ID" lay-verify="required" />
|
||||
<input type="text" class="layui-input" id="DevId" name="DevId" value="@Model.data.DevId" placeholder="请输入设备对应的ID" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item row">
|
||||
|
|
|
|||
|
|
@ -5,6 +5,6 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
|
|||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<_PublishTargetUrl>D:\webpublish\waste.ybhdmob.com</_PublishTargetUrl>
|
||||
<History>True|2021-05-27T08:18:09.5993838Z;True|2021-05-27T16:07:31.3484951+08:00;True|2021-05-27T11:30:37.9119310+08:00;True|2021-05-27T11:28:35.5374674+08:00;True|2021-05-27T08:00:09.1625592+08:00;True|2021-05-26T20:42:17.0852150+08:00;True|2021-05-26T20:36:49.7527415+08:00;True|2021-05-25T17:57:31.8791293+08:00;True|2021-05-25T13:49:29.6488978+08:00;True|2021-05-25T13:48:24.6686105+08:00;True|2021-05-25T13:25:41.2512493+08:00;True|2021-05-24T17:55:33.3800078+08:00;True|2021-05-20T14:35:30.6957985+08:00;True|2021-05-20T13:17:22.6192995+08:00;True|2021-05-20T10:51:38.1268169+08:00;True|2021-05-19T19:50:03.7000224+08:00;True|2021-05-19T19:44:27.2518811+08:00;True|2021-05-19T19:43:26.5916681+08:00;True|2021-05-19T19:36:29.3197365+08:00;True|2021-05-19T19:30:00.3802430+08:00;True|2021-05-19T17:55:23.7939835+08:00;True|2021-05-19T11:05:17.9043392+08:00;True|2021-05-19T10:19:38.4839988+08:00;True|2021-05-19T10:17:19.7430612+08:00;True|2021-05-19T10:13:23.0031721+08:00;True|2021-05-19T10:06:03.9881599+08:00;True|2021-05-18T14:39:03.8876574+08:00;True|2021-05-18T14:23:46.9818836+08:00;True|2021-05-18T14:19:56.2382079+08:00;True|2021-05-18T11:29:53.5497590+08:00;True|2021-05-18T11:16:18.0123853+08:00;True|2021-05-17T18:59:52.4159105+08:00;True|2021-05-17T18:53:37.9438984+08:00;True|2021-05-17T18:48:14.9625161+08:00;True|2021-05-17T17:46:03.7723404+08:00;True|2021-05-17T17:14:20.2312990+08:00;True|2021-05-17T16:44:34.5837616+08:00;True|2021-05-17T16:25:20.1087804+08:00;True|2021-05-17T11:35:27.9388562+08:00;</History>
|
||||
<History>True|2021-05-28T05:59:02.2308877Z;True|2021-05-28T11:56:26.6796406+08:00;True|2021-05-28T11:28:00.4087907+08:00;True|2021-05-27T16:18:09.5993838+08:00;True|2021-05-27T16:07:31.3484951+08:00;True|2021-05-27T11:30:37.9119310+08:00;True|2021-05-27T11:28:35.5374674+08:00;True|2021-05-27T08:00:09.1625592+08:00;True|2021-05-26T20:42:17.0852150+08:00;True|2021-05-26T20:36:49.7527415+08:00;True|2021-05-25T17:57:31.8791293+08:00;True|2021-05-25T13:49:29.6488978+08:00;True|2021-05-25T13:48:24.6686105+08:00;True|2021-05-25T13:25:41.2512493+08:00;True|2021-05-24T17:55:33.3800078+08:00;True|2021-05-20T14:35:30.6957985+08:00;True|2021-05-20T13:17:22.6192995+08:00;True|2021-05-20T10:51:38.1268169+08:00;True|2021-05-19T19:50:03.7000224+08:00;True|2021-05-19T19:44:27.2518811+08:00;True|2021-05-19T19:43:26.5916681+08:00;True|2021-05-19T19:36:29.3197365+08:00;True|2021-05-19T19:30:00.3802430+08:00;True|2021-05-19T17:55:23.7939835+08:00;True|2021-05-19T11:05:17.9043392+08:00;True|2021-05-19T10:19:38.4839988+08:00;True|2021-05-19T10:17:19.7430612+08:00;True|2021-05-19T10:13:23.0031721+08:00;True|2021-05-19T10:06:03.9881599+08:00;True|2021-05-18T14:39:03.8876574+08:00;True|2021-05-18T14:23:46.9818836+08:00;True|2021-05-18T14:19:56.2382079+08:00;True|2021-05-18T11:29:53.5497590+08:00;True|2021-05-18T11:16:18.0123853+08:00;True|2021-05-17T18:59:52.4159105+08:00;True|2021-05-17T18:53:37.9438984+08:00;True|2021-05-17T18:48:14.9625161+08:00;True|2021-05-17T17:46:03.7723404+08:00;True|2021-05-17T17:14:20.2312990+08:00;True|2021-05-17T16:44:34.5837616+08:00;True|2021-05-17T16:25:20.1087804+08:00;True|2021-05-17T11:35:27.9388562+08:00;</History>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
|
@ -628,15 +628,18 @@
|
|||
"message": res.message,
|
||||
};
|
||||
},
|
||||
done: function () {
|
||||
done: function (res,curr,count) {
|
||||
flow.lazyimg();
|
||||
if (options.ondone) {
|
||||
options.ondone(res, curr, count);
|
||||
}
|
||||
}
|
||||
//height: 'full-200'
|
||||
};
|
||||
options = $.extend(defaults, options);
|
||||
table.render(options);
|
||||
//监听排序事件
|
||||
table.on('sort(list)', function (obj) { //注:tool是工具条事件名,test是table原始容器的属性 lay-filter="对应的值"
|
||||
table.on('sort(' + options.id + ')', function (obj) { //注:tool是工具条事件名,test是table原始容器的属性 lay-filter="对应的值"
|
||||
table.reload(options.id, {
|
||||
initSort: obj //记录初始排序,如果不设的话,将无法标记表头的排序状态。
|
||||
, where: { //请求参数(注意:这里面的参数可任意定义,并非下面固定的格式)
|
||||
|
|
@ -646,7 +649,7 @@
|
|||
});
|
||||
});
|
||||
|
||||
table.on('toolbar(list)', function (obj) {
|
||||
table.on('toolbar(' + options.id + ')', function (obj) {
|
||||
var checkStatus = table.checkStatus(obj.config.id);
|
||||
var event = obj.event;
|
||||
if (event == "LAYTABLE_REFRESH") {
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue