Browse Source

手持增加菜单

1.根据VDA获取内部标签
2.补打内部标签后,重新校验
master
hao.jin 3 years ago
parent
commit
89619de0c3
  1. 7
      PDAForm/PDAForm/Bill/VDA/frmBarCodeSelect.Designer.cs
  2. 38
      PDAForm/PDAForm/Bill/VDA/frmBarCodeSelect.cs
  3. 8
      PDAForm/PDAForm/Bill/VDA/frmVDACheck.Designer.cs
  4. 80
      PDAForm/PDAForm/Bill/VDA/frmVDACheck.cs
  5. 21
      PDAForm/PDAForm/PDABiz/F_VerifyBill.cs
  6. 3
      PDAForm/PDAForm/PDAForm.csproj
  7. 2
      Stone.WinForm/Stone.DataService/PDAService/Web.Config
  8. 46
      Stone.WinForm/Stone.DataService/Stone.DataService.Biz/Bill/F_STD_Check.cs
  9. 18
      Stone.WinForm/Stone.DataService/Stone.DataService.Biz/CommandFactory.cs
  10. 25
      Stone.WinForm/Stone.DataService/Stone.DataService.Biz/Info/F_VerifyBill.cs
  11. 1
      Stone.WinForm/Stone.DataService/Stone.DataService.Biz/Stone.DataService.Biz.csproj
  12. 1
      Stone.WinForm/Stone.WinBiz/VerifyData/F_VerifyBill.cs
  13. 1
      Stone.WinForm/Stone.WinModule/VerifyData/frmVerifyBill.cs

7
PDAForm/PDAForm/Bill/VDA/frmBarCodeSelect.Designer.cs

@ -38,11 +38,12 @@
// //
// txt_barcode // txt_barcode
// //
this.txt_barcode.Enabled = false;
this.txt_barcode.Font = new System.Drawing.Font("Tahoma", 16F, System.Drawing.FontStyle.Regular);
this.txt_barcode.Location = new System.Drawing.Point(3, 158); this.txt_barcode.Location = new System.Drawing.Point(3, 158);
this.txt_barcode.MaxLength = 40; this.txt_barcode.MaxLength = 40;
this.txt_barcode.Multiline = true; this.txt_barcode.Multiline = true;
this.txt_barcode.Name = "txt_barcode"; this.txt_barcode.Name = "txt_barcode";
this.txt_barcode.ReadOnly = true;
this.txt_barcode.Size = new System.Drawing.Size(228, 72); this.txt_barcode.Size = new System.Drawing.Size(228, 72);
this.txt_barcode.TabIndex = 22; this.txt_barcode.TabIndex = 22;
// //
@ -57,10 +58,10 @@
// //
this.txt_vda.Location = new System.Drawing.Point(5, 52); this.txt_vda.Location = new System.Drawing.Point(5, 52);
this.txt_vda.MaxLength = 40; this.txt_vda.MaxLength = 40;
this.txt_vda.Multiline = true;
this.txt_vda.Name = "txt_vda"; this.txt_vda.Name = "txt_vda";
this.txt_vda.Size = new System.Drawing.Size(228, 64); this.txt_vda.Size = new System.Drawing.Size(228, 23);
this.txt_vda.TabIndex = 21; this.txt_vda.TabIndex = 21;
this.txt_vda.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txt_vda_KeyDown);
this.txt_vda.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txt_vda_KeyPress); this.txt_vda.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txt_vda_KeyPress);
// //
// label3 // label3

38
PDAForm/PDAForm/Bill/VDA/frmBarCodeSelect.cs

@ -6,6 +6,7 @@ using System.Data;
using System.Drawing; using System.Drawing;
using System.Text; using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
using PDAForm.PDABiz;
namespace PDAForm.Bill.VDA namespace PDAForm.Bill.VDA
{ {
@ -33,14 +34,39 @@ namespace PDAForm.Bill.VDA
private void txt_vda_KeyPress(object sender, KeyPressEventArgs e) private void txt_vda_KeyPress(object sender, KeyPressEventArgs e)
{ {
try
{ }
} private void txt_vda_KeyDown(object sender, KeyEventArgs e)
catch (Exception) {
if (e.KeyCode == Keys.Enter)
{ {
try
throw; {
txt_barcode.Text = "";
string VDA = this.txt_vda.Text.Trim();
if (string.IsNullOrEmpty(VDA)) return;
DataSet dsVerifyBill = F_VerifyBill.GetBarCode(VDA);
if (dsVerifyBill == null || dsVerifyBill.Tables[0].Rows.Count == 0)
{
MessageBox.Show("未找到VDA标签的校验记录!");
txt_vda.SelectAll();
return;
}
var barCode = dsVerifyBill.Tables[0].Rows[0][0].ToString();
txt_barcode.Text = barCode;
if (string.IsNullOrEmpty(barCode))
{
MessageBox.Show("未找到VDA对应的内部标签!");
}
txt_vda.SelectAll();
}
catch (Exception ex)
{
MessageBox.Show("未找到VDA标签的校验记录!");
txt_vda.SelectAll();
}
} }
} }
} }

