diff --git a/.vs/VSWorkspaceState.json b/.vs/VSWorkspaceState.json new file mode 100644 index 00000000..fd5a9563 --- /dev/null +++ b/.vs/VSWorkspaceState.json @@ -0,0 +1,7 @@ +{ + "ExpandedNodes": [ + "" + ], + "SelectedNode": "\\WY.NewJit.sln (src\\Modules\\派格FIS\\WY.NewJit.sln)", + "PreviewInSolutionExplorer": false +} \ No newline at end of file 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/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 + + + + + }); } diff --git a/src/Modules/SettleAccount/src/SettleAccount.Job/Services/SettleAccount/SettleAccountImportService.cs b/src/Modules/SettleAccount/src/SettleAccount.Job/Services/SettleAccount/SettleAccountImportService.cs index 8b58e32f..310e0278 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Job/Services/SettleAccount/SettleAccountImportService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Job/Services/SettleAccount/SettleAccountImportService.cs @@ -42,8 +42,8 @@ namespace TaskJob.Services public string ImportFile(Guid id, List fileName, List realfileName, List customConditions) { - - + + IExporter _excel = new ExcelExporter(); string fileSavePath = Environment.CurrentDirectory + @"\wwwroot\files\host\my-file-container\"; var version = customConditions.Where(p => p.Name == "Version").FirstOrDefault().Value; @@ -53,6 +53,7 @@ namespace TaskJob.Services var factory = customConditions.Where(p => p.Name == "Factory").FirstOrDefault().Value; //_versionRepository.Delete(version); //_repository.Delete(version); + List _setls = new List(); var _id = Guid.NewGuid(); foreach (var itm in fileName) @@ -62,9 +63,9 @@ namespace TaskJob.Services var filePath = fileSavePath + itm;//获取到导入的excel var exten = Path.GetExtension(fileSavePath); - List _setls = new List(); + List _errorList = new List(); - + var checkList = new List(); //var _chList = await _relrepository.GetAllAsync(GuidGenerator.Create(), true); //var _chls = _chList.Select(p => p.SettleMaterialCode).Distinct(); @@ -130,29 +131,22 @@ namespace TaskJob.Services else { // _setls= _inputService.Input(filePath); - var errorlist=new List(); - var dtoList = _inputService.Input(filePath,null,errorlist); + var errorlist = new List(); + var dtoList = _inputService.Input(filePath, null, errorlist); foreach (var dto in dtoList) { if (dto.KENNCode.Length == 6) { dto.KENNCode = "0" + dto.KENNCode; } - var _settleaccount=new Win.Sfs.SettleAccount.Entities.SettleAccounts.SettleAccount(Guid.NewGuid(), Guid.NewGuid(),dto.SettleYear, dto.KENNCode, + var _settleaccount = new Win.Sfs.SettleAccount.Entities.SettleAccounts.SettleAccount(Guid.NewGuid(), Guid.NewGuid(), dto.SettleYear, dto.KENNCode, dto.ChassisNumber, dto.Model, dto.CP5A, dto.CP7, dto.MaterialCode, dto.Qty, dto.SettlementID, dto.SettlementSupplier, - DateTime.Now.Month.ToString(), dto.SettleYear, _id, version, DateTime.Now,Guid.NewGuid()); + DateTime.Now.Month.ToString(), dto.SettleYear, _id, version, DateTime.Now, Guid.NewGuid()); _setls.Add(_settleaccount); } } - var _ls = _setls; - var a = _ls.Where(p => string.IsNullOrEmpty(p.KENNCode)); - var query = from arc in _ls - group arc by new { arc.ChassisNumber, arc.MaterialCode } into g - where g.Count() > 1 - select g; - _repository.Insert(_setls); - _versionRepository.Insert(_id,version, customerCode, customerCode); + @@ -160,7 +154,7 @@ namespace TaskJob.Services #region //var errorFileName = "错误文件.xlsx"; //checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("ERP物料号{0}底盘号 {1}有重复", "11111111111", "22222222222"), string.Empty)); - + //_service.ExportError(id,errorFileName, checkList); #endregion } @@ -169,6 +163,14 @@ namespace TaskJob.Services throw e; } } + + _setls = _setls.GroupBy(p => new { p.ChassisNumber, p.MaterialCode, p.KENNCode }).Select(p => p.FirstOrDefault()).ToList(); + _repository.Insert(_setls); + _versionRepository.Insert(_id, version, customerCode, customerCode); + + + + return id.ToString(); } } diff --git a/vue/src/views/login/index.vue b/vue/src/views/login/index.vue index 1fd290af..5a82dc2c 100644 --- a/vue/src/views/login/index.vue +++ b/vue/src/views/login/index.vue @@ -1,14 +1,18 @@