From 0a3fc209b6d82a785fc5b6409db1659264763e95 Mon Sep 17 00:00:00 2001 From: wyf Date: Thu, 15 May 2025 04:18:15 +0000 Subject: [PATCH] SVN r584 SVN-Revision: r584 --- 插件库/Lskj.PubBomImport/FrmProgress.cs | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/插件库/Lskj.PubBomImport/FrmProgress.cs b/插件库/Lskj.PubBomImport/FrmProgress.cs index b0a0f81..622fde7 100644 --- a/插件库/Lskj.PubBomImport/FrmProgress.cs +++ b/插件库/Lskj.PubBomImport/FrmProgress.cs @@ -910,10 +910,15 @@ namespace Lskj.PubBomImport string guid = Guid.NewGuid() + ""; SqlHelper.ExecuteNonQuery($"insert into p_bomImportExecTab (guid,detailTable,masterSql,detailSql,billNo,detailGuid,UserId,billWay,billSeq,auditFlag,comfirm,newVer) " + $"values ('{guid}','','','','','','{ERPInfo.Instance.UserId}','','','0','','')"); + //记录guid + string updateGuidSql = @"update QMS_wenjiangenggaitab set qms_wjgg_uuid = '{0}' where qms_wjgg_billdocument_Id = '{1}'"; + SqlHelper.ExecuteNonQuery(string.Format(updateGuidSql, guid, primaryValue)); + + //记录文件变更 StringBuilder insertbulider = new StringBuilder(); - string mxCode = BaseImpl.GetResult($"select MxFileName from FileAttachmentMapping where MaterialCode = '{productCode}' and RelatedAttachmentName = '{beforeSourceCode}';") + ""; - insertbulider.AppendLine($"delete FileAttachmentMapping where MaterialCode = '{productCode}' and RelatedAttachmentName = '{beforeSourceCode}';"); - insertbulider.AppendLine($"insert into FileAttachmentMapping (MaterialCode,MxFileName,RelatedAttachmentName,OperatorUser,ChangeStatus) values ('{productCode}','{mxCode}','{sourceCode}','{ERPInfo.Instance.UserName}','变更');"); + string mxCode = BaseImpl.GetResult($"select MxFileName from FileAttachmentMapping where MaterialCode = '{topProductId}' and RelatedAttachmentName = '{beforeSourceCode}';") + ""; + insertbulider.AppendLine($"delete FileAttachmentMapping where MaterialCode = '{topProductId}' and RelatedAttachmentName = '{beforeSourceCode}';"); + insertbulider.AppendLine($"insert into FileAttachmentMapping (MaterialCode,MxFileName,RelatedAttachmentName,OperatorUser,ChangeStatus) values ('{topProductId}','{mxCode}','{sourceCode}','{ERPInfo.Instance.UserName}','变更');"); BaseImpl.ExecSqlValue($"update p_bomImportExecTab set afterSql = '{insertbulider.ToString().Replace("'", "''")}' where guid = '{guid}'"); } @@ -1687,8 +1692,16 @@ namespace Lskj.PubBomImport } else { + GetFileCodeInfo(afterFilename, out string fileCode, out string name, out string fileBB, out int fileBC); BaseImpl.ExecSqlValue(afterSql); BaseImpl.ExecSqlValue($"update p_bomImportExecTab set success = 1 where guid = '{execGuid}'"); + List sqlParamList = new List(); + sqlParamList.Add(new SqlParameter("@copyFileId", SqlDbType.Int) { Value = copyFileId }); + sqlParamList.Add(new SqlParameter("@copyToModule", SqlDbType.VarChar, 100) { Value = "1000202" }); + sqlParamList.Add(new SqlParameter("@copyToIdValue", SqlDbType.VarChar, 100) { Value = fileCode }); + sqlParamList.Add(new SqlParameter("@coverFileId", SqlDbType.Int) { Value = coverFileId }); + sqlParamList.Add(new SqlParameter("@coverTag", SqlDbType.Int) { Value = coverTag }); + BaseImpl.ExecProcedure("p_CopyAttcFileInfo", sqlParamList.ToArray()); } } SetProcessBar(100, 100);