diff --git a/.vs/Win.Sfs.SmartSettlementSystem.PG/v16/.suo b/.vs/Win.Sfs.SmartSettlementSystem.PG/v16/.suo
new file mode 100644
index 00000000..c73c4fe0
Binary files /dev/null and b/.vs/Win.Sfs.SmartSettlementSystem.PG/v16/.suo differ
diff --git a/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/appsettings.Development.json b/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/appsettings.Development.json
index 734cc4b1..3e33bbdb 100644
--- a/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/appsettings.Development.json
+++ b/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/appsettings.Development.json
@@ -3,8 +3,8 @@
"CorsOrigins": "https://*.abc.com,http://localhost:9528,http://149.223.116.5:8088"
},
"ConnectionStrings": {
- "Default": "Server=LAPTOP-V3U07C2O;Database=ABP;user id=sa;Password=1q2w!@#",
- "SettleAccountService": "Server=LAPTOP-V3U07C2O;Database=SettleAccountService;user id=sa;Password=1q2w!@#;"
+ "Default": "Server=192.168.0.140;Database=ABP;user id=sa;Password=Microsoft2008",
+ "SettleAccountService": "Server=192.168.0.140;Database=SettleAccountService;user id=sa;Password=Microsoft2008;"
},
"Logging": {
"LogLevel": {
diff --git a/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/appsettings.json b/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/appsettings.json
index 03b8ad70..327c3c7a 100644
--- a/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/appsettings.json
+++ b/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/appsettings.json
@@ -3,8 +3,8 @@
"CorsOrigins": "https://*.abc.com,http://localhost:9528,http://149.223.116.5:8088"
},
"ConnectionStrings": {
- "Default": "Server=LAPTOP-V3U07C2O;Database=ABP;user id=sa;Password=1q2w!@#",
- "SettleAccountService": "Server=LAPTOP-V3U07C2O;Database=SettleAccountService;user id=sa;Password=1q2w!@#;"
+ "Default": "Server=192.168.0.140;Database=ABP;user id=sa;Password=Microsoft2008",
+ "SettleAccountService": "Server=192.168.0.140;Database=SettleAccountService;user id=sa;Password=Microsoft2008;"
},
"Logging": {
"LogLevel": {
diff --git a/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/btsecsummary/二次配套套打模板.xlsx b/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/btsecsummary/二次配套套打模板.xlsx
deleted file mode 100644
index 40a3a5cc..00000000
Binary files a/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/btsecsummary/二次配套套打模板.xlsx and /dev/null differ
diff --git a/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/btsecsummary/当月结算汇总模板.xlsx b/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/btsecsummary/当月结算汇总模板.xlsx
deleted file mode 100644
index c42ec430..00000000
Binary files a/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/btsecsummary/当月结算汇总模板.xlsx and /dev/null differ
diff --git a/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/secsummary/files/host/sec-summary-container/新建文本文档.txt b/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/secsummary/files/host/sec-summary-container/新建文本文档.txt
deleted file mode 100644
index 96908ec1..00000000
--- a/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/secsummary/files/host/sec-summary-container/新建文本文档.txt
+++ /dev/null
@@ -1 +0,0 @@
-无条码看板量差
\ No newline at end of file
diff --git a/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/secsummary/大众二配结算供应商明细清单模板.xlsx b/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/secsummary/大众二配结算供应商明细清单模板.xlsx
deleted file mode 100644
index 724205c9..00000000
Binary files a/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/secsummary/大众二配结算供应商明细清单模板.xlsx and /dev/null differ
diff --git a/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/secsummary/大众二配结算供应商汇总清单模板.xlsx b/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/secsummary/大众二配结算供应商汇总清单模板.xlsx
deleted file mode 100644
index 5b2d2804..00000000
Binary files a/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/secsummary/大众二配结算供应商汇总清单模板.xlsx and /dev/null differ
diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/InvoiceSettledDiffs/InvoiceSettledDiff.cs b/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/InvoiceSettledDiffs/InvoiceSettledDiff.cs
index 3e6564a2..503f61f2 100644
--- a/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/InvoiceSettledDiffs/InvoiceSettledDiff.cs
+++ b/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/InvoiceSettledDiffs/InvoiceSettledDiff.cs
@@ -24,19 +24,41 @@ namespace Win.Sfs.SettleAccount.Reports.InvoiceSettledDiffs
public class InvoiceSettledDiffExportDto
{
- [ExporterHeader(DisplayName = "版本")]
+
+
+
+ // 期间 发运类型 物料组 SAP编码 工厂 零件号 零件号格式整理 零件名称 开票数量 开票 金额 开票单价 结算数量 CP7报废 索赔/退货 数量差异 定价 价格差异
+
+ [ExporterHeader(DisplayName = "期间")]
public string Version { get; set; }
+ [ExporterHeader(DisplayName = "物料组")]
+ public string SapMaterialGroup { get; set; }
+ [ExporterHeader(DisplayName = "SAP编号")]
+ public string SapMaterialCode { get; set; }
+ [ExporterHeader(DisplayName = "工厂")]
+ public string Factory { get; set; }
[ExporterHeader(DisplayName ="零件编号")]
public string MaterialCode { get; set; }
- [ExporterHeader(DisplayName = "发票数量")]
+ [ExporterHeader(DisplayName = "零件名称")]
+ public string MaterialDesc { get; set; }
+ [ExporterHeader(DisplayName = "开票数量")]
public decimal InvoiceQty { get; set; }
+ [ExporterHeader(DisplayName = "金额")]
+ public decimal InvoiceAmt { get; set; }
+ [ExporterHeader(DisplayName = "开票单价")]
+ public decimal InvoicePrice { get; set; }
[ExporterHeader(DisplayName ="结算数量")]
public decimal SettleQty { get; set; }
-
-
-
- [ExporterHeader(DisplayName = "差额量")]
+ [ExporterHeader(DisplayName = "数量差")]
public decimal DiffQty { get; set; }
+ [ExporterHeader(DisplayName = "CP7报废")]
+ public decimal CP7ScrapQty { get; set; }
+ [ExporterHeader(DisplayName = "索赔/退货")]
+ public decimal ClaimQty { get; set; }
+ [ExporterHeader(DisplayName = "定价")]
+ public decimal SalePrice { get; set; }
+ [ExporterHeader(DisplayName = "价格差异")]
+ public decimal DiffPrice { get; set; }
}
diff --git a/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/InvoiceSettledDiffs/InvoiceSettledDiff.cs b/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/InvoiceSettledDiffs/InvoiceSettledDiff.cs
index da3b3865..b43d41d6 100644
--- a/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/InvoiceSettledDiffs/InvoiceSettledDiff.cs
+++ b/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/InvoiceSettledDiffs/InvoiceSettledDiff.cs
@@ -1,4 +1,5 @@
-using System;
+using Magicodes.ExporterAndImporter.Core;
+using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -11,38 +12,69 @@ namespace Win.Sfs.SettleAccount.Reports.InvoiceSettledDiffs
{
public InvoiceSettledDiff()
{ }
- public InvoiceSettledDiff(Guid Id,Guid parentId, string materialCode, decimal invoiceQty, decimal settleQty,string version, decimal diffqty):base(Id)
+
+ public InvoiceSettledDiff(string version, string sapMaterialGroup, string sapMaterialCode, string factory, string materialCode, string materialDesc, decimal invoiceQty, decimal invoiceAmt, decimal invoicePrice, decimal settleQty, decimal diffQty, decimal cP7ScrapQty, decimal claimQty, decimal salePrice, decimal diffPrice)
{
- ParentId = parentId;
+ Version = version;
+ SapMaterialGroup = sapMaterialGroup;
+ SapMaterialCode = sapMaterialCode;
+ Factory = factory;
MaterialCode = materialCode;
+ MaterialDesc = materialDesc;
InvoiceQty = invoiceQty;
+ InvoiceAmt = invoiceAmt;
+ InvoicePrice = invoicePrice;
SettleQty = settleQty;
- Version = version;
- DiffQty = diffqty;
+ DiffQty = diffQty;
+ CP7ScrapQty = cP7ScrapQty;
+ ClaimQty = claimQty;
+ SalePrice = salePrice;
+ DiffPrice = diffPrice;
+ }
+
+ [ExporterHeader(DisplayName = "期间")]
+ public string Version { get; set; }
+ [ExporterHeader(DisplayName = "物料组")]
+ public string SapMaterialGroup { get; set; }
+ [ExporterHeader(DisplayName = "SAP编号")]
+ public string SapMaterialCode { get; set; }
+ [ExporterHeader(DisplayName = "工厂")]
+ public string Factory { get; set; }
+ [ExporterHeader(DisplayName = "零件编号")]
+ public string MaterialCode { get; set; }
+ [ExporterHeader(DisplayName = "零件名称")]
+ public string MaterialDesc { get; set; }
+ [ExporterHeader(DisplayName = "开票数量")]
+ public decimal InvoiceQty { get; set; }
+ [ExporterHeader(DisplayName = "金额")]
+ public decimal InvoiceAmt { get; set; }
+ [ExporterHeader(DisplayName = "开票单价")]
+ public decimal InvoicePrice { get; set; }
+ [ExporterHeader(DisplayName = "结算数量")]
+ public decimal SettleQty { get; set; }
+ [ExporterHeader(DisplayName = "数量差")]
+ public decimal DiffQty { get; set; }
+ [ExporterHeader(DisplayName = "CP7报废")]
+ public decimal CP7ScrapQty { get; set; }
+ [ExporterHeader(DisplayName = "索赔/退货")]
+ public decimal ClaimQty { get; set; }
+ [ExporterHeader(DisplayName = "定价")]
+ public decimal SalePrice { get; set; }
+ [ExporterHeader(DisplayName = "价格差异")]
+ public decimal DiffPrice { get; set; }
+
+
+
+
+
+
+
+
+
+
+
- }
-
- ///
- /// 父ID
- ///
- public Guid ParentId { set; get; }
- ///
- /// 物料编码
- ///
- public string MaterialCode { set; get; }
- ///
- /// 发票数量
- ///
- public decimal InvoiceQty { set; get; }
- ///
- /// 结算数量
- ///
- public decimal SettleQty { set; get; }
-
- public string Version { set; get; }
-
- public decimal DiffQty { set; get; }
}
}
diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/InvoiceSettledDiffDapperRepository.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/InvoiceSettledDiffDapperRepository.cs
index a9ebffd1..4cb3f017 100644
--- a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/InvoiceSettledDiffDapperRepository.cs
+++ b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/InvoiceSettledDiffDapperRepository.cs
@@ -20,39 +20,93 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob
public virtual List GetInvoiceSettledDiffReportList(string version,string year, string tablename ,string materialcode)
{
- string str = string.Empty;
- str += " where 1=1 ";
- //if (!string.IsNullOrEmpty(year))
+ //string str = string.Empty;
+ //str += " where 1=1 ";
+ ////if (!string.IsNullOrEmpty(year))
+ ////{
+ //// str += string.Format(" and year='{0}' ", year);
+ ////}
+ //if (!string.IsNullOrEmpty(version))
//{
- // str += string.Format(" and year='{0}' ", year);
+ // str += string.Format(" and version='{0}' ", version);
//}
- if (!string.IsNullOrEmpty(version))
- {
- str += string.Format(" and version='{0}' ", version);
- }
+
+
+ //// string sqlString = "select "+ string.Format(" {0} as Version ,",version) + "a.MaterialCode,isnull(b.qty,0) InvoiceQty,isnull(c.qty,0) SettleQty, (isnull(b.qty,0)-isnull(c.qty,0)) as DiffQty from (\n" +
+ //// " select distinct MaterialCode from( \n"+
+ ////"select distinct MaterialCode from Set_Invoice {0}\n" +
+ //// "union all\n" +
+ //// "select distinct MaterialCode from {1} {0}\n" +
+ //// ") temp \n"+
+ //// ") as a\n" +
+ //// "left join\n" +
+ //// "\n" +
+ //// "(select SUM(QTY) qty,MaterialCode from Set_Invoice {0} GROUP BY MaterialCode) b on a.MaterialCode=b.MaterialCode\n" +
+ //// "\n" +
+ //// "left join\n" +
+ //// "(select SUM(QTY) qty,MaterialCode from {1} {0} GROUP BY MaterialCode) c on a.MaterialCode=c.MaterialCode";
+
+
+ string sqlString =
+"SELECT \n" + string.Format(" '{0}' as Version ,", version) + "\n" +
+" b.*,\n" +
+" ISnull(\n" +
+" c.Qty,\n" +
+" IsNull( d.qty, 0 )) SettleQty,\n" +
+"CASE\n" +
+" \n" +
+" WHEN e.Type = 'CP7报废' THEN\n" +
+" isnull( e.Qty, 0 ) ELSE 0 \n" +
+" END AS CP7ScrapQty,\n" +
+"CASE\n" +
+" \n" +
+" WHEN e.Type = '索赔' THEN\n" +
+" isnull( e.Qty, 0 ) ELSE 0 \n" +
+" END AS ClaimQty,\n" +
+" (\n" +
+" b.InvoiceQty - ISnull(\n" +
+" c.Qty,\n" +
+" IsNull( d.qty, 0 ))) DiffQty,\n" +
+" Isnull( f.Price, 0 ) SalePrice,\n" +
+" b.InvoicePrice - Isnull( f.Price, 0 ) DiffPrice,\n" +
+" '' AS SapMaterialCode \n" +
+"FROM\n" +
+" (\n" +
+" SELECT\n" +
+" Factory, MaterialCode,\n" +
+" SUM( QTY ) InvoiceQty,\n" +
+" sum( amt ) InvoiceAmt,\n" +
+" sum( amt )/ sum( Qty ) InvoicePrice \n" +
+" FROM\n" +
+" Set_Invoice \n" +
+" WHERE\n" +
+" version = '{0}' \n" +
+" GROUP BY\n" +
+" MaterialCode,Factory \n" +
+" ) b\n" +
+" LEFT JOIN ( SELECT SUM( QTY ) Qty, MaterialCode FROM Set_settle WHERE version = '{0}' GROUP BY MaterialCode ) c ON b.MaterialCode = c.MaterialCode\n" +
+" LEFT JOIN ( SELECT SUM( QTY ) qty, MaterialCode FROM Set_KanbanSettle WHERE version = '{0}' GROUP BY MaterialCode ) d ON b.MaterialCode = d.MaterialCode\n" +
+" LEFT JOIN ( SELECT * FROM Set_ScrapClaims WHERE version = '{0}' ) e ON b.MaterialCode = e.MaterialCode\n" +
+" LEFT JOIN ( SELECT * FROM Set_PriceList WHERE version = '{0}' ) f ON b.MaterialCode = f.MaterialCode";
+
+
+
+
+
+ string _sql = string.Format(sqlString, version);
+
+ var _query = DbConnection.Query(_sql);
+
+
+ var _list = _query.ToList();
if (!string.IsNullOrEmpty(materialcode))
{
- str += string.Format(" and materialcode='{0}' ", materialcode);
+ _list= _list.Where(p => p.MaterialCode == materialcode).ToList();
}
- string sqlString = "select "+ string.Format(" {0} as Version ,",version) + "a.MaterialCode,isnull(b.qty,0) InvoiceQty,isnull(c.qty,0) SettleQty, (isnull(b.qty,0)-isnull(c.qty,0)) as DiffQty from (\n" +
- " select distinct MaterialCode from( \n"+
- "select distinct MaterialCode from Set_Invoice {0}\n" +
- "union all\n" +
- "select distinct MaterialCode from {1} {0}\n" +
- ") temp \n"+
- ") as a\n" +
- "left join\n" +
- "\n" +
- "(select SUM(QTY) qty,MaterialCode from Set_Invoice {0} GROUP BY MaterialCode) b on a.MaterialCode=b.MaterialCode\n" +
- "\n" +
- "left join\n" +
- "(select SUM(QTY) qty,MaterialCode from {1} {0} GROUP BY MaterialCode) c on a.MaterialCode=c.MaterialCode";
-
- string _sql = string.Format(sqlString, str, tablename);
-
- var _query = DbConnection.Query(_sql);
- return _query.ToList();
+
+
+ return _list;
}
//public virtual async Task> GetUpFileAsync(string taskid)
diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/PriceQtyDiffDapperReportRepository.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/PriceQtyDiffDapperReportRepository.cs
index 341f7972..cc068b8f 100644
--- a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/PriceQtyDiffDapperReportRepository.cs
+++ b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/PriceQtyDiffDapperReportRepository.cs
@@ -46,7 +46,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" FROM(SELECT DISTINCT MaterialCode " +
" FROM(SELECT DISTINCT MaterialCode " +
" FROM Set_Invoice " +
- " WHERE(Version = '{0}') " +
+ " WHERE(Version = '{0}') " +
" UNION ALL " +
" SELECT DISTINCT b.SettleMaterialCode AS MaterialCode " +
" FROM Set_item_invoice_price AS a INNER JOIN " +
diff --git a/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/InvoiceSettledDiffExportService.cs b/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/InvoiceSettledDiffExportService.cs
index a179b778..76951a32 100644
--- a/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/InvoiceSettledDiffExportService.cs
+++ b/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/InvoiceSettledDiffExportService.cs
@@ -56,12 +56,26 @@ namespace SettleAccount.Job.Services
//_list.Add(new InvoiceSettledDiff(Guid.NewGuid(), _id, itm.MaterialCode, itm.InvoiceQty, itm.SettleQty));
_lsExport.Add(new InvoiceSettledDiffExportDto()
{
- Version=itm.Version,
- MaterialCode = itm.MaterialCode,
- InvoiceQty = itm.InvoiceQty,
- SettleQty = itm.SettleQty,
- DiffQty=itm.DiffQty
- });
+
+
+ Version =itm. Version ,
+ MaterialCode =itm. MaterialCode ,
+ InvoiceQty =itm. InvoiceQty ,
+ InvoiceAmt =itm. InvoiceAmt ,
+ InvoicePrice =itm. InvoicePrice ,
+ SettleQty =itm. SettleQty ,
+ CP7ScrapQty =itm. CP7ScrapQty ,
+ ClaimQty =itm. ClaimQty ,
+ DiffQty =itm. DiffQty ,
+ SalePrice =itm. SalePrice ,
+ DiffPrice =itm. DiffPrice ,
+ SapMaterialCode =itm.SapMaterialCode ,
+ Factory = itm.Factory
+
+
+
+
+ });
}