入库检验修改
This commit is contained in:
@@ -13,6 +13,8 @@ using ZR.Model.MES.wms.Dto;
|
||||
using Mapster;
|
||||
using System.Reflection.PortableExecutable;
|
||||
using Microsoft.AspNetCore.Http.HttpResults;
|
||||
using ZR.Model.MES.pro;
|
||||
using System.Drawing;
|
||||
|
||||
namespace ZR.Service.mes.wms
|
||||
{
|
||||
@@ -101,13 +103,26 @@ namespace ZR.Service.mes.wms
|
||||
ProductionNum = SqlFunc.AggregateSum(it.ProductionNum ?? 0),
|
||||
// Result= SqlFunc.AggregateSum(it.Result??0),
|
||||
Partnumber = SqlFunc.AggregateMax(it.Partnumber)
|
||||
}).ToList();
|
||||
})
|
||||
.LeftJoin<ProWorkorder_v2>((s, w) => s.Workorder==w.ClientWorkorder)
|
||||
.Select((s,w)=>new WmFgentryInspect_parentDto
|
||||
{
|
||||
Workorder= s.Workorder,
|
||||
ProductionNum=s.ProductionNum,
|
||||
Partnumber=s.Partnumber,
|
||||
ProductDescription=w.ProductDescription,
|
||||
Specifications=w.Specifications,
|
||||
Colour = w.Colour
|
||||
})
|
||||
.ToList();
|
||||
|
||||
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();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -133,16 +148,26 @@ namespace ZR.Service.mes.wms
|
||||
public PagedInfo<WmFgentryInspectDto> GetList_second(WmFgentryInspectQueryDto parm)
|
||||
{
|
||||
var predicate = Expressionable.Create<WmFgentryInspect>()
|
||||
.AndIF(!string.IsNullOrEmpty(parm.Workorder), it => it.Workorder.Contains(parm.Workorder))
|
||||
.AndIF(!string.IsNullOrEmpty(parm.Packcode), it => it.Packcode.Contains(parm.Packcode))
|
||||
.AndIF(!string.IsNullOrEmpty(parm.Partnumber), it => it.Partnumber.Contains(parm.Partnumber))
|
||||
.AndIF(parm.starttime != null && parm.starttime > new DateTime(1999, 1, 1), it => it.CreatedTime > parm.starttime)
|
||||
.AndIF(parm.endtime != null && parm.endtime > new DateTime(1999, 1, 1), it => it.CreatedTime < parm.endtime)
|
||||
.AndIF(!string.IsNullOrEmpty(parm.Workorder), s => s.Workorder.Contains(parm.Workorder))
|
||||
.AndIF(!string.IsNullOrEmpty(parm.Packcode), s => s.Packcode.Contains(parm.Packcode))
|
||||
.AndIF(!string.IsNullOrEmpty(parm.Partnumber), s=> s.Partnumber.Contains(parm.Partnumber))
|
||||
.AndIF(parm.starttime != null && parm.starttime > new DateTime(1999, 1, 1), s => s.CreatedTime > parm.starttime)
|
||||
.AndIF(parm.endtime != null && parm.endtime > new DateTime(1999, 1, 1), s => s.CreatedTime < parm.endtime)
|
||||
;
|
||||
var response = Queryable()
|
||||
.Where(it => it.Bitwm == 0)
|
||||
.LeftJoin<ProWorkorder_v2>((s, w) => s.Workorder == w.ClientWorkorder)
|
||||
.Where(s => s.Bitwm == 0)
|
||||
.Where(predicate.ToExpression())
|
||||
.ToPage<WmFgentryInspect, WmFgentryInspectDto>(parm);
|
||||
.Select((s, w) => new WmFgentryInspectDto
|
||||
{
|
||||
Workorder = s.Workorder,
|
||||
ProductionNum = s.ProductionNum,
|
||||
Partnumber = s.Partnumber,
|
||||
ProductDescription = w.ProductDescription,
|
||||
Specifications = w.Specifications,
|
||||
Colour = w.Colour
|
||||
})
|
||||
.ToPage<WmFgentryInspectDto, WmFgentryInspectDto>(parm);
|
||||
return response;
|
||||
}
|
||||
|
||||
@@ -227,6 +252,20 @@ namespace ZR.Service.mes.wms
|
||||
.ExecuteCommand();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置全部批量不合格
|
||||
/// </summary>
|
||||
/// <param name="workorder_selected"></param>
|
||||
/// <param name="updateby"></param>
|
||||
/// <returns></returns>
|
||||
public int SetAllUnQualified(string workorder_selected, string updateby)
|
||||
{
|
||||
return Context.Updateable<WmFgentryInspect>()
|
||||
.SetColumns(it => it.Result == 2)
|
||||
.Where(it => it.Workorder == workorder_selected)
|
||||
.ExecuteCommand();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user