初始化到新仓库

This commit is contained in:
2025-11-18 11:58:00 +08:00
parent 04c258ceb6
commit 164a105213
24 changed files with 172 additions and 87 deletions

View File

@@ -413,101 +413,109 @@ Public Class FrmUpdateConfig
UpdateInstallTip(20, $"Start Get Uts Host") UpdateInstallTip(20, $"Start Get Uts Host")
'获取webService目标地址 '获取webService目标地址
Dim remoteIP As IPEndPoint = Nothing 'Dim remoteIP As IPEndPoint = Nothing
Try 'Try
If remoteIP Is Nothing Then ' If remoteIP Is Nothing Then
' remoteIP = New IPEndPoint(Dns.GetHostAddresses("www.uts-data.com")(0), 5980)
' End If
'Catch ex As Exception
' UpdateInstallTip(20, $"Send Heartbeat Packet Fail:{ex.Message}")
' Return False
'End Try
remoteIP = New IPEndPoint(Dns.GetHostAddresses("www.uts-data.com")(0), 5980) 'UpdateInstallTip(20, $"remoteIP:{remoteIP.Address }")
End If
Catch ex As Exception
UpdateInstallTip(20, $"Send Heartbeat Packet Fail:{ex.Message}")
Return False
End Try
'发送获取主机地址命令 ''发送获取主机地址命令
Try 'Try
Dim packet() As Byte = _webPacker.FillPacket(CByte(UtsWebPacket.Commands.Heartbeat), BitConverter.GetBytes(0)) ' Dim packet() As Byte = _webPacker.FillPacket(CByte(UtsWebPacket.Commands.Heartbeat), BitConverter.GetBytes(0))
_udpClient.Send(packet, packet.Length, remoteIP) ' _udpClient.Send(packet, packet.Length, remoteIP)
Catch ex As Exception 'Catch ex As Exception
UpdateInstallTip(20, $"Send Heartbeat Packet Fail:{ex.Message}") ' UpdateInstallTip(20, $"Send Heartbeat Packet Fail:{ex.Message}")
Return False ' Return False
End Try 'End Try
'UpdateInstallTip(20, $"send")
'等待回复 ''等待回复
Dim timeout As Integer = 5 * 1000 'Dim timeout As Integer = 5 * 1000
Dim lastTime As Date = Now 'Dim lastTime As Date = Now
Dim length As Integer 'Dim length As Integer
Dim recvBuf() As Byte = Nothing 'Dim recvBuf() As Byte = Nothing
Dim recviceIp As New IPEndPoint(IPAddress.Any, 0) 'Dim recviceIp As New IPEndPoint(IPAddress.Any, 0)
While (Now - lastTime).TotalMilliseconds < timeout 'While (Now - lastTime).TotalMilliseconds < timeout
length = _udpClient.Available ' length = _udpClient.Available
If length > 0 Then ' If length > 0 Then
recvBuf = _udpClient.Receive(recviceIp) ' recvBuf = _udpClient.Receive(recviceIp)
Exit While ' Exit While
End If ' End If
Threading.Thread.Sleep(1000) ' Threading.Thread.Sleep(1000)
End While 'End While
If recvBuf Is Nothing Then 'If recvBuf Is Nothing Then
UpdateInstallTip(20, $"Get Host Fail!") ' UpdateInstallTip(20, $"Get Host Fail!")
Return False ' Return False
End If 'End If
'UpdateInstallTip(20, $"Rcvd")
''校验
'Try
' _webPacker.CheckPacket(recvBuf)
'Catch ex As Exception
' UpdateInstallTip(20, $"Check Packet Error:{ex.Message}")
' Return False
'End Try
'UpdateInstallTip(20, $"Verfied")
'校验 ''处理回复
Try 'Dim cmdByte As Byte = recvBuf(UtsWebPacket.PacketBits.Command)
_webPacker.CheckPacket(recvBuf)
Catch ex As Exception
UpdateInstallTip(20, $"Check Packet Error:{ex.Message}")
Return False
End Try
'处理回复 ''不是回复心跳包
Dim cmdByte As Byte = recvBuf(UtsWebPacket.PacketBits.Command) 'If cmdByte <> 1 Then Return False
'不是回复心跳包 'Dim type As Integer
If cmdByte <> 1 Then Return False 'Dim ftpHost As String = ""
'Dim dbHost As String = ""
'For i As Integer = UtsWebPacket.PacketBits.Param + 4 To recvBuf.Count - 1
' type = recvBuf(i)
' length = recvBuf(i + 1)
Dim type As Integer ' If length = 0 Then
Dim ftpHost As String = "" ' UpdateInstallTip(20, $"Invalid data length!")
Dim dbHost As String = "" ' Return False
For i As Integer = UtsWebPacket.PacketBits.Param + 4 To recvBuf.Count - 1 ' End If
type = recvBuf(i)
length = recvBuf(i + 1)
If length = 0 Then ' Select Case type
UpdateInstallTip(20, $"Invalid data length!") ' Case 1 'ftp服务器地址
Return False ' ftpHost = Encoding.UTF8.GetString(recvBuf, i + 2, length)
End If ' Case 2 'db服务器地址
' dbHost = Encoding.UTF8.GetString(recvBuf, i + 2, length)
' End Select
' i += length + 1
'Next
Select Case type 'If String.IsNullOrEmpty(ftpHost) Then
Case 1 'ftp服务器地址 ' UpdateInstallTip(20, $"Get FtpHost Fail,Host is null.")
ftpHost = Encoding.UTF8.GetString(recvBuf, i + 2, length) ' Return False
Case 2 'db服务器地址 'Else
dbHost = Encoding.UTF8.GetString(recvBuf, i + 2, length) ' If String.Compare(UtsRegistry.FtpHost, ftpHost) <> 0 Then
End Select ' UtsRegistry.FtpHost = ftpHost '写入注册表
i += length + 1 ' End If
Next 'End If
If String.IsNullOrEmpty(ftpHost) Then 'If String.IsNullOrEmpty(dbHost) Then
UpdateInstallTip(20, $"Get FtpHost Fail,Host is null.") ' UpdateInstallTip(20, $"Get DbHost Fail,Host is null.")
Return False ' Return False
Else 'Else
If String.Compare(UtsRegistry.FtpHost, ftpHost) <> 0 Then ' If String.Compare(UtsRegistry.DbHost, dbHost) <> 0 Then
UtsRegistry.FtpHost = ftpHost '写入注册表 ' UtsRegistry.DbHost = dbHost '写入注册表
End If ' End If
End If 'End If
If String.IsNullOrEmpty(dbHost) Then '//'Momo 2025-09-09 目前先写死服务器地址,后续版本再改为动态获取
UpdateInstallTip(20, $"Get DbHost Fail,Host is null.") Dim ftpHost As String = "ftp.uts-data.com"
Return False Dim dbHost As String = "db.uts-data.com"
Else
If String.Compare(UtsRegistry.DbHost, dbHost) <> 0 Then
UtsRegistry.DbHost = dbHost '写入注册表 UtsRegistry.DbHost = dbHost '写入注册表
End If UtsRegistry.FtpHost = ftpHost '写入注册表
End If
UpdateInstallTip(20, $"Get Uts Host Success!") UpdateInstallTip(20, $"Get Uts Host Success!")
Return True Return True
End Function End Function

