Browse Source

bug修改完成

HQ
liuyunfeng 7 months ago
parent
commit
b0a3fba68f
  1. 3
      src/Modules/BaseService/BaseService.Application/UserManagement/UserAppService.cs
  2. 4
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgBaseData/AssemblyCfgs/Dtos/ImportErpAssemblyGroupDto.cs
  3. 13
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgCheck/BillM100s/Dtos/BillM100Dto.cs
  4. 13
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgCheck/BillM100s/Dtos/ResultBillM100Dto.cs
  5. 12
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgCheck/UnknownAssemblys/Dtos/ResultUnknownAssemblyDto.cs
  6. 15
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/PrintTable/Dtos/WaitPrintDto.cs
  7. 42
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/WY.NewJit.Application.Contracts.xml
  8. 393
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/MsgBaseData/AssemblyCfgs/AssemblyCfgErpAppService.cs
  9. 4
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/MsgCheck/UnknownAssemblys/UnknownAssemblyAppService.cs
  10. 4
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/PrintTable/WaitPrintAppService.cs
  11. 2
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/WY.NewJit.Application.xml
  12. 4
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/EdiReceive/Services/EdiParseDomainService.cs
  13. 4
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/EdiReceive/Services/HQ_M100DomainService.cs
  14. 105
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgBaseData/Services/AssemblyDomainService.cs
  15. 9
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgCheck/Entitys/BillM100.cs
  16. 10
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/PrintTable/Entitys/WaitPrint.cs
  17. 7
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Web/appsettings.json

3
src/Modules/BaseService/BaseService.Application/UserManagement/UserAppService.cs

@ -198,8 +198,7 @@ namespace BaseService.Systems.UserManagement
var branchRoles = await GetUserBranchRolesAsync(CurrentUsers.GetId()); var branchRoles = await GetUserBranchRolesAsync(CurrentUsers.GetId());
var groupBranchRoles = branchRoles.GroupBy(x => x.BranchId) var groupBranchRoles = branchRoles.GroupBy(x => x.BranchId)
.Select(y => new {xx = new {BranchId = y.Key}, items = y}); .Select(y => new {xx = new {BranchId = y.Key}, items = y});
foreach (var group in groupBranchRoles foreach (var group in groupBranchRoles)
)
{ {
var mybranchrole = new BranchRoleDto var mybranchrole = new BranchRoleDto
{ {

4
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgBaseData/AssemblyCfgs/Dtos/ImportErpAssemblyGroupDto.cs

@ -29,11 +29,11 @@ namespace WY.NewJit.MsgBaseData
[Required(ErrorMessage = "颜色说明{0}是必填项")] [Required(ErrorMessage = "颜色说明{0}是必填项")]
public virtual string ColorExplain { get; set; } public virtual string ColorExplain { get; set; }
/// <summary> /// <summary>
/// 物料号 /// SAP物料号
/// </summary> /// </summary>
[ExporterHeader(DisplayName = "物料号")] [ExporterHeader(DisplayName = "物料号")]
[ImporterHeader(Name = "物料号")] [ImporterHeader(Name = "物料号")]
[Required(ErrorMessage = "物料号{0}是必填项")] [Required(ErrorMessage = "SAP物料号{0}是必填项")]
public virtual string MaterialNum { get; set; } public virtual string MaterialNum { get; set; }
} }
} }

13
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgCheck/BillM100s/Dtos/BillM100Dto.cs

@ -124,5 +124,18 @@ namespace WY.NewJit.MsgCheck
[ImporterHeader(Name = "手工操作日期")] [ImporterHeader(Name = "手工操作日期")]
public DateTime? OperationTime { get; set; } public DateTime? OperationTime { get; set; }
/// <summary>
/// 规格说明:HSC0DRCC0001
/// </summary>
[ExporterHeader(DisplayName = "规格说明")]
[ImporterHeader(Name = "规格说明")]
public virtual string SpecExplain { get; set; }
/// <summary>
/// 颜色说明:车型描述后7位,石墨黑/云杉灰
/// </summary>
[ExporterHeader(DisplayName = "颜色说明")]
[ImporterHeader(Name = "颜色说明")]
public virtual string ColorExplain { get; set; }
} }
} }

13
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgCheck/BillM100s/Dtos/ResultBillM100Dto.cs

@ -150,6 +150,19 @@ namespace WY.NewJit.MsgCheck
[ImporterHeader(IsIgnore = true)] [ImporterHeader(IsIgnore = true)]
public virtual string PrintBillNum { get; set; } public virtual string PrintBillNum { get; set; }
/// <summary>
/// 规格说明:HSC0DRCC0001
/// </summary>
[ExporterHeader(DisplayName = "规格说明")]
[ImporterHeader(Name = "规格说明")]
public virtual string SpecExplain { get; set; }
/// <summary>
/// 颜色说明:车型描述后7位,石墨黑/云杉灰
/// </summary>
[ExporterHeader(DisplayName = "颜色说明")]
[ImporterHeader(Name = "颜色说明")]
public virtual string ColorExplain { get; set; }

12
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgCheck/UnknownAssemblys/Dtos/ResultUnknownAssemblyDto.cs

@ -110,6 +110,18 @@ namespace WY.NewJit.MsgCheck.UnknownAssemblys
[ImporterHeader(Name = "单据表描述")] [ImporterHeader(Name = "单据表描述")]
public string BillDescription { get; set; } public string BillDescription { get; set; }
/// <summary>
/// 规格说明:HSC0DRCC0001
/// </summary>
[ExporterHeader(DisplayName = "规格说明")]
[ImporterHeader(Name = "规格说明")]
public virtual string SpecExplain { get; set; }
/// <summary>
/// 颜色说明:车型描述后7位,石墨黑/云杉灰
/// </summary>
[ExporterHeader(DisplayName = "颜色说明")]
[ImporterHeader(Name = "颜色说明")]
public virtual string ColorExplain { get; set; }
} }
} }

