This commit is contained in:
杰 朱
2021-03-15 11:50:51 +08:00
2 changed files with 62 additions and 4 deletions

View File

@@ -37,9 +37,9 @@ namespace NX.ERP.U8.Store
headXml.setAttribute("brdflag", 1);
headXml.setAttribute("ccode", storeIn.Code);
headXml.setAttribute("ddate", storeIn.Date);
headXml.setAttribute("cmaker",storeIn.Maker);
headXml.setAttribute("cmaker", storeIn.Maker);
headXml.setAttribute("cvouchtype", this.VoucherID);
headXml.setAttribute("vt_id",new VT().GetDefaltVTID("0301"));
headXml.setAttribute("vt_id", new VT().GetDefaltVTID("0301"));
headXml.setAttribute("editprop", "A");
headXml.setAttribute("cdepcode", "");
headXml.setAttribute("cpersoncode", "");
@@ -96,5 +96,53 @@ namespace NX.ERP.U8.Store
}
public bool UpdateVocher(Model.Request.OtherStoreInOut storeIn)
{
var voucherParameter = base.LoadVoucher($" cCode={storeIn.Code}");
DOMDocument domBody = voucherParameter.DomBody;
for (var n = 0; n < storeIn.details.Count(); n++)
{
var detail = storeIn.details[n];
var bodyXml = domBody.createElement("z:row");
bodyXml.setAttribute("cinvcode", detail.InvCode);
bodyXml.setAttribute("iquantity", detail.Quantity);
bodyXml.setAttribute("cbatch", "");
bodyXml.setAttribute("cposition", detail.Position);
bodyXml.setAttribute("cvmivencode", "");
bodyXml.setAttribute("dmadedate", "");
bodyXml.setAttribute("dvdate", "");
bodyXml.setAttribute("iexpiratdatecalcu", "");
bodyXml.setAttribute("cmassunit", "");
bodyXml.setAttribute("imassdate", "");
bodyXml.setAttribute("cexpirationdate", "");
bodyXml.setAttribute("dexpirationdate", "");
bodyXml.setAttribute("citem_class", "");
bodyXml.setAttribute("citemcode", "");
bodyXml.setAttribute("cbmemo", "");
bodyXml.setAttribute("editprop", "A");
bodyXml.setAttribute("irowno", domBody.selectSingleNode("//rs:data").childNodes.length + 1);
domBody.selectSingleNode("//rs:data").appendChild(bodyXml);
}
var str = voucherParameter.DomBody.xml;
Console.WriteLine(str);
try
{
return base.UpdateRdVoucher(voucherParameter);
}
catch (Exception err)
{
throw err;
}
}
}
}

View File

@@ -6,8 +6,8 @@ using System.Web.Http;
namespace NX.ERP.WebAPi.Controllers.Store
{
public class OtherStoreInController:ApiController
public class OtherStoreInController : ApiController
{
[Obsolete]
[Route("api/OtherIn/Add")]
@@ -17,5 +17,15 @@ namespace NX.ERP.WebAPi.Controllers.Store
var dal = new NX.ERP.U8.Store.OtherStoreInDAL();
return dal.AddVocher(storeIn);
}
[Route("api/OtherIn/Update")]
[HttpPost]
public bool UpdteVoucher([FromBody] Model.Request.OtherStoreInOut storeIn)
{
var dal = new NX.ERP.U8.Store.OtherStoreInDAL();
return dal.UpdateVocher(storeIn);
}
}
}