From 52de01a367a16184e26955a28bbbac053630bf80 Mon Sep 17 00:00:00 2001
From: 44673626 <44673626@qq.com>
Date: Wed, 13 Apr 2022 15:47:56 +0800
Subject: [PATCH] =?UTF-8?q?=E7=BA=A2=E6=97=97=EF=BC=8C=E5=A4=96=E9=83=A8?=
=?UTF-8?q?=E5=8D=95=E5=8F=B7=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Entities/BT_Car/BT_Car_PlatformDto.cs | 2 +-
.../BT_Car/BT_Car_PlatformExportDto.cs | 4 +-
.../BT_Car/BT_Car_PlatformImportDto.cs | 4 +-
.../Entities/HQ_H/HQ_H_PlatformDto.cs | 2 +-
.../Entities/HQ_H/HQ_H_PlatformExportDto.cs | 2 +-
.../Entities/HQ_H/HQ_H_PlatformImportDto.cs | 2 +-
.../UnHQSettleAccounts/UnHQSettleDto.cs | 2 +-
.../Entities/BT_Car/BT_Car_Platform.cs | 4 +-
.../Entities/HQ_F/HQ_F_Platform.cs | 2 +-
.../Entities/HQ_H/HQ_H_Platform.cs | 2 +-
.../UnHQSettleAccounts/UnHQSettleAccount.cs | 2 +-
.../HQCarSettledDetailDapperRepository.cs | 10 +-
.../HQFactorySettledDetailDapperRepository.cs | 155 +--------
.../HQHSettledDetailDapperRepository.cs | 307 +++++++++---------
.../SettleSparePartDapperReportRepository.cs | 72 +++-
.../HQHSettledDetailDiffExportService.cs | 25 +-
16 files changed, 250 insertions(+), 347 deletions(-)
diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BT_Car/BT_Car_PlatformDto.cs b/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BT_Car/BT_Car_PlatformDto.cs
index 9cd50c92..c08e30be 100644
--- a/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BT_Car/BT_Car_PlatformDto.cs
+++ b/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BT_Car/BT_Car_PlatformDto.cs
@@ -14,7 +14,7 @@ namespace Win.Sfs.SettleAccount.Entities.BT_Car
///
public string Factory { get; set; }
///
- ///外部验收单号
+ ///外部单号
///
public string ExternalKanbanNumber { get; set; }
///
diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BT_Car/BT_Car_PlatformExportDto.cs b/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BT_Car/BT_Car_PlatformExportDto.cs
index db09adb9..08c3e785 100644
--- a/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BT_Car/BT_Car_PlatformExportDto.cs
+++ b/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BT_Car/BT_Car_PlatformExportDto.cs
@@ -15,9 +15,9 @@ namespace Win.Sfs.SettleAccount.Entities.BT_Car
[ExporterHeader(DisplayName = "工厂")]
public string Factory { get; set; }
///
- ///外部验收单号
+ ///外部单号
///
- [ExporterHeader(DisplayName = "外部验收单号")]
+ [ExporterHeader(DisplayName = "外部单号")]
public string ExternalKanbanNumber { get; set; }
///
///看板编号
diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BT_Car/BT_Car_PlatformImportDto.cs b/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BT_Car/BT_Car_PlatformImportDto.cs
index 9fc419a5..0feffa14 100644
--- a/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BT_Car/BT_Car_PlatformImportDto.cs
+++ b/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BT_Car/BT_Car_PlatformImportDto.cs
@@ -15,9 +15,9 @@ namespace Win.Sfs.SettleAccount.Entities.BT_Car
[ImporterHeader(Name = "工厂")]
public string Factory { get; set; }
///
- ///外部看板编号
+ ///外部单号
///
- [ImporterHeader(Name = "外部验收单号")]
+ [ImporterHeader(Name = "外部单号")]
public string ExternalKanbanNumber { get; set; }
///
///看板编号
diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/HQ_H/HQ_H_PlatformDto.cs b/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/HQ_H/HQ_H_PlatformDto.cs
index 7f8d9556..9a3edca6 100644
--- a/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/HQ_H/HQ_H_PlatformDto.cs
+++ b/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/HQ_H/HQ_H_PlatformDto.cs
@@ -15,7 +15,7 @@ namespace Win.Sfs.SettleAccount.Entities.HQ_H
///
public string Factory { get; set; }
///
- ///外部看板编号
+ ///外部单号
///
public string ExternalKanbanNumber { get; set; }
///
diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/HQ_H/HQ_H_PlatformExportDto.cs b/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/HQ_H/HQ_H_PlatformExportDto.cs
index 282d5539..213804bd 100644
--- a/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/HQ_H/HQ_H_PlatformExportDto.cs
+++ b/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/HQ_H/HQ_H_PlatformExportDto.cs
@@ -17,7 +17,7 @@ namespace Win.Sfs.SettleAccount.Entities.HQ_H
///
///外部单号
///
- [ExporterHeader(DisplayName = "外部看板编号")]
+ [ExporterHeader(DisplayName = "外部单号")]
public string ExternalKanbanNumber { get; set; }
///
///看板编号
diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/HQ_H/HQ_H_PlatformImportDto.cs b/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/HQ_H/HQ_H_PlatformImportDto.cs
index a16a4afe..e46caa69 100644
--- a/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/HQ_H/HQ_H_PlatformImportDto.cs
+++ b/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/HQ_H/HQ_H_PlatformImportDto.cs
@@ -17,7 +17,7 @@ namespace Win.Sfs.SettleAccount.Entities.HQ_H
///
///外部单号
///
- [ImporterHeader(Name = "外部看板编号")]
+ [ImporterHeader(Name = "外部单号")]
public string ExternalKanbanNumber { get; set; }
///
///看板编号
diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleDto.cs b/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleDto.cs
index b92fc6a9..8dcb17f9 100644
--- a/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleDto.cs
+++ b/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleDto.cs
@@ -14,7 +14,7 @@ namespace Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts
///
public string Factory { get; set; }
///
- ///外部看板编号
+ ///外部单号
///
public string ExternalKanbanNumber { get; set; }
///
diff --git a/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BT_Car/BT_Car_Platform.cs b/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BT_Car/BT_Car_Platform.cs
index 2592adc9..126ac8b1 100644
--- a/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BT_Car/BT_Car_Platform.cs
+++ b/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BT_Car/BT_Car_Platform.cs
@@ -57,9 +57,9 @@ namespace Win.Sfs.SettleAccount.Entities.BT_Car
[Display(Name = "工厂")]
public string Factory { get; set; }
///
- ///外部验收单号
+ ///外部单号
///
- [Display(Name = "外部验收单号")]
+ [Display(Name = "外部单号")]
public string ExternalKanbanNumber { get; set; }
///
///看板编号
diff --git a/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/HQ_F/HQ_F_Platform.cs b/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/HQ_F/HQ_F_Platform.cs
index ac90c240..4c494408 100644
--- a/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/HQ_F/HQ_F_Platform.cs
+++ b/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/HQ_F/HQ_F_Platform.cs
@@ -69,7 +69,7 @@ namespace Win.Sfs.SettleAccount.Entities.HQ_F
///
///外部看板编号
///
- [Display(Name = "外部看板编号")]
+ [Display(Name = "外部单号")]
public string ExternalKanbanNumber { get; set; }
///
///看板编号
diff --git a/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/HQ_H/HQ_H_Platform.cs b/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/HQ_H/HQ_H_Platform.cs
index 84d0d014..4883b898 100644
--- a/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/HQ_H/HQ_H_Platform.cs
+++ b/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/HQ_H/HQ_H_Platform.cs
@@ -70,7 +70,7 @@ namespace Win.Sfs.SettleAccount.Entities.HQ_H
///
///外部看板编号
///
- [Display(Name = "外部看板编号")]
+ [Display(Name = "外部单号")]
public string ExternalKanbanNumber { get; set; }
///
///看板编号
diff --git a/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/UnHQSettleAccounts/UnHQSettleAccount.cs b/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/UnHQSettleAccounts/UnHQSettleAccount.cs
index 1956dc44..b87d1a01 100644
--- a/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/UnHQSettleAccounts/UnHQSettleAccount.cs
+++ b/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/UnHQSettleAccounts/UnHQSettleAccount.cs
@@ -73,7 +73,7 @@ namespace Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts
///
///外部看板编号
///
- [Display(Name = "外部看板编号")]
+ [Display(Name = "外部单号")]
public string ExternalKanbanNumber { get; set; }
///
///看板编号
diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQCarSettledDetailDapperRepository.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQCarSettledDetailDapperRepository.cs
index c34a64ae..07f1d02a 100644
--- a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQCarSettledDetailDapperRepository.cs
+++ b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQCarSettledDetailDapperRepository.cs
@@ -89,7 +89,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" C.EstimateTypeDesc 物料组,\n" +
" C.MaterialDesc 物料描述,\n" +
" CONVERT ( VARCHAR ( 100 ), A.AcceptanceDate, 23 ) 验收单日期,\n" +
- " a.[ExternalKanbanNumber] AS 外部验收单号,\n" +
+ " a.[ExternalKanbanNumber] AS 外部单号,\n" +
" ISNULL( A.Price, 0 ) 结算单价,\n" +
" ISNULL( A.Qty, 0 ) 结算数量,\n" +
" ISNULL( A.Price, 0 ) * ISNULL( A.Qty, 0 ) 结算金额,\n" +
@@ -230,7 +230,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" C.EstimateTypeDesc 物料组,\n" +
" C.MaterialDesc 物料描述,\n" +
" CONVERT ( VARCHAR ( 100 ), A.AcceptanceDate, 23 ) 验收单日期,\n" +
- " a.[ExternalKanbanNumber] AS 外部验收单号,\n" +
+ " a.[ExternalKanbanNumber] AS 外部单号,\n" +
" ISNULL( A.Price, 0 ) 结算单价,\n" +
" ISNULL( A.Qty, 0 ) 结算数量,\n" +
" ISNULL( A.Price, 0 ) * ISNULL( A.Qty, 0 ) 结算金额,\n" +
@@ -356,7 +356,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
结算数量 = qty;
结算金额 = settleprice;
物料组 = metarialGroup;
- 外部验收单号 = externalKanbanNumber;
+ 外部单号 = externalKanbanNumber;
验收单日期 = acceptanceDate;
}
@@ -380,8 +380,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
[ExporterHeader(DisplayName = "结算验收单号",IsIgnore =true)]
public string 结算验收单号 { set; get; }
- [ExporterHeader(DisplayName = "外部验收单号")]
- public string 外部验收单号 { set; get; }
+ [ExporterHeader(DisplayName = "外部单号")]
+ public string 外部单号 { set; get; }
[ExporterHeader(DisplayName = "物料组")]
public string 物料组 { set; get; }
diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQFactorySettledDetailDapperRepository.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQFactorySettledDetailDapperRepository.cs
index 48ba2225..beb247d0 100644
--- a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQFactorySettledDetailDapperRepository.cs
+++ b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQFactorySettledDetailDapperRepository.cs
@@ -101,7 +101,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" temp1.物料组,\n" +
" temp1.零件中文名称,\n" +
" temp1.发货数量,\n" +
- " temp1.外部验收单号,\n" +
+ " temp1.外部单号,\n" +
" temp1.结算数量,\n" +
" isnull( TEMP2.Price, 0 ) AS 发货定价,\n" +
" isnull( temp1.发货数量, 0 ) * isnull( TEMP2.Price, 0 ) AS 发货总金额,\n" +
@@ -117,7 +117,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" c.CustomerPartCode 客户物料号,\n" +
" c.MaterialDesc AS 零件中文名称,\n" +
" isnull( a.Qty, 0 ) AS 发货数量,\n" +
- " '' AS 外部验收单号,\n" +
+ " '' AS 外部单号,\n" +
" isnull( b.Qty, 0 ) AS 结算数量,\n" +
" C.EstimateTypeDesc AS 物料组 \n" +
" FROM\n" +
@@ -147,7 +147,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" temp1.物料组,\n" +
" temp1.零件中文名称,\n" +
" temp1.发货数量,\n" +
- " temp1.外部验收单号,\n" +
+ " temp1.外部单号,\n" +
" temp1.结算数量,\n" +
" isnull( TEMP2.Price, 0 ) AS 发货定价,\n" +
" isnull( temp1.发货数量, 0 ) * isnull( TEMP2.Price, 0 ) AS 发货总金额,\n" +
@@ -163,7 +163,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" c.CustomerPartCode 客户物料号,\n" +
" c.MaterialDesc AS 零件中文名称,\n" +
" isnull( a.Qty, 0 ) AS 发货数量,\n" +
- " '' AS 外部验收单号,\n" +
+ " '' AS 外部单号,\n" +
" isnull( b.Qty, 0 ) AS 结算数量,\n" +
" C.EstimateTypeDesc AS 物料组 \n" +
" FROM\n" +
@@ -394,7 +394,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
{
//itm1.看板编号 = itmcopy.KanbanNumber;
//itm1.验收单日期 = itmcopy.AcceptanceDate;
- itm1.外部验收单号 = itmcopy.ExternalKanbanNumber;
+ itm1.外部单号 = itmcopy.ExternalKanbanNumber;
}
}
@@ -404,93 +404,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
}
- #region old
- //string str = "SELECT\n" +
- //" temp3.StorageLocation 收货仓库,\n" +
- //" temp3.StorageLocationDesc 收货仓库描述,\n" +
- //" temp3.HQHKanBan 订货看板编号,\n" +
- //" temp3.ExternalKanbanNumber 外部验收单号,\n" +
- //" temp3.AcceptanceDate 验收单日期,\n" +
- //" temp3.MaterialCode Sap编码,\n" +
- //" temp3.hqMaterialCode 客户物料号,\n" +
- //" temp3.EstimateTypeDesc 物料组,\n" +
- //" temp3.MaterialDesc 零件中文名称,\n" +
- //" isnull( TEMP2.Price, 0 ) AS 发货定价,\n" +
- //" temp3.UnHQAmt 金额,\n" +
- //" temp3.系统未结数量,\n" +
- //" temp3.UnHQQty 红旗未结数量,\n" +
- //" ( ISNULL( temp3.系统未结数量, 0 ) - ISNULL( temp3.UnHQQty, 0 ) ) 差异 \n" +
- //"FROM\n" +
- //" (\n" +
- //" SELECT\n" +
- //" * \n" +
- //" FROM\n" +
- //" (\n" +
- //" SELECT\n" +
- //" h.StorageLocation,\n" +
- //" h.StorageLocationDesc,\n" +
- //" h.HQHKanBan,\n" +
- //" h.ExternalKanbanNumber,\n" +
- //" CONVERT ( VARCHAR ( 100 ), h.AcceptanceDate, 23 ) AcceptanceDate,\n" +
- //" m.MaterialCode,\n" +
- //" h.MaterialCode hqMaterialCode,\n" +
- //" m.CustomerPartCode,\n" +
- //" m.MaterialDesc,\n" +
- //" m.EstimateTypeDesc,\n" +
- //" ISNULL( h.Qty, 0 ) AS UnHQQty,\n" +
- //" ISNULL( h.Amt, 0 ) AS UnHQAmt \n" +
- //" FROM\n" +
- //" (\n" +
- //" SELECT SUM\n" +
- //" ( Qty ) Qty,\n" +
- //" Amt,\n" +
- //" HQHKanBan,\n" +
- //" StorageLocation,\n" +
- //" StorageLocationDesc,\n" +
- //" ExternalKanbanNumber,\n" +
- //" MaterialCode,\n" +
- //" AcceptanceDate \n" +
- //" FROM\n" +
- //" Set_UnHQSettleAccount \n" +
- //" GROUP BY\n" +
- //" HQHKanBan,\n" +
- //" StorageLocation,\n" +
- //" StorageLocationDesc,\n" +
- //" ExternalKanbanNumber,\n" +
- //" Amt,\n" +
- //" MaterialCode,\n" +
- //" AcceptanceDate \n" +
- //" ) AS h\n" +
- //" LEFT JOIN Set_material AS m ON h.MaterialCode = m.CustomerPartCode \n" +
- //" ) AS unhq\n" +
- //" LEFT JOIN (\n" +
- //" SELECT\n" +
- //" a.Kanban AS 订货看板编号,\n" +
- //" b.MaterialCode AS 订货零件号,\n" +
- //" c.MaterialCode Sap编码,\n" +
- //" c.CustomerPartCode 客户物料号,\n" +
- //" c.MaterialDesc AS 零件中文名称,\n" +
- //" isnull( a.Qty, 0 ) AS 系统未结数量,\n" +
- //" b.ExternalKanbanNumber AS 外部验收单号,\n" +
- //" C.EstimateTypeDesc AS 物料组 \n" +
- //" FROM\n" +
- //" ( SELECT SUM ( Qty ) Qty, Kanban, MaterialCode FROM Set_HQ_H_Kanban GROUP BY Kanban, MaterialCode ) AS a\n" +
- //" LEFT OUTER JOIN ( SELECT * FROM Set_HQ_H_Platform WHERE HQHKanBan <> 'BJ' ) AS b ON a.Kanban = b.HQHKanBan \n" +
- //" AND a.MaterialCode = b.MaterialCode\n" +
- //" LEFT OUTER JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" +
- //" WHERE\n" +
- //" b.HQHKanBan IS NULL \n" +
- //" AND b.MaterialCode IS NULL \n" +
- //" ) AS temp1 ON unhq.HQHKanBan = temp1.[订货看板编号] \n" +
- //" AND unhq.CustomerPartCode= temp1.客户物料号 -- WHERE\n" +
- //"-- temp1.[订货看板编号] IS NULL\n" +
- //"-- AND temp1.客户物料号 IS NULL\n" +
- //" \n" +
- //" ) temp3\n" +
- //" LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE Version = '202110' ) AS TEMP2 ON temp3.MaterialCode = TEMP2.MaterialCode";
- #endregion
-
-
+
///
/// 红旗系统未对比对红旗主机厂未结,其中红旗系统未结数据中还包括有发货有结算中发货数量大于结算的也要整合到未结当中
///
@@ -527,55 +441,14 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
{
contion += " WHERE 1=1 ";
}
- //按照客户财务要求 去掉结算验收单号换成外部验收单号
- //string str = "SELECT\n" +
- //" temp1.交货单号,\n" +
- //" temp1.交货时间,\n" +
- //" temp1.收货仓库,\n" +
- //" temp1.收货仓库描述,\n" +
- //" temp1.订货看板编号,\n" +
- //" temp1.外部验收单号,\n" +
- //" temp1.Sap编码,\n" +
- //" temp1.[客户物料号],\n" +
- //" temp1.物料组,\n" +
- //" temp1.零件中文名称,\n" +
- //" isnull( TEMP2.Price, 0 ) AS 发货定价,\n" +
- //" ISNULL( temp1.系统未结数量, 0 ) 系统未结数量,\n" +
- //" isnull( temp3.Qty, 0 ) AS 红旗未结数量,\n" +
- //" ( ISNULL( temp1.系统未结数量, 0 ) - ISNULL( temp3.Qty, 0 ) ) 差异 \n" +
- //"FROM\n" +
- //" (\n" +
- //" SELECT\n" +
- //" a.WmsBillNum [交货单号],\n" +
- //" CONVERT ( VARCHAR ( 100 ), a.LastModificationTime, 23 ) 交货时间,\n" +
- //" b.StorageLocation AS 收货仓库,\n" +
- //" b.StorageLocationDesc AS 收货仓库描述,\n" +
- //" a.Kanban AS 订货看板编号,\n" +
- //" c.MaterialCode Sap编码,\n" +
- //" c.CustomerPartCode 客户物料号,\n" +
- //" c.MaterialDesc AS 零件中文名称,\n" +
- //" isnull( a.Qty, 0 ) AS 系统未结数量,\n" +
- //" b.ExternalKanbanNumber AS 外部验收单号,\n" +
- //" C.EstimateTypeDesc AS 物料组 \n" +
- //" FROM\n" +
- //" ( SELECT SUM ( Qty ) AS Qty, Kanban, MaterialCode, WmsBillNum, LastModificationTime FROM Set_HQ_H_Kanban GROUP BY Kanban, MaterialCode, WmsBillNum, LastModificationTime ) AS a\n" +
- //" LEFT OUTER JOIN ( SELECT * FROM Set_HQ_H_Platform WHERE HQHKanBan <> 'BJ' ) AS b ON a.Kanban = b.HQHKanBan \n" +
- //" AND a.MaterialCode = b.MaterialCode\n" +
- //" LEFT OUTER JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" +
- //" WHERE\n" +
- //" b.HQHKanBan IS NULL \n" +
- //" AND b.MaterialCode IS NULL {0}\n" +
- //" ) AS temp1\n" +
- //" LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE ( Version = ( SELECT MAX ( Version ) FROM Set_PriceList ) ) ) AS TEMP2 ON temp1.Sap编码 = TEMP2.MaterialCode\n" +
- //" LEFT JOIN ( SELECT SUM ( Qty ) Qty, HQHKanBan, MaterialCode FROM Set_UnHQSettleAccount GROUP BY HQHKanBan, MaterialCode ) temp3 ON temp1.[订货看板编号] = temp3.HQHKanBan \n" +
- //" AND temp1.[客户物料号] = temp3.MaterialCode";
+
string str = "SELECT\n" +
" temp.交货单号,\n" +
" temp.交货时间,\n" +
" temp.订货看板编号,\n" +
- " temp.外部验收单号,\n" +
+ " temp.外部单号,\n" +
" temp.Sap编码,\n" +
" temp.[客户物料号],\n" +
" temp.物料组,\n" +
@@ -603,7 +476,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" temp1.物料组,\n" +
" temp1.零件中文名称,\n" +
" temp1.发货数量,\n" +
- " temp1.外部验收单号,\n" +
+ " temp1.外部单号,\n" +
" temp1.结算数量,\n" +
" isnull( TEMP2.Price, 0 ) AS 发货定价,\n" +
" isnull( temp1.发货数量, 0 ) * isnull( TEMP2.Price, 0 ) AS 发货总金额,\n" +
@@ -619,7 +492,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" c.CustomerPartCode 客户物料号,\n" +
" c.MaterialDesc AS 零件中文名称,\n" +
" isnull( a.Qty, 0 ) AS 发货数量,\n" +
- " '' AS 外部验收单号,\n" +
+ " '' AS 外部单号,\n" +
" isnull( b.Qty, 0 ) AS 结算数量,\n" +
" C.EstimateTypeDesc AS 物料组 \n" +
" FROM\n" +
@@ -649,7 +522,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" temp1.物料组,\n" +
" temp1.零件中文名称,\n" +
" temp1.发货数量,\n" +
- " temp1.外部验收单号,\n" +
+ " temp1.外部单号,\n" +
" temp1.结算数量,\n" +
" isnull( TEMP2.Price, 0 ) AS 发货定价,\n" +
" isnull( temp1.发货数量, 0 ) * isnull( TEMP2.Price, 0 ) AS 发货总金额,\n" +
@@ -665,7 +538,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" c.CustomerPartCode 客户物料号,\n" +
" c.MaterialDesc AS 零件中文名称,\n" +
" isnull( a.Qty, 0 ) AS 发货数量,\n" +
- " '' AS 外部验收单号,\n" +
+ " '' AS 外部单号,\n" +
" isnull( b.Qty, 0 ) AS 结算数量,\n" +
" C.EstimateTypeDesc AS 物料组 \n" +
" FROM\n" +
@@ -823,8 +696,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
[ExporterHeader(DisplayName = "结算验收单号", IsIgnore = true)]
public string 结算验收单号 { set; get; }
- [ExporterHeader(DisplayName = "外部验收单号")]
- public string 外部验收单号 { set; get; }
+ [ExporterHeader(DisplayName = "外部单号")]
+ public string 外部单号 { set; get; }
[ExporterHeader(DisplayName = "Sap编码")]
public string Sap编码 { set; get; }
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 b9e73757..f6e76952 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
@@ -70,101 +70,98 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
string str = "SELECT\n" +
- " isnull( temp1.交货单号, '' ) 交货单号,\n" +
- " temp1.交货时间,\n" +
- " isnull( temp1.手工或自动, '' ) 手工或自动,\n" +
- " temp1.[工厂],\n" +
- " temp1.收货仓库,\n" +
- " temp1.收货仓库描述,\n" +
- " temp1.订货看板编号,\n" +
- " temp1.订货零件号,\n" +
- " temp1.验收单日期,\n" +
- " temp1.Sap编码,\n" +
- " temp1.看板编号,\n" +
- " temp1.物料组,\n" +
- " temp1.零件中文名称,\n" +
- " temp1.发货数量,\n" +
- " temp1.发货状态,\n" +
- " temp1.外部验收单号,\n" +
- " temp1.结算数量,\n" +
- " temp3.Price AS 结算单价,\n" +
- " ( temp1.[结算数量] * ISNULL( temp3.Price, 0 ) ) AS 结算金额,\n" +
- " isnull( TEMP2.Price, 0 ) AS 发货定价,\n" +
- " isnull( temp1.发货数量, 0 ) * isnull( TEMP2.Price, 0 ) AS 发货总金额,\n" +
- " ( isnull( temp1.发货数量, 0 ) - isnull( temp1.[结算数量], 0 ) - ISNULL( temp4.Qty, 0 ) ) AS 数量差异,\n" +
- " ISNULL( temp3.Price, 0 ) - ISNULL( TEMP2.Price, 0 ) AS 单价差异,\n" +
- " ( ISNULL( temp3.Price, 0 ) - ISNULL( TEMP2.Price, 0 ) ) * temp1.结算数量 AS 差异总金额 ,\n" +
- " temp4.Qty 退货数量 \n" +
- "FROM\n" +
- " (\n" +
- " SELECT\n" +
- " '' AS 交货单号,\n" +
- " NULL AS 交货时间,\n" +
- " '' AS 手工或自动,\n" +
- " a.StorageLocation AS 收货仓库,\n" +
- " a.StorageLocationDesc AS 收货仓库描述,\n" +
- " a.HQHKanBan AS 订货看板编号,\n" +
- " a.MaterialCode AS 订货零件号,\n" +
- " c.MaterialCode Sap编码,\n" +
- " a.MaterialCode 结算物料代码,\n" +
- " c.MaterialDesc AS 零件中文名称,\n" +
- " isnull( b.Qty, 0 ) AS 发货数量,\n" +
- " 2 AS 发货状态,\n" +
- " a.[ExternalKanbanNumber] AS 外部验收单号,\n" +
- " isnull( a.Qty, 0 ) AS 结算数量,\n" +
- " C.EstimateTypeDesc AS 物料组,\n" +
- " a.Factory AS 工厂,\n" +
- " '' AS 看板编号,\n" +
- " '' AS 验收单日期 \n" +
- " FROM\n" +
- " (\n" +
- " SELECT SUM\n" +
- " ( Qty ) AS Qty,\n" +
- " HQHKanBan,\n" +
- " MaterialCode,\n" +
- " Version,\n" +
- " StorageLocation,\n" +
- " StorageLocationDesc,\n" +
- " Factory,\n" +
- " ExternalKanbanNumber \n" +
- " FROM\n" +
- " Set_HQ_H_Platform \n" +
- " GROUP BY\n" +
- " HQHKanBan,\n" +
- " MaterialCode,\n" +
- " Version,\n" +
- " StorageLocation,\n" +
- " StorageLocationDesc,\n" +
- " Factory,\n" +
- " ExternalKanbanNumber \n" +
- " ) AS a\n" +
- " INNER JOIN ( SELECT SUM ( Qty ) AS Qty, Kanban, MaterialCode FROM Set_HQ_H_Kanban GROUP BY Kanban, MaterialCode ) AS b ON a.HQHKanBan = b.Kanban \n" +
- " AND a.MaterialCode = b.MaterialCode\n" +
- " LEFT OUTER JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" +
- " WHERE\n" +
- " ( a.Version= '{0}' AND a.HQHKanBan IS NOT NULL ) \n" +
- " AND a.HQHKanBan <> 'BJ' \n" +
- " ) AS temp1\n" +
- " LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE Version = '202110' ) AS TEMP2 ON temp1.Sap编码 = TEMP2.MaterialCode\n" +
- " LEFT JOIN (\n" +
- " SELECT\n" +
- " ROUND( SUM ( Amt ) / SUM ( Qty ), 4 ) price,\n" +
- " HQHKanBan,\n" +
- " MaterialCode,\n" +
- " Version \n" +
- " FROM\n" +
- " Set_HQ_H_Platform \n" +
- " WHERE\n" +
- " Version = '{0}' \n" +
- " AND HQHKanBan <> 'BJ' \n" +
- " GROUP BY\n" +
- " HQHKanBan,\n" +
- " MaterialCode,\n" +
- " Version \n" +
- " ) AS TEMP3 ON temp1.[结算物料代码] = TEMP3.MaterialCode \n" +
- " AND temp1.订货看板编号 = TEMP3.HQHKanBan\n" +
- " LEFT JOIN set_backQty temp4 ON temp1.订货看板编号 = temp4.Code \n" +
- " AND temp1.Sap编码= temp4.MaterialCode";
+ " isnull( temp1.交货单号, '' ) 交货单号,\n" +
+ " temp1.交货时间,\n" +
+ " temp1.[工厂],\n" +
+ " temp1.收货仓库,\n" +
+ " temp1.收货仓库描述,\n" +
+ " temp1.订货看板编号,\n" +
+ " temp1.订货零件号,\n" +
+ " temp1.验收单日期,\n" +
+ " temp1.Sap编码,\n" +
+ " temp1.看板编号,\n" +
+ " temp1.物料组,\n" +
+ " temp1.零件中文名称,\n" +
+ " temp1.发货数量,\n" +
+ " temp1.外部单号,\n" +
+ " temp1.结算数量,\n" +
+ " temp3.Price AS 结算单价,\n" +
+ " ( temp1.[结算数量] * ISNULL( temp3.Price, 0 ) ) AS 结算金额,\n" +
+ " isnull( TEMP2.Price, 0 ) AS 发货定价,\n" +
+ " isnull( temp1.发货数量, 0 ) - ISNULL( temp4.Qty, 0 ) AS 实际发货数量,\n" +
+ " ( isnull( temp1.发货数量, 0 ) - ISNULL( temp4.Qty, 0 ) ) * isnull( TEMP2.Price, 0 ) AS 实际发货总金额,\n" +
+ " ( isnull( temp1.发货数量, 0 ) - ISNULL( temp4.Qty, 0 ) - isnull( temp1.[结算数量], 0 ) ) AS 量差,\n" +
+ " ISNULL( temp3.Price, 0 ) - ISNULL( TEMP2.Price, 0 ) AS 单价差异,\n" +
+ " ( ISNULL( temp3.Price, 0 ) - ISNULL( TEMP2.Price, 0 ) ) * temp1.结算数量 AS 差异总金额 ,\n" +
+ " temp4.Qty 退货数量 \n" +
+ "FROM\n" +
+ " (\n" +
+ " SELECT\n" +
+ " '' AS 交货单号,\n" +
+ " NULL AS 交货时间,\n" +
+ " a.StorageLocation AS 收货仓库,\n" +
+ " a.StorageLocationDesc AS 收货仓库描述,\n" +
+ " a.HQHKanBan AS 订货看板编号,\n" +
+ " a.MaterialCode AS 订货零件号,\n" +
+ " c.MaterialCode Sap编码,\n" +
+ " a.MaterialCode 结算物料代码,\n" +
+ " c.MaterialDesc AS 零件中文名称,\n" +
+ " isnull( b.Qty, 0 ) AS 发货数量,\n" +
+ " a.[ExternalKanbanNumber] AS 外部单号,\n" +
+ " isnull( a.Qty, 0 ) AS 结算数量,\n" +
+ " C.EstimateTypeDesc AS 物料组,\n" +
+ " a.Factory AS 工厂,\n" +
+ " '' AS 看板编号,\n" +
+ " '' AS 验收单日期 \n" +
+ " FROM\n" +
+ " (\n" +
+ " SELECT SUM\n" +
+ " ( Qty ) AS Qty,\n" +
+ " HQHKanBan,\n" +
+ " MaterialCode,\n" +
+ " Version,\n" +
+ " StorageLocation,\n" +
+ " StorageLocationDesc,\n" +
+ " Factory,\n" +
+ " ExternalKanbanNumber \n" +
+ " FROM\n" +
+ " Set_HQ_H_Platform \n" +
+ " GROUP BY\n" +
+ " HQHKanBan,\n" +
+ " MaterialCode,\n" +
+ " Version,\n" +
+ " StorageLocation,\n" +
+ " StorageLocationDesc,\n" +
+ " Factory,\n" +
+ " ExternalKanbanNumber \n" +
+ " ) AS a\n" +
+ " INNER JOIN ( SELECT SUM ( Qty ) AS Qty, Kanban, MaterialCode FROM Set_HQ_H_Kanban GROUP BY Kanban, MaterialCode ) AS b ON a.HQHKanBan = b.Kanban \n" +
+ " AND a.MaterialCode = b.MaterialCode\n" +
+ " LEFT OUTER JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" +
+ " WHERE\n" +
+ " ( a.Version= '{0}' AND a.HQHKanBan IS NOT NULL ) \n" +
+ " AND a.HQHKanBan <> 'BJ' \n" +
+ " ) AS temp1\n" +
+ " LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE Version = '202110' ) AS TEMP2 ON temp1.Sap编码 = TEMP2.MaterialCode\n" +
+ " LEFT JOIN (\n" +
+ " SELECT\n" +
+ " ROUND( SUM ( Amt ) / SUM ( Qty ), 4 ) price,\n" +
+ " HQHKanBan,\n" +
+ " MaterialCode,\n" +
+ " Version \n" +
+ " FROM\n" +
+ " Set_HQ_H_Platform \n" +
+ " WHERE\n" +
+ " Version = '{0}' \n" +
+ " AND HQHKanBan <> 'BJ' \n" +
+ " GROUP BY\n" +
+ " HQHKanBan,\n" +
+ " MaterialCode,\n" +
+ " Version \n" +
+ " ) AS TEMP3 ON temp1.[结算物料代码] = TEMP3.MaterialCode \n" +
+ " AND temp1.订货看板编号 = TEMP3.HQHKanBan\n" +
+ " LEFT JOIN set_backQty temp4 ON temp1.订货看板编号 = temp4.Code \n" +
+ " AND temp1.Sap编码= temp4.MaterialCode";
@@ -368,7 +365,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
{
itm1.看板编号 = itmcopy.KanbanNumber;
itm1.验收单日期 = itmcopy.AcceptanceDate;
- itm1.外部验收单号 = itmcopy.ExternalKanbanNumber;
+ itm1.外部单号 = itmcopy.ExternalKanbanNumber;
}
}
@@ -398,7 +395,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" (\n" +
" SELECT\n" +
" temp1.交货时间,\n" +
- " isnull( temp1.手工或自动, '' ) 手工或自动,\n" +
" isnull( temp1.交货单号, '' ) 交货单号,\n" +
" temp1.[工厂],\n" +
" temp1.收货仓库,\n" +
@@ -412,7 +408,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" temp1.零件中文名称,\n" +
" temp1.发货数量,\n" +
" temp1.发货状态,\n" +
- " temp1.外部验收单号,\n" +
+ " temp1.外部单号,\n" +
" temp1.结算数量,\n" +
" temp1.结算单价,\n" +
" temp1.结算金额,\n" +
@@ -426,7 +422,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" SELECT\n" +
" b.WmsBillNum AS 交货单号,\n" +
" CONVERT ( VARCHAR ( 100 ), b.LastModificationTime, 23 ) AS 交货时间,\n" +
- " b.IsAuto AS 手工或自动,\n" +
" a.StorageLocation AS 收货仓库,\n" +
" a.StorageLocationDesc AS 收货仓库描述,\n" +
" a.HQHKanBan AS 订货看板编号,\n" +
@@ -435,7 +430,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" c.MaterialDesc AS 零件中文名称,\n" +
" isnull( b.Qty, 0 ) AS 发货数量,\n" +
" isnull( b.State, 0 ) AS 发货状态,\n" +
- " a.ExternalKanbanNumber AS 外部验收单号,\n" +
+ " a.ExternalKanbanNumber AS 外部单号,\n" +
" isnull( a.Qty, 0 ) AS 结算数量,\n" +
" isnull( a.Price, 0 ) AS 结算单价,\n" +
" isnull( a.Amt, 0 ) AS 结算金额 ,\n" +
@@ -461,7 +456,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" SELECT\n" +
" isnull( temp1.交货单号, '' ) 交货单号,\n" +
" temp1.交货时间,\n" +
- " isnull( temp1.手工或自动, '' ) 手工或自动,\n" +
" temp1.[工厂],\n" +
" temp1.收货仓库,\n" +
" temp1.收货仓库描述,\n" +
@@ -474,7 +468,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" temp1.零件中文名称,\n" +
" temp1.发货数量,\n" +
" temp1.发货状态,\n" +
- " temp1.外部验收单号,\n" +
+ " temp1.外部单号,\n" +
" temp1.结算数量,\n" +
" temp3.Price AS 结算单价,\n" +
" ( temp1.[结算数量] * ISNULL( temp3.Price, 0 ) ) AS 结算金额,\n" +
@@ -488,7 +482,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" SELECT\n" +
" '' AS 交货单号,\n" +
" NULL AS 交货时间,\n" +
- " '' AS 手工或自动,\n" +
" a.StorageLocation AS 收货仓库,\n" +
" a.StorageLocationDesc AS 收货仓库描述,\n" +
" '' AS 订货看板编号,\n" +
@@ -498,7 +491,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" c.MaterialDesc AS 零件中文名称,\n" +
" 0 AS 发货数量,\n" +
" 0 AS 发货状态,\n" +
- " a.ExternalKanbanNumber AS 外部验收单号,\n" +
+ " a.ExternalKanbanNumber AS 外部单号,\n" +
" isnull( a.Qty, 0 ) AS 结算数量,\n" +
" C.EstimateTypeDesc AS 物料组,\n" +
" a.Factory AS 工厂,\n" +
@@ -512,7 +505,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" Version,\n" +
" StorageLocation,\n" +
" StorageLocationDesc,\n" +
- " Factory,ExternalKanbanNumber \n" +
+ " Factory,\n" +
+ " ExternalKanbanNumber \n" +
" FROM\n" +
" Set_HQ_H_Platform \n" +
" WHERE\n" +
@@ -522,7 +516,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" Version,\n" +
" StorageLocation,\n" +
" StorageLocationDesc,\n" +
- " Factory,ExternalKanbanNumber \n" +
+ " Factory,\n" +
+ " ExternalKanbanNumber \n" +
" ) AS a\n" +
" LEFT OUTER JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" +
" WHERE\n" +
@@ -605,7 +600,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" temp1.物料组,\n" +
" temp1.零件中文名称,\n" +
" temp1.发货数量,\n" +
- " temp1.外部验收单号,\n" +
+ " temp1.外部单号,\n" +
" temp1.结算数量,\n" +
" temp1.结算单价,\n" +
" temp1.结算金额,\n" +
@@ -613,6 +608,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" isnull( temp1.发货数量, 0 ) * isnull( TEMP2.Price, 0 ) AS 发货总金额,\n" +
" isnull( tt.Qty, 0 ) 退货数量,\n" +
" isnull( temp1.发货数量, 0 ) - isnull( tt.Qty, 0 ) AS 实际发货数量,\n" +
+ " isnull( temp1.发货数量, 0 ) - isnull( temp1.结算数量, 0 ) - isnull( tt.Qty, 0 ) AS 未结数量,\n" +
" temp1.结算单价 - ISNULL( TEMP2.Price, 0 ) AS 单价差异,\n" +
" ISNULL( TEMP2.Price, 0 ) * ( isnull( temp1.发货数量, 0 ) - isnull( tt.Qty, 0 ) ) AS 实际发货总金额 \n" +
" FROM\n" +
@@ -625,7 +621,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" c.CustomerPartCode 客户物料号,\n" +
" c.MaterialDesc AS 零件中文名称,\n" +
" isnull( a.Qty, 0 ) AS 发货数量,\n" +
- " '' AS 外部验收单号,\n" +
+ " '' AS 外部单号,\n" +
" isnull( b.Qty, 0 ) AS 结算数量,\n" +
" 0 AS 结算单价,\n" +
" 0 AS 结算金额 ,\n" +
@@ -656,16 +652,17 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" temp1.物料组,\n" +
" temp1.零件中文名称,\n" +
" temp1.发货数量,\n" +
- " temp1.外部验收单号,\n" +
+ " temp1.外部单号,\n" +
" temp1.结算数量,\n" +
" temp1.结算单价,\n" +
" temp1.结算金额,\n" +
" isnull( TEMP2.Price, 0 ) AS 发货定价,\n" +
" isnull( temp1.发货数量, 0 ) * isnull( TEMP2.Price, 0 ) AS 发货总金额,\n" +
" isnull( tt.Qty, 0 ) 退货数量,\n" +
- " isnull( temp1.发货数量, 0 ) - isnull( temp1.结算数量, 0 )- isnull( tt.Qty, 0 ) AS 实际发货数量,\n" +
+ " isnull( temp1.发货数量, 0 ) - isnull( tt.Qty, 0 ) AS 实际发货数量,\n" +
+ " isnull( temp1.发货数量, 0 ) - isnull( temp1.结算数量, 0 ) - isnull( tt.Qty, 0 ) AS 未结数量,\n" +
" temp1.结算单价 - ISNULL( TEMP2.Price, 0 ) AS 单价差异,\n" +
- " ISNULL( TEMP2.Price, 0 ) * ( isnull( temp1.发货数量, 0 ) - isnull( temp1.结算数量, 0 ) - isnull( tt.Qty, 0 ) ) AS 实际发货总金额 \n" +
+ " ISNULL( TEMP2.Price, 0 ) * ( isnull( temp1.发货数量, 0 ) - isnull( tt.Qty, 0 ) ) AS 实际发货总金额 \n" +
" FROM\n" +
" (\n" +
" SELECT\n" +
@@ -676,7 +673,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" c.CustomerPartCode 客户物料号,\n" +
" c.MaterialDesc AS 零件中文名称,\n" +
" isnull( a.Qty, 0 ) AS 发货数量,\n" +
- " '' AS 外部验收单号,\n" +
+ " '' AS 外部单号,\n" +
" isnull( b.Qty, 0 ) AS 结算数量,\n" +
" isnull( b.Price, 0 ) AS 结算单价,\n" +
" isnull( b.Qty, 0 ) * isnull( b.Price, 0 ) AS 结算金额 ,\n" +
@@ -991,7 +988,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" temp1.零件中文名称,\n" +
" temp1.发货数量,\n" +
" temp1.发货状态,\n" +
- " temp1.外部验收单号,\n" +
+ " temp1.外部单号,\n" +
" temp1.结算数量,\n" +
" temp1.结算单价,\n" +
" temp1.结算金额,\n" +
@@ -1015,7 +1012,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" c.MaterialDesc AS 零件中文名称,\n" +
" isnull( a.Qty, 0 ) AS 发货数量,\n" +
" isnull( a.State, 0 ) AS 发货状态,\n" +
- " b.ExternalKanbanNumber AS 外部验收单号,\n" +
+ " b.ExternalKanbanNumber AS 外部单号,\n" +
" isnull( b.Qty, 0 ) AS 结算数量,\n" +
" isnull( b.Price, 0 ) AS 结算单价,\n" +
" isnull( b.Amt, 0 ) AS 结算金额 ,\n" +
@@ -1093,7 +1090,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" temp1.物料组,\n" +
" temp1.零件中文名称,\n" +
" temp1.发货数量,\n" +
- " temp1.外部验收单号,\n" +
+ " temp1.外部单号,\n" +
" temp1.结算数量,\n" +
" temp1.结算单价,\n" +
" temp1.结算金额,\n" +
@@ -1114,7 +1111,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" c.CustomerPartCode 客户物料号,\n" +
" c.MaterialDesc AS 零件中文名称,\n" +
" isnull( a.Qty, 0 ) AS 发货数量,\n" +
- " '' AS 外部验收单号,\n" +
+ " '' AS 外部单号,\n" +
" isnull( b.Qty, 0 ) AS 结算数量,\n" +
" 0 AS 结算单价,\n" +
" 0 AS 结算金额 ,\n" +
@@ -1203,7 +1200,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" C.EstimateTypeDesc 物料组,\n" +
" C.MaterialCode Sap编码,\n" +
" C.MaterialDesc 零件中文名称,\n" +
- " a.[ExternalKanbanNumber] AS 外部验收单号,\n" +
+ " a.[ExternalKanbanNumber] AS 外部单号,\n" +
" a.Factory AS 工厂,\n" +
" a.HQHKanBan AS 订货看板编号,\n" +
" a.AcceptanceDate 验收单日期,\n" +
@@ -1428,74 +1425,64 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
public string 交货单号 { set; get; }
[ExporterHeader(DisplayName = "交货时间")]
public string 交货时间 { set; get; }
- [ExporterHeader(DisplayName = "手工或自动")]
- public string 手工或自动 { set; get; }
+
+ [ExporterHeader(DisplayName = "工厂")]
+ public string 工厂 { set; get; }
+
+ [ExporterHeader(DisplayName = "外部单号")]
+ public string 外部单号 { set; get; }
+ [ExporterHeader(DisplayName = "验收单日期")]
+ public string 验收单日期 { set; get; }
[ExporterHeader(DisplayName = "收货仓库")]
public string 收货仓库 { set; get; }
[ExporterHeader(DisplayName = "收货仓库描述")]
public string 收货仓库描述 { set; get; }
+ [ExporterHeader(DisplayName = "物料组(车型)")]
+ public string 物料组 { set; get; }
[ExporterHeader(DisplayName = "订货看板编号")]
public string 订货看板编号 { set; get; }
[ExporterHeader(DisplayName = "订货零件号")]
public string 订货零件号 { set; get; }
- [ExporterHeader(DisplayName = "发货零件号")]
- public string 发货零件号 { set; get; }
- [ExporterHeader(DisplayName = "零件中文名称")]
- public string 零件中文名称 { set; get; }
[ExporterHeader(DisplayName = "Sap编码")]
public string Sap编码 { set; get; }
- [ExporterHeader(DisplayName = "物料组(车型)")]
- public string 物料组 { set; get; }
-
- [ExporterHeader(DisplayName = "客户物料号")]
- public string 客户物料号 { set; get; }
-
-
+ [ExporterHeader(DisplayName = "零件中文名称")]
+ public string 零件中文名称 { set; get; }
[ExporterHeader(DisplayName = "发货数量")]
public decimal 发货数量 { set; get; }
- [ExporterHeader(DisplayName = "发货状态")]
- public string 发货状态 { set; get; }
-
- [ExporterHeader(DisplayName = "结算验收单号",IsIgnore =true)]
- public string 结算验收单号 { set; get; }
+ [ExporterHeader(DisplayName = "退货数量")]
+ public string 退货数量 { set; get; }
- [ExporterHeader(DisplayName = "外部验收单号")]
- public string 外部验收单号 { set; get; }
+ [ExporterHeader(DisplayName = "实际发货数量")]
+ public decimal 实际发货数量 { set; get; }
[ExporterHeader(DisplayName = "结算数量")]
public decimal 结算数量 { set; get; }
[ExporterHeader(DisplayName = "结算单价")]
public decimal 结算单价 { set; get; }
-
[ExporterHeader(DisplayName = "结算金额")]
public decimal 结算金额 { set; get; }
-
- [ExporterHeader(DisplayName = "销售单价")]
- public decimal 销售单价 { set; get; }
-
-
-
[ExporterHeader(DisplayName = "发货定价")]
public decimal 发货定价 { set; get; }
- [ExporterHeader(DisplayName = "发货总金额")]
- public decimal 发货总金额 { set; get; }
- [ExporterHeader(DisplayName = "数量差异")]
- public decimal 数量差异 { set; get; }
+
+ [ExporterHeader(DisplayName = "实际发货总金额")]
+ public decimal 实际发货总金额 { set; get; }
+
+ [ExporterHeader(DisplayName = "量差(实际发货-结算)")]
+ public decimal 量差 { set; get; }
+
[ExporterHeader(DisplayName = "单价差异")]
public decimal 单价差异 { set; get; }
[ExporterHeader(DisplayName = "差异总金额")]
public decimal 差异总金额 { set; get; }
- [ExporterHeader(DisplayName = "工厂")]
- public string 工厂 { set; get; }
-
[ExporterHeader(DisplayName = "看板编号")]
public string 看板编号 { set; get; }
- [ExporterHeader(DisplayName = "验收单日期")]
- public string 验收单日期 { set; get; }
- [ExporterHeader(DisplayName = "退货数量")]
- public string 退货数量 { set; get; }
+
+
+
+
+
}
@@ -1530,8 +1517,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
[ExporterHeader(DisplayName = "结算验收单号",IsIgnore =true)]
public string 结算验收单号 { set; get; }
- [ExporterHeader(DisplayName = "外部验收单号")]
- public string 外部验收单号 { set; get; }
+ [ExporterHeader(DisplayName = "外部单号")]
+ public string 外部单号 { set; get; }
[ExporterHeader(DisplayName = "发货数量")]
public decimal 发货数量 { set; get; }
@@ -1602,12 +1589,18 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
[ExporterHeader(DisplayName = "发货数量")]
public decimal 发货数量 { set; get; }
+ [ExporterHeader(DisplayName = "结算数量")]
+ public decimal 结算数量 { set; get; }
+
[ExporterHeader(DisplayName = "退货数量")]
public decimal 退货数量 { set; get; }
[ExporterHeader(DisplayName = "实际发货数量")]
public decimal 实际发货数量 { set; get; }
+ [ExporterHeader(DisplayName = "未结数量")]
+ public decimal 未结数量 { set; get; }
+
[ExporterHeader(DisplayName = "发货定价")]
public decimal 发货定价 { set; get; }
diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleSparePartDapperReportRepository.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleSparePartDapperReportRepository.cs
index e66e4def..cf840e57 100644
--- a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleSparePartDapperReportRepository.cs
+++ b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleSparePartDapperReportRepository.cs
@@ -664,11 +664,13 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" temp1.物料代码,\n" +
" temp1.物料描述,\n" +
" temp1.发货数量,\n" +
- " temp1.收货数量,\n" +
+ " temp1.开票数量,\n" +
" temp1.收货与交货差异,\n" +
" ISNULL( temp3.Qty, 0 ) 退货数量,\n" +
- " ISNULL( temp1.发货数量, 0 ) - ISNULL( temp1.收货数量, 0 ) - ISNULL( temp3.Qty, 0 ) 实际交货数量,\n" +
- " ISNULL( TEMP2.Price, 0 ) AS 定价 \n" +
+ " ISNULL( temp1.发货数量, 0 ) - ISNULL( temp3.Qty, 0 ) 实际发货数量,\n" +
+ " ISNULL( temp1.发货数量, 0 ) - ISNULL( temp3.Qty, 0 ) - ISNULL( temp1.开票数量, 0 ) 未结数量,\n" +
+ " ISNULL( TEMP2.Price, 0 ) AS 定价,\n" +
+ " ISNULL( TEMP2.Price, 0 ) * ( ISNULL( temp1.发货数量, 0 ) - ISNULL( temp3.Qty, 0 ) ) 实际发货总金额 \n" +
" FROM\n" +
" (\n" +
" SELECT\n" +
@@ -680,11 +682,24 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" c.MaterialDesc AS 物料描述,\n" +
" c.EstimateTypeDesc AS 物料组,\n" +
" ISNULL( a.ReceiptQty, 0 ) AS 发货数量,\n" +
- " ISNULL( b.ReceiptQty, 0 ) AS 收货数量,\n" +
+ " ISNULL( b.ReceiptQty, 0 ) AS 开票数量,\n" +
" ( ISNULL( a.ReceiptQty, 0 ) - ISNULL( b.ReceiptQty, 0 ) ) AS 收货与交货差异 \n" +
" FROM\n" +
- " ( SELECT SUM ( ReceiptQty ) AS ReceiptQty, PurchaseOrderNo, MaterialCode FROM Set_WMSSparePart WHERE PurchaseOrderNo is not null and PurchaseOrderNo!='' GROUP BY PurchaseOrderNo, MaterialCode ) AS a\n" +
- " LEFT JOIN ( SELECT SUM ( ReceiptQty ) ReceiptQty, PurchaseOrderNo, MaterialCode FROM Set_SparePart WHERE Extend != 'is90' and PurchaseOrderNo!='NoOrder' GROUP BY PurchaseOrderNo, MaterialCode ) AS b ON a.PurchaseOrderNo= b.PurchaseOrderNo \n" +
+ " (\n" +
+ " SELECT SUM\n" +
+ " ( ReceiptQty ) AS ReceiptQty,\n" +
+ " PurchaseOrderNo,\n" +
+ " MaterialCode \n" +
+ " FROM\n" +
+ " Set_WMSSparePart \n" +
+ " WHERE\n" +
+ " PurchaseOrderNo IS NOT NULL \n" +
+ " AND PurchaseOrderNo != '' \n" +
+ " GROUP BY\n" +
+ " PurchaseOrderNo,\n" +
+ " MaterialCode \n" +
+ " ) AS a\n" +
+ " LEFT JOIN ( SELECT SUM ( InvoicedQty ) ReceiptQty, PurchaseOrderNo, MaterialCode FROM Set_SparePart WHERE Extend != 'is90' AND PurchaseOrderNo != 'NoOrder' GROUP BY PurchaseOrderNo, MaterialCode ) AS b ON a.PurchaseOrderNo= b.PurchaseOrderNo \n" +
" AND a.MaterialCode = b.MaterialCode\n" +
" LEFT OUTER JOIN ( SELECT MAX ( Id ) Id, MaterialCode, CustomerPartCode, MaterialDesc, EstimateTypeDesc FROM Set_material GROUP BY MaterialCode, MaterialDesc, EstimateTypeDesc, CustomerPartCode ) AS c ON a.MaterialCode = c.CustomerPartCode \n" +
" WHERE\n" +
@@ -707,11 +722,13 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" temp1.物料代码,\n" +
" temp1.物料描述,\n" +
" temp1.发货数量,\n" +
- " temp1.收货数量,\n" +
+ " temp1.开票数量,\n" +
" temp1.收货与交货差异,\n" +
" ISNULL( temp3.Qty, 0 ) 退货数量,\n" +
- " ISNULL( temp1.发货数量, 0 ) - ISNULL( temp1.收货数量, 0 ) - ISNULL( temp3.Qty, 0 ) 实际交货数量,\n" +
- " ISNULL( TEMP2.Price, 0 ) AS 定价 \n" +
+ " ISNULL( temp1.发货数量, 0 ) - ISNULL( temp3.Qty, 0 ) 实际发货数量,\n" +
+ " ISNULL( temp1.发货数量, 0 ) - ISNULL( temp3.Qty, 0 ) - ISNULL( temp1.开票数量, 0 ) 未结数量,\n" +
+ " ISNULL( TEMP2.Price, 0 ) AS 定价,\n" +
+ " ISNULL( TEMP2.Price, 0 ) * ( ISNULL( temp1.发货数量, 0 ) - ISNULL( temp3.Qty, 0 ) ) 实际发货总金额 \n" +
" FROM\n" +
" (\n" +
" SELECT\n" +
@@ -723,11 +740,24 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" c.MaterialDesc AS 物料描述,\n" +
" c.EstimateTypeDesc AS 物料组,\n" +
" ISNULL( a.ReceiptQty, 0 ) AS 发货数量,\n" +
- " ISNULL( b.ReceiptQty, 0 ) AS 收货数量,\n" +
+ " ISNULL( b.ReceiptQty, 0 ) AS 开票数量,\n" +
" ( ISNULL( b.ReceiptQty, 0 ) - ISNULL( a.ReceiptQty, 0 ) ) AS 收货与交货差异 \n" +
" FROM\n" +
- " ( SELECT SUM ( ReceiptQty ) AS ReceiptQty, PurchaseOrderNo, MaterialCode FROM Set_WMSSparePart WHERE PurchaseOrderNo is not null and PurchaseOrderNo!='' GROUP BY PurchaseOrderNo, MaterialCode ) a\n" +
- " INNER JOIN ( SELECT SUM ( ReceiptQty ) ReceiptQty, PurchaseOrderNo, MaterialCode FROM Set_SparePart WHERE Extend != 'is90' and PurchaseOrderNo!='NoOrder' GROUP BY PurchaseOrderNo, MaterialCode ) AS b ON a.PurchaseOrderNo= b.PurchaseOrderNo \n" +
+ " (\n" +
+ " SELECT SUM\n" +
+ " ( ReceiptQty ) AS ReceiptQty,\n" +
+ " PurchaseOrderNo,\n" +
+ " MaterialCode \n" +
+ " FROM\n" +
+ " Set_WMSSparePart \n" +
+ " WHERE\n" +
+ " PurchaseOrderNo IS NOT NULL \n" +
+ " AND PurchaseOrderNo != '' \n" +
+ " GROUP BY\n" +
+ " PurchaseOrderNo,\n" +
+ " MaterialCode \n" +
+ " ) a\n" +
+ " INNER JOIN ( SELECT SUM ( InvoicedQty ) ReceiptQty, PurchaseOrderNo, MaterialCode FROM Set_SparePart WHERE Extend != 'is90' AND PurchaseOrderNo != 'NoOrder' GROUP BY PurchaseOrderNo, MaterialCode ) AS b ON a.PurchaseOrderNo= b.PurchaseOrderNo \n" +
" AND a.MaterialCode = b.MaterialCode\n" +
" LEFT OUTER JOIN ( SELECT MAX ( Id ) Id, MaterialCode, CustomerPartCode, MaterialDesc, EstimateTypeDesc FROM Set_material GROUP BY MaterialCode, MaterialDesc, EstimateTypeDesc, CustomerPartCode ) AS c ON a.MaterialCode = c.CustomerPartCode \n" +
" WHERE\n" +
@@ -1031,7 +1061,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
}
///
- /// 大众备件未结
+ /// 大众备件未结明细
///
public class UnSettleSparePartExport
{
@@ -1060,20 +1090,26 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
[ExporterHeader(DisplayName = "发货数量")]
public decimal 发货数量 { set; get; }
- [ExporterHeader(DisplayName = "收货数量")]
- public decimal 收货数量 { set; get; }
+ [ExporterHeader(DisplayName = "开票数量")]
+ public decimal 开票数量 { set; get; }
- [ExporterHeader(DisplayName = "收货与交货差异")]
+ [ExporterHeader(DisplayName = "收货与交货差异", IsIgnore = true)]
public decimal 收货与交货差异 { set; get; }
[ExporterHeader(DisplayName = "退货数量")]
public string 退货数量 { set; get; }
- [ExporterHeader(DisplayName = "实际交货数量")]
- public string 实际交货数量 { set; get; }
+ [ExporterHeader(DisplayName = "实际发货数量")]
+ public string 实际发货数量 { set; get; }
+
+ [ExporterHeader(DisplayName = "未结数量")]
+ public decimal 未结数量 { set; get; }
[ExporterHeader(DisplayName = "定价")]
public decimal 定价 { set; get; }
+ [ExporterHeader(DisplayName = "实际发货总金额")]
+ public decimal 实际发货总金额 { set; get; }
+
[ExporterHeader(DisplayName = "寄售库存数量", IsIgnore = true)]
public decimal 寄售库存数量 { set; get; }
diff --git a/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQHSettledDetailDiffExportService.cs b/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQHSettledDetailDiffExportService.cs
index 3d37cf2e..a503771f 100644
--- a/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQHSettledDetailDiffExportService.cs
+++ b/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQHSettledDetailDiffExportService.cs
@@ -67,16 +67,17 @@ namespace SettleAccount.Job.Services.Report
//var _reversels = _dapperRepository.GetReverseSettledDetailDiffReportList(version, materialCode, begin, end, materialGroup);
- var _lst = _dapperRepository.GetDiffQtyList(version);
- foreach (var itm in _lst)
- {
- var _first = _ls.FirstOrDefault(p => p.订货看板编号 == itm.看板号 && p.订货零件号 == itm.客户物料号);
- if (_first != null)
- {
- _first.结算数量 = _first.发货数量 + itm.差异数量;
- _first.数量差异 = itm.差异数量;
- }
- }
+ //var _lst = _dapperRepository.GetDiffQtyList(version);
+ //foreach (var itm in _lst)
+ //{
+ // var _first = _ls.FirstOrDefault(p => p.订货看板编号 == itm.看板号 && p.订货零件号 == itm.客户物料号);
+ // if (_first != null)
+ // {
+ // _first.结算数量 = _first.发货数量 + itm.差异数量;
+ // _first.数量差异 = itm.差异数量;
+ // }
+ //}
+
//订货看板编号
if (!string.IsNullOrEmpty(kanban))
{
@@ -114,13 +115,13 @@ namespace SettleAccount.Job.Services.Report
_ls = _ls.Where(p => _groupList.Contains(p.物料组)).ToList();
}
}
- //发货零件号
+ //订货零件号
if (!string.IsNullOrEmpty(materialCode))
{
var _groupList = materialCode.Split(new char[] { '\n' }).Distinct().ToList();
if (_groupList.Count() > 0)
{
- _ls = _ls.Where(p => _groupList.Contains(p.发货零件号)).ToList();
+ _ls = _ls.Where(p => _groupList.Contains(p.订货零件号)).ToList();
}
}
//厂内物料号