Browse Source

更新版本

branch_ccpg_220107
Administrator 3 years ago
parent
commit
17d113337c
  1. BIN
      .vs/Win.Sfs.SmartSettlementSystem.PG/v16/.suo
  2. 4
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/appsettings.Development.json
  3. 4
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/appsettings.json
  4. BIN
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/btsecsummary/二次配套套打模板.xlsx
  5. BIN
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/btsecsummary/当月结算汇总模板.xlsx
  6. 1
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/secsummary/files/host/sec-summary-container/新建文本文档.txt
  7. BIN
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/secsummary/大众二配结算供应商明细清单模板.xlsx
  8. BIN
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/secsummary/大众二配结算供应商汇总清单模板.xlsx
  9. 34
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/InvoiceSettledDiffs/InvoiceSettledDiff.cs
  10. 84
      src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/InvoiceSettledDiffs/InvoiceSettledDiff.cs
  11. 106
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/InvoiceSettledDiffDapperRepository.cs
  12. 2
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/PriceQtyDiffDapperReportRepository.cs
  13. 26
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/InvoiceSettledDiffExportService.cs

BIN
.vs/Win.Sfs.SmartSettlementSystem.PG/v16/.suo

Binary file not shown.

4
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" "CorsOrigins": "https://*.abc.com,http://localhost:9528,http://149.223.116.5:8088"
}, },
"ConnectionStrings": { "ConnectionStrings": {
"Default": "Server=LAPTOP-V3U07C2O;Database=ABP;user id=sa;Password=1q2w!@#", "Default": "Server=192.168.0.140;Database=ABP;user id=sa;Password=Microsoft2008",
"SettleAccountService": "Server=LAPTOP-V3U07C2O;Database=SettleAccountService;user id=sa;Password=1q2w!@#;" "SettleAccountService": "Server=192.168.0.140;Database=SettleAccountService;user id=sa;Password=Microsoft2008;"
}, },
"Logging": { "Logging": {
"LogLevel": { "LogLevel": {

4
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" "CorsOrigins": "https://*.abc.com,http://localhost:9528,http://149.223.116.5:8088"
}, },
"ConnectionStrings": { "ConnectionStrings": {
"Default": "Server=LAPTOP-V3U07C2O;Database=ABP;user id=sa;Password=1q2w!@#", "Default": "Server=192.168.0.140;Database=ABP;user id=sa;Password=Microsoft2008",
"SettleAccountService": "Server=LAPTOP-V3U07C2O;Database=SettleAccountService;user id=sa;Password=1q2w!@#;" "SettleAccountService": "Server=192.168.0.140;Database=SettleAccountService;user id=sa;Password=Microsoft2008;"
}, },
"Logging": { "Logging": {
"LogLevel": { "LogLevel": {

BIN
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/btsecsummary/二次配套套打模板.xlsx

Binary file not shown.

BIN
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/btsecsummary/当月结算汇总模板.xlsx

Binary file not shown.

1
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/secsummary/files/host/sec-summary-container/新建文本文档.txt

@ -1 +0,0 @@
无条码看板量差

BIN
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/secsummary/大众二配结算供应商明细清单模板.xlsx

Binary file not shown.

BIN
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/secsummary/大众二配结算供应商汇总清单模板.xlsx

Binary file not shown.

34
src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/InvoiceSettledDiffs/InvoiceSettledDiff.cs

@ -24,19 +24,41 @@ namespace Win.Sfs.SettleAccount.Reports.InvoiceSettledDiffs
public class InvoiceSettledDiffExportDto public class InvoiceSettledDiffExportDto
{ {
[ExporterHeader(DisplayName = "版本")]
// 期间 发运类型 物料组 SAP编码 工厂 零件号 零件号格式整理 零件名称 开票数量 开票 金额 开票单价 结算数量 CP7报废 索赔/退货 数量差异 定价 价格差异
[ExporterHeader(DisplayName = "期间")]
public string Version { get; set; } 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 ="零件编号")] [ExporterHeader(DisplayName ="零件编号")]
public string MaterialCode { get; set; } public string MaterialCode { get; set; }
[ExporterHeader(DisplayName = "发票数量")] [ExporterHeader(DisplayName = "零件名称")]
public string MaterialDesc { get; set; }
[ExporterHeader(DisplayName = "开票数量")]
public decimal InvoiceQty { get; set; } public decimal InvoiceQty { get; set; }
[ExporterHeader(DisplayName = "金额")]
public decimal InvoiceAmt { get; set; }
[ExporterHeader(DisplayName = "开票单价")]
public decimal InvoicePrice { get; set; }
[ExporterHeader(DisplayName ="结算数量")] [ExporterHeader(DisplayName ="结算数量")]
public decimal SettleQty { get; set; } public decimal SettleQty { get; set; }
[ExporterHeader(DisplayName = "数量差")]
[ExporterHeader(DisplayName = "差额量")]
public decimal DiffQty { get; set; } 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; }
} }

84
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.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
@ -11,38 +12,69 @@ namespace Win.Sfs.SettleAccount.Reports.InvoiceSettledDiffs
{ {
public InvoiceSettledDiff() 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; MaterialCode = materialCode;
MaterialDesc = materialDesc;
InvoiceQty = invoiceQty; InvoiceQty = invoiceQty;
InvoiceAmt = invoiceAmt;
InvoicePrice = invoicePrice;
SettleQty = settleQty; 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; }
}
/// <summary>
/// 父ID
/// </summary>
public Guid ParentId { set; get; }
/// <summary>
/// 物料编码
/// </summary>
public string MaterialCode { set; get; }
/// <summary>
/// 发票数量
/// </summary>
public decimal InvoiceQty { set; get; }
/// <summary>
/// 结算数量
/// </summary>
public decimal SettleQty { set; get; }
public string Version { set; get; }
public decimal DiffQty { set; get; }
} }
} }

