diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs index fa051e96..d276bbe2 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs @@ -162,7 +162,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ if (errorList.Count() > 0) { - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode,Message = "请下载错误信息", fileName = await ExportErrorReportAsync(errorList) }); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode,Message = "错误提示文件已下载,请打开文件查看", fileName = await ExportErrorReportAsync(errorList) }); } var dto1s = ObjectMapper.Map, List>(entitys); @@ -225,6 +225,21 @@ namespace Win.Sfs.SettleAccount.Entities.BQ /// public virtual async Task ReissueInvoiceExtend(List p_list) { + var errorlist= p_list.GroupBy(p => new { p.PN, p.LU }).Where(p => p.Count() > 1).Select(p => new { p.Key.PN, p.Key.LU }).ToList(); + + List errors = new List(); + + foreach (var itm in errorlist) + { + errors.Add(new ERR_EXP_DTO() { Message=$"零件号{itm.LU},标识号(生产码){itm.PN}有重复数据!" }); + } + + if (errors.Count > 0) + { + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = await ExportErrorReportAsync(errors) }); + + } + var adjlist = ObjectMapper.Map, List>(p_list); if (adjlist == null && adjlist.Count == 0) { @@ -291,7 +306,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ //var errorList =await CheckInvoiceGenerationRules(entitys, priceList, inv.BusinessType); //if (errorList.Count() > 0) //{ - //return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "请下载错误信息", fileName = await ExportErrorReportAsync(errorList) }); + //return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = await ExportErrorReportAsync(errorList) }); //} var dto1s = ObjectMapper.Map, List>(entitys); var q = from d in dto1s diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs index b731a175..35fb78db 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs @@ -101,7 +101,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var errorList = await CheckInvoiceGenerationRules(entitys,main.Site,priceList, main.BusinessType);//校验生成规则 if (errorList.Count() > 0) { - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "请下载错误信息", fileName = await ExportErrorReportAsync(errorList) }); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = await ExportErrorReportAsync(errorList) }); } if (await _bbacMng.SetForwardState(main, SettleBillState.已开票)) { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_NOT_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_NOT_SA_SERVICE.cs index d881a771..7a173b52 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_NOT_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_NOT_SA_SERVICE.cs @@ -61,7 +61,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { errorlist.Add(new ERR_EXP_DTO() { Message = itm }); } - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "请下载错误信息", fileName = await ExportErrorReportAsync(errorlist) }); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = await ExportErrorReportAsync(errorlist) }); } } return new JsonResult(new { Code = 200, Message = "生成成功" }); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs index 96e2e3be..ac312e3c 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs @@ -181,7 +181,7 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase if (checkList.Count > 0) { string fileName = await ExportErrorReportAsync(checkList).ConfigureAwait(false); - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message= "请下载错误信息", fileName = fileName }); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message= "错误提示文件已下载,请打开文件查看", fileName = fileName }); } #endregion diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_BA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_BA_SERVICE.cs index cbc42227..c8a59b3e 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_BA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_BA_SERVICE.cs @@ -22,6 +22,7 @@ using Win.Sfs.SettleAccount.Entities.BQ.Managers; using Win.Sfs.SettleAccount.Entities.BQ.Temp; using Win.Sfs.SettleAccount.Entities.Prices; using Win.Sfs.SettleAccount.Entities.TaskJobs; +using Win.Sfs.SettleAccount.ExportReports; using Win.Sfs.Shared.RepositoryBase; namespace Win.Sfs.SettleAccount.Entities.BQ @@ -118,7 +119,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ if (errorList.Count() > 0) { - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "请下载错误信息", fileName = await ExportErrorReportAsync(errorList) }); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = await ExportErrorReportAsync(errorList) }); ; } @@ -182,6 +183,19 @@ namespace Win.Sfs.SettleAccount.Entities.BQ /// public virtual async Task ReissueInvoiceExtend(List p_list) { + var errorlist = p_list.GroupBy(p => new { p.PN, p.LU }).Where(p => p.Count() > 1).Select(p => new { p.Key.PN, p.Key.LU }).ToList(); + + List errors = new List(); + + foreach (var itm in errorlist) + { + errors.Add(new ERR_EXP_DTO() { Message = $"零件号{itm.LU},标识号(生产码){itm.PN}有重复数据!" }); + } + + if (errors.Count > 0) + { + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = await ExportErrorReportAsync(errors) }); + } var adjlist = ObjectMapper.Map, List>(p_list); if (adjlist == null && adjlist.Count == 0) @@ -248,7 +262,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var errorList = await CheckInvoiceGenerationRules(entitys, priceList, inv.BusinessType); if (errorList.Count() > 0) { - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "请下载错误信息", fileName = await ExportErrorReportAsync(errorList) }); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = await ExportErrorReportAsync(errorList) }); } // var dto1s = ObjectMapper.Map, List>(entitys); var q = from d in entitys diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_CAN_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_CAN_SA_SERVICE.cs index aecbd853..88a49041 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_CAN_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_CAN_SA_SERVICE.cs @@ -94,7 +94,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var errorList = await CheckInvoiceGenerationRules(entitys,main.Site,priceList, main.BusinessType);//校验生成规则 if (errorList.Count() > 0) { - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "请下载错误信息", fileName = await ExportErrorReportAsync(errorList) }); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = await ExportErrorReportAsync(errorList) }); } if (await _hbpoMng.SetForwardState(main, SettleBillState.已开票)) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_NOT_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_NOT_SA_SERVICE.cs index 39ff9027..5dfd895a 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_NOT_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_NOT_SA_SERVICE.cs @@ -65,7 +65,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { errorlist.Add(new ERR_EXP_DTO() { Message = itm }); } - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "请下载错误信息", fileName = await ExportErrorReportAsync(errorlist) }); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = await ExportErrorReportAsync(errorlist) }); } } return new JsonResult(new { Code = 200, Message = "生成成功" }); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_SERVICE.cs index 866c41b8..3b23a102 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_SERVICE.cs @@ -230,7 +230,7 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase if (checkList.Count > 0) { string fileName = await ExportErrorReportAsync(checkList).ConfigureAwait(false); - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "请下载错误信息", fileName = fileName }); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = fileName }); } #endregion @@ -269,7 +269,7 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase if (checkList.Count > 0) { string fileName = await ExportErrorReportAsync(checkList).ConfigureAwait(false); - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "请下载错误信息", fileName = fileName }); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = fileName }); } #endregion diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs index e5fa9c11..f050dcd5 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs @@ -113,7 +113,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ } if (errors.Count() > 0) { - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "请下载错误信息", fileName = await ExportErrorReportAsync(errors) }); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = await ExportErrorReportAsync(errors) }); } } await _invMng.SetForwardState(p_invs, SettleBillState.财务已审核); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_BA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_BA_SERVICE.cs index 49cdd0f5..105083dc 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_BA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_BA_SERVICE.cs @@ -140,7 +140,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var errorList = await CheckInvoiceGenerationRules(entitys, priceList, inv.BusinessType); if (errorList.Count > 0) { - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "请下载错误信息", fileName = await ExportErrorReportAsync(errorList) }); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = await ExportErrorReportAsync(errorList) }); } // var dto1s = ObjectMapper.Map, List>(entitys); var q = from d in entitys @@ -264,7 +264,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var errorList = await CheckInvoiceGenerationRules(entitys, priceList, inv.BusinessType); if (errorList.Count > 0) { - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "请下载错误信息", fileName = await ExportErrorReportAsync(errorList) }); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = await ExportErrorReportAsync(errorList) }); } // var dto1s = ObjectMapper.Map, List>(entitys); var q = from d in entitys diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_CAN_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_CAN_SA_SERVICE.cs index 64f2a82a..05276240 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_CAN_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_CAN_SA_SERVICE.cs @@ -97,7 +97,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var errorList = await CheckInvoiceGenerationRules(entitys,main.Site,priceList, main.BusinessType);//校验生成规则 if (errorList.Count() > 0) { - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "请下载错误信息", fileName = await ExportErrorReportAsync(errorList) }); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = await ExportErrorReportAsync(errorList) }); } if (await _pubMng.SetForwardState(main, SettleBillState.已开票)) { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_NOT_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_NOT_SA_SERVICE.cs index b57ac692..17b2acb0 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_NOT_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_NOT_SA_SERVICE.cs @@ -61,7 +61,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { errorlist.Add(new ERR_EXP_DTO() { Message = itm }); } - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "请下载错误信息", fileName = await ExportErrorReportAsync(errorlist) }); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = await ExportErrorReportAsync(errorlist) }); } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs index 16c7c73f..dcaa113b 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs @@ -246,7 +246,7 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase if (checkList.Count > 0) { string fileName = await ExportErrorReportAsync(checkList).ConfigureAwait(false); - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "请下载错误信息", fileName = fileName }); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = fileName }); } #endregion @@ -283,7 +283,7 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase if (checkList.Count > 0) { string fileName = await ExportErrorReportAsync(checkList); - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "请下载错误信息", fileName = fileName }); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = fileName }); } #endregion @@ -313,7 +313,7 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase if (checkList.Count > 0) { string fileName = await ExportErrorReportAsync(checkList).ConfigureAwait(false); - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "请下载错误信息", fileName = fileName }); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = fileName }); } #endregion @@ -344,7 +344,7 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase if (checkList.Count > 0) { string fileName = await ExportErrorReportAsync(checkList).ConfigureAwait(false); - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "请下载错误信息", fileName = fileName }); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = fileName }); } #endregion diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PURCHASE_PRICE_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PURCHASE_PRICE_SERVICE.cs index 08ba22cb..c0076805 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PURCHASE_PRICE_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PURCHASE_PRICE_SERVICE.cs @@ -73,7 +73,7 @@ public class PURCHASE_PRICE_SERVICE : SettleAccountApplicationBase 0) { string fileName = await ExportErrorReportAsync(checkList); - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "请下载错误信息", fileName = fileName }); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = fileName }); } foreach (var itm in _ls) { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/TB_RePartsRelationship_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/TB_RePartsRelationship_SERVICE.cs index 01be258d..0fb06f74 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/TB_RePartsRelationship_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/TB_RePartsRelationship_SERVICE.cs @@ -91,7 +91,7 @@ public class TB_RePartsRelationship_SERVICE : SettleAccountApplicationBase 0) { string fileName = await ExportErrorReportAsync(checkList).ConfigureAwait(false); - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "请下载错误信息", fileName = fileName }); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = fileName }); } foreach (var itm in _ls) { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/MaterialRelationships/MaterialRelationshipAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/MaterialRelationships/MaterialRelationshipAppService.cs index a119cb87..ade23b7d 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/MaterialRelationships/MaterialRelationshipAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/MaterialRelationships/MaterialRelationshipAppService.cs @@ -75,7 +75,7 @@ public class MaterialRelationshipAppService : SettleAccountApplicationBase 0) { string fileName = await ExportErrorReportAsync(checkList).ConfigureAwait(false); - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "请下载错误信息", fileName = fileName }); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = fileName }); } foreach (var itm in _ls) {