Commit a0616726 by 陶然

优化

parent 195dfe53
...@@ -13,6 +13,9 @@ namespace Kivii.Client.SamplePackages ...@@ -13,6 +13,9 @@ namespace Kivii.Client.SamplePackages
public const string RouteLocationQuery = "/Restful/Kivii.Samples.Entities.Location/Query"; public const string RouteLocationQuery = "/Restful/Kivii.Samples.Entities.Location/Query";
public const string RouteSampleQuery = "/Restful/Kivii.Samples.Entities.Sample/Query"; public const string RouteSampleQuery = "/Restful/Kivii.Samples.Entities.Sample/Query";
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";
} }
} }
...@@ -51,15 +51,15 @@ ...@@ -51,15 +51,15 @@
this.tbxUserName = new System.Windows.Forms.TextBox(); this.tbxUserName = new System.Windows.Forms.TextBox();
this.plToolBar = new System.Windows.Forms.Panel(); this.plToolBar = new System.Windows.Forms.Panel();
this.gbTools = new System.Windows.Forms.GroupBox(); this.gbTools = new System.Windows.Forms.GroupBox();
this.btnClearCurrentPackage = new System.Windows.Forms.Button();
this.btnScanRfid = new System.Windows.Forms.Button();
this.cbSetCurrentPackageNode = new System.Windows.Forms.ComboBox();
this.lbSetPackageNode = new System.Windows.Forms.Label();
this.lbSetPackage = new System.Windows.Forms.Label(); this.lbSetPackage = new System.Windows.Forms.Label();
this.tbSetCurrentPackage = new System.Windows.Forms.TextBox(); this.tbSetCurrentPackage = new System.Windows.Forms.TextBox();
this.plMain = new System.Windows.Forms.Panel(); this.plMain = new System.Windows.Forms.Panel();
this.gbMain = new System.Windows.Forms.GroupBox(); this.gbMain = new System.Windows.Forms.GroupBox();
this.lbSetPackageNode = new System.Windows.Forms.Label();
this.cbSetCurrentPackageNode = new System.Windows.Forms.ComboBox();
this.btnScanRfid = new System.Windows.Forms.Button();
this.dgvSamples = new System.Windows.Forms.DataGridView(); this.dgvSamples = new System.Windows.Forms.DataGridView();
this.btnClearCurrentPackage = new System.Windows.Forms.Button();
this.SampleAction = new System.Windows.Forms.DataGridViewButtonColumn(); this.SampleAction = new System.Windows.Forms.DataGridViewButtonColumn();
this.SampleBizId = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.SampleBizId = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.SampleOwnerName = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.SampleOwnerName = new System.Windows.Forms.DataGridViewTextBoxColumn();
...@@ -312,6 +312,57 @@ ...@@ -312,6 +312,57 @@
this.gbTools.TabStop = false; this.gbTools.TabStop = false;
this.gbTools.Text = "操作台"; this.gbTools.Text = "操作台";
// //
// btnClearCurrentPackage
//
this.btnClearCurrentPackage.Location = new System.Drawing.Point(130, 37);
this.btnClearCurrentPackage.Name = "btnClearCurrentPackage";
this.btnClearCurrentPackage.Size = new System.Drawing.Size(103, 23);
this.btnClearCurrentPackage.TabIndex = 77;
this.btnClearCurrentPackage.Text = "重设";
this.btnClearCurrentPackage.UseVisualStyleBackColor = true;
this.btnClearCurrentPackage.Click += new System.EventHandler(this.btnClearCurrentPackage_Click);
//
// btnScanRfid
//
this.btnScanRfid.BackColor = System.Drawing.Color.PapayaWhip;
this.btnScanRfid.Dock = System.Windows.Forms.DockStyle.Right;
this.btnScanRfid.Font = new System.Drawing.Font("宋体", 25F, System.Drawing.FontStyle.Bold);
this.btnScanRfid.ForeColor = System.Drawing.Color.Chocolate;
this.btnScanRfid.Location = new System.Drawing.Point(664, 17);
this.btnScanRfid.Name = "btnScanRfid";
this.btnScanRfid.Size = new System.Drawing.Size(126, 105);
this.btnScanRfid.TabIndex = 76;
this.btnScanRfid.Text = "开始扫描";
this.btnScanRfid.UseVisualStyleBackColor = false;
this.btnScanRfid.Click += new System.EventHandler(this.btnScanRfid_Click);
//
// cbSetCurrentPackageNode
//
this.cbSetCurrentPackageNode.Font = new System.Drawing.Font("宋体", 20F);
this.cbSetCurrentPackageNode.FormattingEnabled = true;
this.cbSetCurrentPackageNode.Items.AddRange(new object[] {
"1号袋",
"2号袋",
"3号袋",
"4号袋",
"5号袋",
"6号袋"});
this.cbSetCurrentPackageNode.Location = new System.Drawing.Point(239, 63);
this.cbSetCurrentPackageNode.Name = "cbSetCurrentPackageNode";
this.cbSetCurrentPackageNode.Size = new System.Drawing.Size(180, 35);
this.cbSetCurrentPackageNode.TabIndex = 30;
this.cbSetCurrentPackageNode.TextChanged += new System.EventHandler(this.cbSetCurrentPackageNode_TextChanged);
//
// lbSetPackageNode
//
this.lbSetPackageNode.AutoSize = true;
this.lbSetPackageNode.Font = new System.Drawing.Font("宋体", 18F);
this.lbSetPackageNode.Location = new System.Drawing.Point(235, 36);
this.lbSetPackageNode.Name = "lbSetPackageNode";
this.lbSetPackageNode.Size = new System.Drawing.Size(118, 24);
this.lbSetPackageNode.TabIndex = 28;
this.lbSetPackageNode.Text = "袋子选择:";
//
// lbSetPackage // lbSetPackage
// //
this.lbSetPackage.AutoSize = true; this.lbSetPackage.AutoSize = true;
...@@ -352,46 +403,6 @@ ...@@ -352,46 +403,6 @@
this.gbMain.TabStop = false; this.gbMain.TabStop = false;
this.gbMain.Text = "入箱列表"; this.gbMain.Text = "入箱列表";
// //
// lbSetPackageNode
//
this.lbSetPackageNode.AutoSize = true;
this.lbSetPackageNode.Font = new System.Drawing.Font("宋体", 18F);
this.lbSetPackageNode.Location = new System.Drawing.Point(235, 36);
this.lbSetPackageNode.Name = "lbSetPackageNode";
this.lbSetPackageNode.Size = new System.Drawing.Size(118, 24);
this.lbSetPackageNode.TabIndex = 28;
this.lbSetPackageNode.Text = "袋子选择:";
//
// cbSetCurrentPackageNode
//
this.cbSetCurrentPackageNode.Font = new System.Drawing.Font("宋体", 20F);
this.cbSetCurrentPackageNode.FormattingEnabled = true;
this.cbSetCurrentPackageNode.Items.AddRange(new object[] {
"1号袋",
"2号袋",
"3号袋",
"4号袋",
"5号袋",
"6号袋"});
this.cbSetCurrentPackageNode.Location = new System.Drawing.Point(239, 63);
this.cbSetCurrentPackageNode.Name = "cbSetCurrentPackageNode";
this.cbSetCurrentPackageNode.Size = new System.Drawing.Size(180, 35);
this.cbSetCurrentPackageNode.TabIndex = 30;
this.cbSetCurrentPackageNode.TextChanged += new System.EventHandler(this.cbSetCurrentPackageNode_TextChanged);
//
// btnScanRfid
//
this.btnScanRfid.BackColor = System.Drawing.Color.PapayaWhip;
this.btnScanRfid.Dock = System.Windows.Forms.DockStyle.Right;
this.btnScanRfid.Font = new System.Drawing.Font("宋体", 25F, System.Drawing.FontStyle.Bold);
this.btnScanRfid.ForeColor = System.Drawing.Color.Chocolate;
this.btnScanRfid.Location = new System.Drawing.Point(664, 17);
this.btnScanRfid.Name = "btnScanRfid";
this.btnScanRfid.Size = new System.Drawing.Size(126, 105);
this.btnScanRfid.TabIndex = 76;
this.btnScanRfid.Text = "开始扫描";
this.btnScanRfid.UseVisualStyleBackColor = false;
//
// dgvSamples // dgvSamples
// //
this.dgvSamples.AllowUserToAddRows = false; this.dgvSamples.AllowUserToAddRows = false;
...@@ -413,18 +424,9 @@ ...@@ -413,18 +424,9 @@
this.dgvSamples.RowTemplate.Height = 23; this.dgvSamples.RowTemplate.Height = 23;
this.dgvSamples.Size = new System.Drawing.Size(787, 449); this.dgvSamples.Size = new System.Drawing.Size(787, 449);
this.dgvSamples.TabIndex = 0; this.dgvSamples.TabIndex = 0;
this.dgvSamples.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvSamples_CellContentClick);
this.dgvSamples.RowPostPaint += new System.Windows.Forms.DataGridViewRowPostPaintEventHandler(this.dgvSamples_RowPostPaint); this.dgvSamples.RowPostPaint += new System.Windows.Forms.DataGridViewRowPostPaintEventHandler(this.dgvSamples_RowPostPaint);
// //
// btnClearCurrentPackage
//
this.btnClearCurrentPackage.Location = new System.Drawing.Point(130, 37);
this.btnClearCurrentPackage.Name = "btnClearCurrentPackage";
this.btnClearCurrentPackage.Size = new System.Drawing.Size(103, 23);
this.btnClearCurrentPackage.TabIndex = 77;
this.btnClearCurrentPackage.Text = "重设";
this.btnClearCurrentPackage.UseVisualStyleBackColor = true;
this.btnClearCurrentPackage.Click += new System.EventHandler(this.btnClearCurrentPackage_Click);
//
// SampleAction // SampleAction
// //
dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
...@@ -459,13 +461,12 @@ ...@@ -459,13 +461,12 @@
// //
// SampleName // SampleName
// //
this.SampleName.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None; this.SampleName.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.SampleName.DataPropertyName = "Name"; this.SampleName.DataPropertyName = "Name";
this.SampleName.HeaderText = "样品名称"; this.SampleName.HeaderText = "样品名称";
this.SampleName.MinimumWidth = 120; this.SampleName.MinimumWidth = 120;
this.SampleName.Name = "SampleName"; this.SampleName.Name = "SampleName";
this.SampleName.ReadOnly = true; this.SampleName.ReadOnly = true;
this.SampleName.Width = 120;
// //
// SampleDealTime // SampleDealTime
// //
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<Deterministic>true</Deterministic> <Deterministic>true</Deterministic>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType> <DebugType>full</DebugType>
<Optimize>false</Optimize> <Optimize>false</Optimize>
...@@ -44,6 +44,9 @@ ...@@ -44,6 +44,9 @@
<Reference Include="Kivii.Linq.V4.0, Version=5.6.2023.4200, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="Kivii.Linq.V4.0, Version=5.6.2023.4200, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Kivii.Linq.5.6.2023.4200\lib\net40\Kivii.Linq.V4.0.dll</HintPath> <HintPath>..\packages\Kivii.Linq.5.6.2023.4200\lib\net40\Kivii.Linq.V4.0.dll</HintPath>
</Reference> </Reference>
<Reference Include="Kivii.Rfid.D500.V4.0">
<HintPath>Content\Kivii.Rfid.D500.V4.0.dll</HintPath>
</Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Xml.Linq" />
...@@ -93,5 +96,8 @@ ...@@ -93,5 +96,8 @@
</Compile> </Compile>
<None Include="Resources\批量读卡器文档.zip" /> <None Include="Resources\批量读卡器文档.zip" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Content\Kivii.Rfid.D500.V4.0.dll" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project> </Project>
\ No newline at end of file
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading;
using System.Windows.Forms; using System.Windows.Forms;
namespace Kivii.Client.SamplePackages namespace Kivii.Client.SamplePackages
{ {
internal static class Program internal static class Program
{ {
#region 设置单进程,开机启动
private static Mutex _mutex = null;
private static bool isProgramExisted()
{
bool rtns = false;
_mutex = new Mutex(true, "Kivii.Rfid.D500.V4.0.dll", out rtns);
//mutex.Dispose();
return !rtns;
}
#endregion
/// <summary> /// <summary>
/// 应用程序的主入口点。 /// 应用程序的主入口点。
/// </summary> /// </summary>
[STAThread] [STAThread]
static void Main() static void Main()
{ {
if (isProgramExisted())
{
MessageBox.Show($"读卡器被占用正在被使用。", "通讯冲突", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly);
Application.Exit();
return;
}
Application.EnableVisualStyles(); Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false); Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new FrmMain()); Application.Run(new FrmMain());
......
...@@ -27,4 +27,26 @@ namespace Kivii.Samples.Transforms ...@@ -27,4 +27,26 @@ namespace Kivii.Samples.Transforms
{ {
public Guid PackageKvid { get; set; } public Guid PackageKvid { get; set; }
} }
[Route(Configs.RouteSamplePrePackaging)]
public class SamplePrePackaging:IReturn<RestfulExecutionResponse<Sample>>
{
public string Tid { get; set; }
public Guid OwnerKvid { get; set; }//要打包的样品的所属信息
}
[Route(Configs.RouteSamplePackaging)]
public class SamplePackaging : IReturn<RestfulExecutionResponse<Sample>>
{
public Guid Kvid { get; set; }//要流转样品信息
public Location Location { get; set; }//地点位置信息,只需要InternalCode
public Sample Package { get; set; }//指定包裹信息,Package.PackageName可传入包裹的区域信息,例如包裹A0001中的1号袋子
}
[Route(Configs.RouteSampleUnPackaging)]
public class SampleUnPackaging : IReturn<RestfulExecutionResponse<Sample>>
{
public Guid Kvid { get; set; }//要流转样品信息
public Location Location { get; set; }//地点位置信息,只需要InternalCode
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment