|
@@ -552,7 +552,13 @@ namespace Hotline.Repository.SqlSugar.Orders
|
|
/// <returns></returns>
|
|
/// <returns></returns>
|
|
public async Task<DataTable> CenterReportFormsStatistics(DateTime StartTime, DateTime EndTime)
|
|
public async Task<DataTable> CenterReportFormsStatistics(DateTime StartTime, DateTime EndTime)
|
|
{
|
|
{
|
|
- var list = await Db.Queryable<StatisticsCenter>()
|
|
|
|
|
|
+ var listAny = await Db.Queryable<StatisticsCenter>()
|
|
|
|
+ .Where(x => x.Time >= StartTime && x.Time <= EndTime).AnyAsync();
|
|
|
|
+ if (!listAny)
|
|
|
|
+ {
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+ var list = await Db.Queryable<StatisticsCenter>()
|
|
.Where(x => x.Time >= StartTime && x.Time <= EndTime)
|
|
.Where(x => x.Time >= StartTime && x.Time <= EndTime)
|
|
.Select(x => new StatisticsCenter
|
|
.Select(x => new StatisticsCenter
|
|
{
|
|
{
|
|
@@ -605,7 +611,14 @@ namespace Hotline.Repository.SqlSugar.Orders
|
|
/// <returns></returns>
|
|
/// <returns></returns>
|
|
public async Task<DataTable> CenterReportPurTypeStatistics(DateTime StartTime, DateTime EndTime)
|
|
public async Task<DataTable> CenterReportPurTypeStatistics(DateTime StartTime, DateTime EndTime)
|
|
{
|
|
{
|
|
- var list = await Db.Queryable<StatisticsPurTypeSatisfied>()
|
|
|
|
|
|
+ var any = await Db.Queryable<StatisticsPurTypeSatisfied>()
|
|
|
|
+ .Where(x => x.Time >= StartTime && x.Time <= EndTime).AnyAsync();
|
|
|
|
+ if (!any)
|
|
|
|
+ {
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ var list = await Db.Queryable<StatisticsPurTypeSatisfied>()
|
|
.Where(x => x.Time >= StartTime && x.Time <= EndTime)
|
|
.Where(x => x.Time >= StartTime && x.Time <= EndTime)
|
|
.Select(x => new StatisticsPurTypeSatisfied
|
|
.Select(x => new StatisticsPurTypeSatisfied
|
|
{
|
|
{
|
|
@@ -637,7 +650,16 @@ namespace Hotline.Repository.SqlSugar.Orders
|
|
/// <returns></returns>
|
|
/// <returns></returns>
|
|
public async Task<DataTable> CenterReportDepartStatistics(DateTime StartTime, DateTime EndTime, string Type)
|
|
public async Task<DataTable> CenterReportDepartStatistics(DateTime StartTime, DateTime EndTime, string Type)
|
|
{
|
|
{
|
|
- var list = await Db.Queryable<StatisticsDepart>()
|
|
|
|
|
|
+ var any = await Db.Queryable<StatisticsDepart>()
|
|
|
|
+ .LeftJoin<SystemOrganize>((x, so) => x.DepartmentId == so.oldBmid)
|
|
|
|
+ .Where(x => x.Time >= StartTime && x.Time <= EndTime && x.Type == Type).AnyAsync();
|
|
|
|
+ if (!any)
|
|
|
|
+ {
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ var list = await Db.Queryable<StatisticsDepart>()
|
|
.LeftJoin<SystemOrganize>((x, so) => x.DepartmentId == so.oldBmid)
|
|
.LeftJoin<SystemOrganize>((x, so) => x.DepartmentId == so.oldBmid)
|
|
.Where(x => x.Time >= StartTime && x.Time <= EndTime && x.Type == Type)
|
|
.Where(x => x.Time >= StartTime && x.Time <= EndTime && x.Type == Type)
|
|
.GroupBy((x, so) => new
|
|
.GroupBy((x, so) => new
|
|
@@ -669,6 +691,13 @@ namespace Hotline.Repository.SqlSugar.Orders
|
|
/// <returns></returns>
|
|
/// <returns></returns>
|
|
public async Task<DataTable> CenterReportNewStatistics(DateTime StartTime, DateTime EndTime)
|
|
public async Task<DataTable> CenterReportNewStatistics(DateTime StartTime, DateTime EndTime)
|
|
{
|
|
{
|
|
|
|
+ var any = await Db.Queryable<StatisticsBaseInfo>()
|
|
|
|
+ .Where(x => x.AddDate >= StartTime && x.AddDate <= EndTime).AnyAsync();
|
|
|
|
+
|
|
|
|
+ if (!any)
|
|
|
|
+ {
|
|
|
|
+ return null
|
|
|
|
+ }
|
|
var list = await Db.Queryable<StatisticsBaseInfo>()
|
|
var list = await Db.Queryable<StatisticsBaseInfo>()
|
|
.Where(x => x.AddDate >= StartTime && x.AddDate <= EndTime)
|
|
.Where(x => x.AddDate >= StartTime && x.AddDate <= EndTime)
|
|
.Select(x => new
|
|
.Select(x => new
|