This commit is contained in:
杰 朱
2021-02-02 15:20:51 +08:00
parent 6ca5454a22
commit da75fbb8fb
5 changed files with 39 additions and 24 deletions

View File

@@ -132,7 +132,7 @@ namespace NX.ERP.U8.Mom
}
if (!string.IsNullOrEmpty(Params.ProductOrderNo))
{
where.Add(" a.moCode like @ProductOrderNo ");
where.Add(" b.moCode like @ProductOrderNo ");
}
return this.GetDetails(string.Join(" and ", where.ToArray()), new
{
@@ -145,14 +145,24 @@ namespace NX.ERP.U8.Mom
public IEnumerable<Model.MOM.MomDetail> GetDetails(string strWhere = "", object Param = null)
{
var strSql = @"select
b.MoId as id ,b.MoDId as ProductOrderDtlId,b.MoId as ProductOrderId,a.MoCode as ProductOrderNo,a.CreateDate as ProductOrderDate,b.InvCode as ProductCode,b.Qty as Qty,
c.AllocateId as id ,c.AllocateId as AllocateId,c.MoDId as ProductOrderDtlId,c.InvCode as MaterialCode,b.MoId as ProductOrderId, c.IssQty as IssQty,c.Qty
from mom_order as a
left join mom_orderdetail as b on a.MoId=b.MoId
left join mom_moallocate as c on b.MoDId=c.MoDId ";
b.MoId as id ,b.MoDId as ProductOrderDtlId,b.MoId as ProductOrderId,b.MoCode as ProductOrderNo,b.MakeDate as ProductOrderDate,b.InvCode as ProductCode,b.Qty as Qty,
d.AllocateId as id ,d.AllocateId as AllocateId,b.MoDId as ProductOrderDtlId,d.InvCode as MaterialCode,b.MoId as ProductOrderId, d.IssQty as IssQty,d.Qty
FROM v_st_mom_orderdetail b INNER JOIN
(SELECT modid as m_modid,allocateid,CREJECTCODE,IssQty,Qty,InvCode
from v_st_moallocate
where isnull(WIPType,0)=3
and isnull(ByproductFlag,0)=0
and (ISNULL(Qty,0)-ISNULL(IssQty,0)+ISNULL(ReplenishQty,0))>0
and isnull(RequisitionFlag,0) = 0 and 1=1)
d ON b.modid= d.m_modid
Where b.byproductflag=0
and ISNULL(b.Status,0) = 3
and ( isnull(b.bWorkshopTrans,0) = 0 or (isnull(b.bWorkshopTrans,0) =1
and isnull(b.sfcflag,0) =1)) AND (1>0) AND (1>0) AND ( 1>0 )
";
if (!string.IsNullOrEmpty(strWhere))
{
strSql += $" where {strWhere} ";
strSql += $" and {strWhere} ";
}
var lookup = new Dictionary<int, Model.MOM.MomDetail>();
using (var conn = U8LoginContext.Instance.Connection)
@@ -182,12 +192,12 @@ namespace NX.ERP.U8.Mom
public Model.MOM.MomOrder GetModel(string Code)
{
return this.GetList("a.moCode=@Code", new { Code }).FirstOrDefault();
return this.GetList("b.moCode=@Code", new { Code }).FirstOrDefault();
}
public IEnumerable<Model.MOM.MomOrder> GetListByLastID(int Id)
{
return this.GetList("a.moid >= @id", new { Id });
return this.GetList("b.moid >= @id", new { Id });
}
}