添加工艺站发布站包历史表;允许用户选择测试站时选择历史发布站包

This commit is contained in:
2024-05-08 21:59:31 +08:00
parent ec4c447b01
commit e475a06eb5
254 changed files with 928 additions and 242730 deletions

View File

@@ -527,13 +527,25 @@ Namespace UTSModule.Station
''' </summary>
''' <param name="revFileName"></param>
Private Sub ReleaseUpdateDatabase(revFileName As String)
Dim saved As Boolean = False
'获取站包Md5值
Dim revFilePath As String = $"{UtsPath.StationPacketPath(ParentProcessStation.ParentProject.Index, ParentProcessStation.StationID, revFileName)}"
Dim md5 As String = UTS_Core.Security.Md5.GetFileMd5(revFilePath)
ReleaseUpdatePacketLogTable(revFileName, md5) '更新发布历史
ReleaseUpdateStationTable(revFileName, md5) '更新站位表
PacketMD5 = md5
End Sub
''' <summary>
''' 发布站包时,更新站位表信息
''' </summary>
''' <param name="revFileName"></param>
''' <param name="md5"></param>
Private Sub ReleaseUpdateStationTable(revFileName As String, md5 As String)
Dim saved As Boolean = False
'更新最新包名,编辑密码与发布密码
Dim tableName As String = DbTableModel.Customer.StationListTable.TableName
@@ -556,7 +568,7 @@ Namespace UTSModule.Station
db.Close()
saved = True
Catch ex As Exception
Console.WriteLine($"Release Packet To Database Fail,{ex.Message}")
Console.WriteLine($"Release Packet To Update Station Table Fail,{ex.Message}")
saved = False
End Try
End Using
@@ -573,10 +585,67 @@ Namespace UTSModule.Station
DbConnect.DbConnector.SaveCmdStringToCacheTable(db, remoteCmd)
End If
db.Close()
End Using
End Sub
''' <summary>
''' 发布站包时,更新站包发布记录表信息
''' </summary>
''' <param name="revFileName"></param>
''' <param name="md5"></param>
Private Sub ReleaseUpdatePacketLogTable(revFileName As String, md5 As String)
Dim saved As Boolean = False
Dim tableName As String = DbTableModel.Customer.StationPacketReleaseLogTable.TableName
Dim colNames As New Dictionary(Of String, String)
colNames.Add(DbTableModel.Customer.StationPacketReleaseLogTable.ColNames.ProjectID.ToString(), ParentProcessStation.ParentProject.Index.ToString)
colNames.Add(DbTableModel.Customer.StationPacketReleaseLogTable.ColNames.StationID.ToString(), ParentProcessStation.StationID.ToString)
colNames.Add(DbTableModel.Customer.StationPacketReleaseLogTable.ColNames.CreateTime.ToString(), DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss"))
colNames.Add(DbTableModel.Customer.StationPacketReleaseLogTable.ColNames.UpdateTime.ToString(), DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss"))
colNames.Add(DbTableModel.Customer.StationPacketReleaseLogTable.ColNames.PacketName.ToString(), revFileName)
colNames.Add(DbTableModel.Customer.StationPacketReleaseLogTable.ColNames.PacketMd5.ToString(), md5)
colNames.Add(DbTableModel.Customer.StationPacketReleaseLogTable.ColNames.Description.ToString(), CurrentImprint.ToString())
colNames.Add(DbTableModel.Customer.StationPacketReleaseLogTable.ColNames.Remark.ToString(), "")
colNames.Add(DbTableModel.Customer.StationPacketReleaseLogTable.ColNames.IsValid.ToString(), "1")
colNames.Add(DbTableModel.Customer.StationPacketReleaseLogTable.ColNames.UserID.ToString(), ParentProcessStation.ParentProject.UserId.ToString())
colNames.Add(DbTableModel.Customer.StationPacketReleaseLogTable.ColNames.UserName.ToString(), ParentProcessStation.ParentProject.UserName.ToString())
colNames.Add(DbTableModel.Customer.StationPacketReleaseLogTable.ColNames.PublicIP.ToString(), "") 'todo:填充信息
colNames.Add(DbTableModel.Customer.StationPacketReleaseLogTable.ColNames.ComputerName.ToString(), "")
colNames.Add(DbTableModel.Customer.StationPacketReleaseLogTable.ColNames.SID.ToString(), "")
'保存至云端
Dim remoteCmd As String
Using db As New DbExecutor(UtsDb.RemoteDbType, UtsDb.RemoteConnString)
remoteCmd = db.CmdHelper.DbInsert(UtsDb.RemotePrivateDb, tableName, colNames)
Try
db.Open()
db.ExecuteNonQuery(remoteCmd)
db.Close()
saved = True
Catch ex As Exception
Console.WriteLine($"Release Packet To Update Packet Log Table Fail,{ex.Message}")
saved = False
End Try
End Using
'保存至本地库
Using db As New DbExecutor(UtsDb.LocalDbType, UtsDb.LocalConnString) '存至本地
db.Open()
Dim localCmd As String = db.CmdHelper.Insert(tableName, colNames)
db.ExecuteNonQuery(localCmd)
'更新缓存日志表
If saved = False Then
DbConnect.DbConnector.SaveCmdStringToCacheTable(db, remoteCmd)
End If
db.Close()
End Using
PacketMD5 = md5
End Sub
''' <summary>