其他入库修改
This commit is contained in:
@@ -44,7 +44,7 @@ namespace NX.ERP.BLL.Store
|
|||||||
if (inbound.InboundType == Model.InboundType.productIn)
|
if (inbound.InboundType == Model.InboundType.productIn)
|
||||||
{
|
{
|
||||||
var dal = new NX.ERP.U8.Store.ProductInDAL();
|
var dal = new NX.ERP.U8.Store.ProductInDAL();
|
||||||
ID = dal.AddVoucher(new ERP.Model.Request.ProductStoreIn()
|
ID = dal.SaveVoucher(new ERP.Model.Request.ProductStoreIn()
|
||||||
{
|
{
|
||||||
|
|
||||||
Id = inbound.Id,
|
Id = inbound.Id,
|
||||||
@@ -71,7 +71,7 @@ namespace NX.ERP.BLL.Store
|
|||||||
if (inbound.InboundType == Model.InboundType.OtherIn)
|
if (inbound.InboundType == Model.InboundType.OtherIn)
|
||||||
{
|
{
|
||||||
var dal = new NX.ERP.U8.Store.OtherStoreInDAL();
|
var dal = new NX.ERP.U8.Store.OtherStoreInDAL();
|
||||||
ID = dal.AddVocher(new ERP.Model.Request.OtherStoreInOut()
|
ID = dal.SaveVoucher(new ERP.Model.Request.OtherStoreInOut()
|
||||||
{
|
{
|
||||||
Id = inbound.Id,
|
Id = inbound.Id,
|
||||||
Code = inbound.InboundNo,
|
Code = inbound.InboundNo,
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ namespace NX.ERP.BLL.Store
|
|||||||
if (outBound.OutboundType == Model.OutBoundType.SaleOut)
|
if (outBound.OutboundType == Model.OutBoundType.SaleOut)
|
||||||
{
|
{
|
||||||
var dal = new U8.Store.SaleOutDAL();
|
var dal = new U8.Store.SaleOutDAL();
|
||||||
ID = dal.AddVoucher(new ERP.Model.Request.SaleStoreOut()
|
ID = dal.SaveVoucher(new ERP.Model.Request.SaleStoreOut()
|
||||||
{
|
{
|
||||||
Id = outBound.Id,
|
Id = outBound.Id,
|
||||||
Code = outBound.OutboundNo,
|
Code = outBound.OutboundNo,
|
||||||
@@ -68,7 +68,7 @@ namespace NX.ERP.BLL.Store
|
|||||||
if (outBound.OutboundType == Model.OutBoundType.OtherOut)
|
if (outBound.OutboundType == Model.OutBoundType.OtherOut)
|
||||||
{
|
{
|
||||||
var dal = new U8.Store.OtherStoreOutDAL();
|
var dal = new U8.Store.OtherStoreOutDAL();
|
||||||
ID = dal.AddVocher(new ERP.Model.Request.OtherStoreInOut()
|
ID = dal.SaveVoucher(new ERP.Model.Request.OtherStoreInOut()
|
||||||
{
|
{
|
||||||
Date = outBound.OutboundDate,
|
Date = outBound.OutboundDate,
|
||||||
WhCode = outBound.WarehouseCode,
|
WhCode = outBound.WarehouseCode,
|
||||||
|
|||||||
@@ -169,8 +169,6 @@ namespace NX.ERP.U8.Store
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -95,11 +95,36 @@ namespace NX.ERP.U8.Store
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public bool UpdateVocher(Model.Request.OtherStoreInOut storeIn)
|
public string SaveVoucher(Model.Request.OtherStoreInOut storeIn)
|
||||||
|
{
|
||||||
|
var voucherParameter = this.LoadVoucher($"id='{storeIn.Id}'");
|
||||||
|
if (voucherParameter.DomHead.selectSingleNode("//rs:data").childNodes.length == 0)
|
||||||
|
{
|
||||||
|
return this.AddVocher(storeIn);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (this.UpdateVocher(storeIn, voucherParameter))
|
||||||
|
{
|
||||||
|
return storeIn.Id.ToString();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new Exception("保存错误");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public bool UpdateVocher(Model.Request.OtherStoreInOut storeIn, VoucherParameter voucherParameter = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
var voucherParameter = base.LoadVoucher($" id={storeIn.Id}");
|
if (voucherParameter == null)
|
||||||
|
{
|
||||||
|
voucherParameter = base.LoadVoucher($" id={storeIn.Id}");
|
||||||
|
}
|
||||||
DOMDocument domBody = voucherParameter.DomBody;
|
DOMDocument domBody = voucherParameter.DomBody;
|
||||||
for (var n = 0; n < storeIn.details.Count(); n++)
|
for (var n = 0; n < storeIn.details.Count(); n++)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -93,11 +93,41 @@ namespace NX.ERP.U8.Store
|
|||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public bool UpdateVocher(Model.Request.OtherStoreInOut storeIn)
|
|
||||||
|
|
||||||
|
public string SaveVoucher(Model.Request.OtherStoreInOut storeIn)
|
||||||
|
{
|
||||||
|
var voucherParameter = this.LoadVoucher($"id='{storeIn.Id}'");
|
||||||
|
if (voucherParameter.DomHead.selectSingleNode("//rs:data").childNodes.length == 0)
|
||||||
|
{
|
||||||
|
return this.AddVocher(storeIn);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (this.UpdateVocher(storeIn, voucherParameter))
|
||||||
|
{
|
||||||
|
return storeIn.Id.ToString();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new Exception("保存错误");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public bool UpdateVocher(Model.Request.OtherStoreInOut storeIn, VoucherParameter voucherParameter = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if (voucherParameter == null)
|
||||||
|
{
|
||||||
|
voucherParameter = this.LoadVoucher($"id='{storeIn.Id}'");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
VoucherParameter voucherParameter = this.LoadVoucher($"id='{storeIn.Id}'");
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -85,10 +85,35 @@ namespace NX.ERP.U8.Store
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public bool UpdateVoucher(ProductStoreIn storeIn)
|
|
||||||
|
public string SaveVoucher(Model.Request.ProductStoreIn storeIn)
|
||||||
{
|
{
|
||||||
var voucherParameter = this.LoadVoucher($"id='{storeIn.Id}'");
|
var voucherParameter = this.LoadVoucher($"id='{storeIn.Id}'");
|
||||||
|
if (voucherParameter.DomHead.selectSingleNode("//rs:data").childNodes.length == 0)
|
||||||
|
{
|
||||||
|
return this.AddVoucher(storeIn);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (this.UpdateVoucher(storeIn, voucherParameter))
|
||||||
|
{
|
||||||
|
return storeIn.Id.ToString();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new Exception("保存错误");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public bool UpdateVoucher(ProductStoreIn storeIn, VoucherParameter voucherParameter=null)
|
||||||
|
{
|
||||||
|
if (voucherParameter == null)
|
||||||
|
{
|
||||||
|
voucherParameter = this.LoadVoucher($"id='{storeIn.Id}'");
|
||||||
|
}
|
||||||
DOMDocument domBody = voucherParameter.DomBody;
|
DOMDocument domBody = voucherParameter.DomBody;
|
||||||
|
|
||||||
if (storeIn.Source == "生产订单")
|
if (storeIn.Source == "生产订单")
|
||||||
|
|||||||
Reference in New Issue
Block a user