15
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/PrintTable/Dtos/WaitPrintDto.cs

@ -154,5 +154,20 @@ namespace WY.NewJit.PrintTable
[ExporterHeader(DisplayName = "R100接收时间")] [ExporterHeader(DisplayName = "R100接收时间")]
[ImporterHeader(Name = "R100接收时间")] [ImporterHeader(Name = "R100接收时间")]
public DateTime? R100ReceiveTime { get; set; } public DateTime? R100ReceiveTime { get; set; }
/// <summary>
/// 规格说明:HSC0DRCC0001
/// </summary>
[ExporterHeader(DisplayName = "规格说明")]
[ImporterHeader(Name = "规格说明")]
public virtual string SpecExplain { get; set; }
/// <summary>
/// 颜色说明:车型描述后7位,石墨黑/云杉灰
/// </summary>
[ExporterHeader(DisplayName = "颜色说明")]
[ImporterHeader(Name = "颜色说明")]
public virtual string ColorExplain { get; set; }
} }
} }

42
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/WY.NewJit.Application.Contracts.xml

@ -1440,7 +1440,7 @@
</member> </member>
<member name="P:WY.NewJit.MsgBaseData.ImportErpAssemblyGroupDto.MaterialNum"> <member name="P:WY.NewJit.MsgBaseData.ImportErpAssemblyGroupDto.MaterialNum">
<summary> <summary>
物料号 SAP物料号
</summary> </summary>
</member> </member>
<member name="P:WY.NewJit.MsgBaseData.QueryAssemblyCfgErpDto.ErpAssemblyCode"> <member name="P:WY.NewJit.MsgBaseData.QueryAssemblyCfgErpDto.ErpAssemblyCode">
@ -2281,6 +2281,16 @@
手工操作日期 手工操作日期
</summary> </summary>
</member> </member>
<member name="P:WY.NewJit.MsgCheck.BillM100Dto.SpecExplain">
<summary>
规格说明:HSC0DRCC0001
</summary>
</member>
<member name="P:WY.NewJit.MsgCheck.BillM100Dto.ColorExplain">
<summary>
颜色说明:车型描述后7位,石墨黑/云杉灰
</summary>
</member>
<member name="T:WY.NewJit.MsgCheck.BillM100PartDto"> <member name="T:WY.NewJit.MsgCheck.BillM100PartDto">
<summary> <summary>
零件查询结果DTO 零件查询结果DTO
@ -2601,6 +2611,16 @@
柱护板打印状态(不为空时表示已打印) 柱护板打印状态(不为空时表示已打印)
</summary> </summary>
</member> </member>
<member name="P:WY.NewJit.MsgCheck.ResultBillM100Dto.SpecExplain">
<summary>
规格说明:HSC0DRCC0001
</summary>
</member>
<member name="P:WY.NewJit.MsgCheck.ResultBillM100Dto.ColorExplain">
<summary>
颜色说明:车型描述后7位,石墨黑/云杉灰
</summary>
</member>
<member name="P:WY.NewJit.MsgCheck.TimeOutRemindResultDto.ProductLine"> <member name="P:WY.NewJit.MsgCheck.TimeOutRemindResultDto.ProductLine">
<summary> <summary>
生产线 生产线
@ -4007,6 +4027,16 @@
单据表描述 单据表描述
</summary> </summary>
</member> </member>
<member name="P:WY.NewJit.MsgCheck.UnknownAssemblys.ResultUnknownAssemblyDto.SpecExplain">
<summary>
规格说明:HSC0DRCC0001
</summary>
</member>
<member name="P:WY.NewJit.MsgCheck.UnknownAssemblys.ResultUnknownAssemblyDto.ColorExplain">
<summary>
颜色说明:车型描述后7位,石墨黑/云杉灰
</summary>
</member>
<member name="P:WY.NewJit.MsgCheck.UnknownAssemblys.ToParseInParam.IsSelectAll"> <member name="P:WY.NewJit.MsgCheck.UnknownAssemblys.ToParseInParam.IsSelectAll">
<summary> <summary>
是否选中全部 是否选中全部
@ -4440,5 +4470,15 @@
R100接收时间 R100接收时间
</summary> </summary>
</member> </member>
<member name="P:WY.NewJit.PrintTable.WaitPrintDto.SpecExplain">
<summary>
规格说明:HSC0DRCC0001
</summary>
</member>
<member name="P:WY.NewJit.PrintTable.WaitPrintDto.ColorExplain">
<summary>
颜色说明:车型描述后7位,石墨黑/云杉灰
</summary>
</member>
</members> </members>
</doc> </doc>

393
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/MsgBaseData/AssemblyCfgs/AssemblyCfgErpAppService.cs

