|
|
@@ -17,21 +17,18 @@ namespace WMS.BZServices.KLHC
|
|
|
{
|
|
|
public class StatisticsreportService
|
|
|
{
|
|
|
-
|
|
|
- private readonly Repository<WCS_TaskOld> _taskoldrepository;
|
|
|
-
|
|
|
+ private readonly Repository<WCS_TaskOld> _taskoldrepository;
|
|
|
+
|
|
|
public StatisticsreportService(Repository<WCS_TaskOld> taskoldrepository)
|
|
|
- {
|
|
|
- _taskoldrepository = taskoldrepository;
|
|
|
+ {
|
|
|
+ _taskoldrepository = taskoldrepository;
|
|
|
}
|
|
|
|
|
|
public PagedInfo<StatisticsDto> GetPageList(Pagination pagination, StatisticsQueryDto statisticsQueryDto)
|
|
|
{
|
|
|
-
|
|
|
var list = GetQueryable(statisticsQueryDto).ToPage(pagination);
|
|
|
return list;
|
|
|
}
|
|
|
-
|
|
|
|
|
|
public IList<StatisticsDto> GetList(StatisticsQueryDto statisticsQueryDto)
|
|
|
{
|
|
|
@@ -106,7 +103,7 @@ namespace WMS.BZServices.KLHC
|
|
|
EditTime = it.EndTime.Value.Date,
|
|
|
Hour = it.EndTime.Value.Hour
|
|
|
})
|
|
|
- .MergeTable()//将查询结果转成一个表
|
|
|
+ .MergeTable()//将查询结果转成一个表
|
|
|
.GroupBy(o => new { o.Hour, o.EditTime })
|
|
|
.Select(it => new TaskInOutDto { Count = SqlFunc.AggregateCount(it.Hour), Hour = it.Hour, CreateTime = it.EditTime })
|
|
|
.OrderBy(o => o.CreateTime);
|
|
|
@@ -120,14 +117,12 @@ namespace WMS.BZServices.KLHC
|
|
|
EditTime = it.EndTime.Value.Date,
|
|
|
Hour = it.EndTime.Value.Hour
|
|
|
})
|
|
|
- .MergeTable()//将查询结果转成一个表
|
|
|
+ .MergeTable()//将查询结果转成一个表
|
|
|
.GroupBy(o => new { o.Type, o.Hour, o.EditTime })
|
|
|
.Select(it => new TaskInOutDto { Count = SqlFunc.AggregateCount(it.Type), Type = it.Type, Hour = it.Hour, CreateTime = it.EditTime })
|
|
|
.OrderBy(o => o.CreateTime);
|
|
|
-
|
|
|
}
|
|
|
|
|
|
-
|
|
|
var lists = sugarQueryable.ToList();
|
|
|
PagedInfo<HourTaskDto> HourTasks = new PagedInfo<HourTaskDto>()
|
|
|
{
|
|
|
@@ -183,8 +178,6 @@ namespace WMS.BZServices.KLHC
|
|
|
if (TaskDate != null)
|
|
|
TaskDate.SetValue(s, p.ToString("yyyy-MM-dd"), null);
|
|
|
|
|
|
-
|
|
|
-
|
|
|
for (int i = 0; i < 24; i++)
|
|
|
{
|
|
|
PropertyInfo info = plist.GetProperty("A" + i.ToString());
|
|
|
@@ -200,8 +193,6 @@ namespace WMS.BZServices.KLHC
|
|
|
HourTasks.Result.Add(s);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
if (!pagination.sidx.IsEmpty())
|
|
|
{
|
|
|
@@ -221,7 +212,6 @@ namespace WMS.BZServices.KLHC
|
|
|
return pagination.sord.ToLower().Contains("asc") ?
|
|
|
pro.GetValue(info1, null).ToInt().CompareTo(pro.GetValue(info2, null).ToInt()) :
|
|
|
pro.GetValue(info2, null).ToInt().CompareTo(pro.GetValue(info1, null).ToInt());
|
|
|
-
|
|
|
});
|
|
|
//typeof(HourTaskDto).GetProperty( pagination.sidx.Replace("DESC", "").Replace("ASC", ""))).ToList();
|
|
|
}
|
|
|
@@ -231,7 +221,6 @@ namespace WMS.BZServices.KLHC
|
|
|
return HourTasks;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
public PagedInfo<InOutReportDto> GetInOutReport(Pagination pagination, InOutReportQueryDto queryDto)
|
|
|
{
|
|
|
if (!queryDto.EndTimeBegin.HasValue)
|
|
|
@@ -260,7 +249,7 @@ namespace WMS.BZServices.KLHC
|
|
|
Day = it.EndTime.Value.Day.ToString(),
|
|
|
Hour = it.EndTime.Value.Hour.ToString(),
|
|
|
InQty = SqlFunc.AggregateCount(SqlFunc.IF(it.Type == 1).Return(1).End<int>()),
|
|
|
- OutQty = SqlFunc.AggregateCount(SqlFunc.IF(it.Type == 2).Return(1).End<int>()),
|
|
|
+ OutQty = SqlFunc.AggregateSum(SqlFunc.IF(it.Type == 2).Return(1 * it.FullQty).End<int>()),
|
|
|
}).MergeTable();//.OrderBy(o => new { o.Year, o.Month, o.Day, o.Hour })
|
|
|
}
|
|
|
else
|
|
|
@@ -273,11 +262,14 @@ namespace WMS.BZServices.KLHC
|
|
|
Month = it.EndTime.Value.Month.ToString(),
|
|
|
Day = it.EndTime.Value.Day.ToString(),
|
|
|
InQty = SqlFunc.AggregateCount(SqlFunc.IF(it.Type == 1).Return(1).End<int>()),
|
|
|
- OutQty = SqlFunc.AggregateCount(SqlFunc.IF(it.Type == 2).Return(1).End<int>()),
|
|
|
+ OutQty = SqlFunc.AggregateSum(SqlFunc.IF(it.Type == 2).Return(1 * it.FullQty).End<int>()),
|
|
|
}).MergeTable(); //.OrderBy(o => new { o.Year, o.Month, o.Day })
|
|
|
if (pagination.sidx == "Hour")
|
|
|
pagination.sidx = "Day";
|
|
|
}
|
|
|
+
|
|
|
+ var a = sugarQueryable.ToList();
|
|
|
+
|
|
|
var lists = sugarQueryable.ToPage(pagination);
|
|
|
|
|
|
lists.Result.Add(new InOutReportDto
|
|
|
@@ -288,5 +280,5 @@ namespace WMS.BZServices.KLHC
|
|
|
});
|
|
|
return lists;
|
|
|
}
|
|
|
- }
|
|
|
-}
|
|
|
+ }
|
|
|
+}
|