SVN-Revision: r713
This commit is contained in:
wyf
2025-06-11 07:47:30 +00:00
parent be37f1f278
commit 3ea315ad88
+6 -3
View File
@@ -1503,7 +1503,8 @@ namespace Lskj.PubBomImport
{ {
int.TryParse(parentRow["套数"] + "", out int tamount); int.TryParse(parentRow["套数"] + "", out int tamount);
string childCode = parentRow["图号"] + ""; string childCode = parentRow["图号"] + "";
insertbulider.AppendLine($"insert into FileAttachmentMapping (MaterialCode,MxFileName,RelatedAttachmentName,OperatorUser,ChangeStatus) values ('{topProductId}','{sourceCode }','{childCode}','{ERPInfo.Instance.UserName}','变更');"); string unionTzName = parentRow.Table.Columns.Contains("关联装配图") ? (parentRow["关联装配图"] + "").Trim() : "";
insertbulider.AppendLine($"insert into FileAttachmentMapping (MaterialCode,MxFileName,RelatedAttachmentName,OperatorUser,ChangeStatus,UnionTZName) values ('{topProductId}','{sourceCode }','{childCode}','{ERPInfo.Instance.UserName}','变更','{unionTzName}');");
if (childCode.StartsWith("QD") || childCode.StartsWith("ZZQD")) if (childCode.StartsWith("QD") || childCode.StartsWith("ZZQD"))
{ {
string tempFileName = childFileDic.ContainsKey(childCode) ? childFileDic[childCode] : ""; string tempFileName = childFileDic.ContainsKey(childCode) ? childFileDic[childCode] : "";
@@ -1823,12 +1824,13 @@ namespace Lskj.PubBomImport
{ {
int.TryParse(parentRow["套数"] + "", out int tamount); int.TryParse(parentRow["套数"] + "", out int tamount);
string code = (parentRow["图号"] + "").Trim(); string code = (parentRow["图号"] + "").Trim();
string unionTzName = parentRow.Table.Columns.Contains("关联装配图") ? (parentRow["关联装配图"] + "").Trim() : "";
int codeCount = mxCodeRows.Where(n => (n["图号"] + "").Trim().StartsWith(code)).Count(); int codeCount = mxCodeRows.Where(n => (n["图号"] + "").Trim().StartsWith(code)).Count();
if (codeCount > 1)//只允许存在一个 if (codeCount > 1)//只允许存在一个
{ {
throw new Exception($"MX中的{code}重复,请修改"); throw new Exception($"MX中的{code}重复,请修改");
} }
insertbulider.AppendLine($"insert into FileAttachmentMapping (MaterialCode,MxFileName,RelatedAttachmentName,OperatorUser,ChangeStatus) values ('{productId}','{mxsourceCode }','{code}','{ERPInfo.Instance.UserName}','新增');"); insertbulider.AppendLine($"insert into FileAttachmentMapping (MaterialCode,MxFileName,RelatedAttachmentName,OperatorUser,ChangeStatus,UnionTZName) values ('{productId}','{mxsourceCode }','{code}','{ERPInfo.Instance.UserName}','新增','{unionTzName}');");
DataTable filetable = BaseImpl.GetDataTableResult($"select sname,fileId,webpath from p_fm_filetab where parentid in (select dirid from P_fm_DirectoryTab where pid = '{code}' and dllcoid = '1000202') and speciesno = '010106' and sname like '{code}%'"); DataTable filetable = BaseImpl.GetDataTableResult($"select sname,fileId,webpath from p_fm_filetab where parentid in (select dirid from P_fm_DirectoryTab where pid = '{code}' and dllcoid = '1000202') and speciesno = '010106' and sname like '{code}%'");
fileTableDic[code] = filetable; fileTableDic[code] = filetable;
int childMaxBc = -1; int childMaxBc = -1;
@@ -2631,12 +2633,13 @@ namespace Lskj.PubBomImport
{ {
int.TryParse(parentRow["套数"] + "", out int tamount); int.TryParse(parentRow["套数"] + "", out int tamount);
string code = (parentRow["图号"] + "").Trim(); string code = (parentRow["图号"] + "").Trim();
string unionTzName = parentRow.Table.Columns.Contains("关联装配图") ? (parentRow["关联装配图"] + "").Trim() : "";
int codeCount = mxCodeRows.Where(n => (n["图号"] + "").Trim().StartsWith(code)).Count(); int codeCount = mxCodeRows.Where(n => (n["图号"] + "").Trim().StartsWith(code)).Count();
if (codeCount > 1)//只允许存在一个 if (codeCount > 1)//只允许存在一个
{ {
throw new Exception($"MX中的{code}重复,请修改"); throw new Exception($"MX中的{code}重复,请修改");
} }
insertbulider.AppendLine($"insert into FileAttachmentMapping (MaterialCode,MxFileName,RelatedAttachmentName,OperatorUser,ChangeStatus) values ('{productId}','{mxsourceCode }','{code}','{ERPInfo.Instance.UserName}','新增');"); insertbulider.AppendLine($"insert into FileAttachmentMapping (MaterialCode,MxFileName,RelatedAttachmentName,OperatorUser,ChangeStatus,UnionTZName) values ('{productId}','{mxsourceCode }','{code}','{ERPInfo.Instance.UserName}','新增','{unionTzName}');");
DataTable filetable = BaseImpl.GetDataTableResult($"select sname,fileId,webpath from p_fm_filetab where parentid in (select dirid from P_fm_DirectoryTab where pid = '{code}' and dllcoid = '1000202') and speciesno = '010106' and sname like '{code}%'"); DataTable filetable = BaseImpl.GetDataTableResult($"select sname,fileId,webpath from p_fm_filetab where parentid in (select dirid from P_fm_DirectoryTab where pid = '{code}' and dllcoid = '1000202') and speciesno = '010106' and sname like '{code}%'");
fileTableDic[code] = filetable; fileTableDic[code] = filetable;
int childMaxBc = -1; int childMaxBc = -1;