合并
This commit is contained in:
@@ -14,7 +14,7 @@ namespace NX.ERP.U8.AP
|
||||
public APVouch() : base("应付单", "U8API/APVouch")
|
||||
{
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
protected override string AddUrl
|
||||
@@ -56,10 +56,10 @@ namespace NX.ERP.U8.AP
|
||||
u8EnvContext.U8Login = U8LoginContext.Instance.ClsLogin;
|
||||
U8ApiAddress apiAddress = new U8ApiAddress(this.LoadUrl);
|
||||
U8ApiBroker u8ApiBroker = new U8ApiBroker(apiAddress, u8EnvContext);
|
||||
u8EnvContext.SetApiContext("VouchType",this.VoucherID);
|
||||
u8EnvContext.SetApiContext("VouchType", this.VoucherID);
|
||||
|
||||
u8ApiBroker.AssignNormalValue("linkid", "");
|
||||
|
||||
u8ApiBroker.AssignNormalValue("linkid", "0");
|
||||
|
||||
if (!u8ApiBroker.Invoke())
|
||||
{
|
||||
Exception exception = u8ApiBroker.GetException();
|
||||
@@ -95,7 +95,7 @@ namespace NX.ERP.U8.AP
|
||||
para.DomBody = new DOMDocumentClass();
|
||||
para.DomBody.loadXML(dOMDocument2.xml);
|
||||
}
|
||||
|
||||
|
||||
para.ReturnValue = Convert.ToBoolean(u8ApiBroker.GetReturnValue());
|
||||
para.ErrMsg = u8ApiBroker.GetResult("xmlmsg") as string;
|
||||
u8ApiBroker.Release();
|
||||
@@ -122,7 +122,7 @@ namespace NX.ERP.U8.AP
|
||||
u8ApiBroker.AssignNormalValue("ohead", para.DomHead);
|
||||
u8ApiBroker.AssignNormalValue("obody", para.DomBody);
|
||||
//给普通参数isadd赋值。此参数的数据类型为System.Boolean,此参数按值传递,表示true新增,false修改
|
||||
u8ApiBroker.AssignNormalValue("isadd",true);
|
||||
u8ApiBroker.AssignNormalValue("isadd", true);
|
||||
|
||||
|
||||
if (para.DOMMsg != null)
|
||||
@@ -133,7 +133,7 @@ namespace NX.ERP.U8.AP
|
||||
{
|
||||
u8ApiBroker.AssignNormalValue("xmlmsg", new DOMDocumentClass());
|
||||
}
|
||||
|
||||
|
||||
|
||||
// u8ApiBroker.AssignNormalValue("bReMote", para.IsReMote);
|
||||
if (!u8ApiBroker.Invoke())
|
||||
@@ -163,11 +163,20 @@ namespace NX.ERP.U8.AP
|
||||
|
||||
}
|
||||
para.ReturnValue = Convert.ToBoolean(u8ApiBroker.GetReturnValue());
|
||||
|
||||
|
||||
|
||||
para.ErrMsg = u8ApiBroker.GetResult("xmlmsg") as string;
|
||||
|
||||
|
||||
|
||||
|
||||
u8ApiBroker.Release();
|
||||
|
||||
if (!para.ReturnValue)
|
||||
{
|
||||
throw new Exception(para.ErrMsg);
|
||||
}
|
||||
|
||||
|
||||
return "";
|
||||
}
|
||||
catch (Exception err)
|
||||
@@ -183,7 +192,7 @@ namespace NX.ERP.U8.AP
|
||||
|
||||
|
||||
|
||||
public string AddVocher()
|
||||
public string AddVocher(NX.ERP.Model.Request.ApVouch ApVouch)
|
||||
{
|
||||
|
||||
VoucherParameter voucherParameter = new VoucherParameter
|
||||
@@ -197,15 +206,43 @@ namespace NX.ERP.U8.AP
|
||||
voucherParameter.DomHead.loadXML(HeadTemplate);
|
||||
voucherParameter.DomBody.loadXML(BodyTemplate);
|
||||
IXMLDOMElement headXml = domHead.createElement("z:row");
|
||||
|
||||
|
||||
|
||||
// headXml.setAttribute("cVenAbbName", "无锡市鑫奥");
|
||||
headXml.setAttribute("cDwCode", ApVouch.supplierCode);
|
||||
headXml.setAttribute("dVouchDate",ApVouch.Date);
|
||||
headXml.setAttribute("iExchRate", 1);
|
||||
headXml.setAttribute("iAmount_f",ApVouch.Amount);
|
||||
headXml.setAttribute("iRAmount", ApVouch.Amount);
|
||||
headXml.setAttribute("cVouchType", "P0");
|
||||
headXml.setAttribute("cTypeName", "其他应付单");
|
||||
headXml.setAttribute("cCode", "220201");
|
||||
headXml.setAttribute("cexch_name", "人民币");
|
||||
headXml.setAttribute("VT_ID", 8056);
|
||||
headXml.setAttribute("bd_c", false);
|
||||
headXml.setAttribute("bStartFlag", false);
|
||||
headXml.setAttribute("cVouchID", "");
|
||||
headXml.setAttribute("cFlag", "AP");
|
||||
headXml.setAttribute("cDeptCode", ApVouch.DeptCode);
|
||||
headXml.setAttribute("cDigest", ApVouch.Digest);
|
||||
headXml.setAttribute("cLink", "");
|
||||
IXMLDOMElement bodyXml;
|
||||
|
||||
//for (var n = 0; n < storeIn.details.Count(); n++)
|
||||
//{
|
||||
//var detail = storeIn.details[n];
|
||||
bodyXml = domBody.createElement("z:row");
|
||||
|
||||
//var detail = storeIn.details[n];
|
||||
bodyXml = domBody.createElement("z:row");
|
||||
|
||||
bodyXml.setAttribute("cDeptCode", ApVouch.DeptCode);
|
||||
bodyXml.setAttribute("cCode", "");
|
||||
bodyXml.setAttribute("iExchRate", 1);
|
||||
bodyXml.setAttribute("cexch_name", "人民币");
|
||||
bodyXml.setAttribute("iAmount", ApVouch.Amount);
|
||||
bodyXml.setAttribute("iAmount_f", ApVouch.Amount);
|
||||
bodyXml.setAttribute("iAmt_s", 0);
|
||||
bodyXml.setAttribute("cLink", "");
|
||||
headXml.setAttribute("cDwCode", ApVouch.supplierCode);
|
||||
bodyXml.setAttribute("bd_c", true);
|
||||
|
||||
domBody.selectSingleNode("//rs:data").appendChild(bodyXml);
|
||||
//}
|
||||
domHead.selectSingleNode("//rs:data").appendChild(headXml);
|
||||
var str = voucherParameter.DomBody.xml;
|
||||
@@ -216,7 +253,6 @@ namespace NX.ERP.U8.AP
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
|
||||
throw err;
|
||||
}
|
||||
|
||||
|
||||
@@ -53,11 +53,11 @@ namespace NX.ERP.U8
|
||||
cInvCCode AS MaterialTypeCode,
|
||||
cReplaceItem AS 替换件,
|
||||
cPosition AS 货位编码,
|
||||
bSale AS 是否销售,
|
||||
bPurchase AS 是否外购,
|
||||
bSelf AS 是否自制,
|
||||
bSale AS IsSale,
|
||||
bPurchase AS IsPurchase,
|
||||
bSelf AS IsSelf,
|
||||
bComsume AS 是否生产耗用,
|
||||
bProducing AS 是否在制,
|
||||
bProducing AS IsProducing,
|
||||
bService AS 是否应税劳务,
|
||||
bAccessary AS 是否成套件,
|
||||
iTaxRate AS TaxRate,
|
||||
@@ -176,7 +176,7 @@ namespace NX.ERP.U8
|
||||
iQTMethod AS 质量检验方案,
|
||||
PictureGUID AS 图片GUID,
|
||||
bPlanInv AS 是否计划品,
|
||||
bProxyForeign AS 是否委外,
|
||||
bProxyForeign AS ProxyForeign,
|
||||
bATOModel AS 是否ATO模型,
|
||||
bCheckItem AS 是否选项类,
|
||||
bPTOModel AS 是否PTO模型,
|
||||
@@ -325,13 +325,18 @@ namespace NX.ERP.U8
|
||||
where.Add(" cInvCCode = @MaterialTypeCode ");
|
||||
}
|
||||
|
||||
if (Material.ModifyDate != null)
|
||||
{
|
||||
where.Add(" dModifyDate >= @ModifyDate ");
|
||||
}
|
||||
|
||||
return this.GetList(string.Join(" and ", where.ToArray()), new
|
||||
{
|
||||
MaterialCode = Material.MaterialCode,
|
||||
MaterialName = $"%{Material.MaterialName}%",
|
||||
SpecsModel = Material.SpecsModel,
|
||||
MaterialTypeCode = Material.MaterialTypeCode
|
||||
MaterialTypeCode = Material.MaterialTypeCode,
|
||||
ModifyDate = Material.ModifyDate
|
||||
|
||||
}); ;
|
||||
|
||||
|
||||
@@ -54,5 +54,47 @@ namespace NX.ERP.U8.Mom
|
||||
}
|
||||
|
||||
|
||||
public IEnumerable<NX.ERP.Model.Response.MOM.Bom> GetList(NX.ERP.Model.Request.Bom bom)
|
||||
{
|
||||
|
||||
List<string> where = new List<string>();
|
||||
if (!string.IsNullOrEmpty(bom.ParentCode))
|
||||
{
|
||||
where.Add(" c.InvCode = @ParentCode ");
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(bom.VersionDesc))
|
||||
{
|
||||
where.Add(" a.VersionDesc like @VersionDesc ");
|
||||
}
|
||||
|
||||
if (bom.BomType.HasValue)
|
||||
{
|
||||
where.Add(" a.BomType = @BomType ");
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (bom.Version.HasValue)
|
||||
{
|
||||
where.Add(" a.Version = @Version ");
|
||||
}
|
||||
|
||||
|
||||
return this.GetList(string.Join(" and ", where.ToArray()), new
|
||||
{
|
||||
ParentCode = bom.ParentCode,
|
||||
VersionDesc =$"%{bom.VersionDesc}%",
|
||||
BomType = bom.BomType,
|
||||
Version =bom.Version,
|
||||
|
||||
|
||||
}); ;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace NX.ERP.U8.Mom
|
||||
using (var conn = U8LoginContext.Instance.Connection)
|
||||
{
|
||||
string strSQL = @"select
|
||||
a.MoId as ProductOrderId,a.moCode as ProductOrderNo,a.CreateDate as ProductDate,a.CreateUser as PreparedBy,
|
||||
a.MoId as ProductOrderId,a.moCode as ProductOrderNo,ISNULL( ModifyDate,createDate) as ModifyDate,a.CreateDate as ProductDate,a.CreateUser as PreparedBy,
|
||||
b.MoId as id ,b.MoDId as ProductOrderDtlId,b.MoId as ProductOrderId,b.MoTypeId,d.DueDate,ISNULL( b.MDeptCode,'53') as MDeptCode,a.MoCode as ProductOrderNo,
|
||||
a.CreateDate as ProductOrderDate,b.InvCode as ProductCode,b.Qty as Qty,b.SortSeq,b.SoCode,
|
||||
c.AllocateId as id ,c.AllocateId as AllocateId,c.MoDId as ProductOrderDtlId,c.InvCode as MaterialCode,b.MoId as ProductOrderId, c.IssQty as IssQty,c.Qty,
|
||||
@@ -95,11 +95,19 @@ namespace NX.ERP.U8.Mom
|
||||
{
|
||||
where.Add(" a.MoId >= @ProductOrderendID ");
|
||||
}
|
||||
|
||||
if (Params.ModifyDate!=null)
|
||||
{
|
||||
where.Add(" ISNULL( a.ModifyDate,createDate) >= @ModifyDate ");
|
||||
}
|
||||
|
||||
|
||||
return this.GetList(string.Join(" and ", where.ToArray()), new
|
||||
{
|
||||
ProductCode = $"%{Params.ProductCode}%",
|
||||
ProductOrderNo = $"{Params.ProductOrderNo}",
|
||||
ProductOrderendID = $"{Params.ProductOrderendID}"
|
||||
Params.ProductOrderendID,
|
||||
Params.ModifyDate
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -33,10 +33,7 @@ namespace NX.ERP.U8.Finance
|
||||
left join Inventory e WITH(NOLOCK) on a.cInvCode=e.cInvCode
|
||||
left join ST_SNDetail_SaleOut f WITH(NOLOCK) on a.cInvSN= f.cInvSN
|
||||
left join rdrecord32 g WITH(NOLOCK) on f.iVouchID=g.id
|
||||
left join Customer h WITH(NOLOCK) on g.cCusCode=h.cCusCode
|
||||
|
||||
|
||||
";
|
||||
left join Customer h WITH(NOLOCK) on g.cCusCode=h.cCusCode";
|
||||
|
||||
|
||||
List<string> where = new List<string>();
|
||||
|
||||
@@ -141,18 +141,14 @@ FROM MaterialAppVouch a
|
||||
public void Provide(NX.ERP.Model.Request.MaterialAppProvide provide)
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
using (var conn = U8LoginContext.Instance.Connection)
|
||||
{
|
||||
|
||||
var strSql = @"update MaterialAppVouchs set dDueDate=@DueDate,cDefine22='是',cDefine23=@SN,cDefine24=@WorkCenter";
|
||||
if (provide.Detail1.Count() != 0)
|
||||
if (provide.Detail.Count() != 0)
|
||||
{
|
||||
var mappDetails = this.GetDetailByMoCode(provide.OrderCode, provide.OrderDetailId).ToDictionary(m => m.AllocateId);
|
||||
foreach (var item in provide.Detail1)
|
||||
foreach (var item in provide.Detail)
|
||||
{
|
||||
if (mappDetails.TryGetValue(item.AllocateId, out var _mappDetails))
|
||||
{
|
||||
|
||||
@@ -18,7 +18,8 @@ namespace NX.ERP.U8.Store
|
||||
{
|
||||
using (var conn = U8LoginContext.Instance.Connection)
|
||||
{
|
||||
var sql = @"select cInvCode as MaterialCode ,cPosCode as BinCode,iQuantity as Qty from InvPositionSum where ISNULL(iQuantity,0)<>0";
|
||||
var sql = @" select a.cInvCode as MaterialCode ,cPosCode as BinCode,iQuantity as Qty,b.cInvName as MaterialName from InvPositionSum as a
|
||||
left join Inventory as b on a.cInvCode=b.cInvCode where ISNULL(iQuantity,0)<>0";
|
||||
if (!string.IsNullOrEmpty(strwhere))
|
||||
{
|
||||
sql += $" and {strwhere}";
|
||||
@@ -38,6 +39,34 @@ namespace NX.ERP.U8.Store
|
||||
}
|
||||
|
||||
|
||||
public IEnumerable<Model.Response.Store.Stock> GetList(NX.ERP.Model.Request.Stock stock)
|
||||
{
|
||||
List<string> where = new List<string>();
|
||||
if (!string.IsNullOrEmpty(stock.MaterialCode))
|
||||
{
|
||||
where.Add(" a.cInvCode = @MaterialCode ");
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(stock.MaterialName))
|
||||
{
|
||||
where.Add(" b.cInvName like @MaterialName ");
|
||||
}
|
||||
|
||||
|
||||
return this.GetList(string.Join(" and ", where.ToArray()), new
|
||||
{
|
||||
MaterialCode = stock.MaterialCode,
|
||||
MaterialName = $"%{stock.MaterialName}%",
|
||||
|
||||
|
||||
}); ;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user