增加统一算法
This commit is contained in:
@@ -5,6 +5,9 @@ using System.Text;
|
|||||||
|
|
||||||
namespace NX.ERP.Model.Store
|
namespace NX.ERP.Model.Store
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 采购入库单
|
||||||
|
/// </summary>
|
||||||
public class PuStoreIn
|
public class PuStoreIn
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -14,7 +17,18 @@ namespace NX.ERP.Model.Store
|
|||||||
private string depcode;
|
private string depcode;
|
||||||
private string whcode;
|
private string whcode;
|
||||||
private ICollection<PuStoreInDetail> puStoreInDetails = new List<PuStoreInDetail>();
|
private ICollection<PuStoreInDetail> puStoreInDetails = new List<PuStoreInDetail>();
|
||||||
|
private string _puCode;
|
||||||
|
private string maker;
|
||||||
|
private string personCode;
|
||||||
public ICollection<PuStoreInDetail> PuStoreInDetails { get => puStoreInDetails; set => puStoreInDetails = value; }
|
public ICollection<PuStoreInDetail> PuStoreInDetails { get => puStoreInDetails; set => puStoreInDetails = value; }
|
||||||
|
public int Id { get => id; set => id = value; }
|
||||||
|
public string Code { get => code; set => code = value; }
|
||||||
|
public DateTime Date { get => date; set => date = value; }
|
||||||
|
public string Depcode { get => depcode; set => depcode = value; }
|
||||||
|
public string Whcode { get => whcode; set => whcode = value; }
|
||||||
|
public string PuCode { get => _puCode; set => _puCode = value; }
|
||||||
|
public string Maker { get => maker; set => maker = value; }
|
||||||
|
public string PersonCode { get => personCode; set => personCode = value; }
|
||||||
|
public string RdCode { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,12 +42,14 @@
|
|||||||
<Compile Include="Base\MaterielDAL.cs" />
|
<Compile Include="Base\MaterielDAL.cs" />
|
||||||
<Compile Include="Base\MaterielTypeDAL.cs" />
|
<Compile Include="Base\MaterielTypeDAL.cs" />
|
||||||
<Compile Include="Purchase\ArrivalDAL.cs" />
|
<Compile Include="Purchase\ArrivalDAL.cs" />
|
||||||
|
<Compile Include="Store\PuStoreInDAL.cs" />
|
||||||
<Compile Include="STVocher.cs" />
|
<Compile Include="STVocher.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<Compile Include="Base\SupplierDAL.cs" />
|
<Compile Include="Base\SupplierDAL.cs" />
|
||||||
<Compile Include="U8LoginContext.cs" />
|
<Compile Include="U8LoginContext.cs" />
|
||||||
<Compile Include="Base\UnitDAL.cs" />
|
<Compile Include="Base\UnitDAL.cs" />
|
||||||
<Compile Include="Base\WarehouseDAL.cs" />
|
<Compile Include="Base\WarehouseDAL.cs" />
|
||||||
|
<Compile Include="VoucherParameter.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="ADODB, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
<Reference Include="ADODB, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
|
|||||||
44
NX.ERP.U8/Store/PuStoreInDAL.cs
Normal file
44
NX.ERP.U8/Store/PuStoreInDAL.cs
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
using MSXML2;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using UFIDA.U8.U8APIFramework;
|
||||||
|
using UFIDA.U8.U8APIFramework.Parameter;
|
||||||
|
using UFIDA.U8.U8MOMAPIFramework;
|
||||||
|
|
||||||
|
namespace NX.ERP.U8.Store
|
||||||
|
{
|
||||||
|
public class PuStoreInDAL
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 保存一个采购到货单
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="puStoreIn"></param>
|
||||||
|
public void AddPuStoreIn(Model.Store.PuStoreIn puStoreIn)
|
||||||
|
{
|
||||||
|
VoucherParameter voucherParameter = new VoucherParameter();
|
||||||
|
voucherParameter.VoucherType = "01";
|
||||||
|
voucherParameter.DomHead = new DOMDocumentClass();
|
||||||
|
voucherParameter.DomBody = new DOMDocumentClass();
|
||||||
|
|
||||||
|
IXMLDOMElement iXMLDOMElement = voucherParameter.DomHead.createElement("z:row");
|
||||||
|
iXMLDOMElement.setAttribute("biafirst", "0");
|
||||||
|
iXMLDOMElement.setAttribute("bpufirst", "0");
|
||||||
|
iXMLDOMElement.setAttribute("bisstqc", "0");
|
||||||
|
iXMLDOMElement.setAttribute("bomfirst", "0");
|
||||||
|
iXMLDOMElement.setAttribute("brdflag", 1);
|
||||||
|
iXMLDOMElement.setAttribute("ccode", puStoreIn.Code);
|
||||||
|
iXMLDOMElement.setAttribute("ddate", puStoreIn.Date.ToShortDateString());
|
||||||
|
iXMLDOMElement.setAttribute("cmaker", puStoreIn.Maker);
|
||||||
|
iXMLDOMElement.setAttribute("cvouchtype", "01");
|
||||||
|
///iXMLDOMElement.setAttribute("vt_id", ((U8ApiInterfaceBase)u8STApiInterface).get_Util().GetDefaltVTID("24", "", ""));
|
||||||
|
iXMLDOMElement.setAttribute("editprop", "A");
|
||||||
|
iXMLDOMElement.setAttribute("cdepcode", puStoreIn.Depcode);
|
||||||
|
iXMLDOMElement.setAttribute("cpersoncode", puStoreIn.PersonCode);
|
||||||
|
iXMLDOMElement.setAttribute("crdcode", puStoreIn.RdCode);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,8 +1,10 @@
|
|||||||
using System;
|
using MSXML2;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using U8Login;
|
using U8Login;
|
||||||
|
using UFIDA.U8.U8APIFramework;
|
||||||
|
using UFIDA.U8.U8MOMAPIFramework;
|
||||||
|
|
||||||
namespace NX.ERP.U8
|
namespace NX.ERP.U8
|
||||||
{
|
{
|
||||||
@@ -131,5 +133,101 @@ namespace NX.ERP.U8
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void AddRdVoucher(VoucherParameter para)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
U8EnvContext u8EnvContext = new U8EnvContext();
|
||||||
|
u8EnvContext.U8Login =this.ClsLogin;
|
||||||
|
|
||||||
|
U8ApiAddress apiAddress = new U8ApiAddress("");
|
||||||
|
U8ApiBroker u8ApiBroker = new U8ApiBroker(apiAddress, u8EnvContext);
|
||||||
|
u8ApiBroker.AssignNormalValue("sVouchType", para.VoucherType);
|
||||||
|
u8ApiBroker.AssignNormalValue("DomHead", para.DomHead);
|
||||||
|
u8ApiBroker.AssignNormalValue("domBody", para.DomBody);
|
||||||
|
if (para.DomPosition != null && para.DomPosition.selectNodes("//z:row").length != 0)
|
||||||
|
{
|
||||||
|
u8ApiBroker.AssignNormalValue("domPosition", para.DomPosition);
|
||||||
|
}
|
||||||
|
u8ApiBroker.AssignNormalValue("cnnFrom", para.Connection);
|
||||||
|
if (para.DOMMsg != null)
|
||||||
|
{
|
||||||
|
u8ApiBroker.AssignNormalValue("domMsg", para.DOMMsg);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
u8ApiBroker.AssignNormalValue("domMsg", new DOMDocumentClass());
|
||||||
|
}
|
||||||
|
u8ApiBroker.AssignNormalValue("bCheck", para.IsCheck);
|
||||||
|
u8ApiBroker.AssignNormalValue("bBeforCheckStock", para.IsBeforCheckStock);
|
||||||
|
u8ApiBroker.AssignNormalValue("bIsRedVouch", para.IsRedVouch);
|
||||||
|
u8ApiBroker.AssignNormalValue("sAddedState", para.AddedState);
|
||||||
|
u8ApiBroker.AssignNormalValue("bReMote", para.IsReMote);
|
||||||
|
if (!u8ApiBroker.Invoke())
|
||||||
|
{
|
||||||
|
Exception exception = u8ApiBroker.GetException();
|
||||||
|
if (exception != null)
|
||||||
|
{
|
||||||
|
if (exception is MomSysException)
|
||||||
|
{
|
||||||
|
MomSysException ex = exception as MomSysException;
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (exception is MomBizException)
|
||||||
|
{
|
||||||
|
MomBizException ex2 = exception as MomBizException;
|
||||||
|
|
||||||
|
}
|
||||||
|
string exceptionString = u8ApiBroker.GetExceptionString();
|
||||||
|
if (exceptionString.Length != 0)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
para.ReturnValue = false;
|
||||||
|
|
||||||
|
u8ApiBroker.Release();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
para.ReturnValue = Convert.ToBoolean(u8ApiBroker.GetReturnValue());
|
||||||
|
para.DOMMsg = u8ApiBroker.GetResult("domMsg") as DOMDocument;
|
||||||
|
para.ErrMsg = u8ApiBroker.GetResult("errMsg") as string;
|
||||||
|
if (para.ReturnValue)
|
||||||
|
{
|
||||||
|
para.VoucherId = u8ApiBroker.GetResult("VouchId") as string;
|
||||||
|
if (para.VoucherType.Equals("12"))
|
||||||
|
{
|
||||||
|
//para.VoucherCode = base.Util.GetTransVoucherCode(para.VoucherId);
|
||||||
|
}
|
||||||
|
else if (para.VoucherType.Equals("18"))
|
||||||
|
{
|
||||||
|
//para.VoucherCode = base.Util.GetCheckVoucherCode(para.VoucherId);
|
||||||
|
}
|
||||||
|
else if (para.VoucherType.Equals("19"))
|
||||||
|
{
|
||||||
|
// para.VoucherCode = base.Util.GetAdjustVoucherCode(para.VoucherId);
|
||||||
|
//if (base.Util.dbHelper.U8ExcuteNoneQuery("Update AdjustPVouchs Set cVouchCode = '" + para.VoucherCode + "' Where id = " + para.VoucherId) == 0)
|
||||||
|
//{
|
||||||
|
// para.ErrMsg = "更新货位调整单子表单号失败!";
|
||||||
|
// para.ReturnValue = false;
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//para.VoucherCode = base.Util.GetSTVoucherCode(para.VoucherId, para.VoucherType);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
u8ApiBroker.Release();
|
||||||
|
}
|
||||||
|
catch (Exception ex3)
|
||||||
|
{
|
||||||
|
// Log.WriteLog(ex3);
|
||||||
|
throw new Exception("增加供应链库存单据失败!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
278
NX.ERP.U8/VoucherParameter.cs
Normal file
278
NX.ERP.U8/VoucherParameter.cs
Normal file
@@ -0,0 +1,278 @@
|
|||||||
|
using ADODB;
|
||||||
|
using MSXML2;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace NX.ERP.U8
|
||||||
|
{
|
||||||
|
public class VoucherParameter
|
||||||
|
{
|
||||||
|
private string voucherType;
|
||||||
|
|
||||||
|
private DOMDocument domHead;
|
||||||
|
|
||||||
|
private DOMDocument domBody;
|
||||||
|
|
||||||
|
private DOMDocument domPosition;
|
||||||
|
|
||||||
|
private string errMsg;
|
||||||
|
|
||||||
|
private string voucherId;
|
||||||
|
|
||||||
|
private DOMDocument domMsg;
|
||||||
|
|
||||||
|
private bool isCheck;
|
||||||
|
|
||||||
|
private bool isBeforCheckStock;
|
||||||
|
|
||||||
|
private bool isRedVouch;
|
||||||
|
|
||||||
|
private bool isReMote;
|
||||||
|
|
||||||
|
private string addedState;
|
||||||
|
|
||||||
|
private object timeStamp;
|
||||||
|
|
||||||
|
private string voucherCode;
|
||||||
|
|
||||||
|
private ADODB.Connection connection;
|
||||||
|
|
||||||
|
|
||||||
|
private bool returnValue;
|
||||||
|
|
||||||
|
private string strWhere;
|
||||||
|
|
||||||
|
private bool isGetBlank;
|
||||||
|
|
||||||
|
private string sBodyWhere_Order;
|
||||||
|
|
||||||
|
public string SBodyWhere_Order
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return sBodyWhere_Order;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
sBodyWhere_Order = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool IsGetBlank
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return isGetBlank;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
isGetBlank = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public string StrWhere
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return strWhere;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
strWhere = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool ReturnValue
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return returnValue;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
returnValue = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public string VoucherCode
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return voucherCode;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
voucherCode = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public string VoucherType
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return voucherType;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
voucherType = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public DOMDocument DomHead
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return domHead;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
domHead = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public DOMDocument DomBody
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return domBody;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
domBody = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public DOMDocument DomPosition
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return domPosition;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
domPosition = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public string ErrMsg
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return errMsg;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
errMsg = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public string VoucherId
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return voucherId;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
voucherId = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public DOMDocument DOMMsg
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return domMsg;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
domMsg = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool IsCheck
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return isCheck;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
isCheck = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool IsBeforCheckStock
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return isBeforCheckStock;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
isBeforCheckStock = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool IsRedVouch
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return isRedVouch;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
isRedVouch = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool IsReMote
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return isReMote;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
isReMote = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public string AddedState
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return addedState;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
addedState = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public object TimeStamp
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return timeStamp;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
timeStamp = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Connection Connection { get => connection; set => connection = value; }
|
||||||
|
|
||||||
|
public VoucherParameter()
|
||||||
|
{
|
||||||
|
|
||||||
|
isCheck = true;
|
||||||
|
isBeforCheckStock = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user