@ -492,200 +492,201 @@ SELECT top 1 v.Id
[DisableRequestSizeLimit] [DisableRequestSizeLimit]
public virtual async Task<ObjectResultDto<string>> ImportErpAssemblyAsync([FromForm] IFormFileCollection files) public virtual async Task<ObjectResultDto<string>> ImportErpAssemblyAsync([FromForm] IFormFileCollection files)
{ {
_logger.LogDebug(_errorMessagePrefix + "ImportErpAssemblyAsync 进入"); throw new NotImplementedException();
ObjectResultDto<string> ret = new ObjectResultDto<string>(); //_logger.LogDebug(_errorMessagePrefix + "ImportErpAssemblyAsync 进入");
try //ObjectResultDto<string> ret = new ObjectResultDto<string>();
{ //try
List<MaterialExt> material3Lst = await _materialExtRepository.Where(itm => itm.MaterialType == "3").ToListAsync(); //{
List<PartCfg> partCfgLst = await _partCfgRepository.GetListAsync(); //取结算件信息列表 // List<MaterialExt> material3Lst = await _materialExtRepository.Where(itm => itm.MaterialType == "3").ToListAsync();
List<ErpAssemblyInfo2Part> ass2partLst = new List<ErpAssemblyInfo2Part>(); // List<PartCfg> partCfgLst = await _partCfgRepository.GetListAsync(); //取结算件信息列表
using (var memoryStream = new MemoryStream()) // List<ErpAssemblyInfo2Part> ass2partLst = new List<ErpAssemblyInfo2Part>();
{ // using (var memoryStream = new MemoryStream())
//保存到内存流 // {
IFormFile file = files[0]; // //保存到内存流
await file.CopyToAsync(memoryStream); // IFormFile file = files[0];
memoryStream.Seek(0, SeekOrigin.Begin); // await file.CopyToAsync(memoryStream);
StreamReader sr = new StreamReader(memoryStream, Encoding.Default); // memoryStream.Seek(0, SeekOrigin.Begin);
string strLine = ""; //记录每次读取的一行记录 // StreamReader sr = new StreamReader(memoryStream, Encoding.Default);
string[] aryLine = null; //记录每行记录中的各字段内容 // string strLine = ""; //记录每次读取的一行记录
int columnCount = 0; //标示列数 // string[] aryLine = null; //记录每行记录中的各字段内容
//遍历文件行 // int columnCount = 0; //标示列数
while ((strLine = sr.ReadLine()) != null) // //遍历文件行
{ // while ((strLine = sr.ReadLine()) != null)
if (strLine.IsNullOrEmpty()) // {
{ // if (strLine.IsNullOrEmpty())
continue; // {
} // continue;
if (strLine.Contains('�')) // }
{ // if (strLine.Contains('�'))
ret.Message = "导入文件的格式不对,请将其转换成utf-8格式后再导入"; // {
ret.Status = false; // ret.Message = "导入文件的格式不对,请将其转换成utf-8格式后再导入";
return ret; // ret.Status = false;
} // return ret;
// }
aryLine = strLine.Split(" ");
columnCount = aryLine.Count();
if (columnCount == 0)
{
continue;
}
if (columnCount < 14)
{
ret.Message = "当前行的列数小于14,行号:" + aryLine[0];
ret.Status = false;
return ret;
}
ErpAssemblyInfo2Part ass2partObj = new ErpAssemblyInfo2Part();
ass2partObj.ErpAssemblyCode = aryLine[1].Trim();
ass2partObj.ErpAssemblyName = aryLine[2].Trim();
//从物料表取车型,操作员导入BOM时已经在SAP中录入物料了
MaterialExt materialObj = material3Lst.FirstOrDefault(itm => itm.MaterialNum == ass2partObj.ErpAssemblyCode);
if (materialObj != null)
{
ass2partObj.VehicleModel = materialObj.VehicleModel;
ass2partObj.MaterialMemo = materialObj.MaterialMemo?.Replace(" ",""); //SAP分组
}
//将模板中的SAP物料号转换成客户零件号 // aryLine = strLine.Split(" ");
string sapMaterialNum = aryLine[11].Trim().Replace(" "," "); //取派格SAP物料号 // columnCount = aryLine.Count();
var partCfgObj = partCfgLst.FirstOrDefault(itm => itm.RelationKey == sapMaterialNum); // if (columnCount == 0)
if (partCfgObj != null) // {
{ // continue;
ass2partObj.PartCode = partCfgObj.PartCode; // }
ass2partObj.PartCode2 = sapMaterialNum; // if (columnCount < 14)
} // {
else // ret.Message = "当前行的列数小于14,行号:" + aryLine[0];
{ // ret.Status = false;
ret.Message = $"当前行的SAP物料号在零件信息表没有匹配的客户零件号,行号:{aryLine[0]},SAP物料号:{sapMaterialNum}"; // return ret;
ret.Status = false; // }
return ret; // ErpAssemblyInfo2Part ass2partObj = new ErpAssemblyInfo2Part();
} // ass2partObj.ErpAssemblyCode = aryLine[1].Trim();
ass2partObj.PartNum = aryLine[13].TryToDouble(); // ass2partObj.ErpAssemblyName = aryLine[2].Trim();
// //从物料表取车型,操作员导入BOM时已经在SAP中录入物料了
// MaterialExt materialObj = material3Lst.FirstOrDefault(itm => itm.MaterialNum == ass2partObj.ErpAssemblyCode);
// if (materialObj != null)
// {
// ass2partObj.VehicleModel = materialObj.VehicleModel;
// ass2partObj.MaterialMemo = materialObj.MaterialMemo?.Replace(" ",""); //SAP分组
// }
//数据校验 // //将模板中的SAP物料号转换成客户零件号
if (ass2partObj.ErpAssemblyCode == null || ass2partObj.ErpAssemblyCode.Trim() == "") // string sapMaterialNum = aryLine[11].Trim().Replace(" "," "); //取派格SAP物料号
{ // var partCfgObj = partCfgLst.FirstOrDefault(itm => itm.RelationKey == sapMaterialNum);
ret.Message = "当前行的ERP总成代码列是空,行号:" + aryLine[0]; // if (partCfgObj != null)
ret.Status = false; // {
return ret; // ass2partObj.PartCode = partCfgObj.PartCode;
} // ass2partObj.PartCode2 = sapMaterialNum;
if (ass2partObj.PartCode == null || ass2partObj.PartCode.Trim() == "") // }
{ // else
if (partCfgObj.IsDisable == true) //不参与解析的也进入BOM, 报文解析时排除 // {
{ // ret.Message = $"当前行的SAP物料号在零件信息表没有匹配的客户零件号,行号:{aryLine[0]},SAP物料号:{sapMaterialNum}";
} // ret.Status = false;
else // return ret;
{ // }
ret.Message = "当前行的零件代码列是空,行号:" + aryLine[0] + "对应SAP零件号:" + sapMaterialNum; // ass2partObj.PartNum = aryLine[13].TryToDouble();
ret.Status = false;
return ret;
}
}
if (ass2partObj.PartNum == null || ass2partObj.PartNum == 0)
{
ret.Message = "当前行的零件数量列是空或零,行号:" + aryLine[0];
ret.Status = false;
return ret;
}
ass2partLst.Add(ass2partObj);
}
}
//取Erp总成
List<AssemblyCfgErp> erpDataLst = await _assemblyCfgErpRepository.GetListAsync(itm => itm.NewVersionId == null, true);
//总成编码去重 // //数据校验
List<string> erpAssemblyCodeLst = ass2partLst // if (ass2partObj.ErpAssemblyCode == null || ass2partObj.ErpAssemblyCode.Trim() == "")
.Where(itm => string.IsNullOrEmpty(itm.ErpAssemblyCode) == false) // {
.Select(itm => itm.ErpAssemblyCode) // ret.Message = "当前行的ERP总成代码列是空,行号:" + aryLine[0];
.Distinct() // ret.Status = false;
.ToList(); // return ret;
//校验导入 // }
string repeatMsg = ""; // if (ass2partObj.PartCode == null || ass2partObj.PartCode.Trim() == "")
foreach (var erpAssemblyCode in erpAssemblyCodeLst) // {
{ // if (partCfgObj.IsDisable == true) //不参与解析的也进入BOM, 报文解析时排除
var partLst = ass2partLst.Where(itm => itm.ErpAssemblyCode == erpAssemblyCode).ToList(); // {
if (partLst.Count() > 0) // }
{ // else
string erpAssCode = partLst[0].ErpAssemblyCode; // {
string erpAssName = partLst[0].ErpAssemblyName; // ret.Message = "当前行的零件代码列是空,行号:" + aryLine[0] + "对应SAP零件号:" + sapMaterialNum;
string vehicleModel = partLst[0].VehicleModel; // ret.Status = false;
AssemblyCfgErp erpObj = new AssemblyCfgErp( // return ret;
GuidGenerator.Create(), // }
erpAssCode, // }
erpAssName, // if (ass2partObj.PartNum == null || ass2partObj.PartNum == 0)
0, // {
vehicleModel // ret.Message = "当前行的零件数量列是空或零,行号:" + aryLine[0];
); // ret.Status = false;
foreach (var partObj in partLst) // return ret;
{ // }
erpObj.AddChildObject( // ass2partLst.Add(ass2partObj);
GuidGenerator.Create(), // }
partObj.PartCode, // }
partObj.PartNum, // //取Erp总成
partObj.PartCode2 // List<AssemblyCfgErp> erpDataLst = await _assemblyCfgErpRepository.GetListAsync(itm => itm.NewVersionId == null, true);
);
} // //总成编码去重
List<string> repeatLst = _assemblyDomainService.ReturnRepeatErpAssembly(erpObj, erpDataLst, material3Lst); //返回重复总成 // List<string> erpAssemblyCodeLst = ass2partLst
foreach (var repeatStr in repeatLst) // .Where(itm => string.IsNullOrEmpty(itm.ErpAssemblyCode) == false)
{ // .Select(itm => itm.ErpAssemblyCode)
repeatMsg += repeatStr; // .Distinct()
} // .ToList();
} // //校验导入
} // string repeatMsg = "";
if (repeatMsg.Length > 0) // foreach (var erpAssemblyCode in erpAssemblyCodeLst)
{ // {
ret.Status = false; // var partLst = ass2partLst.Where(itm => itm.ErpAssemblyCode == erpAssemblyCode).ToList();
ret.Message = repeatMsg; // if (partLst.Count() > 0)
return ret; // {
} // string erpAssCode = partLst[0].ErpAssemblyCode;
// string erpAssName = partLst[0].ErpAssemblyName;
// string vehicleModel = partLst[0].VehicleModel;
// AssemblyCfgErp erpObj = new AssemblyCfgErp(
// GuidGenerator.Create(),
// erpAssCode,
// erpAssName,
// 0,
// vehicleModel
// );
// foreach (var partObj in partLst)
// {
// erpObj.AddChildObject(
// GuidGenerator.Create(),
// partObj.PartCode,
// partObj.PartNum,
// partObj.PartCode2
// );
// }
// List<string> repeatLst = _assemblyDomainService.ReturnRepeatErpAssembly(erpObj, erpDataLst, material3Lst); //返回重复总成
// foreach (var repeatStr in repeatLst)
// {
// repeatMsg += repeatStr;
// }
// }
// }
// if (repeatMsg.Length > 0)
// {
// ret.Status = false;
// ret.Message = repeatMsg;
// return ret;
// }
//遍历总成,插入数据库 // //遍历总成,插入数据库
int maxVer = _assemblyCfgErpRepository.Any() ? _assemblyCfgErpRepository.Max(itm => itm.ErpAssemblyVersion) : 0; // int maxVer = _assemblyCfgErpRepository.Any() ? _assemblyCfgErpRepository.Max(itm => itm.ErpAssemblyVersion) : 0;
foreach (var erpAssemblyCode in erpAssemblyCodeLst) // foreach (var erpAssemblyCode in erpAssemblyCodeLst)
{ // {
var partLst = ass2partLst.Where(itm => itm.ErpAssemblyCode == erpAssemblyCode).ToList(); // var partLst = ass2partLst.Where(itm => itm.ErpAssemblyCode == erpAssemblyCode).ToList();
if (partLst.Count() > 0) // if (partLst.Count() > 0)
{ // {
string erpAssCode = partLst[0].ErpAssemblyCode; // string erpAssCode = partLst[0].ErpAssemblyCode;
string erpAssName = partLst[0].ErpAssemblyName; // string erpAssName = partLst[0].ErpAssemblyName;
string vehicleModel = partLst[0].VehicleModel; // string vehicleModel = partLst[0].VehicleModel;
AssemblyCfgErp erpObj = new AssemblyCfgErp( // AssemblyCfgErp erpObj = new AssemblyCfgErp(
GuidGenerator.Create(), // GuidGenerator.Create(),
erpAssCode, // erpAssCode,
erpAssName, // erpAssName,
++maxVer, // ++maxVer,
vehicleModel // vehicleModel
); // );
foreach (var partObj in partLst) // foreach (var partObj in partLst)
{ // {
erpObj.AddChildObject( // erpObj.AddChildObject(
GuidGenerator.Create(), // GuidGenerator.Create(),
partObj.PartCode, // partObj.PartCode,
partObj.PartNum, // partObj.PartNum,
partObj.PartCode2 // partObj.PartCode2
); // );
} // }
AssemblyCfgErp obj2 = await _assemblyCfgErpRepository.InsertAsync(erpObj); // AssemblyCfgErp obj2 = await _assemblyCfgErpRepository.InsertAsync(erpObj);
await _assemblyDomainService.RemoveRepeatErpAssembly(obj2, erpDataLst); //删除重复总成 // await _assemblyDomainService.RemoveRepeatErpAssembly(obj2, erpDataLst); //删除重复总成
} // }
} // }
_globalSettingsDomainService.SetSetting(GlobalSettingsNameEnum., true); // _globalSettingsDomainService.SetSetting(GlobalSettingsNameEnum.刷新报文解析缓存, true);
ret.Status = true; // ret.Status = true;
return ret; // return ret;
} //}
catch (Exception ex) //catch (Exception ex)
{ //{
ret.Status = false; // ret.Status = false;
ret.Message = _errorMessagePrefix + "ImportErpAssemblyAsync 执行出错:" + ex.Message; // ret.Message = _errorMessagePrefix + "ImportErpAssemblyAsync 执行出错:" + ex.Message;
_logger.LogError(ret.Message); // _logger.LogError(ret.Message);
return ret; // return ret;
} //}
} }
/// <summary> /// <summary>
/// 总成组导入 /// 总成组导入【红旗版本】
/// </summary> /// </summary>
/// <param name="files"></param> /// <param name="files"></param>
/// <returns></returns> /// <returns></returns>
@ -830,12 +831,12 @@ SELECT top 1 v.Id
var partdists = srcLst.Select(r => r.MaterialNum).Distinct(); var partdists = srcLst.Select(r => r.MaterialNum).Distinct();
foreach (var material in partdists) foreach (var sapMaterial in partdists)
{ {
var material3 = material3Lst.FirstOrDefault(r => r.MaterialNum == material); var material3 = material3Lst.FirstOrDefault(r => r.MaterialNum == sapMaterial);
if (material3 == null) if (material3 == null)
{ {
error += $"零件编号【{material}】系统中不存在,请检查后再导入\r\n"; error += $"零件编号【{sapMaterial}】系统中不存在,请检查后再导入\r\n";
} }
} }
@ -856,27 +857,27 @@ SELECT top 1 v.Id
string arrStr = string.Join(',', arr); string arrStr = string.Join(',', arr);
var qry = from item in srcLst var qry = from item in srcLst
group item by item.SpecExplain into g group item by new { item.SpecExplain, item.ColorExplain } into g
select new select new
{ {
SpecExplain = g.Key, SpecExplain = g.Key.SpecExplain,
ColorExplain = g.ElementAt(0).ColorExplain, ColorExplain = g.Key.ColorExplain,
Details = g.Select(itm => itm.MaterialNum).ToList() Details = g.Select(itm => itm.MaterialNum).ToList()
}; };
foreach (var item in qry) foreach (var item in qry)
{ {
if (item.Details.Count != 4) if (item.Details.Count != 4)
{ {
strBuild.AppendLine($"规格说明{item.SpecExplain}包含的物料号不是4个"); strBuild.AppendLine($"规格说明{item.SpecExplain}、颜色说明{item.ColorExplain}包含的物料号不是4个");
} }
//遍历物料号 //遍历物料号
List<string> strLst = new List<string>(); List<string> strLst = new List<string>();
foreach (string materialNum in item.Details) foreach (string sapMaterialNum in item.Details)
{ {
var materialObj = material3Lst.FirstOrDefault(itm => itm.RelationKey == materialNum); var materialObj = material3Lst.FirstOrDefault(itm => itm.MaterialNum == sapMaterialNum);
if (materialObj == null) if (materialObj == null)
{ {
strBuild.AppendLine($"规格说明{item.SpecExplain}:物料号{materialNum}在物料表不存在!"); strBuild.AppendLine($"规格说明{item.SpecExplain}:物料号{sapMaterialNum}在物料表不存在!");
} }
else else
{ {
@ -886,7 +887,7 @@ SELECT top 1 v.Id
} }
else else
{ {
strBuild.AppendLine($"规格说明{item.SpecExplain}:物料号{materialNum}的MaterialType2不是【{arrStr}】其中之一!"); strBuild.AppendLine($"规格说明{item.SpecExplain}:物料号{sapMaterialNum}的MaterialType2不是【{arrStr}】其中之一!");
} }
} }
} }

4
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/MsgCheck/UnknownAssemblys/UnknownAssemblyAppService.cs

@ -222,7 +222,7 @@ with b as
( (
-- select Id,HostSN,KNR,'' as VIN,AssemblyID,OnlineTime,ReceiveTime,VehicleModelCode,ProductLine,[Version],BillStatus, Description, SerialNumStr from FisBillR100 where BillStatus =1 -- select Id,HostSN,KNR,'' as VIN,AssemblyID,OnlineTime,ReceiveTime,VehicleModelCode,ProductLine,[Version],BillStatus, Description, SerialNumStr from FisBillR100 where BillStatus =1
-- union all -- union all
select Id,HostSN,KNR,VIN,AssemblyID,OnlineTime,ReceiveTime,VehicleModelCode,ProductLine,[Version],BillStatus, Description, SerialNumStr from FisBillM100 where BillStatus =1 select Id,HostSN,KNR,VIN,AssemblyID,OnlineTime,ReceiveTime,VehicleModelCode,ProductLine,[Version],BillStatus, Description, SerialNumStr, SpecExplain, ColorExplain from FisBillM100 where BillStatus =1
) )
,d as ,d as
( (
@ -231,7 +231,7 @@ with b as
select * from select * from
( (
select ROW_NUMBER() OVER(order by b.SerialNumStr) as row_number, select ROW_NUMBER() OVER(order by b.SerialNumStr) as row_number,
a.*, b.HostSN,b.KNR,VIN,b.AssemblyID,b.OnlineTime,b.ReceiveTime,b.VehicleModelCode,b.[Version],b.BillStatus, '' as MessageFileName, b.Description as BillDescription a.*, b.HostSN,b.KNR,VIN,b.AssemblyID,b.OnlineTime,b.ReceiveTime,b.VehicleModelCode,b.[Version],b.BillStatus, '' as MessageFileName, b.Description as BillDescription, b.SpecExplain, b.ColorExplain
from FisUnknownAssembly a from FisUnknownAssembly a
join b on a.BillID = b.Id join b on a.BillID = b.Id
left join d on b.VehicleModelCode = d.DicItemCode left join d on b.VehicleModelCode = d.DicItemCode

4
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/PrintTable/WaitPrintAppService.cs

@ -43,7 +43,7 @@ namespace WY.NewJit.PrintTable
} }
} }
private const string _providerCode = "0709FAW-VW7XH"; private const string _providerCode = "LAJ46"; //0709FAW-VW7XH
/// <summary> /// <summary>
/// 柱护板缓存列表(打印柱护板时用到) /// 柱护板缓存列表(打印柱护板时用到)
@ -454,7 +454,7 @@ namespace WY.NewJit.PrintTable
List<AssemblyCfgErp> erpAssemblyLst = GetErpAssemblyListByBill((Guid)billObj.AssemblyID); List<AssemblyCfgErp> erpAssemblyLst = GetErpAssemblyListByBill((Guid)billObj.AssemblyID);
List<string> erpCodeLst = erpAssemblyLst.Select(itm => itm.ErpAssemblyCode).ToList(); List<string> erpCodeLst = erpAssemblyLst.Select(itm => itm.ErpAssemblyCode).ToList();
//根据ERP总成编码取对应的物料扩展信息 //根据ERP总成编码取对应的物料扩展信息
List<MaterialExt> materialExtLst = _materialExtRepository.Where(itm => erpCodeLst.Contains(itm.RelationKey)).ToList(); List<MaterialExt> materialExtLst = _materialExtRepository.Where(itm => erpCodeLst.Contains(itm.MaterialNum)).ToList();
if (erpCodeLst.Count != 4) if (erpCodeLst.Count != 4)
{ {
promMsg += $"*总成数量是{erpCodeLst.Count}*"; promMsg += $"*总成数量是{erpCodeLst.Count}*";

2
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/WY.NewJit.Application.xml

@ -409,7 +409,7 @@
</member> </member>
<member name="M:WY.NewJit.MsgBaseData.AssemblyCfgErpAppService.ImportErpAssemblyGroupAsync(Microsoft.AspNetCore.Http.IFormFileCollection)"> <member name="M:WY.NewJit.MsgBaseData.AssemblyCfgErpAppService.ImportErpAssemblyGroupAsync(Microsoft.AspNetCore.Http.IFormFileCollection)">
<summary> <summary>
总成组导入 总成组导入【红旗版本】
</summary> </summary>
<param name="files"></param> <param name="files"></param>
<returns></returns> <returns></returns>

4
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/EdiReceive/Services/EdiParseDomainService.cs

@ -236,6 +236,8 @@ namespace WY.NewJit.EdiReceive.Services
//插入M100、未打印表 //插入M100、未打印表
m100Obj.SetAssemblyID(vehicleAssemblyResu.Id); m100Obj.SetAssemblyID(vehicleAssemblyResu.Id);
m100Obj.SetBillStatus(BillStatusEnum.Match); m100Obj.SetBillStatus(BillStatusEnum.Match);
m100Obj.SpecExplain = specExplain;
m100Obj.ColorExplain = colorExplain;
var insM100Ret = await _hqM100DomainServie.InsertM100(m100Obj, true); var insM100Ret = await _hqM100DomainServie.InsertM100(m100Obj, true);
if (insM100Ret == null) if (insM100Ret == null)
{ {
@ -249,6 +251,8 @@ namespace WY.NewJit.EdiReceive.Services
//更新单据表 //更新单据表
m100Obj.SetAssemblyID(null); m100Obj.SetAssemblyID(null);
m100Obj.SetBillStatus(BillStatusEnum.NotMatch); m100Obj.SetBillStatus(BillStatusEnum.NotMatch);
m100Obj.SpecExplain = specExplain;
m100Obj.ColorExplain = colorExplain;
var succObj1 = await _hqM100DomainServie.InsertM100(m100Obj, true); var succObj1 = await _hqM100DomainServie.InsertM100(m100Obj, true);
//不匹配时,插入未知总成 //不匹配时,插入未知总成

4
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/EdiReceive/Services/HQ_M100DomainService.cs

@ -131,6 +131,8 @@ namespace WY.NewJit.MsgCheck
waitPrint.CreatorId = m100Ret.CreatorId; waitPrint.CreatorId = m100Ret.CreatorId;
waitPrint.LastModificationTime = m100Ret.LastModificationTime; waitPrint.LastModificationTime = m100Ret.LastModificationTime;
waitPrint.LastModifierId = m100Ret.LastModifierId; waitPrint.LastModifierId = m100Ret.LastModifierId;
waitPrint.SpecExplain = m100Ret.SpecExplain;
waitPrint.ColorExplain = m100Ret.ColorExplain;
} }
private void Set_WaitPrint(WaitPrint sourceWaitPrint, WaitPrint targetWaitPrint) private void Set_WaitPrint(WaitPrint sourceWaitPrint, WaitPrint targetWaitPrint)
@ -153,6 +155,8 @@ namespace WY.NewJit.MsgCheck
targetWaitPrint.CreatorId = sourceWaitPrint.CreatorId; targetWaitPrint.CreatorId = sourceWaitPrint.CreatorId;
targetWaitPrint.LastModificationTime = sourceWaitPrint.LastModificationTime; targetWaitPrint.LastModificationTime = sourceWaitPrint.LastModificationTime;
targetWaitPrint.LastModifierId = sourceWaitPrint.LastModifierId; targetWaitPrint.LastModifierId = sourceWaitPrint.LastModifierId;
targetWaitPrint.SpecExplain = sourceWaitPrint.SpecExplain;
targetWaitPrint.ColorExplain = sourceWaitPrint.ColorExplain;
} }
public async Task<Dictionary<Guid, List<BillM100Part>>> GetM100PartDic(List<Guid> m100IdLst) public async Task<Dictionary<Guid, List<BillM100Part>>> GetM100PartDic(List<Guid> m100IdLst)

