添加基础信息查询的接口
This commit is contained in:
@@ -14,7 +14,7 @@ namespace NX.ERP.U8.Base
|
||||
{
|
||||
using (var conn = new System.Data.SqlClient.SqlConnection(U8LoginContext.Instance.Constr4Net))
|
||||
{
|
||||
var sql = @"select cPosCode as Code,cPosName as Name,iPosGrade,bPosEnd,cWhCode as WhCode,
|
||||
var sql = @"select cPosCode as BinCode,cPosName as BinName,iPosGrade,bPosEnd,cWhCode as WarehouseCode,
|
||||
iMaxCubage as VolumeLimit, iMaxweight as WeightLimit,cMemo,cBarCode from Position";
|
||||
if (!string.IsNullOrEmpty(strwhere))
|
||||
{
|
||||
@@ -30,7 +30,35 @@ namespace NX.ERP.U8.Base
|
||||
{
|
||||
return this.GetList(" cWhCode=@Code", new { Code });
|
||||
}
|
||||
|
||||
|
||||
|
||||
public IEnumerable<Bin> GetList(NX.ERP.Model.Request.Bin Param)
|
||||
{
|
||||
List<string> where = new List<string>();
|
||||
|
||||
if (!string.IsNullOrEmpty(Param.BinCode))
|
||||
{
|
||||
where.Add(" cPosCode like @BinCode");
|
||||
}
|
||||
|
||||
|
||||
if (!string.IsNullOrEmpty(Param.WarehouseCode))
|
||||
{
|
||||
where.Add(" cWhCode like @WarehouseCode");
|
||||
}
|
||||
|
||||
return this.GetList(string.Join(" and ", where.ToArray()), new
|
||||
{
|
||||
BinCode = $"%{Param.BinCode}%",
|
||||
WarehouseCode=$"%{Param.WarehouseCode}%"
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -16,9 +16,9 @@ namespace NX.ERP.U8
|
||||
using (var conn = new System.Data.SqlClient.SqlConnection(U8LoginContext.Instance.Constr4Net))
|
||||
{
|
||||
var sql = @"select
|
||||
cInvCode AS Code ,
|
||||
cInvCode AS MaterielCode ,
|
||||
cInvAddCode AS 存货代码,
|
||||
cInvName AS Name ,
|
||||
cInvName AS MaterielName ,
|
||||
fLength AS Length,
|
||||
fWidth AS Wide,
|
||||
fHeight AS Height,
|
||||
@@ -36,7 +36,7 @@ namespace NX.ERP.U8
|
||||
iMassDate AS 保质期数,
|
||||
cMassUnit AS 保质期单位,
|
||||
iWarnDays AS 保质期预警天数,
|
||||
cInvCCode AS InvCCode,
|
||||
cInvCCode AS MaterielTypeCode,
|
||||
cReplaceItem AS 替换件,
|
||||
cPosition AS 货位编码,
|
||||
bSale AS 是否销售,
|
||||
@@ -46,7 +46,7 @@ namespace NX.ERP.U8
|
||||
bProducing AS 是否在制,
|
||||
bService AS 是否应税劳务,
|
||||
bAccessary AS 是否成套件,
|
||||
iTaxRate AS 税率,
|
||||
iTaxRate AS TaxRate,
|
||||
iInvRCost AS InvRCost,
|
||||
iInvSPrice AS InvSPrice,
|
||||
iInvLSCost AS 最低售价,
|
||||
@@ -279,6 +279,52 @@ namespace NX.ERP.U8
|
||||
}
|
||||
|
||||
|
||||
public IEnumerable<Materiel> GetList(IEnumerable<string> codes)
|
||||
{
|
||||
return this.GetList(" cInvCode=@codes ", codes);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public IEnumerable<Materiel> GetList(NX.ERP.Model.Request.Materiel materiel)
|
||||
{
|
||||
List<string> where = new List<string>();
|
||||
if (!string.IsNullOrEmpty(materiel.MaterielCode))
|
||||
{
|
||||
where.Add(" cInvCode like @MaterielCode ");
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(materiel.MaterielName))
|
||||
{
|
||||
where.Add(" cInvName like @MaterielName ");
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(materiel.SpecsModel))
|
||||
{
|
||||
where.Add(" cInvStd like @SpecsModel ");
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (!string.IsNullOrEmpty(materiel.MaterielTypeCode))
|
||||
{
|
||||
where.Add(" cInvCCode = @MaterielTypeCode ");
|
||||
}
|
||||
|
||||
|
||||
return this.GetList(string.Join(" and ", where.ToArray()), new
|
||||
{
|
||||
MaterielCode = $"%{materiel.MaterielCode}%",
|
||||
MaterielName = $"%{materiel.MaterielName}%",
|
||||
SpecsModel = materiel.SpecsModel,
|
||||
MaterielTypeCode = materiel.MaterielTypeCode
|
||||
|
||||
}); ;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取成本
|
||||
/// </summary>
|
||||
@@ -309,7 +355,6 @@ namespace NX.ERP.U8
|
||||
case "最新成本":
|
||||
|
||||
return inv.InvNCost;
|
||||
|
||||
default:
|
||||
{
|
||||
throw new Exception("取得U8存货档案价格失败!");
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace NX.ERP.U8
|
||||
{
|
||||
using (var conn = new System.Data.SqlClient.SqlConnection(U8LoginContext.Instance.Constr4Net))
|
||||
{
|
||||
var sql = @"select cInvCCode AS Code,cInvCName AS Name from InventoryClass ";
|
||||
var sql = @"select cInvCCode AS MaterielTypeCode,cInvCName AS MaterielTypeName,bInvCEnd as IsEnd,iInvCGrade as Level from InventoryClass ";
|
||||
if (!string.IsNullOrEmpty(strWhere))
|
||||
{
|
||||
sql += $" where {strWhere}";
|
||||
@@ -21,5 +21,42 @@ namespace NX.ERP.U8
|
||||
return conn.Query<MaterielType>(sql, Param);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public IEnumerable<Model.MaterielType> GetList(NX.ERP.Model.Request.MaterielType materielType)
|
||||
{
|
||||
List<string> where = new List<string>();
|
||||
if (!string.IsNullOrEmpty(materielType.MaterielTypeCode))
|
||||
{
|
||||
where.Add(" cInvCCode like @MaterielTypeCode ");
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(materielType.MaterielTypeName))
|
||||
{
|
||||
where.Add(" cInvCName like @MaterielTypeName ");
|
||||
}
|
||||
|
||||
if (materielType.Level.HasValue)
|
||||
{
|
||||
where.Add(" iInvCGrade=@Level ");
|
||||
}
|
||||
|
||||
if (materielType.IsEnd.HasValue)
|
||||
{
|
||||
where.Add(" bInvCEnd=@IsEnd ");
|
||||
}
|
||||
return this.GetList(string.Join(" and ", where.ToArray()), new
|
||||
{
|
||||
MaterielTypeCode=$"%{materielType.MaterielTypeCode}%",
|
||||
MaterielTypeName=$"%{materielType.MaterielTypeName}%",
|
||||
materielType.Level,
|
||||
materielType.IsEnd
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -12,10 +12,10 @@ namespace NX.ERP.U8
|
||||
public IEnumerable<Warehouse> GetList(string strWhere = "", object Param = null)
|
||||
{
|
||||
|
||||
|
||||
|
||||
using (var conn = new System.Data.SqlClient.SqlConnection(U8LoginContext.Instance.Constr4Net))
|
||||
{
|
||||
var sql = "select cWhCode as Code,cWhName as Name from Warehouse";
|
||||
var sql = "select cWhCode as WarehouseCode,cWhName as WarehouseName from Warehouse";
|
||||
if (!string.IsNullOrEmpty(strWhere))
|
||||
{
|
||||
sql += $" where {strWhere}";
|
||||
@@ -23,5 +23,33 @@ namespace NX.ERP.U8
|
||||
return conn.Query<Warehouse>(sql, Param);
|
||||
}
|
||||
}
|
||||
public IEnumerable<Warehouse> GetList(NX.ERP.Model.Request.Warehouse Params)
|
||||
{
|
||||
|
||||
List<string> where = new List<string>();
|
||||
|
||||
|
||||
if (!string.IsNullOrEmpty(Params.WarehouseCode))
|
||||
{
|
||||
where.Add(" cWhCode like @WarehouseCode");
|
||||
|
||||
}
|
||||
if (!string.IsNullOrEmpty(Params.WarehouseName))
|
||||
{
|
||||
where.Add(" cWhName like @WarehouseName");
|
||||
|
||||
}
|
||||
|
||||
return this.GetList(string.Join(" and ", where.ToArray()), new
|
||||
{
|
||||
WarehouseCode = $"%{Params.WarehouseCode}%",
|
||||
WarehouseName = $"%{Params.WarehouseName}%"
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user