View File

@@ -447,3 +447,4 @@ C:\Project\AUTS_Studio\obj\Debug\AUTS_Stu.1BA4C2FE.Up2Date
C:\Project\AUTS_Studio\obj\Debug\AUTS_Studio.exe C:\Project\AUTS_Studio\obj\Debug\AUTS_Studio.exe
C:\Project\AUTS_Studio\obj\Debug\AUTS_Studio.xml C:\Project\AUTS_Studio\obj\Debug\AUTS_Studio.xml
C:\Project\AUTS_Studio\obj\Debug\AUTS_Studio.pdb C:\Project\AUTS_Studio\obj\Debug\AUTS_Studio.pdb
G:\Git\AUTS\AUTS_Studio\obj\Debug\AUTS_Studio.exe.config

Binary file not shown.

View File

@@ -175,6 +175,10 @@
<WCFMetadata Include="Connected Services\" /> <WCFMetadata Include="Connected Services\" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\AUTS_Win\AUTS_Win.vbproj">
<Project>{31df2b00-ad65-48be-a18e-4f2cbde1188d}</Project>
<Name>AUTS_Win</Name>
</ProjectReference>
<ProjectReference Include="..\UTS_Core\UTS_Core.vbproj"> <ProjectReference Include="..\UTS_Core\UTS_Core.vbproj">
<Project>{33c6456c-f00d-41ac-a6fb-db0601495c6a}</Project> <Project>{33c6456c-f00d-41ac-a6fb-db0601495c6a}</Project>
<Name>UTS_Core</Name> <Name>UTS_Core</Name>

