修正名称的错误
This commit is contained in:
@@ -7,9 +7,9 @@ using NX.ERP.Model;
|
||||
|
||||
namespace NX.ERP.U8
|
||||
{
|
||||
public class MaterielDAL
|
||||
public class MaterialDAL
|
||||
{
|
||||
public IEnumerable<Materiel> GetList(string strWhere = "", object Param = null)
|
||||
public IEnumerable<Material> GetList(string strWhere = "", object Param = null)
|
||||
{
|
||||
|
||||
|
||||
@@ -18,9 +18,9 @@ namespace NX.ERP.U8
|
||||
{
|
||||
|
||||
var sql = @"select
|
||||
cInvCode AS MaterielCode ,
|
||||
cInvCode AS MaterialCode ,
|
||||
cInvAddCode AS 存货代码,
|
||||
cInvName AS MaterielName ,
|
||||
cInvName AS MaterialName ,
|
||||
fLength AS Length,
|
||||
fWidth AS Wide,
|
||||
fHeight AS Height,
|
||||
@@ -38,7 +38,7 @@ namespace NX.ERP.U8
|
||||
iMassDate AS 保质期数,
|
||||
cMassUnit AS 保质期单位,
|
||||
iWarnDays AS 保质期预警天数,
|
||||
cInvCCode AS MaterielTypeCode,
|
||||
cInvCCode AS MaterialTypeCode,
|
||||
cReplaceItem AS 替换件,
|
||||
cPosition AS 货位编码,
|
||||
bSale AS 是否销售,
|
||||
@@ -270,56 +270,56 @@ namespace NX.ERP.U8
|
||||
{
|
||||
sql += $" where {strWhere}";
|
||||
}
|
||||
return conn.Query<Materiel>(sql, Param);
|
||||
return conn.Query<Material>(sql, Param);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public Materiel GetModel(string Code)
|
||||
public Material GetModel(string Code)
|
||||
{
|
||||
return this.GetList(" cInvCode=@Code ", new { Code }).FirstOrDefault();
|
||||
}
|
||||
|
||||
|
||||
public IEnumerable<Materiel> GetList(IEnumerable<string> codes)
|
||||
public IEnumerable<Material> GetList(IEnumerable<string> codes)
|
||||
{
|
||||
return this.GetList(" cInvCode in @codes ",new { codes });
|
||||
}
|
||||
|
||||
|
||||
|
||||
public IEnumerable<Materiel> GetList(NX.ERP.Model.Request.Materiel materiel)
|
||||
public IEnumerable<Material> GetList(NX.ERP.Model.Request.Material Material)
|
||||
{
|
||||
List<string> where = new List<string>();
|
||||
if (!string.IsNullOrEmpty(materiel.MaterielCode))
|
||||
if (!string.IsNullOrEmpty(Material.MaterialCode))
|
||||
{
|
||||
where.Add(" cInvCode like @MaterielCode ");
|
||||
where.Add(" cInvCode like @MaterialCode ");
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(materiel.MaterielName))
|
||||
if (!string.IsNullOrEmpty(Material.MaterialName))
|
||||
{
|
||||
where.Add(" cInvName like @MaterielName ");
|
||||
where.Add(" cInvName like @MaterialName ");
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(materiel.SpecsModel))
|
||||
if (!string.IsNullOrEmpty(Material.SpecsModel))
|
||||
{
|
||||
where.Add(" cInvStd like @SpecsModel ");
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (!string.IsNullOrEmpty(materiel.MaterielTypeCode))
|
||||
if (!string.IsNullOrEmpty(Material.MaterialTypeCode))
|
||||
{
|
||||
where.Add(" cInvCCode = @MaterielTypeCode ");
|
||||
where.Add(" cInvCCode = @MaterialTypeCode ");
|
||||
}
|
||||
|
||||
|
||||
return this.GetList(string.Join(" and ", where.ToArray()), new
|
||||
{
|
||||
MaterielCode = $"%{materiel.MaterielCode}%",
|
||||
MaterielName = $"%{materiel.MaterielName}%",
|
||||
SpecsModel = materiel.SpecsModel,
|
||||
MaterielTypeCode = materiel.MaterielTypeCode
|
||||
MaterialCode = $"%{Material.MaterialCode}%",
|
||||
MaterialName = $"%{Material.MaterialName}%",
|
||||
SpecsModel = Material.SpecsModel,
|
||||
MaterialTypeCode = Material.MaterialTypeCode
|
||||
|
||||
}); ;
|
||||
|
||||
|
||||
@@ -7,50 +7,50 @@ using NX.ERP.Model;
|
||||
|
||||
namespace NX.ERP.U8
|
||||
{
|
||||
public class MaterielTypeDAL
|
||||
public class MaterialTypeDAL
|
||||
{
|
||||
public IEnumerable<MaterielType> GetList(string strWhere = "", object Param = null)
|
||||
public IEnumerable<MaterialType> GetList(string strWhere = "", object Param = null)
|
||||
{
|
||||
using (var conn = U8LoginContext.Instance.Connection)
|
||||
{
|
||||
var sql = @"select cInvCCode AS MaterielTypeCode,cInvCName AS MaterielTypeName,bInvCEnd as MaterialTypeIsend,iInvCGrade as MaterialTypeGrade from InventoryClass ";
|
||||
var sql = @"select cInvCCode AS MaterialTypeCode,cInvCName AS MaterialTypeName,bInvCEnd as MaterialTypeIsend,iInvCGrade as MaterialTypeGrade from InventoryClass ";
|
||||
if (!string.IsNullOrEmpty(strWhere))
|
||||
{
|
||||
sql += $" where {strWhere}";
|
||||
}
|
||||
return conn.Query<MaterielType>(sql, Param);
|
||||
return conn.Query<MaterialType>(sql, Param);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public IEnumerable<Model.MaterielType> GetList(NX.ERP.Model.Request.MaterielType materielType)
|
||||
public IEnumerable<Model.MaterialType> GetList(NX.ERP.Model.Request.MaterialType MaterialType)
|
||||
{
|
||||
List<string> where = new List<string>();
|
||||
if (!string.IsNullOrEmpty(materielType.MaterielTypeCode))
|
||||
if (!string.IsNullOrEmpty(MaterialType.MaterialTypeCode))
|
||||
{
|
||||
where.Add(" cInvCCode like @MaterielTypeCode ");
|
||||
where.Add(" cInvCCode like @MaterialTypeCode ");
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(materielType.MaterielTypeName))
|
||||
if (!string.IsNullOrEmpty(MaterialType.MaterialTypeName))
|
||||
{
|
||||
where.Add(" cInvCName like @MaterielTypeName ");
|
||||
where.Add(" cInvCName like @MaterialTypeName ");
|
||||
}
|
||||
|
||||
if (!materielType.MaterialTypeGrade.HasValue)
|
||||
if (MaterialType.MaterialTypeGrade.HasValue)
|
||||
{
|
||||
where.Add(" iInvCGrade=@Level ");
|
||||
}
|
||||
|
||||
if (!materielType.MaterialTypeIsend.HasValue)
|
||||
if (MaterialType.MaterialTypeIsend.HasValue)
|
||||
{
|
||||
where.Add(" bInvCEnd=@MaterialTypeIsend ");
|
||||
}
|
||||
return this.GetList(string.Join(" and ", where.ToArray()), new
|
||||
{
|
||||
MaterielTypeCode=$"%{materielType.MaterielTypeCode}%",
|
||||
MaterielTypeName=$"%{materielType.MaterielTypeName}%",
|
||||
materielType.MaterialTypeGrade,
|
||||
materielType.MaterialTypeIsend
|
||||
MaterialTypeCode=$"%{MaterialType.MaterialTypeCode}%",
|
||||
MaterialTypeName=$"%{MaterialType.MaterialTypeName}%",
|
||||
MaterialType.MaterialTypeGrade,
|
||||
MaterialType.MaterialTypeIsend
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ namespace NX.ERP.U8.Mom
|
||||
|
||||
if (!string.IsNullOrEmpty(Params.ProductCode))
|
||||
{
|
||||
where.Add(" b.InvCode like @ ProductCode");
|
||||
where.Add(" b.InvCode like @ProductCode");
|
||||
}
|
||||
if (!string.IsNullOrEmpty(Params.ProductOrderNo))
|
||||
{
|
||||
@@ -128,7 +128,7 @@ namespace NX.ERP.U8.Mom
|
||||
|
||||
if (!string.IsNullOrEmpty(Params.ProductCode))
|
||||
{
|
||||
where.Add(" b.InvCode like @ ProductCode");
|
||||
where.Add(" b.InvCode like @ProductCode");
|
||||
}
|
||||
if (!string.IsNullOrEmpty(Params.ProductOrderNo))
|
||||
{
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace NX.ERP.U8.Purchase
|
||||
{
|
||||
string strSQL = @"select a.id AS ArrivalId,a.cCode as ArrivalCode,A.cbustype AS busType,a.cptcode as PTCode,a.iTaxRate as TaxRate,a.iexchrate as Exchrate,cexch_name as ExchName,cVenCode as VenCode,a.dDate as ArrivalDate,A.cVenCode AS SupplierCode,
|
||||
B.Autoid as id,b.ID as ArrivalID,
|
||||
b.cInvCode AS MaterielCode,
|
||||
b.cInvCode AS MaterialCode,
|
||||
b.cBatch AS BatchNo,
|
||||
b.cUnitID AS UnitCode,b.ioricost as oricost,b.ioritaxcost as oritaxcost ,b.icost as cost,b.iorimoney as orimoney,b.ioritaxprice as oritaxprice,b.iorisum as orisum,
|
||||
B.iQuantity as Quantity,b.iposid as PosId ,B.CORDERCODE as OrderCode,C.POID as Poid from
|
||||
|
||||
@@ -11,17 +11,17 @@ using UFIDA.U8.U8MOMAPIFramework;
|
||||
|
||||
namespace NX.ERP.U8.Store
|
||||
{
|
||||
public class MaterielStoreOutDAL : VoucherBase
|
||||
public class MaterialStoreOutDAL : VoucherBase
|
||||
{
|
||||
|
||||
public MaterielStoreOutDAL() : base("11", "U8API/MaterialOut")
|
||||
public MaterialStoreOutDAL() : base("11", "U8API/MaterialOut")
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public string AddVocher(Model.Request.MaterielStoreOut storeOut)
|
||||
public string AddVocher(Model.Request.MaterialStoreOut storeOut)
|
||||
{
|
||||
VoucherParameter voucherParameter = new VoucherParameter
|
||||
{
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace NX.ERP.U8.Store
|
||||
var detail = storeIn.Details[n];
|
||||
bodyXml.setAttribute("cinvcode", detail.InvCode);
|
||||
bodyXml.setAttribute("iquantity", detail.Quantity);
|
||||
var _cost = new MaterielDAL().GetCost(detail.InvCode, 0);
|
||||
var _cost = new MaterialDAL().GetCost(detail.InvCode, 0);
|
||||
bodyXml.setAttribute("iunitcost", _cost);
|
||||
bodyXml.setAttribute("iprice", new Account.Accinformation().FormatMoney(_cost * detail.Quantity));
|
||||
bodyXml.setAttribute("irowno", n + 1);
|
||||
|
||||
@@ -10,6 +10,7 @@ namespace NX.ERP.U8
|
||||
{
|
||||
public class U8LoginContext : IDisposable
|
||||
{
|
||||
private static readonly object locker = new object();
|
||||
private static U8LoginContext _u8LoginContext;
|
||||
private string EaiPort = System.Configuration.ConfigurationManager.AppSettings["EaiPort"];
|
||||
private string EaiPath = System.Configuration.ConfigurationManager.AppSettings["EaiPath"];
|
||||
@@ -19,7 +20,14 @@ namespace NX.ERP.U8
|
||||
{
|
||||
if (_u8LoginContext == null)
|
||||
{
|
||||
_u8LoginContext = new U8LoginContext();
|
||||
lock (locker)
|
||||
{
|
||||
if (_u8LoginContext == null)
|
||||
{
|
||||
_u8LoginContext = new U8LoginContext();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return _u8LoginContext;
|
||||
}
|
||||
@@ -39,15 +47,26 @@ namespace NX.ERP.U8
|
||||
public U8LoginContext()
|
||||
{
|
||||
}
|
||||
private static readonly object locker1 = new object();
|
||||
|
||||
public clsLogin ClsLogin
|
||||
{
|
||||
get
|
||||
{
|
||||
|
||||
|
||||
if (this._clslogin == null)
|
||||
{
|
||||
this.Login();
|
||||
lock (locker1)
|
||||
{
|
||||
if (this._clslogin == null)
|
||||
{
|
||||
this.Login();
|
||||
}
|
||||
}
|
||||
}
|
||||
return this._clslogin;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +78,7 @@ namespace NX.ERP.U8
|
||||
return new System.Data.SqlClient.SqlConnection(this.Constr4Net);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -160,7 +179,7 @@ namespace NX.ERP.U8
|
||||
get
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
return $"http://{this.ClsLogin.cServer}:{EaiPort}/{EaiPath}";
|
||||
|
||||
@@ -218,6 +237,7 @@ namespace NX.ERP.U8
|
||||
{
|
||||
get
|
||||
{
|
||||
|
||||
if (uiLogin == null)
|
||||
{
|
||||
uiLogin = new UFSoft.U8.Framework.Login.UI.clsLogin();
|
||||
@@ -246,6 +266,10 @@ namespace NX.ERP.U8
|
||||
|
||||
public void Login()
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
if (NeedUiLogin)
|
||||
{
|
||||
if (!UiLogin.login("DP"))
|
||||
@@ -275,7 +299,6 @@ namespace NX.ERP.U8
|
||||
}
|
||||
_clslogin.set_TaskId(UiLogin.GetTaskID("ST"));
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user