8
PDAForm/PDAForm/Bill/VDA/frmVDACheck.Designer.cs

@ -41,10 +41,10 @@
// //
this.txt_barcode.Location = new System.Drawing.Point(4, 165); this.txt_barcode.Location = new System.Drawing.Point(4, 165);
this.txt_barcode.MaxLength = 40; this.txt_barcode.MaxLength = 40;
this.txt_barcode.Multiline = true;
this.txt_barcode.Name = "txt_barcode"; this.txt_barcode.Name = "txt_barcode";
this.txt_barcode.Size = new System.Drawing.Size(228, 72); this.txt_barcode.Size = new System.Drawing.Size(228, 23);
this.txt_barcode.TabIndex = 26; this.txt_barcode.TabIndex = 26;
this.txt_barcode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txt_barcode_KeyDown);
// //
// label2 // label2
// //
@ -57,10 +57,10 @@
// //
this.txt_vda.Location = new System.Drawing.Point(6, 59); this.txt_vda.Location = new System.Drawing.Point(6, 59);
this.txt_vda.MaxLength = 40; this.txt_vda.MaxLength = 40;
this.txt_vda.Multiline = true;
this.txt_vda.Name = "txt_vda"; this.txt_vda.Name = "txt_vda";
this.txt_vda.Size = new System.Drawing.Size(228, 64); this.txt_vda.Size = new System.Drawing.Size(228, 23);
this.txt_vda.TabIndex = 25; this.txt_vda.TabIndex = 25;
this.txt_vda.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txt_vda_KeyDown);
this.txt_vda.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txt_vda_KeyPress_1); this.txt_vda.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txt_vda_KeyPress_1);
// //
// label3 // label3

80
PDAForm/PDAForm/Bill/VDA/frmVDACheck.cs

@ -6,6 +6,8 @@ using System.Data;
using System.Drawing; using System.Drawing;
using System.Text; using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
using PDAForm.Comm;
using PDAForm.PDABiz;
namespace PDAForm.Bill.VDA namespace PDAForm.Bill.VDA
{ {
@ -30,5 +32,83 @@ namespace PDAForm.Bill.VDA
{ {
} }
private void txt_vda_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
try
{
var vda = txt_vda.Text.Trim();
//校验VDA标签是否有效
if (string.IsNullOrEmpty(vda))
{
MessageBox.Show("VDA标签不能为空!");
txt_vda.Focus();
}
DataSet dsVerifyBill = F_VerifyBill.GetBarCode(vda);
if (dsVerifyBill == null || dsVerifyBill.Tables[0].Rows.Count == 0)
{
MessageBox.Show("未找到VDA标签的校验记录!");
txt_vda.SelectAll();
return;
}
}
catch
{
MessageBox.Show("未找到VDA标签的校验记录!");
txt_vda.SelectAll();
}
txt_barcode.Focus();
}
}
private void txt_barcode_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
try
{
#region 提交数据到服务器
var VDA = txt_vda.Text.Trim();
var BarCode = txt_barcode.Text.Trim();
if (string.IsNullOrEmpty(VDA))
{
MessageBox.Show("VDA标签不能为空!");
txt_vda.Focus();
}
if (string.IsNullOrEmpty(BarCode))
{
MessageBox.Show("内部标签不能为空!");
txt_barcode.Focus();
}
string Cmd = "BILL_RE_CHECK";
string Pars = UserInfo.UserName + ";" + VDA + ";" + BarCode;
MyCommand cmd = new MyCommand(Cmd, Pars);
DataSet dsData = F_Message.ServiceMessage(cmd.GetCommand());
if (dsData.Tables[0].Rows[0]["Str"].ToString() == "OK")
{
this.txt_vda.Text = "";
this.txt_barcode.Text = "";
this.txt_vda.Focus();
}
else
{
txt_barcode.SelectAll();
throw new Exception("装箱校验失败,请检查");
}
#endregion
}
catch (Exception ex)
{
MessageBox.Show("装箱校验失败,请检查标签!");
txt_barcode.SelectAll();
}
}
}
} }
} }

