Bläddra i källkod

达梦数据库开发

develop
OCEAN 4 månader sedan
förälder
incheckning
c69b2cbb94
12 ändrade filer med 2807 tillägg och 24 borttagningar
  1. Binär
      .vs/CNAS_DBSync/v15/.suo
  2. Binär
      .vs/CNAS_DBSync/v15/Server/sqlite3/storage.ide
  3. Binär
      .vs/CNAS_DBSync/v15/Server/sqlite3/storage.ide-shm
  4. Binär
      .vs/CNAS_DBSync/v15/Server/sqlite3/storage.ide-wal
  5. +4
    -4
      CNAS_DBSync/frmSplitParam.Designer.cs
  6. +5
    -5
      CNAS_DBSync/frmSplitParam.cs
  7. +81
    -14
      CnasSynchronusClient/CnasInsertOperation.cs
  8. +1
    -0
      CnasSynchronusClient/CnasSynchronusBLL.csproj
  9. Binär
      dll/CNAS_DBSync.exe
  10. Binär
      dll/CnasSynchronusClient.dll
  11. +5
    -1
      dll/DataConfig/aaa.xml
  12. +2711
    -0
      dll/ErrorLog/20250216.txt

Binär
.vs/CNAS_DBSync/v15/.suo Visa fil


Binär
.vs/CNAS_DBSync/v15/Server/sqlite3/storage.ide Visa fil


Binär
.vs/CNAS_DBSync/v15/Server/sqlite3/storage.ide-shm Visa fil


Binär
.vs/CNAS_DBSync/v15/Server/sqlite3/storage.ide-wal Visa fil


+ 4
- 4
CNAS_DBSync/frmSplitParam.Designer.cs Visa fil

@@ -105,18 +105,18 @@
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(199, 108);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(243, 20);
this.label5.Size = new System.Drawing.Size(104, 20);
this.label5.TabIndex = 7;
this.label5.Text = "(截断后返回左侧(L)/右侧(R)的内容)";
this.label5.Text = "(截断终止位)";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(200, 35);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(79, 20);
this.label4.Size = new System.Drawing.Size(114, 20);
this.label4.TabIndex = 6;
this.label4.Text = "(截断字符)";
this.label4.Text = "(截断起始位)";
//
// label2
//


+ 5
- 5
CNAS_DBSync/frmSplitParam.cs Visa fil

@@ -32,11 +32,11 @@ namespace CNAS_DBSync
MessageBox.Show("参数2不能为空。");
return;
}
if (this.cbxPrama2.Text != "L" && this.cbxPrama2.Text != "R")
{
MessageBox.Show("参数2不符合规则,请重新选择。");
return;
}
//if (this.cbxPrama2.Text != "L" && this.cbxPrama2.Text != "R")
//{
// MessageBox.Show("参数2不符合规则,请重新选择。");
// return;
//}

this.conditionvalue.Value = "{"+ this.txtPrama1.Text + ","+ this.cbxPrama2.Text + "}";
this.DialogResult = DialogResult.OK;


+ 81
- 14
CnasSynchronusClient/CnasInsertOperation.cs Visa fil

@@ -4,6 +4,8 @@ using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Management;
using System.Net.NetworkInformation;
using System.Text;
using System.Text.RegularExpressions;

@@ -60,7 +62,7 @@ namespace CnasSynchronusClient
break;
}
if (dtTarget.Columns.Contains(syncInstrumentItem.CnasInstrumentColumn))
drNewTarget[syncInstrumentItem.CnasInstrumentColumn] = syncInstrumentItem.GUID;
drNewTarget[syncInstrumentItem.CnasInstrumentColumn] = syncInstrumentItem.GUID + GetMachineCode();
else
{
strErrorMsg = "设置的CNAS仪器信息列没有在库中找到,请重新配置";
@@ -79,7 +81,70 @@ namespace CnasSynchronusClient
}
return strErrorMsg;
}
private string GetMachineCode()
{
StringBuilder machineCode = new StringBuilder();

// 获取CPU ID
string cpuId = GetCPUId();
machineCode.Append(cpuId);

// 获取所有MAC地址
List<string> macAddresses = GetMACAddresses();
foreach (string mac in macAddresses)
{
machineCode.Append("_").Append(mac);
}

return machineCode.ToString();
}

