修改参数名称

This commit is contained in:
admin
2021-01-15 10:22:35 +08:00
parent a2fd7eca0b
commit 68a8696bdf
17 changed files with 115 additions and 40 deletions

View File

@@ -60,6 +60,10 @@
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
</ItemGroup> </ItemGroup>
<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\MaterielStoreOut.cs" />
<Compile Include="Response\Store\MaterielStoreOutDetail.cs" /> <Compile Include="Response\Store\MaterielStoreOutDetail.cs" />
<Compile Include="Request\PuStoreIn.cs" /> <Compile Include="Request\PuStoreIn.cs" />

View File

@@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
namespace NX.ERP.Model.Store namespace NX.ERP.Model.Request
{ {
public class MaterielStoreOutDetail public class MaterielStoreOutDetail
{ {
@@ -11,11 +11,11 @@ namespace NX.ERP.Model.Store
private double quantity; private double quantity;
private string binCode; private string binCode;
private string cinvcode; private string cinvcode;
public int sorceDetailId { get; set; } public int SorceDetailId { get; set; }
public double Quantity { get => quantity; set => quantity = value; } public double Quantity { get => quantity; set => quantity = value; }
public string BinCode { get => binCode; set => binCode = 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; }
} }
} }

View 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>();
}
}

View 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; }
}
}

View 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>();
}
}

View 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
{
}
}

View File

@@ -17,11 +17,11 @@ namespace NX.ERP.Model
private string _cMemo; private string _cMemo;
private string _cBarCode; private string _cBarCode;
public string BinCode { get => _BinCode; set => _BinCode = value; } public string Code { get => _BinCode; set => _BinCode = value; }
public string BinName { get => _BinName; set => _BinName = value; } public string Name { get => _BinName; set => _BinName = value; }
public string IsPosGrade { get => _IsPosGrade; set => _IsPosGrade = value; } public string IsPosGrade { get => _IsPosGrade; set => _IsPosGrade = value; }
public bool BPosEnd { get => _bPosEnd; set => _bPosEnd = 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 VolumeLimit { get => _VolumeLimit; set => _VolumeLimit = value; }
public int WeightLimit { get => _WeightLimit; set => _WeightLimit = value; } public int WeightLimit { get => _WeightLimit; set => _WeightLimit = value; }
public string CMemo { get => _cMemo; set => _cMemo = value; } public string CMemo { get => _cMemo; set => _cMemo = value; }

View File

@@ -7,8 +7,8 @@ namespace NX.ERP.Model
{ {
public class Materiel public class Materiel
{ {
private string materielCode; private string _code;
private string materielName; private string _name;
private decimal length; private decimal length;
private decimal wide; private decimal wide;
private decimal height; private decimal height;
@@ -21,8 +21,8 @@ namespace NX.ERP.Model
private int minStock; private int minStock;
private int aql; private int aql;
private int invccode; private int invccode;
public string MaterielCode { get => materielCode; set => materielCode = value; } public string Code { get => _code; set => _code = value; }
public string MaterielName { get => materielName; set => materielName = value; } public string Name { get => _name; set => _name = value; }
public decimal Length { get => length; set => length = value; } public decimal Length { get => length; set => length = value; }
public decimal Wide { get => wide; set => wide = value; } public decimal Wide { get => wide; set => wide = value; }
public decimal Height { get => height; set => height = value; } public decimal Height { get => height; set => height = value; }

View File

@@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
namespace NX.ERP.Model.Request namespace NX.ERP.Model.Store
{ {
public class MaterielStoreOutDetail public class MaterielStoreOutDetail
{ {
@@ -11,11 +11,11 @@ namespace NX.ERP.Model.Request
private double quantity; private double quantity;
private string binCode; private string binCode;
private string cinvcode; private string cinvcode;
public int sorceDetailId { get; set; } public int SorceDetailId { get; set; }
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 Cinvcode { get => cinvcode; set => cinvcode = value; } public string InvCode { get => cinvcode; set => cinvcode = value; }
} }
} }

View File

@@ -341,8 +341,8 @@ namespace U8AppMain
new NX.ERP.Model.Request.MaterielStoreOutDetail() new NX.ERP.Model.Request.MaterielStoreOutDetail()
{ {
Position="002070206", Position="002070206",
Cinvcode="218174", InvCode="218174",
sorceDetailId=1000200145, SorceDetailId=1000200145,
Quantity=1, Quantity=1,
} }
} }
@@ -355,14 +355,14 @@ namespace U8AppMain
private void 其他入库ToolStripMenuItem_Click(object sender, EventArgs e) private void 其他入库ToolStripMenuItem_Click(object sender, EventArgs e)
{ {
var a = new NX.ERP.U8.Store.OtherStoreInDAL(); 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, Date = DateTime.Today,
Code = "111", Code = "111",
WhCode = "2", 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", InvCode="218174",
Quantity=2, Quantity=2,
@@ -377,14 +377,14 @@ namespace U8AppMain
private void 其他出库ToolStripMenuItem_Click(object sender, EventArgs e) private void 其他出库ToolStripMenuItem_Click(object sender, EventArgs e)
{ {
var a = new NX.ERP.U8.Store.OtherStoreOutDAL(); 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, Date = DateTime.Today,
Code = "111", Code = "111",
WhCode = "2", 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", InvCode="218174",
Quantity=4, Quantity=4,

View File

@@ -14,7 +14,7 @@ namespace NX.ERP.U8.Base
{ {
using (var conn = new System.Data.SqlClient.SqlConnection(U8LoginContext.Instance.Constr4Net)) 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"; iMaxCubage as VolumeLimit, iMaxweight as WeightLimit,cMemo,cBarCode from Position";
if (!string.IsNullOrEmpty(strwhere)) if (!string.IsNullOrEmpty(strwhere))
{ {

View File

@@ -16,9 +16,9 @@ namespace NX.ERP.U8
using (var conn = new System.Data.SqlClient.SqlConnection(U8LoginContext.Instance.Constr4Net)) using (var conn = new System.Data.SqlClient.SqlConnection(U8LoginContext.Instance.Constr4Net))
{ {
var sql = @"select var sql = @"select
cInvCode AS MaterielCode , cInvCode AS Code ,
cInvAddCode AS 存货代码, cInvAddCode AS 存货代码,
cInvName AS MaterielName , cInvName AS Name ,
fLength AS Length, fLength AS Length,
fWidth AS Wide, fWidth AS Wide,
fHeight AS Height, fHeight AS Height,

View File

@@ -55,21 +55,37 @@ namespace NX.ERP.U8.Store
{ {
headXml.setAttribute("cbustype", "领料"); headXml.setAttribute("cbustype", "领料");
var Order = new Mom.MomOrderDAL().GetModel(storeOut.SourceCode); var Order = new Mom.MomOrderDAL().GetModel(storeOut.SourceCode);
if (Order == null)
{
throw new Exception($"未知订单:{storeOut.SourceCode}");
}
headXml.setAttribute("iproorderid", Order.Id); headXml.setAttribute("iproorderid", Order.Id);
headXml.setAttribute("cmpocode", Order.Code); headXml.setAttribute("cmpocode", Order.Code);
headXml.setAttribute("cpspcode", "904008"); headXml.setAttribute("cpspcode", "");
headXml.setAttribute("crdname", "材料出库"); headXml.setAttribute("crdname", "材料出库");
headXml.setAttribute("cdepcode", "24"); headXml.setAttribute("cdepcode", "24");
headXml.setAttribute("cdepname", "研发LA组"); //headXml.setAttribute("cdepname", "研发LA组");
IXMLDOMElement bodyXml; IXMLDOMElement bodyXml;
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 alllocate = Order.Allocates.First(m => { return m.Id == detail.sorceDetailId; }); var alllocate = Order.Allocates.FirstOrDefault(m => { return m.Id == detail.SorceDetailId; });
var moomDetail = Order.Details.First(m => { return m.Id == alllocate.ModId; }); 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 = domBody.createElement("z:row");
bodyXml.setAttribute("autoid", n); bodyXml.setAttribute("autoid", n);
bodyXml.setAttribute("cinvcode", detail.Cinvcode); bodyXml.setAttribute("cinvcode", detail.InvCode);
bodyXml.setAttribute("iquantity", detail.Quantity); bodyXml.setAttribute("iquantity", detail.Quantity);
bodyXml.setAttribute("irowno", n + 1); bodyXml.setAttribute("irowno", n + 1);
bodyXml.setAttribute("cbatch", ""); bodyXml.setAttribute("cbatch", "");
@@ -80,7 +96,7 @@ namespace NX.ERP.U8.Store
bodyXml.setAttribute("autoid", storeOut.Id); bodyXml.setAttribute("autoid", storeOut.Id);
bodyXml.setAttribute("id", storeOut.Id); bodyXml.setAttribute("id", storeOut.Id);
bodyXml.setAttribute("impoids", detail.sorceDetailId); bodyXml.setAttribute("impoids", detail.SorceDetailId);
bodyXml.setAttribute("cmocode", Order.Code); bodyXml.setAttribute("cmocode", Order.Code);
bodyXml.setAttribute("invcode", "904008");//产品编码 bodyXml.setAttribute("invcode", "904008");//产品编码
bodyXml.setAttribute("cwhcode", storeOut.Whcode); bodyXml.setAttribute("cwhcode", storeOut.Whcode);

View File

@@ -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 VoucherParameter voucherParameter = new VoucherParameter

View File

@@ -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 VoucherParameter voucherParameter = new VoucherParameter
@@ -85,7 +85,7 @@ namespace NX.ERP.U8.Store
Console.WriteLine(str); Console.WriteLine(str);
try try
{ {
return AddRdVoucher( voucherParameter); return AddRdVoucher(voucherParameter);
} }
catch (Exception err) catch (Exception err)
{ {

View File

@@ -8,8 +8,9 @@ namespace NX.ERP.WebAPi.Controllers.Store
{ {
public class OtherStoreInController:ApiController public class OtherStoreInController:ApiController
{ {
[Route("api/OtherIn/Add")]
[HttpPost] [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(); var dal = new NX.ERP.U8.Store.OtherStoreInDAL();
return dal.AddVocher(storeIn); return dal.AddVocher(storeIn);

View File

@@ -8,8 +8,9 @@ namespace NX.ERP.WebAPi.Controllers.Store
{ {
public class OtherStoreOutController : ApiController public class OtherStoreOutController : ApiController
{ {
[Route("api/OtherOut/Add")]
[HttpPost] [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(); var dal = new NX.ERP.U8.Store.OtherStoreOutDAL();
return dal.AddVocher(storeIn); return dal.AddVocher(storeIn);