View File

@@ -1706,6 +1706,16 @@ UTS_Core
<param name="station">当前站位信息</param> <param name="station">当前站位信息</param>
<param name="result">当前测试结果</param> <param name="result">当前测试结果</param>
</member> </member>
<member name="M:UTS_Core.UTSModule.DbConnect.DbConnector.UpdateSnListTableToLocal(UTS_Core.Database.DbExecutor,System.String,System.Collections.Generic.List{System.String},System.Collections.Generic.List{System.String},System.Boolean)">
<summary>
更新SNList表指定字段名称的值
</summary>
<param name="db"></param>
<param name="dbName"></param>
<param name="filedNames"></param>
<param name="filedValues"></param>
<param name="saveCache"></param>
</member>
<member name="M:UTS_Core.UTSModule.DbConnect.DbConnector.UpdateLocalSnList(System.String,System.String,System.String,System.String,System.String)"> <member name="M:UTS_Core.UTSModule.DbConnect.DbConnector.UpdateLocalSnList(System.String,System.String,System.String,System.String,System.String)">
<summary> <summary>
更新本地SN总表的测试记录(用于处理组播写入Sn总表操作) 更新本地SN总表的测试记录(用于处理组播写入Sn总表操作)

View File

@@ -1 +1 @@
5f5ba153640a4dff2f48567a68d3399ad14c6243da5c9356d1d73b1771bec3b4 384cd63a033c7cce4d2758ed67c54e656ca20202fe3133d7e336e161ff5fae44

View File

