修正代码

This commit is contained in:
admin
2021-01-13 10:21:56 +08:00
parent 6001b690ed
commit be6ed7aec9
23 changed files with 214 additions and 38 deletions

View File

@@ -23,5 +23,11 @@ namespace NX.ERP.U8.Base
return conn.Query<Bin>(sql, Params);
}
}
public IEnumerable<Bin> GetListByWhCode(string Code)
{
return this.GetList(" cWhCode=@Code", new { Code });
}
}
}

View File

@@ -5,7 +5,7 @@ using System.Text;
using Dapper;
namespace NX.ERP.U8.Mom
{
public class MomOrderDetailDAL
public class MomOrderDAL
{
public IEnumerable<Model.MOM.MomOrder> GetList(string strWhere = "", object param = null)
{
@@ -59,6 +59,10 @@ namespace NX.ERP.U8.Mom
return this.GetList("a.moCode=@Code", new { Code }).FirstOrDefault();
}
public IEnumerable<Model.MOM.MomOrder> GetListByLastID(int Id)
{
return this.GetList("a.moid >= @id", new { Id });
}
}
}

View File

@@ -43,7 +43,7 @@
<Compile Include="Base\MaterielTypeDAL.cs" />
<Compile Include="FileHelp.cs" />
<Compile Include="FormatHelp.cs" />
<Compile Include="Mom\MomOrderDetailDAL.cs" />
<Compile Include="Mom\MomOrderDAL.cs" />
<Compile Include="Purchase\ArrivalDAL.cs" />
<Compile Include="Store\MaterielStoreOutDAL.cs" />
<Compile Include="Store\OtherStoreInDAL.cs" />

View File

@@ -53,6 +53,14 @@ namespace NX.ERP.U8.Purchase
}
public IEnumerable<Model.Purchase.Arrival> GetListByLastId(int Id)
{
return this.GetList(" a.id>=@Id ", new { Id });
}
public Model.Purchase.Arrival GetModel(string Code)
{
return this.GetList(" a.cCode=@Code ", new { Code }).FirstOrDefault();

View File

@@ -61,7 +61,7 @@ namespace NX.ERP.U8.Store
if (storeOut.Source == "生产订单")
{
headXml.setAttribute("cbustype", "领料");
var Order = new Mom.MomOrderDetailDAL().GetModel(storeOut.SourceCode);
var Order = new Mom.MomOrderDAL().GetModel(storeOut.SourceCode);
headXml.setAttribute("iproorderid", Order.Id);
headXml.setAttribute("cmpocode", Order.Code);
headXml.setAttribute("cpspcode", "904008");

View File

@@ -8,13 +8,13 @@ namespace NX.ERP.U8.Store
{
public class OtherStoreInDAL : VoucherBase
{
public OtherStoreInDAL() : base("09")
public OtherStoreInDAL() : base("08")
{
}
public string AddVocher(Model.Store.OtherStoreIn storeIn)
public string AddVocher(Model.Store.OtherStoreInOut storeIn)
{
VoucherParameter voucherParameter = new VoucherParameter

View File

@@ -1,15 +1,97 @@
using System;
using MSXML2;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace NX.ERP.U8.Store
{
public class OtherStoreOutDAL:VoucherBase
public class OtherStoreOutDAL : VoucherBase
{
public OtherStoreOutDAL():base("09")
{
public OtherStoreOutDAL() : base("09")
{
}
public string AddVocher(Model.Store.OtherStoreInOut storeIn)
{
VoucherParameter voucherParameter = new VoucherParameter
{
VoucherType = this.VoucherID,
DomHead = new DOMDocumentClass(),
DomBody = new DOMDocumentClass()
};
DOMDocument domHead = voucherParameter.DomHead;
DOMDocument domBody = voucherParameter.DomBody;
voucherParameter.DomHead.loadXML(HeadTemplate);
voucherParameter.DomBody.loadXML(BodyTemplate);
IXMLDOMElement headXml = domHead.createElement("z:row");
headXml.setAttribute("bpufirst", "0");
headXml.setAttribute("bisstqc", "0");
headXml.setAttribute("bomfirst", "0");
headXml.setAttribute("biafirst", "0");
headXml.setAttribute("brdflag", 1);
headXml.setAttribute("ccode", storeIn.Code);
headXml.setAttribute("ddate", storeIn.Date);
headXml.setAttribute("cmaker", "/");
headXml.setAttribute("cvouchtype", this.VoucherID);
headXml.setAttribute("vt_id", "");
headXml.setAttribute("editprop", "A");
headXml.setAttribute("cdepcode", "");
headXml.setAttribute("cpersoncode", "");
headXml.setAttribute("crdcode", "");
headXml.setAttribute("csource", "库存");
headXml.setAttribute("cwhcode", storeIn.WhCode);
headXml.setAttribute("cbustype", "其他出库");
headXml.setAttribute("cmemo", "");
IXMLDOMElement bodyXml;
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);
bodyXml.setAttribute("irowno", n + 1);
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");
domBody.selectSingleNode("//rs:data").appendChild(bodyXml);
}
domHead.selectSingleNode("//rs:data").appendChild(headXml);
var str = voucherParameter.DomBody.xml;
Console.WriteLine(str);
try
{
return U8LoginContext.Instance.AddRdVoucher("U8API/PuStoreIn/Add", voucherParameter);
}
catch (Exception err)
{
throw err;
}
}
}
}