Browse Source

厂内客户物料号替换

master
mahao 1 year ago
parent
commit
2aaef17a1f
  1. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Startup.cs
  2. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_SA_DTO.cs
  3. 93
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_SA_DTO.cs
  4. 24
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/TB_RePartsRelationship_DTO.cs
  5. 22
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_SERVICE.cs
  6. 180
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs
  7. 102
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeEdiCompareAppService.cs
  8. 1
      code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs

2
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Startup.cs

@ -29,6 +29,7 @@ public class Startup
options.MimeTypes = ResponseCompressionDefaults.MimeTypes.Concat(new[] { "image/svg+xml" });
});
services.AddScheduler();
services.AddSingleton<JisHBPOSeEdiCompareAppService>();
services.AddSignalR(o => o.EnableDetailedErrors = true);
JobHostdService.AddService(services);
services.AddSingleton<JobHostdService>();
@ -56,6 +57,7 @@ public class Startup
app.UseEndpoints(endpoints => endpoints.MapHub<PageHub>("/api/hub"));
app.ApplicationServices.UseScheduler(scheduler =>
{
scheduler.Schedule<JisHBPOSeEdiCompareAppService>().EverySeconds(10);
});
var contentTypeProvider = new FileExtensionContentTypeProvider();
contentTypeProvider.Mappings.Add(".mjs", "text/javascript");

2
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_SA_DTO.cs

@ -87,7 +87,7 @@ public class HBPO_SA_DETAIL_IMPORT_DTO
[Display(Name = "PartNumber")]
[Required(ErrorMessage = "{0}不能为空")]
[ImporterHeader(Name = "PartNumber")]
public string LU { get; set; }
public string PartCode { get; set; }
/// <summary>
/// 数量

93
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_SA_DTO.cs

@ -76,12 +76,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
public DateTime SettleDate { set; get; }
/// <summary>
/// 零件号
/// 客户零件号
/// </summary>
[Display(Name = "Material")]
[Required(ErrorMessage = "{0}不能为空")]
[ImporterHeader(Name = "Material")]
public string LU { get; set; }
public string PartCode { get; set; }
/// <summary>
/// 生产号
@ -120,12 +120,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
public DateTime SettleDate { set; get; }
/// <summary>
/// 零件号
/// 客户零件号
/// </summary>
[Display(Name = "零件号")]
[Required(ErrorMessage = "{0}不能为空")]
[ImporterHeader(Name = "零件号")]
public string LU { get; set; }
public string PartCode { get; set; }
/// <summary>
/// 生产号
@ -164,12 +164,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
public DateTime SettleDate { set; get; }
/// <summary>
/// 零件号
/// 客户零件号
/// </summary>
[Display(Name = "零件号")]
[Required(ErrorMessage = "{0}不能为空")]
[ImporterHeader(Name = "零件号")]
public string LU { get; set; }
public string PartCode { get; set; }
/// <summary>
/// 生产号
@ -208,12 +208,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
public DateTime SettleDate { set; get; }
/// <summary>
/// 零件号
/// 客户零件号
/// </summary>
[Display(Name = "零件号")]
[Required(ErrorMessage = "{0}不能为空")]
[ImporterHeader(Name = "零件号")]
public string LU { get; set; }
public string PartCode { get; set; }
/// <summary>
/// 生产号
@ -252,12 +252,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
public DateTime SettleDate { set; get; }
/// <summary>
/// 零件号
/// 客户零件号
/// </summary>
[Display(Name = "Material")]
[Required(ErrorMessage = "{0}不能为空")]
[ImporterHeader(Name = "Material")]
public string LU { get; set; }
public string PartCode { get; set; }
/// <summary>
/// 生产号
@ -283,79 +283,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
public string GroupNum { get; set; }
}
/// <summary>
/// 导入
/// </summary>
public class PUB_SA_DETAIL_IMPORT_DTO
{
///// <summary>
///// 期间
///// </summary>
//public int Version { set; get; }
///// <summary>
///// 单价
///// </summary>
//public decimal Price { set; get; }
///// <summary>
///// 结算单
///// </summary>
//public string BillNum { set; get; }
/// <summary>
/// 结算日期
/// </summary>
[Display(Name = "结算日期")]
[ImporterHeader(Name = "Pstng Date")]
public DateTime SettleDate { set; get; }
/// <summary>
/// 零件号
/// </summary>
[Display(Name = "零件号")]
[Required(ErrorMessage = "{0}不能为空")]
[ImporterHeader(Name = "Material")]
public string LU { get; set; }
/// <summary>
/// 生产号
/// </summary>
[Display(Name = "生产号")]
[ImporterHeader(Name = "External Delivery ID")]
[Required(ErrorMessage = "{0}不能为空")]
public string PN { get; set; }
///// <summary>
///// 组合键值(LU+PN)
///// </summary>
//public string KeyCode
//{
// get => LU + PN;
//}
///// <summary>
/// 数量
/// </summary>
[Display(Name = "数量")]
[ImporterHeader(Name = "Quantity")]
public decimal Qty { get; set; }
/// <summary>
/// 结算分组号
/// </summary>
[Display(Name = "结算分组号")]
[ImporterHeader(Name = "Delivery")]
[Required(ErrorMessage = "{0}不能为空")]
public string GroupNum { get; set; }
/////// <summary>
/////// 工厂地点
/////// </summary>
////[Display(Name = "工厂地点")]
////public string Site { get; set; }
}
/// <summary>
/// 结算明细导出请求
/// </summary>

