From e315d00df956b4fee38dafa79b88843493310c83 Mon Sep 17 00:00:00 2001 From: 44673626 <44673626@qq.com> Date: Fri, 14 Jan 2022 10:16:21 +0800 Subject: [PATCH] =?UTF-8?q?H=E5=B9=B3=E5=8F=B0=E3=80=81F=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E5=92=8CM=E5=B9=B3=E5=8F=B0=E7=9A=84=E7=BB=93=E7=AE=97?= =?UTF-8?q?=E6=95=B0=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../HQFSettledDetailDapperRepository.cs | 6 ++-- .../HQHSettledDetailDapperRepository.cs | 35 ++++++------------- .../HQMSettledDetailDapperRepository.cs | 8 ++--- 3 files changed, 18 insertions(+), 31 deletions(-) diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQFSettledDetailDapperRepository.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQFSettledDetailDapperRepository.cs index a8de758f..02433950 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQFSettledDetailDapperRepository.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQFSettledDetailDapperRepository.cs @@ -221,14 +221,14 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " temp1.MaterialCode 客户物料号,\n" + " temp1.HQHKanBan 看板号 ,\n" + " temp1.SettleQty 结算数量,\n" + - " temp2.Qty 发货数量,\n" + - " ( temp1.SettleQty - temp2.Qty ) 差异数量 \n" + + " ISNULL(temp2.Qty,0) 发货数量,\n" + + " ( ISNULL(temp1.SettleQty,0) - ISNULL(temp2.Qty,0) ) 差异数量 \n" + "FROM\n" + " ( SELECT SUM ( Qty ) SettleQty, HQHKanBan, MaterialCode FROM Set_HQ_F_Platform WHERE version = '{0}' GROUP BY HQHKanBan, MaterialCode ) temp1\n" + " LEFT JOIN ( SELECT SUM ( Qty ) Qty, Kanban, MaterialCode FROM Set_HQ_F_Kanban GROUP BY Kanban, MaterialCode ) temp2 ON temp1.HQHKanBan = temp2.Kanban \n" + " AND temp1.MaterialCode = temp2.MaterialCode \n" + "WHERE\n" + - " temp1.SettleQty!= temp2.Qty"; + " temp1.SettleQty!= ISNULL(temp2.Qty,0)"; str = string.Format(str, version); var _query = DbConnection.Query(str, null, null, true, 1200, null); diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQHSettledDetailDapperRepository.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQHSettledDetailDapperRepository.cs index 48eca5bc..2d134ada 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQHSettledDetailDapperRepository.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQHSettledDetailDapperRepository.cs @@ -135,31 +135,18 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report { List _list = new List(); var str = - "SELECT temp1.MaterialCode 客户物料号,temp1.HQHKanBan 看板号 ,temp1.SettleQty 结算数量, temp2.Qty 发货数量,( temp1.SettleQty - temp2.Qty ) 差异数量 \n" + + "SELECT\n" + + " temp1.MaterialCode 客户物料号,\n" + + " temp1.HQHKanBan 看板号 ,\n" + + " temp1.SettleQty 结算数量,\n" + + " ISNULL(temp2.Qty,0) 发货数量,\n" + + " ( ISNULL(temp1.SettleQty,0) - ISNULL(temp2.Qty,0) ) 差异数量 \n" + "FROM\n" + - " (\n" + - " SELECT\n" + - " SUM( Qty ) SettleQty,\n" + - " HQHKanBan,\n" + - " MaterialCode \n" + - " FROM\n" + - " Set_HQ_H_Platform where version='{0}'\n" + - " GROUP BY\n" + - " HQHKanBan,\n" + - " MaterialCode \n" + - " ) temp1\n" + - " LEFT JOIN (\n" + - " SELECT\n" + - " SUM( Qty ) Qty,\n" + - " Kanban,\n" + - " MaterialCode \n" + - " FROM\n" + - " Set_HQ_H_Kanban \n" + - " GROUP BY\n" + - " Kanban,\n" + - " MaterialCode \n" + - " ) temp2 ON temp1.HQHKanBan = temp2.Kanban \n" + - " AND temp1.MaterialCode = temp2.MaterialCode where temp1.SettleQty!=temp2.Qty "; + " ( SELECT SUM ( Qty ) SettleQty, HQHKanBan, MaterialCode FROM Set_HQ_H_Platform WHERE version = '{0}' GROUP BY HQHKanBan, MaterialCode ) temp1\n" + + " LEFT JOIN ( SELECT SUM ( Qty ) Qty, Kanban, MaterialCode FROM Set_HQ_H_Kanban GROUP BY Kanban, MaterialCode ) temp2 ON temp1.HQHKanBan = temp2.Kanban \n" + + " AND temp1.MaterialCode = temp2.MaterialCode \n" + + "WHERE\n" + + " temp1.SettleQty!= ISNULL(temp2.Qty,0)"; str = string.Format(str, version); var _query = DbConnection.Query(str, null, null, true, 1200, null); diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQMSettledDetailDapperRepository.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQMSettledDetailDapperRepository.cs index c390a26a..2b402a17 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQMSettledDetailDapperRepository.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQMSettledDetailDapperRepository.cs @@ -129,18 +129,18 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report { List _list = new List(); var str = - "SELECT\n" + + "SELECT\n" + " temp1.MaterialCode 客户物料号,\n" + " temp1.HQMKanBan 看板号 ,\n" + " temp1.SettleQty 结算数量,\n" + - " temp2.Qty 发货数量,\n" + - " ( temp1.SettleQty - temp2.Qty ) 差异数量 \n" + + " ISNULL(temp2.Qty,0) 发货数量,\n" + + " ( ISNULL(temp1.SettleQty,0) - ISNULL(temp2.Qty,0) ) 差异数量 \n" + "FROM\n" + " ( SELECT SUM ( Qty ) SettleQty, HQMKanBan, MaterialCode FROM Set_HQ_M_Platform WHERE version = '{0}' GROUP BY HQMKanBan, MaterialCode ) temp1\n" + " LEFT JOIN ( SELECT SUM ( Qty ) Qty, Kanban, MaterialCode FROM Set_HQ_M_Kanban GROUP BY Kanban, MaterialCode ) temp2 ON temp1.HQMKanBan = temp2.Kanban \n" + " AND temp1.MaterialCode = temp2.MaterialCode \n" + "WHERE\n" + - " temp1.SettleQty!= temp2.Qty"; + " temp1.SettleQty!= ISNULL(temp2.Qty,0)"; str = string.Format(str, version); var _query = DbConnection.Query(str, null, null, true, 1200, null);