21
PDAForm/PDAForm/PDABiz/F_VerifyBill.cs

@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using PDAForm.Comm;
namespace PDAForm.PDABiz
{
public class F_VerifyBill
{
public static DataSet GetBarCode(string VDA)
{
string Cmd = "GetBarCode";
string Pars = VDA;
MyCommand command = new MyCommand(Cmd, Pars);
return F_Message.ServiceMessage(command.GetCommand());
}
}
}

3
PDAForm/PDAForm/PDAForm.csproj

@ -2,7 +2,7 @@
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion> <ProductVersion>9.0.21022</ProductVersion>
<SchemaVersion>2.0</SchemaVersion> <SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{6B9249A0-CACF-4DBB-8281-EF43C9078100}</ProjectGuid> <ProjectGuid>{6B9249A0-CACF-4DBB-8281-EF43C9078100}</ProjectGuid>
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
@ -425,6 +425,7 @@
<Compile Include="frmVerifySelect.Designer.cs"> <Compile Include="frmVerifySelect.Designer.cs">
<DependentUpon>frmVerifySelect.cs</DependentUpon> <DependentUpon>frmVerifySelect.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="PDABiz\F_VerifyBill.cs" />
<Compile Include="PDAControl\ctrProduct.cs"> <Compile Include="PDAControl\ctrProduct.cs">
<SubType>UserControl</SubType> <SubType>UserControl</SubType>
</Compile> </Compile>

2
Stone.WinForm/Stone.DataService/PDAService/Web.Config

@ -9,7 +9,7 @@
--> -->
<configuration> <configuration>
<appSettings> <appSettings>
<add key="LocalDB" value="DATA SOURCE = 127.0.0.1,12017;USER ID = sa;PASSWORD = sa;INITIAL CATALOG = STD"/> <add key="LocalDB" value="DATA SOURCE = 127.0.0.1;USER ID = sa;PASSWORD = Microsoft2008;INITIAL CATALOG = STD"/>
<add key="BarCodeDB" value=""/> <add key="BarCodeDB" value=""/>
</appSettings> </appSettings>
<connectionStrings/> <connectionStrings/>

46
Stone.WinForm/Stone.DataService/Stone.DataService.Biz/Bill/F_STD_Check.cs

@ -81,6 +81,52 @@ namespace Stone.DataService.Biz.Bill
} }
public DataSet VDA_UPDATE_Submit(Command cmd)
{
string UserName = cmd.Pars[0];
string VDA = cmd.Pars[1];
string BarCode = cmd.Pars[2];
LocalDBService db = null;
try
{
db = new LocalDBService();
db.BeginTrans();
Entity_t_VerifyBill t_VerifyBill = new Entity_t_VerifyBill(db);
var dsVerifyBill = t_VerifyBill.GetData($"[PackageNo1]='{VDA}' or [PackageNo2]='{VDA}'");
if(dsVerifyBill.Tables.Count == 0 || dsVerifyBill == null)
{
throw new Exception($"不存在 VDA标签 {VDA} 的校验记录!");
}
var strID = dsVerifyBill.Tables[0].Rows[0]["ID"].ToString();
var strsql = "";
//更新为失效
strsql = "Update t_VerifyBill" +
" set State = '已失效'" +
" where PackageNo1 = '" + VDA + "' or PackageNo2 = '" + VDA + "'";
db.Exec_NonQuery(strsql);
//插入新记录
strsql = "Insert into t_VerifyBill(AsnNumber,PackageNo,PackageNo1,PackageNo2,PartNumber,Qty,BarCode,UserName)" +
" select AsnNumber,PackageNo,PackageNo1,PackageNo2,PartNumber,Qty,'" + BarCode + "'," +
"'" + UserName + "'" +
" from t_VerifyBill where ID = " + strID;
db.Exec_NonQuery(strsql);
db.Commit();
return Stone.DataService.Biz.BizPublic.MyDataSet.GetDataByString("OK");
}
catch (Exception ex)
{
if (db != null) db.Rollback();
throw ex;
}
finally
{
if (db != null) db.EndTrans();
}
}
} }
} }

