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);