From 14dee41d4c9011f404d859c6b4d031120d0c1e99 Mon Sep 17 00:00:00 2001 From: mahao Date: Tue, 12 Sep 2023 13:15:57 +0800 Subject: [PATCH 1/4] up --- .../Report/JisBBACSeEdiCompareExportService.cs | 3 +-- .../Report/JisHBPOSeEdiCompareExportService.cs | 3 +-- .../Services/Report/SeEdiCompareExportBaseService.cs | 11 ++++++++--- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSeEdiCompareExportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSeEdiCompareExportService.cs index 117bd11c..f447a674 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSeEdiCompareExportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSeEdiCompareExportService.cs @@ -52,12 +52,11 @@ namespace SettleAccount.Job.Services.Report var strSeStartDateTime = property.Where(p => p.Name == "SeStartDateTime").FirstOrDefault().Value; var strSeEndDateTime = property.Where(p => p.Name == "SeEndDateTime").FirstOrDefault().Value; - var businessTypeDisplayName = EnumBusinessType.JisBBAC.GetAttributeOfType()?.Name?? EnumBusinessType.JisBBAC.ToString(); var seStartDateTime = DateTime.Parse(strSeStartDateTime); var seEndDateTime = DateTime.Parse(strSeEndDateTime); var filename = exportName.FirstOrDefault(); - var excelExporter = GetSeEdiCompareData(seStartDateTime, seEndDateTime, businessTypeDisplayName); + var excelExporter = GetSeEdiCompareData(seStartDateTime, seEndDateTime, EnumBusinessType.JisBBAC); var result = excelExporter.ExportAppendDataAsByteArray(); result.ShouldNotBeNull(); _fileContainer.SaveAsync(filename, result.Result, true); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSeEdiCompareExportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSeEdiCompareExportService.cs index 830d0589..40741a08 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSeEdiCompareExportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSeEdiCompareExportService.cs @@ -49,12 +49,11 @@ namespace SettleAccount.Job.Services.Report var strSeStartDateTime = property.Where(p => p.Name == "SeStartDateTime").FirstOrDefault().Value; var strSeEndDateTime = property.Where(p => p.Name == "SeEndDateTime").FirstOrDefault().Value; - var businessTypeDisplayName = EnumBusinessType.JisHBPO.GetAttributeOfType()?.Name ?? EnumBusinessType.JisHBPO.ToString(); var seStartDateTime = DateTime.Parse(strSeStartDateTime); var seEndDateTime = DateTime.Parse(strSeEndDateTime); var filename = exportName.FirstOrDefault(); - var excelExporter = GetSeEdiCompareData(seStartDateTime, seEndDateTime, businessTypeDisplayName); + var excelExporter = GetSeEdiCompareData(seStartDateTime, seEndDateTime, EnumBusinessType.JisHBPO); var result = excelExporter.ExportAppendDataAsByteArray(); result.ShouldNotBeNull(); _fileContainer.SaveAsync(filename, result.Result, true); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SeEdiCompareExportBaseService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SeEdiCompareExportBaseService.cs index 51ca667c..47bc6d7c 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SeEdiCompareExportBaseService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SeEdiCompareExportBaseService.cs @@ -1,8 +1,10 @@ using System; +using System.ComponentModel.DataAnnotations; using System.Linq; using Magicodes.ExporterAndImporter.Core.Extension; using Magicodes.ExporterAndImporter.Excel; using Microsoft.AspNetCore.SignalR; +using Microsoft.OpenApi.Extensions; using SettleAccount.Bases; using SettleAccount.Domain.BQ; using SettleAccount.Job.SignalR; @@ -36,11 +38,12 @@ namespace SettleAccount.Job.Services.Report /// /// 获取发运、Eid比对数据 /// - public ExcelExporter GetSeEdiCompareData(DateTime seStartDateTime, DateTime seEndDateTime, string businessTypeDisplayName) + public ExcelExporter GetSeEdiCompareData(DateTime seStartDateTime, DateTime seEndDateTime, EnumBusinessType businessType) where TSe : JisSeBase where TEdi : SE_EDI where TCompareReport : SeEidCompareReport, new() { + var businessTypeDisplayName = businessType.GetAttributeOfType()?.Name ?? businessType.ToString(); // Sheet行数 var maxRowNumberOnASheet = AppConst.DefaultRowNumberOnASheet; var excelExporterAttribute = typeof(TCompareReport).GetAttribute(inherit: true); @@ -72,7 +75,9 @@ namespace SettleAccount.Job.Services.Report t.Remark = string.IsNullOrEmpty(t.SequenceNumber) ? "PJIS出单,AJIS未上" : ""; }); //无EDI有发运 - var notHaveEdiHaveSeList = _settleAccountDbContext.Set().Where(t => t.IsHaveEdiData == false) + var notHaveEdiHaveSeList = _settleAccountDbContext.Set() + .Where(t => t.BusinessType == businessType) + .Where(t => t.IsHaveEdiData == false) .GroupBy(t => new { t.PN, t.CustomerPartCodeNoSpace }) .Select(t => new TCompareReport() { @@ -107,7 +112,7 @@ namespace SettleAccount.Job.Services.Report LineStationCode = groupItem.Max(t => t.LineStationCode) }; var seGroup = from se in _settleAccountDbContext.Set() - where se.IsHaveEdiData == true && se.BillTime >= seStartDateTime && se.BillTime <= seEndDateTime + where se.BusinessType == businessType && se.IsHaveEdiData == true && se.BillTime >= seStartDateTime && se.BillTime <= seEndDateTime group se by new { se.PN, se.CustomerPartCodeNoSpace } into groupItem select new { From 1dbdb734c4db05df04e2a729fb65a82c705930c8 Mon Sep 17 00:00:00 2001 From: mahao Date: Tue, 12 Sep 2023 13:24:44 +0800 Subject: [PATCH 2/4] up --- .../Entities/BQ/PUB_SE_DETAIL_SERVICE.cs | 1 - .../src/SettleAccount.Domain/EnumBusinessType.cs | 8 -------- .../SettleAccount.Domain/Reports/SeEidCompareReport.cs | 8 +++++--- .../Services/Report/SeEdiCompareExportBaseService.cs | 3 --- 4 files changed, 5 insertions(+), 15 deletions(-) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SE_DETAIL_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SE_DETAIL_SERVICE.cs index da8c89b1..752f6c6d 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SE_DETAIL_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SE_DETAIL_SERVICE.cs @@ -114,7 +114,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ AssemblyDate = DateTime.Now, MatchNumber = i.ToString(), InjectionCode = i.ToString(), - MateType = "是", DiffDesc = "WMS有发货EDI有订单" }); } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/EnumBusinessType.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/EnumBusinessType.cs index 229d2368..c22b0088 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/EnumBusinessType.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/EnumBusinessType.cs @@ -12,49 +12,41 @@ public enum EnumBusinessType /// [Display(Name = "未定义")] None = 0, - /// /// JisBBAC /// [Display(Name = "JisBBAC")] JisBBAC = 1, - /// /// JisHBPO /// [Display(Name = "JisHBPO")] JisHBPO = 2, - /// /// 直供件BBAC /// [Display(Name = "直供件BBAC")] ZhiGongJianBBAC = 3, - /// /// 直供件HBPO /// [Display(Name = "直供件HBPO")] ZhiGongJianHBPO = 4, - /// /// 买单件BBAC /// [Display(Name = "买单件BBAC")] MaiDanJianBBAC = 5, - /// /// 买单件HBPO /// [Display(Name = "买单件HBPO")] MaiDanJianHBPO = 6, - /// /// 备件 /// [Display(Name = "备件")] BeiJian = 7, - /// /// 印度件 /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SeEidCompareReport.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SeEidCompareReport.cs index c1cac5c7..ca8bf756 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SeEidCompareReport.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SeEidCompareReport.cs @@ -136,11 +136,13 @@ public class SeEidCompareReport [ExporterHeader(DisplayName = "注塑码")] public string InjectionCode { get; set; } /// - /// 是否完全匹配 + /// 匹配类型 /// - [Display(Name = "是否完全匹配")] + [Display(Name = "匹配类型")] [ExporterHeader(DisplayName = "是否完全匹配")] - public string MateType { get; set; } + [ValueMapping("是", true)] + [ValueMapping("否", false)] + public bool MateType => DiffQty == 0m; /// /// 差异说明 /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SeEdiCompareExportBaseService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SeEdiCompareExportBaseService.cs index 47bc6d7c..f7c32932 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SeEdiCompareExportBaseService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SeEdiCompareExportBaseService.cs @@ -66,7 +66,6 @@ namespace SettleAccount.Job.Services.Report EdiQty = t.Sum(t => t.Qty), AssemblyDate = default, MatchNumber = default, - MateType = "否", DiffDesc = "WMS漏发货EDI有订单" }).ToList(); haveEdiNotHaveSeList.ForEach(t => @@ -94,7 +93,6 @@ namespace SettleAccount.Job.Services.Report MaterialDes = t.Max(t => t.PartDesc), SEQty = t.Sum(t => t.Qty), InjectionCode = t.Max(t => t.InjectionCode), - MateType = "否", DiffDesc = "WMS有发货EDI无订单" }).ToList(); //有EDI有发运 @@ -156,7 +154,6 @@ namespace SettleAccount.Job.Services.Report AssemblyDate = default, MatchNumber = default, InjectionCode = se.InjectionCode, - MateType = se.Qty == edi.Qty ? "是" : "否", DiffDesc = "WMS有发货EDI有订单" }).ToList(); haveEdiHaveSeList.ForEach(t => t.SequenceNumber = GetSequenceNumberDate(t.SequenceNumber)); From 133102709b0079d6708b76cfce20a569b5b6b42f Mon Sep 17 00:00:00 2001 From: mahao Date: Tue, 12 Sep 2023 13:33:13 +0800 Subject: [PATCH 3/4] up --- .../Entities/BQ/Syncs/JisBBACSeEdiCompareAppService.cs | 4 ++++ .../Entities/BQ/Syncs/JisHBPOSeEdiCompareAppService.cs | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeEdiCompareAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeEdiCompareAppService.cs index d903dcef..ede1116f 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeEdiCompareAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeEdiCompareAppService.cs @@ -18,10 +18,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs; public class JisBBACSeEdiCompareAppService : ApplicationService, IInvocable { private readonly IServiceProvider _serviceProvider; + private readonly EnumBusinessType _businessType; public JisBBACSeEdiCompareAppService(IServiceProvider serviceProvider) { _serviceProvider = serviceProvider; + _businessType = EnumBusinessType.JisBBAC; } /// @@ -35,6 +37,7 @@ public class JisBBACSeEdiCompareAppService : ApplicationService, IInvocable await HandDelEdiDataAsync().ConfigureAwait(false); var seDetailGroup = db.Set() + .Where(t => t.BusinessType == _businessType) .Where(t => t.IsHaveEdiData == false) .GroupBy(t => new { t.PN, t.CustomerPartCodeNoSpace }) .Select(t => t.Key); @@ -53,6 +56,7 @@ public class JisBBACSeEdiCompareAppService : ApplicationService, IInvocable var pns = keyCodes.Select(t => t.PN).Distinct().ToList(); var seDetails = db.Set() + .Where(t => t.BusinessType == _businessType) .Where(t => t.IsHaveEdiData == false) .Where(t => pns.Contains(t.PN)) .AsEnumerable() diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeEdiCompareAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeEdiCompareAppService.cs index 5e0a8191..993ba794 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeEdiCompareAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeEdiCompareAppService.cs @@ -19,10 +19,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs; public class JisHBPOSeEdiCompareAppService : ApplicationService, IInvocable { private readonly IServiceProvider _serviceProvider; + private readonly EnumBusinessType _businessType; public JisHBPOSeEdiCompareAppService(IServiceProvider serviceProvider) { _serviceProvider = serviceProvider; + _businessType = EnumBusinessType.JisHBPO; } /// @@ -36,6 +38,7 @@ public class JisHBPOSeEdiCompareAppService : ApplicationService, IInvocable await HandDelEdiDataAsync().ConfigureAwait(false); var seDetailGroup = db.Set() + .Where(t => t.BusinessType == _businessType) .Where(t => t.IsHaveEdiData == false) .GroupBy(t => new { t.PN, t.CustomerPartCodeNoSpace }) .Select(t => t.Key); @@ -54,6 +57,7 @@ public class JisHBPOSeEdiCompareAppService : ApplicationService, IInvocable var pns = keyCodes.Select(t => t.PN).Distinct().ToList(); var seDetails = db.Set() + .Where(t => t.BusinessType == _businessType) .Where(t => t.IsHaveEdiData == false) .Where(t => pns.Contains(t.PN)) .AsEnumerable() From a36f813cf07ff4cf5111408324bc76b9098931c2 Mon Sep 17 00:00:00 2001 From: wanggang <76527413@qq.com> Date: Tue, 12 Sep 2023 13:56:51 +0800 Subject: [PATCH 4/4] update --- .../wwwroot/components/table/index.js | 2 +- .../wwwroot/views/settle/_check.js | 240 +++++++++--------- 2 files changed, 124 insertions(+), 118 deletions(-) diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/table/index.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/table/index.js index b3d816e9..600f5437 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/table/index.js +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/table/index.js @@ -39,7 +39,7 @@ export default {
- +
diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/_check.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/_check.js index 0f1c39b9..6949efe6 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/_check.js +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/_check.js @@ -8,6 +8,7 @@ import extraProperties from "../../models/_extraProperties.js"; import { getUrl } from "../../request/index.js"; import businessTypes from "../../models/_options.js"; import { required, trim } from "../../utils/validation.js"; +import { delay } from "../../utils/index.js"; export default { components: { AppForm, AppTable }, @@ -51,6 +52,7 @@ export default { 报废重开 + 报废重开 @@ -62,78 +64,80 @@ export default { -
- - - 新建 - 导入 - 删除 - - - - - - +
+
+ + + 新建 + 导入 + 删除 - -
-
- - - - - - - - - - - - -
-
- - - - - - - - - -
-
- - - - - - - - - + + + + + + + +
+
+ + + + + + + + + + + + +
+
+ + + + + + + + + +
+
+ + + + + + + + + +
@@ -155,7 +159,7 @@ export default { - + @@ -581,62 +585,64 @@ export default { } else { service = "pub_ba_service"; } - if (setupRef.value === 1) { - try { - // setupRef.value += 1; - // return; //临时 - //发到服务的校验 - const result = await request(`settleaccount/${service}/reissue-invoice-list`, adjList.value, { method: "POST" }); + try { + loading.value = true; + if (setupRef.value === 1) { + try { + // setupRef.value += 1; + // return; //临时 + //发到服务的校验 + const result = await request(`settleaccount/${service}/reissue-invoice-list`, adjList.value, { method: "POST" }); + if (!result.errors) { + adjList2.value = result.data.data; + setupRef.value += 1; + //处理高亮 + nextTick(() => { + const list1 = setup2table1Ref.value.tableRef.querySelectorAll(".row.data"); + const list2 = setup2table2Ref.value.tableRef.querySelectorAll(".row.data"); + list1.forEach((o) => { + addDiff(o, list2, ".qty"); + addDiff(o, list2, ".amt"); + }); + list2.forEach((o) => { + addDiff(o, list1, ".qty"); + addDiff(o, list1, ".amt"); + }); + }); + } else if (result.data?.code === 400 && result.data.fileName) { + window.open(getUrl(`settleaccount/getblobfile/download/${result.data.fileName}`)); + } + } catch (e) { + console.log(e); + } + } else if (setupRef.value === 2) { + const url = `settleaccount/${service}/reissue-invoice-list-ext`; + const result = await request(url, adjList.value, { method: "POST" }); if (!result.errors) { - adjList2.value = result.data.data; + //setup3的数据来源 + setup3Model.value = result.data.data; setupRef.value += 1; - //处理高亮 - nextTick(() => { - const list1 = setup2table1Ref.value.tableRef.querySelectorAll(".row.data"); - const list2 = setup2table2Ref.value.tableRef.querySelectorAll(".row.data"); - list1.forEach((o) => { - addDiff(o, list2, ".qty"); - addDiff(o, list2, ".amt"); - }); - list2.forEach((o) => { - addDiff(o, list1, ".qty"); - addDiff(o, list1, ".amt"); - }); - }); - } else if (result.data?.code === 400) { - // ElMessage({ - // type: "error", - // message: "操作失败", - // }); + } else if (result.data?.code === 400 && result.data.fileName) { window.open(getUrl(`settleaccount/getblobfile/download/${result.data.fileName}`)); } - } catch (e) { - console.log(e); - } - } else if (setupRef.value === 2) { - const url = `settleaccount/${service}/reissue-invoice-list-ext`; - const result = await request(url, adjList.value, { method: "POST" }); - if (!result.errors) { - //setup3的数据来源 - setup3Model.value = result.data.data; - setupRef.value += 1; - } else if (result.data?.code === 400 && result.data.fileName) { - window.open(getUrl(`settleaccount/getblobfile/download/${result.data.fileName}`)); - } - } else if (setupRef.value === 3) { - const url = `settleaccount/${service}/reissue-invoice-extend`; - const result = await request(url, adjList.value, { method: "POST" }); - if (!result.errors) { - setupRef.value += 1; - } else if (result.data?.code === 400 && result.data.fileName) { - window.open(getUrl(`settleaccount/getblobfile/download/${result.data.fileName}`)); + } else if (setupRef.value === 3) { + const url = `settleaccount/${service}/reissue-invoice-extend`; + const result = await request(url, adjList.value, { method: "POST" }); + if (!result.errors) { + setupRef.value += 1; + } else if (result.data?.code === 400 && result.data.fileName) { + window.open(getUrl(`settleaccount/getblobfile/download/${result.data.fileName}`)); + } + } else if (setupRef.value === 4) { + setupDialogVisable.value = false; + refreshRef.value = false; + nextTick(() => { + refreshRef.value = true; + }); } - } else if (setupRef.value === 4) { - setupDialogVisable.value = false; - refreshRef.value = false; - nextTick(() => { - refreshRef.value = true; - }); + } finally { + await delay(5000); + loading.value = false; } }; const drawerClosed = () => {