屏蔽某些API

This commit is contained in:
admin
2021-01-21 16:00:58 +08:00
parent f84e9f2e5e
commit 9b672067cb
24 changed files with 101 additions and 38 deletions

View File

@@ -61,6 +61,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="BaseModel.cs" />
<Compile Include="Request\Arrival.cs" />
<Compile Include="Request\Bin.cs" />
<Compile Include="Request\Customer.cs" />
<Compile Include="Request\Materiel.cs" />

View File

@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace NX.ERP.Model.Request
{
public class Arrival:BaseModel
{
public string ArrivalNo { get; set; }
}
}

View File

@@ -16,16 +16,22 @@ namespace NX.ERP.Model.Purchase
private string supplierCode;
private ICollection<ArrivalDetail> arrivalDetails = new List<ArrivalDetail>();
public int Id { get => id; set => id = value; }
public string ArrivalCode { get => arrivalCode; set => arrivalCode = value; }
public DateTime Date { get => _date; set => _date = value; }
public ICollection<ArrivalDetail> Details { get => arrivalDetails; set => arrivalDetails = value; }
public int ArrivalId { get => id; set => id = value; }
public string ArrivalNo { get => arrivalCode; set => arrivalCode = value; }
public DateTime ArrivalDate { get => _date; set => _date = value; }
public ICollection<ArrivalDetail> ArrivalDtlLst { get => arrivalDetails; set => arrivalDetails = value; }
public string PreparedBy { get; set; }
public string SupplierCode { get => supplierCode; set => supplierCode = value; }
public double ExchRate { get; set; }
public string ExchName { get; set; }
[Newtonsoft.Json.JsonIgnore]
public string VenCode { get; set; }
public double TaxRate { get; set; }
[Newtonsoft.Json.JsonIgnore]
public string PTCode { get; set; }
[Newtonsoft.Json.JsonIgnore]
public string BusType { get; set; }
}

View File

