入库检验
This commit is contained in:
@@ -41,7 +41,7 @@ namespace ZR.Service.mes.wms
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
public PagedInfo<WmFgentryInspectDto> GetList_first(WmFgentryInspectQueryDto parm)
|
||||
public PagedInfo<WmFgentryInspect_parentDto> GetList_first(WmFgentryInspectQueryDto parm)
|
||||
{
|
||||
var predicate = Expressionable.Create<WmFgentryInspect>()
|
||||
.AndIF(!string.IsNullOrEmpty(parm.Workorder), it => it.Workorder.Contains(parm.Workorder))
|
||||
@@ -52,23 +52,35 @@ namespace ZR.Service.mes.wms
|
||||
;
|
||||
|
||||
|
||||
List<WmFgentryInspect> inspects = Queryable()
|
||||
.Where(predicate.ToExpression()).GroupBy(it => it.Workorder)
|
||||
.Select(it => new WmFgentryInspect()
|
||||
List<WmFgentryInspect_parentDto> inspects = Queryable()
|
||||
.Where(predicate.ToExpression())
|
||||
.GroupBy(it => it.Workorder)
|
||||
.Select(it => new WmFgentryInspect_parentDto()
|
||||
{
|
||||
Workorder = it.Workorder,
|
||||
ProductionNum = SqlFunc.AggregateSum(it.ProductionNum ?? 0),
|
||||
// Result= SqlFunc.AggregateSum(it.Result??0),
|
||||
Partnumber = SqlFunc.AggregateMax(it.Partnumber)
|
||||
}).ToList();
|
||||
int totalPages = (int)Math.Ceiling((double)inspects.Count / parm.PageSize);
|
||||
var pageProducts = inspects.Skip((parm.PageNum - 1) * parm.PageSize).Take(parm.PageSize);
|
||||
|
||||
PagedInfo<WmFgentryInspectDto> response = new PagedInfo<WmFgentryInspectDto>()
|
||||
foreach (var inspect in inspects)
|
||||
{
|
||||
inspect.Result_good=Queryable().Where(it=>it.Workorder==inspect.Workorder).Where(it=>it.Result==1).Count();
|
||||
inspect.Result_bad=Queryable().Where(it=>it.Workorder==inspect.Workorder).Where(it=>it.Result==2).Count();
|
||||
inspect.Result_null=Queryable().Where(it=>it.Workorder==inspect.Workorder).Where(it=>it.Result==0|| it.Result==null).Count();
|
||||
}
|
||||
|
||||
|
||||
int totalPages = (int)Math.Ceiling((double)inspects.Count / parm.PageSize);
|
||||
|
||||
var pageProducts = inspects.Skip((parm.PageNum - 1) * parm.PageSize).Take(parm.PageSize).ToList();
|
||||
|
||||
PagedInfo<WmFgentryInspect_parentDto> response = new PagedInfo<WmFgentryInspect_parentDto>()
|
||||
{
|
||||
PageSize = parm.PageSize,
|
||||
PageIndex = parm.PageNum,
|
||||
TotalPage = totalPages,
|
||||
Result= pageProducts.Adapt<List<WmFgentryInspectDto>>()
|
||||
Result= pageProducts
|
||||
};
|
||||
|
||||
return response;
|
||||
@@ -141,6 +153,42 @@ namespace ZR.Service.mes.wms
|
||||
//return response;
|
||||
return Update(model, true);
|
||||
}
|
||||
/// <summary>
|
||||
/// 批量修改合格
|
||||
/// </summary>
|
||||
/// <param name="packcode_select"></param>
|
||||
/// <returns></returns>
|
||||
public int BatchQualified(string[] packcode_select,string updateby)
|
||||
{
|
||||
int sum = 0;
|
||||
foreach (string packcode in packcode_select)
|
||||
{
|
||||
sum= sum+ Context.Updateable<WmFgentryInspect>()
|
||||
.Where(it=>it.Packcode == packcode)
|
||||
.SetColumns(it=>it.Result==1)
|
||||
.ExecuteCommand();
|
||||
}
|
||||
return sum;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 批量修改合格
|
||||
/// </summary>
|
||||
/// <param name="packcode_select"></param>
|
||||
/// <returns></returns>
|
||||
public int BatchUnQualified(string[] packcode_select, string updateby)
|
||||
{
|
||||
int sum = 0;
|
||||
foreach (string packcode in packcode_select)
|
||||
{
|
||||
sum = sum + Context.Updateable<WmFgentryInspect>()
|
||||
.Where(it => it.Packcode == packcode)
|
||||
.SetColumns(it => it.Result == 2)
|
||||
.ExecuteCommand();
|
||||
}
|
||||
return sum;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user