private string GetCPUId()
{
try
{
using (ManagementClass mc = new ManagementClass("Win32_Processor"))
{
ManagementObjectCollection moc = mc.GetInstances();
foreach (ManagementObject mo in moc)
{
return mo.Properties["ProcessorId"].Value.ToString();
}
}
}
catch (Exception ex)
{
throw new Exception("获取CPU ID失败: " + ex.Message);
}
return string.Empty;
}

private List<string> GetMACAddresses()
{
List<string> macAddresses = new List<string>();
try
{
NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces();
foreach (NetworkInterface adapter in nics)
{
// 只获取物理网卡的MAC地址
if (adapter.NetworkInterfaceType == NetworkInterfaceType.Ethernet ||
adapter.NetworkInterfaceType == NetworkInterfaceType.Wireless80211)
{
string mac = adapter.GetPhysicalAddress().ToString();
if (!string.IsNullOrEmpty(mac))
{
macAddresses.Add(mac);
}
}
}
}
catch (Exception ex)
{
throw new Exception("获取MAC地址失败: " + ex.Message);
}
return macAddresses;
}
/// <summary>
/// 获取日期字段
/// </summary>
@@ -443,7 +508,6 @@ namespace CnasSynchronusClient
AppLog.Error(ex.Message);
}
}

/// <summary>
/// 处理SubString类型固定值
/// </summary>
@@ -458,24 +522,27 @@ namespace CnasSynchronusClient
if (item.Value != null && item.Value.ToString() != "")
{
string[] strValues = item.Value.ToString().Split(new string[] { "{", ",", "}" }, StringSplitOptions.RemoveEmptyEntries);

if (strValues.Length == 2)
{
string[] strInputValues = drNewTarget[item.ColumnName].ToString().Split(new string[] { strValues[0] }, StringSplitOptions.RemoveEmptyEntries);
if (strInputValues.Length == 1)
{
drNewTarget[item.ColumnName] = strInputValues[0];
}
if (strInputValues.Length == 2) //只处理分割后有两部分的
{
if (strValues[1] == "L")
{
drNewTarget[item.ColumnName] = strInputValues[0];
}
else if (strValues[1] == "R")
{
drNewTarget[item.ColumnName] = strInputValues[1];
}

var list = strInputValues[0].Substring(Convert.ToInt32(strValues[0]), Convert.ToInt32(strValues[1]));
drNewTarget[item.ColumnName] = list;
}
//if (strInputValues.Length == 2) //只处理分割后有两部分的
//{
// if (strValues[1] == "L")
// {
// drNewTarget[item.ColumnName] = strInputValues[0];
// }
// else if (strValues[1] == "R")
// {
// drNewTarget[item.ColumnName] = strInputValues[1];
// }
//}
}
}
}


+ 1
- 0
CnasSynchronusClient/CnasSynchronusBLL.csproj Visa fil

@@ -45,6 +45,7 @@
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Management" />
<Reference Include="System.Web" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Xml.Linq" />


Binär
dll/CNAS_DBSync.exe Visa fil


Binär
dll/CnasSynchronusClient.dll Visa fil


+ 5
- 1
dll/DataConfig/aaa.xml Visa fil

@@ -1 +1,5 @@
<?xml version="1.0" encoding="utf-8"?><SystemFormatConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><ShowDelayDays>-10</ShowDelayDays><TableInfoMode>0</TableInfoMode><ShowLogDays>-10</ShowLogDays><YQName>aaa</YQName></SystemFormatConfig>
<<<<<<< HEAD
<?xml version="1.0" encoding="utf-8"?><SystemFormatConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><ShowDelayDays>-10</ShowDelayDays><TableInfoMode>0</TableInfoMode><ShowLogDays>-10</ShowLogDays><YQName>aaa</YQName></SystemFormatConfig>
=======
<?xml version="1.0" encoding="utf-8"?><SystemFormatConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><ShowDelayDays>0</ShowDelayDays><TableInfoMode>0</TableInfoMode><ShowLogDays>0</ShowLogDays><YQName>aaa</YQName></SystemFormatConfig>
>>>>>>> e61dd2ce015f609324a2df3f403e999bf1c3591b

+ 2711
- 0
dll/ErrorLog/20250216.txt
Filskillnaden har hållits tillbaka eftersom den är för stor
Visa fil


Laddar…
Avbryt
Spara