@@ -12,34 +12,42 @@ namespace NX.ERP.Model.Purchase
{
private int id;
private string materielCode;
public int Id { get => id; set => id = value; }
public int ArrivalDtlId { get => id; set => id = value; }
public int ArrivalID { get => arrivalID; set => arrivalID = value; }
public string MaterielCode { get => materielCode; set => materielCode = value; }
public string MaterialCode { get => materielCode; set => materielCode = value; }
public string BatchNo { get => batchNo; set => batchNo = value; }
public string UnitCode { get => unitCode; set => unitCode = value; }
public double Quantity { get => quantity; set => quantity = value; }
public double Qty { get => quantity; set => quantity = value; }
/// <summary>
/// 审批状态2 说明已经审核过了
/// </summary>
public int Iverifystateex { get => iverifystateex; set => iverifystateex = value; }
private int arrivalID;
private string batchNo;
private string unitCode;
private double quantity;
private int iverifystateex;
[Newtonsoft.Json.JsonIgnore]
public int posId { get; set; }
[Newtonsoft.Json.JsonIgnore]
public string OrderCode { get; set; }
[Newtonsoft.Json.JsonIgnore]
public int PoId { get; set; }
[Newtonsoft.Json.JsonIgnore]
public double oricost { get; set; }
[Newtonsoft.Json.JsonIgnore]
public double oritaxcost { get; set; }
[Newtonsoft.Json.JsonIgnore]
public double orimoney { get; set; }
[Newtonsoft.Json.JsonIgnore]
public double oritaxprice { get; set; }
[Newtonsoft.Json.JsonIgnore]
public double orisum { get; set; }
[Newtonsoft.Json.JsonIgnore]
public int Iverifystateex { get => iverifystateex; set => iverifystateex = value; }
[Newtonsoft.Json.JsonIgnore]
public double cost { get; set; }
// b.ioricost as oricost,b.ioritaxcost as oritaxcost ,b.iorimoney as orimoney,b.oritaxprice as oritaxprice,b.iorisum as orisum,

View File

@@ -11,8 +11,7 @@ namespace NX.ERP.U8.Purchase
{
using (var conn = new System.Data.SqlClient.SqlConnection(U8LoginContext.Instance.Constr4Net))
{
string strSQL = @"select a.id,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 date,A.cVenCode AS SupplierCode,
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.cBatch AS BatchNo,
@@ -20,8 +19,7 @@ namespace NX.ERP.U8.Purchase
B.iQuantity as Quantity,b.iposid as PosId ,B.CORDERCODE as OrderCode,C.POID as Poid from
pu_ArrHead as a
left join pu_arrbody as b on a.id=b.id
Left Join PO_Podetails C WITH (NOLOCK) ON B.iPOsID = C.ID
";
Left Join PO_Podetails C WITH (NOLOCK) ON B.iPOsID = C.ID ";
if (!string.IsNullOrEmpty(strWhere))
{
strSQL += $" where {strWhere} ";
@@ -30,16 +28,16 @@ namespace NX.ERP.U8.Purchase
// return conn.Query<Model.Purchase.Arrival>(strSQL,null);
var list = conn.Query<Model.Purchase.Arrival, Model.Purchase.ArrivalDetail, Model.Purchase.Arrival>(strSQL, (arrival, ArrivalDetail) =>
{
if (!lookup.TryGetValue(arrival.Id, out var _arrival))
if (!lookup.TryGetValue(arrival.ArrivalId, out var _arrival))
{
lookup.Add(arrival.Id, arrival);
lookup.Add(arrival.ArrivalId, arrival);
}
else
{
arrival = _arrival;
}
arrival.Details.Add(ArrivalDetail);
arrival.ArrivalDtlLst.Add(ArrivalDetail);
return arrival;
}, param, null, true, "id", 10, System.Data.CommandType.Text);
return lookup.Values;
@@ -52,6 +50,16 @@ namespace NX.ERP.U8.Purchase
}
public IEnumerable<Model.Purchase.Arrival> Query(NX.ERP.Model.Request.Arrival arrival)
{
var where = "";
if (!string.IsNullOrEmpty(arrival.ArrivalNo))
{
where = " a.cCode like @Code ";
}
return this.GetList(where, new { Code = $"%{arrival.ArrivalNo}%" });
}
public IEnumerable<Model.Purchase.Arrival> GetListByLastId(int Id)
{

View File

@@ -36,7 +36,6 @@ namespace NX.ERP.U8.Store
headXml.setAttribute("ccode", "11");
headXml.setAttribute("ddate", storeIn.Date);
headXml.setAttribute("cmaker", storeIn.Maker);
headXml.setAttribute("vt_id", new VT().GetDefaltVTID("0411"));
headXml.setAttribute("editprop", "A");
headXml.setAttribute("cdepcode", "");
@@ -53,14 +52,13 @@ namespace NX.ERP.U8.Store
IXMLDOMElement bodyXml;
for (var n = 0; n < storeIn.Details.Count; n++)
{
bodyXml = domBody.createElement("z:row");
var detail = storeIn.Details[n];
bodyXml.setAttribute("cinvcode", detail.InvCode);
bodyXml.setAttribute("iquantity", detail.Quantity);
var _cost = new MaterielDAL().GetCost(detail.InvCode, 0);
bodyXml.setAttribute("iunitcost", _cost);
bodyXml.setAttribute("iprice", new NX.ERP.U8.Account.Accinformation().FormatMoney(_cost * detail.Quantity));
bodyXml.setAttribute("iprice", new Account.Accinformation().FormatMoney(_cost * detail.Quantity));
bodyXml.setAttribute("irowno", n + 1);
bodyXml.setAttribute("editprop", "A");
bodyXml.setAttribute("cbatch", detail.Batch);
@@ -70,19 +68,14 @@ namespace NX.ERP.U8.Store
headXml.setAttribute("iproorderid", momOrder.Id);
domBody.selectSingleNode("//rs:data").appendChild(bodyXml);
}
}
domHead.selectSingleNode("//rs:data").appendChild(headXml);
try
{
return AddRdVoucher(voucherParameter);
}
catch (Exception err)
{
throw err;
}

View File

@@ -58,9 +58,9 @@ namespace NX.ERP.U8.Store
headXml.setAttribute("iexchrate", Arrival.ExchRate);
headXml.setAttribute("cexch_name", Arrival.ExchName);
headXml.setAttribute("cvencode", Arrival.VenCode);
headXml.setAttribute("carvcode", Arrival.ArrivalCode);
headXml.setAttribute("ipurarriveid", Arrival.Id);
headXml.setAttribute("darvdate", Arrival.Date);
headXml.setAttribute("carvcode", Arrival.ArrivalNo);
headXml.setAttribute("ipurarriveid", Arrival.ArrivalId);
headXml.setAttribute("darvdate", Arrival.ArrivalDate);
headXml.setAttribute("itaxrate", Arrival.TaxRate);
headXml.setAttribute("cptcode", Arrival.PTCode);
@@ -68,7 +68,7 @@ namespace NX.ERP.U8.Store
for (var n = 0; n < puStoreIn.Details.Count; n++)
{
var detail = puStoreIn.Details[n];
var arrivalDetail = Arrival.Details.First(m => { return m.Id == detail.SorceDetailId; });
var arrivalDetail = Arrival.ArrivalDtlLst.First(m => { return m.ArrivalID == detail.SorceDetailId; });
headXml.setAttribute("cordercode", arrivalDetail.OrderCode);
// headXml.setAttribute("ipurorderid", arrivalDetail.PoId);
bodyXml = domBody.createElement("z:row");
@@ -82,8 +82,8 @@ namespace NX.ERP.U8.Store
bodyXml.setAttribute("cposition", detail.Position);
// bodyXml.setAttribute("cposname", "B1Y1H001"); //货位,string类型
//iXMLDOMElement.setAttribute("carvcode", Arrival.ArrivalCode);
bodyXml.setAttribute("cbarvcode", Arrival.ArrivalCode);
bodyXml.setAttribute("ipurarriveid", Arrival.Id);
bodyXml.setAttribute("cbarvcode", Arrival.ArrivalNo);
bodyXml.setAttribute("ipurarriveid", Arrival.ArrivalId);
bodyXml.setAttribute("iarrsid", detail.SorceDetailId);
bodyXml.setAttribute("darvdate", DateTime.Today.ToShortDateString());
bodyXml.setAttribute("editprop", "A");

View File

@@ -79,7 +79,7 @@ namespace NX.ERP.WebAPi
// });
// Set this flag to omit descriptions for any actions decorated with the Obsolete attribute
//c.IgnoreObsoleteActions();
c.IgnoreObsoleteActions();
// Each operation be assigned one or more tags which are then used by consumers for various reasons.
// For example, the swagger-ui groups operations according to the first tag of each operation.
@@ -101,7 +101,7 @@ namespace NX.ERP.WebAPi
// those comments into the generated docs and UI. You can enable this by providing the path to one or
// more Xml comment files.
//
// c.IncludeXmlComments(string.Format("{0}/bin/NX.ERP.WebAPi.xml", System.AppDomain.CurrentDomain.BaseDirectory));
// c.IncludeXmlComments(string.Format("{0}/bin/NX.ERP.WebAPi.xml", System.AppDomain.CurrentDomain.BaseDirectory));
// Swashbuckle makes a best attempt at generating Swagger compliant JSON schemas for the various types
// exposed in your API. However, there may be occasions when more control of the output is needed.

View File

@@ -20,7 +20,7 @@ namespace NX.ERP.WebAPi.Controllers
/// </summary>
/// <returns></returns>
// GET api/values
[Obsolete]
[Route("api/Customer/List")]
[HttpGet]
public IEnumerable<Model.Customer> List()

View File

@@ -10,6 +10,7 @@ namespace NX.ERP.WebAPi.Controllers
{
public class MaterielController : ApiController
{
[Obsolete]
[Route("api/Materiel/List")]
[HttpGet]
public IEnumerable<Materiel> List()

View File

@@ -10,6 +10,7 @@ namespace NX.ERP.WebAPi.Controllers
{
public class MaterielTypeController:ApiController
{
[Obsolete]
[Route("api/MaterielType/List")]
[HttpGet]
public IEnumerable<MaterielType> List()

View File

@@ -9,6 +9,7 @@ namespace NX.ERP.WebAPi.Controllers
{
public class PositionController : ApiController
{
[Obsolete]
[Route("api/Position/List")]
[HttpGet]
public IEnumerable<Model.Bin> List()

View File

@@ -10,6 +10,7 @@ namespace NX.ERP.WebAPi.Controllers
{
public class SupplierController : ApiController
{
[Obsolete]
[Route("api/Supplier/List")]
[HttpGet]
public IEnumerable<Supplier> List()

View File

@@ -9,6 +9,7 @@ namespace NX.ERP.WebAPi.Controllers
{
public class UnitController : ApiController
{
[Obsolete]
[Route("api/Unit/List")]
[HttpGet]
public IEnumerable<Model.Unit> List()

View File

@@ -9,6 +9,7 @@ namespace NX.ERP.WebAPi.Controllers
{
public class WarehouseController : ApiController
{
[Obsolete]
[Route("api/Warehouse/List")]
[HttpGet]
public IEnumerable<Model.Warehouse> List()

View File

@@ -8,6 +8,7 @@ namespace NX.ERP.WebAPi.Controllers.MOM
{
public class MomOrderController : ApiController
{
[Obsolete]
[Route("api/MomOrder/List")]
[HttpGet]
public IEnumerable<Model.MOM.MomOrder> List()
@@ -16,6 +17,7 @@ namespace NX.ERP.WebAPi.Controllers.MOM
return customerDAL.GetList();
}
[Obsolete]
[Route("api/MomOrder/list/{id}")]
[HttpGet]
public IEnumerable<Model.MOM.MomOrder> GetListByLastID(int id)
@@ -23,7 +25,7 @@ namespace NX.ERP.WebAPi.Controllers.MOM
var customerDAL = new NX.ERP.U8.Mom.MomOrderDAL();
return customerDAL.GetListByLastID(id);
}
[Obsolete]
[Route("api/MomOrder/{Code}")]
[HttpGet]
public Model.MOM.MomOrder GetModel(string Code)

View File

@@ -9,6 +9,7 @@ namespace NX.ERP.WebAPi.Controllers
{
public class ArrivalController : ApiController
{
[Obsolete]
[Route("api/Arrival/List")]
// GET api/values
[HttpGet]
@@ -18,6 +19,17 @@ namespace NX.ERP.WebAPi.Controllers
return customerDAL.GetList();
}
[Route("api/Arrival/Query")]
// GET api/values
[HttpPost]
public IEnumerable<Model.Purchase.Arrival> List([FromBody] NX.ERP.Model.Request.Arrival arrival)
{
var customerDAL = new ArrivalDAL();
return customerDAL.Query(arrival);
}
[Obsolete]
[Route("api/Arrival/{Code}")]
[HttpGet]
public Model.Purchase.Arrival Model(string Code)
@@ -25,7 +37,7 @@ namespace NX.ERP.WebAPi.Controllers
var customerDAL = new ArrivalDAL();
return customerDAL.GetModel(Code);
}
[Obsolete]
[Route("api/Arrival/list/{id}")]
[HttpGet]
public IEnumerable<Model.Purchase.Arrival> GetListByLastID(int id)

View File

@@ -10,6 +10,7 @@ namespace NX.ERP.WebAPi.Controllers.Sale
{
public class DispatchController : ApiController
{
[Obsolete]
[Route("api/Dispatch/List")]
// GET api/values
[HttpGet]
@@ -18,13 +19,14 @@ namespace NX.ERP.WebAPi.Controllers.Sale
var customerDAL = new DispatchListDAL();
return customerDAL.GetList();
}
[Obsolete]
[HttpGet]
public Model.Sale.DispatchList Model(int id)
{
var customerDAL = new DispatchListDAL();
return customerDAL.GetModel(id);
}
[Obsolete]
[Route("api/Dispatch/{Code}")]
[HttpGet]
public Model.Sale.DispatchList ModelByCode(string Code)
@@ -32,6 +34,7 @@ namespace NX.ERP.WebAPi.Controllers.Sale
var customerDAL = new DispatchListDAL();
return customerDAL.GetModel(Code);
}
[Obsolete]
[Route("api/Dispatch/List/{id}")]
[HttpGet]
public IEnumerable<Model.Sale.DispatchList> GetListByLastID(int id)

View File

@@ -6,8 +6,10 @@ using System.Web.Http;
namespace NX.ERP.WebAPi.Controllers.Store
{
public class MaterielStoreOutController:ApiController
{
[Obsolete]
[Route("api/MaterialOut/Add")]
[HttpPost]

View File

@@ -6,8 +6,10 @@ using System.Web.Http;
namespace NX.ERP.WebAPi.Controllers.Store
{
public class OtherStoreInController:ApiController
{
[Obsolete]
[Route("api/OtherIn/Add")]
[HttpPost]
public string AddVoucher([FromBody] Model.Request.OtherStoreInOut storeIn)

View File

@@ -6,8 +6,10 @@ using System.Web.Http;
namespace NX.ERP.WebAPi.Controllers.Store
{
public class OtherStoreOutController : ApiController
{
[Obsolete]
[Route("api/OtherOut/Add")]
[HttpPost]
public string AddVoucher([FromBody] Model.Request.OtherStoreInOut storeIn)

View File

@@ -6,8 +6,10 @@ using System.Web.Http;
namespace NX.ERP.WebAPi.Controllers.Store
{
public class ProductStoreInController: ApiController
{
[Obsolete]
[Route("api/ProductStoreIn/Add")]
[HttpPost]
public object AddVoucher([FromBody] Model.Request.ProductStoreIn storeIn)

View File

@@ -6,8 +6,10 @@ using System.Web.Http;
namespace NX.ERP.WebAPi.Controllers.Store
{
public class PuStoreInController : ApiController
{
[Obsolete]
[Route("api/PuStoreIn/Add")]
[HttpPost]
public object AddVoucher([FromBody] Model.Request.PuStoreIn storeIn)

View File

@@ -6,8 +6,10 @@ using System.Web.Http;
namespace NX.ERP.WebAPi.Controllers.Store
{
public class SaleStoreOutController : ApiController
{
[Obsolete]
[Route("api/SaleStoreOut/Add")]
[HttpPost]
public object AddVoucher([FromBody] Model.Request.SaleStoreOut storeIn)