105
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgBaseData/Services/AssemblyDomainService.cs

@ -143,59 +143,60 @@ namespace WY.NewJit.MsgBaseData
[UnitOfWork] [UnitOfWork]
public virtual async Task SyncErpAssemblyAsync(int takeRecordCount) public virtual async Task SyncErpAssemblyAsync(int takeRecordCount)
{ {
string sql = @" throw new NotImplementedException();
SELECT AppraisalCategory as RelationKey, ErpMaterialCode, MaterialDesc, SettleMaterialCode, Qty // string sql = @"
FROM [SettleAccountService].[dbo].[v_relationship] a //SELECT AppraisalCategory as RelationKey, ErpMaterialCode, MaterialDesc, SettleMaterialCode, Qty
where not exists (select * from [dbo].[FisAssemblyCfgErp] e where a.AppraisalCategory = e.RelationKey) // FROM [SettleAccountService].[dbo].[v_relationship] a
order by [Version], ErpMaterialCode, MaterialDesc, SettleMaterialCode, Qty // where not exists (select * from [dbo].[FisAssemblyCfgErp] e where a.AppraisalCategory = e.RelationKey)
"; // order by [Version], ErpMaterialCode, MaterialDesc, SettleMaterialCode, Qty
//取ERP总成 最大版本 //";
int maxVer = _assemblyCfgErpRepository.Any() ? _assemblyCfgErpRepository.Max(itm => itm.ErpAssemblyVersion) : 0; // //取ERP总成 最大版本
//初始化ERP总成及结算件数据 // int maxVer = _assemblyCfgErpRepository.Any() ? _assemblyCfgErpRepository.Max(itm => itm.ErpAssemblyVersion) : 0;
await ClearPub(maxVer); // //初始化ERP总成及结算件数据
//取增量数据 // await ClearPub(maxVer);
List<V_Relationship> relationshipLst = await _newJitDapperRepository.GetListBySqlAsync<V_Relationship>(sql, true); // //取增量数据
List<string> keyLst = relationshipLst.Select(itm => itm.RelationKey).Distinct().Take(takeRecordCount).ToList(); // List<V_Relationship> relationshipLst = await _newJitDapperRepository.GetListBySqlAsync<V_Relationship>(sql, true);
// List<string> keyLst = relationshipLst.Select(itm => itm.RelationKey).Distinct().Take(takeRecordCount).ToList();
foreach (string keyStr in keyLst) // foreach (string keyStr in keyLst)
{ // {
List<V_Relationship> filterLst = relationshipLst.Where(itm => itm.RelationKey == keyStr).ToList(); // List<V_Relationship> filterLst = relationshipLst.Where(itm => itm.RelationKey == keyStr).ToList();
//填充erp主实体 // //填充erp主实体
AssemblyCfgErp targetObj = new AssemblyCfgErp( // AssemblyCfgErp targetObj = new AssemblyCfgErp(
_guidGenerator.Create(), // _guidGenerator.Create(),
filterLst[0].ErpMaterialCode, // filterLst[0].ErpMaterialCode,
filterLst[0].MaterialDesc, // filterLst[0].MaterialDesc,
++maxVer, // ++maxVer,
null, // null,
filterLst[0].RelationKey // filterLst[0].RelationKey
); // );
//填充erp子实体 // //填充erp子实体
foreach (V_Relationship filterItm in filterLst) // foreach (V_Relationship filterItm in filterLst)
{ // {
targetObj.AddChildObject( // targetObj.AddChildObject(
_guidGenerator.Create(), // _guidGenerator.Create(),
filterItm.SettleMaterialCode, // filterItm.SettleMaterialCode,
filterItm.Qty, // filterItm.Qty,
"", // "",
false // false
); // );
} // }
//判断结算件配置重复 // //判断结算件配置重复
List<ErpAssembly2> repeatIdLst = await FindRepeatErpAssembly(targetObj); // List<ErpAssembly2> repeatIdLst = await FindRepeatErpAssembly(targetObj);
if (repeatIdLst == null || repeatIdLst.Count == 0) //没有重复,直接插入 // if (repeatIdLst == null || repeatIdLst.Count == 0) //没有重复,直接插入
{ // {
AssemblyCfgErp obj2 = await _assemblyCfgErpRepository.InsertAsync(targetObj); // AssemblyCfgErp obj2 = await _assemblyCfgErpRepository.InsertAsync(targetObj);
} // }
else //存在重复 // else //存在重复
{ // {
foreach (ErpAssembly2 item in repeatIdLst) // foreach (ErpAssembly2 item in repeatIdLst)
{ // {
//更新历史数据NewVersionId字段 // //更新历史数据NewVersionId字段
await UpdateNewVersionId(item.ErpAssemblyId, targetObj.Id); // await UpdateNewVersionId(item.ErpAssemblyId, targetObj.Id);
} // }
AssemblyCfgErp obj2 = await _assemblyCfgErpRepository.InsertAsync(targetObj); // AssemblyCfgErp obj2 = await _assemblyCfgErpRepository.InsertAsync(targetObj);
} // }
} // }
} }
/// <summary> /// <summary>

