Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
Kivii.Client.SamplePackages.V4.0
Project
Overview
Details
Activity
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
陶然
Kivii.Client.SamplePackages.V4.0
Commits
5e9e09ea
Commit
5e9e09ea
authored
May 31, 2023
by
陶然
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化
parent
5e08422e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
142 additions
and
64 deletions
+142
-64
Configs.cs
Src/Configs.cs
+1
-0
FrmMain.Designer.cs
Src/FrmMain.Designer.cs
+55
-40
FrmMain.cs
Src/FrmMain.cs
+80
-24
RestfulRequests.cs
Src/Requests/RestfulRequests.cs
+6
-0
No files found.
Src/Configs.cs
View file @
5e9e09ea
...
...
@@ -16,6 +16,7 @@ namespace Kivii.Client.SamplePackages
public
const
string
RouteSamplePrePackaging
=
"/Restful/Kivii.Samples.Entities.Sample/PrePackaging"
;
public
const
string
RouteSamplePackaging
=
"/Restful/Kivii.Samples.Entities.Sample/Packaging"
;
public
const
string
RouteSampleUnPackaging
=
"/Restful/Kivii.Samples.Entities.Sample/UnPackaging"
;
public
const
string
RouteSampleCreate
=
"/Restful/Kivii.Samples.Entities.Sample/Create"
;
}
}
Src/FrmMain.Designer.cs
View file @
5e9e09ea
...
...
@@ -51,6 +51,9 @@
this
.
tbxUserName
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
plToolBar
=
new
System
.
Windows
.
Forms
.
Panel
();
this
.
gbTools
=
new
System
.
Windows
.
Forms
.
GroupBox
();
this
.
lbTips
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
lbScanSample
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
tbScanSample
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
btnClearCurrentPackage
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btnScanRfid
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
cbSetCurrentPackageNode
=
new
System
.
Windows
.
Forms
.
ComboBox
();
...
...
@@ -60,9 +63,6 @@
this
.
plMain
=
new
System
.
Windows
.
Forms
.
Panel
();
this
.
gbMain
=
new
System
.
Windows
.
Forms
.
GroupBox
();
this
.
dgvSamples
=
new
System
.
Windows
.
Forms
.
DataGridView
();
this
.
tbScanSample
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
lbScanSample
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
lbTips
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
SampleAction
=
new
System
.
Windows
.
Forms
.
DataGridViewButtonColumn
();
this
.
SampleBizId
=
new
System
.
Windows
.
Forms
.
DataGridViewTextBoxColumn
();
this
.
SampleOwnerName
=
new
System
.
Windows
.
Forms
.
DataGridViewTextBoxColumn
();
...
...
@@ -71,6 +71,7 @@
this
.
SampleDeadTime
=
new
System
.
Windows
.
Forms
.
DataGridViewTextBoxColumn
();
this
.
SampleQuantityUnit
=
new
System
.
Windows
.
Forms
.
DataGridViewTextBoxColumn
();
this
.
SamplePackageName
=
new
System
.
Windows
.
Forms
.
DataGridViewTextBoxColumn
();
this
.
ckbAutoCreatePackage
=
new
System
.
Windows
.
Forms
.
CheckBox
();
this
.
plLeft
.
SuspendLayout
();
this
.
gbInfo
.
SuspendLayout
();
this
.
gbLogin
.
SuspendLayout
();
...
...
@@ -301,6 +302,7 @@
//
// gbTools
//
this
.
gbTools
.
Controls
.
Add
(
this
.
ckbAutoCreatePackage
);
this
.
gbTools
.
Controls
.
Add
(
this
.
lbTips
);
this
.
gbTools
.
Controls
.
Add
(
this
.
lbScanSample
);
this
.
gbTools
.
Controls
.
Add
(
this
.
tbScanSample
);
...
...
@@ -318,11 +320,42 @@
this
.
gbTools
.
TabStop
=
false
;
this
.
gbTools
.
Text
=
"操作台"
;
//
// lbTips
//
this
.
lbTips
.
AutoSize
=
true
;
this
.
lbTips
.
Font
=
new
System
.
Drawing
.
Font
(
"宋体"
,
10F
);
this
.
lbTips
.
ForeColor
=
System
.
Drawing
.
SystemColors
.
ButtonShadow
;
this
.
lbTips
.
Location
=
new
System
.
Drawing
.
Point
(
529
,
46
);
this
.
lbTips
.
Name
=
"lbTips"
;
this
.
lbTips
.
Size
=
new
System
.
Drawing
.
Size
(
119
,
14
);
this
.
lbTips
.
TabIndex
=
80
;
this
.
lbTips
.
Text
=
"(输入完成报告号)"
;
//
// lbScanSample
//
this
.
lbScanSample
.
AutoSize
=
true
;
this
.
lbScanSample
.
Font
=
new
System
.
Drawing
.
Font
(
"宋体"
,
18F
);
this
.
lbScanSample
.
Location
=
new
System
.
Drawing
.
Point
(
421
,
36
);
this
.
lbScanSample
.
Name
=
"lbScanSample"
;
this
.
lbScanSample
.
Size
=
new
System
.
Drawing
.
Size
(
118
,
24
);
this
.
lbScanSample
.
TabIndex
=
79
;
this
.
lbScanSample
.
Text
=
"手动入箱:"
;
//
// tbScanSample
//
this
.
tbScanSample
.
BackColor
=
System
.
Drawing
.
SystemColors
.
Window
;
this
.
tbScanSample
.
Font
=
new
System
.
Drawing
.
Font
(
"宋体"
,
18F
);
this
.
tbScanSample
.
Location
=
new
System
.
Drawing
.
Point
(
425
,
63
);
this
.
tbScanSample
.
Name
=
"tbScanSample"
;
this
.
tbScanSample
.
Size
=
new
System
.
Drawing
.
Size
(
249
,
35
);
this
.
tbScanSample
.
TabIndex
=
78
;
this
.
tbScanSample
.
KeyDown
+=
new
System
.
Windows
.
Forms
.
KeyEventHandler
(
this
.
tbScanSample_KeyDown
);
//
// btnClearCurrentPackage
//
this
.
btnClearCurrentPackage
.
Location
=
new
System
.
Drawing
.
Point
(
1
30
,
37
);
this
.
btnClearCurrentPackage
.
Location
=
new
System
.
Drawing
.
Point
(
1
21
,
37
);
this
.
btnClearCurrentPackage
.
Name
=
"btnClearCurrentPackage"
;
this
.
btnClearCurrentPackage
.
Size
=
new
System
.
Drawing
.
Size
(
103
,
23
);
this
.
btnClearCurrentPackage
.
Size
=
new
System
.
Drawing
.
Size
(
67
,
23
);
this
.
btnClearCurrentPackage
.
TabIndex
=
77
;
this
.
btnClearCurrentPackage
.
Text
=
"重设"
;
this
.
btnClearCurrentPackage
.
UseVisualStyleBackColor
=
true
;
...
...
@@ -353,9 +386,9 @@
"4号袋"
,
"5号袋"
,
"6号袋"
});
this
.
cbSetCurrentPackageNode
.
Location
=
new
System
.
Drawing
.
Point
(
2
39
,
63
);
this
.
cbSetCurrentPackageNode
.
Location
=
new
System
.
Drawing
.
Point
(
2
76
,
63
);
this
.
cbSetCurrentPackageNode
.
Name
=
"cbSetCurrentPackageNode"
;
this
.
cbSetCurrentPackageNode
.
Size
=
new
System
.
Drawing
.
Size
(
1
80
,
35
);
this
.
cbSetCurrentPackageNode
.
Size
=
new
System
.
Drawing
.
Size
(
1
43
,
35
);
this
.
cbSetCurrentPackageNode
.
TabIndex
=
30
;
this
.
cbSetCurrentPackageNode
.
TextChanged
+=
new
System
.
EventHandler
(
this
.
cbSetCurrentPackageNode_TextChanged
);
//
...
...
@@ -363,7 +396,7 @@
//
this
.
lbSetPackageNode
.
AutoSize
=
true
;
this
.
lbSetPackageNode
.
Font
=
new
System
.
Drawing
.
Font
(
"宋体"
,
18F
);
this
.
lbSetPackageNode
.
Location
=
new
System
.
Drawing
.
Point
(
2
35
,
36
);
this
.
lbSetPackageNode
.
Location
=
new
System
.
Drawing
.
Point
(
2
74
,
36
);
this
.
lbSetPackageNode
.
Name
=
"lbSetPackageNode"
;
this
.
lbSetPackageNode
.
Size
=
new
System
.
Drawing
.
Size
(
118
,
24
);
this
.
lbSetPackageNode
.
TabIndex
=
28
;
...
...
@@ -385,7 +418,7 @@
this
.
tbSetCurrentPackage
.
Font
=
new
System
.
Drawing
.
Font
(
"宋体"
,
18F
);
this
.
tbSetCurrentPackage
.
Location
=
new
System
.
Drawing
.
Point
(
6
,
63
);
this
.
tbSetCurrentPackage
.
Name
=
"tbSetCurrentPackage"
;
this
.
tbSetCurrentPackage
.
Size
=
new
System
.
Drawing
.
Size
(
2
27
,
35
);
this
.
tbSetCurrentPackage
.
Size
=
new
System
.
Drawing
.
Size
(
2
66
,
35
);
this
.
tbSetCurrentPackage
.
TabIndex
=
25
;
this
.
tbSetCurrentPackage
.
KeyDown
+=
new
System
.
Windows
.
Forms
.
KeyEventHandler
(
this
.
tbSetCurrentPackage_KeyDown
);
//
...
...
@@ -433,37 +466,6 @@
this
.
dgvSamples
.
CellContentClick
+=
new
System
.
Windows
.
Forms
.
DataGridViewCellEventHandler
(
this
.
dgvSamples_CellContentClick
);
this
.
dgvSamples
.
RowPostPaint
+=
new
System
.
Windows
.
Forms
.
DataGridViewRowPostPaintEventHandler
(
this
.
dgvSamples_RowPostPaint
);
//
// tbScanSample
//
this
.
tbScanSample
.
BackColor
=
System
.
Drawing
.
SystemColors
.
Window
;
this
.
tbScanSample
.
Font
=
new
System
.
Drawing
.
Font
(
"宋体"
,
18F
);
this
.
tbScanSample
.
Location
=
new
System
.
Drawing
.
Point
(
425
,
63
);
this
.
tbScanSample
.
Name
=
"tbScanSample"
;
this
.
tbScanSample
.
Size
=
new
System
.
Drawing
.
Size
(
249
,
35
);
this
.
tbScanSample
.
TabIndex
=
78
;
this
.
tbScanSample
.
KeyDown
+=
new
System
.
Windows
.
Forms
.
KeyEventHandler
(
this
.
tbScanSample_KeyDown
);
//
// lbScanSample
//
this
.
lbScanSample
.
AutoSize
=
true
;
this
.
lbScanSample
.
Font
=
new
System
.
Drawing
.
Font
(
"宋体"
,
18F
);
this
.
lbScanSample
.
Location
=
new
System
.
Drawing
.
Point
(
421
,
36
);
this
.
lbScanSample
.
Name
=
"lbScanSample"
;
this
.
lbScanSample
.
Size
=
new
System
.
Drawing
.
Size
(
118
,
24
);
this
.
lbScanSample
.
TabIndex
=
79
;
this
.
lbScanSample
.
Text
=
"手动入箱:"
;
//
// lbTips
//
this
.
lbTips
.
AutoSize
=
true
;
this
.
lbTips
.
Font
=
new
System
.
Drawing
.
Font
(
"宋体"
,
10F
);
this
.
lbTips
.
ForeColor
=
System
.
Drawing
.
SystemColors
.
ButtonShadow
;
this
.
lbTips
.
Location
=
new
System
.
Drawing
.
Point
(
529
,
46
);
this
.
lbTips
.
Name
=
"lbTips"
;
this
.
lbTips
.
Size
=
new
System
.
Drawing
.
Size
(
119
,
14
);
this
.
lbTips
.
TabIndex
=
80
;
this
.
lbTips
.
Text
=
"(输入完成报告号)"
;
//
// SampleAction
//
dataGridViewCellStyle1
.
Alignment
=
System
.
Windows
.
Forms
.
DataGridViewContentAlignment
.
MiddleCenter
;
...
...
@@ -540,6 +542,18 @@
this
.
SamplePackageName
.
ReadOnly
=
true
;
this
.
SamplePackageName
.
Width
=
120
;
//
// ckbAutoCreatePackage
//
this
.
ckbAutoCreatePackage
.
AutoSize
=
true
;
this
.
ckbAutoCreatePackage
.
Checked
=
true
;
this
.
ckbAutoCreatePackage
.
CheckState
=
System
.
Windows
.
Forms
.
CheckState
.
Checked
;
this
.
ckbAutoCreatePackage
.
Location
=
new
System
.
Drawing
.
Point
(
196
,
41
);
this
.
ckbAutoCreatePackage
.
Name
=
"ckbAutoCreatePackage"
;
this
.
ckbAutoCreatePackage
.
Size
=
new
System
.
Drawing
.
Size
(
72
,
16
);
this
.
ckbAutoCreatePackage
.
TabIndex
=
81
;
this
.
ckbAutoCreatePackage
.
Text
=
"创建箱号"
;
this
.
ckbAutoCreatePackage
.
UseVisualStyleBackColor
=
true
;
//
// FrmMain
//
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
6F
,
12F
);
...
...
@@ -610,6 +624,7 @@
private
System
.
Windows
.
Forms
.
DataGridViewTextBoxColumn
SampleDeadTime
;
private
System
.
Windows
.
Forms
.
DataGridViewTextBoxColumn
SampleQuantityUnit
;
private
System
.
Windows
.
Forms
.
DataGridViewTextBoxColumn
SamplePackageName
;
private
System
.
Windows
.
Forms
.
CheckBox
ckbAutoCreatePackage
;
}
}
Src/FrmMain.cs
View file @
5e9e09ea
...
...
@@ -321,6 +321,30 @@ namespace Kivii.Client.SamplePackages
MessageBox
.
Show
(
ex
.
GetResponseStatus
().
Message
,
"撤销入箱"
);
}
}
private
void
setCurrentPackage
(
Sample
package
)
{
_currentPackage
=
new
Sample
();
_currentPackage
.
PopulateWith
(
package
);
tbSetCurrentPackage
.
Enabled
=
_currentPackage
==
null
;
tbCurrentPackage
.
Text
=
_currentPackage
.
Name
+
(
_currentPackage
.
PackageName
.
IsNullOrEmpty
()
?
""
:
$"(
{
_currentPackage
.
PackageName
}
)"
);
btnClearCurrentPackage
.
Enabled
=
_currentPackage
!=
null
;
cbSetCurrentPackageNode
.
Enabled
=
_currentPackage
.
Status
==
(
int
)
PackageStatus
.
Empty
||
_currentPackage
.
Status
==
(
int
)
PackageStatus
.
Full
;
btnScanRfid
.
Enabled
=
_currentPackage
.
Status
==
(
int
)
PackageStatus
.
Empty
||
_currentPackage
.
Status
==
(
int
)
PackageStatus
.
Full
;
tbScanSample
.
Enabled
=
_currentPackage
.
Status
==
(
int
)
PackageStatus
.
Empty
||
_currentPackage
.
Status
==
(
int
)
PackageStatus
.
Full
;
tbScanSample
.
Text
=
""
;
if
(
_currentPackage
.
Status
==
(
int
)
PackageStatus
.
Full
||
_currentPackage
.
Status
==
(
int
)
PackageStatus
.
Inbound
)
{
querySampleInPackaged
();
}
if
(
_currentPackage
.
Status
==
(
int
)
PackageStatus
.
Inbound
)
{
MessageBox
.
Show
(
"当前箱子已入库,无法继续操作!"
,
"箱号设置"
);
return
;
}
cbSetCurrentPackageNode
.
SelectedIndex
=
0
;
Thread
.
Sleep
(
200
);
btnScanRfid_Click
(
null
,
null
);
}
private
void
searchPackage
()
{
...
...
@@ -342,32 +366,64 @@ namespace Kivii.Client.SamplePackages
{
if
(
resp
.
Results
.
Count
<=
0
)
{
_currentPackage
=
null
;
MessageBox
.
Show
(
"未找到箱号!"
,
"箱号设置"
);
return
;
if
(!
ckbAutoCreatePackage
.
Checked
)
{
_currentPackage
=
null
;
MessageBox
.
Show
(
"未找到箱号!"
,
"箱号设置"
);
return
;
}
else
{
var
requestCreate
=
new
PackageCreate
();
requestCreate
.
Item
=
new
Sample
();
requestCreate
.
Item
.
Name
=
tbSetCurrentPackage
.
Text
;
requestCreate
.
Item
.
Type
=
SampleType
.
Package
;
requestCreate
.
Item
.
OperateTime
=
DateTime
.
Now
;
var
createTask
=
_client
.
PostAsync
(
requestCreate
);
createTask
.
Success
(
res
=>
{
if
(
res
.
Results
.
Count
<=
0
)
{
_currentPackage
=
null
;
MessageBox
.
Show
(
"创建箱号失败!"
,
"箱号设置"
);
return
;
}
var
createPackage
=
res
.
Results
.
FirstOrDefault
();
setCurrentPackage
(
createPackage
);
return
;
});
createTask
.
Error
(
ex
=>
{
_currentPackage
=
null
;
MessageBox
.
Show
(
"创建箱号失败!"
,
"箱号设置"
);
return
;
});
return
;
}
}
var
package
=
resp
.
Results
.
FirstOrDefault
();
_currentPackage
=
new
Sample
();
_currentPackage
.
PopulateWith
(
package
);
tbSetCurrentPackage
.
Enabled
=
_currentPackage
==
null
;
tbCurrentPackage
.
Text
=
_currentPackage
.
Name
+
(
_currentPackage
.
PackageName
.
IsNullOrEmpty
()
?
""
:
$"(
{
_currentPackage
.
PackageName
}
)"
);
btnClearCurrentPackage
.
Enabled
=
_currentPackage
!=
null
;
cbSetCurrentPackageNode
.
Enabled
=
_currentPackage
.
Status
==
(
int
)
PackageStatus
.
Empty
||
_currentPackage
.
Status
==
(
int
)
PackageStatus
.
Full
;
btnScanRfid
.
Enabled
=
_currentPackage
.
Status
==
(
int
)
PackageStatus
.
Empty
||
_currentPackage
.
Status
==
(
int
)
PackageStatus
.
Full
;
tbScanSample
.
Enabled
=
_currentPackage
.
Status
==
(
int
)
PackageStatus
.
Empty
||
_currentPackage
.
Status
==
(
int
)
PackageStatus
.
Full
;
tbScanSample
.
Text
=
""
;
if
(
_currentPackage
.
Status
==
(
int
)
PackageStatus
.
Full
||
_currentPackage
.
Status
==
(
int
)
PackageStatus
.
Inbound
)
{
querySampleInPackaged
();
}
if
(
_currentPackage
.
Status
==
(
int
)
PackageStatus
.
Inbound
)
{
MessageBox
.
Show
(
"当前箱子已入库,无法继续操作!"
,
"箱号设置"
);
return
;
}
cbSetCurrentPackageNode
.
SelectedIndex
=
0
;
Thread
.
Sleep
(
200
);
btnScanRfid_Click
(
null
,
null
);
setCurrentPackage
(
package
);
//_currentPackage = new Sample();
//_currentPackage.PopulateWith(package);
//tbSetCurrentPackage.Enabled = _currentPackage == null;
//tbCurrentPackage.Text = _currentPackage.Name + (_currentPackage.PackageName.IsNullOrEmpty() ? "" : $"({_currentPackage.PackageName})");
//btnClearCurrentPackage.Enabled = _currentPackage != null;
//cbSetCurrentPackageNode.Enabled = _currentPackage.Status == (int)PackageStatus.Empty || _currentPackage.Status == (int)PackageStatus.Full;
//btnScanRfid.Enabled = _currentPackage.Status == (int)PackageStatus.Empty || _currentPackage.Status == (int)PackageStatus.Full;
//tbScanSample.Enabled = _currentPackage.Status == (int)PackageStatus.Empty || _currentPackage.Status == (int)PackageStatus.Full;
//tbScanSample.Text = "";
//if (_currentPackage.Status == (int)PackageStatus.Full || _currentPackage.Status == (int)PackageStatus.Inbound)
//{
// querySampleInPackaged();
//}
//if (_currentPackage.Status == (int)PackageStatus.Inbound)
//{
// MessageBox.Show("当前箱子已入库,无法继续操作!", "箱号设置");
// return;
//}
//cbSetCurrentPackageNode.SelectedIndex = 0;
//Thread.Sleep(200);
//btnScanRfid_Click(null, null);
});
task
.
Error
(
err
=>
{
...
...
Src/Requests/RestfulRequests.cs
View file @
5e9e09ea
...
...
@@ -50,4 +50,10 @@ namespace Kivii.Samples.Transforms
public
Guid
Kvid
{
get
;
set
;
}
//要流转样品信息
public
Location
Location
{
get
;
set
;
}
//地点位置信息,只需要InternalCode
}
[
Route
(
Configs
.
RouteSampleCreate
)]
public
class
PackageCreate
:
IReturn
<
RestfulCreateResponse
<
Sample
>>
{
public
Sample
Item
{
get
;
set
;
}
}
}
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