24
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/TB_RePartsRelationship_DTO.cs

@ -41,11 +41,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
public class TB_RePartsRelationship_IMPORT_DTO
{
/// <summary>
/// 客户物料号
/// 厂内物料号
/// </summary>
[Display(Name = "客户物料号")]
[Display(Name = "厂内物料号")]
[Required(ErrorMessage = "{0}是必填项")]
[ImporterHeader(Name = "客户物料号")]
[ImporterHeader(Name = "厂内物料号")]
public string LU { set; get; }
/// <summary>
@ -56,11 +56,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
public EnumBusinessType BusinessType { get; set; }
/// <summary>
/// 替换客户物料号
/// 替换厂内物料号
/// </summary>
[Display(Name = "替换客户物料号")]
[Display(Name = "替换厂内物料号")]
[Required(ErrorMessage = "{0}是必填项")]
[ImporterHeader(Name = "替换客户物料号")]
[ImporterHeader(Name = "替换厂内物料号")]
public string RepLU { set; get; }
}
@ -70,10 +70,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
public class TB_RePartsRelationship_EXPORT_DTO
{
/// <summary>
/// 零件
/// 厂内物料
/// </summary>
[Display(Name = "零件号")]
[ExporterHeader(DisplayName = "客户物料号")]
[Display(Name = "厂内物料号")]
[ExporterHeader(DisplayName = "厂内物料号")]
public string LU { set; get; }
/// <summary>
@ -84,10 +84,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
public EnumBusinessType BusinessType { get; set; }
/// <summary>
/// 替换零件
/// 替换厂内物料
/// </summary>
[Display(Name = "替换零件号")]
[ExporterHeader(DisplayName = "替换客户物料号")]
[Display(Name = "替换厂内物料号")]
[ExporterHeader(DisplayName = "替换厂内物料号")]
public string RepLU { set; get; }
}

22
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_SERVICE.cs