9
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgCheck/Entitys/BillM100.cs

@ -134,6 +134,15 @@ namespace WY.NewJit.MsgCheck
/// </summary> /// </summary>
public virtual bool? IsPartSwitch { get; set; } public virtual bool? IsPartSwitch { get; set; }
/// <summary>
/// 规格说明:HSC0DRCC0001
/// </summary>
public virtual string SpecExplain { get; set; }
/// <summary>
/// 颜色说明:车型描述后7位,石墨黑/云杉灰
/// </summary>
public virtual string ColorExplain { get; set; }
public BillM100() public BillM100()
{ {

10
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/PrintTable/Entitys/WaitPrint.cs

@ -110,6 +110,16 @@ namespace WY.NewJit.PrintTable
/// </summary> /// </summary>
public Guid? LastModifierId { get; set; } public Guid? LastModifierId { get; set; }
/// <summary>
/// 规格说明:HSC0DRCC0001
/// </summary>
public virtual string SpecExplain { get; set; }
/// <summary>
/// 颜色说明:车型描述后7位,石墨黑/云杉灰
/// </summary>
public virtual string ColorExplain { get; set; }
public WaitPrint() public WaitPrint()
{ {

7
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Web/appsettings.json

@ -11,10 +11,11 @@
//"Default": "Server=192.168.0.140;Database=ABP;User ID=sa;Password=Microsoft2008;", //"Default": "Server=192.168.0.140;Database=ABP;User ID=sa;Password=Microsoft2008;",
//"WMS": "Server=192.168.0.140;Database=CPAT_WMS_TEST;User ID=sa;Password=Microsoft2008;" //"WMS": "Server=192.168.0.140;Database=CPAT_WMS_TEST;User ID=sa;Password=Microsoft2008;"
"NewJitPG": "Server=dev.ccwin-in.com,6208;Database=NewJitPG_HQ;uid=sa;pwd=ChangkeTec@2021;",
"Default": "Server=dev.ccwin-in.com,6208;Database=ABP;User ID=sa;Password=ChangkeTec@2021;", "Default": "Server=dev.ccwin-in.com,6208;Database=ABP;User ID=sa;Password=ChangkeTec@2021;",
"WMS": "Server=dev.ccwin-in.com,6208;Database=CPAT_WMS;User ID=sa;Password=ChangkeTec@2021;" //"NewJitPG": "Server=dev.ccwin-in.com,6208;Database=NewJitPG_HQ;uid=sa;pwd=ChangkeTec@2021;",
//"WMS": "Server=dev.ccwin-in.com,6208;Database=CPAT_WMS;User ID=sa;Password=ChangkeTec@2021;"
"NewJitPG": "Server=192.168.0.68;Database=NewJitPG_HQ;uid=sa;pwd=Microsoft@2022;",
"WMS": "Server=192.168.0.140;Database=CPAT_WMS_TEST;User ID=sa;Password=Microsoft2008;"
}, },
"AuthServer": { "AuthServer": {
"Authority": "http://dev.ccwin-in.com:16077", "Authority": "http://dev.ccwin-in.com:16077",

Loading…
Cancel
Save