产品入库

This commit is contained in:
gongxh
2021-03-15 13:13:29 +08:00
parent 65c4e82437
commit 13ccee99e5
4 changed files with 65 additions and 11 deletions

View File

@@ -55,9 +55,6 @@ namespace NX.ERP.U8.Store
for (var n = 0; n < storeIn.details.Count(); n++)
{
var detail = storeIn.details[n];
//var arrivalDetail = Arrival.ArrivalDetails.First(m => { return m.Id == detail.SorceDetailId; });
//headXml.setAttribute("cordercode", arrivalDetail.OrderCode);
// headXml.setAttribute("ipurorderid", arrivalDetail.PoId);
bodyXml = domBody.createElement("z:row");
bodyXml.setAttribute("cinvcode", detail.InvCode);
bodyXml.setAttribute("iquantity", detail.Quantity);

View File

@@ -85,5 +85,52 @@ namespace NX.ERP.U8.Store
}
public bool UpdateVoucher(ProductStoreIn storeIn)
{
var voucherParameter = this.LoadVoucher($"cCode='{storeIn.Code}'");
DOMDocument domBody = voucherParameter.DomBody;
if (storeIn.Source == "生产订单")
{
var momOrder = new Mom.MomOrderDAL().GetModel(storeIn.SourceCode);
IXMLDOMElement bodyXml;
for (var n = 0; n < storeIn.Details.Count; n++)
{
bodyXml = domBody.createElement("z:row");
var detail = storeIn.Details[n];
bodyXml.setAttribute("cinvcode", detail.InvCode);
bodyXml.setAttribute("iquantity", detail.Quantity);
var _cost = new MaterialDAL().GetCost(detail.InvCode, 0);
bodyXml.setAttribute("iunitcost", _cost);
bodyXml.setAttribute("iprice", new Account.Accinformation().FormatMoney(_cost * detail.Quantity));
bodyXml.setAttribute("editprop", "A");
bodyXml.setAttribute("cbatch", detail.Batch);
bodyXml.setAttribute("cposition", detail.Position);
var momOrderDetail = momOrder.ProductDtlLst.First(m => { return m.ProductOrderDtlId == detail.SourceDetailId; });
bodyXml.setAttribute("cmocode", momOrder.ProductOrderNo);
bodyXml.setAttribute("impoids", detail.SourceDetailId);
bodyXml.setAttribute("irowno", domBody.selectSingleNode("//rs:data").childNodes.length + 1);
domBody.selectSingleNode("//rs:data").appendChild(bodyXml);
}
}
try
{
return UpdateRdVoucher(voucherParameter);
}
catch (Exception err)
{
throw err;
}
}
}
}

View File

@@ -192,9 +192,9 @@ namespace NX.ERP.U8.Store
para.ErrMsg = u8ApiBroker.GetResult("errMsg") as string;
u8ApiBroker.Release();
}
catch (Exception ex3)
catch (Exception err)
{
throw ex3;
throw err;
}
}
@@ -273,10 +273,10 @@ namespace NX.ERP.U8.Store
u8ApiBroker.Release();
return true;
}
catch (Exception ex3)
catch (Exception err)
{
throw ex3;
throw err;
}
finally
{
@@ -362,10 +362,10 @@ namespace NX.ERP.U8.Store
u8ApiBroker.Release();
return VoucherId;
}
catch (Exception ex3)
catch (Exception err)
{
throw ex3;
throw err;
}
finally
{

View File

@@ -6,8 +6,8 @@ using System.Web.Http;
namespace NX.ERP.WebAPi.Controllers.Store
{
public class ProductStoreInController: ApiController
public class ProductStoreInController : ApiController
{
[Obsolete]
[Route("api/ProductStoreIn/Add")]
@@ -17,5 +17,15 @@ namespace NX.ERP.WebAPi.Controllers.Store
var dal = new NX.ERP.U8.Store.ProductInDAL();
return new { Id = dal.AddVoucher(storeIn) };
}
[Obsolete]
[Route("api/ProductStoreIn/Update")]
[HttpPost]
public bool UpdateVoucher([FromBody] Model.Request.ProductStoreIn storeIn)
{
var dal = new NX.ERP.U8.Store.ProductInDAL();
return dal.UpdateVoucher(storeIn);
}
}
}