@@ -262,3 +262,62 @@ C:\Project\SQLliteReading\bin\Debug\System.Threading.Tasks.Extensions.xml
C:\Project\SQLliteReading\bin\Debug\K4os.Compression.LZ4.xml C:\Project\SQLliteReading\bin\Debug\K4os.Compression.LZ4.xml
C:\Project\SQLliteReading\bin\Debug\K4os.Hash.xxHash.xml C:\Project\SQLliteReading\bin\Debug\K4os.Hash.xxHash.xml
C:\Project\SQLliteReading\obj\Debug\SQLliteR.4BCD7BEC.Up2Date C:\Project\SQLliteReading\obj\Debug\SQLliteR.4BCD7BEC.Up2Date
G:\Git\AUTS\SQLliteReading\bin\Debug\x64\SQLite.Interop.dll
G:\Git\AUTS\SQLliteReading\bin\Debug\x86\SQLite.Interop.dll
G:\Git\AUTS\SQLliteReading\bin\Debug\AUTS_ProductEntry.exe.config
G:\Git\AUTS\SQLliteReading\bin\Debug\AUTS_ProductEntry.exe
G:\Git\AUTS\SQLliteReading\bin\Debug\AUTS_ProductEntry.pdb
G:\Git\AUTS\SQLliteReading\bin\Debug\AUTS_ProductEntry.xml
G:\Git\AUTS\SQLliteReading\bin\Debug\FlexCell.dll
G:\Git\AUTS\SQLliteReading\bin\Debug\Newtonsoft.Json.Bson.dll
G:\Git\AUTS\SQLliteReading\bin\Debug\Newtonsoft.Json.dll
G:\Git\AUTS\SQLliteReading\bin\Debug\UTS_Core.dll
G:\Git\AUTS\SQLliteReading\bin\Debug\SharpCompress.dll
G:\Git\AUTS\SQLliteReading\bin\Debug\FluentFTP.dll
G:\Git\AUTS\SQLliteReading\bin\Debug\TeeChart.dll
G:\Git\AUTS\SQLliteReading\bin\Debug\MySql.Data.dll
G:\Git\AUTS\SQLliteReading\bin\Debug\System.Memory.dll
G:\Git\AUTS\SQLliteReading\bin\Debug\System.Buffers.dll
G:\Git\AUTS\SQLliteReading\bin\Debug\ZstdSharp.dll
G:\Git\AUTS\SQLliteReading\bin\Debug\Google.Protobuf.dll
G:\Git\AUTS\SQLliteReading\bin\Debug\Zstandard.Net.dll
G:\Git\AUTS\SQLliteReading\bin\Debug\K4os.Compression.LZ4.Streams.dll
G:\Git\AUTS\SQLliteReading\bin\Debug\BouncyCastle.Crypto.dll
G:\Git\AUTS\SQLliteReading\bin\Debug\Ubiety.Dns.Core.dll
G:\Git\AUTS\SQLliteReading\bin\Debug\System.Numerics.Vectors.dll
G:\Git\AUTS\SQLliteReading\bin\Debug\System.Runtime.CompilerServices.Unsafe.dll
G:\Git\AUTS\SQLliteReading\bin\Debug\System.Threading.Tasks.Extensions.dll
G:\Git\AUTS\SQLliteReading\bin\Debug\K4os.Compression.LZ4.dll
G:\Git\AUTS\SQLliteReading\bin\Debug\K4os.Hash.xxHash.dll
G:\Git\AUTS\SQLliteReading\bin\Debug\UTS_Core.pdb
G:\Git\AUTS\SQLliteReading\bin\Debug\UTS_Core.xml
G:\Git\AUTS\SQLliteReading\bin\Debug\UTS_Core.dll.config
G:\Git\AUTS\SQLliteReading\bin\Debug\Newtonsoft.Json.xml
G:\Git\AUTS\SQLliteReading\bin\Debug\Newtonsoft.Json.Bson.pdb
G:\Git\AUTS\SQLliteReading\bin\Debug\Newtonsoft.Json.Bson.xml
G:\Git\AUTS\SQLliteReading\bin\Debug\SharpCompress.pdb
G:\Git\AUTS\SQLliteReading\bin\Debug\FluentFTP.xml
G:\Git\AUTS\SQLliteReading\bin\Debug\MySql.Data.xml
G:\Git\AUTS\SQLliteReading\bin\Debug\System.Memory.xml
G:\Git\AUTS\SQLliteReading\bin\Debug\System.Buffers.xml
G:\Git\AUTS\SQLliteReading\bin\Debug\Google.Protobuf.pdb
G:\Git\AUTS\SQLliteReading\bin\Debug\Google.Protobuf.xml
G:\Git\AUTS\SQLliteReading\bin\Debug\K4os.Compression.LZ4.Streams.xml
G:\Git\AUTS\SQLliteReading\bin\Debug\System.Numerics.Vectors.xml
G:\Git\AUTS\SQLliteReading\bin\Debug\System.Runtime.CompilerServices.Unsafe.xml
G:\Git\AUTS\SQLliteReading\bin\Debug\System.Threading.Tasks.Extensions.xml
G:\Git\AUTS\SQLliteReading\bin\Debug\K4os.Compression.LZ4.xml
G:\Git\AUTS\SQLliteReading\bin\Debug\K4os.Hash.xxHash.xml
G:\Git\AUTS\SQLliteReading\obj\Debug\SQLliteReading.vbproj.AssemblyReference.cache
G:\Git\AUTS\SQLliteReading\obj\Debug\AUTS_ProductEntry.exe.config
G:\Git\AUTS\SQLliteReading\obj\Debug\AUTS_ProductEntry.FrmMain.resources
G:\Git\AUTS\SQLliteReading\obj\Debug\AUTS_ProductEntry.Resources.resources
G:\Git\AUTS\SQLliteReading\obj\Debug\SQLliteReading.vbproj.GenerateResource.cache
G:\Git\AUTS\SQLliteReading\obj\Debug\SQLliteReading.vbproj.CoreCompileInputs.cache
G:\Git\AUTS\SQLliteReading\obj\Debug\SQLliteR.4BCD7BEC.Up2Date
G:\Git\AUTS\SQLliteReading\obj\Debug\AUTS_ProductEntry.exe
G:\Git\AUTS\SQLliteReading\obj\Debug\AUTS_ProductEntry.xml
G:\Git\AUTS\SQLliteReading\obj\Debug\AUTS_ProductEntry.pdb
G:\Git\AUTS\SQLliteReading\bin\Debug\AUTS_Win.exe
G:\Git\AUTS\SQLliteReading\bin\Debug\AUTS_Win.pdb
G:\Git\AUTS\SQLliteReading\bin\Debug\AUTS_Win.exe.config

