From 7c645dbe59155b87d62be1a85b3eeeacd5252f1f Mon Sep 17 00:00:00 2001 From: 44673626 <44673626@qq.com> Date: Fri, 15 Jul 2022 13:55:35 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E9=87=8F=E5=B7=AE=E4=BB=B7=E5=B7=AE?= =?UTF-8?q?=E5=8A=A0=E4=B8=8A=20ErrorBill=E5=8A=9F=E8=83=BD=20=E4=BF=9D?= =?UTF-8?q?=E6=8C=81=E4=BA=8B=E5=8A=A1=E5=9C=A8=E4=B8=80=E4=B8=AA=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E4=B8=8A=E4=B8=8B=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UnInvoiceSettledDetailDiffExportService.cs | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnInvoiceSettledDetailDiffExportService.cs b/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnInvoiceSettledDetailDiffExportService.cs index a6d6f80d..2624afbd 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnInvoiceSettledDetailDiffExportService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnInvoiceSettledDetailDiffExportService.cs @@ -54,7 +54,7 @@ namespace SettleAccount.Job.Services private readonly ErpPartDapperRepository _erpdapperRepository; private readonly IBlobContainer _fileContainer; - private readonly ISettleAccountBranchEfCoreRepository _errorListRepository; + //private readonly ISettleAccountBranchEfCoreRepository _errorListRepository; private readonly OutputService _outputService; private readonly InputService _inputService; @@ -65,9 +65,9 @@ namespace SettleAccount.Job.Services InvoiceSettledDetailDiffDapperRepository dapperRepository1, OutputService outputService, InputService inputService, - UnSettledDetailDapperRepository dapperRepository2, + UnSettledDetailDapperRepository dapperRepository2 - ISettleAccountBranchEfCoreRepository errorListRepository + //ISettleAccountBranchEfCoreRepository errorListRepository ) { _fileContainer = fileContainer; @@ -79,7 +79,7 @@ namespace SettleAccount.Job.Services _dapperRepository =dapperRepository; _dapperRepository1 = dapperRepository1; _dapperRepository2 = dapperRepository2; - _errorListRepository = errorListRepository; + // _errorListRepository = errorListRepository; } public string ExportFile(Guid id, List exportName, List p_list) @@ -347,7 +347,9 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.MaterialCode, Wms } - var _checkList = _errorListRepository.ToList(); + //var _checkList = _errorListRepository.ToList(); + //应用屏蔽错误信息功能,将其屏蔽的信息从生成的列表中排除掉,20220629 + var _checkList = _erpdapperRepository.GetErrorBillList(); var query = from itm in _ls join itm1 in _checkList on new { ChassisNumber = itm.ChassisNumber, MaterialCode = itm.MaterialCode, WmsBillNum = itm.WmsBillNum } @@ -427,8 +429,10 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.MaterialCode, Wms _list = _list.Where(p => _groupList.Contains(p.SapMaterialCode)).ToList(); } } - - var _checkList = _errorListRepository.ToList(); + + //var _checkList = _errorListRepository.ToList(); + //应用屏蔽错误信息功能,将其屏蔽的信息从生成的列表中排除掉,20220629 + var _checkList = _erpdapperRepository.GetErrorBillList(); var query = from itm in _list join itm1 in _checkList on new { ChassisNumber = itm.ChassisNumber, MaterialCode = itm.MaterialCode, WmsBillNum = itm.WmsBillNum } From 78bf7fa291b506ff88bc6e7a33677b19f656ff00 Mon Sep 17 00:00:00 2001 From: 44673626 <44673626@qq.com> Date: Thu, 21 Jul 2022 17:32:38 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E7=BA=A2=E6=97=97=E7=BB=93=E7=AE=97?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=EF=BC=8C=E8=87=AA=E5=AE=9A=E4=B9=89=E5=8F=91?= =?UTF-8?q?=E8=B4=A7=E5=AF=BC=E5=85=A5=EF=BC=8C=E7=BA=A2=E6=97=97=E4=B8=80?= =?UTF-8?q?=E8=BD=BF=E5=87=BA=E5=BA=93=E5=8D=95=E5=AF=BC=E5=85=A5=EF=BC=8C?= =?UTF-8?q?=E4=B8=80=E6=AC=A1=E6=80=A7=E5=AF=84=E5=94=AE=E9=94=80=E5=94=AE?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E5=8A=A0=E5=85=A5=E5=AF=BC=E5=85=A5=E6=97=B6?= =?UTF-8?q?=E6=A3=80=E9=AA=8C=E7=89=A9=E6=96=99=E4=B8=BB=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E4=B8=AD=E6=98=AF=E5=90=A6=E5=AD=98=E5=9C=A8=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E7=9A=84=E7=89=A9=E6=96=99=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/HQ_H/HQ_H_PlatformAppService.cs | 21 +++++++---- .../WMS/WMSCusomerKanbanAppService.cs | 18 +++++++--- .../Entities/WMS/WMSJitAppService.cs | 4 +-- .../Entities/WMS/WMSSharePartAppService.cs | 15 ++++---- .../Entities/WMS/WmsHQKBOutputAppService.cs | 36 ++++++++++++------- .../WMS/WmsOneTimeSaleOutputAppService.cs | 24 +++++++++---- .../Report/ErpPartDapperRepository.cs | 10 ++++++ 7 files changed, 90 insertions(+), 38 deletions(-) diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/HQ_H/HQ_H_PlatformAppService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/HQ_H/HQ_H_PlatformAppService.cs index d2045e8f..5cae35a9 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/HQ_H/HQ_H_PlatformAppService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/HQ_H/HQ_H_PlatformAppService.cs @@ -103,15 +103,24 @@ namespace Win.Sfs.SettleAccount.Entities.HQ_H throw new BusinessException("导入模板数据不能为空!"); } - var entityList = ObjectMapper.Map, List>(result); + var entityList_org = ObjectMapper.Map, List>(result); + + var entityList= entityList_org.Where(p => !string.IsNullOrEmpty(p.MaterialCode)).ToList();//过滤掉物料号为空的数据 + + var gethqimportdata = entityList.Select(p => p.MaterialCode).Distinct().ToList(); + var getmaterial = _erpdapperRepository.GetMaterialListCustomerPartCode(); //和物料主数据中SAP物料号检验是否存在 - foreach (var itm in entityList) + var query = from itm in gethqimportdata + join itm1 in getmaterial on itm equals itm1.CustomerPartCode into temp1 + from tm1 in temp1.DefaultIfEmpty() + where tm1 == null + select itm; + + + foreach (var itm in query) { - if (!_erpdapperRepository.GetMaterialList().Any(p => p.CustomerPartCode == itm.MaterialCode)) - { - checkList.Add(new ErrorExportDto(version, "红旗结算导入", string.Empty, string.Empty, itm.MaterialCode, string.Empty, string.Format("物料主数据不存在当前导入的物料号{0}!", itm.MaterialCode), string.Empty)); - } + checkList.Add(new ErrorExportDto(version, "红旗结算导入", string.Empty, string.Empty, itm, string.Empty, string.Format("物料主数据不存在当前导入的物料号{0}!", itm), string.Empty)); } if (checkList.Count > 0) diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSCusomerKanbanAppService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSCusomerKanbanAppService.cs index f6516f4a..36ed14d0 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSCusomerKanbanAppService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSCusomerKanbanAppService.cs @@ -486,12 +486,20 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts var filteResult = result.Where(p =>!string.IsNullOrEmpty(p.SapMaterialCode));//过滤掉物料号为空的数据 //和物料主数据中SAP物料号检验是否存在 - foreach (var itm in filteResult) + var gethqimportdata = filteResult.Select(p => p.SapMaterialCode).Distinct().ToList(); + var getmaterial = _erpdapperRepository.GetMaterialList(); + + var queryCheck = from itm in gethqimportdata + join itm1 in getmaterial on itm equals itm1.MaterialCode into temp1 + from tm1 in temp1.DefaultIfEmpty() + where tm1 == null + select itm; + foreach (var itm in queryCheck) { - if (!_erpdapperRepository.GetMaterialList().Any(p => p.MaterialCode == itm.SapMaterialCode)) - { - checkList.Add(new ErrorExportDto(version, "自定义出库单导入", string.Empty, string.Empty, itm.SapMaterialCode, string.Empty, string.Format("物料主数据不存在当前导入的物料号{0}!", itm.SapMaterialCode), string.Empty)); - } + //if (!_erpdapperRepository.GetMaterialList().Any(p => p.MaterialCode == itm.SapMaterialCode)) + //{ + checkList.Add(new ErrorExportDto(version, "自定义出库单导入", string.Empty, string.Empty, itm, string.Empty, string.Format("物料主数据不存在当前导入的物料号{0}!", itm), string.Empty)); + //} } //检验2:导入模板中的结算数据是否为0 diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSJitAppService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSJitAppService.cs index 81c5750b..9e06eef9 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSJitAppService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSJitAppService.cs @@ -55,8 +55,8 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts /// /// wms出库 /// - //[Authorize(SettleAccountPermissions.WMSJIT.Default)] - [AllowAnonymous] + [Authorize(SettleAccountPermissions.WMSJIT.Default)] + //[AllowAnonymous] [Route("api/settleaccount/wmsjitoutput")] public class WMSJitAppService : diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePartAppService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePartAppService.cs index cfd1c9e6..9721e8a4 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePartAppService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePartAppService.cs @@ -681,14 +681,15 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts } //和物料主数据中SAP物料号检验是否存在 - foreach (var itm in result) - { - if (!_erpdapperRepository.GetMaterialList().Any(p => p.MaterialCode == itm.MaterialCode)) - { - checkList.Add(new ErrorExportDto(version, "大众备件出库单导入", string.Empty, string.Empty, itm.MaterialCode, string.Empty, string.Format("物料主数据不存在当前导入的物料号{0}!", itm.MaterialCode), string.Empty)); - } - } + //foreach (var itm in result) + //{ + // if (!_erpdapperRepository.GetMaterialList().Any(p => p.MaterialCode == itm.MaterialCode)) + // { + // checkList.Add(new ErrorExportDto(version, "大众备件出库单导入", string.Empty, string.Empty, itm.MaterialCode, string.Empty, string.Format("物料主数据不存在当前导入的物料号{0}!", itm.MaterialCode), string.Empty)); + // } + + //} if (checkList.Count > 0) { diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQKBOutputAppService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQKBOutputAppService.cs index fefbdb45..5c42e197 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQKBOutputAppService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQKBOutputAppService.cs @@ -269,7 +269,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS throw new BusinessException("导入模板数据不能为空!"); } //物料号不能为空,直接过滤掉,模板的中看不到有空行的情况,但是通过个IE这个插件发现有空行数据导入 - var _list = _listOrgin.Where(p =>!string.IsNullOrEmpty(p.SapMaterialCode)); + var _list = _listOrgin.Where(p => !string.IsNullOrEmpty(p.SapMaterialCode)); foreach (var itm in _list) { @@ -278,7 +278,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS checkList.Add(new ErrorExportDto(version, "红旗一轿出库单导入", string.Empty, string.Empty, string.Empty, string.Empty, string.Format("导入模板中SAP编码{0}的是否备件及客户号不能为空,影响出库请检查!", itm.SapMaterialCode), string.Empty)); } } - + foreach (var itm in _list) { if (itm.IsBack != "是" && itm.IsBack != "否") @@ -287,14 +287,26 @@ namespace Win.Sfs.SettleAccount.Entities.WMS } } //和物料主数据中SAP物料号检验是否存在 - foreach (var itm in _list) + var gethqimportdata = _list.Select(p => p.SapMaterialCode).Distinct().ToList(); + var getmaterial = _erpdapperRepository.GetMaterialList(); + + var queryCheck = from itm in gethqimportdata + join itm1 in getmaterial on itm equals itm1.MaterialCode into temp1 + from tm1 in temp1.DefaultIfEmpty() + where tm1 == null + select itm; + foreach (var itm in queryCheck) { - if (!_erpdapperRepository.GetMaterialList().Any(p => p.MaterialCode == itm.SapMaterialCode)) - { - checkList.Add(new ErrorExportDto(version, "红旗一轿出库单导入", string.Empty, string.Empty, itm.SapMaterialCode, string.Empty, string.Format("物料主数据不存在当前导入的物料号{0}!", itm.SapMaterialCode), string.Empty)); - } - + checkList.Add(new ErrorExportDto(version, "红旗一轿出库单导入", string.Empty, string.Empty, itm, string.Empty, string.Format("物料主数据不存在当前导入的物料号{0}!", itm), string.Empty)); } + //foreach (var itm in _list) + //{ + // if (!_erpdapperRepository.GetMaterialList().Any(p => p.MaterialCode == itm.SapMaterialCode)) + // { + // checkList.Add(new ErrorExportDto(version, "红旗一轿出库单导入", string.Empty, string.Empty, itm.SapMaterialCode, string.Empty, string.Format("物料主数据不存在当前导入的物料号{0}!", itm.SapMaterialCode), string.Empty)); + // } + + //} if (checkList.Count > 0) { @@ -314,11 +326,11 @@ namespace Win.Sfs.SettleAccount.Entities.WMS } } var getbillName = "HQVSBT";//混合数据 - if(_list.FirstOrDefault().Extend== "100113") + if (_list.FirstOrDefault().Extend == "100113") { getbillName = "BT";//一轿 } - else if(_list.FirstOrDefault().Extend == "100053") + else if (_list.FirstOrDefault().Extend == "100053") { getbillName = "HQKB";//红旗 } @@ -346,14 +358,14 @@ namespace Win.Sfs.SettleAccount.Entities.WMS 0, 0, itm.Price, - Math.Round((itm.Price * itm.Qty),2) + Math.Round((itm.Price * itm.Qty), 2) ); await _wmsRepository.GetDbContext().BulkInsertAsync(query.ToList(), new BulkConfig() { BulkCopyTimeout = 0, BatchSize = 10000 }); int _count = _wmsVersionRepository.Count(p => p.Version == version && p.BillNum == _billNum); if (_count == 0) { - var _version = new WmsHQWithOutKanbanOutPut(GuidGenerator.Create(), version, _billNum, CurrentUser.Email,string.Empty); + var _version = new WmsHQWithOutKanbanOutPut(GuidGenerator.Create(), version, _billNum, CurrentUser.Email, string.Empty); await _wmsVersionRepository.InsertAsync(_version, true); } return ApplicationConsts.SuccessStr; ; diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsOneTimeSaleOutputAppService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsOneTimeSaleOutputAppService.cs index 29e2440e..b1198605 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsOneTimeSaleOutputAppService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsOneTimeSaleOutputAppService.cs @@ -234,14 +234,26 @@ namespace Win.Sfs.SettleAccount.Entities.WMS } //和物料主数据中SAP物料号检验是否存在 - foreach (var itm in _list) + var gethqimportdata = _list.Select(p => p.SapMaterialCode).Distinct().ToList(); + var getmaterial = _erpdapperRepository.GetMaterialList(); + + var queryCheck = from itm in gethqimportdata + join itm1 in getmaterial on itm equals itm1.MaterialCode into temp1 + from tm1 in temp1.DefaultIfEmpty() + where tm1 == null + select itm; + foreach (var itm in queryCheck) { - if (!_erpdapperRepository.GetMaterialList().Any(p => p.MaterialCode == itm.SapMaterialCode)) - { - checkList.Add(new ErrorExportDto(version, "一次性寄售销售导入", string.Empty, string.Empty, itm.SapMaterialCode, string.Empty, string.Format("物料主数据不存在当前导入的物料号{0}!", itm.SapMaterialCode), string.Empty)); - } - + checkList.Add(new ErrorExportDto(version, "一次性寄售销售导入", string.Empty, string.Empty, itm, string.Empty, string.Format("物料主数据不存在当前导入的物料号{0}!", itm), string.Empty)); } + //foreach (var itm in _list) + //{ + // if (!_erpdapperRepository.GetMaterialList().Any(p => p.MaterialCode == itm.SapMaterialCode)) + // { + // checkList.Add(new ErrorExportDto(version, "一次性寄售销售导入", string.Empty, string.Empty, itm.SapMaterialCode, string.Empty, string.Format("物料主数据不存在当前导入的物料号{0}!", itm.SapMaterialCode), string.Empty)); + // } + + //} if (checkList.Count > 0) { return await ExportErrorReportAsync(checkList); diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/ErpPartDapperRepository.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/ErpPartDapperRepository.cs index c6433314..f0dd9242 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/ErpPartDapperRepository.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/ErpPartDapperRepository.cs @@ -57,6 +57,16 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report } + /// + /// 获取客户物料号 + /// + /// + public virtual List GetMaterialListCustomerPartCode() + { + return DbConnection.Query("select max(Id) ID,'' Factory,CustomerPartCode,MaterialDesc,EstimateTypeDesc,EstimateType from Set_material where CustomerPartCode is not null group by CustomerPartCode, MaterialDesc, EstimateTypeDesc, EstimateType ").ToList(); + + } + public virtual List GetErrorBillList() { From a38d5c5a9b3988179390ff93cede3349011dc6cb Mon Sep 17 00:00:00 2001 From: 44673626 <44673626@qq.com> Date: Wed, 27 Jul 2022 16:48:24 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E7=BA=A2=E6=97=97=E4=B8=80=E8=BD=BF?= =?UTF-8?q?=E8=BD=A6=E5=87=BA=E5=BA=93=E5=8D=95=E3=80=81=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E5=8F=91=E8=B4=A7=E5=8D=95=E5=92=8C=E4=B8=80=E6=AC=A1?= =?UTF-8?q?=E6=80=A7=E5=AF=84=E5=94=AE=E5=87=BA=E5=BA=93=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E5=8A=A0=E4=B8=8A=E6=A3=80=E9=AA=8C=EF=BC=8C=E4=B8=8D=E6=98=AF?= =?UTF-8?q?=E6=B1=87=E6=80=BB=E7=9A=84=E6=95=B0=E6=8D=AE=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WMS/WMSCusomerKanbanAppService.cs | 13 ++++++++++++ .../Entities/WMS/WmsHQKBOutputAppService.cs | 21 ++++++++++++++++++- .../WMS/WmsOneTimeSaleOutputAppService.cs | 13 ++++++++++++ .../Entities/WMS/WmsUnInterface.cs | 4 ++-- 4 files changed, 48 insertions(+), 3 deletions(-) diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSCusomerKanbanAppService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSCusomerKanbanAppService.cs index 36ed14d0..37d42caa 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSCusomerKanbanAppService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSCusomerKanbanAppService.cs @@ -485,6 +485,19 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts var filteResult = result.Where(p =>!string.IsNullOrEmpty(p.SapMaterialCode));//过滤掉物料号为空的数据 + //不是汇总形式出库的不能导入,即导入的数据中如果SAP编号 即厂内零件号有重复不能导入 + var sapcodegroup = (from t in filteResult + group t by t.SapMaterialCode into m + where m.Count() >= 2 + select m).ToList(); + if (sapcodegroup != null && sapcodegroup.Count > 0) + { + foreach (var item in sapcodegroup) + { + checkList.Add(new ErrorExportDto(version, "自定义出库单导入", string.Empty, string.Empty, item.Key, string.Empty, string.Format("导入模板中SAP编码{0},有重复不是汇总出库请检查!", item.Key), string.Empty)); + } + } + //和物料主数据中SAP物料号检验是否存在 var gethqimportdata = filteResult.Select(p => p.SapMaterialCode).Distinct().ToList(); var getmaterial = _erpdapperRepository.GetMaterialList(); diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQKBOutputAppService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQKBOutputAppService.cs index 5c42e197..ba98d736 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQKBOutputAppService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQKBOutputAppService.cs @@ -279,11 +279,30 @@ namespace Win.Sfs.SettleAccount.Entities.WMS } } + //不是汇总形式出库的不能导入,即导入的数据中如果SAP编号 即厂内零件号有重复不能导入 + var sapcodegroup = (from t in _list + group t by new { sapcode = t.SapMaterialCode, isbj = t.IsBack } into m + select new + { + 物料号 = m.Key.sapcode, + 是否备件 = m.Key.isbj, + rowcount = m.Count() + } into c + where c.rowcount >= 2 + select c).ToList(); + if (sapcodegroup != null && sapcodegroup.Count > 0) + { + foreach (var item in sapcodegroup) + { + checkList.Add(new ErrorExportDto(version, "红旗一轿出库单导入", string.Empty, string.Empty, item.物料号, string.Empty, string.Format("导入模板中SAP编码{0}并且是否备件值{1},有重复不是汇总出库请检查!", item.物料号, item.是否备件), string.Empty)); + } + } + foreach (var itm in _list) { if (itm.IsBack != "是" && itm.IsBack != "否") { - checkList.Add(new ErrorExportDto(version, "红旗一轿出库单导入", string.Empty, string.Empty, string.Empty, string.Empty, string.Format("导入模板中SAP编码{0}的是否备件请填写是或否,影响出库请检查!", itm.SapMaterialCode), string.Empty)); + checkList.Add(new ErrorExportDto(version, "红旗一轿出库单导入", string.Empty, string.Empty, itm.SapMaterialCode, string.Empty, string.Format("导入模板中SAP编码{0}的是否备件请填写是或否,影响出库请检查!", itm.SapMaterialCode), string.Empty)); } } //和物料主数据中SAP物料号检验是否存在 diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsOneTimeSaleOutputAppService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsOneTimeSaleOutputAppService.cs index b1198605..3ab0e5c5 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsOneTimeSaleOutputAppService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsOneTimeSaleOutputAppService.cs @@ -233,6 +233,19 @@ namespace Win.Sfs.SettleAccount.Entities.WMS checkList.Add(new ErrorExportDto(version, "一次性寄售销售导入", string.Empty, string.Empty, string.Empty, string.Empty, "导入模板中第一页签没有数据,请检查!", string.Empty)); } + //不是汇总形式出库的不能导入,即导入的数据中如果SAP编号 即厂内零件号有重复不能导入 + var sapcodegroup = (from t in _list + group t by t.SapMaterialCode into m + where m.Count() >= 2 + select m).ToList(); + if (sapcodegroup != null && sapcodegroup.Count > 0) + { + foreach (var item in sapcodegroup) + { + checkList.Add(new ErrorExportDto(version, "一次性寄售销售导入", string.Empty, string.Empty, item.Key, string.Empty, string.Format("导入模板中SAP编码{0},有重复不是汇总出库请检查!", item.Key), string.Empty)); + } + } + //和物料主数据中SAP物料号检验是否存在 var gethqimportdata = _list.Select(p => p.SapMaterialCode).Distinct().ToList(); var getmaterial = _erpdapperRepository.GetMaterialList(); diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsUnInterface.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsUnInterface.cs index 003806c1..042a9dde 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsUnInterface.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsUnInterface.cs @@ -306,13 +306,13 @@ namespace Win.Sfs.SettleAccount.Entities.WMS var en1= entities.Where(p => p.OutputQty == 0).ToList(); foreach(var itm in en1) { - checkList.Add(new ErrorExportDto() { Message = string.Format("结算号:{0}物料号:{1}实际出库数量为0不能同步Sap", itm.BillNum, itm.MaterialCode) }); + checkList.Add(new ErrorExportDto() { Version = input.Version, ItemCode = itm.MaterialCode, Model = "结算出库SAP接口", Message = string.Format("结算号:{0}物料号:{1}实际出库数量为0不能同步Sap", itm.BillNum, itm.MaterialCode) }); } var en2=entities.Where(p => p.OutputQty != p.Qty && p.OutputQty>0).ToList(); foreach (var itm in en2) { - checkList.Add(new ErrorExportDto() { Message = string.Format("结算号:{0}物料号:{1}实际出库数量不等于结算数量不能同步Sap", itm.BillNum, itm.MaterialCode) }); + checkList.Add(new ErrorExportDto() { Version = input.Version, ItemCode = itm.MaterialCode, Model = "结算出库SAP接口", Message = string.Format("结算号:{0}物料号:{1}实际出库数量不等于结算数量不能同步Sap", itm.BillNum, itm.MaterialCode) }); } var _count = entities.Count(p => p.State==2); From d275f7b0e72e809d54d438f73b4895b371b01d9e Mon Sep 17 00:00:00 2001 From: 44673626 <44673626@qq.com> Date: Wed, 27 Jul 2022 17:03:36 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E6=A3=80=E9=AA=8C=E7=89=A9=E6=96=99?= =?UTF-8?q?=E5=8F=B7=E6=98=AF=E5=90=A6=E9=87=8D=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/WMS/WMSCusomerKanbanAppService.cs | 17 ----------------- .../Entities/WMS/WmsHQKBOutputAppService.cs | 2 +- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSCusomerKanbanAppService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSCusomerKanbanAppService.cs index 37d42caa..13bf1c2c 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSCusomerKanbanAppService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSCusomerKanbanAppService.cs @@ -569,23 +569,6 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts } } - //检验3:导入模板中物料号,不能重复 - var _isRepeatOfReportList = from arc in _lst - group arc by new { arc.Kanban, arc.SapMaterialCode, arc.Version } - into g - where g.Count() > 1 - select g; - foreach (var itm in _isRepeatOfReportList) - { - checkList.Add(new ErrorExportDto(version, "自定义出库单", string.Empty, string.Empty, string.Empty, string.Empty, string.Format("导入模板中物料号{0}有重复,请检查!", itm.Key.SapMaterialCode), string.Empty)); - } - if (checkList.Count > 0) - { - return await ExportErrorReportAsync(checkList); - } - - - var outPutDetail = await _wmsRepository.Where(p => p.Version == version && p.State != 4 ).ToListAsync(); diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQKBOutputAppService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQKBOutputAppService.cs index ba98d736..a7564caa 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQKBOutputAppService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQKBOutputAppService.cs @@ -294,7 +294,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS { foreach (var item in sapcodegroup) { - checkList.Add(new ErrorExportDto(version, "红旗一轿出库单导入", string.Empty, string.Empty, item.物料号, string.Empty, string.Format("导入模板中SAP编码{0}并且是否备件值{1},有重复不是汇总出库请检查!", item.物料号, item.是否备件), string.Empty)); + checkList.Add(new ErrorExportDto(version, "红旗一轿出库单导入", string.Empty, string.Empty, item.物料号, string.Empty, string.Format("导入模板中SAP编码{0}并且是否备件值为{1},有重复不是汇总出库请检查!", item.物料号, item.是否备件), string.Empty)); } } From 87f259d0dd3c6dc4523ff9df5b094c4235042fa7 Mon Sep 17 00:00:00 2001 From: 44673626 <44673626@qq.com> Date: Fri, 2 Sep 2022 11:06:21 +0800 Subject: [PATCH 5/6] =?UTF-8?q?20220902=E6=B4=BE=E6=A0=BC=E7=BB=93?= =?UTF-8?q?=E7=AE=97=E7=B3=BB=E7=BB=9F=E6=9C=80=E6=96=B0=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=EF=BC=8C=E6=96=B0git?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/Prices/PriceListAppService.cs | 3 +- .../Entities/Prices/PriceListAppServiceBJ.cs | 7 ++--- .../Entities/WMS/WMSHQHKanbanAppService.cs | 2 +- .../Entities/WMS/WMSKanbanAppService.cs | 4 +-- .../Entities/WMS/WMSSharePart90AppService.cs | 29 ++++++++++--------- .../SettleAccountApplicationModule.cs | 2 ++ .../Report/FisUpdateStateDapperRepository.cs | 25 ++++++++++++---- .../HQHSettledDetailDapperRepository.cs | 4 +-- .../HQMSettledDetailDapperRepository.cs | 4 +-- .../SettleSparePartDapperReportRepository.cs | 4 +-- .../Services/Report/FisUpdateExportService.cs | 29 +++++++++++++++++-- 11 files changed, 77 insertions(+), 36 deletions(-) diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs index c33ba1f8..0afee3d8 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs @@ -216,7 +216,8 @@ namespace Win.Sfs.SettleAccount.Entities.Prices var entityList = ObjectMapper.Map, List>(result); var _ls = entityList.Where(p=>p.EndDate.ToString().Contains("9999")).OrderByDescending(p => p.BeginDate).GroupBy(p => new { p.MaterialCode, p.CustomerCode,p.Type }).Select(p=>p.FirstOrDefault()); - + //只过滤类型为10的即正常价格,类型为20的是备件价格 + _ls = _ls.Where(p => p.Type == 10).ToList(); foreach (var itm in _ls) { diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs index 1c0cfe76..b0881d7a 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs @@ -170,17 +170,16 @@ namespace Win.Sfs.SettleAccount.Entities.Prices var entityList = ObjectMapper.Map, List>(result); var _ls = entityList.Where(p=>p.EndDate.ToString().Contains("9999")).OrderByDescending(p => p.BeginDate).GroupBy(p => new { p.MaterialCode, p.CustomerCode,p.Type }).Select(p=>p.FirstOrDefault()); + + //只要类型为20的备件价格数据 + _ls = _ls.Where(p => p.Type == 20).ToList(); foreach (var itm in _ls) { itm.Update(GuidGenerator.Create(),version); } - _ls=_ls.Where(p => p.Type == 20).ToList(); - - - await _mng.ImportAsync(_ls.ToList(), version); return ApplicationConsts.SuccessStr; } diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSHQHKanbanAppService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSHQHKanbanAppService.cs index 99eca55d..56ded856 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSHQHKanbanAppService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSHQHKanbanAppService.cs @@ -505,7 +505,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts { WmsHQHKanbanOutPutDetial _detail = new WmsHQHKanbanOutPutDetial( GuidGenerator.Create(), - !string.IsNullOrEmpty(itm.WmsBillNum) ? itm.WmsBillNum : string.Empty, + !string.IsNullOrEmpty(itm.WmsBillNum) ? (itm.WmsBillNum.Length > 36 ? "PF" : itm.WmsBillNum) : string.Empty, itm.Kanban, itm.MaterialCode, itm.MaterialDesc, diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSKanbanAppService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSKanbanAppService.cs index 03d56af2..9dd49e7b 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSKanbanAppService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSKanbanAppService.cs @@ -806,7 +806,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts { WmsKanbanOutPutDetial _detail = new WmsKanbanOutPutDetial( GuidGenerator.Create(), - !string.IsNullOrEmpty(itm.WmsBillNum) ? itm.WmsBillNum : string.Empty, + !string.IsNullOrEmpty(itm.WmsBillNum) ? (itm.WmsBillNum.Length > 36 ? "PF" : itm.WmsBillNum) : string.Empty, itm.Kanban, itm.MaterialCode, @@ -815,7 +815,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts string.Empty, string.Empty, 0, - !string.IsNullOrEmpty(itm.Extend1) ? itm.Extend1 : string.Empty, + !string.IsNullOrEmpty(itm.Extend1) ? itm.Extend1 : string.Empty,//客户物料号 !string.IsNullOrEmpty(itm.Extend2) ? itm.Extend2 : string.Empty, version, itm.MaterialCode, diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePart90AppService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePart90AppService.cs index 79ac8e05..14afdc21 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePart90AppService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePart90AppService.cs @@ -269,10 +269,10 @@ namespace Win.Sfs.SettleAccount.Entities.WMS string.Empty, string.Empty, 0, - !string.IsNullOrEmpty(p.Extend1) ? p.Extend1 : string.Empty, + !string.IsNullOrEmpty(p.Extend1) ? p.Extend1 : string.Empty,//客户物料号 string.Empty, p.Version, - p.MaterialCode, + p.ParentMaterialCode, _billNum, GuidGenerator.Create(), string.Empty, @@ -318,8 +318,8 @@ namespace Win.Sfs.SettleAccount.Entities.WMS string.Empty, string.Empty, 0, + !string.IsNullOrEmpty(p.Extend1) ? p.Extend1 : string.Empty, string.Empty, - string.Empty, input.Version, p.MaterialCode, _billNum, @@ -512,14 +512,14 @@ namespace Win.Sfs.SettleAccount.Entities.WMS } } - //和物料主数据中SAP物料号检验是否存在 - //foreach (var itm in filteResult) - //{ - // if (!_erpdapperRepository.GetMaterialList().Any(p => p.MaterialCode == itm.MaterialCode)) - // { - // checkList.Add(new ErrorExportDto(version, "大众备件出库单导入", string.Empty, string.Empty, itm.MaterialCode, string.Empty, string.Format("物料主数据不存在当前导入的物料号{0}!", itm.MaterialCode), string.Empty)); - // } - //} + + foreach (var itm in filteResult) + { + if (string.IsNullOrEmpty(itm.Extend1)) + { + checkList.Add(new ErrorExportDto(version, "大众备件出库单导入", string.Empty, string.Empty, string.Empty, string.Empty, string.Format("当前导入订单号{0}存在物料号为空情况,请检查!", itm.OrderBillNum), string.Empty)); + } + } if (checkList.Count > 0) { @@ -532,8 +532,9 @@ namespace Win.Sfs.SettleAccount.Entities.WMS { WmsSharePart90OutPutDetial _detail = new WmsSharePart90OutPutDetial( GuidGenerator.Create(), - //itm.WmsBillNum, - string.Empty, + //itm.WmsBillNum.Length > 36 ? "PF" : itm.WmsBillNum, + !string.IsNullOrEmpty(itm.WmsBillNum) ? (itm.WmsBillNum.Length > 36 ? "PF" : itm.WmsBillNum) : string.Empty, + //string.Empty, itm.OrderBillNum, itm.MaterialCode, @@ -542,7 +543,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS string.Empty, string.Empty, 0, - string.Empty, + !string.IsNullOrEmpty(itm.Extend1) ? itm.Extend1 : string.Empty,//客户物料号 string.Empty, version, itm.ParentMaterialCode, diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationModule.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationModule.cs index 257098e2..390c46b4 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationModule.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationModule.cs @@ -10,6 +10,7 @@ using Volo.Abp.Dapper; using Win.Abp.Snowflakes; using Volo.Abp.EventBus.RabbitMq; using Volo.Abp.RabbitMQ; +using Volo.Abp.EntityFrameworkCore; namespace Win.Sfs.SettleAccount { @@ -22,6 +23,7 @@ namespace Win.Sfs.SettleAccount typeof(AbpIdentityHttpApiClientModule), typeof(AbpAutoMapperModule), typeof(AbpAspNetCoreMvcModule), + typeof(AbpEntityFrameworkCoreModule), typeof(AbpDapperModule) //typeof(AbpEventBusRabbitMqModule) diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/FisUpdateStateDapperRepository.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/FisUpdateStateDapperRepository.cs index 07245ff9..52d9267e 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/FisUpdateStateDapperRepository.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/FisUpdateStateDapperRepository.cs @@ -23,6 +23,21 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report /// /// 主数据Dapper表 /// + //public class FisUpdateDapperRepository : DapperRepository, ITransientDependency + //{ + // public FisUpdateDapperRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) + // { + + // } + // [UnitOfWork(isTransactional: false)] + // public virtual void UpdateFisSettle() + // { + + // DbConnection.Execute("EXEC sp_settle_fis_update", null, null, 1200, null); + + // } + //} + public class FisUpdateDapperRepository : DapperRepository, ITransientDependency { public FisUpdateDapperRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) @@ -30,15 +45,15 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report } [UnitOfWork(isTransactional: false)] - public virtual void UpdateFisSettle() + public virtual void UpdateFisSettle(string version) { - - DbConnection.Execute("EXEC sp_settle_fis_update", null, null, 1200, null); + + DbConnection.Execute(string.Format("EXEC sp_settle_fis_update N'{0}'", version), null, null, 1200, null); } - - } + + } } diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQHSettledDetailDapperRepository.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQHSettledDetailDapperRepository.cs index 711dba91..f6e28268 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 @@ -1845,7 +1845,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " ) A\n" + " LEFT JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" + " ) temp1\n" + - " LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE Version = '202110' ) AS temp2 ON temp1.Sap编码 = temp2.MaterialCode"; + " LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceListBJ WHERE Version = '202110' and Type=20 ) AS temp2 ON temp1.Sap编码 = temp2.MaterialCode"; var _sql = string.Format(str, version); @@ -1919,7 +1919,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " ) A\n" + " LEFT JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" + " ) temp1\n" + - " LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE Version = '202110' ) AS temp2 ON temp1.Sap编码 = temp2.MaterialCode\n" + + " LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceListBJ WHERE Version = '202110' and Type=20 ) AS temp2 ON temp1.Sap编码 = temp2.MaterialCode\n" + " LEFT JOIN (\n" + " SELECT SUM\n" + " ( Amt ) / SUM ( Qty ) AS Price,\n" + diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQMSettledDetailDapperRepository.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQMSettledDetailDapperRepository.cs index 2b402a17..5653d38f 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQMSettledDetailDapperRepository.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQMSettledDetailDapperRepository.cs @@ -114,7 +114,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " ( a.HQMKanBan <> 'BJ' ) \n" + " AND a.Version= '{0}' {1} \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"; + " LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE ( Version = ( SELECT MAX ( Version ) FROM Set_PriceList ) ) and Type=10) AS TEMP2 ON temp1.Sap编码 = TEMP2.MaterialCode"; var _sql = string.Format(str, version, condition); var _query = DbConnection.Query(_sql, null, null, true, 1200, null); @@ -206,7 +206,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " ) A\n" + " LEFT JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" + " ) temp1\n" + - " LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE ( Version = ( SELECT MAX ( Version ) AS Expr1 FROM Set_PriceList ) ) ) AS temp2 ON temp1.Sap编码 = temp2.MaterialCode"; + " LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceListBJ WHERE ( Version = ( SELECT MAX ( Version ) AS Expr1 FROM Set_PriceList ) ) and Type=20 ) AS temp2 ON temp1.Sap编码 = temp2.MaterialCode"; var _sql = string.Format(str, version, condition); var _query = DbConnection.Query(_sql, null, null, true, 1200, null); 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 61401990..d14e2961 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 @@ -1332,7 +1332,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " ) AS temp1\n" + " LEFT JOIN ( SELECT * FROM set_backQty ) temp3 ON temp1.采购订单号 = temp3.Code \n" + " AND temp1.SAP编码= temp3.MaterialCode\n" + -" LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE Version = '202110' ) AS TEMP2 ON temp1.SAP编码 = TEMP2.MaterialCode \n" + +" LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceListBJ WHERE Version = '202110' and Type=20 ) AS TEMP2 ON temp1.SAP编码 = TEMP2.MaterialCode \n" + " ) unint1 UNION ALL\n" + "SELECT\n" + " * \n" + @@ -1389,7 +1389,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " ) AS temp1\n" + " LEFT JOIN ( SELECT * FROM set_backQty ) temp3 ON temp1.采购订单号 = temp3.Code \n" + " AND temp1.SAP编码= temp3.MaterialCode\n" + -" LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE Version = '202110' ) AS TEMP2 ON temp1.SAP编码 = TEMP2.MaterialCode \n" + +" LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceListBJ WHERE Version = '202110' and Type=20 ) AS TEMP2 ON temp1.SAP编码 = TEMP2.MaterialCode \n" + " ) unint2;"; diff --git a/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/FisUpdateExportService.cs b/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/FisUpdateExportService.cs index de28ddc2..3e59b89d 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/FisUpdateExportService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/FisUpdateExportService.cs @@ -11,6 +11,27 @@ using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report; namespace SettleAccount.Job.Services.Report { + //public class FisUpdateExportService : ITransientDependency, IExportJob + //{ + // private readonly FisUpdateDapperRepository _dapperRepository; + + + // public FisUpdateExportService( + + // FisUpdateDapperRepository dapperRepository + + // ) + // { + // _dapperRepository = dapperRepository; + // } + // [UnitOfWork(isTransactional: false)] + // public string ExportFile(Guid id, List exportName, List property) + // { + // _dapperRepository.UpdateFisSettle(); + // return id.ToString(); + // } + //} + public class FisUpdateExportService : ITransientDependency, IExportJob { private readonly FisUpdateDapperRepository _dapperRepository; @@ -19,15 +40,17 @@ namespace SettleAccount.Job.Services.Report public FisUpdateExportService( FisUpdateDapperRepository dapperRepository - + ) { _dapperRepository = dapperRepository; } [UnitOfWork(isTransactional: false)] - public string ExportFile(Guid id, List exportName, List property) + public string ExportFile(Guid id, List exportName, List p_list) { - _dapperRepository.UpdateFisSettle(); + var version = p_list.Where(p => p.Name == "Version").FirstOrDefault().Value; + + _dapperRepository.UpdateFisSettle(version); return id.ToString(); } } From bf26d947ca8b02c10ff43771bb068e893fe6dcba Mon Sep 17 00:00:00 2001 From: 44673626 <44673626@qq.com> Date: Fri, 2 Sep 2022 11:17:56 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E5=9F=BA=E7=A1=80=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E4=BB=A3=E7=A0=8120220902=E6=96=B0git?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../HbDtoExtensions.cs | 45 +++++++++++++++++++ ...BaseServiceApplicationAutoMapperProfile.cs | 4 ++ .../UserManagement/UserAppService.cs | 9 ++++ .../BaseService.Domain/Users/AppUser.cs | 2 +- .../BaseEfCoreEntityExtensionMappings.cs | 9 ++++ .../BaseService.Host/BaseService.Host.csproj | 2 +- ...eServiceMigrationDbContextModelSnapshot.cs | 5 ++- 7 files changed, 73 insertions(+), 3 deletions(-) create mode 100644 src/Modules/BaseService/BaseService.Application.Contracts/HbDtoExtensions.cs diff --git a/src/Modules/BaseService/BaseService.Application.Contracts/HbDtoExtensions.cs b/src/Modules/BaseService/BaseService.Application.Contracts/HbDtoExtensions.cs new file mode 100644 index 00000000..6313e9ce --- /dev/null +++ b/src/Modules/BaseService/BaseService.Application.Contracts/HbDtoExtensions.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Volo.Abp.Identity; +using Volo.Abp.ObjectExtending; +using Volo.Abp.Threading; + +namespace BaseService +{ + public static class HbDtoExtensions + { + private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner(); + + public static void Configure() + { + OneTimeRunner.Run(() => + { + /* You can add extension properties to DTOs + * defined in the depended modules. + * + * Example: + * + * ObjectExtensionManager.Instance + * .AddOrUpdateProperty("Title"); + * + * See the documentation for more: + * https://docs.abp.io/en/abp/latest/Object-Extensions + */ + ObjectExtensionManager.Instance + .AddOrUpdateProperty( + new[] + { + typeof(IdentityUserDto), + typeof(IdentityUserCreateDto), + typeof(IdentityUserUpdateDto), + typeof(UpdateProfileDto) + }, + "CodeNum" + ); + }); + } + } +} diff --git a/src/Modules/BaseService/BaseService.Application/BaseServiceApplicationAutoMapperProfile.cs b/src/Modules/BaseService/BaseService.Application/BaseServiceApplicationAutoMapperProfile.cs index 66ba4a2f..f22660de 100644 --- a/src/Modules/BaseService/BaseService.Application/BaseServiceApplicationAutoMapperProfile.cs +++ b/src/Modules/BaseService/BaseService.Application/BaseServiceApplicationAutoMapperProfile.cs @@ -9,6 +9,8 @@ using BaseService.BaseData.BranchManagement.Dto; using BaseService.BaseData.UserBranchRoleManagement.Dto; using BaseService.RelationData.Dto; +using Volo.Abp.Identity; + namespace BaseService { public class BaseServiceApplicationAutoMapperProfile : Profile @@ -24,6 +26,8 @@ namespace BaseService //分支--角色 CreateMap(); + + CreateMap().MapExtraProperties(); } } } diff --git a/src/Modules/BaseService/BaseService.Application/UserManagement/UserAppService.cs b/src/Modules/BaseService/BaseService.Application/UserManagement/UserAppService.cs index b70e6b1c..a2ffa872 100644 --- a/src/Modules/BaseService/BaseService.Application/UserManagement/UserAppService.cs +++ b/src/Modules/BaseService/BaseService.Application/UserManagement/UserAppService.cs @@ -22,6 +22,7 @@ using Volo.Abp.ObjectExtending; using Volo.Abp.PermissionManagement; using Volo.Abp.Users; using IdentityUser = Volo.Abp.Identity.IdentityUser; +using Volo.Abp.Data; namespace BaseService.Systems.UserManagement { @@ -122,6 +123,13 @@ namespace BaseService.Systems.UserManagement public async Task UpdateAsync(Guid id, IdentityUserUpdateDto input) { var user = await UserManager.GetByIdAsync(id); + // user.SetProperty("Title", "My custom title value!"); + //var gettitle= user.GetProperty("Title"); + // if(string.IsNullOrEmpty(gettitle)) + // { + // throw new BusinessException("用户标题不能为空"); + // } + user.ConcurrencyStamp = input.ConcurrencyStamp; (await UserManager.SetUserNameAsync(user, input.UserName)).CheckErrors(); @@ -138,6 +146,7 @@ namespace BaseService.Systems.UserManagement } var dto = ObjectMapper.Map(user); + await CurrentUnitOfWork.SaveChangesAsync(); diff --git a/src/Modules/BaseService/BaseService.Domain/Users/AppUser.cs b/src/Modules/BaseService/BaseService.Domain/Users/AppUser.cs index 625c0ff1..c176e663 100644 --- a/src/Modules/BaseService/BaseService.Domain/Users/AppUser.cs +++ b/src/Modules/BaseService/BaseService.Domain/Users/AppUser.cs @@ -32,7 +32,7 @@ namespace BaseService.Users #endregion - + public string CodeNum { get; set; } //public Guid BranchId { get; set; } //public bool Enable { get; set; } diff --git a/src/Modules/BaseService/BaseService.EntityFrameworkCore/EntityFrameworkCore/BaseEfCoreEntityExtensionMappings.cs b/src/Modules/BaseService/BaseService.EntityFrameworkCore/EntityFrameworkCore/BaseEfCoreEntityExtensionMappings.cs index 71aa980e..0b76ac1d 100644 --- a/src/Modules/BaseService/BaseService.EntityFrameworkCore/EntityFrameworkCore/BaseEfCoreEntityExtensionMappings.cs +++ b/src/Modules/BaseService/BaseService.EntityFrameworkCore/EntityFrameworkCore/BaseEfCoreEntityExtensionMappings.cs @@ -14,6 +14,15 @@ namespace BaseService.EntityFrameworkCore { BaseServiceModuleExtensionConfigurator.Configure(); + ObjectExtensionManager.Instance + .MapEfCoreProperty( + "CodeNum", + (entityBuilder, propertyBuilder) => + { + + } + ); + //OneTimeRunner.Run(() => //{ // ObjectExtensionManager.Instance diff --git a/src/Modules/BaseService/BaseService.Host/BaseService.Host.csproj b/src/Modules/BaseService/BaseService.Host/BaseService.Host.csproj index c6fe1a45..a37b3da0 100644 --- a/src/Modules/BaseService/BaseService.Host/BaseService.Host.csproj +++ b/src/Modules/BaseService/BaseService.Host/BaseService.Host.csproj @@ -30,7 +30,7 @@ - + diff --git a/src/Modules/BaseService/BaseService.Host/FileStorage/Migrations/BaseServiceMigrationDbContextModelSnapshot.cs b/src/Modules/BaseService/BaseService.Host/FileStorage/Migrations/BaseServiceMigrationDbContextModelSnapshot.cs index b5614c92..764ff34b 100644 --- a/src/Modules/BaseService/BaseService.Host/FileStorage/Migrations/BaseServiceMigrationDbContextModelSnapshot.cs +++ b/src/Modules/BaseService/BaseService.Host/FileStorage/Migrations/BaseServiceMigrationDbContextModelSnapshot.cs @@ -19,7 +19,7 @@ namespace FileStorage.Migrations .UseIdentityColumns() .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer) .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("ProductVersion", "5.0.1"); + .HasAnnotation("ProductVersion", "5.0.7"); modelBuilder.Entity("BaseService.BaseData.Branch", b => { @@ -653,6 +653,9 @@ namespace FileStorage.Migrations .HasDefaultValue(0) .HasColumnName("AccessFailedCount"); + b.Property("CodeNum") + .HasColumnType("nvarchar(max)"); + b.Property("ConcurrencyStamp") .IsConcurrencyToken() .HasMaxLength(40)