diff --git a/NX.ERP.Model/Response/Base/Bin.cs b/NX.ERP.Model/Response/Base/Bin.cs index d1a891e..f11f641 100644 --- a/NX.ERP.Model/Response/Base/Bin.cs +++ b/NX.ERP.Model/Response/Base/Bin.cs @@ -24,5 +24,8 @@ namespace NX.ERP.Model public string BarCode { get => _cBarCode; set => _cBarCode = value; } + + + public long Pubufts { get; set; } } } diff --git a/NX.ERP.Model/Response/Base/Customer.cs b/NX.ERP.Model/Response/Base/Customer.cs index 18be0d1..a2ad362 100644 --- a/NX.ERP.Model/Response/Base/Customer.cs +++ b/NX.ERP.Model/Response/Base/Customer.cs @@ -19,5 +19,8 @@ namespace NX.ERP.Model public string Contract { get => contract; set => contract = value; } public string ContractPhone { get => contractPhone; set => contractPhone = value; } public string CustomerName { get => customerName; set => customerName = value; } + + + public long Pubufts { get; set; } } } diff --git a/NX.ERP.Model/Response/Base/Materiel.cs b/NX.ERP.Model/Response/Base/Materiel.cs index 45a1c3a..3fe4040 100644 --- a/NX.ERP.Model/Response/Base/Materiel.cs +++ b/NX.ERP.Model/Response/Base/Materiel.cs @@ -24,7 +24,7 @@ namespace NX.ERP.Model public string MaterialCode { get => _code; set => _code = value; } public string MaterialName { get => _name; set => _name = value; } - + public long Pubufts { get; set; } public string MaterialTypeCode { get; set; } public string SpecsModel { get; set; } diff --git a/NX.ERP.Model/Response/Base/Supplier.cs b/NX.ERP.Model/Response/Base/Supplier.cs index 456b24e..de3be1e 100644 --- a/NX.ERP.Model/Response/Base/Supplier.cs +++ b/NX.ERP.Model/Response/Base/Supplier.cs @@ -26,6 +26,7 @@ namespace NX.ERP.Model public bool ProxyForeign { get; set; } + public long Pubufts { get; set; } } } diff --git a/NX.ERP.Model/Response/Base/Warehouse.cs b/NX.ERP.Model/Response/Base/Warehouse.cs index d42deec..ed41d45 100644 --- a/NX.ERP.Model/Response/Base/Warehouse.cs +++ b/NX.ERP.Model/Response/Base/Warehouse.cs @@ -19,5 +19,8 @@ namespace NX.ERP.Model public string WarehouseAdmin { get; set; } public string Contacts { get; set; } public string Telephone { get; set; } + + + public long Pubufts { get; set; } } } diff --git a/NX.ERP.U8/Base/BinDAL.cs b/NX.ERP.U8/Base/BinDAL.cs index 5fe82fb..196fe45 100644 --- a/NX.ERP.U8/Base/BinDAL.cs +++ b/NX.ERP.U8/Base/BinDAL.cs @@ -15,7 +15,7 @@ namespace NX.ERP.U8.Base using (var conn = U8LoginContext.Instance.Connection) { var sql = @"select cPosCode as BinCode,cPosName as BinName,iPosGrade,bPosEnd,cWhCode as WarehouseCode, - iMaxCubage as VolumeLimit, iMaxweight as WeightLimit,cMemo,cBarCode from Position"; + iMaxCubage as VolumeLimit, iMaxweight as WeightLimit,cMemo,cBarCode,CONVERT(BIGINT,pubufts) AS pubufts from Position"; if (!string.IsNullOrEmpty(strwhere)) { sql += $" where {strwhere}"; @@ -24,7 +24,12 @@ namespace NX.ERP.U8.Base } } - + + public IEnumerable GetList(long Pubufts) + { + + return this.GetList("CONVERT(BIGINT,pubufts) > @Pubufts", new { Pubufts }); + } public IEnumerable GetListByWhCode(string Code) { @@ -50,7 +55,7 @@ namespace NX.ERP.U8.Base return this.GetList(string.Join(" and ", where.ToArray()), new { BinCode = $"%{Param.BinCode}%", - WarehouseCode=$"%{Param.WarehouseCode}%" + WarehouseCode = $"%{Param.WarehouseCode}%" }); diff --git a/NX.ERP.U8/Base/CustomerDAL.cs b/NX.ERP.U8/Base/CustomerDAL.cs index 43b5ee9..46500bc 100644 --- a/NX.ERP.U8/Base/CustomerDAL.cs +++ b/NX.ERP.U8/Base/CustomerDAL.cs @@ -20,6 +20,8 @@ namespace NX.ERP.U8 cCusName AS CustomerName, cCusPostCode AS PostalCode, cCusAddress AS Address, + CONVERT(BIGINT,pubufts) as pubufts, + cCusPerson AS Contract,cCusPhone AS ContractPhone from Customer "; if (!string.IsNullOrEmpty(strWhere)) { @@ -29,6 +31,20 @@ namespace NX.ERP.U8 } } + public IEnumerable GetList(long Pubufts) + { + + return this.GetList("CONVERT(BIGINT,pubufts) > @Pubufts", new { Pubufts }); + + + + + + } + + + + public IEnumerable GetList(NX.ERP.Model.Request.Customer Params) { IList where = new List(); diff --git a/NX.ERP.U8/Base/MaterielDAL.cs b/NX.ERP.U8/Base/MaterielDAL.cs index 1992cb2..0426504 100644 --- a/NX.ERP.U8/Base/MaterielDAL.cs +++ b/NX.ERP.U8/Base/MaterielDAL.cs @@ -324,7 +324,7 @@ namespace NX.ERP.U8 bProxyForeign AS ProxyForeign, - + CONVERT(BIGINT,pubufts) as pubufts, cDTAQL AS Aql @@ -339,6 +339,17 @@ namespace NX.ERP.U8 } + public IEnumerable GetList(long Pubufts) + { + + return this.GetList("CONVERT(BIGINT,pubufts) > @Pubufts", new { Pubufts }); + + + + + + } + public Material GetModel(string Code) { return this.GetList(" cInvCode=@Code ", new { Code }).FirstOrDefault(); diff --git a/NX.ERP.U8/Base/MaterielTypeDAL.cs b/NX.ERP.U8/Base/MaterielTypeDAL.cs index 7533632..f08f644 100644 --- a/NX.ERP.U8/Base/MaterielTypeDAL.cs +++ b/NX.ERP.U8/Base/MaterielTypeDAL.cs @@ -23,6 +23,18 @@ namespace NX.ERP.U8 + } + + + public IEnumerable GetList(long Pubufts) + { + + return this.GetList("CONVERT(BIGINT,pubufts) > @Pubufts", new { Pubufts }); + + + + + } diff --git a/NX.ERP.U8/Base/SupplierDAL.cs b/NX.ERP.U8/Base/SupplierDAL.cs index ebf17cd..e137005 100644 --- a/NX.ERP.U8/Base/SupplierDAL.cs +++ b/NX.ERP.U8/Base/SupplierDAL.cs @@ -23,7 +23,7 @@ namespace NX.ERP.U8 cVenPhone as ContractPhone, ISNULL(dModifyDate,dVenCreateDatetime) as ModifyDate, bProxyForeign as ProxyForeign, - + CONVERT(BIGINT,pubufts) as pubufts, cVenPerson AS Contract from Vendor "; if (!string.IsNullOrEmpty(strWhere)) { @@ -34,6 +34,17 @@ namespace NX.ERP.U8 } + public IEnumerable GetList(long Pubufts) + { + + return this.GetList("CONVERT(BIGINT,pubufts) > @Pubufts", new { Pubufts }); + + + + + + } + public IEnumerable GetList(NX.ERP.Model.Request.Supplier Params) { IList where = new List(); diff --git a/NX.ERP.U8/Base/UnitDAL.cs b/NX.ERP.U8/Base/UnitDAL.cs index 244ec39..f1f4500 100644 --- a/NX.ERP.U8/Base/UnitDAL.cs +++ b/NX.ERP.U8/Base/UnitDAL.cs @@ -25,6 +25,11 @@ namespace NX.ERP.U8 } } + public IEnumerable GetList(long Pubufts) + { + + return this.GetList("CONVERT(BIGINT,pubufts) > @Pubufts", new { Pubufts }); + } public IEnumerable GetList(NX.ERP.Model.Request.Unit Params) { @@ -54,7 +59,7 @@ namespace NX.ERP.U8 { UnitCode = $"%{Params.UnitCode}%", UnitName = $"%{Params.UnitName}%", - Pubufts=Params.Pubufts + Pubufts = Params.Pubufts }); diff --git a/NX.ERP.U8/Base/WarehouseDAL.cs b/NX.ERP.U8/Base/WarehouseDAL.cs index c43217a..5b1f50a 100644 --- a/NX.ERP.U8/Base/WarehouseDAL.cs +++ b/NX.ERP.U8/Base/WarehouseDAL.cs @@ -15,7 +15,7 @@ namespace NX.ERP.U8 using (var conn = U8LoginContext.Instance.Connection) { - var sql = "select cWhCode as WarehouseCode,cWhName as WarehouseName from Warehouse"; + var sql = "select cWhCode as WarehouseCode,cWhName as WarehouseName,CONVERT(BIGINT,pubufts) AS pubufts from Warehouse"; if (!string.IsNullOrEmpty(strWhere)) { sql += $" where {strWhere}"; @@ -23,6 +23,16 @@ namespace NX.ERP.U8 return conn.Query(sql, Param); } } + + + + public IEnumerable GetList(long Pubufts) + { + + return this.GetList("CONVERT(BIGINT,pubufts) > @Pubufts", new { Pubufts }); + } + + public IEnumerable GetList(NX.ERP.Model.Request.Warehouse Params) { diff --git a/NX.ERP.U8/Mom/BomDAL.cs b/NX.ERP.U8/Mom/BomDAL.cs index 13671ab..1dad86b 100644 --- a/NX.ERP.U8/Mom/BomDAL.cs +++ b/NX.ERP.U8/Mom/BomDAL.cs @@ -53,6 +53,11 @@ namespace NX.ERP.U8.Mom } + public IEnumerable GetList(long Pubufts) + { + return this.GetList("CONVERT(BIGINT,a.Ufts) >@Pubufts", new { Pubufts }); + } + public IEnumerable GetList(NX.ERP.Model.Request.Bom bom) { diff --git a/NX.ERP.U8/Mom/MomOrderDAL.cs b/NX.ERP.U8/Mom/MomOrderDAL.cs index 9e79534..c0f3bd8 100644 --- a/NX.ERP.U8/Mom/MomOrderDAL.cs +++ b/NX.ERP.U8/Mom/MomOrderDAL.cs @@ -73,6 +73,16 @@ namespace NX.ERP.U8.Mom } + public IEnumerable GetList(long Pubufts) + { + return this.GetList("CONVERT(BIGINT,a.Ufts) > @Pubufts", new { Pubufts }); + } + + + + + + /// /// /// @@ -99,7 +109,7 @@ namespace NX.ERP.U8.Mom where.Add(" a.MoId >= @ProductOrderendID "); } - if (Params.ModifyDate!=null) + if (Params.ModifyDate != null) { where.Add(" ISNULL( a.ModifyDate,createDate) >= @ModifyDate or a.RelsTime>=@ModifyDate "); } @@ -108,10 +118,10 @@ namespace NX.ERP.U8.Mom if (Params.Pubufts != null) { where.Add("CONVERT(BIGINT,a.Ufts) > @Pubufts "); - + } - if (Params.Status!=null) + if (Params.Status != null) { where.Add(" b.Status in @Status "); diff --git a/NX.ERP.U8/Purchase/ArrivalDAL.cs b/NX.ERP.U8/Purchase/ArrivalDAL.cs index 30d58b9..95b2726 100644 --- a/NX.ERP.U8/Purchase/ArrivalDAL.cs +++ b/NX.ERP.U8/Purchase/ArrivalDAL.cs @@ -7,7 +7,7 @@ namespace NX.ERP.U8.Purchase { public class ArrivalDAL { - public IEnumerable GetList(List strWhere , object param = null) + public IEnumerable GetList(string where , object param = null) { using (var conn = U8LoginContext.Instance.Connection) { @@ -39,11 +39,11 @@ namespace NX.ERP.U8.Purchase "; - var aa = string.Join(" and ", strWhere.ToArray()); + - if (!string.IsNullOrEmpty(aa)) + if (!string.IsNullOrEmpty(where)) { - strSQL += " and " + aa; + strSQL += " and " + where; } var lookup = new Dictionary(); @@ -66,6 +66,24 @@ namespace NX.ERP.U8.Purchase } } + + public IEnumerable GetList(IEnumerable where, object param = null) + { + return this.GetList(string.Join(" and ", where.ToArray()), param); + + } + + + + public IEnumerable GetList(long Pubufts) + { + return this.GetList("CONVERT(BIGINT,a.Ufts) > @Pubufts", new { Pubufts }); + } + + + + + public Model.Purchase.Arrival GetModel(int id) { List where = new List(); diff --git a/NX.ERP.WebAPi/Controllers/Base/CustomerController.cs b/NX.ERP.WebAPi/Controllers/Base/CustomerController.cs index 8bf10ef..76841f6 100644 --- a/NX.ERP.WebAPi/Controllers/Base/CustomerController.cs +++ b/NX.ERP.WebAPi/Controllers/Base/CustomerController.cs @@ -16,17 +16,17 @@ namespace NX.ERP.WebAPi.Controllers public class CustomerController : ApiController { /// - /// 获取客户信息 + /// /// + /// /// - // GET api/values - [Obsolete] + [Route("api/Customer/List")] [HttpGet] - public IEnumerable List() + public IEnumerable List(long Pubufts = 0) { var customerDAL = new CustomerDAL(); - return customerDAL.GetList(); + return customerDAL.GetList(Pubufts); } /// /// 查询 @@ -35,7 +35,7 @@ namespace NX.ERP.WebAPi.Controllers /// [Route("api/Customer/Query")] [HttpPost] - + public IEnumerable Query(NX.ERP.Model.Request.Customer Param) { var customerDAL = new CustomerDAL(); diff --git a/NX.ERP.WebAPi/Controllers/Base/MaterielController.cs b/NX.ERP.WebAPi/Controllers/Base/MaterielController.cs index d3c78e5..4dcf803 100644 --- a/NX.ERP.WebAPi/Controllers/Base/MaterielController.cs +++ b/NX.ERP.WebAPi/Controllers/Base/MaterielController.cs @@ -10,13 +10,13 @@ namespace NX.ERP.WebAPi.Controllers { public class MaterialController : ApiController { - [Obsolete] + [Route("api/Material/List")] [HttpGet] - public IEnumerable List() + public IEnumerable List(long Pubufts = 0) { var MaterialDAL = new MaterialDAL(); - return MaterialDAL.GetList(); + return MaterialDAL.GetList(Pubufts); } [Route("api/Material/Query")] diff --git a/NX.ERP.WebAPi/Controllers/Base/MaterielTypeController.cs b/NX.ERP.WebAPi/Controllers/Base/MaterielTypeController.cs index 8537677..a87a78d 100644 --- a/NX.ERP.WebAPi/Controllers/Base/MaterielTypeController.cs +++ b/NX.ERP.WebAPi/Controllers/Base/MaterielTypeController.cs @@ -10,13 +10,13 @@ namespace NX.ERP.WebAPi.Controllers { public class MaterialTypeController:ApiController { - [Obsolete] + [Route("api/MaterialType/List")] [HttpGet] - public IEnumerable List() + public IEnumerable List(long Pubufts = 0) { var MaterialType = new MaterialTypeDAL(); - return MaterialType.GetList(); + return MaterialType.GetList(Pubufts); } [Route("api/MaterialType/Query")] diff --git a/NX.ERP.WebAPi/Controllers/Base/SupplierController.cs b/NX.ERP.WebAPi/Controllers/Base/SupplierController.cs index cf48547..22d01aa 100644 --- a/NX.ERP.WebAPi/Controllers/Base/SupplierController.cs +++ b/NX.ERP.WebAPi/Controllers/Base/SupplierController.cs @@ -10,13 +10,12 @@ namespace NX.ERP.WebAPi.Controllers { public class SupplierController : ApiController { - [Obsolete] [Route("api/Supplier/List")] [HttpGet] - public IEnumerable List() + public IEnumerable List(long Pubufts = 0) { var supplierDAL = new SupplierDAL(); - return supplierDAL.GetList(); + return supplierDAL.GetList(Pubufts); } diff --git a/NX.ERP.WebAPi/Controllers/Base/UnitController.cs b/NX.ERP.WebAPi/Controllers/Base/UnitController.cs index 87d6ee7..0ae7c2b 100644 --- a/NX.ERP.WebAPi/Controllers/Base/UnitController.cs +++ b/NX.ERP.WebAPi/Controllers/Base/UnitController.cs @@ -9,13 +9,13 @@ namespace NX.ERP.WebAPi.Controllers { public class UnitController : ApiController { - [Obsolete] + [Route("api/Unit/List")] [HttpGet] - public IEnumerable List() + public IEnumerable List(long Pubufts = 0) { var supplierDAL = new UnitDAL(); - return supplierDAL.GetList(); + return supplierDAL.GetList(Pubufts); } diff --git a/NX.ERP.WebAPi/Controllers/Base/WarehouseController.cs b/NX.ERP.WebAPi/Controllers/Base/WarehouseController.cs index 1a97463..b5b552e 100644 --- a/NX.ERP.WebAPi/Controllers/Base/WarehouseController.cs +++ b/NX.ERP.WebAPi/Controllers/Base/WarehouseController.cs @@ -9,13 +9,13 @@ namespace NX.ERP.WebAPi.Controllers { public class WarehouseController : ApiController { - [Obsolete] + [Route("api/Warehouse/List")] [HttpGet] - public IEnumerable List() + public IEnumerable List(long Pubufts = 0) { var warehouseDAL = new WarehouseDAL(); - return warehouseDAL.GetList(); + return warehouseDAL.GetList(Pubufts); } [Route("api/Warehouse/Query")] [HttpPost] diff --git a/NX.ERP.WebAPi/Controllers/MOM/BomController.cs b/NX.ERP.WebAPi/Controllers/MOM/BomController.cs index 6cff9c9..aed78bd 100644 --- a/NX.ERP.WebAPi/Controllers/MOM/BomController.cs +++ b/NX.ERP.WebAPi/Controllers/MOM/BomController.cs @@ -8,13 +8,13 @@ namespace NX.ERP.WebAPi.Controllers.MOM { public class BomController : ApiController { - [Obsolete] + [Route("api/Bom/List")] [HttpGet] - public IEnumerable GetList() + public IEnumerable GetList(long Pubufts = 0) { - return new NX.ERP.U8.Mom.BomDAL().GetList(); + return new NX.ERP.U8.Mom.BomDAL().GetList(Pubufts); } diff --git a/NX.ERP.WebAPi/Controllers/MOM/MomOrderController.cs b/NX.ERP.WebAPi/Controllers/MOM/MomOrderController.cs index daa966f..0532f94 100644 --- a/NX.ERP.WebAPi/Controllers/MOM/MomOrderController.cs +++ b/NX.ERP.WebAPi/Controllers/MOM/MomOrderController.cs @@ -9,13 +9,13 @@ namespace NX.ERP.WebAPi.Controllers.MOM public class MomOrderController : ApiController { - [Obsolete] + [Route("api/MomOrder/List")] [HttpGet] - public IEnumerable List() + public IEnumerable List(long Pubufts = 0) { var customerDAL = new NX.ERP.U8.Mom.MomOrderDAL(); - return customerDAL.GetList(); + return customerDAL.GetList(Pubufts); } diff --git a/NX.ERP.WebAPi/Controllers/Purchase/ArrivalController.cs b/NX.ERP.WebAPi/Controllers/Purchase/ArrivalController.cs index 44ae32c..04cdf35 100644 --- a/NX.ERP.WebAPi/Controllers/Purchase/ArrivalController.cs +++ b/NX.ERP.WebAPi/Controllers/Purchase/ArrivalController.cs @@ -9,23 +9,21 @@ namespace NX.ERP.WebAPi.Controllers { public class ArrivalController : ApiController { - //[Obsolete] - //[Route("api/Arrival/List")] - //// GET api/values - //[HttpGet] - //public IEnumerable List() - //{ - // var customerDAL = new ArrivalDAL(); - // return customerDAL.GetList(); - //} + + [Route("api/Arrival/List")] + [HttpGet] + public IEnumerable List(long Pubufts = 0) + { + var Arrival = new ArrivalDAL(); + return Arrival.GetList(Pubufts); + } - [Route("api/Arrival/Query")] - // GET api/values + [Route("api/Arrival/Query")] [HttpPost] public IEnumerable List([FromBody] NX.ERP.Model.Request.Arrival arrival) { - var customerDAL = new ArrivalDAL(); - return customerDAL.Query(arrival); + var Arrival = new ArrivalDAL(); + return Arrival.Query(arrival); } @@ -34,16 +32,16 @@ namespace NX.ERP.WebAPi.Controllers [HttpGet] public Model.Purchase.Arrival Model(string Code) { - var customerDAL = new ArrivalDAL(); - return customerDAL.GetModel(Code); + var Arrival = new ArrivalDAL(); + return Arrival.GetModel(Code); } - + [Obsolete] [Route("api/Arrival/list/{id}")] [HttpGet] public IEnumerable GetListByLastID(int id) { - var customerDAL = new ArrivalDAL(); - return customerDAL.GetListByLastId(id); + var Arrival = new ArrivalDAL(); + return Arrival.GetListByLastId(id); } diff --git a/NX.ERP.WebAPi/Filters/ApiResultAttribute.cs b/NX.ERP.WebAPi/Filters/ApiResultAttribute.cs index c3a0efa..73bfcf0 100644 --- a/NX.ERP.WebAPi/Filters/ApiResultAttribute.cs +++ b/NX.ERP.WebAPi/Filters/ApiResultAttribute.cs @@ -22,7 +22,7 @@ namespace NX.ERP.WebAPi.Filters { ErrCode = 0, Data = actionExecutedContext.ActionContext.Response.Content.ReadAsAsync().Result, - pubufts = uf + Pubufts = uf }; actionExecutedContext.Response.Content = new ObjectContent>(result, GlobalConfiguration.Configuration.Formatters.JsonFormatter); diff --git a/NX.ERP.WebAPi/Web.config b/NX.ERP.WebAPi/Web.config index 432da6d..c9855bd 100644 --- a/NX.ERP.WebAPi/Web.config +++ b/NX.ERP.WebAPi/Web.config @@ -5,9 +5,9 @@ --> - - - + + +