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 d0d518c0..b3d816e9 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 @@ -1,5 +1,6 @@ import html from "html"; import { reactive, ref } from "vue"; +import { dayjs } from "element-plus"; export default { template: html`
@@ -37,7 +38,10 @@ export default {
-
{{row[key]}}
+
+ + +
@@ -96,6 +100,7 @@ export default { checkAllClick, getSelection, clearSelection, + dayjs, }; }, }; diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/business.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/business.js index 3716de54..756e0271 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/business.js +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/business.js @@ -107,11 +107,11 @@ function createCommerceCheckList(path, business, client, title = "商务审批") "title=客户已收票&isTop=true", (_, q) => q.filters.some((o) => o.column === "state" && o.value === 3) && q.filters.some((o) => o.column === "invoiceState" && o.value === 1) ), - createButton( - "bao-fei", - "title=报废&isTop=true", - (_, q) => q.filters.some((o) => o.column === "state" && (o.value === 3 || o.value === 4)) && q.filters.some((o) => o.column === "invoiceState" && o.value === 1) - ), + // createButton( + // "bao-fei", + // "title=报废&isTop=true", + // (_, q) => q.filters.some((o) => o.column === "state" && (o.value === 3 || o.value === 4)) && q.filters.some((o) => o.column === "invoiceState" && o.value === 1) + // ), ], }; } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SA_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SA_DTO.cs index c6c838b2..fd220de2 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SA_DTO.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SA_DTO.cs @@ -103,7 +103,7 @@ public class BBAC_SA_DETAIL_DTO : AuditedAggregateRoot /// /// BBAC结算导入请求 /// -public class BBACSaImportRequestDto //: IValidatableObject +public class BBACSaImportRequestDto { /// /// 文件 @@ -119,42 +119,7 @@ public class BBACSaImportRequestDto //: IValidatableObject /// [Display(Name = "地点")] [Required(ErrorMessage = "{0}必须填写")] - //[ValidateSite(Sites = new string[] { "1040", "1046" }, ErrorMessage = "{0}值无效")] public string Site { get; set; } - - //public IEnumerable Validate(ValidationContext validationContext) - //{ - // if (Site != "1040" && Site != "1046") - // { - // yield return new ValidationResult( - // $"地点值无效", - // new[] { nameof(Site) }); - // } - //} -} - -public class ValidateSiteAttribute : ValidationAttribute -{ - public ValidateSiteAttribute() - { - } - - public string[] Sites { get; set; } - - protected override ValidationResult IsValid(object value, ValidationContext validationContext) - { - if (!Sites.Contains(value)) - { - return new ValidationResult(FormatErrorMessage(validationContext.DisplayName)); - } - return ValidationResult.Success; - } - - //public override bool IsValid(object value) - //{ - // return AllowEmptyStrings || value is not string stringValue || !string.IsNullOrWhiteSpace(stringValue); - // return base.IsValid(value); - //} } /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs index 1daff631..499503c1 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs @@ -37,7 +37,6 @@ using Volo.Abp.Users; using Volo.Abp.Validation; using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.SettleAccount.Entities.BQ.Dtos; -using Win.Sfs.SettleAccount.Entities.BQ.Syncs; using Win.Sfs.SettleAccount.Entities.BQ.Vmi; using Win.Sfs.Shared; using Win.Sfs.Shared.Filter; @@ -86,11 +85,11 @@ public class VmiAppService : Controller, IApplicationService, IJobService, ITran /// Excel 转 JSON /// [HttpPost, Consumes("multipart/form-data")] - public async Task> ExcelToJSONAsync(List files) + public async Task> ExcelToJSONAsync(List files) { using var ms = new MemoryStream(); await files.FirstOrDefault().OpenReadStream().CopyToAsync(ms).ConfigureAwait(false); - return this.ImportInternal(ms.ToArray()).Select(o => o.Item1).ToList(); + return this.ImportInternal(ms.ToArray()).Select(o => o.Item1).ToList(); } /// @@ -193,7 +192,7 @@ public class VmiAppService : Controller, IApplicationService, IJobService, ITran query = query.Where(input.Filters.ToLambda()); } query = string.IsNullOrEmpty(input.Sorting) ? query : DynamicQueryableExtensions.OrderBy(query, input.Sorting); - var query2 = query.GroupBy(o => new { o.ErpToLoc, o.RealPartCode }).Select(o => new VmiBalanceSumDto { ErpToLoc = o.Key.ErpToLoc,RealPartCode = o.Key.RealPartCode, Qty = o.Sum(o => o.Qty) }); + var query2 = query.GroupBy(o => new { o.ErpToLoc, o.RealPartCode }).Select(o => new VmiBalanceSumDto { ErpToLoc = o.Key.ErpToLoc, RealPartCode = o.Key.RealPartCode, Qty = o.Sum(o => o.Qty) }); var totalCount = query2.Count(); var entities = await query2.PageBy(input.SkipCount, input.MaxResultCount).ToListAsync().ConfigureAwait(false); return new PagedResultDto(totalCount, entities); @@ -506,7 +505,7 @@ public class VmiAppService : Controller, IApplicationService, IJobService, ITran { var row = ws.Row(rowIndex); var model = Activator.CreateInstance(); - for (var columnIndex = 1; columnIndex < columnsUsedCount; columnIndex++) + for (var columnIndex = 1; columnIndex < columnsUsedCount + 1; columnIndex++) { var cell = row.Cell(columnIndex); var headerName = ws.Cell(1, columnIndex).Value.ToString().Trim(); @@ -656,6 +655,7 @@ public class VmiBalanceSumDto { [Display(Name = "ERP库位", Order = 13)] public string ErpToLoc { get; set; } + [Display(Name = "厂内零件号", Order = 6)] public string RealPartCode { get; set; }//原始 diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs index c297c05b..4403ccc7 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs @@ -149,7 +149,7 @@ public class PriceListAppService : SettleAccountApplicationBase /// private List CheckPriceListContinuity(List priceList) { - var pricelist = new List(); + var result = new List(); if (priceList.Count <= 1) { return priceList; // 只有一个或零个价格条目 @@ -167,11 +167,11 @@ public class PriceListAppService : SettleAccountApplicationBase { if (sortedList[i].LU == sortedList[i - 1].LU && sortedList[i].BeginTime != sortedList[i - 1].EndTime.AddDays(1)) { - pricelist.Add(sortedList[i]); + result.Add(sortedList[i]); } } } - return pricelist; // 所有价格时间都连续 + return result; // 所有价格时间都连续 } /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs index e593dd1d..f78edce6 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs @@ -133,7 +133,7 @@ public class PriceListAppServiceBJ : SettleAccountApplicationBase /// private List CheckPriceListContinuity(List priceList) { - var pricelist = new List(); + var result = new List(); if (priceList.Count <= 1) { return priceList; // 只有一个或零个价格条目 @@ -151,12 +151,12 @@ public class PriceListAppServiceBJ : SettleAccountApplicationBase { if (sortedList[i].LU == sortedList[i - 1].LU && sortedList[i].BeginDate != sortedList[i - 1].EndDate.AddDays(1)) { - pricelist.Add(sortedList[i]); + result.Add(sortedList[i]); } } } - return pricelist; // 所有价格时间都连续 + return result; } /// 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 c36a68a9..117bd11c 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 @@ -3,8 +3,6 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Linq.Dynamic.Core; -using Magicodes.ExporterAndImporter.Core.Extension; -using Magicodes.ExporterAndImporter.Excel; using Microsoft.AspNetCore.SignalR; using Microsoft.OpenApi.Extensions; using SettleAccount.Domain.BQ; @@ -17,7 +15,6 @@ using Volo.Abp.DependencyInjection; using Volo.Abp.ObjectMapping; using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.SettleAccount; -using Win.Sfs.SettleAccount.Consts; using Win.Sfs.SettleAccount.Reports; namespace SettleAccount.Job.Services.Report diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/PubSaSeCompareExportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/PubSaSeCompareExportService.cs index 5d26eb4c..23069cb1 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/PubSaSeCompareExportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/PubSaSeCompareExportService.cs @@ -1,15 +1,12 @@ using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using System.Drawing; using System.Linq; using Magicodes.ExporterAndImporter.Excel; using Microsoft.AspNetCore.SignalR; using Microsoft.OpenApi.Extensions; -using SettleAccount.Bases; using SettleAccount.Domain.BQ; using SettleAccount.Job.SignalR; -using ShardingCore.Extensions; using Shouldly; using TaskJob.EventArgs; using TaskJob.Interfaces; @@ -19,8 +16,8 @@ using Volo.Abp.ObjectMapping; using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.SettleAccount; using Win.Sfs.SettleAccount.Entities.BQ; +using Win.Sfs.SettleAccount.Enums; using Win.Sfs.SettleAccount.Reports; -using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report; using Win.Sfs.Shared.RepositoryBase; namespace SettleAccount.Job.Services.Report @@ -174,7 +171,7 @@ namespace SettleAccount.Job.Services.Report } //结算 var saGroup = from sa in _settleAccountDbContext.Set() - where sa.BusinessType == businessType + where sa.BusinessType == businessType && sa.MappingType == EnumMappingType.None group sa by new { sa.PN, sa.CustomerPartCodeNoSpace } into groupItem select new { @@ -201,6 +198,7 @@ namespace SettleAccount.Job.Services.Report }; //发运 var seGroup = from se in _settleAccountDbContext.Set() + where se.BusinessType == businessType group se by new { se.PN, se.CustomerPartCodeNoSpace } into groupItem select new { @@ -278,12 +276,13 @@ namespace SettleAccount.Job.Services.Report /// /// 获取比对数据 + /// 印度件根据客户零件号对比 /// private List GetSaSeCompareDataYinDu(int version) { //结算 var saGroup = from sa in _settleAccountDbContext.Set() - where sa.BusinessType == EnumBusinessType.YinDuJian + where sa.BusinessType == EnumBusinessType.YinDuJian && sa.MappingType == EnumMappingType.None group sa by new { sa.CustomerPartCodeNoSpace } into groupItem select new { @@ -308,6 +307,7 @@ namespace SettleAccount.Job.Services.Report }; //发运 var seGroup = from se in _settleAccountDbContext.Set() + where se.BusinessType == EnumBusinessType.YinDuJian group se by new { se.CustomerPartCodeNoSpace } into groupItem select new { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeCompareExportBaseService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeCompareExportBaseService.cs index 7e660bcc..7ffdf9b5 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeCompareExportBaseService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeCompareExportBaseService.cs @@ -5,6 +5,7 @@ using EFCore.BulkExtensions; using Magicodes.ExporterAndImporter.Core.Extension; using Magicodes.ExporterAndImporter.Excel; using Microsoft.AspNetCore.SignalR; +using Microsoft.CodeAnalysis.CSharp.Syntax; using SettleAccount.Bases; using SettleAccount.Domain.BQ; using SettleAccount.Job.SignalR; @@ -44,7 +45,7 @@ namespace SettleAccount.Job.Services.Report { //结算 var saGroup = from sa in _settleAccountDbContext.Set() - where sa.BusinessType == businessType + where sa.BusinessType == businessType && sa.MappingType == EnumMappingType.None group sa by new { sa.PN, sa.CustomerPartCodeNoSpace } into groupItem select new { @@ -71,6 +72,7 @@ namespace SettleAccount.Job.Services.Report }; //发运 var seGroup = from se in _settleAccountDbContext.Set() + where se.BusinessType == businessType group se by new { se.PN, se.CustomerPartCodeNoSpace } into groupItem select new { @@ -211,32 +213,64 @@ namespace SettleAccount.Job.Services.Report }); }); - //获取二次比对上的数据 - secondMatchHaveSaHaveSes = (from notHaveSaHaveSe in notHaveSaHaveSes - join haveSaNotHaveSe in haveSaNotHaveSes - on new { notHaveSaHaveSe.PN, notHaveSaHaveSe.ReplaceFactoryPartCode } equals new { haveSaNotHaveSe.PN, haveSaNotHaveSe.ReplaceFactoryPartCode } - select new SaSeCompareDiff() - { - WmsBillNum = notHaveSaHaveSe.WmsBillNum, - ShippingDate = notHaveSaHaveSe.ShippingDate, - SeqNumber = notHaveSaHaveSe.SeqNumber, - PJISSeqNumber = notHaveSaHaveSe.PJISSeqNumber, - CustomerOfflineTime = haveSaNotHaveSe.CustomerOfflineTime, - SAQty = haveSaNotHaveSe.SAQty, - SEQty = notHaveSaHaveSe.SEQty, - PN = haveSaNotHaveSe.PN, - ToLocCode = notHaveSaHaveSe.ToLocCode, - ToErpLocCode = notHaveSaHaveSe.ToErpLocCode, - Category = EnumPubSaSeCompareCategory.HaveSaHaveSe, - SeCustomerPartCode = notHaveSaHaveSe.SeCustomerPartCode, - SeFactoryPartCode = notHaveSaHaveSe.SeFactoryPartCode, - SaCustomerPartCode = haveSaNotHaveSe.SaCustomerPartCode, - SaFactoryPartCode = haveSaNotHaveSe.SaFactoryPartCode, - CustomerPartCode = haveSaNotHaveSe.CustomerPartCode, - PartCodeDesc = haveSaNotHaveSe.PartCodeDesc, - FactoryPartCode = haveSaNotHaveSe.FactoryPartCode, - ReplaceFactoryPartCode = haveSaNotHaveSe.ReplaceFactoryPartCode - }).ToList(); + if (businessType != EnumBusinessType.YinDuJian) + { + //获取二次比对上的数据 + secondMatchHaveSaHaveSes = (from notHaveSaHaveSe in notHaveSaHaveSes + join haveSaNotHaveSe in haveSaNotHaveSes + on new { notHaveSaHaveSe.PN, notHaveSaHaveSe.ReplaceFactoryPartCode } equals new { haveSaNotHaveSe.PN, haveSaNotHaveSe.ReplaceFactoryPartCode } + select new SaSeCompareDiff() + { + WmsBillNum = notHaveSaHaveSe.WmsBillNum, + ShippingDate = notHaveSaHaveSe.ShippingDate, + SeqNumber = notHaveSaHaveSe.SeqNumber, + PJISSeqNumber = notHaveSaHaveSe.PJISSeqNumber, + CustomerOfflineTime = haveSaNotHaveSe.CustomerOfflineTime, + SAQty = haveSaNotHaveSe.SAQty, + SEQty = notHaveSaHaveSe.SEQty, + PN = haveSaNotHaveSe.PN, + ToLocCode = notHaveSaHaveSe.ToLocCode, + ToErpLocCode = notHaveSaHaveSe.ToErpLocCode, + Category = EnumPubSaSeCompareCategory.HaveSaHaveSe, + SeCustomerPartCode = notHaveSaHaveSe.SeCustomerPartCode, + SeFactoryPartCode = notHaveSaHaveSe.SeFactoryPartCode, + SaCustomerPartCode = haveSaNotHaveSe.SaCustomerPartCode, + SaFactoryPartCode = haveSaNotHaveSe.SaFactoryPartCode, + CustomerPartCode = haveSaNotHaveSe.CustomerPartCode, + PartCodeDesc = haveSaNotHaveSe.PartCodeDesc, + FactoryPartCode = haveSaNotHaveSe.FactoryPartCode, + ReplaceFactoryPartCode = haveSaNotHaveSe.ReplaceFactoryPartCode + }).ToList(); + } + else + { + //获取二次比对上的数据 + secondMatchHaveSaHaveSes = (from notHaveSaHaveSe in notHaveSaHaveSes + join haveSaNotHaveSe in haveSaNotHaveSes + on new { notHaveSaHaveSe.ReplaceFactoryPartCode } equals new { haveSaNotHaveSe.ReplaceFactoryPartCode } + select new SaSeCompareDiff() + { + WmsBillNum = notHaveSaHaveSe.WmsBillNum, + ShippingDate = notHaveSaHaveSe.ShippingDate, + SeqNumber = notHaveSaHaveSe.SeqNumber, + PJISSeqNumber = notHaveSaHaveSe.PJISSeqNumber, + CustomerOfflineTime = haveSaNotHaveSe.CustomerOfflineTime, + SAQty = haveSaNotHaveSe.SAQty, + SEQty = notHaveSaHaveSe.SEQty, + PN = haveSaNotHaveSe.PN, + ToLocCode = notHaveSaHaveSe.ToLocCode, + ToErpLocCode = notHaveSaHaveSe.ToErpLocCode, + Category = EnumPubSaSeCompareCategory.HaveSaHaveSe, + SeCustomerPartCode = notHaveSaHaveSe.SeCustomerPartCode, + SeFactoryPartCode = notHaveSaHaveSe.SeFactoryPartCode, + SaCustomerPartCode = haveSaNotHaveSe.SaCustomerPartCode, + SaFactoryPartCode = haveSaNotHaveSe.SaFactoryPartCode, + CustomerPartCode = haveSaNotHaveSe.CustomerPartCode, + PartCodeDesc = haveSaNotHaveSe.PartCodeDesc, + FactoryPartCode = haveSaNotHaveSe.FactoryPartCode, + ReplaceFactoryPartCode = haveSaNotHaveSe.ReplaceFactoryPartCode + }).ToList(); + } return secondMatchHaveSaHaveSes; }