Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
Ftt_Common
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Ftt_Common
Commits
9beec34f
Commit
9beec34f
authored
Feb 28, 2025
by
罗显健
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.打包工具增加周期选择,2.表开发工具:列兼容系统关键字。
parent
7cf335ea
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
110 additions
and
34 deletions
+110
-34
FrmMain.Designer.cs
Ftt.PatchPack/FrmMain.Designer.cs
+30
-18
FrmMain.cs
Ftt.PatchPack/FrmMain.cs
+32
-5
Project.cs
Ftt.PatchPack/Project.cs
+47
-10
Utils.cs
Tools/MyUtils/Utils.cs
+1
-1
No files found.
Ftt.PatchPack/FrmMain.Designer.cs
View file @
9beec34f
...
...
@@ -35,6 +35,7 @@
this
.
lstProject
=
new
System
.
Windows
.
Forms
.
ListView
();
this
.
lblNotes
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
pnlTop
=
new
System
.
Windows
.
Forms
.
Panel
();
this
.
ckbMergeSql
=
new
System
.
Windows
.
Forms
.
CheckBox
();
this
.
ckbShowLog
=
new
System
.
Windows
.
Forms
.
CheckBox
();
this
.
ckbDelHisPack
=
new
System
.
Windows
.
Forms
.
CheckBox
();
this
.
btnOpenDirectory
=
new
System
.
Windows
.
Forms
.
Button
();
...
...
@@ -42,7 +43,7 @@
this
.
pnlLeft
=
new
System
.
Windows
.
Forms
.
Panel
();
this
.
gpbLog
=
new
System
.
Windows
.
Forms
.
GroupBox
();
this
.
txtLog
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
c
kbMergeSql
=
new
System
.
Windows
.
Forms
.
Check
Box
();
this
.
c
mbPeriod
=
new
System
.
Windows
.
Forms
.
Combo
Box
();
this
.
pnlTop
.
SuspendLayout
();
this
.
pnlLeft
.
SuspendLayout
();
this
.
gpbLog
.
SuspendLayout
();
...
...
@@ -100,7 +101,7 @@
this
.
lstProject
.
RightToLeft
=
System
.
Windows
.
Forms
.
RightToLeft
.
No
;
this
.
lstProject
.
RightToLeftLayout
=
true
;
this
.
lstProject
.
ShowGroups
=
false
;
this
.
lstProject
.
Size
=
new
System
.
Drawing
.
Size
(
672
,
231
);
this
.
lstProject
.
Size
=
new
System
.
Drawing
.
Size
(
1024
,
231
);
this
.
lstProject
.
TabIndex
=
10
;
this
.
lstProject
.
UseCompatibleStateImageBehavior
=
false
;
this
.
lstProject
.
View
=
System
.
Windows
.
Forms
.
View
.
List
;
...
...
@@ -112,12 +113,13 @@
this
.
lblNotes
.
Location
=
new
System
.
Drawing
.
Point
(
0
,
289
);
this
.
lblNotes
.
Name
=
"lblNotes"
;
this
.
lblNotes
.
Padding
=
new
System
.
Windows
.
Forms
.
Padding
(
12
,
8
,
0
,
0
);
this
.
lblNotes
.
Size
=
new
System
.
Drawing
.
Size
(
672
,
52
);
this
.
lblNotes
.
Size
=
new
System
.
Drawing
.
Size
(
1024
,
52
);
this
.
lblNotes
.
TabIndex
=
11
;
this
.
lblNotes
.
Text
=
"注意:本工具只打包项目设定文件夹内通用文件。。。。。详细内容见源代码"
;
//
// pnlTop
//
this
.
pnlTop
.
Controls
.
Add
(
this
.
cmbPeriod
);
this
.
pnlTop
.
Controls
.
Add
(
this
.
ckbMergeSql
);
this
.
pnlTop
.
Controls
.
Add
(
this
.
ckbShowLog
);
this
.
pnlTop
.
Controls
.
Add
(
this
.
ckbDelHisPack
);
...
...
@@ -130,9 +132,21 @@
this
.
pnlTop
.
Location
=
new
System
.
Drawing
.
Point
(
0
,
0
);
this
.
pnlTop
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
3
,
4
,
3
,
4
);
this
.
pnlTop
.
Name
=
"pnlTop"
;
this
.
pnlTop
.
Size
=
new
System
.
Drawing
.
Size
(
672
,
58
);
this
.
pnlTop
.
Size
=
new
System
.
Drawing
.
Size
(
1024
,
58
);
this
.
pnlTop
.
TabIndex
=
12
;
//
// ckbMergeSql
//
this
.
ckbMergeSql
.
AutoSize
=
true
;
this
.
ckbMergeSql
.
BackColor
=
System
.
Drawing
.
SystemColors
.
Control
;
this
.
ckbMergeSql
.
ForeColor
=
System
.
Drawing
.
Color
.
Blue
;
this
.
ckbMergeSql
.
Location
=
new
System
.
Drawing
.
Point
(
573
,
33
);
this
.
ckbMergeSql
.
Name
=
"ckbMergeSql"
;
this
.
ckbMergeSql
.
Size
=
new
System
.
Drawing
.
Size
(
93
,
21
);
this
.
ckbMergeSql
.
TabIndex
=
14
;
this
.
ckbMergeSql
.
Text
=
"合并Sql脚本"
;
this
.
ckbMergeSql
.
UseVisualStyleBackColor
=
false
;
//
// ckbShowLog
//
this
.
ckbShowLog
.
AutoSize
=
true
;
...
...
@@ -164,7 +178,7 @@
//
this
.
btnOpenDirectory
.
BackColor
=
System
.
Drawing
.
SystemColors
.
Control
;
this
.
btnOpenDirectory
.
ForeColor
=
System
.
Drawing
.
SystemColors
.
WindowText
;
this
.
btnOpenDirectory
.
Location
=
new
System
.
Drawing
.
Point
(
486
,
3
);
this
.
btnOpenDirectory
.
Location
=
new
System
.
Drawing
.
Point
(
486
,
4
);
this
.
btnOpenDirectory
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
3
,
4
,
3
,
4
);
this
.
btnOpenDirectory
.
Name
=
"btnOpenDirectory"
;
this
.
btnOpenDirectory
.
Size
=
new
System
.
Drawing
.
Size
(
81
,
27
);
...
...
@@ -194,7 +208,7 @@
this
.
pnlLeft
.
Dock
=
System
.
Windows
.
Forms
.
DockStyle
.
Fill
;
this
.
pnlLeft
.
Location
=
new
System
.
Drawing
.
Point
(
0
,
0
);
this
.
pnlLeft
.
Name
=
"pnlLeft"
;
this
.
pnlLeft
.
Size
=
new
System
.
Drawing
.
Size
(
672
,
341
);
this
.
pnlLeft
.
Size
=
new
System
.
Drawing
.
Size
(
1024
,
341
);
this
.
pnlLeft
.
TabIndex
=
13
;
//
// gpbLog
...
...
@@ -217,25 +231,22 @@
this
.
txtLog
.
Size
=
new
System
.
Drawing
.
Size
(
346
,
319
);
this
.
txtLog
.
TabIndex
=
0
;
//
// c
kbMergeSql
// c
mbPeriod
//
this
.
ckbMergeSql
.
AutoSize
=
true
;
this
.
ckbMergeSql
.
BackColor
=
System
.
Drawing
.
SystemColors
.
Control
;
this
.
ckbMergeSql
.
ForeColor
=
System
.
Drawing
.
Color
.
Blue
;
this
.
ckbMergeSql
.
Location
=
new
System
.
Drawing
.
Point
(
573
,
33
);
this
.
ckbMergeSql
.
Name
=
"ckbMergeSql"
;
this
.
ckbMergeSql
.
Size
=
new
System
.
Drawing
.
Size
(
93
,
21
);
this
.
ckbMergeSql
.
TabIndex
=
14
;
this
.
ckbMergeSql
.
Text
=
"合并Sql脚本"
;
this
.
ckbMergeSql
.
UseVisualStyleBackColor
=
false
;
this
.
cmbPeriod
.
DropDownStyle
=
System
.
Windows
.
Forms
.
ComboBoxStyle
.
DropDownList
;
this
.
cmbPeriod
.
FormattingEnabled
=
true
;
this
.
cmbPeriod
.
Location
=
new
System
.
Drawing
.
Point
(
573
,
4
);
this
.
cmbPeriod
.
Name
=
"cmbPeriod"
;
this
.
cmbPeriod
.
Size
=
new
System
.
Drawing
.
Size
(
90
,
25
);
this
.
cmbPeriod
.
TabIndex
=
15
;
//
// FrmMain
//
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
7F
,
17F
);
this
.
AutoScaleMode
=
System
.
Windows
.
Forms
.
AutoScaleMode
.
Font
;
this
.
ClientSize
=
new
System
.
Drawing
.
Size
(
1024
,
341
);
this
.
Controls
.
Add
(
this
.
pnlLeft
);
this
.
Controls
.
Add
(
this
.
gpbLog
);
this
.
Controls
.
Add
(
this
.
pnlLeft
);
this
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
FormBorderStyle
=
System
.
Windows
.
Forms
.
FormBorderStyle
.
FixedSingle
;
this
.
Icon
=
((
System
.
Drawing
.
Icon
)(
resources
.
GetObject
(
"$this.Icon"
)));
...
...
@@ -268,8 +279,9 @@
private
System
.
Windows
.
Forms
.
Panel
pnlLeft
;
private
System
.
Windows
.
Forms
.
CheckBox
ckbShowLog
;
private
System
.
Windows
.
Forms
.
GroupBox
gpbLog
;
private
System
.
Windows
.
Forms
.
TextBox
txtLog
;
private
System
.
Windows
.
Forms
.
CheckBox
ckbMergeSql
;
private
System
.
Windows
.
Forms
.
ComboBox
cmbPeriod
;
private
System
.
Windows
.
Forms
.
TextBox
txtLog
;
}
}
Ftt.PatchPack/FrmMain.cs
View file @
9beec34f
...
...
@@ -30,13 +30,11 @@ namespace Ftt.PatchPack
new
ToolTip
().
SetToolTip
(
ckbMergeSql
,
"合并未使用Use XX指令的脚本,Use指令的脚本文件独立存在并间隔合并操作。"
);
}
private
void
FrmMain_Load
(
object
sender
,
EventArgs
e
)
{
InitForm
();
}
}
private
void
InitForm
()
{
LogVisible
(
false
);
...
...
@@ -47,9 +45,39 @@ namespace Ftt.PatchPack
{
lstProject
.
Items
.
Add
(
cli
.
Key
);
}
InitCmbPeriod
();
}
#
region
打包周期
/// <summary>
/// 初始化打包周期
/// </summary>
private
void
InitCmbPeriod
()
{
Dictionary
<
int
,
string
>
dic
=
new
Dictionary
<
int
,
string
>
{
{
0
,
"默认"
},
{
30
,
"30天"
},
{
45
,
"45天"
},
{
60
,
"2个月"
},
{
90
,
"3个月"
}
};
cmbPeriod
.
DataSource
=
new
BindingSource
(
dic
,
null
);
cmbPeriod
.
DisplayMember
=
"Value"
;
cmbPeriod
.
ValueMember
=
"Key"
;
cmbPeriod
.
SelectedValueChanged
+=
CmbPeriod_SelectedValueChanged
;
}
/// <summary>
/// 选择打包周期
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private
void
CmbPeriod_SelectedValueChanged
(
object
sender
,
EventArgs
e
)
{
Project
.
SetPatchTime
((
int
)
cmbPeriod
.
SelectedValue
);
}
#
endregion
#
region
按钮操作
...
...
@@ -192,7 +220,6 @@ namespace Ftt.PatchPack
#
endregion
#
region
内部方法
private
void
LogVisible
(
bool
visible
)
...
...
Ftt.PatchPack/Project.cs
View file @
9beec34f
...
...
@@ -90,9 +90,9 @@ namespace Ftt.PatchPack
//添加默认配置
config
.
AppSettings
.
Settings
.
Add
(
"ExceptFiles"
,
""
);
config
.
AppSettings
.
Settings
.
Add
(
"ContainFiles"
,
""
);
config
.
AppSettings
.
Settings
.
Add
(
"PatchTimeFrame_Dll"
,
"48"
);
config
.
AppSettings
.
Settings
.
Add
(
"PatchTimeFrame_Sql"
,
"720"
);
config
.
AppSettings
.
Settings
.
Add
(
"PatchTimeFrame_Xml"
,
"720"
);
config
.
AppSettings
.
Settings
.
Add
(
"PatchTimeFrame_Dll"
,
PatchTimeFrame_Dll
.
ToString
()
);
config
.
AppSettings
.
Settings
.
Add
(
"PatchTimeFrame_Sql"
,
PatchTimeFrame_Sql
.
ToString
()
);
config
.
AppSettings
.
Settings
.
Add
(
"PatchTimeFrame_Xml"
,
PatchTimeFrame_Xml
.
ToString
()
);
config
.
AppSettings
.
Settings
.
Add
(
"Exclude_PDB"
,
"1"
);
//保存配置文件
config
.
Save
(
ConfigurationSaveMode
.
Modified
);
...
...
@@ -114,9 +114,7 @@ namespace Ftt.PatchPack
foreach
(
var
file
in
files
)
if
(!
ContainFiles
.
Contains
(
file
))
ContainFiles
.
Add
(
file
);
}
Int32
.
TryParse
(
ConfigurationManager
.
AppSettings
[
"PatchTimeFrame_Dll"
],
out
PatchTimeFrame_Dll
);
Int32
.
TryParse
(
ConfigurationManager
.
AppSettings
[
"PatchTimeFrame_Sql"
],
out
PatchTimeFrame_Sql
);
Int32
.
TryParse
(
ConfigurationManager
.
AppSettings
[
"PatchTimeFrame_Xml"
],
out
PatchTimeFrame_Xml
);
SetPatchTime
();
Int32
.
TryParse
(
ConfigurationManager
.
AppSettings
[
"Exclude_PDB"
],
out
int
_exclude_PDB
);
//是否包含pdb文件
if
(
_exclude_PDB
==
1
)
Exclude_PDB
=
true
;
}
...
...
@@ -217,6 +215,49 @@ namespace Ftt.PatchPack
return
MergeSqlFile
?
MergeSql
(
valid
)
:
valid
;
}
/// <summary>
/// 设置打包时间
/// </summary>
/// <param name="dayDll">Dll文件打包周期,单位:天</param>
/// <param name="daySql">Sql文件打包周期,单位:天</param>
/// <param name="dayXml">Xml文件打包周期,单位:天</param>
public
static
void
SetPatchTime
(
int
dayDll
,
int
daySql
,
int
dayXml
)
{
if
(
dayDll
<=
0
||
daySql
<=
0
||
dayXml
<=
0
)
{
SetPatchTime
();
}
else
{
PatchTimeFrame_Xml
=
24
*
dayXml
;
PatchTimeFrame_Sql
=
24
*
daySql
;
PatchTimeFrame_Dll
=
24
*
dayDll
;
}
}
/// <summary>
/// 设置打包时间
/// </summary>
/// <param name="day">文件打包周期,单位:天</param>
public
static
void
SetPatchTime
(
int
day
)
{
SetPatchTime
(
day
,
day
,
day
);
}
/// <summary>
/// 设置打包时间,默认从配置文件读取
/// </summary>
public
static
void
SetPatchTime
()
{
Int32
.
TryParse
(
ConfigurationManager
.
AppSettings
[
"PatchTimeFrame_Dll"
],
out
PatchTimeFrame_Dll
);
Int32
.
TryParse
(
ConfigurationManager
.
AppSettings
[
"PatchTimeFrame_Sql"
],
out
PatchTimeFrame_Sql
);
Int32
.
TryParse
(
ConfigurationManager
.
AppSettings
[
"PatchTimeFrame_Xml"
],
out
PatchTimeFrame_Xml
);
}
#
endregion
#
region
私有方法
/// <summary>
/// 获取据库脚本补丁,返回有效的文件夹,一个月以内
/// </summary>
...
...
@@ -292,10 +333,6 @@ namespace Ftt.PatchPack
return
mergeSqlFiles
;
}
#
endregion
#
region
私有方法
/// <summary>
/// 获取有效的打包文件列表
/// </summary>
...
...
Tools/MyUtils/Utils.cs
View file @
9beec34f
...
...
@@ -932,7 +932,7 @@ namespace Tools.MyUtils
//列名与类型
var
FieldName
=
r
[
"FieldName"
].
ToString
();
var
ColumnType
=
r
[
"ColumnType"
].
ToString
();
columninfo
=
$"
{
FieldName
}
{
ColumnType
}
"
;
columninfo
=
$"
[
{
FieldName
}
]
{
ColumnType
}
"
;
//兼容列名中包含系统关键字的情况 2025-02-28 11:06:53 lxj
//是否为空
var
IsNotNull
=
r
[
"IsNotNull"
]
==
DBNull
.
Value
?
false
:
(
bool
)
r
[
"IsNotNull"
];
columninfo
+=
IsNotNull
?
" NOT NULL"
:
" NULL"
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment