修改参数名称
This commit is contained in:
@@ -60,6 +60,10 @@
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Request\OtherStoreIn.cs" />
|
||||
<Compile Include="Request\OtherStoreInDetail.cs" />
|
||||
<Compile Include="Request\OtherStoreOut.cs" />
|
||||
<Compile Include="Request\OtherStoreOutDetail.cs" />
|
||||
<Compile Include="Response\Store\MaterielStoreOut.cs" />
|
||||
<Compile Include="Response\Store\MaterielStoreOutDetail.cs" />
|
||||
<Compile Include="Request\PuStoreIn.cs" />
|
||||
|
||||
@@ -3,7 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace NX.ERP.Model.Store
|
||||
namespace NX.ERP.Model.Request
|
||||
{
|
||||
public class MaterielStoreOutDetail
|
||||
{
|
||||
@@ -11,11 +11,11 @@ namespace NX.ERP.Model.Store
|
||||
private double quantity;
|
||||
private string binCode;
|
||||
private string cinvcode;
|
||||
public int sorceDetailId { get; set; }
|
||||
|
||||
|
||||
public int SorceDetailId { get; set; }
|
||||
|
||||
|
||||
public double Quantity { get => quantity; set => quantity = value; }
|
||||
public string BinCode { get => binCode; set => binCode = value; }
|
||||
public string Cinvcode { get => cinvcode; set => cinvcode = value; }
|
||||
public string Position { get => binCode; set => binCode = value; }
|
||||
public string InvCode { get => cinvcode; set => cinvcode = value; }
|
||||
}
|
||||
}
|
||||
|
||||
15
NX.ERP.Model/Request/OtherStoreIn.cs
Normal file
15
NX.ERP.Model/Request/OtherStoreIn.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace NX.ERP.Model.Request
|
||||
{
|
||||
public class OtherStoreInOut
|
||||
{
|
||||
public string Code { get; set; }
|
||||
public DateTime Date { get; set; }
|
||||
public string WhCode { get; set; }
|
||||
public IList<OtherStoreInOutDetail> details = new List<OtherStoreInOutDetail>();
|
||||
}
|
||||
}
|
||||
15
NX.ERP.Model/Request/OtherStoreInDetail.cs
Normal file
15
NX.ERP.Model/Request/OtherStoreInDetail.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace NX.ERP.Model.Request
|
||||
{
|
||||
public class OtherStoreInOutDetail
|
||||
{
|
||||
public string InvCode { get; set; }
|
||||
public double Quantity { get; set; }
|
||||
public string Position { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
12
NX.ERP.Model/Request/OtherStoreOut.cs
Normal file
12
NX.ERP.Model/Request/OtherStoreOut.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace NX.ERP.Model.Request
|
||||
{
|
||||
public class OtherStoreOut
|
||||
{
|
||||
public ICollection<OtherStoreOutDetail> details = new List<OtherStoreOutDetail>();
|
||||
}
|
||||
}
|
||||
11
NX.ERP.Model/Request/OtherStoreOutDetail.cs
Normal file
11
NX.ERP.Model/Request/OtherStoreOutDetail.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace NX.ERP.Model.Request
|
||||
{
|
||||
public class OtherStoreOutDetail
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -17,11 +17,11 @@ namespace NX.ERP.Model
|
||||
private string _cMemo;
|
||||
private string _cBarCode;
|
||||
|
||||
public string BinCode { get => _BinCode; set => _BinCode = value; }
|
||||
public string BinName { get => _BinName; set => _BinName = value; }
|
||||
public string Code { get => _BinCode; set => _BinCode = value; }
|
||||
public string Name { get => _BinName; set => _BinName = value; }
|
||||
public string IsPosGrade { get => _IsPosGrade; set => _IsPosGrade = value; }
|
||||
public bool BPosEnd { get => _bPosEnd; set => _bPosEnd = value; }
|
||||
public string WarehouseCode { get => _WarehouseCode; set => _WarehouseCode = value; }
|
||||
public string WhCode { get => _WarehouseCode; set => _WarehouseCode = value; }
|
||||
public int VolumeLimit { get => _VolumeLimit; set => _VolumeLimit = value; }
|
||||
public int WeightLimit { get => _WeightLimit; set => _WeightLimit = value; }
|
||||
public string CMemo { get => _cMemo; set => _cMemo = value; }
|
||||
|
||||
@@ -7,8 +7,8 @@ namespace NX.ERP.Model
|
||||
{
|
||||
public class Materiel
|
||||
{
|
||||
private string materielCode;
|
||||
private string materielName;
|
||||
private string _code;
|
||||
private string _name;
|
||||
private decimal length;
|
||||
private decimal wide;
|
||||
private decimal height;
|
||||
@@ -21,8 +21,8 @@ namespace NX.ERP.Model
|
||||
private int minStock;
|
||||
private int aql;
|
||||
private int invccode;
|
||||
public string MaterielCode { get => materielCode; set => materielCode = value; }
|
||||
public string MaterielName { get => materielName; set => materielName = value; }
|
||||
public string Code { get => _code; set => _code = value; }
|
||||
public string Name { get => _name; set => _name = value; }
|
||||
public decimal Length { get => length; set => length = value; }
|
||||
public decimal Wide { get => wide; set => wide = value; }
|
||||
public decimal Height { get => height; set => height = value; }
|
||||
|
||||
@@ -3,7 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace NX.ERP.Model.Request
|
||||
namespace NX.ERP.Model.Store
|
||||
{
|
||||
public class MaterielStoreOutDetail
|
||||
{
|
||||
@@ -11,11 +11,11 @@ namespace NX.ERP.Model.Request
|
||||
private double quantity;
|
||||
private string binCode;
|
||||
private string cinvcode;
|
||||
public int sorceDetailId { get; set; }
|
||||
|
||||
|
||||
public int SorceDetailId { get; set; }
|
||||
|
||||
|
||||
public double Quantity { get => quantity; set => quantity = value; }
|
||||
public string Position { get => binCode; set => binCode = value; }
|
||||
public string Cinvcode { get => cinvcode; set => cinvcode = value; }
|
||||
public string InvCode { get => cinvcode; set => cinvcode = value; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -341,8 +341,8 @@ namespace U8AppMain
|
||||
new NX.ERP.Model.Request.MaterielStoreOutDetail()
|
||||
{
|
||||
Position="002070206",
|
||||
Cinvcode="218174",
|
||||
sorceDetailId=1000200145,
|
||||
InvCode="218174",
|
||||
SorceDetailId=1000200145,
|
||||
Quantity=1,
|
||||
}
|
||||
}
|
||||
@@ -355,14 +355,14 @@ namespace U8AppMain
|
||||
private void 其他入库ToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var a = new NX.ERP.U8.Store.OtherStoreInDAL();
|
||||
a.AddVocher(new NX.ERP.Model.Store.OtherStoreInOut()
|
||||
a.AddVocher(new NX.ERP.Model.Request.OtherStoreInOut()
|
||||
{
|
||||
Date = DateTime.Today,
|
||||
Code = "111",
|
||||
WhCode = "2",
|
||||
details = new List<NX.ERP.Model.Store.OtherStoreInOutDetail>()
|
||||
details = new List<NX.ERP.Model.Request.OtherStoreInOutDetail>()
|
||||
{
|
||||
new NX.ERP.Model.Store.OtherStoreInOutDetail()
|
||||
new NX.ERP.Model.Request.OtherStoreInOutDetail()
|
||||
{
|
||||
InvCode="218174",
|
||||
Quantity=2,
|
||||
@@ -377,14 +377,14 @@ namespace U8AppMain
|
||||
private void 其他出库ToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var a = new NX.ERP.U8.Store.OtherStoreOutDAL();
|
||||
a.AddVocher(new NX.ERP.Model.Store.OtherStoreInOut()
|
||||
a.AddVocher(new NX.ERP.Model.Request.OtherStoreInOut()
|
||||
{
|
||||
Date = DateTime.Today,
|
||||
Code = "111",
|
||||
WhCode = "2",
|
||||
details = new List<NX.ERP.Model.Store.OtherStoreInOutDetail>()
|
||||
details = new List<NX.ERP.Model.Request.OtherStoreInOutDetail>()
|
||||
{
|
||||
new NX.ERP.Model.Store.OtherStoreInOutDetail()
|
||||
new NX.ERP.Model.Request.OtherStoreInOutDetail()
|
||||
{
|
||||
InvCode="218174",
|
||||
Quantity=4,
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace NX.ERP.U8.Base
|
||||
{
|
||||
using (var conn = new System.Data.SqlClient.SqlConnection(U8LoginContext.Instance.Constr4Net))
|
||||
{
|
||||
var sql = @"select cPosCode as BinCode,cPosName as BinName,iPosGrade,bPosEnd,cWhCode as WarehouseCode,
|
||||
var sql = @"select cPosCode as Code,cPosName as Name,iPosGrade,bPosEnd,cWhCode as WhCode,
|
||||
iMaxCubage as VolumeLimit, iMaxweight as WeightLimit,cMemo,cBarCode from Position";
|
||||
if (!string.IsNullOrEmpty(strwhere))
|
||||
{
|
||||
|
||||
@@ -16,9 +16,9 @@ namespace NX.ERP.U8
|
||||
using (var conn = new System.Data.SqlClient.SqlConnection(U8LoginContext.Instance.Constr4Net))
|
||||
{
|
||||
var sql = @"select
|
||||
cInvCode AS MaterielCode ,
|
||||
cInvCode AS Code ,
|
||||
cInvAddCode AS 存货代码,
|
||||
cInvName AS MaterielName ,
|
||||
cInvName AS Name ,
|
||||
fLength AS Length,
|
||||
fWidth AS Wide,
|
||||
fHeight AS Height,
|
||||
|
||||
@@ -55,21 +55,37 @@ namespace NX.ERP.U8.Store
|
||||
{
|
||||
headXml.setAttribute("cbustype", "领料");
|
||||
var Order = new Mom.MomOrderDAL().GetModel(storeOut.SourceCode);
|
||||
if (Order == null)
|
||||
{
|
||||
throw new Exception($"未知订单:{storeOut.SourceCode}");
|
||||
}
|
||||
headXml.setAttribute("iproorderid", Order.Id);
|
||||
headXml.setAttribute("cmpocode", Order.Code);
|
||||
headXml.setAttribute("cpspcode", "904008");
|
||||
headXml.setAttribute("cpspcode", "");
|
||||
headXml.setAttribute("crdname", "材料出库");
|
||||
headXml.setAttribute("cdepcode", "24");
|
||||
headXml.setAttribute("cdepname", "研发LA组");
|
||||
//headXml.setAttribute("cdepname", "研发LA组");
|
||||
IXMLDOMElement bodyXml;
|
||||
for (var n = 0; n < storeOut.Details.Count(); n++)
|
||||
{
|
||||
var detail = storeOut.Details[n];
|
||||
var alllocate = Order.Allocates.First(m => { return m.Id == detail.sorceDetailId; });
|
||||
var moomDetail = Order.Details.First(m => { return m.Id == alllocate.ModId; });
|
||||
var alllocate = Order.Allocates.FirstOrDefault(m => { return m.Id == detail.SorceDetailId; });
|
||||
if (alllocate == null)
|
||||
{
|
||||
throw new Exception($"未知订单明细行:{detail.SorceDetailId}");
|
||||
|
||||
}
|
||||
|
||||
if (alllocate.InvCode != detail.InvCode)
|
||||
{
|
||||
throw new Exception($"订单明细存货编号与出库存货编号不符:{detail.InvCode}");
|
||||
}
|
||||
|
||||
|
||||
var moomDetail = Order.Details.FirstOrDefault(m => { return m.Id == alllocate.ModId; });
|
||||
bodyXml = domBody.createElement("z:row");
|
||||
bodyXml.setAttribute("autoid", n);
|
||||
bodyXml.setAttribute("cinvcode", detail.Cinvcode);
|
||||
bodyXml.setAttribute("cinvcode", detail.InvCode);
|
||||
bodyXml.setAttribute("iquantity", detail.Quantity);
|
||||
bodyXml.setAttribute("irowno", n + 1);
|
||||
bodyXml.setAttribute("cbatch", "");
|
||||
@@ -80,7 +96,7 @@ namespace NX.ERP.U8.Store
|
||||
bodyXml.setAttribute("autoid", storeOut.Id);
|
||||
bodyXml.setAttribute("id", storeOut.Id);
|
||||
|
||||
bodyXml.setAttribute("impoids", detail.sorceDetailId);
|
||||
bodyXml.setAttribute("impoids", detail.SorceDetailId);
|
||||
bodyXml.setAttribute("cmocode", Order.Code);
|
||||
bodyXml.setAttribute("invcode", "904008");//产品编码
|
||||
bodyXml.setAttribute("cwhcode", storeOut.Whcode);
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace NX.ERP.U8.Store
|
||||
}
|
||||
|
||||
|
||||
public string AddVocher(Model.Store.OtherStoreInOut storeIn)
|
||||
public string AddVocher(Model.Request.OtherStoreInOut storeIn)
|
||||
{
|
||||
|
||||
VoucherParameter voucherParameter = new VoucherParameter
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace NX.ERP.U8.Store
|
||||
|
||||
|
||||
}
|
||||
public string AddVocher(Model.Store.OtherStoreInOut storeIn)
|
||||
public string AddVocher(Model.Request.OtherStoreInOut storeIn)
|
||||
{
|
||||
|
||||
VoucherParameter voucherParameter = new VoucherParameter
|
||||
@@ -85,7 +85,7 @@ namespace NX.ERP.U8.Store
|
||||
Console.WriteLine(str);
|
||||
try
|
||||
{
|
||||
return AddRdVoucher( voucherParameter);
|
||||
return AddRdVoucher(voucherParameter);
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
|
||||
@@ -8,8 +8,9 @@ namespace NX.ERP.WebAPi.Controllers.Store
|
||||
{
|
||||
public class OtherStoreInController:ApiController
|
||||
{
|
||||
[Route("api/OtherIn/Add")]
|
||||
[HttpPost]
|
||||
public string AddVoucher([FromBody] Model.Store.OtherStoreInOut storeIn)
|
||||
public string AddVoucher([FromBody] Model.Request.OtherStoreInOut storeIn)
|
||||
{
|
||||
var dal = new NX.ERP.U8.Store.OtherStoreInDAL();
|
||||
return dal.AddVocher(storeIn);
|
||||
|
||||
@@ -8,8 +8,9 @@ namespace NX.ERP.WebAPi.Controllers.Store
|
||||
{
|
||||
public class OtherStoreOutController : ApiController
|
||||
{
|
||||
[Route("api/OtherOut/Add")]
|
||||
[HttpPost]
|
||||
public string AddVoucher([FromBody] Model.Store.OtherStoreInOut storeIn)
|
||||
public string AddVoucher([FromBody] Model.Request.OtherStoreInOut storeIn)
|
||||
{
|
||||
var dal = new NX.ERP.U8.Store.OtherStoreOutDAL();
|
||||
return dal.AddVocher(storeIn);
|
||||
|
||||
Reference in New Issue
Block a user