From 1d5b460550b344712e8d2e712154f4b93dbed51d Mon Sep 17 00:00:00 2001
From: wanggang <76527413@qq.com>
Date: Tue, 12 Sep 2023 08:47:55 +0800
Subject: [PATCH 1/6] update

---
 .../wwwroot/router/business.js                         | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

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)
+      // ),
     ],
   };
 }

From 6bf42f27390ca7b75cbcf5c68fc749fafa71b483 Mon Sep 17 00:00:00 2001
From: mahao <hao.ma@ccwin-in.com>
Date: Tue, 12 Sep 2023 09:04:59 +0800
Subject: [PATCH 2/6] up

---
 .../Entities/BQ/Dtos/BBAC_SA_DTO.cs           | 37 +------------------
 .../Entities/Prices/PriceListAppService.cs    |  6 +--
 .../Entities/Prices/PriceListAppServiceBJ.cs  |  6 +--
 3 files changed, 7 insertions(+), 42 deletions(-)

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<Guid>
 /// <summary>
 /// BBAC结算导入请求
 /// </summary>
-public class BBACSaImportRequestDto //: IValidatableObject
+public class BBACSaImportRequestDto
 {
     /// <summary>
     /// 文件
@@ -119,42 +119,7 @@ public class BBACSaImportRequestDto //: IValidatableObject
     /// </summary>
     [Display(Name = "地点")]
     [Required(ErrorMessage = "{0}必须填写")]
-    //[ValidateSite(Sites = new string[] { "1040", "1046" }, ErrorMessage = "{0}值无效")]
     public string Site { get; set; }
-
-    //public IEnumerable<ValidationResult> 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);
-    //}
 }
 
 /// <summary>
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<PriceList>
     /// </summary>
     private List<PriceList> CheckPriceListContinuity(List<PriceList> priceList)
     {
-        var pricelist = new List<PriceList>();
+        var result = new List<PriceList>();
         if (priceList.Count <= 1)
         {
             return priceList; // 只有一个或零个价格条目
@@ -167,11 +167,11 @@ public class PriceListAppService : SettleAccountApplicationBase<PriceList>
             {
                 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; // 所有价格时间都连续
     }
 
     /// <summary>
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<PriceListBJ>
     /// </summary>
     private List<PriceListBJ> CheckPriceListContinuity(List<PriceListBJ> priceList)
     {
-        var pricelist = new List<PriceListBJ>();
+        var result = new List<PriceListBJ>();
         if (priceList.Count <= 1)
         {
             return priceList; // 只有一个或零个价格条目
@@ -151,12 +151,12 @@ public class PriceListAppServiceBJ : SettleAccountApplicationBase<PriceListBJ>
             {
                 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;
     }
 
     /// <summary>

From 65da89abf7c176f76495031d6593ab7d59cb1f00 Mon Sep 17 00:00:00 2001
From: wanggang <76527413@qq.com>
Date: Tue, 12 Sep 2023 09:20:00 +0800
Subject: [PATCH 3/6] update

---
 .../SettleAccount.Application/Entities/BQ/VmiAppService.cs  | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

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..6d9a0f7d 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;
@@ -193,7 +192,7 @@ public class VmiAppService : Controller, IApplicationService, IJobService, ITran
             query = query.Where(input.Filters.ToLambda<VmiBalance>());
         }
         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<VmiBalanceSumDto>(totalCount, entities);
@@ -506,7 +505,7 @@ public class VmiAppService : Controller, IApplicationService, IJobService, ITran
             {
                 var row = ws.Row(rowIndex);
                 var model = Activator.CreateInstance<T>();
-                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; }//原始
 

From dde7bb033f4b56dc16a4d6d40253e044edfcaef0 Mon Sep 17 00:00:00 2001
From: wanggang <76527413@qq.com>
Date: Tue, 12 Sep 2023 09:36:26 +0800
Subject: [PATCH 4/6] update

---
 .../wwwroot/components/table/index.js                      | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

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`<div class="app-table el-table" ref="tableRef">
@@ -37,7 +38,10 @@ export default {
           </template>
         </template>
         <div class="cell el-table__cell" :class="key" v-else-if="!item.hidden">
-          <div class="cell">{{row[key]}}</div>
+          <div class="cell">
+            <template v-if="item.input==='datetime'">{{dayjs(model[prop]).format('YYYY-MM-DD HH:mm:ss')}}</template>
+            <template v-else>{{row[key]}}</template>
+          </div>
         </div>
       </template>
     </div>
@@ -96,6 +100,7 @@ export default {
       checkAllClick,
       getSelection,
       clearSelection,
+      dayjs,
     };
   },
 };

From 572dda8ddf526e2654d079e4848d69acf5ca825e Mon Sep 17 00:00:00 2001
From: wanggang <76527413@qq.com>
Date: Tue, 12 Sep 2023 10:02:57 +0800
Subject: [PATCH 5/6] update

---
 .../SettleAccount.Application/Entities/BQ/VmiAppService.cs    | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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 6d9a0f7d..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
@@ -85,11 +85,11 @@ public class VmiAppService : Controller, IApplicationService, IJobService, ITran
     /// Excel 转 JSON
     /// </summary>
     [HttpPost, Consumes("multipart/form-data")]
-    public async Task<List<PUB_ADJ_DETAIL_IMP_DTO>> ExcelToJSONAsync(List<IFormFile> files)
+    public async Task<List<PUB_ADJ_DETAIL_DTO>> ExcelToJSONAsync(List<IFormFile> files)
     {
         using var ms = new MemoryStream();
         await files.FirstOrDefault().OpenReadStream().CopyToAsync(ms).ConfigureAwait(false);
-        return this.ImportInternal<PUB_ADJ_DETAIL_IMP_DTO>(ms.ToArray()).Select(o => o.Item1).ToList();
+        return this.ImportInternal<PUB_ADJ_DETAIL_DTO>(ms.ToArray()).Select(o => o.Item1).ToList();
     }
 
     /// <summary>

From 1691e4e70fcf14bf506f32157484623423367b31 Mon Sep 17 00:00:00 2001
From: mahao <hao.ma@ccwin-in.com>
Date: Tue, 12 Sep 2023 10:16:51 +0800
Subject: [PATCH 6/6] up

---
 .../JisBBACSeEdiCompareExportService.cs       |  3 -
 .../Report/PubSaSeCompareExportService.cs     | 12 +--
 .../Report/SaSeCompareExportBaseService.cs    | 88 +++++++++++++------
 3 files changed, 67 insertions(+), 36 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 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<PUB_SA_DETAIL>()
-                          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<PUB_SE_DETAIL>()
+                          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
 
         /// <summary>
         /// 获取比对数据
+        /// 印度件根据客户零件号对比
         /// </summary>
         private List<SaSeCompareDiff> GetSaSeCompareDataYinDu(int version)
         {
             //结算
             var saGroup = from sa in _settleAccountDbContext.Set<PUB_SA_DETAIL>()
-                          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<PUB_SE_DETAIL>()
+                          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<TSaDetail>()
-                          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<TSeDetail>()
+                          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;
         }