质量报表导出修改,批量展示查询顺序修改
This commit is contained in:
@@ -10,6 +10,12 @@ namespace ZR.Service.mes.qc.IService
|
||||
{
|
||||
public interface IQCStatisticsService
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取描述清单数据
|
||||
/// </summary>
|
||||
/// <param name="partnumber">成品零件号</param>
|
||||
/// <returns></returns>
|
||||
public string GetDescription(string partnumber);
|
||||
|
||||
#region 获取统计表
|
||||
//获取 首检
|
||||
|
||||
@@ -14,6 +14,8 @@ using ZR.Model.mes.md;
|
||||
using ZR.Model.MES.qc;
|
||||
using ZR.Model.MES.qc.DTO;
|
||||
using ZR.Model.MES.qu;
|
||||
using ZR.Model.MES.wms;
|
||||
using ZR.Model.MES.wms.Dto;
|
||||
using ZR.Service.mes.qc.IService;
|
||||
|
||||
namespace ZR.Service.mes.qc
|
||||
@@ -62,7 +64,18 @@ namespace ZR.Service.mes.qc
|
||||
|
||||
List<QcQualityStatisticsFirst> data = Context.Queryable<QcQualityStatisticsFirst>().Where(predicate).OrderBy(it => it.WorkorderId).OrderBy(it => it.Remark2).ToPageList(pageNum, pageSize, ref totalNum);
|
||||
|
||||
|
||||
foreach (QcQualityStatisticsFirst item in data)
|
||||
{
|
||||
WmMaterial material = Context.Queryable<WmMaterial>()
|
||||
.Where(it => it.Partnumber == item.FinishedPartNumber)
|
||||
.First();
|
||||
if (material == null)
|
||||
{
|
||||
item.ProductDescription = "此零件号不在物料清单内!";
|
||||
continue;
|
||||
}
|
||||
item.ProductDescription = !string.IsNullOrEmpty(material.Description) ? material.Description : material.ProductName;
|
||||
}
|
||||
return (data, totalNum);
|
||||
}
|
||||
|
||||
@@ -97,7 +110,18 @@ namespace ZR.Service.mes.qc
|
||||
|
||||
|
||||
List<QcQualityStatisticsAgain> data = Context.Queryable<QcQualityStatisticsAgain>().Where(predicate).OrderBy(it => it.WorkorderId).OrderBy(it => it.Remark2).ToPageList(pageNum, pageSize, ref totalNum);
|
||||
|
||||
foreach (QcQualityStatisticsAgain item in data)
|
||||
{
|
||||
WmMaterial material = Context.Queryable<WmMaterial>()
|
||||
.Where(it => it.Partnumber == item.FinishedPartNumber)
|
||||
.First();
|
||||
if (material == null)
|
||||
{
|
||||
item.ProductDescription = "此零件号不在物料清单内!";
|
||||
continue;
|
||||
}
|
||||
item.ProductDescription = !string.IsNullOrEmpty(material.Description) ? material.Description : material.ProductName;
|
||||
}
|
||||
|
||||
return (data, totalNum);
|
||||
}
|
||||
@@ -133,7 +157,18 @@ namespace ZR.Service.mes.qc
|
||||
|
||||
List<QcQualityStatisticsFinal> data = Context.Queryable<QcQualityStatisticsFinal>().Where(predicate).OrderBy(it => it.WorkorderId).OrderBy(it => it.Remark2).ToPageList(pageNum, pageSize, ref totalNum);
|
||||
|
||||
|
||||
foreach (QcQualityStatisticsFinal item in data)
|
||||
{
|
||||
WmMaterial material = Context.Queryable<WmMaterial>()
|
||||
.Where(it => it.Partnumber == item.FinishedPartNumber)
|
||||
.First();
|
||||
if (material == null)
|
||||
{
|
||||
item.ProductDescription = "此零件号不在物料清单内!";
|
||||
continue;
|
||||
}
|
||||
item.ProductDescription = !string.IsNullOrEmpty(material.Description) ? material.Description : material.ProductName;
|
||||
}
|
||||
return (data, totalNum);
|
||||
}
|
||||
|
||||
@@ -167,7 +202,18 @@ namespace ZR.Service.mes.qc
|
||||
.ToExpression();
|
||||
|
||||
List<QcQualityStatisticsTotal> data = Context.Queryable<QcQualityStatisticsTotal>().Where(predicate).OrderBy(it => it.WorkorderId).OrderBy(it => it.Remark2).ToPageList(pageNum, pageSize, ref totalNum);
|
||||
|
||||
foreach (QcQualityStatisticsTotal item in data)
|
||||
{
|
||||
WmMaterial material = Context.Queryable<WmMaterial>()
|
||||
.Where(it => it.Partnumber == item.FinishedPartNumber)
|
||||
.First();
|
||||
if (material == null)
|
||||
{
|
||||
item.ProductDescription = "此零件号不在物料清单内!";
|
||||
continue;
|
||||
}
|
||||
item.ProductDescription = !string.IsNullOrEmpty(material.Description) ? material.Description : material.ProductName;
|
||||
}
|
||||
|
||||
return (data, totalNum);
|
||||
}
|
||||
@@ -307,5 +353,27 @@ namespace ZR.Service.mes.qc
|
||||
}).ToList();
|
||||
return newList;
|
||||
}
|
||||
|
||||
public string GetDescription(string partnumber)
|
||||
{
|
||||
try
|
||||
{
|
||||
WmMaterial material = Context.Queryable<WmMaterial>()
|
||||
.Where(it => it.Partnumber == partnumber)
|
||||
.First();
|
||||
if (material == null)
|
||||
{
|
||||
return "此零件号不在物料清单内!";
|
||||
}
|
||||
else
|
||||
{
|
||||
return !string.IsNullOrEmpty(material.Description) ? material.Description : material.ProductName;
|
||||
}
|
||||
|
||||
}catch(Exception ex)
|
||||
{
|
||||
return "获取描述异常!";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ namespace ZR.Service.Business
|
||||
try
|
||||
{
|
||||
PagedInfo<WmGoodsBatchTableDto> result = new PagedInfo<WmGoodsBatchTableDto>();
|
||||
// 出库记录
|
||||
// 入库记录
|
||||
List<WmGoodsBatchTableDto> list = Context.Queryable<WmGoodsNowProduction>()
|
||||
.Where(it => it.PackageCodeClient.Contains(parm.PackageCode))
|
||||
.Select(it => new WmGoodsBatchTableDto
|
||||
@@ -105,7 +105,7 @@ namespace ZR.Service.Business
|
||||
Remark = it.Remark,
|
||||
HasChild = false
|
||||
})
|
||||
.OrderBy(it => it.Id)
|
||||
.OrderByDescending(it => it.EntryWarehouseTime)
|
||||
.ToList();
|
||||
foreach (WmGoodsBatchTableDto item in list)
|
||||
{
|
||||
@@ -157,7 +157,7 @@ namespace ZR.Service.Business
|
||||
"GROUP BY\n" +
|
||||
" Partnumber \n" +
|
||||
"ORDER BY\n" +
|
||||
" ID DESC";
|
||||
" EntryWarehouseTime DESC";
|
||||
PagedInfo<WmGoodsBatchTableDto> result = Context.SqlQueryable<WmGoodsNowProduction>(sql)
|
||||
.Where(exp)
|
||||
.Select<WmGoodsBatchTableDto>()
|
||||
@@ -206,7 +206,7 @@ namespace ZR.Service.Business
|
||||
Remark = it.Remark,
|
||||
HasChild = false
|
||||
})
|
||||
.OrderBy(it => it.Id)
|
||||
.OrderByDescending(it => it.EntryWarehouseTime)
|
||||
.ToList();
|
||||
foreach (WmGoodsBatchTableDto item in list)
|
||||
{
|
||||
@@ -311,7 +311,7 @@ namespace ZR.Service.Business
|
||||
Remark = it.Remark,
|
||||
HasChild = false
|
||||
})
|
||||
.OrderBy(it => it.Id)
|
||||
.OrderByDescending(it => it.OutTime)
|
||||
.ToList();
|
||||
foreach (WmGoodsBatchTableDto item in list)
|
||||
{
|
||||
@@ -363,7 +363,7 @@ namespace ZR.Service.Business
|
||||
"GROUP BY\n" +
|
||||
" Partnumber \n" +
|
||||
"ORDER BY\n" +
|
||||
" ID DESC";
|
||||
" OutTime DESC";
|
||||
PagedInfo<WmGoodsBatchTableDto> result = Context.SqlQueryable<WmGoodsOutRecord>(sql)
|
||||
.Where(exp)
|
||||
.Select<WmGoodsBatchTableDto>()
|
||||
@@ -411,7 +411,7 @@ namespace ZR.Service.Business
|
||||
Remark = it.Remark,
|
||||
HasChild = false
|
||||
})
|
||||
.OrderBy(it => it.Id)
|
||||
.OrderByDescending(it => it.OutTime)
|
||||
.ToList();
|
||||
foreach (WmGoodsBatchTableDto item in list)
|
||||
{
|
||||
@@ -504,7 +504,7 @@ namespace ZR.Service.Business
|
||||
Remark = it.Remark,
|
||||
HasChild = false
|
||||
})
|
||||
.OrderBy(it => it.Id)
|
||||
.OrderByDescending(it => it.OutTime)
|
||||
.ToList();
|
||||
foreach (WmGoodsBatchTableDto item in list)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user