/******************************
* 说明:右键菜单、常用菜单通用类
* 创建人:龚宇超
* 创建日期:2017-12-19
* 修改人:
* 修改日期:
* 修改备注:
* 版本:1.0.0.0
******************************/
using DevExpress.Utils;
using DevExpress.Utils.Menu;
using DevExpress.XtraGrid.Columns;
using DevExpress.XtraGrid.Views.Base;
using DevExpress.XtraGrid.Views.Grid;
using DevExpress.XtraTab;
using Lskj.Business;
using Lskj.Business.Impl;
using Lskj.Control.BrowserSetting;
using Lskj.Core;
using Lskj.Data;
using Lskj.Data.Api.BLL;
using Lskj.Model;
using Lskj.Util;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Web;
using System.Windows.Forms;
namespace Lskj.Control.Model
{
///
/// 右键菜单、常用菜单通用类
///
public class BaseRightMenu
{
///
/// 最初账套版本
///
public DataRow AccountItem;
public DataTable MenuTable;
public DynamicModel Model;
public MyControl ControlObj;
///
/// 表格按钮右键
///
public Dictionary RightMenuBtnEdits = new Dictionary();
///
/// mrp按钮右键
///
public Dictionary RightMenuMrpBtnEdits = new Dictionary();
protected GridView BaseGridView;
protected ContextMenuStrip MenuStrip;
///
/// 右键菜单执行完成后调用事件
///
protected event EventHandler OnRightCallback;
///
/// 替换参数前执行
///
public event BeforeHandleParamsEventHandler OnBeforeHandleParamsCallback;
///
/// 缓存右键菜单
///
protected List RightMenuItems = new List();
///
/// 是否允许右键回调
///
public bool AllowRightCallback = false;
FrmProgressBar frmProgressBar = null;
///
/// 说明:设置右键菜单
/// 创建人:龚宇超
/// 创建日期:2017-12-19
/// 修改人:
/// 修改日期:
/// 修改备注:
/// 版本:1.0
///
/// The grid view.
/// The table.
public virtual void InitRightMenus(System.Windows.Forms.Control view, DataTable table, DynamicModel model, MyControl control = null, ContextMenuStrip menu = null)
{
this.MenuTable = table;
this.Model = model;
this.ControlObj = control;
//判断是否存在网址框(需要绑定右键打开事件判断是否生成 网址框右键)
bool existLabWWW = false;
if (view is GridControlEx)
{
GridControlEx grid = view as GridControlEx;
foreach (GridColumn item in grid.GridView.Columns)
{
if (item.Tag is GridColumnModel)
{
GridColumnModel gridColumnModel = item.Tag as GridColumnModel;
if (gridColumnModel.FieldType == ControlType.LabWWW) existLabWWW = true;
}
}
}
if (((table == null || table.Rows.Count == 0) && menu == null) && !existLabWWW) return;
ContextMenuStrip cmsMenu = new ContextMenuStrip();
cmsMenu.Opening += new CancelEventHandler(MenuStripOpening);
if (menu != null)
{
// 添加固定的右键菜单,例附件管理
for (int i = menu.Items.Count - 1; i >= 0; i--)
{
ToolStripMenuItem item = menu.Items[i] as ToolStripMenuItem;
cmsMenu.Items.Add(item);
RightMenuItems.Add(item);
}
}
foreach (DataRow item in table.Rows)
{
GridRightMenuModel menuModel = new GridRightMenuModel(item);
if (!string.IsNullOrWhiteSpace(menuModel.MenuName))
{
ToolStripMenuItem menuItem = new ToolStripMenuItem();
menuItem.Text = menuModel.MenuName;
menuItem.Tag = menuModel;
menuItem.Click += new EventHandler(MenuStripItemClick);
if ((item.Table.Columns.Contains("IcoName") && !string.IsNullOrEmpty(item["IcoName"] + "")) || (item.Table.Columns.Contains("showtoolbar") && !string.IsNullOrEmpty(item["showtoolbar"] + "")))
{
RightMenuBtnEdits.Add(menuModel.Id, menuItem);
}
if (item.Table.Columns.Contains("isMrpClickBtn") && (item["isMrpClickBtn"] + "").Equals("1"))
{
RightMenuMrpBtnEdits.Add(menuModel.Id, menuItem);
}
else
{
cmsMenu.Items.Add(menuItem);
RightMenuItems.Add(menuItem);
}
}
if (!string.IsNullOrWhiteSpace(menuModel.ExecuteFirstCode))
{
DataRow[] rows = table.Select("orderid='" + menuModel.ExecuteFirstCode + "'");
if (rows != null && rows.Length > 0)
{
GridRightMenuModel ExecuteFirstMenuModel = new GridRightMenuModel(rows[0]);
menuModel.ExecuteFirstRightModel = ExecuteFirstMenuModel;
}
}
}
this.MenuStrip = cmsMenu;
}
///
/// 说明:设置回调函数
/// 创建人:龚宇超
/// 创建日期:2017-12-19
/// 修改人:
/// 修改日期:
/// 修改备注:
/// 版本:1.0
///
/// The handler.
public virtual void SetRightCallback(EventHandler handler)
{
this.OnRightCallback = handler;
}
///
/// 说明:右键菜单执行前调用
/// 创建人:龚宇超
/// 创建日期:2018-01-29
/// 修改人:
/// 修改日期:
/// 修改备注:
/// 版本:1.0
///
/// The item.
/// The model.
protected virtual void MenuStripClickBefore(ToolStripMenuItem item, GridRightMenuModel model)
{
}
///
/// 说明:右键菜单执行完
/// 创建人:龚宇超
/// 创建日期:2018-01-29
/// 修改人:
/// 修改日期:
/// 修改备注:
/// 版本:1.0
///
/// The item.
/// The model.
protected virtual void MenuStripClickAfter(ToolStripMenuItem item, GridRightMenuModel model)
{
}
///
/// 说明:右键菜单打开前判断
/// 创建人:龚宇超
/// 创建日期:2018-01-29
/// 修改人:
/// 修改日期:
/// 修改备注:
/// 版本:1.0
///
/// The sender.
/// The instance containing the event data.
protected virtual void MenuStripOpening(object sender, CancelEventArgs e)
{
}
///
/// 说明:检查可用条件
/// 创建人:龚宇超
/// 创建日期:2017-11-09
/// 修改人:
/// 修改日期:
/// 修改备注:
/// 版本:1.0
///
/// The cond.
/// The data row.
/// true if XXXX, false otherwise.
public bool ValidateCond(string cond, DataRow dataRow)
{
bool result = false;
cond = ReplaceHelper.ReplaceRowParam(dataRow, cond);
if (cond.StartsWith("@") || cond.StartsWith("!"))
{
result = "1".Equals(BaseImpl.GetDefaultValue(cond));
}
else if (dataRow == null)
{
result = ReplaceHelper.EvalCond(cond);
}
else
{
result = ReplaceHelper.ReplaceRowParamCond(dataRow, cond);
}
return result;
}
///
/// 说明:右键菜单点击
/// 创建人:龚宇超
/// 创建日期:2018-01-29
/// 修改人:
/// 修改日期:
/// 修改备注:
/// 版本:1.0
///
/// The sender.
/// The instance containing the event data.
protected virtual void MenuStripItemClick(object sender, EventArgs e)
{
ToolStripMenuItem item = sender as ToolStripMenuItem;
DXMenuItem items = sender as DXMenuItem;
DataRow[] rowArray = GetSelectedRows();
GridRightMenuModel model = item == null ? items.Tag as GridRightMenuModel : item.Tag as GridRightMenuModel;
if (!model.Mergeexec && !model.MoreClick && rowArray.Length > 1)
{
MessageUtil.Show(string.Format(ResourceKeys.ExecRightMenuOnlyOne, model.MenuName));
return;
}
if (model.AllowNullExec && rowArray.Length == 0)
{
rowArray = new DataRow[] { new DataTable().NewRow() };
}
if (rowArray.Length == 0 && model.IsMustSelectRow())
{
MessageUtil.Show(ResourceKeys.SelectRowIsNull);
return;
}
if (!string.IsNullOrEmpty(model.UnionZTid))
{
string UnionZTid = ReplaceHelper.ReplaceRowParam(rowArray[0], model.UnionZTid);
string condition = string.Format("where ShowName ='{0}'", ERPInfo.Instance.AccountBook);
DataTable dt = MainImpl.GetLedgerList(condition);
DataRow RT = BaseImpl.GetDataRowResult($"select * from p_sydbGroupTab where ID={UnionZTid}");
AccountItem = dt.Rows[0];
AccountItem["IP"] = DBConfig.Instance.ServerName;
ToDBatching(RT, AccountItem);
}
try
{
this.MenuStripClickBefore(item, model);
if (model.ExecuteFirstRightModel != null)
{
bool ExecuteFirstExecResult = this.ExecRightMenu(model.ExecuteFirstRightModel, rowArray);
if (!ExecuteFirstExecResult) return;
}
bool execResult = this.ExecRightMenu(model, rowArray);
//if (model.nextrightcode == 0 && execResult)
//{
//}
if (model.ActionType == 0 && execResult && !model.DisableSuccessfulPrompt)
{
MessageUtil.Show(string.IsNullOrEmpty(model.SuccessMsg) ? ResourceKeys.OperSuccess : model.SuccessMsg);
}
if ((execResult || AllowRightCallback) && model.Refresh && this.OnRightCallback != null)
{
this.OnRightCallback(sender, e);
}
if (!string.IsNullOrWhiteSpace(this.Model.ModuleCode))
{
DataRow modelRow = MainImpl.GetSystemdllTab(this.Model.ModuleCode);//获取单个模块信息
ModuleModel SysModel = new ModuleModel(modelRow);// 系统模块实体对象
if (SysModel.AccordingNameSelected == 0)
{
this.MenuStripClickAfter(item, model);
}
}
}
catch (Exception ex)
{
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show(Message, ex.Message);
LogHelper.Instance.WriteError(ex);
}
finally
{
if (!string.IsNullOrEmpty(model.UnionZTid)) ToDBatching(AccountItem, AccountItem);
}
}
///
/// 启动账套数据源刷新
///
protected void ToDBatching(DataRow RT, DataRow firstrow)
{
string serverIP = RT["IP"] + "";
string dbName = RT["DBName"] + "";
string dataBook = RT["ShowName"] + "";
bool isInternal = RT.Table.Columns.Contains("IsInternalNetwork") && !string.IsNullOrEmpty(RT["IsInternalNetwork"] + "") ? "1".Equals(RT["IsInternalNetwork"] + "") : false;
DBConfig.Instance.DataBook = dataBook;
DBConfig.Instance.ServerName = serverIP;
DBConfig.Instance.DataBase = dbName;
DBConfig.Instance.IsInternalNetwork = isInternal;
if (!DBConfig.Instance.CreateConnection())
{
ToDBatching(firstrow, firstrow);
}
}
///
/// 说明:QQ点击
/// 创建人:龚宇超
/// 创建日期:2017-10-30
/// 修改人:
/// 修改日期:
/// 修改备注:
/// 版本:1.0
///
/// The source of the event.
/// The instance containing the event data.
protected void QQItemClick(object sender, EventArgs e)
{
try
{
ToolStripMenuItem item = (ToolStripMenuItem)sender;
Process process = new Process();
ProcessStartInfo processInfo = new ProcessStartInfo();
string Url = string.Format(@"tencent://message/?Menu=yes&uin={0}", item.Tag);
processInfo.FileName = @"iexplore.exe";
processInfo.Arguments = Url;
processInfo.UseShellExecute = true;
processInfo.RedirectStandardInput = false;
process.StartInfo = processInfo;
process.Start();
}
catch (Exception ex)
{
LogHelper.Instance.WriteError(ex);
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show(ResourceKeys.OpenQQError);
}
}
///
/// 说明:网站点击
/// 创建人:龚宇超
/// 创建日期:2017-10-30
/// 修改人:
/// 修改日期:
/// 修改备注:
/// 版本:1.0
///
/// The source of the event.
/// The instance containing the event data.
protected void BrowerItemClick(object sender, EventArgs e)
{
try
{
ToolStripMenuItem item = (ToolStripMenuItem)sender;
//Process.Start("iexplore.exe", item.Tag + "");
System.Diagnostics.Process.Start(item.Tag + "");//默认浏览器打开
}
catch (Exception ex)
{
LogHelper.Instance.WriteError(ex);
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show(ResourceKeys.OpenBrowerFault);
}
}
///
/// 说明:执行右键菜单
/// 创建人:龚宇超
/// 创建日期:2017-10-30
/// 修改人:
/// 修改日期:
/// 修改备注:
/// 版本:1.0
///
/// The model.
/// The row handles.
/// true if XXXX, false otherwise.
public bool ExecRightMenu(GridRightMenuModel model, DataRow[] rows)
{
StaticControl.RightMenuGridView = BaseGridView;
List paramListEx = model.ParamList;
List paramList = null;
bool resultValue = true;
bool isFirstSuccess = false;//第一次返回成功
bool FinallySucceeded = false;//最后一次成功
string actionSql = string.Empty;
bool execOnlyOne = IsExecOnlyOne(model, paramListEx, rows, out actionSql);
bool tipOnlyOne = true; // 执行是否提示一次
bool allowBefore = ApiHelper.IsExecEventApi(Interface.Api.OperateEvent.BeforeModuleContextMenu, Model.ModuleCode, model.Id);
bool allowAfter = ApiHelper.IsExecEventApi(Interface.Api.OperateEvent.AfterModuleContextMenu, Model.ModuleCode, model.Id);
if (model.AllowNullExec && rows.Length == 0)
{
rows = new DataRow[] { new DataTable().NewRow() };
}
for (int i = 0; i < rows.Length; i++)
{
// 只执行一次,则后续不再执行.
if (execOnlyOne && i > 0) continue;
LogUtil.WriteDebug(model.MenuTabName, "执行右键", model.MenuName, "右键id:" + model.Id);
DataRow rowData = rows[i];
if (!string.IsNullOrWhiteSpace(model.BeforeMsg) && tipOnlyOne)
{
tipOnlyOne = false;
string prompt = ReplaceHelper.ReplaceRowParam(rowData, model.BeforeMsg);
if (prompt.StartsWith("@") || prompt.StartsWith("!"))
{
prompt = BaseImpl.GetDefaultValue(prompt);
}
if (!string.IsNullOrWhiteSpace(prompt))
{
DialogResult result = MessageUtil.Show(prompt, MessageBoxButtons.YesNo);
//DialogResult result = MessageUtil.Show(ReplaceHelper.ReplaceRowParam(rowData, model.BeforeMsg), MessageBoxButtons.YesNo);
if (result != DialogResult.Yes)
{
resultValue = false;
break;
}
}
}
//删除触发的接口所要用到的参数,先把参数存到表中,同步工具去处理
if (!string.IsNullOrWhiteSpace(model.DelToPostSql) && !string.IsNullOrWhiteSpace(model.SynchronizationToolSQL))
{
DataTable dt = BaseModuleImpl.GetDataTableResult(ReplaceHelper.ReplaceRowParam(rowData, model.DelToPostSql));
foreach (DataRow dr in dt.Rows)
{
SqlHelper.ExecuteNonQuery(ReplaceHelper.ReplaceRowParam(dr, model.SynchronizationToolSQL).Replace("''", "null"));
}
}
paramList = this.HandleRightMenuParams(paramListEx, rowData, model.Mergeexec ? rows : null, model.ActionType);
string maintabFocusedRowJson = "";
if (rowData != null)
{
maintabFocusedRowJson = rowData.ToJsonObject();
}
paramList.Add(maintabFocusedRowJson);
string dllName = ReplaceHelper.ReplaceRowParam(rowData, model.DllName).Trim();
if (this.BaseGridView != null)
{
GridCell[] cells = this.BaseGridView.GetSelectedCells();
if (cells != null && cells.Length > 0 && dllName.Contains("{COLUMN_"))
{
GridCell cell = cells[0];
DataRow focusedRow = this.BaseGridView.GetFocusedDataRow();
string colValue = focusedRow == null || !focusedRow.Table.Columns.Contains(cell.Column.Name) ? "" : focusedRow[cell.Column.Name] + "";
dllName = dllName.ReplaceColumnParam(cell.Column.Name, cell.Column.Caption, colValue);
}
}
if ((dllName.Equals("Lskj.PubBrower.dll", StringComparison.CurrentCultureIgnoreCase) || dllName.Equals("Lskj.PubBrower2.dll", StringComparison.CurrentCultureIgnoreCase)) && SystemInfo.Instance.PrimitiveBrowser)
{
dllName = "Lskj.PubBrowerXp.dll";
}
if (dllName.Equals("MyFormDesinger.exe", StringComparison.OrdinalIgnoreCase))
{
string[] args = { paramList[0], "-", "-", paramList[3] };
System.Diagnostics.Process.Start(PubUtil.AbsolutelyPath + "Desinger\\" + dllName, string.Join(" ", args));
}
else if (dllName.Equals("LsCallLibrary.exe", StringComparison.OrdinalIgnoreCase))
{
System.Diagnostics.Process.Start(PubUtil.AbsolutelyPath + dllName, string.Join(" ", paramList.ToArray()));
}
// 特殊处理程序
else if (dllName.Contains(".exe") && !model.WipeExes.Contains(dllName.ToString()) && (dllName.ToLower() != "lstest.exe"))
{
//WinHelper.WinExec(File.Exists(dllName) ? dllName : PubUtil.AbsolutelyLibPath + dllName, 1);
// WinHelper.WinExec(dllName);
string[] dllNameSplit = Regex.Split(dllName, ":args=");
string[] pmsSplit = dllNameSplit.Length > 1 ? (dllNameSplit[1] + "").Split(',') : null;
if (dllNameSplit.Length > 1 && pmsSplit != null && pmsSplit.Length > 0)//嵌入exe模块
{
string[] pmsArgs = pmsSplit.Select(pms => ReplaceHelper.ReplaceUserInfo(pms)).ToArray();
string guid = Guid.NewGuid().ToString();
Panel mainPanel = new Panel();
ProcessStartInfo processStartInfo = new ProcessStartInfo()
{
FileName = dllNameSplit[0],
Arguments = HandleHelper.CombineArgs(pmsArgs),
UseShellExecute = false,
RedirectStandardOutput = false,
RedirectStandardError = false,
CreateNoWindow = false
};
Process startedProcess = Process.Start(processStartInfo);
if (startedProcess == null)
{
MessageUtil.Show("进程启动失败");
return false;
}
startedProcess.WaitForInputIdle();
int retry = 0;
while (startedProcess.MainWindowHandle == IntPtr.Zero && retry < 500)
{
Thread.Sleep(100);
startedProcess.Refresh();
retry++;
}
IntPtr exeMainHandle = startedProcess.MainWindowHandle;
if (exeMainHandle == IntPtr.Zero)
{
MessageBox.Show("无法获取启动程序的主窗口句柄");
return false;
}
HandleHelper.SetFormNoneStyle(exeMainHandle, mainPanel);
mainPanel.Dock = DockStyle.Fill;
using (BaseForm baseForm = new BaseForm())
{
baseForm.WindowState = FormWindowState.Maximized;
baseForm.Controls.Add(mainPanel);
baseForm.ShowDialog();
}
}
else
{
//删除选中行的json信息
if (!string.IsNullOrWhiteSpace(maintabFocusedRowJson)) paramList.Remove(maintabFocusedRowJson);
// 创建进程启动信息对象
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = File.Exists(dllName) ? dllName : PubUtil.AbsolutelyLibPath + dllName; // 指定要启动的 EXE 路径
// 将参数数组拼接为命令行字符串(注意空格处理)
// 若参数包含空格,需要用双引号包裹,避免被解析为多个参数
startInfo.Arguments = string.Join(" ", paramList.Select(arg =>
arg.Contains(" ") ? $"\"{arg}\"" : arg
));
// 可选:设置进程启动选项
startInfo.UseShellExecute = false; // 不使用系统外壳程序(建议为 false,便于重定向输入输出)
startInfo.CreateNoWindow = false; // 是否在新窗口中启动(false 为显示窗口)
// 启动进程
Process process = Process.Start(startInfo);
// 执行exe程序
//WinHelper.WinExec(File.Exists(dllName) ? dllName : PubUtil.AbsolutelyLibPath + dllName, 1);
}
}
else if (dllName.StartsWith("www.") ||
dllName.StartsWith("http://") ||
dllName.StartsWith("https://") ||
dllName.StartsWith("ftp://") ||
dllName.StartsWith("file://"))
{
// 打开网页程序
Process.Start(dllName);
}
else
{
#region 右键执行前调用Api接口
if (allowBefore)
{
ApiHelper apiHelper = new ApiHelper(Model.ModuleCode, model.Id, rowData);
apiHelper.OnEvent(Interface.Api.OperateEvent.BeforeModuleContextMenu, Interface.Api.ActionType.None);//添
if (!apiHelper.apiHandler.GetApiSuccess(apiHelper.apiHandlerModels))
{
MessageUtil.Show(ResourceKeys.OperFault + "\r\n" + apiHelper.apiResutMsg);
resultValue = false;
break;
}
}
#endregion
if (model.DuringExecutionMinimize) ERPInfo.Instance.MainControl.WindowState = FormWindowState.Minimized;
switch (model.ActionType)
{
case 1: // 执行存储过程
if (i == rows.Length - 1 || execOnlyOne)
{
//执行最后一条
FinallySucceeded = true;
}
resultValue = ExecProcedure(model, paramList, FinallySucceeded);
//resultValue = ExecProcedure(model, paramList, isFirstSuccess);
//isFirstSuccess = resultValue;
break;
case 2: // 调用dll程序
resultValue = ExecDynamicLinkLibary(model, paramList, dllName);
break;
case 3: //调用delphi程序
resultValue = ExecDelphiLibary(model.DllName, paramList);
//LogUtil.WriteDebug(model.MenuTabName, "打印", "右键打印:"+ model.MenuName, "打印格式:" + paramList[1]);
break;
case 4://调用主程序右键直接添加到page上
resultValue = ExecDynamicLinkLibary(model, paramList, dllName, true, rowData);
break;
case 5://执行存储过程获取下载url集合执行批量下载
resultValue = ExecDownloadFiles(model, paramList, rows);
break;
case 6://下载后打开文件
resultValue = OpenAfterDownloading(model, paramList);
break;
case 7://打开导入覆盖控件
resultValue = OpenFrmcCover(model, paramList);
break;
case 0: // 执行sql语句
resultValue = ExecSqlValue(model, rowData, actionSql);
break;
}
if (resultValue)
{
#region 右键执行成功调用Api接口
if (allowAfter)
{
ApiHelper apiHelper = new ApiHelper(Model.ModuleCode, model.Id, rowData);
apiHelper.OnEvent(Interface.Api.OperateEvent.AfterModuleContextMenu, Interface.Api.ActionType.None);
if (!apiHelper.apiHandler.GetApiSuccess(apiHelper.apiHandlerModels))
{
MessageUtil.Show(ResourceKeys.OperFault + "\r\n" + apiHelper.apiResutMsg);
resultValue = false;
break;
}
}
#endregion
}
}
}
return resultValue;
}
///
/// 导入数据或者反写到界面
///
///
///
///
public bool OpenFrmcCover(GridRightMenuModel model, List paramList)
{
bool importIntoDatabase = false;
if (string.IsNullOrWhiteSpace(paramList[0]) || paramList[0] + "" == "0")
{
//模式1,把导入的数据反写到主界面上
if (string.IsNullOrWhiteSpace(paramList[1]) || string.IsNullOrWhiteSpace(paramList[2]))
{
MessageUtil.Show("模块编号或主键名称未配置");
return false;
}
}
else
{
//模式2,保存到数据库中,在执行保存后sql
importIntoDatabase = true;
if (string.IsNullOrWhiteSpace(paramList[1]))
{
MessageUtil.Show("模块编号未配置");
return false;
}
}
string primaryKey = paramList[2];
FrmCover frmCover = new FrmCover(importIntoDatabase, paramList[1], paramList[2], paramList[3]);
if (frmCover.ShowDialog() == DialogResult.OK && !importIntoDatabase)
{
//反写数据源
DataTable ReverseData = frmCover.ReverseData;
//外部数据
DataTable table = GetDataTable();
// 提取 ReverseData 中所有的主键值
HashSet