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

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

@@ -0,0 +1,132 @@

Imports System.Text
Imports UTS_Core.Database
Namespace UTSModule.DbTableModel.Customer
Public Class StationPacketReleaseLogTable
Enum ColNames
''' <summary>
''' 工艺站包索引
''' </summary>
ID
''' <summary>
''' 项目索引
''' </summary>
ProjectID
''' <summary>
''' 站位索引
''' </summary>
StationID
''' <summary>
''' 创建时间
''' </summary>
CreateTime
''' <summary>
''' 更新时间
''' </summary>
UpdateTime
''' <summary>
''' 当前包名
''' </summary>
PacketName
''' <summary>
''' 当前包MD5值
''' </summary>
PacketMd5
''' <summary>
''' 记录本版本更改内容
''' </summary>
Description
''' <summary>
''' 当前包是否有效
''' </summary>
IsValid
''' <summary>
''' 登录用户索引
''' </summary>
UserID
''' <summary>
''' 登录用户名称
''' </summary>
UserName
''' <summary>
''' 发布电脑的公网IP
''' </summary>
PublicIP
''' <summary>
''' 发布电脑用户名
''' </summary>
ComputerName
''' <summary>
''' 发布电脑的SID
''' </summary>
SID
''' <summary>
''' 备注
''' </summary>
Remark
End Enum
Public Shared Property TableName() As String = "TBL_TP_Release_Log"
''' <summary>
''' 建表语句
''' </summary>
''' <returns>建表语句</returns>
Public Shared Function CreateTableString(dbName As String, Optional dbType As DbExecutor.DbTypeEnum = DbExecutor.DbTypeEnum.Mysql) As String
Dim builder As New StringBuilder
If dbType = DbExecutor.DbTypeEnum.Mysql Then
builder.Append($"CREATE TABLE If Not Exists `{dbName}`.`{TableName}` ")
builder.Append("(")
builder.Append($"`{ColNames.ID}` int(11) NOT NULL AUTO_INCREMENT COMMENT '工艺站包索引',")
builder.Append($"`{ColNames.ProjectID}` int(11) NOT NULL COMMENT '项目ID',")
builder.Append($"`{ColNames.StationID}` int(11) NOT NULL COMMENT '站位索引',")
builder.Append($"`{ColNames.CreateTime}` datetime NOT NULL DEFAULT current_timestamp() COMMENT '创建时间',")
builder.Append($"`{ColNames.UpdateTime}` datetime NOT NULL DEFAULT current_timestamp() COMMENT '更新时间',")
builder.Append($"`{ColNames.Description}` varchar(254) DEFAULT NULL COMMENT '版本说明',")
builder.Append($"`{ColNames.Remark}` varchar(128) DEFAULT NULL COMMENT ' 备注',")
builder.Append($"`{ColNames.PacketName}` varchar(128) DEFAULT NULL COMMENT '工艺站包包名',")
builder.Append($"`{ColNames.PacketMd5}` varchar(32) DEFAULT NULL COMMENT '工艺站包MD5值',")
builder.Append($"`{ColNames.IsValid}` tinyint(4) not NULL DEFAULT 1 COMMENT '是否有效',")
builder.Append($"`{ColNames.UserID}` int(11) NOT NULL COMMENT '登录用户索引',")
builder.Append($"`{ColNames.UserName}` varchar(64) NOT NULL COMMENT '登录用户名称',")
builder.Append($"`{ColNames.PublicIP}` int(64) NOT NULL COMMENT '发布电脑的公网IP',")
builder.Append($"`{ColNames.ComputerName}` int(64) NOT NULL COMMENT '发布电脑用户名',")
builder.Append($"`{ColNames.SID}` varchar(64) DEFAULT NULL COMMENT '发布电脑的SID',")
builder.Append($"PRIMARY KEY (`{ColNames.ID}`) ")
builder.Append(")")
builder.Append("ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;")
Else
Throw New Exception($"{TableName}-Invalid db type :{dbType}")
End If
Return builder.ToString()
End Function
End Class
End Namespace

View File

@@ -80,7 +80,7 @@ Namespace UTSModule.Project
Private Sub TsBtnNewProject_Click(sender As Object, e As EventArgs) Handles TsBtnNewProject.Click
Using dlg As New DlgCreateProject
If dlg.ShowDialog() <> DialogResult.OK Then Return
_userProject = New ProjectInfo(_userInfo.UserId, dlg.ProjectName)
_userProject = New ProjectInfo(_userInfo.UserId, _userInfo.UserName, dlg.ProjectName)
LoadProjectInitForm(_userProject)
End Using
End Sub
@@ -90,7 +90,7 @@ Namespace UTSModule.Project
Using dlg As New DlgLoadProject
If dlg.ShowDialog() <> DialogResult.OK Then Return
Try
_userProject = New ProjectInfo(_userInfo.UserId, dlg.ProjectName, dlg.LoadMode)
_userProject = New ProjectInfo(_userInfo.UserId, _userInfo.UserName, dlg.ProjectName, dlg.LoadMode)
LoadProjectInitForm(_userProject) '初始化页面
Catch ex As Exception
MsgBox($"Load Project Error:{ex.Message}")
@@ -103,7 +103,7 @@ Namespace UTSModule.Project
Using dlg As New DlgLoadProject
If dlg.ShowDialog() <> DialogResult.OK Then Return
Try
_userProject = New ProjectInfo(_userInfo.UserId, dlg.ProjectName, dlg.LoadMode)
_userProject = New ProjectInfo(_userInfo.UserId, _userInfo.UserName, dlg.ProjectName, dlg.LoadMode)
LoadProjectInitForm(_userProject) '初始化页面
_userProject.Index = -1
Catch ex As Exception
@@ -148,7 +148,8 @@ Namespace UTSModule.Project
End Sub
Private Sub UpdateProjectInfo(project As ProjectInfo)
project.UserId = _userInfo.UserId '当前操作项目站用户
project.UserId = _userInfo.UserId '当前操作项目站用户索引
project.UserName = _userInfo.UserName '当前操作项目站用户名称
If String.Compare(project.Name, TxtProjectName.Text) <> 0 Then
project.Name = TxtProjectName.Text

View File

@@ -37,8 +37,9 @@ Namespace UTSModule.Project
End Enum
#Region "New"
Sub New(userId As Integer, projectName As String)
Sub New(userId As Integer, userName As String, projectName As String)
Me.UserId = userId
Me.UserName = userName
Index = -1
ProductTypeId = 0
Name = projectName
@@ -53,8 +54,9 @@ Namespace UTSModule.Project
End Sub
Sub New(userId As Integer, projectName As String, mode As InitializeModeEnum)
Sub New(userId As Integer, userName As String, projectName As String, mode As InitializeModeEnum)
Me.UserId = userId
Me.UserName = userName
Index = -1
ProductTypeId = 0
Name = projectName
@@ -71,8 +73,10 @@ Namespace UTSModule.Project
End Sub
Sub New(userId As Integer, projectId As Integer, mode As InitializeModeEnum)
Sub New(userId As Integer, userName As String, projectId As Integer, mode As InitializeModeEnum)
Me.UserId = userId
Me.UserName = userName
Index = projectId
ProductTypeId = 0
Name = String.Empty
@@ -189,6 +193,12 @@ Namespace UTSModule.Project
''' <returns></returns>
Public Property UserId() As Integer
''' <summary>
''' 项目当前操作人名称
''' </summary>
''' <returns></returns>
Public Property UserName() As String
Private _masterImg As Image
@@ -530,6 +540,46 @@ Namespace UTSModule.Project
End Sub
Private Function LoadStationPackets(db As DbExecutor, pid As Integer, sid As Integer) As List(Of StationPacketVo)
Dim tableName As String = DbTableModel.Customer.StationPacketReleaseLogTable.TableName
Dim condition As String = $"`{DbTableModel.Customer.StationPacketReleaseLogTable.ColNames.ProjectID}` = {pid} && `{DbTableModel.Customer.StationPacketReleaseLogTable.ColNames.StationID}` = {sid}"
Dim dtProject As DataTable = db.ExecuteDataTable(db.CmdHelper.SearchAll(tableName, condition))
Dim packetList As New List(Of StationPacketVo)
For Each row As DataRow In dtProject.Rows
Dim packet As New StationPacketVo With {
.ProjectID = CInt(row(DbTableModel.Customer.StationPacketReleaseLogTable.ColNames.ProjectID.ToString())),
.StationID = CInt(row(DbTableModel.Customer.StationPacketReleaseLogTable.ColNames.StationID.ToString())),
.PacketName = row(DbTableModel.Customer.StationPacketReleaseLogTable.ColNames.StationID.ToString()).ToString(),
.PacketMd5 = row(DbTableModel.Customer.StationPacketReleaseLogTable.ColNames.StationID.ToString()).ToString(),
.Description = row(DbTableModel.Customer.StationPacketReleaseLogTable.ColNames.StationID.ToString()).ToString()
}
packetList.Insert(0, packet)
Next
Return packetList
End Function
''' <summary>
''' 获取当前站位所有站包
''' </summary>
''' <param name="pid"></param>
''' <param name="sid"></param>
''' <returns></returns>
Public Function LoadLocalDbStationPackets(pid As Integer, sid As Integer) As List(Of StationPacketVo)
Dim packetList As New List(Of StationPacketVo)
Using db As New DbExecutor(UtsDb.LocalDbType, UtsDb.LocalConnString)
db.Open()
packetList.AddRange(LoadStationPackets(db, pid, sid))
db.Close()
End Using
Return packetList
End Function
''' <summary>
''' 通过项目索引初始化项目信息
''' </summary>

View File

@@ -34,131 +34,156 @@ Namespace UTSModule.Station
Me.LblProject = New System.Windows.Forms.Label()
Me.Label1 = New System.Windows.Forms.Label()
Me.GrpStationDesc = New System.Windows.Forms.GroupBox()
Me.Label3 = New System.Windows.Forms.Label()
Me.RtxStationDesc = New System.Windows.Forms.RichTextBox()
Me.GroupBox1 = New System.Windows.Forms.GroupBox()
Me.RtxProjectDesc = New System.Windows.Forms.RichTextBox()
Me.Label2 = New System.Windows.Forms.Label()
Me.TableLayoutPanel1.SuspendLayout
CType(Me.PicStationPreview,System.ComponentModel.ISupportInitialize).BeginInit
Me.GrpStationDesc.SuspendLayout
Me.GroupBox1.SuspendLayout
Me.SuspendLayout
'
'TableLayoutPanel1
'
Me.TableLayoutPanel1.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right),System.Windows.Forms.AnchorStyles)
Me.TableLayoutPanel1.ColumnCount = 2
Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50!))
Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50!))
Me.TableLayoutPanel1.Controls.Add(Me.OK_Button, 0, 0)
Me.TableLayoutPanel1.Controls.Add(Me.Cancel_Button, 1, 0)
Me.TableLayoutPanel1.Location = New System.Drawing.Point(534, 430)
Me.TableLayoutPanel1.Name = "TableLayoutPanel1"
Me.TableLayoutPanel1.RowCount = 1
Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50!))
Me.TableLayoutPanel1.Size = New System.Drawing.Size(240, 39)
Me.TableLayoutPanel1.TabIndex = 0
'
'OK_Button
'
Me.OK_Button.Dock = System.Windows.Forms.DockStyle.Fill
Me.OK_Button.Font = New System.Drawing.Font("宋体", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134,Byte))
Me.OK_Button.Location = New System.Drawing.Point(3, 3)
Me.OK_Button.Name = "OK_Button"
Me.OK_Button.Size = New System.Drawing.Size(114, 33)
Me.OK_Button.TabIndex = 0
Me.OK_Button.Text = "确定"
'
'Cancel_Button
'
Me.Cancel_Button.DialogResult = System.Windows.Forms.DialogResult.Cancel
Me.Cancel_Button.Dock = System.Windows.Forms.DockStyle.Fill
Me.Cancel_Button.Font = New System.Drawing.Font("宋体", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134,Byte))
Me.Cancel_Button.Location = New System.Drawing.Point(123, 3)
Me.Cancel_Button.Name = "Cancel_Button"
Me.Cancel_Button.Size = New System.Drawing.Size(114, 33)
Me.Cancel_Button.TabIndex = 1
Me.Cancel_Button.Text = "取消"
'
'PicStationPreview
'
Me.PicStationPreview.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.PicStationPreview.Location = New System.Drawing.Point(24, 181)
Me.PicStationPreview.Name = "PicStationPreview"
Me.PicStationPreview.Size = New System.Drawing.Size(200, 200)
Me.PicStationPreview.TabIndex = 5
Me.PicStationPreview.TabStop = false
'
'CboStation
'
Me.CboStation.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.CboStation.Font = New System.Drawing.Font("宋体", 12!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134,Byte))
Me.CboStation.FormattingEnabled = true
Me.CboStation.IntegralHeight = false
Me.CboStation.Location = New System.Drawing.Point(24, 49)
Me.CboStation.MaxDropDownItems = 16
Me.CboStation.Name = "CboStation"
Me.CboStation.Size = New System.Drawing.Size(200, 24)
Me.CboStation.TabIndex = 9
'
'LblStation
'
Me.LblStation.AutoSize = true
Me.LblStation.Location = New System.Drawing.Point(6, 27)
Me.LblStation.Name = "LblStation"
Me.LblStation.Size = New System.Drawing.Size(41, 12)
Me.LblStation.TabIndex = 8
Me.LblStation.Text = "站位:"
'
'CboProject
'
Me.CboProject.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.CboProject.Font = New System.Drawing.Font("宋体", 12!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134,Byte))
Me.CboProject.FormattingEnabled = true
Me.CboProject.IntegralHeight = false
Me.CboProject.Location = New System.Drawing.Point(24, 49)
Me.CboProject.MaxDropDownItems = 16
Me.CboProject.Name = "CboProject"
Me.CboProject.Size = New System.Drawing.Size(200, 24)
Me.CboProject.TabIndex = 7
'
'LblProject
'
Me.LblProject.AutoSize = true
Me.LblProject.Location = New System.Drawing.Point(6, 27)
Me.LblProject.Name = "LblProject"
Me.LblProject.Size = New System.Drawing.Size(41, 12)
Me.LblProject.TabIndex = 6
Me.LblProject.Text = "项目:"
'
'Label1
'
Me.Label1.AutoSize = true
Me.Label1.Location = New System.Drawing.Point(6, 166)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(41, 12)
Me.Label1.TabIndex = 10
Me.Label1.Text = "预览:"
'
'GrpStationDesc
'
Me.GrpStationDesc.Controls.Add(Me.Label3)
Me.GrpStationDesc.Controls.Add(Me.RtxStationDesc)
Me.GrpStationDesc.Controls.Add(Me.CboStation)
Me.GrpStationDesc.Controls.Add(Me.LblStation)
Me.GrpStationDesc.Location = New System.Drawing.Point(291, 15)
Me.GrpStationDesc.Name = "GrpStationDesc"
Me.GrpStationDesc.Size = New System.Drawing.Size(483, 400)
Me.GrpStationDesc.TabIndex = 11
Me.GrpStationDesc.TabStop = false
Me.GrpStationDesc.Text = "站位描述"
'
'Label3
'
Me.Label3.AutoSize = true
Me.Label3.Location = New System.Drawing.Point(6, 82)
Me.Label3.Name = "Label3"
Me.CboPacket = New System.Windows.Forms.ComboBox()
Me.Label4 = New System.Windows.Forms.Label()
Me.Label3 = New System.Windows.Forms.Label()
Me.RtxStationDesc = New System.Windows.Forms.RichTextBox()
Me.GroupBox1 = New System.Windows.Forms.GroupBox()
Me.RtxProjectDesc = New System.Windows.Forms.RichTextBox()
Me.Label2 = New System.Windows.Forms.Label()
Me.TableLayoutPanel1.SuspendLayout()
CType(Me.PicStationPreview, System.ComponentModel.ISupportInitialize).BeginInit()
Me.GrpStationDesc.SuspendLayout()
Me.GroupBox1.SuspendLayout()
Me.SuspendLayout()
'
'TableLayoutPanel1
'
Me.TableLayoutPanel1.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.TableLayoutPanel1.ColumnCount = 2
Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50.0!))
Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50.0!))
Me.TableLayoutPanel1.Controls.Add(Me.OK_Button, 0, 0)
Me.TableLayoutPanel1.Controls.Add(Me.Cancel_Button, 1, 0)
Me.TableLayoutPanel1.Location = New System.Drawing.Point(533, 431)
Me.TableLayoutPanel1.Name = "TableLayoutPanel1"
Me.TableLayoutPanel1.RowCount = 1
Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50.0!))
Me.TableLayoutPanel1.Size = New System.Drawing.Size(240, 39)
Me.TableLayoutPanel1.TabIndex = 0
'
'OK_Button
'
Me.OK_Button.Dock = System.Windows.Forms.DockStyle.Fill
Me.OK_Button.Font = New System.Drawing.Font("宋体", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.OK_Button.Location = New System.Drawing.Point(3, 3)
Me.OK_Button.Name = "OK_Button"
Me.OK_Button.Size = New System.Drawing.Size(114, 33)
Me.OK_Button.TabIndex = 0
Me.OK_Button.Text = "确定"
'
'Cancel_Button
'
Me.Cancel_Button.DialogResult = System.Windows.Forms.DialogResult.Cancel
Me.Cancel_Button.Dock = System.Windows.Forms.DockStyle.Fill
Me.Cancel_Button.Font = New System.Drawing.Font("宋体", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.Cancel_Button.Location = New System.Drawing.Point(123, 3)
Me.Cancel_Button.Name = "Cancel_Button"
Me.Cancel_Button.Size = New System.Drawing.Size(114, 33)
Me.Cancel_Button.TabIndex = 1
Me.Cancel_Button.Text = "取消"
'
'PicStationPreview
'
Me.PicStationPreview.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.PicStationPreview.Location = New System.Drawing.Point(24, 181)
Me.PicStationPreview.Name = "PicStationPreview"
Me.PicStationPreview.Size = New System.Drawing.Size(200, 200)
Me.PicStationPreview.TabIndex = 5
Me.PicStationPreview.TabStop = False
'
'CboStation
'
Me.CboStation.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.CboStation.Font = New System.Drawing.Font("宋体", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.CboStation.FormattingEnabled = True
Me.CboStation.IntegralHeight = False
Me.CboStation.Location = New System.Drawing.Point(24, 49)
Me.CboStation.MaxDropDownItems = 16
Me.CboStation.Name = "CboStation"
Me.CboStation.Size = New System.Drawing.Size(200, 24)
Me.CboStation.TabIndex = 9
'
'LblStation
'
Me.LblStation.AutoSize = True
Me.LblStation.Location = New System.Drawing.Point(6, 27)
Me.LblStation.Name = "LblStation"
Me.LblStation.Size = New System.Drawing.Size(41, 12)
Me.LblStation.TabIndex = 8
Me.LblStation.Text = "站位:"
'
'CboProject
'
Me.CboProject.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.CboProject.Font = New System.Drawing.Font("宋体", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.CboProject.FormattingEnabled = True
Me.CboProject.IntegralHeight = False
Me.CboProject.Location = New System.Drawing.Point(24, 49)
Me.CboProject.MaxDropDownItems = 16
Me.CboProject.Name = "CboProject"
Me.CboProject.Size = New System.Drawing.Size(200, 24)
Me.CboProject.TabIndex = 7
'
'LblProject
'
Me.LblProject.AutoSize = True
Me.LblProject.Location = New System.Drawing.Point(6, 27)
Me.LblProject.Name = "LblProject"
Me.LblProject.Size = New System.Drawing.Size(41, 12)
Me.LblProject.TabIndex = 6
Me.LblProject.Text = "项目:"
'
'Label1
'
Me.Label1.AutoSize = True
Me.Label1.Location = New System.Drawing.Point(6, 166)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(41, 12)
Me.Label1.TabIndex = 10
Me.Label1.Text = "预览:"
'
'GrpStationDesc
'
Me.GrpStationDesc.Controls.Add(Me.CboPacket)
Me.GrpStationDesc.Controls.Add(Me.Label4)
Me.GrpStationDesc.Controls.Add(Me.Label3)
Me.GrpStationDesc.Controls.Add(Me.RtxStationDesc)
Me.GrpStationDesc.Controls.Add(Me.CboStation)
Me.GrpStationDesc.Controls.Add(Me.LblStation)
Me.GrpStationDesc.Location = New System.Drawing.Point(291, 15)
Me.GrpStationDesc.Name = "GrpStationDesc"
Me.GrpStationDesc.Size = New System.Drawing.Size(483, 400)
Me.GrpStationDesc.TabIndex = 11
Me.GrpStationDesc.TabStop = False
Me.GrpStationDesc.Text = "站位描述"
'
'CboPacket
'
Me.CboPacket.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.CboPacket.Font = New System.Drawing.Font("宋体", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.CboPacket.FormattingEnabled = True
Me.CboPacket.IntegralHeight = False
Me.CboPacket.Location = New System.Drawing.Point(258, 49)
Me.CboPacket.MaxDropDownItems = 16
Me.CboPacket.Name = "CboPacket"
Me.CboPacket.Size = New System.Drawing.Size(200, 24)
Me.CboPacket.TabIndex = 13
'
'Label4
'
Me.Label4.AutoSize = True
Me.Label4.Location = New System.Drawing.Point(244, 27)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(41, 12)
Me.Label4.TabIndex = 12
Me.Label4.Text = "站包:"
'
'Label3
'
Me.Label3.AutoSize = True
Me.Label3.Location = New System.Drawing.Point(6, 82)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(65, 12)
Me.Label3.TabIndex = 11
Me.Label3.Text = "站位总览:"
@@ -166,59 +191,59 @@ Namespace UTSModule.Station
'RtxStationDesc
'
Me.RtxStationDesc.BorderStyle = System.Windows.Forms.BorderStyle.None
Me.RtxStationDesc.Font = New System.Drawing.Font("宋体", 12!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134,Byte))
Me.RtxStationDesc.ForeColor = System.Drawing.Color.Gray
Me.RtxStationDesc.Location = New System.Drawing.Point(24, 97)
Me.RtxStationDesc.Name = "RtxStationDesc"
Me.RtxStationDesc.ReadOnly = true
Me.RtxStationDesc.Size = New System.Drawing.Size(434, 284)
Me.RtxStationDesc.TabIndex = 10
Me.RtxStationDesc.Text = ""
'
'GroupBox1
'
Me.GroupBox1.Controls.Add(Me.RtxProjectDesc)
Me.GroupBox1.Controls.Add(Me.Label2)
Me.GroupBox1.Controls.Add(Me.CboProject)
Me.GroupBox1.Controls.Add(Me.Label1)
Me.GroupBox1.Controls.Add(Me.LblProject)
Me.GroupBox1.Controls.Add(Me.PicStationPreview)
Me.GroupBox1.Location = New System.Drawing.Point(23, 15)
Me.GroupBox1.Name = "GroupBox1"
Me.GroupBox1.Size = New System.Drawing.Size(240, 400)
Me.GroupBox1.TabIndex = 12
Me.GroupBox1.TabStop = false
Me.GroupBox1.Text = "项目描述"
'
'RtxProjectDesc
'
Me.RtxProjectDesc.BorderStyle = System.Windows.Forms.BorderStyle.None
Me.RtxProjectDesc.Font = New System.Drawing.Font("宋体", 12!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134,Byte))
Me.RtxProjectDesc.Location = New System.Drawing.Point(24, 97)
Me.RtxProjectDesc.Name = "RtxProjectDesc"
Me.RtxProjectDesc.ReadOnly = true
Me.RtxProjectDesc.Size = New System.Drawing.Size(200, 57)
Me.RtxProjectDesc.TabIndex = 12
Me.RtxProjectDesc.Text = ""
'
'Label2
'
Me.Label2.AutoSize = true
Me.Label2.Location = New System.Drawing.Point(6, 82)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(41, 12)
Me.Label2.TabIndex = 8
Me.Label2.Text = "简介:"
'
'DlgLoadStation
'
Me.AcceptButton = Me.OK_Button
Me.AutoScaleDimensions = New System.Drawing.SizeF(6!, 12!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.CancelButton = Me.Cancel_Button
Me.ClientSize = New System.Drawing.Size(794, 470)
Me.Controls.Add(Me.GroupBox1)
Me.Controls.Add(Me.GrpStationDesc)
Me.RtxStationDesc.Font = New System.Drawing.Font("宋体", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.RtxStationDesc.ForeColor = System.Drawing.Color.Gray
Me.RtxStationDesc.Location = New System.Drawing.Point(24, 97)
Me.RtxStationDesc.Name = "RtxStationDesc"
Me.RtxStationDesc.ReadOnly = True
Me.RtxStationDesc.Size = New System.Drawing.Size(434, 284)
Me.RtxStationDesc.TabIndex = 10
Me.RtxStationDesc.Text = ""
'
'GroupBox1
'
Me.GroupBox1.Controls.Add(Me.RtxProjectDesc)
Me.GroupBox1.Controls.Add(Me.Label2)
Me.GroupBox1.Controls.Add(Me.CboProject)
Me.GroupBox1.Controls.Add(Me.Label1)
Me.GroupBox1.Controls.Add(Me.LblProject)
Me.GroupBox1.Controls.Add(Me.PicStationPreview)
Me.GroupBox1.Location = New System.Drawing.Point(23, 15)
Me.GroupBox1.Name = "GroupBox1"
Me.GroupBox1.Size = New System.Drawing.Size(240, 400)
Me.GroupBox1.TabIndex = 12
Me.GroupBox1.TabStop = False
Me.GroupBox1.Text = "项目描述"
'
'RtxProjectDesc
'
Me.RtxProjectDesc.BorderStyle = System.Windows.Forms.BorderStyle.None
Me.RtxProjectDesc.Font = New System.Drawing.Font("宋体", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.RtxProjectDesc.Location = New System.Drawing.Point(24, 97)
Me.RtxProjectDesc.Name = "RtxProjectDesc"
Me.RtxProjectDesc.ReadOnly = True
Me.RtxProjectDesc.Size = New System.Drawing.Size(200, 57)
Me.RtxProjectDesc.TabIndex = 12
Me.RtxProjectDesc.Text = ""
'
'Label2
'
Me.Label2.AutoSize = True
Me.Label2.Location = New System.Drawing.Point(6, 82)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(41, 12)
Me.Label2.TabIndex = 8
Me.Label2.Text = "简介:"
'
'DlgLoadStation
'
Me.AcceptButton = Me.OK_Button
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 12.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.CancelButton = Me.Cancel_Button
Me.ClientSize = New System.Drawing.Size(793, 471)
Me.Controls.Add(Me.GroupBox1)
Me.Controls.Add(Me.GrpStationDesc)
Me.Controls.Add(Me.TableLayoutPanel1)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
Me.MaximizeBox = false
@@ -251,5 +276,7 @@ End Sub
Friend WithEvents Label3 As Windows.Forms.Label
Friend WithEvents RtxStationDesc As Windows.Forms.RichTextBox
Friend WithEvents RtxProjectDesc As Windows.Forms.RichTextBox
Friend WithEvents CboPacket As ComboBox
Friend WithEvents Label4 As Label
End Class
End Namespace

View File

@@ -5,6 +5,7 @@ Imports UTS_Core.UTSModule.Project
Namespace UTSModule.Station
Public Class DlgLoadStation
Public Property ProcessStation() As ProcessStation
Public Property UserInfo() As Login.UserInfo
Public _projectInfo As ProjectInfo
@@ -21,7 +22,7 @@ Namespace UTSModule.Station
Dim projectList As String() = ProjectInfo.LoadProjectList(ProjectInfo.InitializeModeEnum.LocalDatabaseLoad)
If projectList.Contains(projectName) = False Then Return False
_projectInfo = New ProjectInfo(UserInfo.UserId, projectName, ProjectInfo.InitializeModeEnum.LocalDatabaseLoad)
_projectInfo = New ProjectInfo(UserInfo.UserId, UserInfo.UserName, projectName, ProjectInfo.InitializeModeEnum.LocalDatabaseLoad)
For Each projectStationInfo As ProcessStation In _projectInfo.Station
If projectStationInfo.Name = stationName Then
ProcessStation = projectStationInfo
@@ -94,6 +95,8 @@ Namespace UTSModule.Station
CboStation.Items.Add(station.Name)
Next
CboPacket.Items.Clear()
'添加所有站位描述
RtxStationDesc.SuspendLayout()
@@ -123,7 +126,7 @@ Namespace UTSModule.Station
End Sub
Private Sub CboProject_SelectedIndexChanged(sender As Object, e As EventArgs) Handles CboProject.SelectedIndexChanged
_projectInfo = New ProjectInfo(UserInfo.UserId, CboProject.Text, ProjectInfo.InitializeModeEnum.LocalDatabaseLoad)
_projectInfo = New ProjectInfo(UserInfo.UserId, UserInfo.UserName, CboProject.Text, ProjectInfo.InitializeModeEnum.LocalDatabaseLoad)
RtxProjectDesc.Text = _projectInfo.Description
@@ -136,6 +139,8 @@ Namespace UTSModule.Station
End Sub
Private lastSelectIndex As Integer = -1
Private _packetList As List(Of StationPacketVo)
Private Sub CboStation_SelectedIndexChanged(sender As Object, e As EventArgs) Handles CboStation.SelectedIndexChanged
Dim selectIndex As Integer = _snIndex(CboStation.SelectedIndex)
ProcessStation = _projectInfo.Station.Item(selectIndex)
@@ -149,7 +154,25 @@ Namespace UTSModule.Station
RtxStationDesc.Select(RtxStationDesc.GetFirstCharIndexFromLine(selectIndex), RtxStationDesc.Lines(selectIndex).Length)
RtxStationDesc.SelectionColor = Color.Blue
'获取pid和sid
Dim pid As Integer = _projectInfo.Index
Dim sid As Integer = ProcessStation.StationID
'获取对应站位所有包,倒序添加
_packetList = _projectInfo.LoadLocalDbStationPackets(pid, sid)
CboPacket.Items.Clear()
For Each packet As StationPacketVo In _packetList
CboPacket.Items.Add(packet.PacketName)
Next
If CboPacket.Items.Count > 0 Then CboPacket.SelectedIndex = 0
End Sub
Private Sub CboPacket_SelectedIndexChanged(sender As Object, e As EventArgs) Handles CboPacket.SelectedIndexChanged
ProcessStation.Packet.FileName = _packetList(CboPacket.SelectedIndex).PacketName
ProcessStation.Packet.PacketMD5 = _packetList(CboPacket.SelectedIndex).PacketMd5
End Sub
End Class
End Namespace

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>

View File

@@ -0,0 +1,13 @@
Public Class StationPacketVo
Public Property ProjectID As Integer
Public Property StationID As Integer
Public Property PacketName As String
Public Property PacketMd5 As String
Public Property Description As String
End Class

View File

@@ -902,6 +902,8 @@ Namespace UTSModule.Test
Public Sub IUtsTest_TestNodeCompleted(sender As Object, e As TestNodeCompletedEventArgs) Implements IUtsTest.TestNodeCompleted
If _tester.DebugMode Then Return
If _tester.TestFiexdModule <> FixedModuleEnum.Main Then Return
_recordGrid.UpdateTestRecord(e.Node, e.TestReturn)
End Sub

View File

@@ -771,7 +771,7 @@ Namespace UTSModule.Test
'进度修改
If node.RowListIndex > _startTestIndex AndAlso node.RowListIndex < _endTestIndex Then
Dim p As Double = (node.RowListIndex - _startTestIndex) / (_testCount * 100)
Dim p As Double = (node.RowListIndex - _startTestIndex) / _testCount * 100
RaiseEvent TestProgressChanged(Me, New TestProgressChangedEventArgs(p))
End If