From a29d747b259ffbff2560324611926a892aafb001 Mon Sep 17 00:00:00 2001 From: me Date: Tue, 5 Aug 2025 17:43:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8C=89=E8=AE=A1=E5=88=92=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MenBanReports/MenBanPrintInputDto.cs | 2 +- .../MsgBaseData/Dics/Dtos/DicItemDto.cs | 46 + .../MsgCheck/BillM100s/Dtos/BillM100Dto.cs | 51 +- .../BillM100s/Dtos/BillM100PartDto.cs | 26 + .../MsgCheck/BillM110s/Dtos/BillM110Dto.cs | 26 + .../BillM110s/Dtos/BillM110PartDto.cs | 28 + .../Interfaces/IBillM110AppService.cs | 6 +- .../WY.NewJit.Application.Contracts.xml | 116 ++- .../MsgBaseData/Dics/DicAppService.cs | 14 +- .../MsgCheck/BillM100s/BillM100AppService.cs | 485 ++++++---- .../MsgCheck/BillM110s/BillM110AppService.cs | 860 +++++++++--------- .../WY.NewJit.Application.xml | 49 +- .../Common/ObjectResultDto.cs | 6 - .../MsgCheck/BillStatusEnum.cs | 6 +- .../MsgBaseData/Entitys/DicItem.cs | 24 +- .../Services/LineSNDomianService.cs | 4 +- .../Win.Sfs.Shared.AssemblyInfo.cs | 2 +- .../Win.Sfs.Shared.AssemblyInfoInputs.cache | 2 +- .../netcoreapp5/Win.Utils.AssemblyInfo.cs | 2 +- .../Win.Utils.AssemblyInfoInputs.cache | 2 +- 20 files changed, 1088 insertions(+), 669 deletions(-) diff --git a/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/Extends/MenBanReports/MenBanPrintInputDto.cs b/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/Extends/MenBanReports/MenBanPrintInputDto.cs index 52e931e..44a433d 100644 --- a/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/Extends/MenBanReports/MenBanPrintInputDto.cs +++ b/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/Extends/MenBanReports/MenBanPrintInputDto.cs @@ -37,7 +37,7 @@ namespace WY.NewJit.Extends /// /// 补打时使用 /// - public virtual List M100IdList { get; set; } + //public virtual List M100IdList { get; set; } #endregion } diff --git a/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgBaseData/Dics/Dtos/DicItemDto.cs b/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgBaseData/Dics/Dtos/DicItemDto.cs index 00c8ae9..f8a01c9 100644 --- a/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgBaseData/Dics/Dtos/DicItemDto.cs +++ b/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgBaseData/Dics/Dtos/DicItemDto.cs @@ -27,5 +27,51 @@ namespace WY.NewJit.MsgBaseData /// 字典项名称 /// public string DicItemName { get; set; } + + /// + /// 分类1(零件大类对应分组) + /// + public virtual string DicItemSort1 { get; set; } + + /// + /// 分类2 (零件大类对应产线) + /// + public virtual string DicItemSort2 { get; set; } + + /// + /// 分类3(零件大类对应车型) + /// + public virtual string DicItemSort3 { get; set; } + + /// + /// 分类4(零件大类对应打印报表的三位零件大类) + /// + public virtual string DicItemSort4 { get; set; } + + /// + /// 分类5 (零件大类对应客户零件号) + /// + public virtual string DicItemSort5 { get; set; } + + /// + /// 分类6(零件大类对应显示车型) + /// + public virtual string DicItemSort6 { get; set; } + + /// + /// 分类7(零件大类对应报表字段显示顺序) + /// + public virtual string DicItemSort7 { get; set; } + + /// + /// 分类8(零件大类对应装箱清单号的前缀,例如C或T) + /// + public virtual string DicItemSort8 { get; set; } + + /// + /// 分类9(零件大类对应 打印标准数量 12 或 24) + /// + public virtual string DicItemSort9 { get; set; } + } } diff --git a/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgCheck/BillM100s/Dtos/BillM100Dto.cs b/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgCheck/BillM100s/Dtos/BillM100Dto.cs index eab856e..348cf10 100644 --- a/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgCheck/BillM100s/Dtos/BillM100Dto.cs +++ b/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgCheck/BillM100s/Dtos/BillM100Dto.cs @@ -45,14 +45,14 @@ namespace WY.NewJit.MsgCheck /// /// 总成ID /// - [ExporterHeader(DisplayName = "总成ID")] - [ImporterHeader(Name = "总成ID")] + [ExporterHeader(IsIgnore =true)] + [ImporterHeader(IsIgnore = true)] public Guid? AssemblyID { get; set; } /// /// 上线时间 /// - [ExporterHeader(DisplayName = "上线时间")] + [ExporterHeader(DisplayName = "上线时间", Format ="yyyy-MM-dd HH:mm")] [ImporterHeader(Name = "上线时间")] public DateTime? OnlineTime { get; set; } @@ -73,14 +73,14 @@ namespace WY.NewJit.MsgCheck /// /// 版本 /// - [ExporterHeader(DisplayName = "版本")] - [ImporterHeader(Name = "版本")] + [ExporterHeader(IsIgnore = true)] + [ImporterHeader(IsIgnore = true)] public string Version { get; set; } /// /// 接收时间 /// - [ExporterHeader(DisplayName = "接收时间")] + [ExporterHeader(DisplayName = "接收时间", Format = "yyyy-MM-dd HH:mm")] [ImporterHeader(Name = "接收时间")] public DateTime? ReceiveTime { get; set; } @@ -101,28 +101,55 @@ namespace WY.NewJit.MsgCheck /// /// 涂装重复单据包含的零件列表 /// + [ExporterHeader(IsIgnore = true)] + [ImporterHeader(IsIgnore = true)] public List BillM100Parts { get; set; } /// /// 手工操作类型:0 none,1 手工添加,2 手工修改 /// - [ExporterHeader(DisplayName = "手工操作类型")] - [ImporterHeader(Name = "手工操作类型")] + [ExporterHeader(IsIgnore = true)] + [ImporterHeader(IsIgnore = true)] public ManualOperationTypeEnum OperationType { get; set; } /// /// 手工操作员 /// - [ExporterHeader(DisplayName = "手工操作员")] - [ImporterHeader(Name = "手工操作员")] + [ExporterHeader(IsIgnore = true)] + [ImporterHeader(IsIgnore = true)] public string Operator { get; set; } /// /// 手工操作日期 /// - [ExporterHeader(DisplayName = "手工操作日期")] - [ImporterHeader(Name = "手工操作日期")] + [ExporterHeader(IsIgnore = true)] + [ImporterHeader(IsIgnore = true)] public DateTime? OperationTime { get; set; } + [ExporterHeader(DisplayName = "零件1")] + [ImporterHeader(Name = "零件1")] + public string PartCode1 { get; set; } + + [ExporterHeader(DisplayName = "零件2")] + [ImporterHeader(Name = "零件2")] + public string PartCode2 { get; set; } + + [ExporterHeader(DisplayName = "零件3")] + [ImporterHeader(Name = "零件3")] + public string PartCode3 { get; set; } + + [ExporterHeader(DisplayName = "零件4")] + [ImporterHeader(Name = "零件4")] + public string PartCode4 { get; set; } + + [ExporterHeader(DisplayName = "零件5")] + [ImporterHeader(Name = "零件5")] + public string PartCode5 { get; set; } + + [ExporterHeader(DisplayName = "零件6")] + [ImporterHeader(Name = "零件6")] + public string PartCode6 { get; set; } + + } } diff --git a/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgCheck/BillM100s/Dtos/BillM100PartDto.cs b/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgCheck/BillM100s/Dtos/BillM100PartDto.cs index 52f9451..f136eb5 100644 --- a/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgCheck/BillM100s/Dtos/BillM100PartDto.cs +++ b/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgCheck/BillM100s/Dtos/BillM100PartDto.cs @@ -34,5 +34,31 @@ namespace WY.NewJit.MsgCheck [ExporterHeader(DisplayName = "描述")] [ImporterHeader(Name = "描述")] public string Description { get; set; } + + /// + /// 零件类型:产线 + /// + public virtual string PartType { get; set; } + + /// + /// 零件类型:分组 + /// + public virtual string PartType2 { get; set; } + + /// + /// 零件类型:零件大类 + /// + public virtual string PartType3 { get; set; } + + /// + /// 零件在主表横向排列顺序 + /// + public int? DisplaySN { get; set; } + + /// + /// 零件在主表横向排列显示的列名 + /// + public string DisplayColumnName { get; set; } + } } diff --git a/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgCheck/BillM110s/Dtos/BillM110Dto.cs b/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgCheck/BillM110s/Dtos/BillM110Dto.cs index fdb57c9..cdabb63 100644 --- a/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgCheck/BillM110s/Dtos/BillM110Dto.cs +++ b/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgCheck/BillM110s/Dtos/BillM110Dto.cs @@ -124,5 +124,31 @@ namespace WY.NewJit.MsgCheck [ImporterHeader(Name = "手工操作日期")] public DateTime? OperationTime { get; set; } + #region 横向显示零件 + [ExporterHeader(DisplayName = "零件1")] + [ImporterHeader(Name = "零件1")] + public string PartCode1 { get; set; } + + [ExporterHeader(DisplayName = "零件2")] + [ImporterHeader(Name = "零件2")] + public string PartCode2 { get; set; } + + [ExporterHeader(DisplayName = "零件3")] + [ImporterHeader(Name = "零件3")] + public string PartCode3 { get; set; } + + [ExporterHeader(DisplayName = "零件4")] + [ImporterHeader(Name = "零件4")] + public string PartCode4 { get; set; } + + [ExporterHeader(DisplayName = "零件5")] + [ImporterHeader(Name = "零件5")] + public string PartCode5 { get; set; } + + [ExporterHeader(DisplayName = "零件6")] + [ImporterHeader(Name = "零件6")] + public string PartCode6 { get; set; } + + #endregion } } diff --git a/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgCheck/BillM110s/Dtos/BillM110PartDto.cs b/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgCheck/BillM110s/Dtos/BillM110PartDto.cs index 8b788ff..2f045b5 100644 --- a/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgCheck/BillM110s/Dtos/BillM110PartDto.cs +++ b/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgCheck/BillM110s/Dtos/BillM110PartDto.cs @@ -34,5 +34,33 @@ namespace WY.NewJit.MsgCheck [ExporterHeader(DisplayName = "描述")] [ImporterHeader(Name = "描述")] public string Description { get; set; } + + #region 新增 + /// + /// 零件类型:产线 + /// + public virtual string PartType { get; set; } + + /// + /// 零件类型:分组 + /// + public virtual string PartType2 { get; set; } + + /// + /// 零件类型:零件大类 + /// + public virtual string PartType3 { get; set; } + + /// + /// 零件在主表横向排列顺序 + /// + public int? DisplaySN { get; set; } + + /// + /// 零件在主表横向排列显示的列名 + /// + public string DisplayColumnName { get; set; } + + #endregion } } diff --git a/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgCheck/BillM110s/Interfaces/IBillM110AppService.cs b/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgCheck/BillM110s/Interfaces/IBillM110AppService.cs index 900ce5c..913f0aa 100644 --- a/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgCheck/BillM110s/Interfaces/IBillM110AppService.cs +++ b/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgCheck/BillM110s/Interfaces/IBillM110AppService.cs @@ -67,14 +67,14 @@ namespace WY.NewJit.MsgCheck /// /// 生产线 /// 起始大众顺序号 - Task> GetPrintStartHostSN2(string productLine, string isZhuHuBan,string GroupName = null); + //Task> GetPrintStartHostSN2(string productLine, string isZhuHuBan,string GroupName = null); /// /// 打印前检查门板大众顺序号是否断号 /// /// /// 断号时Item不为空 - Task> CheckMBHostSNBreakNum(MenBanPrintInputDto input); + //Task> CheckMBHostSNBreakNum(MenBanPrintInputDto input); /// /// 打印前检查柱护板大众顺序号是否断号 @@ -105,7 +105,7 @@ namespace WY.NewJit.MsgCheck /// /// 生产线编号列表 /// 生产线超时情况 - Task> ProductLineTimeoutRemind(TimeOutRemindInputDto input); + //Task> ProductLineTimeoutRemind(TimeOutRemindInputDto input); //Task> GetReplenishPrintListAsync(QueryBillM110Dto input); diff --git a/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/WY.NewJit.Application.Contracts.xml b/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/WY.NewJit.Application.Contracts.xml index c7408b9..d3d286b 100644 --- a/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/WY.NewJit.Application.Contracts.xml +++ b/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/WY.NewJit.Application.Contracts.xml @@ -945,6 +945,51 @@ 字典项名称 + + + 分类1(零件大类对应分组) + + + + + 分类2 (零件大类对应产线) + + + + + 分类3(零件大类对应车型) + + + + + 分类4(零件大类对应打印报表的三位零件大类) + + + + + 分类5 (零件大类对应客户零件号) + + + + + 分类6(零件大类对应显示车型) + + + + + 分类7(零件大类对应报表字段显示顺序) + + + + + 分类8(零件大类对应装箱清单号的前缀,例如C或T) + + + + + 分类9(零件大类对应 打印标准数量 12 或 24) + + @@ -1546,6 +1591,31 @@ 描述 + + + 零件类型:产线 + + + + + 零件类型:分组 + + + + + 零件类型:零件大类 + + + + + 零件在主表横向排列顺序 + + + + + 零件在主表横向排列显示的列名 + + 流水号# @@ -2092,6 +2162,31 @@ 描述 + + + 零件类型:产线 + + + + + 零件类型:分组 + + + + + 零件类型:零件大类 + + + + + 零件在主表横向排列顺序 + + + + + 零件在主表横向排列显示的列名 + + 流水号# @@ -2441,27 +2536,6 @@ 导入文件流 执行成功返回真 - - - 根据生产线获取正常打印单据的起始大众顺序号 - - 生产线 - 起始大众顺序号 - - - - 打印前检查门板大众顺序号是否断号 - - - 断号时Item不为空 - - - - 生产线超时提醒 - - 生产线编号列表 - 生产线超时情况 - 零件查询结果DTO diff --git a/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/MsgBaseData/Dics/DicAppService.cs b/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/MsgBaseData/Dics/DicAppService.cs index c34b702..e3cda14 100644 --- a/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/MsgBaseData/Dics/DicAppService.cs +++ b/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/MsgBaseData/Dics/DicAppService.cs @@ -77,12 +77,18 @@ namespace WY.NewJit.MsgBaseData { List lst = _dicDomainService.GetDicItems(dicTypeName); - List items = - ObjectMapper.Map, List>(lst); + List dtoLst = ObjectMapper.Map, List>(lst); - items = items.OrderBy(itm => itm.DicItemCode).ThenBy(itm => itm.DicItemName).ToList(); + if (dicTypeName == "零件大类") + { + dtoLst = dtoLst.OrderBy(itm => itm.DicItemSort2).ThenBy(itm => itm.DicItemSort1).ThenBy(itm => itm.DicItemSort7).ToList(); + } + else + { + dtoLst = dtoLst.OrderBy(itm => itm.DicItemCode).ThenBy(itm => itm.DicItemName).ToList(); + } - return new ListResultDto(items); + return new ListResultDto(dtoLst); } catch (Exception ex) { diff --git a/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/MsgCheck/BillM100s/BillM100AppService.cs b/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/MsgCheck/BillM100s/BillM100AppService.cs index 8971068..d26fff4 100644 --- a/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/MsgCheck/BillM100s/BillM100AppService.cs +++ b/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/MsgCheck/BillM100s/BillM100AppService.cs @@ -1,31 +1,32 @@ using Magicodes.ExporterAndImporter.Core; using Magicodes.ExporterAndImporter.Excel; +using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; +using Shouldly; using System; using System.Collections.Generic; +using System.ComponentModel; +using System.Diagnostics; using System.Linq; using System.Linq.Dynamic.Core; +using System.Reflection; using System.Text; using System.Threading.Tasks; +using Volo.Abp; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; +using Volo.Abp.BlobStoring; using Volo.Abp.Domain.Repositories; -using Volo.Abp.Uow; using Volo.Abp.Domain.Repositories.Dapper; -using WY.NewJit.EntityFrameworkCore; +using Volo.Abp.Uow; using WY.NewJit.Common; -using Shouldly; -using Volo.Abp.BlobStoring; -using Microsoft.AspNetCore.Mvc; +using WY.NewJit.Commons; +using WY.NewJit.EntityFrameworkCore; using WY.NewJit.Extends; -using WY.NewJit.MsgBaseData; using WY.NewJit.Extends.PaiGe; using WY.NewJit.Extends.PaiGe.WMS; -using System.Reflection; -using WY.NewJit.Commons; -using Volo.Abp; -using System.Diagnostics; +using WY.NewJit.MsgBaseData; namespace WY.NewJit.MsgCheck { @@ -607,6 +608,239 @@ select * from return ret; } + /// + /// 包含主表横向排列零件字段 + /// + /// + /// + private async Task QueryByConditionAsync2(QueryBillM100Dto input) + { + M100_M110_Result ret = new M100_M110_Result(); + //取零件大类配置 + List partLargeTypeLst = await _dicItemRepository.GetListAsync(itm => itm.DicTypeCode == "零件大类"); + partLargeTypeLst = partLargeTypeLst.OrderBy(itm => itm.DicItemSort2).ThenBy(itm => itm.DicItemSort1).ToList(); + + var query = await _billM100Repository.GetQueryableAsync(); + var includeQry = query.Include(itm => itm.BillM100Parts); + var m100Query = includeQry.Where(itm => itm.IsReceiveM110 == false || itm.IsReceiveM110 == null); + + if (input.SerialNumBegin != null) + { + m100Query = m100Query.Where(itm => itm.SerialNum >= input.SerialNumBegin); + } + if (input.SerialNumEnd != null) + { + m100Query = m100Query.Where(itm => itm.SerialNum <= input.SerialNumBegin); + } + if (input.HostSNBegin != null) + { + m100Query = m100Query.Where(itm => itm.HostSN >= input.HostSNBegin); + } + if (input.HostSNEnd != null) + { + m100Query = m100Query.Where(itm => itm.HostSN <= input.HostSNEnd); + } + if (!string.IsNullOrEmpty(input.KNRBegin)) + { + m100Query = m100Query.Where(itm => itm.KNR.CompareTo(input.KNRBegin) >= 0); + } + if (!string.IsNullOrEmpty(input.KNREnd)) + { + m100Query = m100Query.Where(itm => itm.KNR.CompareTo(input.KNREnd) <= 0); + } + if (!string.IsNullOrEmpty(input.VINBegin)) + { + m100Query = m100Query.Where(itm => itm.VIN.CompareTo(input.VINBegin) >= 0); + } + if (!string.IsNullOrEmpty(input.VINEnd)) + { + m100Query = m100Query.Where(itm => itm.VIN.CompareTo(input.VINEnd) <= 0); + } + if (input.AssemblyID != null) + { + m100Query = m100Query.Where(itm => itm.AssemblyID != null); + } + if (input.OnlineTimeBegin != null) + { + m100Query = m100Query.Where(itm => itm.OnlineTime >= input.OnlineTimeBegin); + } + if (input.OnlineTimeEnd != null) + { + m100Query = m100Query.Where(itm => itm.OnlineTime <= input.OnlineTimeEnd); + } + if (input.VehicleModelCode != null) + { + m100Query = m100Query.Where(itm => itm.VehicleModelCode == input.VehicleModelCode); + } + if (input.ProductLine != null) + { + m100Query = m100Query.Where(itm => itm.ProductLine == input.ProductLine); + } + if (input.Version != null) + { + m100Query = m100Query.Where(itm => itm.Version == input.Version); + } + if (input.ReceiveTimeBegin != null) + { + m100Query = m100Query.Where(itm => itm.ReceiveTime >= input.ReceiveTimeBegin); + } + if (input.ReceiveTimeEnd != null) + { + m100Query = m100Query.Where(itm => itm.ReceiveTime <= input.ReceiveTimeEnd); + } + //if (input.IsBillMaintenance == true) //M100单据信息维护模块使用 + //{ + // where += " and b.Operator is not null"; + //} + if (input.CanNotPrint == true) + { + m100Query = m100Query.Where(itm => itm.CanNotPrint == true); + } + else if (input.CanNotPrint == false) + { + m100Query = m100Query.Where(itm => itm.CanNotPrint == false || itm.CanNotPrint == null); + } + + if (input.ZHBBillStatus != null && input.ZHBBillStatus != ZHBBillStatusEnum.None) + { + if (input.ZHBBillStatus == ZHBBillStatusEnum.Print) //柱护板已打印 + { + m100Query = m100Query.Where(itm => itm.PrintBillNum != "" && itm.PrintBillNum != null); + } + else if (input.ZHBBillStatus == ZHBBillStatusEnum.NotPrint) //柱护板未打印 + { + m100Query = m100Query.Where(itm => itm.PrintBillNum == "" || itm.PrintBillNum == null); + } + } + else if (input.BillStatus != null && input.BillStatus != BillStatusEnum.None) + { + m100Query = m100Query.Where(itm => itm.BillStatus == input.BillStatus); + } + else + { + //m100Query = m100Query.Where(itm => itm.BillStatus == BillStatusEnum.Match || itm.BillStatus == BillStatusEnum.Publish); //单据状态是已匹配、已打印 + } + + if (input.IsNeedReplenishPrint == true) //只显示需要补打的记录 + { + m100Query = m100Query.Where(itm => itm.NeedReplenishPrint == 1); + } + //M100 + var m100Lst = m100Query.OrderBy(itm => itm.SerialNumStr).Skip(input.SkipCount).Take(input.MaxResultCount).OrderByDescending(itm => itm.SerialNumStr).ToList(); //倒序排列 + List m100Dtos = ObjectMapper.Map, List>(m100Lst); + if (m100Dtos.Count == 0) + { + return ret; + } + var m100Parts = m100Dtos[0].BillM100Parts; + + foreach (BillM100Dto m100Dto in m100Dtos) //遍历M100 + { + foreach (var partDto in m100Dto.BillM100Parts) //遍历子件 + { + //按产线、分组、零件大类 过滤 + var partLargeTypeObj = partLargeTypeLst.FirstOrDefault(itm => + itm.DicItemSort2 == partDto.PartType + && itm.DicItemSort1 == partDto.PartType2 + && itm.DicItemCode == partDto.PartType3); + if (partLargeTypeObj != null) + { + partDto.DisplaySN = partLargeTypeObj.DicItemSort7.TryToInt(); + partDto.DisplayColumnName = partLargeTypeObj.DicItemName; + } + } + var filterParts = m100Dto.BillM100Parts.Where(itm => itm.DisplaySN != null).OrderBy(itm => itm.DisplaySN).ToList(); + for (int i = 0; i < filterParts.Count; i++) + { + var filterPart = filterParts[i]; + switch (i) + { + case 0: + m100Dto.PartCode1 = filterPart.PartCode; + break; + case 1: + m100Dto.PartCode2 = filterPart.PartCode; + break; + case 2: + m100Dto.PartCode3 = filterPart.PartCode; + break; + case 3: + m100Dto.PartCode4 = filterPart.PartCode; + break; + case 4: + m100Dto.PartCode5 = filterPart.PartCode; + break; + case 5: + m100Dto.PartCode6 = filterPart.PartCode; + break; + } + } + m100Dto.BillM100Parts = new List(); + } + ret.PartDisplayColumnName = m100Parts.Where(itm => itm.DisplaySN != null).OrderBy(itm => itm.DisplaySN).Select(itm => itm.DisplayColumnName).JoinAsString(","); + ret.M100Dtos = m100Dtos; + ret.M100_TotalCount = await m100Query.CountAsync(); + return ret; + } + + /// + /// 填充M110主表横向零件字段 + /// + /// + /// + private async Task> FillPartCodeField(List m110Dtos) + { + //取零件大类配置 + List partLargeTypeLst = await _dicItemRepository.GetListAsync(itm => itm.DicTypeCode == "零件大类"); + partLargeTypeLst = partLargeTypeLst.OrderBy(itm => itm.DicItemSort2).ThenBy(itm => itm.DicItemSort1).ToList(); + + foreach (BillM110Dto m110Dto in m110Dtos) //遍历M110 + { + foreach (var partDto in m110Dto.BillM110Parts) //遍历子件 + { + //按产线、分组、零件大类 过滤 + var partLargeTypeObj = partLargeTypeLst.FirstOrDefault(itm => + itm.DicItemSort2 == partDto.PartType + && itm.DicItemSort1 == partDto.PartType2 + && itm.DicItemCode == partDto.PartType3); + if (partLargeTypeObj != null) + { + partDto.DisplaySN = partLargeTypeObj.DicItemSort7.TryToInt(); + partDto.DisplayColumnName = partLargeTypeObj.DicItemName; + } + } + var filterParts = m110Dto.BillM110Parts.Where(itm => itm.DisplaySN != null).OrderBy(itm => itm.DisplaySN).ToList(); + for (int i = 0; i < filterParts.Count; i++) + { + var filterPart = filterParts[i]; + switch (i) + { + case 0: + m110Dto.PartCode1 = filterPart.PartCode; + break; + case 1: + m110Dto.PartCode2 = filterPart.PartCode; + break; + case 2: + m110Dto.PartCode3 = filterPart.PartCode; + break; + case 3: + m110Dto.PartCode4 = filterPart.PartCode; + break; + case 4: + m110Dto.PartCode5 = filterPart.PartCode; + break; + case 5: + m110Dto.PartCode6 = filterPart.PartCode; + break; + } + } + m110Dto.BillM110Parts = new List(); + } + return m110Dtos; + } + + /// /// 取单据包含的ERP总成列表 /// @@ -889,19 +1123,21 @@ select * from //} /// - /// 打印左侧或右侧门板 + /// 将M100转换成MenBanPackingList主子表 /// /// /// - /// /// - /// /// - /// + /// 报表分类,对应DicItemSort4 + /// 零件大类字典项 /// - private MenBanPackingList DoMBPrint(MenBanPrintInputDto input, int pageIdx, double maxSN, List billLst, string reportSort, string[] partLargeType) + private MenBanPackingList DoMBPrint(MenBanPrintInputDto input, int pageIdx, double maxSN, List billLst, string reportSort, List partLargeTypeLst) { const int _colNumberPerPage = 12; + string[] partLargeType = partLargeTypeLst.Select(itm => itm.DicItemCode).ToArray(); //取零件大类 + var partLargeTypeObj = partLargeTypeLst[0]; + //取当前页内容 List curPageLst = billLst.Skip(pageIdx * _colNumberPerPage).Take(_colNumberPerPage).ToList(); @@ -912,8 +1148,10 @@ select * from MenBanPackingList packingMain = new MenBanPackingList(); packingMain.SetId(GuidGenerator.Create()); - packingMain.BillNum = $"C{ymd}{serialNum}{reportSort}"; - packingMain.VehicleModel = vmLst; + + packingMain.BillNum = $"{partLargeTypeObj.DicItemSort8}{ymd}{serialNum}{reportSort}"; //partLargeTypeObj.DicItemSort8包含C或T + + packingMain.VehicleModel = partLargeTypeObj.DicItemSort6; //报表显示车型 //vmLst; packingMain.BillSerialNum = serialNum; packingMain.PrintDate = ServerHelper.CurrentDateTime; packingMain.ProductLine = billLst[0].ProductLine; @@ -3021,119 +3259,18 @@ select min(SerialNumStr) from FisBillM100 a left join d on a.VIN=d.VIN M100_M110_Result ret = new M100_M110_Result(); try { - var query = await _billM100Repository.GetQueryableAsync(); - var includeQry = query.Include(itm => itm.BillM100Parts); - var m100Query = includeQry.Where(itm => itm.IsReceiveM110 == false || itm.IsReceiveM110 == null); - - if (input.SerialNumBegin != null) - { - m100Query = m100Query.Where(itm => itm.SerialNum >= input.SerialNumBegin); - } - if (input.SerialNumEnd != null) - { - m100Query = m100Query.Where(itm => itm.SerialNum <= input.SerialNumBegin); - } - if (input.HostSNBegin != null) - { - m100Query = m100Query.Where(itm => itm.HostSN >= input.HostSNBegin); - } - if (input.HostSNEnd != null) - { - m100Query = m100Query.Where(itm => itm.HostSN <= input.HostSNEnd); - } - if (!string.IsNullOrEmpty(input.KNRBegin)) - { - m100Query = m100Query.Where(itm => itm.KNR.CompareTo(input.KNRBegin) >= 0); - } - if (!string.IsNullOrEmpty(input.KNREnd)) - { - m100Query = m100Query.Where(itm => itm.KNR.CompareTo(input.KNREnd) <= 0); - } - if (!string.IsNullOrEmpty(input.VINBegin)) - { - m100Query = m100Query.Where(itm => itm.VIN.CompareTo(input.VINBegin) >= 0); - } - if (!string.IsNullOrEmpty(input.VINEnd)) - { - m100Query = m100Query.Where(itm => itm.VIN.CompareTo(input.VINEnd) <= 0); - } - if (input.AssemblyID != null) - { - m100Query = m100Query.Where(itm => itm.AssemblyID != null); - } - if (input.OnlineTimeBegin != null) - { - m100Query = m100Query.Where(itm => itm.OnlineTime >= input.OnlineTimeBegin); - } - if (input.OnlineTimeEnd != null) - { - m100Query = m100Query.Where(itm => itm.OnlineTime <= input.OnlineTimeEnd); - } - if (input.VehicleModelCode != null) - { - m100Query = m100Query.Where(itm => itm.VehicleModelCode == input.VehicleModelCode); - } - if (input.ProductLine != null) - { - m100Query = m100Query.Where(itm => itm.ProductLine == input.ProductLine); - } - if (input.Version != null) - { - m100Query = m100Query.Where(itm => itm.Version == input.Version); - } - if (input.ReceiveTimeBegin != null) - { - m100Query = m100Query.Where(itm => itm.ReceiveTime >= input.ReceiveTimeBegin); - } - if (input.ReceiveTimeEnd != null) - { - m100Query = m100Query.Where(itm => itm.ReceiveTime <= input.ReceiveTimeEnd); - } - //if (input.IsBillMaintenance == true) //M100单据信息维护模块使用 - //{ - // where += " and b.Operator is not null"; - //} - if (input.CanNotPrint == true) - { - m100Query = m100Query.Where(itm => itm.CanNotPrint == true); - } - else if (input.CanNotPrint == false) - { - m100Query = m100Query.Where(itm => itm.CanNotPrint == false || itm.CanNotPrint == null); - } - - if (input.ZHBBillStatus != null && input.ZHBBillStatus != ZHBBillStatusEnum.None) - { - if (input.ZHBBillStatus == ZHBBillStatusEnum.Print) //柱护板已打印 - { - m100Query = m100Query.Where(itm => itm.PrintBillNum != "" && itm.PrintBillNum != null); - } - else if (input.ZHBBillStatus == ZHBBillStatusEnum.NotPrint) //柱护板未打印 - { - m100Query = m100Query.Where(itm => itm.PrintBillNum == "" || itm.PrintBillNum == null); - } - } - else if (input.BillStatus != null && input.BillStatus != BillStatusEnum.None) + if (input.ProductLine.IsNullOrEmpty2()) { - m100Query = m100Query.Where(itm => itm.BillStatus == input.BillStatus); + throw new UserFriendlyException("生产线参数不能为空"); } - else - { - //m100Query = m100Query.Where(itm => itm.BillStatus == BillStatusEnum.Match || itm.BillStatus == BillStatusEnum.Publish); //单据状态是已匹配、已打印 - } - - if (input.IsNeedReplenishPrint == true) //只显示需要补打的记录 - { - m100Query = m100Query.Where(itm => itm.NeedReplenishPrint == 1); - } - //M100 - var m100Lst = m100Query.OrderBy(itm => itm.SerialNumStr).Skip(input.SkipCount).Take(input.MaxResultCount).OrderByDescending(itm => itm.SerialNumStr).ToList(); - ret.M100_TotalCount = await m100Query.CountAsync(); - ret.BillM100s = m100Lst; - //M110 + //填充M100,字段中文名称 + ret = await QueryByConditionAsync2(input); + //填充M110 string serialNumStr = await _billM110_Repository.Where(itm => itm.ProductLine == input.ProductLine).MaxAsync(itm => itm.SerialNumStr); var m110_Lst = await _billM110_Repository.GetListAsync(itm => itm.SerialNumStr == serialNumStr, true); - ret.Bill_M110s = m110_Lst; + List m110_Dtos = ObjectMapper.Map, List>(m110_Lst); + m110_Dtos = await FillPartCodeField(m110_Dtos); + ret.M110_Dtos = m110_Dtos; return ret; } @@ -3145,9 +3282,6 @@ select min(SerialNumStr) from FisBillM100 a left join d on a.VIN=d.VIN } } - - - /// /// 按主键获取唯一实体 /// @@ -3296,19 +3430,53 @@ select min(SerialNumStr) from FisBillM100 a left join d on a.VIN=d.VIN { input.SkipCount = 0; input.MaxResultCount = 50000; - PagedResultDto query = new PagedResultDto(); - if (!string.IsNullOrEmpty(input.GroupName)) - { - query = await QueryZHBByConditionAsync(input, (PagedAndSortedBase)input); - } - else + //PagedResultDto query = new PagedResultDto(); + //if (!string.IsNullOrEmpty(input.GroupName)) + //{ + // query = await QueryZHBByConditionAsync(input, (PagedAndSortedBase)input); + //} + //else + //{ + // query = await QueryByConditionAsync(input, (PagedAndSortedBase)input); + //} + M100_M110_Result result = await QueryByConditionAsync2(input); + + string[] fieldNames = result.PartDisplayColumnName.Split(","); + for (int i = 0; i < fieldNames.Length; i++) { - query = await QueryByConditionAsync(input, (PagedAndSortedBase)input); + switch (i) + { + case 0: + ExporterHeaderAttribute attr = typeof(BillM100Dto).GetProperty("PartCode1").GetCustomAttribute(typeof(ExporterHeaderAttribute)) as ExporterHeaderAttribute; + attr.DisplayName = fieldNames[i]; + break; + case 1: + attr = typeof(BillM100Dto).GetProperty("PartCode2").GetCustomAttribute(typeof(ExporterHeaderAttribute)) as ExporterHeaderAttribute; + attr.DisplayName = fieldNames[i]; + break; + case 2: + attr = typeof(BillM100Dto).GetProperty("PartCode3").GetCustomAttribute(typeof(ExporterHeaderAttribute)) as ExporterHeaderAttribute; + attr.DisplayName = fieldNames[i]; + break; + case 3: + attr = typeof(BillM100Dto).GetProperty("PartCode4").GetCustomAttribute(typeof(ExporterHeaderAttribute)) as ExporterHeaderAttribute; + attr.DisplayName = fieldNames[i]; + break; + case 4: + attr = typeof(BillM100Dto).GetProperty("PartCode5").GetCustomAttribute(typeof(ExporterHeaderAttribute)) as ExporterHeaderAttribute; + attr.DisplayName = fieldNames[i]; + break; + case 5: + attr = typeof(BillM100Dto).GetProperty("PartCode6").GetCustomAttribute(typeof(ExporterHeaderAttribute)) as ExporterHeaderAttribute; + attr.DisplayName = fieldNames[i]; + break; + } } - List items = query.Items.ToList(); + + //List items = query.Items.ToList(); //将实体列表转换成excel文件流 IExporter exporter = new ExcelExporter(); - byte[] byteArr = await exporter.ExportAsByteArray(items); + byte[] byteArr = await exporter.ExportAsByteArray(result.M100Dtos); byteArr.ShouldNotBeNull(); //将excel文件流保存到服务器端文件系统 string fileName = string.Format("单据M100_{0}.xlsx", Guid.NewGuid().ToString()); @@ -3414,6 +3582,10 @@ select min(SerialNumStr) from FisBillM100 a left join d on a.VIN=d.VIN return ret; } } + + List partLargeTypeLst = await _dicItemRepository.GetListAsync(itm => itm.DicTypeCode == "零件大类"); + partLargeTypeLst = partLargeTypeLst.OrderBy(itm => itm.DicItemSort2).ThenBy(itm => itm.DicItemSort1).ToList(); + ListResultDto tempLst = await GetMBReportDetailList(input, true); //----------------------------- List billLst = tempLst.Item; if (tempLst.Status == false) @@ -3428,14 +3600,13 @@ select min(SerialNumStr) from FisBillM100 a left join d on a.VIN=d.VIN int pageCnt = (int)Math.Ceiling(billLst.Count / 12.0); //每页打印12列,取打印页数 //double maxBillNum = 0; - //DateTime printTime = ServerHelper.CurrentDateTime; - var reportSortDic = _dicItemRepository - .Where(itm => itm.DicTypeCode == "零件大类" && itm.DicItemSort2 == input.ProductLine) - .ToList() + //过滤产线(DicItemSort2),按“报表分类”(DicItemSort4)分组,分组后按DicItemSort7排序 + Dictionary> reportSortDic = partLargeTypeLst + .Where(itm => itm.DicItemSort2 == input.ProductLine && string.IsNullOrEmpty(itm.DicItemSort4) == false) .GroupBy(itm => itm.DicItemSort4) - .ToDictionary(itm => itm.Key, it2 => it2.Select(itm => itm.DicItemCode).ToArray()); + .ToDictionary(itm => itm.Key, it2 => it2.OrderBy(itm => itm.DicItemSort7).ToList()); for (int pageIdx = 0; pageIdx < pageCnt; pageIdx++) { @@ -3475,12 +3646,12 @@ select min(SerialNumStr) from FisBillM100 a left join d on a.VIN=d.VIN billObj.NeedReplenishPrint = 0; //不需要补打 await _billM100Repository.UpdateAsync(billObj, true); } - else if (billObj.BillStatus == BillStatusEnum.NotMatch) - { - //billObj.PrintTime = ServerHelper.CurrentDateTime; - billObj.NeedReplenishPrint = 1; //需要补打 - await _billM100Repository.UpdateAsync(billObj, true); - } + //else if (billObj.BillStatus == BillStatusEnum.NotMatch) + //{ + // //billObj.PrintTime = ServerHelper.CurrentDateTime; + // billObj.NeedReplenishPrint = 1; //需要补打 + // await _billM100Repository.UpdateAsync(billObj, true); + //} } _logger.LogWarning($"SaveMenBanReport更新M100的门板打印标志 - {sw.ElapsedMilliseconds}毫秒"); @@ -5226,16 +5397,20 @@ select min(SerialNumStr) from FisBillM100 a left join d on a.VIN=d.VIN public class M100_M110_Result { - public List BillM100s { get; set; } - public List Bill_M110s { get; set; } + public List M100Dtos { get; set; } + public List M110_Dtos { get; set; } + + public long M100_TotalCount { get; set; } = 0; - public int M100_TotalCount { get; set; } + /// + /// 零件在主表横向排列显示的列名 + /// + public string PartDisplayColumnName { get; set; } = ""; public M100_M110_Result() { - BillM100s = new List(); - Bill_M110s = new List(); + M100Dtos = new List(); + M110_Dtos = new List(); } } - } diff --git a/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/MsgCheck/BillM110s/BillM110AppService.cs b/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/MsgCheck/BillM110s/BillM110AppService.cs index 8be7ed5..2dfb650 100644 --- a/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/MsgCheck/BillM110s/BillM110AppService.cs +++ b/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/MsgCheck/BillM110s/BillM110AppService.cs @@ -1998,83 +1998,83 @@ select * from /// /// /// 断号时Item不为空 - [UnitOfWork(false)] - [HttpPost] - [Route("check-mb-hostsn-break-num")] - public virtual async Task> CheckMBHostSNBreakNum(MenBanPrintInputDto input) - { - List retLst = new List(); - try - { - int lastNum = await GetMenBanLastPrintNum(input); //从M110中取当前产线、已经打印的最大大众顺序号 - if (lastNum > 0) - { - if ((lastNum % 10000) == 1999) - { - if ((input.BeginHostSN % 10000) != 1) - { - string msg = $"单据之间断号,上次打印的最后大众顺序号为【{lastNum}】,与本次打印开始号【{input.BeginHostSN}】中间存在断号!"; - retLst.Add(msg); - _logger.LogDebug(msg); - } - } - else - { - if (lastNum + 1 != input.BeginHostSN) - { - string msg = $"单据之间断号,上次打印的最后大众顺序号为【{lastNum}】,与本次打印开始号【{input.BeginHostSN}】中间存在断号!"; - retLst.Add(msg); - _logger.LogDebug(msg); - } - } - } + //[UnitOfWork(false)] + //[HttpPost] + //[Route("check-mb-hostsn-break-num")] + //public virtual async Task> CheckMBHostSNBreakNum(MenBanPrintInputDto input) + //{ + // List retLst = new List(); + // try + // { + // int lastNum = await GetMenBanLastPrintNum(input); //从M110中取当前产线、已经打印的最大大众顺序号 + // if (lastNum > 0) + // { + // if ((lastNum % 10000) == 1999) + // { + // if ((input.BeginHostSN % 10000) != 1) + // { + // string msg = $"单据之间断号,上次打印的最后大众顺序号为【{lastNum}】,与本次打印开始号【{input.BeginHostSN}】中间存在断号!"; + // retLst.Add(msg); + // _logger.LogDebug(msg); + // } + // } + // else + // { + // if (lastNum + 1 != input.BeginHostSN) + // { + // string msg = $"单据之间断号,上次打印的最后大众顺序号为【{lastNum}】,与本次打印开始号【{input.BeginHostSN}】中间存在断号!"; + // retLst.Add(msg); + // _logger.LogDebug(msg); + // } + // } + // } - ListResultDto tempLst = await GetMBReportDetailList(input, false); - List billLst = tempLst.Item; - if (billLst.Count < 2) - { - return new ListResultDto(retLst); - } - for (int i = 1; i < billLst.Count; i++) - { - BillM110 priorObj = billLst[i - 1]; - BillM110 curObj = billLst[i]; - int priorHostSN = (int)billLst[i - 1].HostSN; - int curHostSN = (int)billLst[i].HostSN; + // ListResultDto tempLst = await GetMBReportDetailList(input, false); + // List billLst = tempLst.Item; + // if (billLst.Count < 2) + // { + // return new ListResultDto(retLst); + // } + // for (int i = 1; i < billLst.Count; i++) + // { + // BillM110 priorObj = billLst[i - 1]; + // BillM110 curObj = billLst[i]; + // int priorHostSN = (int)billLst[i - 1].HostSN; + // int curHostSN = (int)billLst[i].HostSN; - if (curHostSN > priorHostSN) //0005、0006 - { - if (curHostSN > priorHostSN + 1) //0005、0008时,补号 0006、0007 - { - retLst.Add($"大众顺序号{priorObj.HostSN}与{curObj.HostSN}之间存在断号情况!"); - } - } - else if (curHostSN < priorHostSN) //1999到0001的情况 - { - if (curHostSN + _hostSNMaxVal > priorHostSN + 1) //0005、0008时,补号 0006、0007 - { - retLst.Add($"大众顺序号{priorObj.HostSN}与{curObj.HostSN}之间存在断号情况!"); - } - } - } - if (retLst.Count == 0 && billLst.Count < input.EndHostSN - input.BeginHostSN + 1) - { - retLst.Add($"本车装箱单不满架!"); - } + // if (curHostSN > priorHostSN) //0005、0006 + // { + // if (curHostSN > priorHostSN + 1) //0005、0008时,补号 0006、0007 + // { + // retLst.Add($"大众顺序号{priorObj.HostSN}与{curObj.HostSN}之间存在断号情况!"); + // } + // } + // else if (curHostSN < priorHostSN) //1999到0001的情况 + // { + // if (curHostSN + _hostSNMaxVal > priorHostSN + 1) //0005、0008时,补号 0006、0007 + // { + // retLst.Add($"大众顺序号{priorObj.HostSN}与{curObj.HostSN}之间存在断号情况!"); + // } + // } + // } + // if (retLst.Count == 0 && billLst.Count < input.EndHostSN - input.BeginHostSN + 1) + // { + // retLst.Add($"本车装箱单不满架!"); + // } - return new ListResultDto(retLst); - } - catch (Exception ex) - { - ListResultDto ret = new ListResultDto(); - ret.Status = false; - ret.Message = _errorMessagePrefix + "打印前检查大众顺序号是否断号ChecMBkHostSNBreakNum 执行出错:" + ex.Message; - _logger.LogError(ret.Message); - return ret; - } + // return new ListResultDto(retLst); + // } + // catch (Exception ex) + // { + // ListResultDto ret = new ListResultDto(); + // ret.Status = false; + // ret.Message = _errorMessagePrefix + "打印前检查大众顺序号是否断号ChecMBkHostSNBreakNum 执行出错:" + ex.Message; + // _logger.LogError(ret.Message); + // return ret; + // } - } + //} /// /// 打印前检查大众顺序号是否断号 @@ -2154,72 +2154,72 @@ select * from /// 柱护板是1 门板是非1 /// 柱护板分组类型 /// 起始大众顺序号 - [UnitOfWork] - [HttpGet] - [Route("get-print-start-hostsn2")] - public virtual async Task> GetPrintStartHostSN2(string productLine, string isZhuHuBan,string GroupName=null) - { - int? beginHostSN = null; - try - { - if (isZhuHuBan == "1") //是柱护板, 根据PrintBillNum非空判断是柱护板 - { - //string minSNStr = await _billM110Repository.Where(itm => - // itm.ProductLine == productLine //指定生产线 - // && itm.CanNotPrint != true //能打印 - // && string.IsNullOrEmpty(itm.PrintBillNum) == true //等于 未打印 - // && itm.NeedReplenishPrint != 1 //排除补打 - // ).MinAsync(itm => itm.SerialNumStr); - string sql = @" -with d as -( - select *from [dbo].[FisZHBPrintStatus] where groupName='{1}' -) - -select min(SerialNumStr) from FisBillM110 a left join d on a.VIN=d.VIN - - where ProductLine='{0}' and (CanNotPrint !=1 or CanNotPrint is null) and (PrintBillNum is null or PrintBillNum ='') and (NeedReplenishPrint!=1 or NeedReplenishPrint is null) and d.BillStatus is null"; - - sql = string.Format(sql, productLine, GroupName); - var minSNStr = await _newJitDapperRepository.GetSingleBySqlAsync(sql); - - - beginHostSN = await _billM110Repository.Where(itm => - itm.ProductLine == productLine //指定生产线 - && itm.CanNotPrint != true //能打印 - && string.IsNullOrEmpty(itm.PrintBillNum) == true //等于 未打印 - && itm.SerialNumStr == minSNStr - ).MinAsync(itm => itm.HostSN); - } - else //---------------门板----------------------------------------------------------------------------------- - { - string minSNStr2 = await _billM110Repository.Where(itm => - itm.ProductLine == productLine //指定生产线 - && itm.CanNotPrint != true //能打印 - //&& itm.BillStatus == BillStatusEnum.Match //等于 未打印(和M110上线信息匹配) - && itm.BillStatus != BillStatusEnum.Publish //未知总成也显示在装箱单 - && itm.NeedReplenishPrint != 1 //排除补打 - ).MinAsync(itm => itm.SerialNumStr); +// [UnitOfWork] +// [HttpGet] +// [Route("get-print-start-hostsn2")] +// public virtual async Task> GetPrintStartHostSN2(string productLine, string isZhuHuBan,string GroupName=null) +// { +// int? beginHostSN = null; +// try +// { +// if (isZhuHuBan == "1") //是柱护板, 根据PrintBillNum非空判断是柱护板 +// { +// //string minSNStr = await _billM110Repository.Where(itm => +// // itm.ProductLine == productLine //指定生产线 +// // && itm.CanNotPrint != true //能打印 +// // && string.IsNullOrEmpty(itm.PrintBillNum) == true //等于 未打印 +// // && itm.NeedReplenishPrint != 1 //排除补打 +// // ).MinAsync(itm => itm.SerialNumStr); +// string sql = @" +//with d as +//( +// select *from [dbo].[FisZHBPrintStatus] where groupName='{1}' +//) - beginHostSN = await _billM110Repository.Where(itm => - itm.ProductLine == productLine //指定生产线 - && itm.CanNotPrint != true //能打印 - //&& itm.BillStatus == BillStatusEnum.Match //等于 未打印 - && itm.BillStatus != BillStatusEnum.Publish //未知总成也显示在装箱单 - && itm.SerialNumStr == minSNStr2 - ).MinAsync(itm => itm.HostSN); - } - return new ObjectResultDto(beginHostSN); - } - catch (Exception ex) - { - ObjectResultDto ret = new ObjectResultDto(); - ret.Status = false; - ret.Message = _errorMessagePrefix + "GetPrintStartHostSN2 执行出错:" + ex.Message; - _logger.LogError(ret.Message); - return ret; - } - } +//select min(SerialNumStr) from FisBillM110 a left join d on a.VIN=d.VIN + +// where ProductLine='{0}' and (CanNotPrint !=1 or CanNotPrint is null) and (PrintBillNum is null or PrintBillNum ='') and (NeedReplenishPrint!=1 or NeedReplenishPrint is null) and d.BillStatus is null"; + +// sql = string.Format(sql, productLine, GroupName); +// var minSNStr = await _newJitDapperRepository.GetSingleBySqlAsync(sql); + + +// beginHostSN = await _billM110Repository.Where(itm => +// itm.ProductLine == productLine //指定生产线 +// && itm.CanNotPrint != true //能打印 +// && string.IsNullOrEmpty(itm.PrintBillNum) == true //等于 未打印 +// && itm.SerialNumStr == minSNStr +// ).MinAsync(itm => itm.HostSN); +// } +// else //---------------门板----------------------------------------------------------------------------------- +// { +// string minSNStr2 = await _billM110Repository.Where(itm => +// itm.ProductLine == productLine //指定生产线 +// && itm.CanNotPrint != true //能打印 +// //&& itm.BillStatus == BillStatusEnum.Match //等于 未打印(和M110上线信息匹配) +// && itm.BillStatus != BillStatusEnum.Publish //未知总成也显示在装箱单 +// && itm.NeedReplenishPrint != 1 //排除补打 +// ).MinAsync(itm => itm.SerialNumStr); + +// beginHostSN = await _billM110Repository.Where(itm => +// itm.ProductLine == productLine //指定生产线 +// && itm.CanNotPrint != true //能打印 +// //&& itm.BillStatus == BillStatusEnum.Match //等于 未打印 +// && itm.BillStatus != BillStatusEnum.Publish //未知总成也显示在装箱单 +// && itm.SerialNumStr == minSNStr2 +// ).MinAsync(itm => itm.HostSN); +// } +// return new ObjectResultDto(beginHostSN); +// } +// catch (Exception ex) +// { +// ObjectResultDto ret = new ObjectResultDto(); +// ret.Status = false; +// ret.Message = _errorMessagePrefix + "GetPrintStartHostSN2 执行出错:" + ex.Message; +// _logger.LogError(ret.Message); +// return ret; +// } +// } /// /// 打印门板装箱单 @@ -3209,334 +3209,334 @@ select min(SerialNumStr) from FisBillM110 a left join d on a.VIN=d.VIN /// /// 生产线编号列表 /// 生产线超时情况 - [UnitOfWork] - [HttpPost] - [Route("product-line-timeout-remind")] - public virtual async Task> ProductLineTimeoutRemind(TimeOutRemindInputDto input) - { - List retLst = new List(); - foreach (string plStr in input.ProductLineList) - { - TimeOutRemindResultDto retObj = new TimeOutRemindResultDto(); - retObj.ProductLine = plStr; - retObj.ConfigMinutes = _configuration[$"ConfigDic:ProductLineTimeoutRemind:{plStr}"].TryToInt() ?? 30; + //[UnitOfWork] + //[HttpPost] + //[Route("product-line-timeout-remind")] + //public virtual async Task> ProductLineTimeoutRemind(TimeOutRemindInputDto input) + //{ + // List retLst = new List(); + // foreach (string plStr in input.ProductLineList) + // { + // TimeOutRemindResultDto retObj = new TimeOutRemindResultDto(); + // retObj.ProductLine = plStr; + // retObj.ConfigMinutes = _configuration[$"ConfigDic:ProductLineTimeoutRemind:{plStr}"].TryToInt() ?? 30; - string maxSNStr = await _billM110Repository.Where(itm => itm.ProductLine == plStr).MaxAsync(itm => itm.SerialNumStr); - BillM110 lastBill = await _billM110Repository.FirstOrDefaultAsync(itm => itm.ProductLine == plStr && itm.SerialNumStr == maxSNStr); - if (lastBill != null) - { - retObj.LastReceiveTime = lastBill.ReceiveTime ?? ServerHelper.CurrentDateTime; - retObj.TimeoutMinutes = MinuteDiff(retObj.LastReceiveTime, ServerHelper.CurrentDateTime); - } - retLst.Add(retObj); - } - return new ListResultDto(retLst); - } + // string maxSNStr = await _billM110Repository.Where(itm => itm.ProductLine == plStr).MaxAsync(itm => itm.SerialNumStr); + // BillM110 lastBill = await _billM110Repository.FirstOrDefaultAsync(itm => itm.ProductLine == plStr && itm.SerialNumStr == maxSNStr); + // if (lastBill != null) + // { + // retObj.LastReceiveTime = lastBill.ReceiveTime ?? ServerHelper.CurrentDateTime; + // retObj.TimeoutMinutes = MinuteDiff(retObj.LastReceiveTime, ServerHelper.CurrentDateTime); + // } + // retLst.Add(retObj); + // } + // return new ListResultDto(retLst); + //} - private int MinuteDiff(DateTime beginTime, DateTime endTime) - { - TimeSpan beginSpan = new TimeSpan(beginTime.Ticks); - TimeSpan endSpan = new TimeSpan(endTime.Ticks); - TimeSpan diffSpan = endSpan.Subtract(beginSpan).Duration(); - return (int)(diffSpan.TotalMinutes); - } + //private int MinuteDiff(DateTime beginTime, DateTime endTime) + //{ + // TimeSpan beginSpan = new TimeSpan(beginTime.Ticks); + // TimeSpan endSpan = new TimeSpan(endTime.Ticks); + // TimeSpan diffSpan = endSpan.Subtract(beginSpan).Duration(); + // return (int)(diffSpan.TotalMinutes); + //} #endregion #region 保存报表、加载打印报表分离 //[UnitOfWork] - [UnitOfWork(IsDisabled = true)] - [HttpPost] - [Route("save-menban-report")] - public virtual async Task>> SaveMenBanReport(MenBanPrintInputDto input) - { - Stopwatch sw = new Stopwatch(); + //[UnitOfWork(IsDisabled = true)] + //[HttpPost] + //[Route("save-menban-report")] + //public virtual async Task>> SaveMenBanReport(MenBanPrintInputDto input) + //{ + // Stopwatch sw = new Stopwatch(); - _logger.LogDebug(_errorMessagePrefix + "SaveMenBanReport 进入"); + // _logger.LogDebug(_errorMessagePrefix + "SaveMenBanReport 进入"); - List retLst = new List(); - ObjectResultDto> ret = new ObjectResultDto>(); - ret.Status = false; + // List retLst = new List(); + // ObjectResultDto> ret = new ObjectResultDto>(); + // ret.Status = false; - using (var uow = _unitOfWorkManager.Begin(requiresNew: true, isTransactional: true, isolationLevel: System.Data.IsolationLevel.Unspecified)) - { - try - { - List reportMainLst = new List(); + // using (var uow = _unitOfWorkManager.Begin(requiresNew: true, isTransactional: true, isolationLevel: System.Data.IsolationLevel.Unspecified)) + // { + // try + // { + // List reportMainLst = new List(); - if (input.PrintType == PrintTypeEnum.正常打印) - { - if (input.BeginHostSN != 0 && input.EndHostSN != 0) - { - if (input.BeginHostSN > input.EndHostSN) - { - ret.Message = "止大众顺序号必须大于等于起大众顺序号!"; - ret.Status = false; - return ret; - } - } - ListResultDto tempLst = await GetMBReportDetailList(input, true); //----------------------------- - List billLst = tempLst.Item; - if (tempLst.Status == false) - { - ret.Message = tempLst.Message; - ret.Status = false; - return ret; - } + // if (input.PrintType == PrintTypeEnum.正常打印) + // { + // if (input.BeginHostSN != 0 && input.EndHostSN != 0) + // { + // if (input.BeginHostSN > input.EndHostSN) + // { + // ret.Message = "止大众顺序号必须大于等于起大众顺序号!"; + // ret.Status = false; + // return ret; + // } + // } + // ListResultDto tempLst = await GetMBReportDetailList(input, true); //----------------------------- + // List billLst = tempLst.Item; + // if (tempLst.Status == false) + // { + // ret.Message = tempLst.Message; + // ret.Status = false; + // return ret; + // } - _logger.LogWarning($"SaveMenBanReport读取数据 - {sw.ElapsedMilliseconds}毫秒"); + // _logger.LogWarning($"SaveMenBanReport读取数据 - {sw.ElapsedMilliseconds}毫秒"); - int pageCnt = (int)Math.Ceiling(billLst.Count / 12.0); //每页打印12列,取打印页数 + // int pageCnt = (int)Math.Ceiling(billLst.Count / 12.0); //每页打印12列,取打印页数 - //double maxBillNum = 0; + // //double maxBillNum = 0; - //DateTime printTime = ServerHelper.CurrentDateTime; + // //DateTime printTime = ServerHelper.CurrentDateTime; - var reportSortDic = _dicItemRepository - .Where(itm => itm.DicTypeCode == "零件大类" && itm.DicItemSort2 == input.ProductLine) - .ToList() - .GroupBy(itm => itm.DicItemSort4) - .ToDictionary(itm => itm.Key, it2 => it2.Select(itm => itm.DicItemCode).ToArray()); + // var reportSortDic = _dicItemRepository + // .Where(itm => itm.DicTypeCode == "零件大类" && itm.DicItemSort2 == input.ProductLine) + // .ToList() + // .GroupBy(itm => itm.DicItemSort4) + // .ToDictionary(itm => itm.Key, it2 => it2.Select(itm => itm.DicItemCode).ToArray()); - for (int pageIdx = 0; pageIdx < pageCnt; pageIdx++) - { + // for (int pageIdx = 0; pageIdx < pageCnt; pageIdx++) + // { - foreach (var reportSortItem in reportSortDic) - { - //生成顺序号:按生产线分组,取当前生产线的最大流水号:001至999往复循环 - double maxSN = await _lineSNDomianService.GetMaxSN(ProductTypeEnum.门板, input.ProductLine, string.Empty); + // foreach (var reportSortItem in reportSortDic) + // { + // //生成顺序号:按生产线分组,取当前生产线的最大流水号:001至999往复循环 + // double maxSN = await _lineSNDomianService.GetMaxSN(ProductTypeEnum.门板, input.ProductLine, string.Empty); - MenBanPackingList packingObj = DoMBPrint(input, pageIdx, maxSN, billLst, reportSortItem.Key, reportSortItem.Value); - reportMainLst.Add(packingObj); - } - } + // MenBanPackingList packingObj = DoMBPrint(input, pageIdx, maxSN, billLst, reportSortItem.Key, reportSortItem.Value); + // reportMainLst.Add(packingObj); + // } + // } - _logger.LogWarning($"SaveMenBanReport转换数据 - {sw.ElapsedMilliseconds}毫秒"); + // _logger.LogWarning($"SaveMenBanReport转换数据 - {sw.ElapsedMilliseconds}毫秒"); - //插入门板打印记录表 - await _menBanPackingListRepository.InsertManyAsync(reportMainLst, true); - retLst.AddRange(reportMainLst.Select(itm => itm.Id)); + // //插入门板打印记录表 + // await _menBanPackingListRepository.InsertManyAsync(reportMainLst, true); + // retLst.AddRange(reportMainLst.Select(itm => itm.Id)); - _logger.LogWarning($"SaveMenBanReport插入门板打印记录表 - {sw.ElapsedMilliseconds}毫秒"); + // _logger.LogWarning($"SaveMenBanReport插入门板打印记录表 - {sw.ElapsedMilliseconds}毫秒"); - //调用派格版库存接口 - //await SaveMiddleTable_MB(reportMainLst); + // //调用派格版库存接口 + // //await SaveMiddleTable_MB(reportMainLst); - _logger.LogWarning($"SaveMenBanReport插入中间表 - {sw.ElapsedMilliseconds}毫秒"); + // _logger.LogWarning($"SaveMenBanReport插入中间表 - {sw.ElapsedMilliseconds}毫秒"); - //更新M110的门板打印标志:BillStatus=3 - foreach (BillM110 billObj in billLst) - { - if (billObj.BillStatus == BillStatusEnum.Match) - { - billObj.SetBillStatus(BillStatusEnum.Publish); - billObj.PrintTime = ServerHelper.CurrentDateTime; - billObj.NeedReplenishPrint = 0; //不需要补打 - await _billM110Repository.UpdateAsync(billObj, true); - } - else if (billObj.BillStatus == BillStatusEnum.NotMatch) - { - //billObj.PrintTime = ServerHelper.CurrentDateTime; - billObj.NeedReplenishPrint = 1; //需要补打 - await _billM110Repository.UpdateAsync(billObj, true); - } - } + // //更新M110的门板打印标志:BillStatus=3 + // foreach (BillM110 billObj in billLst) + // { + // if (billObj.BillStatus == BillStatusEnum.Match) + // { + // billObj.SetBillStatus(BillStatusEnum.Publish); + // billObj.PrintTime = ServerHelper.CurrentDateTime; + // billObj.NeedReplenishPrint = 0; //不需要补打 + // await _billM110Repository.UpdateAsync(billObj, true); + // } + // else if (billObj.BillStatus == BillStatusEnum.NotMatch) + // { + // //billObj.PrintTime = ServerHelper.CurrentDateTime; + // billObj.NeedReplenishPrint = 1; //需要补打 + // await _billM110Repository.UpdateAsync(billObj, true); + // } + // } - _logger.LogWarning($"SaveMenBanReport更新M110的门板打印标志 - {sw.ElapsedMilliseconds}毫秒"); + // _logger.LogWarning($"SaveMenBanReport更新M110的门板打印标志 - {sw.ElapsedMilliseconds}毫秒"); - } - //else if (input.PrintType == PrintTypeEnum.重新打印) //和正常打印单据完全一样,可以打印部分单据 - //{ - // throw new BusinessException("请调用LoadMenBanReport方法!"); - //} - //else if (input.PrintType == PrintTypeEnum.补打) - //{ - // List billLst = _billM110Repository.Where(itm => input.M110IdList.Contains(itm.Id)).OrderBy(itm => itm.SerialNumStr).ToList(); - // if (billLst.Count == 0) - // { - // ret.Message = "没有补打的单据,请先选择要补打的单据!"; - // ret.Status = false; - // return ret; - // } - - // int pageCnt = (int)Math.Ceiling(billLst.Count / 12.0); //每页打印12列,取打印页数 - - // double maxBillNum = 0; - - // DateTime printTime = ServerHelper.CurrentDateTime; - - // for (int pageIdx = 0; pageIdx < pageCnt; pageIdx++) - // { - // //取右上角顺序号:按生产线分组,取当前生产线的最大流水号:01至99循环,例如01左、01右 - // double maxSN = 0; // await _lineSNDomianService.GetMaxSN(ProductTypeEnum.门板, input.ProductLine, string.Empty); - // // 先打印两张:左后左前,再打印两张:右后右前 - // List leftLst = DoMBPrint(input, pageIdx, ref maxBillNum, maxSN, printTime, billLst, "左"); - // List rightLst = DoMBPrint(input, pageIdx, ref maxBillNum, maxSN, printTime, billLst, "右"); - - // //作废时需要同时作废相同VIN的左右两页,SortId相同表示是同一组左右 - // Guid sortId = GuidGenerator.Create(); - // foreach (var leftItm in leftLst) - // { - // leftItm.SortId = sortId; - // } - // foreach (var rightItm in rightLst) - // { - // rightItm.SortId = sortId; - // } - - // reportMainLst.AddRange(rightLst); - // reportMainLst.AddRange(leftLst); - // } - // //校验底盘号、零件是否重复打印 - // string checkVinPartRepeatSql = @" - // select top 1 a.BillNum from FisMenBanPackingList a join FisMenBanPackingRec b - // on a.Id = b.MenBanPackingListId - // where a.ReportStatus = 0 - // and b.VIN = '{0}' and (TopSAPMaterialNum = '{1}' or BelowSAPMaterialNum = '{1}') - // "; - // foreach (MenBanPackingList reportMainObj in reportMainLst) - // { - // foreach (MenBanPackingRec reportRecObj in reportMainObj.Details) - // { - // string sql1 = string.Format(checkVinPartRepeatSql, reportRecObj.VIN, reportRecObj.PartCode2); - // string checkVinPartRepeatBillNum1 = _newJitDapperRepository.GetSingleBySql(sql1, true); - // if (string.IsNullOrEmpty(checkVinPartRepeatBillNum1) == false) - // { - // throw new BusinessException("1001", $"与装箱单号{checkVinPartRepeatBillNum1}中的底盘号{reportRecObj.VIN}、零件号{reportRecObj.PartCode2}之间重复!"); - // } - - // string sql2 = string.Format(checkVinPartRepeatSql, reportRecObj.VIN, reportRecObj.PartCode4); - // string checkVinPartRepeatBillNum2 = _newJitDapperRepository.GetSingleBySql(sql2, true); - // if (string.IsNullOrEmpty(checkVinPartRepeatBillNum2) == false) - // { - // throw new BusinessException("1001", $"与装箱单号{checkVinPartRepeatBillNum2}中的底盘号{reportRecObj.VIN}、零件号{reportRecObj.PartCode4}之间重复!"); - // } - // } - // } - - // //调用派格版库存接口 - // await SaveMiddleTable_MB(reportMainLst); - - // //插入门板打印记录表 - // //await _menBanPackingListRepository.InsertManyAsync(reportMainLst); - // foreach (var reportMainObj in reportMainLst) - // { - // var insObj = await _menBanPackingListRepository.InsertAsync(reportMainObj, true); - // if (insObj != null) - // { - // retLst.Add(insObj.Id); - // } - // } - // //更新M110的门板打印标志:BillStatus=3 - // foreach (BillM110 billObj in billLst) - // { - // if (billObj.BillStatus == BillStatusEnum.Match) - // { - // billObj.SetBillStatus(BillStatusEnum.Publish); - // billObj.PrintTime = ServerHelper.CurrentDateTime; - // await _billM110Repository.UpdateAsync(billObj); - // } - // } - //} //补打if - await uow.CompleteAsync(); - ret.Status = true; - ret.Item = retLst; - return ret; - } - catch (Exception ex) - { - await uow.RollbackAsync(); - string errorMsg = _errorMessagePrefix + "SaveMenBanReport 执行出错:" + ex.Message; - _logger.LogError(errorMsg); - ret.Status = false; - ret.Message = ex.Message; - return ret; - } - } //事务 - } + // } + // //else if (input.PrintType == PrintTypeEnum.重新打印) //和正常打印单据完全一样,可以打印部分单据 + // //{ + // // throw new BusinessException("请调用LoadMenBanReport方法!"); + // //} + // //else if (input.PrintType == PrintTypeEnum.补打) + // //{ + // // List billLst = _billM110Repository.Where(itm => input.M110IdList.Contains(itm.Id)).OrderBy(itm => itm.SerialNumStr).ToList(); + // // if (billLst.Count == 0) + // // { + // // ret.Message = "没有补打的单据,请先选择要补打的单据!"; + // // ret.Status = false; + // // return ret; + // // } + + // // int pageCnt = (int)Math.Ceiling(billLst.Count / 12.0); //每页打印12列,取打印页数 + + // // double maxBillNum = 0; + + // // DateTime printTime = ServerHelper.CurrentDateTime; + + // // for (int pageIdx = 0; pageIdx < pageCnt; pageIdx++) + // // { + // // //取右上角顺序号:按生产线分组,取当前生产线的最大流水号:01至99循环,例如01左、01右 + // // double maxSN = 0; // await _lineSNDomianService.GetMaxSN(ProductTypeEnum.门板, input.ProductLine, string.Empty); + // // // 先打印两张:左后左前,再打印两张:右后右前 + // // List leftLst = DoMBPrint(input, pageIdx, ref maxBillNum, maxSN, printTime, billLst, "左"); + // // List rightLst = DoMBPrint(input, pageIdx, ref maxBillNum, maxSN, printTime, billLst, "右"); + + // // //作废时需要同时作废相同VIN的左右两页,SortId相同表示是同一组左右 + // // Guid sortId = GuidGenerator.Create(); + // // foreach (var leftItm in leftLst) + // // { + // // leftItm.SortId = sortId; + // // } + // // foreach (var rightItm in rightLst) + // // { + // // rightItm.SortId = sortId; + // // } + + // // reportMainLst.AddRange(rightLst); + // // reportMainLst.AddRange(leftLst); + // // } + // // //校验底盘号、零件是否重复打印 + // // string checkVinPartRepeatSql = @" + // // select top 1 a.BillNum from FisMenBanPackingList a join FisMenBanPackingRec b + // // on a.Id = b.MenBanPackingListId + // // where a.ReportStatus = 0 + // // and b.VIN = '{0}' and (TopSAPMaterialNum = '{1}' or BelowSAPMaterialNum = '{1}') + // // "; + // // foreach (MenBanPackingList reportMainObj in reportMainLst) + // // { + // // foreach (MenBanPackingRec reportRecObj in reportMainObj.Details) + // // { + // // string sql1 = string.Format(checkVinPartRepeatSql, reportRecObj.VIN, reportRecObj.PartCode2); + // // string checkVinPartRepeatBillNum1 = _newJitDapperRepository.GetSingleBySql(sql1, true); + // // if (string.IsNullOrEmpty(checkVinPartRepeatBillNum1) == false) + // // { + // // throw new BusinessException("1001", $"与装箱单号{checkVinPartRepeatBillNum1}中的底盘号{reportRecObj.VIN}、零件号{reportRecObj.PartCode2}之间重复!"); + // // } + + // // string sql2 = string.Format(checkVinPartRepeatSql, reportRecObj.VIN, reportRecObj.PartCode4); + // // string checkVinPartRepeatBillNum2 = _newJitDapperRepository.GetSingleBySql(sql2, true); + // // if (string.IsNullOrEmpty(checkVinPartRepeatBillNum2) == false) + // // { + // // throw new BusinessException("1001", $"与装箱单号{checkVinPartRepeatBillNum2}中的底盘号{reportRecObj.VIN}、零件号{reportRecObj.PartCode4}之间重复!"); + // // } + // // } + // // } + + // // //调用派格版库存接口 + // // await SaveMiddleTable_MB(reportMainLst); + + // // //插入门板打印记录表 + // // //await _menBanPackingListRepository.InsertManyAsync(reportMainLst); + // // foreach (var reportMainObj in reportMainLst) + // // { + // // var insObj = await _menBanPackingListRepository.InsertAsync(reportMainObj, true); + // // if (insObj != null) + // // { + // // retLst.Add(insObj.Id); + // // } + // // } + // // //更新M110的门板打印标志:BillStatus=3 + // // foreach (BillM110 billObj in billLst) + // // { + // // if (billObj.BillStatus == BillStatusEnum.Match) + // // { + // // billObj.SetBillStatus(BillStatusEnum.Publish); + // // billObj.PrintTime = ServerHelper.CurrentDateTime; + // // await _billM110Repository.UpdateAsync(billObj); + // // } + // // } + // //} //补打if + // await uow.CompleteAsync(); + // ret.Status = true; + // ret.Item = retLst; + // return ret; + // } + // catch (Exception ex) + // { + // await uow.RollbackAsync(); + // string errorMsg = _errorMessagePrefix + "SaveMenBanReport 执行出错:" + ex.Message; + // _logger.LogError(errorMsg); + // ret.Status = false; + // ret.Message = ex.Message; + // return ret; + // } + // } //事务 + //} - [UnitOfWork] - [HttpPost] - [Route("load-menban-report")] - public virtual async Task> LoadMenBanReport(List input) - { - _logger.LogDebug(_errorMessagePrefix + "LoadMenBanReport 进入"); + //[UnitOfWork] + //[HttpPost] + //[Route("load-menban-report")] + //public virtual async Task> LoadMenBanReport(List input) + //{ + // _logger.LogDebug(_errorMessagePrefix + "LoadMenBanReport 进入"); - try - { - List reportMainLst = new List(); + // try + // { + // List reportMainLst = new List(); - reportMainLst = await _menBanPackingListRepository.GetListAsync(itm => input.Contains(itm.Id) == true, true); - //按大众顺序号排序 - foreach (var reportMainObj in reportMainLst) - { - List recLst = reportMainObj.Details; - if (recLst == null) - continue; - - bool has1999 = recLst.Any(itm => itm.HostSN.Contains("1999") || itm.HostSN.Contains("1998") || itm.HostSN.Contains("1997") - || itm.HostSN.Contains("1996") || itm.HostSN.Contains("1995") || itm.HostSN.Contains("1994") - || itm.HostSN.Contains("1993") || itm.HostSN.Contains("1992") || itm.HostSN.Contains("1991") - || itm.HostSN.Contains("1990") || itm.HostSN.Contains("1989") || itm.HostSN.Contains("1988") - || itm.HostSN.Contains("1987") || itm.HostSN.Contains("1986") || itm.HostSN.Contains("1985") - || itm.HostSN.Contains("1984") || itm.HostSN.Contains("1983") || itm.HostSN.Contains("1982") - || itm.HostSN.Contains("1981") || itm.HostSN.Contains("1980") || itm.HostSN.Contains("1979") - || itm.HostSN.Contains("1978") || itm.HostSN.Contains("1977") || itm.HostSN.Contains("1976") - ); - bool has0001 = recLst.Any(itm => itm.HostSN.Contains("0001") || itm.HostSN.Contains("0002") || itm.HostSN.Contains("0003") - || itm.HostSN.Contains("0004") || itm.HostSN.Contains("0005") || itm.HostSN.Contains("0006") - || itm.HostSN.Contains("0007") || itm.HostSN.Contains("0008") || itm.HostSN.Contains("0009") - || itm.HostSN.Contains("0010") || itm.HostSN.Contains("0011") || itm.HostSN.Contains("0012") - || itm.HostSN.Contains("0013") || itm.HostSN.Contains("0014") || itm.HostSN.Contains("0015") - || itm.HostSN.Contains("0016") || itm.HostSN.Contains("0017") || itm.HostSN.Contains("0018") - || itm.HostSN.Contains("0019") || itm.HostSN.Contains("0020") || itm.HostSN.Contains("0021") - || itm.HostSN.Contains("0022") || itm.HostSN.Contains("0023") || itm.HostSN.Contains("0024") - ); - if (has1999 && has0001) - { - reportMainObj.Details = recLst.OrderBy(itm => (itm.HostSN.TryToIntZero() % 10000) < 240 ? (itm.HostSN.TryToIntZero() % 10000 + 1999) : (itm.HostSN.TryToIntZero() % 10000)).ToList(); - } - else - { - reportMainObj.Details = recLst.OrderBy(itm => itm.HostSN).ToList(); - } - } + // reportMainLst = await _menBanPackingListRepository.GetListAsync(itm => input.Contains(itm.Id) == true, true); + // //按大众顺序号排序 + // foreach (var reportMainObj in reportMainLst) + // { + // List recLst = reportMainObj.Details; + // if (recLst == null) + // continue; - #region 格式转换 - //实体 转 DTO - List targetLst = ObjectMapper.Map, List>(reportMainLst); - targetLst = targetLst.OrderBy(itm => itm.BillNum).ToList(); + // bool has1999 = recLst.Any(itm => itm.HostSN.Contains("1999") || itm.HostSN.Contains("1998") || itm.HostSN.Contains("1997") + // || itm.HostSN.Contains("1996") || itm.HostSN.Contains("1995") || itm.HostSN.Contains("1994") + // || itm.HostSN.Contains("1993") || itm.HostSN.Contains("1992") || itm.HostSN.Contains("1991") + // || itm.HostSN.Contains("1990") || itm.HostSN.Contains("1989") || itm.HostSN.Contains("1988") + // || itm.HostSN.Contains("1987") || itm.HostSN.Contains("1986") || itm.HostSN.Contains("1985") + // || itm.HostSN.Contains("1984") || itm.HostSN.Contains("1983") || itm.HostSN.Contains("1982") + // || itm.HostSN.Contains("1981") || itm.HostSN.Contains("1980") || itm.HostSN.Contains("1979") + // || itm.HostSN.Contains("1978") || itm.HostSN.Contains("1977") || itm.HostSN.Contains("1976") + // ); + // bool has0001 = recLst.Any(itm => itm.HostSN.Contains("0001") || itm.HostSN.Contains("0002") || itm.HostSN.Contains("0003") + // || itm.HostSN.Contains("0004") || itm.HostSN.Contains("0005") || itm.HostSN.Contains("0006") + // || itm.HostSN.Contains("0007") || itm.HostSN.Contains("0008") || itm.HostSN.Contains("0009") + // || itm.HostSN.Contains("0010") || itm.HostSN.Contains("0011") || itm.HostSN.Contains("0012") + // || itm.HostSN.Contains("0013") || itm.HostSN.Contains("0014") || itm.HostSN.Contains("0015") + // || itm.HostSN.Contains("0016") || itm.HostSN.Contains("0017") || itm.HostSN.Contains("0018") + // || itm.HostSN.Contains("0019") || itm.HostSN.Contains("0020") || itm.HostSN.Contains("0021") + // || itm.HostSN.Contains("0022") || itm.HostSN.Contains("0023") || itm.HostSN.Contains("0024") + // ); + // if (has1999 && has0001) + // { + // reportMainObj.Details = recLst.OrderBy(itm => (itm.HostSN.TryToIntZero() % 10000) < 240 ? (itm.HostSN.TryToIntZero() % 10000 + 1999) : (itm.HostSN.TryToIntZero() % 10000)).ToList(); + // } + // else + // { + // reportMainObj.Details = recLst.OrderBy(itm => itm.HostSN).ToList(); + // } + // } - //子表BillNum赋值, BillNum填充空格 - foreach (var masterObj in targetLst) - { - masterObj.BillNum = GetTrueString(masterObj.BillNum); - int sn = 1; - foreach (var detailObj in masterObj.Details) - { - detailObj.BillNum = masterObj.BillNum; - detailObj.KNR = GetTrueString(detailObj.KNR); - detailObj.SN = (sn++).ToString(); - detailObj.VIN = detailObj.VIN.TryToRight(6); //底盘号返回后六位 - } - } - #endregion - return targetLst; - } - catch (Exception ex) - { - string errorMsg = _errorMessagePrefix + "LoadMenBanReport 执行出错:" + ex.Message; - _logger.LogError(errorMsg); - throw new UserFriendlyException(errorMsg); - } - } + // #region 格式转换 + // //实体 转 DTO + // List targetLst = ObjectMapper.Map, List>(reportMainLst); + // targetLst = targetLst.OrderBy(itm => itm.BillNum).ToList(); - private static string GetTrueString(string str) - { - return str == null ? " " : str.Trim(); ; - } + // //子表BillNum赋值, BillNum填充空格 + // foreach (var masterObj in targetLst) + // { + // masterObj.BillNum = GetTrueString(masterObj.BillNum); + // int sn = 1; + // foreach (var detailObj in masterObj.Details) + // { + // detailObj.BillNum = masterObj.BillNum; + // detailObj.KNR = GetTrueString(detailObj.KNR); + // detailObj.SN = (sn++).ToString(); + // detailObj.VIN = detailObj.VIN.TryToRight(6); //底盘号返回后六位 + // } + // } + // #endregion + // return targetLst; + // } + // catch (Exception ex) + // { + // string errorMsg = _errorMessagePrefix + "LoadMenBanReport 执行出错:" + ex.Message; + // _logger.LogError(errorMsg); + // throw new UserFriendlyException(errorMsg); + // } + //} + + //private static string GetTrueString(string str) + //{ + // return str == null ? " " : str.Trim(); ; + //} /// /// 打印柱护板装箱单 diff --git a/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/WY.NewJit.Application.xml b/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/WY.NewJit.Application.xml index 0af46ef..eaa1594 100644 --- a/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/WY.NewJit.Application.xml +++ b/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/WY.NewJit.Application.xml @@ -1013,6 +1013,20 @@ 根据筛选条件获取实体列表 + + + 包含主表横向排列零件字段 + + + + + + + 填充M110主表横向零件字段 + + + + 根据条件取用于打印的门板单据列表 @@ -1031,17 +1045,16 @@ - + 打印左侧或右侧门板 - - - + 报表分类,dui + 零件大类字典项 @@ -1118,6 +1131,11 @@ 生产线编号列表 生产线超时情况 + + + 零件在主表横向排列显示的列名 + + M100单据管理应用服务实现 @@ -1405,22 +1423,6 @@ - - - 打印前检查大众顺序号是否断号 - - - 断号时Item不为空 - - - - 根据生产线获取正常打印单据的起始大众顺序号2 - - 生产线 - 柱护板是1 门板是非1 - 柱护板分组类型 - 起始大众顺序号 - 根据筛选条件获取分页实体列表 @@ -1472,13 +1474,6 @@ 导入文件流 执行成功返回真 - - - 生产线超时提醒 - - 生产线编号列表 - 生产线超时情况 - R100单据管理应用服务实现 diff --git a/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain.Shared/Common/ObjectResultDto.cs b/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain.Shared/Common/ObjectResultDto.cs index b750ab7..a7bb060 100644 --- a/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain.Shared/Common/ObjectResultDto.cs +++ b/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain.Shared/Common/ObjectResultDto.cs @@ -7,7 +7,6 @@ namespace WY.NewJit public class ObjectResultDto { - private bool isRepeat; public ObjectResultDto() { @@ -15,11 +14,6 @@ namespace WY.NewJit this.Message = ""; } - public ObjectResultDto(bool isRepeat) - { - this.isRepeat = isRepeat; - } - public ObjectResultDto(bool status, string errorMessage) { this.Status = status; diff --git a/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain.Shared/MsgCheck/BillStatusEnum.cs b/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain.Shared/MsgCheck/BillStatusEnum.cs index 4c29e6d..2660c33 100644 --- a/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain.Shared/MsgCheck/BillStatusEnum.cs +++ b/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain.Shared/MsgCheck/BillStatusEnum.cs @@ -13,13 +13,13 @@ namespace WY.NewJit.MsgCheck /// /// 未匹配 /// - [Description("未匹配")] - NotMatch = 1, + //[Description("未匹配")] + //NotMatch = 1, /// /// 已匹配,未打印 /// - [Description("已匹配")] + [Description("未打印")] Match = 2, /// diff --git a/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgBaseData/Entitys/DicItem.cs b/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgBaseData/Entitys/DicItem.cs index 4a882cf..74623e1 100644 --- a/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgBaseData/Entitys/DicItem.cs +++ b/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgBaseData/Entitys/DicItem.cs @@ -48,10 +48,32 @@ namespace WY.NewJit.MsgBaseData public virtual string DicItemSort4 { get; set; } /// - /// 分类5 + /// 分类5 (零件大类对应客户零件号) /// public virtual string DicItemSort5 { get; set; } + /// + /// 分类6(零件大类对应显示车型) + /// + public virtual string DicItemSort6 { get; set; } + + /// + /// 分类7(零件大类对应报表字段显示顺序) + /// + public virtual string DicItemSort7 { get; set; } + + /// + /// 分类8(零件大类对应装箱清单号的前缀,例如C或T) + /// + public virtual string DicItemSort8 { get; set; } + + /// + /// 分类9(零件大类对应 打印标准数量 12 或 24) + /// + public virtual string DicItemSort9 { get; set; } + + + protected DicItem() { //此构造函数是提供给ORM用来从数据库中获取实体. diff --git a/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgBaseData/Services/LineSNDomianService.cs b/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgBaseData/Services/LineSNDomianService.cs index 42c4a0a..41cc749 100644 --- a/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgBaseData/Services/LineSNDomianService.cs +++ b/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgBaseData/Services/LineSNDomianService.cs @@ -19,7 +19,7 @@ namespace WY.NewJit.MsgBaseData } /// - /// 生成门板或柱护板右上角顺序号 + /// 生成门板或柱护板右上角顺序号,每天零点开始往复循环1-99 /// /// 门板或柱护板 /// 产线 @@ -38,7 +38,7 @@ namespace WY.NewJit.MsgBaseData } DateTime now = DateTime.Now; - DateTime today8 = new DateTime(now.Year, now.Month, now.Day, 8, 0, 0); + DateTime today8 = new DateTime(now.Year, now.Month, now.Day, 0, 0, 0); if (typeObj != null) { diff --git a/Shared/Win.Sfs.Shared/obj/Debug/netcoreapp5/Win.Sfs.Shared.AssemblyInfo.cs b/Shared/Win.Sfs.Shared/obj/Debug/netcoreapp5/Win.Sfs.Shared.AssemblyInfo.cs index 09328bf..4bf6f0b 100644 --- a/Shared/Win.Sfs.Shared/obj/Debug/netcoreapp5/Win.Sfs.Shared.AssemblyInfo.cs +++ b/Shared/Win.Sfs.Shared/obj/Debug/netcoreapp5/Win.Sfs.Shared.AssemblyInfo.cs @@ -14,7 +14,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("Win.Sfs.Shared")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("2.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("2.0.0+9f1698b0f932dfc3e8d926fe272b9e5c15605da4")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("2.0.0+55c68df95edc067cefe3d74120d28daebdd00649")] [assembly: System.Reflection.AssemblyProductAttribute("Win.Sfs.Shared")] [assembly: System.Reflection.AssemblyTitleAttribute("Win.Sfs.Shared")] [assembly: System.Reflection.AssemblyVersionAttribute("2.0.0.0")] diff --git a/Shared/Win.Sfs.Shared/obj/Debug/netcoreapp5/Win.Sfs.Shared.AssemblyInfoInputs.cache b/Shared/Win.Sfs.Shared/obj/Debug/netcoreapp5/Win.Sfs.Shared.AssemblyInfoInputs.cache index 07049b5..6bbb8b8 100644 --- a/Shared/Win.Sfs.Shared/obj/Debug/netcoreapp5/Win.Sfs.Shared.AssemblyInfoInputs.cache +++ b/Shared/Win.Sfs.Shared/obj/Debug/netcoreapp5/Win.Sfs.Shared.AssemblyInfoInputs.cache @@ -1 +1 @@ -d755eed168280a373eeb0870bc5023deded8bf4c7a53f8c511dbfc9601ca31ed +48b37d1c823a2c28ae1847b40d58f961e3a2bcf25479d6132ccf6601b7861fc4 diff --git a/Shared/Win.Utils/obj/Debug/netcoreapp5/Win.Utils.AssemblyInfo.cs b/Shared/Win.Utils/obj/Debug/netcoreapp5/Win.Utils.AssemblyInfo.cs index 7d9588d..69ddc12 100644 --- a/Shared/Win.Utils/obj/Debug/netcoreapp5/Win.Utils.AssemblyInfo.cs +++ b/Shared/Win.Utils/obj/Debug/netcoreapp5/Win.Utils.AssemblyInfo.cs @@ -14,7 +14,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("Win.Utils")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("2.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("2.0.0+32f3c7c4f91a6e47f64ef11cb91719a67226370a")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("2.0.0+55c68df95edc067cefe3d74120d28daebdd00649")] [assembly: System.Reflection.AssemblyProductAttribute("Win.Utils")] [assembly: System.Reflection.AssemblyTitleAttribute("Win.Utils")] [assembly: System.Reflection.AssemblyVersionAttribute("2.0.0.0")] diff --git a/Shared/Win.Utils/obj/Debug/netcoreapp5/Win.Utils.AssemblyInfoInputs.cache b/Shared/Win.Utils/obj/Debug/netcoreapp5/Win.Utils.AssemblyInfoInputs.cache index 0b62015..be5fb63 100644 --- a/Shared/Win.Utils/obj/Debug/netcoreapp5/Win.Utils.AssemblyInfoInputs.cache +++ b/Shared/Win.Utils/obj/Debug/netcoreapp5/Win.Utils.AssemblyInfoInputs.cache @@ -1 +1 @@ -b809d5ff0b4e2ed0d2cfb967cbf1ed268b666995e296a8a123408bdd3804a21c +319ab87b608dd5265bea28a1b45afd1f00fabe88367ebb4631ed6d98436c50fc