From 3f18fdbff0048e4b8c14b7c14dcc363b9cfe5cff Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=B0=20=E6=9C=B1?= <501697962@qq.com>
Date: Tue, 25 May 2021 00:40:12 +0800
Subject: [PATCH 1/3] =?UTF-8?q?=E9=87=87=E8=B4=AD=E6=8A=A5=E8=A1=A8?=
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/PurchasesumRequest.cs | 27 ++
NX.ERP.U8/NX.ERP.U8.csproj | 1 +
NX.ERP.U8/Pmc/PmcQuery.cs | 51 +-
NX.ERP.U8/Pmc/PurchaseQuery.cs | 445 ++++++++++++++++++
.../Controllers/Pmc/PurchaseController.cs | 43 ++
NX.ERP.WebAPi/NX.ERP.WebAPi.csproj | 1 +
NX.ERP.WebAPi/Web.config | 4 +-
NX.ERP.Webapp/src/App.vue | 4 +-
NX.ERP.Webapp/src/api/Purchase.js | 19 +
NX.ERP.Webapp/src/route/index.js | 7 +-
NX.ERP.Webapp/src/views/Purchasesum.vue | 312 ++++++++++++
NX.ERP.Webapp/src/views/inventory-po.vue | 6 +-
NX.ERP.Webapp/src/views/inventory-poc.vue | 335 +++++++++++++
14 files changed, 1231 insertions(+), 25 deletions(-)
create mode 100644 NX.ERP.Model/Request/PurchasesumRequest.cs
create mode 100644 NX.ERP.U8/Pmc/PurchaseQuery.cs
create mode 100644 NX.ERP.WebAPi/Controllers/Pmc/PurchaseController.cs
create mode 100644 NX.ERP.Webapp/src/api/Purchase.js
create mode 100644 NX.ERP.Webapp/src/views/Purchasesum.vue
create mode 100644 NX.ERP.Webapp/src/views/inventory-poc.vue
diff --git a/NX.ERP.Model/NX.ERP.Model.csproj b/NX.ERP.Model/NX.ERP.Model.csproj
index 5d033ae..183d32e 100644
--- a/NX.ERP.Model/NX.ERP.Model.csproj
+++ b/NX.ERP.Model/NX.ERP.Model.csproj
@@ -75,6 +75,7 @@
+
diff --git a/NX.ERP.Model/Request/PurchasesumRequest.cs b/NX.ERP.Model/Request/PurchasesumRequest.cs
new file mode 100644
index 0000000..66fd4c8
--- /dev/null
+++ b/NX.ERP.Model/Request/PurchasesumRequest.cs
@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace NX.ERP.Model.Request
+{
+ public class PurchasesumRequest
+ {
+
+ public IEnumerable AppCodes { get; set; }
+ public string InvStd { get; set; }
+
+ public IEnumerable InvCodes { get; set; }
+
+ public string cpersonname { get; set; }
+
+ public int cday { get; set; }
+
+
+
+
+
+
+
+ }
+}
diff --git a/NX.ERP.U8/NX.ERP.U8.csproj b/NX.ERP.U8/NX.ERP.U8.csproj
index 9392e45..82e1b81 100644
--- a/NX.ERP.U8/NX.ERP.U8.csproj
+++ b/NX.ERP.U8/NX.ERP.U8.csproj
@@ -50,6 +50,7 @@
+
diff --git a/NX.ERP.U8/Pmc/PmcQuery.cs b/NX.ERP.U8/Pmc/PmcQuery.cs
index df559ec..9201427 100644
--- a/NX.ERP.U8/Pmc/PmcQuery.cs
+++ b/NX.ERP.U8/Pmc/PmcQuery.cs
@@ -20,12 +20,17 @@ namespace NX.ERP.U8.Pmc
public IEnumerable GetPmcInventoryallRes(NX.ERP.Model.Request.Inventoryall info)
{
string sql = $@"
- SELECT c.cInvCode invcode1,
- c.cInvName cinvname1, c.cInvStd cinvstd1,LL.cComUnitName, CASE WHEN c.bPurchase = 1 AND
- c.bProxyForeign = 1 THEN '委外' WHEN c.bPurchase = 1 THEN '外购' WHEN c.bself = 1 THEN '自制' ELSE '其它' END AS
- std, isnull(mas.wqty,0) wqty, ISNULL(cs.qty, 0) cqty,ISNULL(misss.issqty, 0) issqty , ISNULL(ds.qty, 0) dqty,isnull(prd.Rqty, 0) rqty,
- ISNULL(OMM.RQTY1, 0) AS rqty1, ISNULL(pu_App.RQTY3, 0) AS rqty3,ISNULL(momq.momqty, 0) AS momqty, ISNULL(MX.MQTY, 0) MQTY, isnull(mas.wqty,0) - isnull(cs.qty, 0) - ISNULL(prd.Rqty, 0)
- - ISNULL(omm.RQTY1, 0) - ISNULL(MX.MQTY, 0) AS q
+ SELECT c.cInvCode invcode1,
+ c.cInvName cinvname1, c.cInvStd cinvstd1,LL.cComUnitName, CASE
+ WHEN c.bPurchase = 1 AND c.bProxyForeign = 1 and c.bself = 1 THEN '委外,自制'
+ WHEN c.bPurchase = 1 AND c.bProxyForeign = 1 and c.bself <>1 THEN '委外'
+ WHEN c.bPurchase = 1 AND c.bProxyForeign <> 1 and c.bself <> 1 THEN '外购'
+ WHEN c.bPurchase = 1 AND c.bProxyForeign <> 1 and c.bself = 1 THEN '外购,自制'
+ WHEN c.bPurchase <> 1 AND c.bProxyForeign <> 1 and c.bself = 1 THEN '自制'
+ ELSE '其它'
+ END AS std, isnull(mas.wqty,0) wqty, ISNULL(cs.qty, 0) cqty,ISNULL(misss.issqty, 0) issqty , ISNULL(ds.qty, 0) dqty,isnull(prd.Rqty, 0) rqty,
+ ISNULL(OMM.RQTY1, 0) AS rqty1, ISNULL(pu_App.RQTY3, 0) AS rqty3,0-(mas.wqty - isnull(ds.qty, 0) - ISNULL(prd.Rqty, 0)
+ - ISNULL(omm.RQTY1, 0) - ISNULL(MX.MQTY, 0)- ISNULL(pu_App.RQTY3, 0)) AS q
FROM Inventory c WITH (NOLOCK) LEFT JOIN
(SELECT ma.invcode, SUM(isnull(ma.qty, 0) - isnull(issqty, 0)) wqty
@@ -129,12 +134,17 @@ namespace NX.ERP.U8.Pmc
select *from (
SELECT m..mocode,CONVERT(varchar(100), mor.StartDate, 23) as StartDate ,CONVERT(varchar(100), mor.DueDate, 23) as DueDate ,DATEDIFF(day,GETDATE(),mor.DueDate) AS jandete , md.SortSeq, md.InvCode, p.cInvName, p.cInvStd,KK.cComUnitName, md.Qty, md.QualifiedInQty,(md.Qty-md.QualifiedInQty) as wwc, ma.InvCode invcode1,
- c.cInvName cinvname1, c.cInvStd cinvstd1,LL.cComUnitName as cComUnitName1, CASE WHEN c.bPurchase = 1 AND
- c.bProxyForeign = 1 THEN '委外' WHEN c.bPurchase = 1 THEN '外购' WHEN c.bself = 1 THEN '自制' ELSE '其它' END AS
- std,dtyl.dtty, ma.Qty qty1, ma.IssQty issqty,(ma.Qty-ma.IssQty) as wll,mdsss.mdqty,shwl.shwl,sdwl.sdwl
- ,mas.wqty wqty, ISNULL(cs.qty, 0) cqty, ISNULL(misss.issqty, 0) issqtyxc,ISNULL(ds.qty, 0) dqty,isnull(prd.Rqty, 0) rqty,
- ISNULL(OMM.RQTY1, 0) AS rqty1, ISNULL(pu_App.RQTY3, 0) AS rqty3,ISNULL(momq.momqty, 0) AS momqty, ISNULL(MX.MQTY, 0) MQTY, mas.wqty - isnull(ds.qty, 0) - ISNULL(prd.Rqty, 0)
- - ISNULL(omm.RQTY1, 0) - ISNULL(MX.MQTY, 0)- ISNULL(pu_App.RQTY3, 0) AS q, motype.description,
+ c.cInvName cinvname1, c.cInvStd cinvstd1,LL.cComUnitName as cComUnitName1, CASE
+ WHEN c.bPurchase = 1 AND c.bProxyForeign = 1 and c.bself = 1 THEN '委外,自制'
+ WHEN c.bPurchase = 1 AND c.bProxyForeign = 1 and c.bself <>1 THEN '委外'
+ WHEN c.bPurchase = 1 AND c.bProxyForeign <> 1 and c.bself <> 1 THEN '外购'
+ WHEN c.bPurchase = 1 AND c.bProxyForeign <> 1 and c.bself = 1 THEN '外购,自制'
+ WHEN c.bPurchase <> 1 AND c.bProxyForeign <> 1 and c.bself = 1 THEN '自制'
+ ELSE '其它'
+ END AS std,dtyl.dtty, ma.Qty qty1, ma.IssQty issqty,(ma.Qty-ma.IssQty) as wll,mdsss.mdqty,shwl.shwl,sdwl.sdwl
+ ,mas.wqty wqty, ISNULL(cs.qty, 0) cqty, ISNULL(misss.issqty, 0) issqtyxc,ISNULL(ds.qty, 0) dqty,isnull(prd.Rqty, 0) rqty,
+ ISNULL(OMM.RQTY1, 0) AS rqty1, ISNULL(pu_App.RQTY3, 0) AS rqty3,ISNULL(momq.momqty, 0) AS momqty, ISNULL(MX.MQTY, 0) MQTY, 0-(mas.wqty - isnull(ds.qty, 0) - ISNULL(prd.Rqty, 0)
+ - ISNULL(omm.RQTY1, 0) - ISNULL(MX.MQTY, 0)- ISNULL(pu_App.RQTY3, 0)) AS q, motype.description,
CASE WHEN md.Status = 2 THEN '锁定' WHEN md.Status = 4 THEN '关闭' WHEN md.Status = 3 THEN '审核' ELSE '新建' END AS st, md.Status
FROM mom_order m WITH (NOLOCK) INNER JOIN
mom_orderdetail md WITH (NOLOCK) ON m.MoId = md.MoId INNER JOIN
@@ -242,12 +252,17 @@ SELECT m..mocode,CONVERT(varchar(100), mor.StartDate, 23) as StartDate ,CONVER
select *from (
SELECT m..mocode,CONVERT(varchar(100), mor.StartDate, 23) as StartDate ,CONVERT(varchar(100), mor.DueDate, 23) as DueDate ,DATEDIFF(day,GETDATE(),mor.DueDate) AS jandete , md.SortSeq, md.InvCode, p.cInvName, p.cInvStd,KK.cComUnitName, md.Qty, md.QualifiedInQty,(md.Qty-md.QualifiedInQty) as wwc, ma.InvCode invcode1,
- c.cInvName cinvname1, c.cInvStd cinvstd1,LL.cComUnitName as cComUnitName1, CASE WHEN c.bPurchase = 1 AND
- c.bProxyForeign = 1 THEN '委外' WHEN c.bPurchase = 1 THEN '外购' WHEN c.bself = 1 THEN '自制' ELSE '其它' END AS
- std,dtyl.dtty, ma.Qty qty1, ma.IssQty issqty,(ma.Qty-ma.IssQty) as wll,mdsss.mdqty,shwl.shwl,sdwl.sdwl
+ c.cInvName cinvname1, c.cInvStd cinvstd1,LL.cComUnitName as cComUnitName1,CASE
+ WHEN c.bPurchase = 1 AND c.bProxyForeign = 1 and c.bself = 1 THEN '委外,自制'
+ WHEN c.bPurchase = 1 AND c.bProxyForeign = 1 and c.bself <>1 THEN '委外'
+ WHEN c.bPurchase = 1 AND c.bProxyForeign <> 1 and c.bself <> 1 THEN '外购'
+ WHEN c.bPurchase = 1 AND c.bProxyForeign <> 1 and c.bself = 1 THEN '外购,自制'
+ WHEN c.bPurchase <> 1 AND c.bProxyForeign <> 1 and c.bself = 1 THEN '自制'
+ ELSE '其它'
+ END AS std,dtyl.dtty, ma.Qty qty1, ma.IssQty issqty,(ma.Qty-ma.IssQty) as wll,mdsss.mdqty,shwl.shwl,sdwl.sdwl
,mas.wqty wqty, ISNULL(cs.qty, 0) cqty, ISNULL(misss.issqty, 0) issqtyxc,ISNULL(ds.qty, 0) dqty,isnull(prd.Rqty, 0) rqty,
- ISNULL(OMM.RQTY1, 0) AS rqty1, ISNULL(pu_App.RQTY3, 0) AS rqty3,ISNULL(momq.momqty, 0) AS momqty, ISNULL(MX.MQTY, 0) MQTY, mas.wqty - isnull(ds.qty, 0) - ISNULL(prd.Rqty, 0)
- - ISNULL(omm.RQTY1, 0) - ISNULL(MX.MQTY, 0)- ISNULL(pu_App.RQTY3, 0) AS q, motype.description,
+ ISNULL(OMM.RQTY1, 0) AS rqty1, ISNULL(pu_App.RQTY3, 0) AS rqty3,ISNULL(momq.momqty, 0) AS momqty, ISNULL(MX.MQTY, 0) MQTY, 0-(mas.wqty - isnull(ds.qty, 0) - ISNULL(prd.Rqty, 0)
+ - ISNULL(omm.RQTY1, 0) - ISNULL(MX.MQTY, 0)- ISNULL(pu_App.RQTY3, 0)) AS q, motype.description,
CASE WHEN md.Status = 2 THEN '锁定' WHEN md.Status = 4 THEN '关闭' WHEN md.Status = 3 THEN '审核' ELSE '新建' END AS st, md.Status
FROM mom_order m WITH (NOLOCK) INNER JOIN
mom_orderdetail md WITH (NOLOCK) ON m.MoId = md.MoId INNER JOIN
@@ -658,7 +673,7 @@ SELECT m..mocode,CONVERT(varchar(100), mor.StartDate, 23) as StartDate ,CONVER
}
if (!info1.byFinish)
{
- where.Add(" isnull(zpurpotail.cbcloser,'') ='' ");
+ where.Add(" isnull(zpurpotail.cbcloser,'') ='' and zpurpotail.ireceivedqty <> zpurpotail.iquantity ");
}
var aa = string.Join(" and ", where.ToArray());
diff --git a/NX.ERP.U8/Pmc/PurchaseQuery.cs b/NX.ERP.U8/Pmc/PurchaseQuery.cs
new file mode 100644
index 0000000..a19e151
--- /dev/null
+++ b/NX.ERP.U8/Pmc/PurchaseQuery.cs
@@ -0,0 +1,445 @@
+using NX.ERP.U8.Purchase;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using Dapper;
+
+
+namespace NX.ERP.U8.Purchase
+
+{
+ public class PurchaseQuery
+ {
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+
+ public IEnumerable