人员产量统计表 注塑质量不合格倒扣
This commit is contained in:
@@ -89,27 +89,35 @@ namespace Tnb.ProductionMgr
|
||||
}
|
||||
|
||||
SqlSugarPagedList<PrdReportUserListOutput> result = await db.Queryable<PrdReport>()
|
||||
.LeftJoin<PrdMoTask>((a,b)=>a.mo_task_id==b.id)
|
||||
.LeftJoin<BasMaterial>((a, b,c) => a.material_id == c.id)
|
||||
.LeftJoin<UserEntity>((a, b,c,d) => a.create_id == d.Id)
|
||||
.LeftJoin<EqpEquipment>((a, b,c,d,e) => a.equip_id == e.id)
|
||||
.WhereIF(!string.IsNullOrEmpty(moTaskCode), (a, b, c, d) => b.mo_task_code.Contains(moTaskCode))
|
||||
.WhereIF(!string.IsNullOrEmpty(equipInfo), (a, b, c, d,e) => e.code.Contains(equipInfo) || e.name.Contains(equipInfo))
|
||||
.WhereIF(!string.IsNullOrEmpty(materialInfo), (a, b, c, d,e) => c.code.Contains(materialInfo) || c.name.Contains(materialInfo))
|
||||
.WhereIF(!string.IsNullOrEmpty(createInfo), (a, b, c, d,e) => d.Account.Contains(createInfo) || d.RealName.Contains(createInfo))
|
||||
.WhereIF(createTime!=null && createTime.Length==2,a=>a.create_time>=sDate && a.create_time<=eDate)
|
||||
.OrderByDescending(a => a.create_time)
|
||||
.Select((a, b, c, d, e) => new PrdReportUserListOutput
|
||||
.Select(a=>new
|
||||
{
|
||||
id = a.id,
|
||||
mo_task_id = b.mo_task_code,
|
||||
equip_id = e.name,
|
||||
material_id = c.code+"/"+c.name,
|
||||
a.create_id,
|
||||
a.material_id,
|
||||
a.batch,
|
||||
create_time = a.create_time.Date,
|
||||
a.reported_qty,
|
||||
a.pqty,
|
||||
a.rqty
|
||||
})
|
||||
.MergeTable()
|
||||
.LeftJoin<BasMaterial>((a, b) => a.material_id == b.id)
|
||||
.LeftJoin<UserEntity>((a, b,c) => a.create_id == c.Id)
|
||||
.WhereIF(!string.IsNullOrEmpty(materialInfo), (a, b, c) => b.code.Contains(materialInfo) || b.name.Contains(materialInfo))
|
||||
.WhereIF(!string.IsNullOrEmpty(createInfo), (a, b, c) => c.Account.Contains(createInfo) || c.RealName.Contains(createInfo))
|
||||
.WhereIF(createTime!=null && createTime.Length==2,a=>a.create_time>=sDate && a.create_time<=eDate)
|
||||
.GroupBy((a,b,c)=>new {a.create_id,a.material_id,b.code,b.name,a.batch,a.create_time,c.RealName})
|
||||
.OrderByDescending(a => a.create_time)
|
||||
.Select((a, b, c) => new PrdReportUserListOutput
|
||||
{
|
||||
// id = a.id,
|
||||
// mo_task_id = b.mo_task_code,
|
||||
// equip_id = e.name,
|
||||
material_id = b.code+"/"+b.name,
|
||||
batch = a.batch,
|
||||
reported_qty = a.reported_qty,
|
||||
rqty = a.rqty,
|
||||
create_id = d.RealName,
|
||||
create_time = a.create_time.ToString(DbTimeFormat.SS)
|
||||
reported_qty = SqlFunc.AggregateSumNoNull(a.reported_qty),
|
||||
rqty = SqlFunc.AggregateSumNoNull(a.rqty),
|
||||
create_id = c.RealName,
|
||||
create_time = a.create_time.ToString("yyyy-MM-dd")
|
||||
}).ToPagedListAsync(input.currentPage, input.pageSize);
|
||||
return PageResult<PrdReportUserListOutput>.SqlSugarPageResult(result);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user