修改
This commit is contained in:
@@ -16,7 +16,7 @@ namespace NX.ERP.U8
|
||||
{
|
||||
var sql = @"select
|
||||
cComunitCode AS UnitCode,
|
||||
cComUnitName AS UnitName,bMainUnit as MainUnit, cGroupCode as GroupCode from ComputationUnit ";
|
||||
cComUnitName AS UnitName,bMainUnit as MainUnit,CONVERT(BIGINT,pubufts) AS pubufts, cGroupCode as GroupCode from ComputationUnit ";
|
||||
if (!string.IsNullOrEmpty(strWhere))
|
||||
{
|
||||
sql += $" where {strWhere}";
|
||||
@@ -40,10 +40,21 @@ namespace NX.ERP.U8
|
||||
where.Add(" cComUnitName like @UnitName ");
|
||||
}
|
||||
|
||||
|
||||
if (Params.Pubufts != null)
|
||||
{
|
||||
|
||||
where.Add("CONVERT(BIGINT,pubufts) >=@Pubufts ");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
return this.GetList(string.Join(" and ", where.ToArray()), new
|
||||
{
|
||||
UnitCode = $"%{Params.UnitCode}%",
|
||||
UnitName = $"%{Params.UnitName}%"
|
||||
UnitName = $"%{Params.UnitName}%",
|
||||
Pubufts=Params.Pubufts
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -30,10 +30,10 @@ namespace NX.ERP.U8.Mom
|
||||
left join mom_orderdetail as b on a.MoId=b.MoId
|
||||
left join mom_morder as d on b.MoDId=d.MoDId
|
||||
left join mom_SNDetail as e on b.MoDId=e.iVouchsID
|
||||
left join mom_moallocate as c on b.MoDId=c.MoDId ";
|
||||
left join mom_moallocate as c on b.MoDId=c.MoDId where b.Status<>4";
|
||||
if (!string.IsNullOrEmpty(strWhere))
|
||||
{
|
||||
strSQL += $" where {strWhere} ";
|
||||
strSQL += $" and {strWhere} ";
|
||||
}
|
||||
var lookupDetail = new Dictionary<int, Model.MOM.MomDetail>();
|
||||
var lookupOrder = new Dictionary<int, Model.MOM.MomOrder>();
|
||||
@@ -59,7 +59,10 @@ namespace NX.ERP.U8.Mom
|
||||
{
|
||||
OrderDetail = momDetail;
|
||||
}
|
||||
OrderDetail.SN.Add(SN);
|
||||
if (SN != null)
|
||||
{
|
||||
OrderDetail.SN.Add(SN);
|
||||
}
|
||||
Order.Allocates.Add(MoAllocate);
|
||||
OrderDetail.ProductAllocateOrderLst.Add(MoAllocate);
|
||||
MoAllocate.momDetail = OrderDetail;
|
||||
@@ -162,9 +165,7 @@ namespace NX.ERP.U8.Mom
|
||||
a.MoId as id ,a.MoDId as ProductOrderDtlId,a.MoId as ProductOrderId,a.MoCode as ProductOrderNo,a.MakeDate as ProductOrderDate,a.InvCode as ProductCode,a.Qty as Qty
|
||||
FROM v_st_mom_orderdetail a with (nolock) Where ( (1>0) AND (1>0) )
|
||||
AND ( 1>0 ) and (case when ISNULL(SfcFlag,0)=1 then iquantity+QualifiedInQty else 1 end)<>0
|
||||
and ISNULL(QCFLAG,0)=0 and ISNULL(Status,0) = 3 and (ISNULL(iQuantity,0))>0 and isnull(MrpQty,0)<>0 and 1=1
|
||||
|
||||
";
|
||||
and ISNULL(QCFLAG,0)=0 and ISNULL(Status,0) = 3 and (ISNULL(iQuantity,0))>0 and isnull(MrpQty,0)<>0 and 1=1";
|
||||
if (!string.IsNullOrEmpty(strWhere))
|
||||
{
|
||||
strSQL += $" and {strWhere} ";
|
||||
|
||||
@@ -123,9 +123,6 @@ FROM MaterialAppVouch a
|
||||
public IEnumerable<Model.Response.Store.MaterialAppDetail> GetDetailByMoCode(string MoCode, int MoDetailId)
|
||||
{
|
||||
var models = this.GetListByMoCode(MoCode, MoDetailId);
|
||||
|
||||
|
||||
|
||||
var reslut = new List<Model.Response.Store.MaterialAppDetail>();
|
||||
foreach (var items in models)
|
||||
{
|
||||
@@ -138,7 +135,7 @@ FROM MaterialAppVouch a
|
||||
|
||||
|
||||
|
||||
public void Provide(NX.ERP.Model.Request.MaterialAppProvide provide)
|
||||
public bool Provide(NX.ERP.Model.Request.MaterialAppProvide provide)
|
||||
{
|
||||
|
||||
using (var conn = U8LoginContext.Instance.Connection)
|
||||
@@ -159,7 +156,7 @@ FROM MaterialAppVouch a
|
||||
throw new Exception("未找到");
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
else //整单发出
|
||||
{
|
||||
@@ -169,7 +166,7 @@ FROM MaterialAppVouch a
|
||||
)";
|
||||
|
||||
|
||||
conn.Execute(strSql, new
|
||||
var info = conn.Execute(strSql, new
|
||||
{
|
||||
DueDate = provide.DueDate,
|
||||
SN = "",
|
||||
@@ -177,8 +174,11 @@ FROM MaterialAppVouch a
|
||||
MoCode = provide.OrderCode,
|
||||
OrderDetailId = provide.OrderDetailId
|
||||
});
|
||||
|
||||
|
||||
if (info == 0)
|
||||
{
|
||||
throw new Exception("未找到相应的物料");
|
||||
}
|
||||
return true;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user