18
Stone.WinForm/Stone.DataService/Stone.DataService.Biz/CommandFactory.cs

@ -24,6 +24,7 @@ namespace Stone.DataService.Biz
F_BillVDA f_BillVDA = null; F_BillVDA f_BillVDA = null;
F_BillAsn f_BillAsn = null; F_BillAsn f_BillAsn = null;
//F_BillSort f_BillSort = null; //F_BillSort f_BillSort = null;
F_STD_Check f_STD_Check = null;
Command cmd = new Command(dsCommand); Command cmd = new Command(dsCommand);
@ -84,19 +85,28 @@ namespace Stone.DataService.Biz
f_BillAsn.BillSubmit(cmd, dsData); f_BillAsn.BillSubmit(cmd, dsData);
return null; return null;
#endregion #endregion
#region STD校验 #region STD校验
case "VDA_CHECK_SUBMIT": case "VDA_CHECK_SUBMIT":
return F_STD_Check.VDA_Check_Submit(cmd); return F_STD_Check.VDA_Check_Submit(cmd);
#endregion #endregion
#region 根据VDA获取内部条码号
case "GETBARCODE":
return F_VerifyBill.GetBarCodeByVDA(cmd);
#endregion
#region 补打内部条码号-重新校验装箱数据
case "BILL_RE_CHECK":
f_STD_Check = new F_STD_Check();
var ds = f_STD_Check.VDA_UPDATE_Submit(cmd);
return ds;
#endregion
} }
throw new Exception("未获取到任何指定的数据!"); throw new Exception("未获取到任何指定的数据!");
} }
} }
} }

25
Stone.WinForm/Stone.DataService/Stone.DataService.Biz/Info/F_VerifyBill.cs

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using Gm_WMS.DataAccess.DataService;
using Stone.Common;
namespace Stone.DataService.Biz.Info
{
public class F_VerifyBill
{
public static DataSet GetBarCodeByVDA(Command cmd)
{
string VDA = cmd.Pars[0];
string sql = "select BarCode from t_VerifyBill where 1= 1 " +
" and PackageNo1 = '" + VDA + "'" +
" or PackageNo2 = '" + VDA + "'" +
" order by Id desc";
LocalDBService db = new LocalDBService();
return db.Exec_DataSet(sql);
}
}
}

1
Stone.WinForm/Stone.DataService/Stone.DataService.Biz/Stone.DataService.Biz.csproj

@ -85,6 +85,7 @@
<Compile Include="Command.cs" /> <Compile Include="Command.cs" />
<Compile Include="CommandFactory.cs" /> <Compile Include="CommandFactory.cs" />
<Compile Include="Info\F_Product.cs" /> <Compile Include="Info\F_Product.cs" />
<Compile Include="Info\F_VerifyBill.cs" />
<Compile Include="Info\F_User.cs" /> <Compile Include="Info\F_User.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Settings.Designer.cs"> <Compile Include="Properties\Settings.Designer.cs">

1
Stone.WinForm/Stone.WinBiz/VerifyData/F_VerifyBill.cs

@ -29,6 +29,7 @@ namespace Stone.WinBiz.VerifyData
dgv.Columns["BarCode"].HeaderText = "内部装箱单号"; dgv.Columns["BarCode"].HeaderText = "内部装箱单号";
dgv.Columns["UserName"].HeaderText = "用户名"; dgv.Columns["UserName"].HeaderText = "用户名";
dgv.Columns["AddTime"].HeaderText = "校验时间"; dgv.Columns["AddTime"].HeaderText = "校验时间";
dgv.Columns["State"].HeaderText = "状态";
} }
} }

1
Stone.WinForm/Stone.WinModule/VerifyData/frmVerifyBill.cs

@ -30,6 +30,7 @@ namespace Stone.WinModule.VerifyData
strWhere += " or [PackageNo] like '%" + code + "%'"; strWhere += " or [PackageNo] like '%" + code + "%'";
strWhere += " or [BarCode] like '%" + code + "%'"; strWhere += " or [BarCode] like '%" + code + "%'";
strWhere += " or [UserName] like '%" + code + "%'"; strWhere += " or [UserName] like '%" + code + "%'";
strWhere += " or [State] like '%" + code + "%'";
} }
else else
{ {

Loading…
Cancel
Save