@ -323,20 +323,19 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase<HBPO_SA>
hbpoSaDetails.ForEach(hbpoSaDetail =>
{
List<string> luList = hbpoSaDetail.LU.Split(" ").ToList();
hbpoSaDetail.LU = luList[0].Replace(" ", "");
if (luList.Count > 1)
List<string> partCodes = hbpoSaDetail.PartCode.Split(" ").ToList();
hbpoSaDetail.PartCode = partCodes[0].Replace(" ", "");
if (partCodes.Count > 1)
{
luList.RemoveAt(0);
var luAssemble = luList.Select(t => t.Replace(" ", ""));
hbpoSaDetail.LU += luAssemble.Aggregate(" ", (current, index) => current + index);
partCodes.RemoveAt(0);
var luAssemble = partCodes.Select(t => t.Replace(" ", ""));
hbpoSaDetail.PartCode += luAssemble.Aggregate(" ", (current, index) => current + index);
}
hbpoSaDetail.BillNum = hbpoSaBillNum;
hbpoSaDetail.KeyCode = hbpoSaDetail.PN + hbpoSaDetail.LU;
//根据物料号、结算日期获取价格
var priceListEntity = priceListEntitys.Find(t => t.LU == hbpoSaDetail.LU && hbpoSaDetail.SettleDate > t.BeginTime && hbpoSaDetail.SettleDate < t.EndTime);
var priceListEntity = priceListEntitys.Find(t => t.LU == hbpoSaDetail.PartCode && hbpoSaDetail.SettleDate > t.BeginTime && hbpoSaDetail.SettleDate < t.EndTime);
hbpoSaDetail.Price = priceListEntity?.Price ?? default;
hbpoSaDetail.BusinessType = _businessType;
});
@ -358,6 +357,13 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase<HBPO_SA>
var materialRelationship = new MaterialRelationship(GuidGenerator.Create(), t.Replace(" ", "-"), "", t, _businessType.ToString());
materialRelationships.Add(materialRelationship);
});
var seAllMaterialRelationships = materialRelationshipEntitys.Union(materialRelationships);
hbpoSaDetails.ForEach(hbpoSaDetail =>
{
hbpoSaDetail.LU = seAllMaterialRelationships.FirstOrDefault(t => t.SettleMaterialCode == hbpoSaDetail.PartCode)?.ErpMaterialCode ?? hbpoSaDetail.PartCode.Replace(" ", "-");
hbpoSaDetail.KeyCode = hbpoSaDetail.PN + hbpoSaDetail.LU;
});
#endregion
#region 入库数据赋值

180
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs

@ -278,158 +278,6 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
#endregion
#region 私有方法
/// <summary>
/// 导入
/// </summary>
[Obsolete(message: "过时废弃")]
private async Task<string> ImportAsync([FromForm] IFormFileCollection files, EnumBusinessType businessType)
{
//数据校验
var checkList = new List<ErrorExportDto>();
//结算单号
var pubSaBillNum = OrderNumberGenerator.GenerateOrderNumber("SA");
//结算主表
var pubSa = new PUB_SA()
{
BillNum = pubSaBillNum,
State = "1",
BusinessType = businessType
};
//结算明细
var pubSaDetails = new List<PUB_SA_DETAIL>();
//可结算单号
var pubCanSaBillNum = OrderNumberGenerator.GenerateOrderNumber("C");
//可结算主表
var pubCanSa = new PUB_CAN_SA()
{
BillNum = pubCanSaBillNum,
SettleBillNum = pubSaBillNum,
State = SettleBillState.,
BusinessType = businessType
};
//可结算明细
var pubCanSaDetails = new List<PUB_CAN_SA_DETAIL>();
//不可结算明细
var pubNotSaDetails = new List<PUB_NOT_SA_DETAIL>();
//客户零件关系
var materialRelationships = new List<MaterialRelationship>();
#region 导入数据转换、数据校验
ExportImporter _exportImporter = new ExportImporter();
var result = await _exportImporter.UploadExcelImport<PUB_SA_DETAIL_IMPORT_DTO>(files, _excelImportService);
var importPubSaDetails = ObjectMapper.Map<List<PUB_SA_DETAIL_IMPORT_DTO>, List<PUB_SA_DETAIL>>(result);
//结算分组号
var pubSaGroupNums = importPubSaDetails.Select(t => t.GroupNum).Distinct();
//已存在的结算分组号
var havPubSaGroupNums = (await _pubSaDetailRepository.GetListAsync(t => pubSaGroupNums.Contains(t.GroupNum))).Select(t => t.GroupNum).Distinct();
if (havPubSaGroupNums.Any() == true)
{
foreach (var item in havPubSaGroupNums)
{
checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, $"结算分组号{item}已存在", string.Empty));
}
//throw new UserFriendlyException($"导入失败,结算分组号({string.Join(",", havPubSaGroupNums)})已存在", "400");
}
if (checkList.Count > 0)
{
return await ExportErrorReportAsync(checkList);
}
#endregion
#region 处理结算数据
//销售价格
var priceListEntitys = await _priceListRepository.GetAllAsync();
importPubSaDetails.ForEach(importPubSaDetail =>
{
List<string> luList = importPubSaDetail.LU.Split(" ").ToList();
importPubSaDetail.LU = luList[0].Replace(" ", "");
if (luList.Count > 1)
{
luList.RemoveAt(0);
var luAssemble = luList.Select(t => t.Replace(" ", ""));
importPubSaDetail.LU += luAssemble.Aggregate(" ", (current, index) => current + index);
}
importPubSaDetail.BillNum = pubSaBillNum;
importPubSaDetail.Site = "XX工厂";
importPubSaDetail.KeyCode = importPubSaDetail.PN + importPubSaDetail.LU;
//根据物料号、结算日期获取价格
var priceListEntity = priceListEntitys.Find(t => t.LU == importPubSaDetail.LU && importPubSaDetail.SettleDate > t.BeginTime && importPubSaDetail.SettleDate < t.EndTime);
importPubSaDetail.Price = priceListEntity?.Price ?? 0;
});
//导入的零件号集合
var importPubSaLUs = importPubSaDetails.Select(t => t.LU).Distinct();
var materialRelationshipEntitys = await _materialRelationshipRepository.GetListAsync(t => importPubSaLUs.Contains(t.SettleMaterialCode));
var materialRelationshipEntitySettleMaterialCodes = materialRelationshipEntitys.Select(t => t.SettleMaterialCode).Distinct();
/*
* ()
*
* 6-
*/
var noExistSettleMaterialCodes = importPubSaLUs.Except(materialRelationshipEntitySettleMaterialCodes);
noExistSettleMaterialCodes.ForEach(t =>
{
var materialRelationship = new MaterialRelationship(GuidGenerator.Create(), t.Replace(" ", "-"), "", t, businessType.ToString());
materialRelationships.Add(materialRelationship);
});
#endregion
#region 入库数据赋值
//结算明细
pubSaDetails = importPubSaDetails;
//不可结算 结算分组号码(根据价格区分结算、不可结算)
var pubNotSaGroupNums = importPubSaDetails.FindAll(t => t.Price == default(decimal)).Select(t => t.GroupNum).Distinct();
var pubSaDetailsCanSes = importPubSaDetails.FindAll(t => pubNotSaGroupNums.Contains(t.GroupNum) == false);
var pubSaDetailsNotCanSes = importPubSaDetails.FindAll(t => pubNotSaGroupNums.Contains(t.GroupNum) == true);
//可结算明细
pubCanSaDetails = ObjectMapper.Map<List<PUB_SA_DETAIL>, List<PUB_CAN_SA_DETAIL>>(pubSaDetailsCanSes);
//不可结算明细
pubNotSaDetails = ObjectMapper.Map<List<PUB_SA_DETAIL>, List<PUB_NOT_SA_DETAIL>>(pubSaDetailsNotCanSes);
#endregion
#region 添加入库
await _repository.InsertAsync(pubSa);
await _pubSaDetailRepository.InsertManyAsync(importPubSaDetails);
if (pubCanSaDetails.Count > 0)
{
pubCanSa.InvGroupNum = pubCanSaDetails.Count.ToString();
pubCanSaDetails.ForEach(pubCanSaDetail =>
{
pubCanSaDetail.BillNum = pubCanSaDetail.InvGroupNum = pubCanSaBillNum;
pubCanSaDetail.BusinessType = businessType;
});
await _pubCanSaRepository.InsertAsync(pubCanSa);
await _pubCanSaDetailRepository.InsertManyAsync(pubCanSaDetails);
}
if (pubNotSaDetails.Count > 0)
{
pubNotSaDetails.ForEach(pubNotSaDetail =>
{
pubNotSaDetail.BusinessType = businessType;
});
await _pubNotSaDetailRepository.InsertManyAsync(pubNotSaDetails);
}
if (materialRelationships.Count > 0)
{
await _materialRelationshipRepository.InsertManyAsync(materialRelationships);
}
#endregion
return ApplicationConsts.SuccessStr;
}
/// <summary>
/// 直供件BBAC导入
/// </summary>
@ -601,28 +449,27 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
pubSaDetails.ForEach(importPubSaDetail =>
{
List<string> luList = importPubSaDetail.LU.Split(" ").ToList();
importPubSaDetail.LU = luList[0].Replace(" ", "");
if (luList.Count > 1)
List<string> partCodes = importPubSaDetail.PartCode.Split(" ").ToList();
importPubSaDetail.PartCode = partCodes[0].Replace(" ", "");
if (partCodes.Count > 1)
{
luList.RemoveAt(0);
var luAssemble = luList.Select(t => t.Replace(" ", ""));
importPubSaDetail.LU += luAssemble.Aggregate(" ", (current, index) => current + index);
partCodes.RemoveAt(0);
var luAssemble = partCodes.Select(t => t.Replace(" ", ""));
importPubSaDetail.PartCode += luAssemble.Aggregate(" ", (current, index) => current + index);
}
importPubSaDetail.Version = _version;
importPubSaDetail.BusinessType = businessType;
importPubSaDetail.Site = "XX工厂";
importPubSaDetail.KeyCode = importPubSaDetail.PN + importPubSaDetail.LU;
//根据物料号、结算日期获取价格
var priceListEntity = priceListEntitys.Find(t => t.LU == importPubSaDetail.LU && importPubSaDetail.SettleDate > t.BeginTime && importPubSaDetail.SettleDate < t.EndTime);
var priceListEntity = priceListEntitys.Find(t => t.LU == importPubSaDetail.PartCode && importPubSaDetail.SettleDate > t.BeginTime && importPubSaDetail.SettleDate < t.EndTime);
importPubSaDetail.Price = priceListEntity?.Price ?? 0;
});
//导入的零件号集合
var importPubSaLUs = pubSaDetails.Select(t => t.LU).Distinct();
var materialRelationshipEntitys = await _materialRelationshipRepository.GetListAsync(t => importPubSaLUs.Contains(t.SettleMaterialCode));
var importPubSaPartCodes = pubSaDetails.Select(t => t.PartCode).Distinct();
var materialRelationshipEntitys = await _materialRelationshipRepository.GetListAsync(t => importPubSaPartCodes.Contains(t.SettleMaterialCode));
var materialRelationshipEntitySettleMaterialCodes = materialRelationshipEntitys.Select(t => t.SettleMaterialCode).Distinct();
/*
@ -630,13 +477,20 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
*
* 6-
*/
var noExistSettleMaterialCodes = importPubSaLUs.Except(materialRelationshipEntitySettleMaterialCodes);
var noExistSettleMaterialCodes = importPubSaPartCodes.Except(materialRelationshipEntitySettleMaterialCodes);
noExistSettleMaterialCodes.ForEach(t =>
{
var materialRelationship = new MaterialRelationship(GuidGenerator.Create(), t.Replace(" ", "-"), "", t, businessType.ToString());
materialRelationships.Add(materialRelationship);
});
var seAllMaterialRelationships = materialRelationshipEntitys.Union(materialRelationships);
pubSaDetails.ForEach(pubSaDetail =>
{
pubSaDetail.LU = seAllMaterialRelationships.FirstOrDefault(t => t.SettleMaterialCode == pubSaDetail.PartCode)?.ErpMaterialCode ?? pubSaDetail.PartCode.Replace(" ", "-");
pubSaDetail.KeyCode = pubSaDetail.PN + pubSaDetail.LU;
});
#endregion
#region 添加入库

