月生产数据
This commit is contained in:
parent
6fb192d29d
commit
2702901ce4
@ -6,7 +6,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace DOAN.Model.MES
|
||||
{
|
||||
public class MonthProductDto //: PagerInfo
|
||||
public class MonthProductDto : PagerInfo
|
||||
{
|
||||
public DateTime SearchYearMonth { get; set; }
|
||||
}
|
||||
|
||||
@ -47,7 +47,7 @@ namespace DOAN.Service.MES.product.IService
|
||||
|
||||
byte[] ExportData(DateTime exportDate);
|
||||
|
||||
List<MonthProuctModel> GetQueryMonthProduct(MonthProductDto parm);
|
||||
PagedInfo<MonthProuctModel> GetQueryMonthProduct(MonthProductDto parm);
|
||||
|
||||
(byte[] fileBytes, string fileName) ExportMonthProduct(MonthProductDto parm);
|
||||
}
|
||||
|
||||
@ -573,7 +573,7 @@ namespace DOAN.Service.MES.product
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
public List<MonthProuctModel> GetQueryMonthProduct(MonthProductDto parm)
|
||||
public PagedInfo<MonthProuctModel> GetQueryMonthProduct(MonthProductDto parm)
|
||||
{
|
||||
(DateTime FirstDay, DateTime LastDay) Handlemonth = GetFirstAndLastDayOfMonth(parm.SearchYearMonth);
|
||||
var predicate = Expressionable.Create<ProPlanAchievementrateVersion2>()
|
||||
@ -611,7 +611,21 @@ namespace DOAN.Service.MES.product
|
||||
t.SummaryPlanNum = t.DayProuctModels.Sum(it => it.SummaryPlanNum ?? 0);
|
||||
t.SummaryPlanAchievementRate = Math.Round(t.SummaryActualNum * 100.0M / t.SummaryPlanNum ?? 1, 2);
|
||||
});
|
||||
return monthProuctModelList;
|
||||
|
||||
|
||||
PagedInfo<MonthProuctModel> result = new PagedInfo<MonthProuctModel>();
|
||||
|
||||
result.TotalNum = monthProuctModelList.Count();
|
||||
result.PageSize = parm.PageSize;
|
||||
result.PageIndex = parm.PageNum;
|
||||
|
||||
var pagedResult = monthProuctModelList
|
||||
.Skip((parm.PageNum - 1) * parm.PageSize)
|
||||
.Take(parm.PageSize)
|
||||
.ToList();
|
||||
result.Result = pagedResult;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public (byte[] fileBytes, string fileName) ExportMonthProduct(MonthProductDto parm)
|
||||
@ -621,7 +635,8 @@ namespace DOAN.Service.MES.product
|
||||
{
|
||||
throw new CustomException("Excel 模板文件不存在");
|
||||
}
|
||||
List<MonthProuctModel> list = GetQueryMonthProduct(parm);
|
||||
parm.PageNum = 10000;
|
||||
List<MonthProuctModel> list = GetQueryMonthProduct(parm).Result;
|
||||
if(list.Count==0)
|
||||
{
|
||||
throw new CustomException("没有数据可以导出");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user