SVN-Revision: r584
This commit is contained in:
wyf
2025-05-15 04:18:15 +00:00
parent 637f4bbd43
commit 0a3fc209b6
+16 -3
View File
@@ -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<SqlParameter> sqlParamList = new List<SqlParameter>();
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);