102
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeEdiCompareAppService.cs

@ -0,0 +1,102 @@
using System;
using System.Diagnostics;
using System.Threading.Tasks;
using Coravel.Invocable;
using Microsoft.AspNetCore.Mvc;
using SettleAccount.Domain.BQ;
using Volo.Abp.Application.Services;
using Win.Sfs.Shared.RepositoryBase;
using System.Linq;
using DocumentFormat.OpenXml.Office2010.ExcelAc;
using System.Collections.Generic;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Application;
using System.Runtime.Intrinsics.X86;
namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs;
/// <summary>
/// JisHBPO 发运数据与EDI数据对比
/// </summary>
[ApiExplorerSettings(IgnoreApi = true)]
public class JisHBPOSeEdiCompareAppService : ApplicationService, IInvocable
{
private readonly IServiceProvider _serviceProvider;
/// <summary>
/// HBPO发运数据仓储
/// </summary>
private readonly INormalEfCoreRepository<HBPO_SE_DETAIL, Guid> _hbpoSeDetailRepository;
/// <summary>
/// HBPOEDI数据仓储
/// </summary>
private readonly INormalEfCoreRepository<HBPO_SE_EDI, Guid> _hbpoSeEdiRepository;
public JisHBPOSeEdiCompareAppService(
IServiceProvider serviceProvider,
INormalEfCoreRepository<HBPO_SE_DETAIL, Guid> hbpoSeDetailRepository, INormalEfCoreRepository<HBPO_SE_EDI, Guid> hbpoSeEdiRepository)
{
_serviceProvider = serviceProvider;
_hbpoSeDetailRepository = hbpoSeDetailRepository;
_hbpoSeEdiRepository = hbpoSeEdiRepository;
}
/// <summary>
/// 执行
/// </summary>
public async Task Invoke()
{
await Task.CompletedTask;
Debug.WriteLine($"执行了 {this.GetType()}");
using var serviceScope = _serviceProvider.CreateScope();
var db = serviceScope.ServiceProvider.GetRequiredService<SettleAccountDbContext>();
//List<HBPO_SE_DETAIL> hbpoSeDetails = await _hbpoSeDetailRepository.GetListAsync(t => t.IsHaveEdiData == false);
//var hbpoSeDetails = db.Set<HBPO_SE_DETAIL>().Where(t => t.IsHaveEdiData == false).OrderBy(t => t.BillTime);
//var hbpoSeEdis = db.Set<HBPO_SE_EDI>().Where(t => t.IsHaveSeData == false && hbpoSeDetails.Any(w => w.PN.Equals(t.PN) && w.LU.Equals(t.LU) && w.Qty.Equals(t.Qty)));
var query = from se in db.Set<HBPO_SE_DETAIL>()
join edi in db.Set<HBPO_SE_EDI>() on new
{
se.LU,
se.PN,
se.Qty
} equals new
{
edi.LU,
edi.PN,
edi.Qty
}
where se.IsHaveEdiData == false && edi.IsHaveSeData == false
//select new
//{
// SeID = se.Id,
// se.PN,
// se.LU,
// se.Qty,
// EdiID = edi.Id
//};
select new
{
se,
edi
};
query.ForEach(item =>
{
Debug.WriteLine($"{Newtonsoft.Json.JsonConvert.SerializeObject(item)}");
});
//var ses = query.SelectMany(t => t.se);
//var edis = query.SelectMany(t => t.edi);
//hbpoSeEdis.ForEach(hbpoSeEdi =>
//{
// Debug.WriteLine($"{hbpoSeEdi.Id}");
//});
}
}

1
code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs

@ -1102,7 +1102,6 @@ namespace Win.Sfs.SettleAccount
.ForMember(x => x.SettleBillNum, y => y.MapFrom(d => d.BillNum));
CreateMap<PUB_SA_DETAIL, PUB_SA_DETAIL_EXPORT_DTO>();
CreateMap<PUB_SA_DETAIL_IMPORT_DTO, PUB_SA_DETAIL>();
CreateMap<ZhiGongJianBBACImportDto, PUB_SA_DETAIL>();
CreateMap<ZhiGongJianHBPOImportDto, PUB_SA_DETAIL>();
CreateMap<MaiDanJianHBPOImportDto, PUB_SA_DETAIL>();

Loading…
Cancel
Save