SVN r1153

SVN-Revision: r1153
This commit is contained in:
tdx
2026-04-17 06:28:51 +00:00
parent 91d860867b
commit 3f689d58b6
2 changed files with 81 additions and 97 deletions
+45 -10
View File
@@ -100,6 +100,7 @@ namespace Lskj.PubApiSetModule
this.valueDataTypeComboBox = new DevExpress.XtraEditors.Repository.RepositoryItemComboBox();
this.valueEncryptTypeColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.valueEncryptTypeComboBox = new DevExpress.XtraEditors.Repository.RepositoryItemComboBox();
this.encryptKeyColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.flowPanelBottom = new System.Windows.Forms.FlowLayoutPanel();
this.btnPmsSave = new DevExpress.XtraEditors.SimpleButton();
this.btnPmsDelete = new DevExpress.XtraEditors.SimpleButton();
@@ -139,6 +140,8 @@ namespace Lskj.PubApiSetModule
this.btnGetApiPmsDelete = new DevExpress.XtraEditors.SimpleButton();
this.btnGetApiPmsAdd = new DevExpress.XtraEditors.SimpleButton();
this.btnGetApiPmsRefresh = new DevExpress.XtraEditors.SimpleButton();
this.customMsgColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.customMsgMemoExEdit = new DevExpress.XtraEditors.Repository.RepositoryItemMemoExEdit();
((System.ComponentModel.ISupportInitialize)(this.tabMain)).BeginInit();
this.tabMain.SuspendLayout();
this.sendPage.SuspendLayout();
@@ -184,6 +187,7 @@ namespace Lskj.PubApiSetModule
((System.ComponentModel.ISupportInitialize)(this.getPmsDisInsertComboBox)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.getPmsDisUpdateComboBox)).BeginInit();
this.flowLayoutPanel2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.customMsgMemoExEdit)).BeginInit();
this.SuspendLayout();
//
// tabMain
@@ -252,7 +256,8 @@ namespace Lskj.PubApiSetModule
this.allowShowMsgComboBox,
this.eTypeCodeComboBox,
this.disableTagComboBox,
this.finshActionMemoExEdit});
this.finshActionMemoExEdit,
this.customMsgMemoExEdit});
this.sendGcMain.Size = new System.Drawing.Size(915, 203);
this.sendGcMain.TabIndex = 23;
this.sendGcMain.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
@@ -294,7 +299,8 @@ namespace Lskj.PubApiSetModule
this.allowShowMsgColumn,
this.disableTagColumn,
this.isTokenErrorCondColumn,
this.orderValueColumn});
this.orderValueColumn,
this.customMsgColumn});
this.sendMainView.GridControl = this.sendGcMain;
this.sendMainView.IndicatorWidth = 40;
this.sendMainView.Name = "sendMainView";
@@ -526,7 +532,7 @@ namespace Lskj.PubApiSetModule
this.tokenApiIdColumn.FieldName = "tokenApiId";
this.tokenApiIdColumn.Name = "tokenApiIdColumn";
this.tokenApiIdColumn.Visible = true;
this.tokenApiIdColumn.VisibleIndex = 21;
this.tokenApiIdColumn.VisibleIndex = 22;
//
// tokenTypeColumn
//
@@ -575,7 +581,7 @@ namespace Lskj.PubApiSetModule
this.allowShowMsgColumn.FieldName = "allowShowMsg";
this.allowShowMsgColumn.Name = "allowShowMsgColumn";
this.allowShowMsgColumn.Visible = true;
this.allowShowMsgColumn.VisibleIndex = 22;
this.allowShowMsgColumn.VisibleIndex = 23;
//
// allowShowMsgComboBox
//
@@ -591,7 +597,7 @@ namespace Lskj.PubApiSetModule
this.disableTagColumn.FieldName = "disableTag";
this.disableTagColumn.Name = "disableTagColumn";
this.disableTagColumn.Visible = true;
this.disableTagColumn.VisibleIndex = 23;
this.disableTagColumn.VisibleIndex = 24;
//
// disableTagComboBox
//
@@ -720,7 +726,8 @@ namespace Lskj.PubApiSetModule
this.pmsDataSourceColumn,
this.unionPmsIdColumn,
this.valueDataTypeColumn,
this.valueEncryptTypeColumn});
this.valueEncryptTypeColumn,
this.encryptKeyColumn});
this.sendDetailView.GridControl = this.sendGcDetail;
this.sendDetailView.IndicatorWidth = 40;
this.sendDetailView.Name = "sendDetailView";
@@ -820,7 +827,7 @@ namespace Lskj.PubApiSetModule
this.pmsAllowNullColumn.FieldName = "allowNull";
this.pmsAllowNullColumn.Name = "pmsAllowNullColumn";
this.pmsAllowNullColumn.Visible = true;
this.pmsAllowNullColumn.VisibleIndex = 9;
this.pmsAllowNullColumn.VisibleIndex = 10;
//
// allowNullComboBox
//
@@ -836,7 +843,7 @@ namespace Lskj.PubApiSetModule
this.pmsDataSourceColumn.FieldName = "pmsDataSource";
this.pmsDataSourceColumn.Name = "pmsDataSourceColumn";
this.pmsDataSourceColumn.Visible = true;
this.pmsDataSourceColumn.VisibleIndex = 8;
this.pmsDataSourceColumn.VisibleIndex = 9;
this.pmsDataSourceColumn.Width = 100;
//
// pmsDataSourceMemoExEdit
@@ -852,7 +859,7 @@ namespace Lskj.PubApiSetModule
this.unionPmsIdColumn.FieldName = "unionPmsId";
this.unionPmsIdColumn.Name = "unionPmsIdColumn";
this.unionPmsIdColumn.Visible = true;
this.unionPmsIdColumn.VisibleIndex = 10;
this.unionPmsIdColumn.VisibleIndex = 11;
//
// valueDataTypeColumn
//
@@ -886,6 +893,14 @@ namespace Lskj.PubApiSetModule
new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
this.valueEncryptTypeComboBox.Name = "valueEncryptTypeComboBox";
//
// encryptKeyColumn
//
this.encryptKeyColumn.Caption = "值加密密钥";
this.encryptKeyColumn.FieldName = "encryptKey";
this.encryptKeyColumn.Name = "encryptKeyColumn";
this.encryptKeyColumn.Visible = true;
this.encryptKeyColumn.VisibleIndex = 8;
//
// flowPanelBottom
//
this.flowPanelBottom.Controls.Add(this.btnPmsSave);
@@ -1350,6 +1365,22 @@ namespace Lskj.PubApiSetModule
this.btnGetApiPmsRefresh.TabStop = false;
this.btnGetApiPmsRefresh.Text = "刷新(&R)";
//
// customMsgColumn
//
this.customMsgColumn.Caption = "自定义提示";
this.customMsgColumn.ColumnEdit = this.customMsgMemoExEdit;
this.customMsgColumn.FieldName = "customMsg";
this.customMsgColumn.Name = "customMsgColumn";
this.customMsgColumn.Visible = true;
this.customMsgColumn.VisibleIndex = 21;
//
// customMsgMemoExEdit
//
this.customMsgMemoExEdit.AutoHeight = false;
this.customMsgMemoExEdit.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
this.customMsgMemoExEdit.Name = "customMsgMemoExEdit";
//
// FrmMain
//
this.Appearance.BackColor = System.Drawing.SystemColors.Control;
@@ -1406,6 +1437,7 @@ namespace Lskj.PubApiSetModule
((System.ComponentModel.ISupportInitialize)(this.getPmsDisInsertComboBox)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.getPmsDisUpdateComboBox)).EndInit();
this.flowLayoutPanel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.customMsgMemoExEdit)).EndInit();
this.ResumeLayout(false);
}
@@ -1505,4 +1537,7 @@ namespace Lskj.PubApiSetModule
private DevExpress.XtraEditors.Repository.RepositoryItemMemoExEdit getAfterSqlMemoExEdit;
private DevExpress.XtraEditors.Repository.RepositoryItemComboBox getIsLoginComboBox;
public DevExpress.XtraGrid.GridControl getGcDetail;
private DevExpress.XtraGrid.Views.Grid.GridView getDetailView;
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel2;
private DevExpress.XtraEditors.SimpleButton btnGetApiPmsSave;
private DevExpress.XtraEditor
+36 -87
View File
@@ -10,6 +10,7 @@ using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
@@ -21,10 +22,10 @@ namespace Lskj.PubApiSetModule
public partial class FrmMain : BaseForm
{
public DynamicApiSetModel Model;
public object SendMainAdapterObj;
public object SendDetailAdapterObj;
public object GetMainAdapterObj;
public object GetDetailAdapterObj;
public DbDataAdapter SendMainAdapterObj;
public DbDataAdapter SendDetailAdapterObj;
public DbDataAdapter GetMainAdapterObj;
public DbDataAdapter GetDetailAdapterObj;
public FrmMain()
{
InitializeComponent();
@@ -157,14 +158,7 @@ namespace Lskj.PubApiSetModule
{
if (sendGcMain.DataSource != null && sendGcMain.DataSource is DataTable sourceTable)
{
if (SendMainAdapterObj is SqlDataAdapter sqlDataAdapter)
{
sqlDataAdapter.Update(sourceTable);
}
else if (SendMainAdapterObj is KdbndpDataAdapter kdbndpDataAdapter)
{
kdbndpDataAdapter.Update(sourceTable);
}
SendMainAdapterObj.Update(sourceTable);
int rowHandle = sendMainView.FocusedRowHandle;
InitApiTabDataSource();
sendMainView.FocusedRowHandle = rowHandle;
@@ -174,14 +168,7 @@ namespace Lskj.PubApiSetModule
{
if (sendGcDetail.DataSource != null && sendGcDetail.DataSource is DataTable sourceTable)
{
if (SendDetailAdapterObj is SqlDataAdapter sqlDataAdapter)
{
sqlDataAdapter.Update(sourceTable);
}
else if (SendDetailAdapterObj is KdbndpDataAdapter kdbndpDataAdapter)
{
kdbndpDataAdapter.Update(sourceTable);
}
SendDetailAdapterObj.Update(sourceTable);
DataRow focusedRow = sendMainView.GetFocusedDataRow();
string apiId = focusedRow["id"] + "";
int rowHandle = sendDetailView.FocusedRowHandle;
@@ -193,14 +180,7 @@ namespace Lskj.PubApiSetModule
{
if (getGcMain.DataSource != null && getGcMain.DataSource is DataTable sourceTable)
{
if (GetMainAdapterObj is SqlDataAdapter sqlDataAdapter)
{
sqlDataAdapter.Update(sourceTable);
}
else if (GetMainAdapterObj is KdbndpDataAdapter kdbndpDataAdapter)
{
kdbndpDataAdapter.Update(sourceTable);
}
GetMainAdapterObj.Update(sourceTable);
DataRow focusedRow = getMainView.GetFocusedDataRow();
string apiId = focusedRow["id"] + "";
int rowHandle = getMainView.FocusedRowHandle;
@@ -212,14 +192,7 @@ namespace Lskj.PubApiSetModule
{
if (getGcDetail.DataSource != null && getGcDetail.DataSource is DataTable sourceTable)
{
if (GetDetailAdapterObj is SqlDataAdapter sqlDataAdapter)
{
sqlDataAdapter.Update(sourceTable);
}
else if (GetDetailAdapterObj is KdbndpDataAdapter kdbndpDataAdapter)
{
kdbndpDataAdapter.Update(sourceTable);
}
GetDetailAdapterObj.Update(sourceTable);
DataRow focusedRow = getDetailView.GetFocusedDataRow();
string apiId = focusedRow["id"] + "";
int rowHandle = getDetailView.FocusedRowHandle;
@@ -348,16 +321,9 @@ namespace Lskj.PubApiSetModule
//SendMain
SendMainAdapterObj = BaseImpl.GetAdapterResult("select * from p_systemeventapitab");
DataTable sendMainTable = new DataTable();
if (SendMainAdapterObj is SqlDataAdapter sqlDataAdapter)
{
SqlCommandBuilder sqlCommandBuilder = new SqlCommandBuilder(sqlDataAdapter);
sqlDataAdapter.Fill(sendMainTable);
}
else if (SendMainAdapterObj is KdbndpDataAdapter kdbndpDataAdapter)
{
KdbndpCommandBuilder sqlCommandBuilder = new KdbndpCommandBuilder(kdbndpDataAdapter);
kdbndpDataAdapter.Fill(sendMainTable);
}
DbCommandBuilder dbCommandBuilder = SqlHelper.dbFactory.CreateCommandBuilder();
dbCommandBuilder.DataAdapter = SendMainAdapterObj;
SendMainAdapterObj.Fill(sendMainTable);
sendGcMain.DataSource = sendMainTable;
}
/// <summary>
@@ -368,16 +334,9 @@ namespace Lskj.PubApiSetModule
//SendDetail
SendDetailAdapterObj = BaseImpl.GetAdapterResult($"select * from p_systemeventapipmstab where apiid = '{apiId}'");
DataTable sendDetailTable = new DataTable();
if (SendDetailAdapterObj is SqlDataAdapter sqlDataAdapter)
{
SqlCommandBuilder sqlCommandBuilder = new SqlCommandBuilder(sqlDataAdapter);
sqlDataAdapter.Fill(sendDetailTable);
}
else if (SendDetailAdapterObj is KdbndpDataAdapter kdbndpDataAdapter)
{
KdbndpCommandBuilder sqlCommandBuilder = new KdbndpCommandBuilder(kdbndpDataAdapter);
kdbndpDataAdapter.Fill(sendDetailTable);
}
DbCommandBuilder dbCommandBuilder = SqlHelper.dbFactory.CreateCommandBuilder();
dbCommandBuilder.DataAdapter = SendDetailAdapterObj;
SendDetailAdapterObj.Fill(sendDetailTable);
sendGcDetail.DataSource = sendDetailTable;
}
/// <summary>
@@ -388,16 +347,9 @@ namespace Lskj.PubApiSetModule
//SendMain
GetMainAdapterObj = BaseImpl.GetAdapterResult("select * from P_SystemToLsApiTab");
DataTable getMainTable = new DataTable();
if (GetMainAdapterObj is SqlDataAdapter sqlDataAdapter)
{
SqlCommandBuilder sqlCommandBuilder = new SqlCommandBuilder(sqlDataAdapter);
sqlDataAdapter.Fill(getMainTable);
}
else if (SendDetailAdapterObj is KdbndpDataAdapter kdbndpDataAdapter)
{
KdbndpCommandBuilder sqlCommandBuilder = new KdbndpCommandBuilder(kdbndpDataAdapter);
kdbndpDataAdapter.Fill(getMainTable);
}
DbCommandBuilder dbCommandBuilder = SqlHelper.dbFactory.CreateCommandBuilder();
dbCommandBuilder.DataAdapter = GetMainAdapterObj;
GetMainAdapterObj.Fill(getMainTable);
getGcMain.DataSource = getMainTable;
}
/// <summary>
@@ -408,16 +360,9 @@ namespace Lskj.PubApiSetModule
//SendDetail
GetDetailAdapterObj = BaseImpl.GetAdapterResult($"select * from P_SystemToLsApiPmsTab where mainId = '{apiId}'");
DataTable getDetailTable = new DataTable();
if (GetDetailAdapterObj is SqlDataAdapter sqlDataAdapter)
{
SqlCommandBuilder sqlCommandBuilder = new SqlCommandBuilder(sqlDataAdapter);
sqlDataAdapter.Fill(getDetailTable);
}
else if (GetDetailAdapterObj is KdbndpDataAdapter kdbndpDataAdapter)
{
KdbndpCommandBuilder sqlCommandBuilder = new KdbndpCommandBuilder(kdbndpDataAdapter);
kdbndpDataAdapter.Fill(getDetailTable);
}
DbCommandBuilder dbCommandBuilder = SqlHelper.dbFactory.CreateCommandBuilder();
dbCommandBuilder.DataAdapter = GetDetailAdapterObj;
GetDetailAdapterObj.Fill(getDetailTable);
getGcDetail.DataSource = getDetailTable;
}
/// <summary>
@@ -480,6 +425,7 @@ namespace Lskj.PubApiSetModule
valueTypeComboBox.Items.Add(new ComBoxModel() { Value = 0, Text = "json值" });
valueTypeComboBox.Items.Add(new ComBoxModel() { Value = 1, Text = "json对象" });
valueTypeComboBox.Items.Add(new ComBoxModel() { Value = 2, Text = "json数组" });
valueTypeComboBox.Items.Add(new ComBoxModel() { Value = 3, Text = "文件" });
//valueDataType
valueDataTypeComboBox.Items.Add(new ComBoxModel() { Value = 0, Text = "文本" });
valueDataTypeComboBox.Items.Add(new ComBoxModel() { Value = 1, Text = "整数" });
@@ -493,6 +439,7 @@ namespace Lskj.PubApiSetModule
valueEncryptTypeComboBox.Items.Add(new ComBoxModel() { Value = 3, Text = "URL地址加密" });
valueEncryptTypeComboBox.Items.Add(new ComBoxModel() { Value = 4, Text = "URL文件Base64" });
valueEncryptTypeComboBox.Items.Add(new ComBoxModel() { Value = 5, Text = "RSA" });
valueEncryptTypeComboBox.Items.Add(new ComBoxModel() { Value = 103, Text = "道宏发票接口特殊加密" });//道宏发票接口特殊加密
#endregion
#region
getIdColumn.OptionsColumn.AllowEdit = false;
@@ -502,6 +449,7 @@ namespace Lskj.PubApiSetModule
//actionType
getActionTypeComboBox.Items.Add(new ComBoxModel() { Value = 1, Text = "新增/更新" });
getActionTypeComboBox.Items.Add(new ComBoxModel() { Value = 2, Text = "删除" });
getActionTypeComboBox.Items.Add(new ComBoxModel() { Value = 3, Text = "自定义" });
#endregion
#region
getPmsDisInsertComboBox.Items.Add(new ComBoxModel() { Value = 1, Text = "禁止插入" });
@@ -607,6 +555,7 @@ namespace Lskj.PubApiSetModule
colDic.Add("ContentType", "varchar(200)");
colDic.Add("eTypeCode", "int");
colDic.Add("disableTag", "int");
colDic.Add("customMsg", "varchar(500)");
string isExitApiTab = "select top 1 * from sysObjects where Id=OBJECT_ID(N'p_systemEventApiTab') and xtype='U'";
DataTable apiTab = SqlHelper.ExecuteDataTable(isExitApiTab);
if (apiTab.Rows.Count > 0)//存在日志表
@@ -624,7 +573,7 @@ namespace Lskj.PubApiSetModule
}
else
{
string createTabSql = "create table p_systemEventApiTab(id bigint IDENTITY(1,1) NOT NULL,{0})";
string createTabSql = "create table p_systemEventApiTab(id bigint IDENTITY(1,1) PRIMARY KEY NOT NULL,{0})";
string createCol = string.Empty;
foreach (KeyValuePair<string, string> colunmField in colDic)
{
@@ -677,7 +626,7 @@ namespace Lskj.PubApiSetModule
}
else
{
string createTabSql = "create table P_systemEventApiPmsTab(id bigint IDENTITY(1,1) NOT NULL,{0})";
string createTabSql = "create table P_systemEventApiPmsTab(id bigint IDENTITY(1,1) PRIMARY KEY NOT NULL,{0})";
string createCol = string.Empty;
foreach (KeyValuePair<string, string> colunmField in colDic)
{
@@ -703,8 +652,8 @@ namespace Lskj.PubApiSetModule
Dictionary<string, string> colDic = new Dictionary<string, string>();
colDic.Add("tableName", "varchar(100)");
colDic.Add("actionType", "int");
colDic.Add("primaryKey", "varchar(100)");
colDic.Add("outputKey", "varchar(100)");
colDic.Add("primaryKey", "varchar(200)");
colDic.Add("outputKey", "varchar(1000)");
colDic.Add("afterSql", "varchar(MAX)");
colDic.Add("isLogin", "int");
colDic.Add("description", "varchar(50)");
@@ -725,7 +674,7 @@ namespace Lskj.PubApiSetModule
}
else
{
string createTabSql = "create table P_SystemToLsApiTab(id bigint IDENTITY(1,1) NOT NULL,{0})";
string createTabSql = "create table P_SystemToLsApiTab(id bigint IDENTITY(1,1) PRIMARY KEY NOT NULL,{0})";
string createCol = string.Empty;
foreach (KeyValuePair<string, string> colunmField in colDic)
{
@@ -773,7 +722,7 @@ namespace Lskj.PubApiSetModule
}
else
{
string createTabSql = "create table P_SystemToLsApiPmsTab(id bigint IDENTITY(1,1) NOT NULL,{0})";
string createTabSql = "create table P_SystemToLsApiPmsTab(id bigint IDENTITY(1,1) PRIMARY KEY NOT NULL,{0})";
string createCol = string.Empty;
foreach (KeyValuePair<string, string> colunmField in colDic)
{
@@ -821,7 +770,7 @@ namespace Lskj.PubApiSetModule
}
else
{
string createTabSql = "create table P_SystemToLsApiDtlsTab(id bigint IDENTITY(1,1) NOT NULL,{0})";
string createTabSql = "create table P_SystemToLsApiDtlsTab(id bigint IDENTITY(1,1) PRIMARY KEY NOT NULL,{0})";
string createCol = string.Empty;
foreach (KeyValuePair<string, string> colunmField in colDic)
{
@@ -865,7 +814,7 @@ namespace Lskj.PubApiSetModule
}
else
{
string createTabSql = "create table P_SystemToLsApiDtlsPmsTab(id bigint IDENTITY(1,1) NOT NULL,{0})";
string createTabSql = "create table P_SystemToLsApiDtlsPmsTab(id bigint IDENTITY(1,1) PRIMARY KEY NOT NULL,{0})";
string createCol = string.Empty;
foreach (KeyValuePair<string, string> colunmField in colDic)
{
@@ -920,7 +869,7 @@ namespace Lskj.PubApiSetModule
}
else
{
string createTabSql = "create table p_systemEventApiLogTab(id bigint IDENTITY(1,1) NOT NULL,{0})";
string createTabSql = "create table p_systemEventApiLogTab(id bigint IDENTITY(1,1) PRIMARY KEY NOT NULL,{0})";
string createCol = string.Empty;
foreach (KeyValuePair<string, string> colunmField in colDic)
{
@@ -968,7 +917,7 @@ namespace Lskj.PubApiSetModule
}
else
{
string createTabSql = "create table p_systemEventApiErrorLogTab(id bigint IDENTITY(1,1) NOT NULL,{0})";
string createTabSql = "create table p_systemEventApiErrorLogTab(id bigint IDENTITY(1,1) PRIMARY KEY NOT NULL,{0})";
string createCol = string.Empty;
foreach (KeyValuePair<string, string> colunmField in colDic)
{
@@ -1018,7 +967,7 @@ namespace Lskj.PubApiSetModule
}
else
{
string createTabSql = "create table P_SystemToLsApiLogTab(id bigint IDENTITY(1,1) NOT NULL,{0})";
string createTabSql = "create table P_SystemToLsApiLogTab(id bigint IDENTITY(1,1) PRIMARY KEY NOT NULL,{0})";
string createCol = string.Empty;
foreach (KeyValuePair<string, string> colunmField in colDic)
{