From 4b07264ddc0aa28cff75cf451725885ec50191b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=B0=20=E6=9C=B1?= <501697962@qq.com> Date: Mon, 10 May 2021 20:26:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=BA=8F=E5=88=97=E5=8F=B7?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- NX.ERP.Model/NX.ERP.Model.csproj | 1 + NX.ERP.Model/Request/SnOrderRequest.cs | 29 ++ NX.ERP.U8/NX.ERP.U8.csproj | 1 + NX.ERP.U8/Pmc/FinanceQuery.cs | 80 ++++++ .../Controllers/Pmc/FinanceController.cs | 25 ++ NX.ERP.WebAPi/NX.ERP.WebAPi.csproj | 1 + NX.ERP.Webapp/src/App.vue | 1 + NX.ERP.Webapp/src/api/Finance.js | 7 + NX.ERP.Webapp/src/route/index.js | 2 + .../src/views/inventory-SNDetail.vue | 254 ++++++++++++++++++ 10 files changed, 401 insertions(+) create mode 100644 NX.ERP.Model/Request/SnOrderRequest.cs create mode 100644 NX.ERP.U8/Pmc/FinanceQuery.cs create mode 100644 NX.ERP.WebAPi/Controllers/Pmc/FinanceController.cs create mode 100644 NX.ERP.Webapp/src/api/Finance.js create mode 100644 NX.ERP.Webapp/src/views/inventory-SNDetail.vue diff --git a/NX.ERP.Model/NX.ERP.Model.csproj b/NX.ERP.Model/NX.ERP.Model.csproj index 622cb3e..8f52a3e 100644 --- a/NX.ERP.Model/NX.ERP.Model.csproj +++ b/NX.ERP.Model/NX.ERP.Model.csproj @@ -64,6 +64,7 @@ + diff --git a/NX.ERP.Model/Request/SnOrderRequest.cs b/NX.ERP.Model/Request/SnOrderRequest.cs new file mode 100644 index 0000000..8ef7877 --- /dev/null +++ b/NX.ERP.Model/Request/SnOrderRequest.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace NX.ERP.Model.Request +{ + public class SnOrderRequest + { + public IEnumerable Cprk { get; set; } + + public IEnumerable Clck { get; set; } + + + public IEnumerable cInvCodes { get; set; } + + public IEnumerable cInvSN { get; set; } + + + + public DateTime? BeginDate { get; set; } + public DateTime? EndDate { get; set; } + + + + + + } +} diff --git a/NX.ERP.U8/NX.ERP.U8.csproj b/NX.ERP.U8/NX.ERP.U8.csproj index dee43ad..c1685d9 100644 --- a/NX.ERP.U8/NX.ERP.U8.csproj +++ b/NX.ERP.U8/NX.ERP.U8.csproj @@ -43,6 +43,7 @@ + diff --git a/NX.ERP.U8/Pmc/FinanceQuery.cs b/NX.ERP.U8/Pmc/FinanceQuery.cs new file mode 100644 index 0000000..8757d01 --- /dev/null +++ b/NX.ERP.U8/Pmc/FinanceQuery.cs @@ -0,0 +1,80 @@ +using NX.ERP.U8.Purchase; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using Dapper; + + +namespace NX.ERP.U8.Finance + +{ + public class FinanceQuery + { + /// + /// + /// + /// + /// + /// + + + public IEnumerable InventorySNDetail(NX.ERP.Model.Request.SnOrderRequest info1) + { + string sql = $@" + select a.cInvCode,e.cInvName,b.cCode as Cprk, b.dDate as rkrq,c.cWhName,b.cMPoCode,d.cDepName,a.cInvSN,g.cCode as Clck,g.dDate as ckrq,h.cCusAbbName,f.cInvSN as ckcInvSN from ST_SNDetail_PROIN a + left join rdrecord10 b on a.iVouchID=b.id + left join Warehouse c on b.cWhCode =c.cWhCode + left join Department d on b.cDepCode =d.cDepCode + left join Inventory e on a.cInvCode=e.cInvCode + left join ST_SNDetail_SaleOut f on a.cInvSN= f.cInvSN + left join rdrecord32 g on f.iVouchID=g.id + left join Customer h on g.cCusCode=h.cCusCode + + "; + + + List where = new List(); + + if (info1.cInvCodes != null) + { + where.Add(" a.cInvCode in @cInvCode"); + } + + if (info1.Cprk != null) + { + where.Add(" b.cCode in @Cprk "); + } + if (info1.Clck != null) + { + where.Add(" g.cCode in @Clck "); + } + if (info1.cInvSN != null) + { + where.Add(" a.cInvSN in @cInvSN "); + } + + if (info1.BeginDate != null && info1.EndDate != null) + { + where.Add(" b.dDate between @beginDate and @endDate "); + + } + + + + var aa = string.Join(" and ", where.ToArray()); + + if (!string.IsNullOrEmpty(aa)) + { + sql += "where " + aa; + } + + using (var conn = NX.ERP.U8.U8LoginContext.Instance.Connection) + { + return conn.Query(sql, new { cInvCode = info1.cInvCodes, Cprk = info1.Cprk, info1.Clck, info1.cInvSN }); + } + } + + + } +} diff --git a/NX.ERP.WebAPi/Controllers/Pmc/FinanceController.cs b/NX.ERP.WebAPi/Controllers/Pmc/FinanceController.cs new file mode 100644 index 0000000..5978209 --- /dev/null +++ b/NX.ERP.WebAPi/Controllers/Pmc/FinanceController.cs @@ -0,0 +1,25 @@ +using NX.ERP.U8.Purchase; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +using System.Web.Http; + +namespace NX.ERP.WebAPi.Controllers +{ + public class FinanceController : ApiController + { + [HttpPost] + [Route("api/Finance/InventorySNDetail")] + public IEnumerable Inventorysocode(NX.ERP.Model.Request.SnOrderRequest info) + { + var FinanceQuery = new NX.ERP.U8.Finance.FinanceQuery(); + return FinanceQuery.InventorySNDetail(info); + } + + + + + } +} \ No newline at end of file diff --git a/NX.ERP.WebAPi/NX.ERP.WebAPi.csproj b/NX.ERP.WebAPi/NX.ERP.WebAPi.csproj index 40d62b3..120e0bf 100644 --- a/NX.ERP.WebAPi/NX.ERP.WebAPi.csproj +++ b/NX.ERP.WebAPi/NX.ERP.WebAPi.csproj @@ -157,6 +157,7 @@ + diff --git a/NX.ERP.Webapp/src/App.vue b/NX.ERP.Webapp/src/App.vue index 2c7e01e..755ac4c 100644 --- a/NX.ERP.Webapp/src/App.vue +++ b/NX.ERP.Webapp/src/App.vue @@ -11,6 +11,7 @@ 跟单记录表 材料出库数据与品种 销售订单表 + 序列号查询 diff --git a/NX.ERP.Webapp/src/api/Finance.js b/NX.ERP.Webapp/src/api/Finance.js new file mode 100644 index 0000000..e13bc7c --- /dev/null +++ b/NX.ERP.Webapp/src/api/Finance.js @@ -0,0 +1,7 @@ +import axios from 'axios' + + +export const InventorySNDetail = (info) => { + return axios.post('/api/Finance/InventorySNDetail', info) +} + diff --git a/NX.ERP.Webapp/src/route/index.js b/NX.ERP.Webapp/src/route/index.js index 29c9cf0..274d14f 100644 --- a/NX.ERP.Webapp/src/route/index.js +++ b/NX.ERP.Webapp/src/route/index.js @@ -3,6 +3,7 @@ import Inventory from '@/views/inventory.vue' import InventoryMom from '@/views/inventory-mom.vue' import InventoryMonth from '@/views/inventory-month.vue' import InventorySo from '@/views/inventory-so.vue' +import inventorySNDetail from '@/views/inventory-SNDetail.vue' export default [ { path: '/', @@ -13,5 +14,6 @@ export default [ { path: '/inventory', component: Inventory }, { path: '/InventoryMom', component: InventoryMom }, { path: '/InventoryMonth', component: InventoryMonth }, + { path: '/inventory-SNDetail', component: inventorySNDetail }, { path: '/InventorySo', component: InventorySo } ] diff --git a/NX.ERP.Webapp/src/views/inventory-SNDetail.vue b/NX.ERP.Webapp/src/views/inventory-SNDetail.vue new file mode 100644 index 0000000..88cbe36 --- /dev/null +++ b/NX.ERP.Webapp/src/views/inventory-SNDetail.vue @@ -0,0 +1,254 @@ + + + 序列号查询 + + + + 产品入库订单编号 + + + + 销售出库订单编号 + + + + + 物料编号 + + + + + 序列号 + + + + + 查询 + 导出 + + + + + + + + + + + + + + + + \ No newline at end of file