修正名称的错误

This commit is contained in:
admin
2021-01-28 10:10:32 +08:00
parent 72c0e2e8c8
commit 2f12959be0
24 changed files with 147 additions and 122 deletions

View File

@@ -9,7 +9,7 @@ namespace NX.ERP.BLL.Model
{
public string OutboundNo { get; set; }
public DateTime OutboundDate { get; set; }
public OutBoundType OutBoundType { get; set; }
public OutBoundType OutboundType { get; set; }
public string WarehouseCode { get; set; }

View File

@@ -8,7 +8,7 @@ namespace NX.ERP.BLL.Model
public enum OutBoundType
{
SaleOut=1,
MaterielOut=2,
MaterialOut=2,
OtherOut=3
//1:销售出库;2:原材料出库;3:其它出库

View File

@@ -12,10 +12,10 @@ namespace NX.ERP.BLL.Store
{
string ID = "";
if (outBound.OutBoundType == Model.OutBoundType.MaterielOut)
if (outBound.OutboundType == Model.OutBoundType.MaterialOut)
{
var dal = new U8.Store.MaterielStoreOutDAL();
ID = dal.AddVocher(new ERP.Model.Request.MaterielStoreOut()
var dal = new U8.Store.MaterialStoreOutDAL();
ID = dal.AddVocher(new ERP.Model.Request.MaterialStoreOut()
{
Code= "191000000007",
Date = outBound.OutboundDate,
@@ -26,7 +26,7 @@ namespace NX.ERP.BLL.Store
Details = outBound.OutboundDtlLst.ConvertAll(m =>
{
return new ERP.Model.Request.MaterielStoreOutDetail()
return new ERP.Model.Request.MaterialStoreOutDetail()
{
InvCode = m.MaterialCode,
@@ -39,7 +39,7 @@ namespace NX.ERP.BLL.Store
});
}
if (outBound.OutBoundType == Model.OutBoundType.SaleOut)
if (outBound.OutboundType == Model.OutBoundType.SaleOut)
{
var dal = new U8.Store.SaleOutDAL();
ID = dal.AddVoucher(new ERP.Model.Request.SaleStoreOut()
@@ -63,7 +63,7 @@ namespace NX.ERP.BLL.Store
});
}
if (outBound.OutBoundType == Model.OutBoundType.OtherOut)
if (outBound.OutboundType == Model.OutBoundType.OtherOut)
{
var dal = new U8.Store.OtherStoreOutDAL();
ID = dal.AddVocher(new ERP.Model.Request.OtherStoreInOut()

View File

@@ -5,16 +5,16 @@ using System.Text;
namespace NX.ERP.Model.Request
{
public class Materiel: BaseModel
public class Material: BaseModel
{
private string _code;
private string _name;
public string MaterielCode { get => _code; set => _code = value; }
public string MaterielName { get => _name; set => _name = value; }
public string MaterialCode { get => _code; set => _code = value; }
public string MaterialName { get => _name; set => _name = value; }
public string MaterielTypeCode { get; set; }
public string MaterialTypeCode { get; set; }
public string SpecsModel { get; set; }

View File

@@ -5,7 +5,7 @@ using System.Text;
namespace NX.ERP.Model.Request
{
public class MaterielStoreOut
public class MaterialStoreOut
{
private int id;
private string code;
@@ -15,7 +15,7 @@ namespace NX.ERP.Model.Request
private string sourceCode;
private string source;
private string maker;
private IList<MaterielStoreOutDetail> details;
private IList<MaterialStoreOutDetail> details;
public int Id { get => id; set => id = value; }
public string Code { get => code; set => code = value; }
@@ -23,7 +23,7 @@ namespace NX.ERP.Model.Request
public string SourceCode { get => sourceCode; set => sourceCode = value; }
public string Source { get => source; set => source = value; }
public DateTime Date { get => date; set => date = value; }
public IList<MaterielStoreOutDetail> Details { get => details; set => details = value; }
public IList<MaterialStoreOutDetail> Details { get => details; set => details = value; }
public string Maker { get => maker; set => maker = value; }
}
}

View File

@@ -5,7 +5,7 @@ using System.Text;
namespace NX.ERP.Model.Request
{
public class MaterielStoreOutDetail
public class MaterialStoreOutDetail
{
private double quantity;

View File

@@ -5,15 +5,15 @@ using System.Text;
namespace NX.ERP.Model.Request
{
public class MaterielType: BaseModel
public class MaterialType: BaseModel
{
private string materielTypeCode;
private string materielTypeName;
private string _MaterialTypeCode;
private string _MaterialTypeName;
private int? _level;
private int? _isEnd;
public string MaterielTypeCode { get => materielTypeCode; set => materielTypeCode = value; }
public string MaterielTypeName { get => materielTypeName; set => materielTypeName = value; }
public string MaterialTypeCode { get => _MaterialTypeCode; set => _MaterialTypeCode = value; }
public string MaterialTypeName { get => _MaterialTypeName; set => _MaterialTypeName = value; }
public int? MaterialTypeGrade { get => _level; set => _level = value; }
public int? MaterialTypeIsend { get => _isEnd; set => _isEnd = value; }
}

View File

@@ -5,7 +5,7 @@ using System.Text;
namespace NX.ERP.Model
{
public class Materiel: BaseModel
public class Material: BaseModel
{
private string _code;
private string _name;
@@ -21,11 +21,11 @@ namespace NX.ERP.Model
private int minStock;
private int aql;
private int invccode;
public string MaterielCode { get => _code; set => _code = value; }
public string MaterielName { get => _name; set => _name = value; }
public string MaterialCode { get => _code; set => _code = value; }
public string MaterialName { get => _name; set => _name = value; }
public string MaterielTypeCode { get; set; }
public string MaterialTypeCode { get; set; }
public string SpecsModel { get; set; }

View File

@@ -5,15 +5,15 @@ using System.Text;
namespace NX.ERP.Model
{
public class MaterielType: BaseModel
public class MaterialType: BaseModel
{
private string materielTypeCode;
private string materielTypeName;
private string _MaterialTypeCode;
private string _MaterialTypeName;
private int? _level;
private int? _isEnd;
public string MaterielTypeCode { get => materielTypeCode; set => materielTypeCode = value; }
public string MaterielTypeName { get => materielTypeName; set => materielTypeName = value; }
public string MaterialTypeCode { get => _MaterialTypeCode; set => _MaterialTypeCode = value; }
public string MaterialTypeName { get => _MaterialTypeName; set => _MaterialTypeName = value; }
public int? MaterialTypeGrade { get => _level; set => _level = value; }
public int? MaterialTypeIsend { get => _isEnd; set => _isEnd = value; }
}

View File

@@ -11,10 +11,10 @@ namespace NX.ERP.Model.Purchase
public class ArrivalDetail
{
private int id;
private string materielCode;
private string _MaterialCode;
public int ArrivalDtlId { get => id; set => id = value; }
public int ArrivalID { get => arrivalID; set => arrivalID = value; }
public string MaterialCode { get => materielCode; set => materielCode = value; }
public string MaterialCode { get => _MaterialCode; set => _MaterialCode = value; }
public string BatchNo { get => batchNo; set => batchNo = value; }
public string UnitCode { get => unitCode; set => unitCode = value; }
public double Qty { get => quantity; set => quantity = value; }

View File

@@ -5,7 +5,7 @@ using System.Text;
namespace NX.ERP.Model.Store
{
public class MaterielStoreOut
public class MaterialStoreOut
{
private int id;
private string code;
@@ -14,7 +14,7 @@ namespace NX.ERP.Model.Store
private DateTime date;
private string sourceCode;
private string source;
private IList<MaterielStoreOutDetail> details;
private IList<MaterialStoreOutDetail> details;
public int Id { get => id; set => id = value; }
public string Code { get => code; set => code = value; }
@@ -23,6 +23,6 @@ namespace NX.ERP.Model.Store
public string SourceCode { get => sourceCode; set => sourceCode = value; }
public string Source { get => source; set => source = value; }
public DateTime Date { get => date; set => date = value; }
public IList<MaterielStoreOutDetail> Details { get => details; set => details = value; }
public IList<MaterialStoreOutDetail> Details { get => details; set => details = value; }
}
}

View File

@@ -5,7 +5,7 @@ using System.Text;
namespace NX.ERP.Model.Store
{
public class MaterielStoreOutDetail
public class MaterialStoreOutDetail
{
private double quantity;

View File

@@ -181,7 +181,7 @@ namespace U8AppMain
list.Add(row["存货编码"].ToString().Trim());
}
var InvInfo = new NX.ERP.U8.MaterielDAL().GetList(list).ToDictionary((m) => { return m.MaterielCode; });
var InvInfo = new NX.ERP.U8.MaterialDAL().GetList(list).ToDictionary((m) => { return m.MaterialCode; });
//构造数据
foreach (DataRow row in this.dataTable.Rows)
@@ -343,8 +343,8 @@ namespace U8AppMain
//var a = new STVocher();
//a.AddVocher();
var a = new NX.ERP.U8.Store.MaterielStoreOutDAL();
a.AddVocher(new NX.ERP.Model.Request.MaterielStoreOut()
var a = new NX.ERP.U8.Store.MaterialStoreOutDAL();
a.AddVocher(new NX.ERP.Model.Request.MaterialStoreOut()
{
Id = 1111,
Code = "2222",
@@ -353,9 +353,9 @@ namespace U8AppMain
Whcode = "2",
Date = DateTime.Now,
Details = new List<NX.ERP.Model.Request.MaterielStoreOutDetail>()
Details = new List<NX.ERP.Model.Request.MaterialStoreOutDetail>()
{
new NX.ERP.Model.Request.MaterielStoreOutDetail()
new NX.ERP.Model.Request.MaterialStoreOutDetail()
{
Position="002070206",
InvCode="218174",

View File

@@ -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
}); ;

View File

@@ -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
});
}

View File

@@ -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))
{

View File

@@ -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

View File

@@ -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
{

View File

@@ -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);

View File

@@ -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"));
}

View File

@@ -17,21 +17,21 @@ using System.Web.Http.Filters;
namespace NX.ERP.WebAPi
{
//public class JsonContentNegotiator : IContentNegotiator
//{
// private readonly JsonMediaTypeFormatter _jsonFormatter;
public class JsonContentNegotiator : IContentNegotiator
{
private readonly JsonMediaTypeFormatter _jsonFormatter;
// public JsonContentNegotiator(JsonMediaTypeFormatter formatter)
// {
// _jsonFormatter = formatter;
// }
public JsonContentNegotiator(JsonMediaTypeFormatter formatter)
{
_jsonFormatter = formatter;
}
// public ContentNegotiationResult Negotiate(Type type, HttpRequestMessage request, IEnumerable<MediaTypeFormatter> formatters)
// {
// var result = new ContentNegotiationResult(_jsonFormatter, new MediaTypeHeaderValue("application/json"));
// return result;
// }
//}
public ContentNegotiationResult Negotiate(Type type, HttpRequestMessage request, IEnumerable<MediaTypeFormatter> formatters)
{
var result = new ContentNegotiationResult(_jsonFormatter, new MediaTypeHeaderValue("application/json"));
return result;
}
}
public static class WebApiConfig
{
public static void Register(HttpConfiguration config)
@@ -45,6 +45,8 @@ namespace NX.ERP.WebAPi
NX.ERP.U8.U8LoginContext.Instance.Server= System.Configuration.ConfigurationManager.AppSettings["Server"];
//optional: set serializer settings here
//System.Web.Http.Filters.IExceptionFilter
config.Filters.Add(new ExceptionFilter());
config.Filters.Add(new ApiResultAttribute());

View File

@@ -8,23 +8,23 @@ using System.Web.Http;
namespace NX.ERP.WebAPi.Controllers
{
public class MaterielController : ApiController
public class MaterialController : ApiController
{
[Obsolete]
[Route("api/Materiel/List")]
[Route("api/Material/List")]
[HttpGet]
public IEnumerable<Materiel> List()
public IEnumerable<Material> List()
{
var materielDAL = new MaterielDAL();
return materielDAL.GetList();
var MaterialDAL = new MaterialDAL();
return MaterialDAL.GetList();
}
[Route("api/Materiel/Query")]
[Route("api/Material/Query")]
[HttpPost]
public IEnumerable<Materiel> Query(NX.ERP.Model.Request.Materiel Param)
public IEnumerable<Material> Query(NX.ERP.Model.Request.Material Param)
{
var materielDAL = new MaterielDAL();
return materielDAL.GetList(Param);
var MaterialDAL = new MaterialDAL();
return MaterialDAL.GetList(Param);
}

View File

@@ -8,23 +8,23 @@ using System.Web.Http;
namespace NX.ERP.WebAPi.Controllers
{
public class MaterielTypeController:ApiController
public class MaterialTypeController:ApiController
{
[Obsolete]
[Route("api/MaterielType/List")]
[Route("api/MaterialType/List")]
[HttpGet]
public IEnumerable<MaterielType> List()
public IEnumerable<MaterialType> List()
{
var materielType = new MaterielTypeDAL();
return materielType.GetList();
var MaterialType = new MaterialTypeDAL();
return MaterialType.GetList();
}
[Route("api/MaterielType/Query")]
[Route("api/MaterialType/Query")]
[HttpPost]
public IEnumerable<MaterielType> Query(NX.ERP.Model.Request.MaterielType Param)
public IEnumerable<MaterialType> Query(NX.ERP.Model.Request.MaterialType Param)
{
var materielType = new MaterielTypeDAL();
return materielType.GetList(Param);
var MaterialType = new MaterialTypeDAL();
return MaterialType.GetList(Param);
}

View File

@@ -7,15 +7,15 @@ using System.Web.Http;
namespace NX.ERP.WebAPi.Controllers.Store
{
public class MaterielStoreOutController:ApiController
public class MaterialStoreOutController:ApiController
{
[Obsolete]
[Route("api/MaterialOut/Add")]
[HttpPost]
public string AddVoucher([FromBody] Model.Request.MaterielStoreOut storeIn)
public string AddVoucher([FromBody] Model.Request.MaterialStoreOut storeIn)
{
var dal = new NX.ERP.U8.Store.MaterielStoreOutDAL();
var dal = new NX.ERP.U8.Store.MaterialStoreOutDAL();
return dal.AddVocher(storeIn);
}
}