View File

@@ -173,6 +173,12 @@ Namespace UTSModule.Project
project.InfoChanged = True project.InfoChanged = True
End If End If
'Momo 2025-07-17 新增对项目有效期的修改检测
MsgBoxDtpValidDate.Value)
If String.Compare(project.EolDate.ToString, DtpValidDate.Value.ToString) <> 0 Then
project.EolDate = DtpValidDate.Value
project.InfoChanged = True
End If
If project.Price <> NudPrice.Value Then If project.Price <> NudPrice.Value Then
project.Price = NudPrice.Value project.Price = NudPrice.Value

View File

@@ -859,8 +859,7 @@ Namespace UTSModule.Project
Private Function ProjectExists(db As DbExecutor, dbName As String, project As ProjectInfo) As Boolean Private Function ProjectExists(db As DbExecutor, dbName As String, project As ProjectInfo) As Boolean
Dim tableName As String = DbTableModel.Customer.ProjectTable.TableName Dim tableName As String = DbTableModel.Customer.ProjectTable.TableName
Dim colNames As String = $"Count(*)" Dim colNames As String = $"Count(*)"
Dim condition As String = $"`{DbTableModel.Customer.ProjectTable.ColNames.ProjectName}` = '{project.Name}' or Dim condition As String = $"`{DbTableModel.Customer.ProjectTable.ColNames.ProjectName}` = '{project.Name}' or `{DbTableModel.Customer.ProjectTable.ColNames.ID}` = '{project.Index}' "
`{DbTableModel.Customer.ProjectTable.ColNames.ID}` = '{project.Index}' "
Return CInt(db.ExecuteScalar(db.CmdHelper.DbSearch(dbName, colNames, tableName, condition))) > 0 Return CInt(db.ExecuteScalar(db.CmdHelper.DbSearch(dbName, colNames, tableName, condition))) > 0
End Function End Function
@@ -1045,9 +1044,7 @@ Namespace UTSModule.Project
Private Function StationExists(db As DbExecutor, dbName As String, processStation As ProcessStation) As Boolean Private Function StationExists(db As DbExecutor, dbName As String, processStation As ProcessStation) As Boolean
Dim tableName As String = DbTableModel.Customer.StationListTable.TableName Dim tableName As String = DbTableModel.Customer.StationListTable.TableName
Dim colName As String = "Count(*)" Dim colName As String = "Count(*)"
Dim condition As String = $"`{DbTableModel.Customer.StationListTable.ColNames.ProjectID}` = {processStation.ParentProject.Index} Dim condition As String = $"`{DbTableModel.Customer.StationListTable.ColNames.ProjectID}` = {processStation.ParentProject.Index} and (`{DbTableModel.Customer.StationListTable.ColNames.StationName}` = '{processStation.Name}' or `{DbTableModel.Customer.StationListTable.ColNames.ID}` = '{processStation.StationID}')"
and (`{DbTableModel.Customer.StationListTable.ColNames.StationName}` = '{processStation.Name}'
or `{DbTableModel.Customer.StationListTable.ColNames.ID}` = '{processStation.StationID}')"
Return CInt(db.ExecuteScalar(db.CmdHelper.DbSearch(dbName, colName, tableName, condition))) > 0 Return CInt(db.ExecuteScalar(db.CmdHelper.DbSearch(dbName, colName, tableName, condition))) > 0
End Function End Function

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.