106
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/InvoiceSettledDiffDapperRepository.cs

@ -20,39 +20,93 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob
public virtual List<InvoiceSettledDiff> GetInvoiceSettledDiffReportList(string version,string year, string tablename ,string materialcode) public virtual List<InvoiceSettledDiff> GetInvoiceSettledDiffReportList(string version,string year, string tablename ,string materialcode)
{ {
string str = string.Empty; //string str = string.Empty;
str += " where 1=1 "; //str += " where 1=1 ";
//if (!string.IsNullOrEmpty(year)) ////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<InvoiceSettledDiff>(_sql);
var _list = _query.ToList();
if (!string.IsNullOrEmpty(materialcode)) 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<InvoiceSettledDiff>(_sql);
return _query.ToList(); return _list;
} }
//public virtual async Task<List<string>> GetUpFileAsync(string taskid) //public virtual async Task<List<string>> GetUpFileAsync(string taskid)

2
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(SELECT DISTINCT MaterialCode " + " FROM(SELECT DISTINCT MaterialCode " +
" FROM Set_Invoice " + " FROM Set_Invoice " +
" WHERE(Version = '{0}') " + " WHERE(Version = '{0}') " +
" UNION ALL " + " UNION ALL " +
" SELECT DISTINCT b.SettleMaterialCode AS MaterialCode " + " SELECT DISTINCT b.SettleMaterialCode AS MaterialCode " +
" FROM Set_item_invoice_price AS a INNER JOIN " + " FROM Set_item_invoice_price AS a INNER JOIN " +

26
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)); //_list.Add(new InvoiceSettledDiff(Guid.NewGuid(), _id, itm.MaterialCode, itm.InvoiceQty, itm.SettleQty));
_lsExport.Add(new InvoiceSettledDiffExportDto() _lsExport.Add(new InvoiceSettledDiffExportDto()
{ {
Version=itm.Version,
MaterialCode = itm.MaterialCode,
InvoiceQty = itm.InvoiceQty, Version =itm. Version ,
SettleQty = itm.SettleQty, MaterialCode =itm. MaterialCode ,
DiffQty=itm.DiffQty 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
});
} }

Loading…
Cancel
Save