增加材料出库单查询接口
This commit is contained in:
@@ -14,7 +14,7 @@ namespace NX.ERP.Model.Store
|
|||||||
private DateTime date;
|
private DateTime date;
|
||||||
private string sourceCode;
|
private string sourceCode;
|
||||||
private string source;
|
private string source;
|
||||||
private IList<MaterialStoreOutDetail> details;
|
private IList<MaterialStoreOutDetail> details = new List<MaterialStoreOutDetail>();
|
||||||
|
|
||||||
public int Id { get => id; set => id = value; }
|
public int Id { get => id; set => id = value; }
|
||||||
public string Code { get => code; set => code = value; }
|
public string Code { get => code; set => code = value; }
|
||||||
|
|||||||
@@ -13,9 +13,14 @@ namespace NX.ERP.Model.Store
|
|||||||
private string cinvcode;
|
private string cinvcode;
|
||||||
public int SorceDetailId { get; set; }
|
public int SorceDetailId { get; set; }
|
||||||
|
|
||||||
|
private string cInvName;
|
||||||
|
|
||||||
|
private string vcInvStd;
|
||||||
|
|
||||||
public double Quantity { get => quantity; set => quantity = value; }
|
public double Quantity { get => quantity; set => quantity = value; }
|
||||||
public string Position { get => binCode; set => binCode = value; }
|
public string Position { get => binCode; set => binCode = value; }
|
||||||
public string InvCode { get => cinvcode; set => cinvcode = value; }
|
public string InvCode { get => cinvcode; set => cinvcode = value; }
|
||||||
|
public string InvName { get => cInvName; set => cInvName = value; }
|
||||||
|
public string InvStd { get => vcInvStd; set => vcInvStd = value; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using MSXML2;
|
using Dapper;
|
||||||
|
using MSXML2;
|
||||||
using NX.ERP.Model.Store;
|
using NX.ERP.Model.Store;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@@ -49,7 +50,7 @@ namespace NX.ERP.U8.Store
|
|||||||
for (var n = 0; n < storeOut.Details.Count(); n++)
|
for (var n = 0; n < storeOut.Details.Count(); n++)
|
||||||
{
|
{
|
||||||
var detail = storeOut.Details[n];
|
var detail = storeOut.Details[n];
|
||||||
var materialAppDetail = metailApp.MaterialAppVouchsLst.FirstOrDefault(m => m.MaterialAppDtlId== detail.SorceDetailId);
|
var materialAppDetail = metailApp.MaterialAppVouchsLst.FirstOrDefault(m => m.MaterialAppDtlId == detail.SorceDetailId);
|
||||||
if (materialAppDetail == null)
|
if (materialAppDetail == null)
|
||||||
{
|
{
|
||||||
throw new Exception("未知明细");
|
throw new Exception("未知明细");
|
||||||
@@ -83,7 +84,7 @@ namespace NX.ERP.U8.Store
|
|||||||
bodyXml.setAttribute("editprop", "A");
|
bodyXml.setAttribute("editprop", "A");
|
||||||
bodyXml.setAttribute("innum", 10);
|
bodyXml.setAttribute("innum", 10);
|
||||||
bodyXml.setAttribute("imoseq", materialAppDetail.Moseq);
|
bodyXml.setAttribute("imoseq", materialAppDetail.Moseq);
|
||||||
bodyXml.setAttribute("inquantity", materialAppDetail.Quantit- materialAppDetail.OutQuantity);
|
bodyXml.setAttribute("inquantity", materialAppDetail.Quantit - materialAppDetail.OutQuantity);
|
||||||
bodyXml.setAttribute("crejectcode", materialAppDetail.RejectCode);
|
bodyXml.setAttribute("crejectcode", materialAppDetail.RejectCode);
|
||||||
bodyXml.setAttribute("iOMoMID", materialAppDetail.OmomId);
|
bodyXml.setAttribute("iOMoMID", materialAppDetail.OmomId);
|
||||||
bodyXml.setAttribute("iopseq", materialAppDetail.OpSeq);
|
bodyXml.setAttribute("iopseq", materialAppDetail.OpSeq);
|
||||||
@@ -225,7 +226,7 @@ namespace NX.ERP.U8.Store
|
|||||||
voucherParameter.DomHead.loadXML(HeadTemplate);
|
voucherParameter.DomHead.loadXML(HeadTemplate);
|
||||||
voucherParameter.DomBody.loadXML(BodyTemplate);
|
voucherParameter.DomBody.loadXML(BodyTemplate);
|
||||||
IXMLDOMElement headXml = domHead.createElement("z:row");
|
IXMLDOMElement headXml = domHead.createElement("z:row");
|
||||||
headXml.setAttribute("ccode","AAA"/* storeOut.Code*/); //DomHead[0]["ccode"] = ""; //入库单号,string类型
|
headXml.setAttribute("ccode", "AAA"/* storeOut.Code*/); //DomHead[0]["ccode"] = ""; //入库单号,string类型
|
||||||
headXml.setAttribute("ddate", storeOut.Date.ToShortDateString()); //DomHead[0]["ddate"] = ""; //入库日期,DateTime类型
|
headXml.setAttribute("ddate", storeOut.Date.ToShortDateString()); //DomHead[0]["ddate"] = ""; //入库日期,DateTime类型
|
||||||
headXml.setAttribute("bpufirst", "0");
|
headXml.setAttribute("bpufirst", "0");
|
||||||
headXml.setAttribute("bisstqc", "0");
|
headXml.setAttribute("bisstqc", "0");
|
||||||
@@ -293,6 +294,53 @@ namespace NX.ERP.U8.Store
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public MaterialStoreOut GetModel(string Code)
|
||||||
|
{
|
||||||
|
return GetList(" a.cCode=@Code", new { Code }).FirstOrDefault();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public IEnumerable<MaterialStoreOut> GetList(string strWhere = "", object param = null)
|
||||||
|
{
|
||||||
|
string strSQL = @" select a.id,a.cCode as Code,a.iproorderid as iproorderid,a.dDate as date,a.cSource as Source,a.cBusCode as SourceCode,
|
||||||
|
b.id,b.iQuantity as quantity, b.cPosition as binCode,b.impoids as SorceDetailId,b.cInvCode as InvCode,
|
||||||
|
c.cInvName as InvName,c.cInvStd as InvStd
|
||||||
|
from rdrecord11 a
|
||||||
|
left join rdrecords11 as b on a.ID=b.ID
|
||||||
|
left join Inventory as c on b.cInvCode=c.cInvCode ";
|
||||||
|
if (!string.IsNullOrEmpty(strWhere))
|
||||||
|
{
|
||||||
|
strSQL += $" where {strWhere} ";
|
||||||
|
}
|
||||||
|
var lookup = new System.Collections.Generic.Dictionary<int, MaterialStoreOut>();
|
||||||
|
using (var conn = U8LoginContext.Instance.Connection)
|
||||||
|
{
|
||||||
|
var list = conn.Query<MaterialStoreOut, MaterialStoreOutDetail, MaterialStoreOut>(strSQL, (a, b) =>
|
||||||
|
{
|
||||||
|
if (!lookup.TryGetValue(a.Id, out var _order))
|
||||||
|
{
|
||||||
|
lookup.Add(a.Id, a);
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
a = _order;
|
||||||
|
}
|
||||||
|
|
||||||
|
a.Details.Add(b);
|
||||||
|
return a;
|
||||||
|
}, param, null, true, "id", 10, System.Data.CommandType.Text);
|
||||||
|
}
|
||||||
|
|
||||||
|
return lookup.Values;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -378,7 +426,8 @@ namespace NX.ERP.U8.Store
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} else if (storeOut.Source=="领料申请单")
|
}
|
||||||
|
else if (storeOut.Source == "领料申请单")
|
||||||
{
|
{
|
||||||
|
|
||||||
var metailApp = new U8.Store.MaterialAppDAL().GetModel(storeOut.SourceCode);
|
var metailApp = new U8.Store.MaterialAppDAL().GetModel(storeOut.SourceCode);
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using System;
|
using NX.ERP.Model.Store;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Web;
|
using System.Web;
|
||||||
@@ -31,5 +32,14 @@ namespace NX.ERP.WebAPi.Controllers.Store
|
|||||||
var dal = new NX.ERP.U8.Store.MaterialStoreOutDAL();
|
var dal = new NX.ERP.U8.Store.MaterialStoreOutDAL();
|
||||||
return dal.UpdateVocher(storeIn);
|
return dal.UpdateVocher(storeIn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
[Route("api/MaterialOut")]
|
||||||
|
[HttpGet]
|
||||||
|
public MaterialStoreOut GetModel([FromUri] string Code)
|
||||||
|
{
|
||||||
|
var dal = new NX.ERP.U8.Store.MaterialStoreOutDAL();
|
||||||
|
return dal.GetModel(Code);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using System;
|
using NX.ERP.Model.Store;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Web;
|
using System.Web;
|
||||||
@@ -26,5 +27,10 @@ namespace NX.ERP.WebAPi.Controllers.Store
|
|||||||
var dal = new NX.ERP.U8.Store.OtherStoreOutDAL();
|
var dal = new NX.ERP.U8.Store.OtherStoreOutDAL();
|
||||||
return dal.UpdateVocher(storeIn);
|
return dal.UpdateVocher(storeIn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user