Compare commits

...

7 Commits

  1. 38
      PDAForm/PDAForm/Bill/AsnBill/F_AsnBill.cs
  2. 3
      PDAForm/PDAForm/Bill/AsnBill/frmAsnBill.Designer.cs
  3. 96
      PDAForm/PDAForm/Bill/AsnBill/frmAsnBill.cs
  4. 116
      PDAForm/PDAForm/Bill/AsnBill/frmAsnBill.resx
  5. 4
      PDAForm/PDAForm/Bill/VDA/frmVDA.cs
  6. 2
      PDAForm/PDAForm/PDAForm.csproj
  7. 4
      PDAForm/PDAForm/PDAForm.xml
  8. 29
      PDAForm/PDAForm/frmMain.Designer.cs
  9. BIN
      Stone.WinForm/Stone.Common.Dlls/Stone.Entity.dll
  10. 2
      Stone.WinForm/Stone.DataService/PDAService/Web.Config
  11. 70
      Stone.WinForm/Stone.DataService/Stone.DataService.Biz/Bill/F_BillAsn.cs
  12. 11
      Stone.WinForm/Stone.DataService/Stone.DataService.Biz/CommandFactory.cs
  13. 27
      Stone.WinForm/Stone.Entity/Entity_t_PartPO.cs
  14. 1
      Stone.WinForm/Stone.Entity/Stone.Entity.csproj
  15. 7
      Stone.WinForm/Stone.WinBiz/BasicData/F_Base.cs
  16. 70
      Stone.WinForm/Stone.WinBiz/BasicData/F_PartPO.cs
  17. 32
      Stone.WinForm/Stone.WinBiz/JISAdmin/F_EDI_JIS5000Sequence.cs
  18. 9
      Stone.WinForm/Stone.WinBiz/JISAdmin/F_JIS5000_Print.cs
  19. 18
      Stone.WinForm/Stone.WinBiz/Standard/F_JIS_VDA_ASN.cs
  20. 2
      Stone.WinForm/Stone.WinBiz/Stone.WinBiz.csproj
  21. 10
      Stone.WinForm/Stone.WinForm/frmMain.cs
  22. 12
      Stone.WinForm/Stone.WinModule/BasicData/F_Factory.cs
  23. 36
      Stone.WinForm/Stone.WinModule/BasicData/frmPartPO.Designer.cs
  24. 26
      Stone.WinForm/Stone.WinModule/BasicData/frmPartPO.cs
  25. 163
      Stone.WinForm/Stone.WinModule/BasicData/frmPartPODetail.Designer.cs
  26. 65
      Stone.WinForm/Stone.WinModule/BasicData/frmPartPODetail.cs
  27. 123
      Stone.WinForm/Stone.WinModule/BasicData/frmPartPODetail.resx
  28. 92
      Stone.WinForm/Stone.WinModule/Standard/frmASNScan.Designer.cs
  29. 93
      Stone.WinForm/Stone.WinModule/Standard/frmASNScan.cs
  30. 120
      Stone.WinForm/Stone.WinModule/Standard/frmASNScan.resx
  31. 7
      Stone.WinForm/Stone.WinModule/Standard/frmJISVDAASN.Designer.cs
  32. 498
      Stone.WinForm/Stone.WinModule/Standard/frmJISVDAASN.cs
  33. 5
      Stone.WinForm/Stone.WinModule/Standard/frmJISVDAASN.resx
  34. 2
      Stone.WinForm/Stone.WinModule/Standard/frmMessageQuestion.cs
  35. 39
      Stone.WinForm/Stone.WinModule/Stone.WinModule.csproj

38
PDAForm/PDAForm/Bill/AsnBill/F_AsnBill.cs

@ -20,7 +20,7 @@ namespace PDAForm.Bill.AsnBill
/// </summary> /// </summary>
public void BillNew(DataGrid dg) public void BillNew(DataGrid dg)
{ {
string Cmd = "BILL_NEW_" + billType; string Cmd = "BILL_GET_" + billType;
string Pars = BillNo + ";" + UserInfo.UserName; string Pars = BillNo + ";" + UserInfo.UserName;
MyCommand cmd = new MyCommand(Cmd, Pars); MyCommand cmd = new MyCommand(Cmd, Pars);
@ -29,15 +29,17 @@ namespace PDAForm.Bill.AsnBill
dg.DataSource = dsBill.Tables[0]; dg.DataSource = dsBill.Tables[0];
DataGridTableStyle style = new DataGridTableStyle(); DataGridTableStyle style = new DataGridTableStyle();
style.MappingName = dsBill.Tables[0].TableName; style.MappingName = dsBill.Tables[0].TableName;
dg.TableStyles.Clear(); dg.TableStyles.Clear();
dg.TableStyles.Add(style); dg.TableStyles.Add(style);
dg.TableStyles[0].GridColumnStyles["PackageNo"].HeaderText = "装箱单号"; dg.TableStyles[0].GridColumnStyles["PartNumber"].HeaderText = "零件号";
dg.TableStyles[0].GridColumnStyles["PackageNo"].Width = 150; dg.TableStyles[0].GridColumnStyles["PartNumber"].Width = 150;
dg.TableStyles[0].GridColumnStyles["IsCheck"].HeaderText = "是否扫描"; dg.TableStyles[0].GridColumnStyles["Qty"].HeaderText = "计划数量";
dg.TableStyles[0].GridColumnStyles["AsnNumber"].Width = 0; dg.TableStyles[0].GridColumnStyles["Qty"].Width = 100;
dg.TableStyles[0].GridColumnStyles["IsShipingVerification"].Width = 0; dg.TableStyles[0].GridColumnStyles["CheckQty"].HeaderText = "校验数量";
dg.TableStyles[0].GridColumnStyles["CheckQty"].Width = 100;
dg.TableStyles[0].GridColumnStyles["IsPackingVerification"].HeaderText = "校验通过";
dg.TableStyles[0].GridColumnStyles["IsPackingVerification"].Width = 50;
} }
/// <summary> /// <summary>
@ -53,7 +55,27 @@ namespace PDAForm.Bill.AsnBill
} }
/// <summary>
/// 提交单据
/// </summary>
public void BillSubmit(DataTable scanInfo)
{
string Cmd = "BILL_SUBMIT_WITHSCAN";
string Pars = UserInfo.UserName;
MyCommand cmd = new MyCommand(Cmd, Pars);
F_Message.ServiceMessage(cmd.GetCommand(), dsBill);
}
public DataTable GetShipingVerification()
{
string Cmd = "BILL_GET_VERIHIS";
string Pars = BillNo + ";" + UserInfo.UserName;
MyCommand cmd = new MyCommand(Cmd, Pars);
var dsBillVeriHis = F_Message.ServiceMessage(cmd.GetCommand());
return dsBillVeriHis.Tables[0];
}
} }
} }

3
PDAForm/PDAForm/Bill/AsnBill/frmAsnBill.Designer.cs

@ -77,7 +77,7 @@
this.label3.Location = new System.Drawing.Point(3, 32); this.label3.Location = new System.Drawing.Point(3, 32);
this.label3.Name = "label3"; this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(100, 20); this.label3.Size = new System.Drawing.Size(100, 20);
this.label3.Text = "装箱单号:"; this.label3.Text = "托盘号:";
// //
// btnSubmit // btnSubmit
// //
@ -104,6 +104,7 @@
this.btnDelete.Size = new System.Drawing.Size(72, 33); this.btnDelete.Size = new System.Drawing.Size(72, 33);
this.btnDelete.TabIndex = 14; this.btnDelete.TabIndex = 14;
this.btnDelete.Text = "删除记录"; this.btnDelete.Text = "删除记录";
this.btnDelete.Visible = false;
this.btnDelete.Click += new System.EventHandler(this.btnDelete_Click); this.btnDelete.Click += new System.EventHandler(this.btnDelete_Click);
// //
// lblState // lblState

96
PDAForm/PDAForm/Bill/AsnBill/frmAsnBill.cs

@ -6,6 +6,7 @@ using System.Drawing;
using System.Text; using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
using PDAForm.Comm; using PDAForm.Comm;
using PDAForm.PDABiz;
using PDAForm.SelectComm; using PDAForm.SelectComm;
namespace PDAForm.Bill.AsnBill namespace PDAForm.Bill.AsnBill
@ -13,6 +14,7 @@ namespace PDAForm.Bill.AsnBill
public partial class frmAsnBill : Form public partial class frmAsnBill : Form
{ {
public F_AsnBill m_base = null; public F_AsnBill m_base = null;
private DataTable dtShipingVerificationHis,dtNowScan;
public frmAsnBill() public frmAsnBill()
{ {
InitializeComponent(); InitializeComponent();
@ -39,9 +41,15 @@ namespace PDAForm.Bill.AsnBill
m_base = new F_AsnBill(); m_base = new F_AsnBill();
m_base.BillNo = this.txtBillNo.Text.Trim(); m_base.BillNo = this.txtBillNo.Text.Trim();
m_base.BillNew(this.dgShow); m_base.BillNew(this.dgShow);
DataRow[] drs = m_base.dsBill.Tables[0].Select("[AsnNumber]='" + m_base.BillNo + "'");
if (drs.Length == 0)
{
throw new Exception("ASN号 " + m_base.BillNo + " 在系统中不存在");
}
//获取已校验的信息,系统支持多次校验
dtShipingVerificationHis = m_base.GetShipingVerification();
dtNowScan = dtShipingVerificationHis.Clone();
Total(); Total();
this.txtBillNo.Enabled = true; this.txtBillNo.Enabled = true;
} }
@ -62,32 +70,70 @@ namespace PDAForm.Bill.AsnBill
{ {
if (e.KeyCode == Keys.Enter) if (e.KeyCode == Keys.Enter)
{ {
if (m_base == null) throw new Exception("请扫ASN编号!"); if (m_base == null) throw new Exception("请扫ASN编号!");
string BarCode = this.txtBarCode.Text.Trim(); string BarCode = this.txtBarCode.Text.Trim().Split('#')[0];
if (BarCode.Length < 0) if (BarCode.Length < 0)
{ {
MyMessageBox.ShowErrorMessage("装箱单号不能为空!"); MyMessageBox.ShowErrorMessage("托盘号不能为空!");
this.txtBarCode.Focus(); this.txtBarCode.Focus();
this.txtBarCode.SelectAll(); this.txtBarCode.SelectAll();
return; return;
} }
//托盘格式样例 5B602C2-04&00000044&02 零件号+分隔符+8位箱流水号+两位的数量
DataRow[] drs = m_base.dsBill.Tables[0].Select("[PackageNo]='" + BarCode + "'"); var barList = BarCode.Split('&');
if (drs.Length == 0) var partCode = barList[0];
var boxID = barList[1];
var strQty = barList[2];
//之前提交的数据中是否采集过改托盘号
DataRow[] drs = dtShipingVerificationHis.Select("[PackageNo]='" + BarCode + "'");
if (drs.Length >0)
{ {
throw new Exception("装箱单号 " + BarCode + " 在系统中不存在"); throw new Exception("托盘号 " + BarCode + " 已扫描");
} }
//本次扫描的数据中是否重复扫描该托盘号
if (Convert.ToInt32(drs[0]["IsCheck"]) == 1) var drNow = dtNowScan.Select("[PackageNo]='" + BarCode + "'");
if (drNow.Length > 0)
{ {
throw new Exception("装箱单号 " + BarCode + " 重复扫描"); throw new Exception("托盘号 " + BarCode + " 已扫描");
}
//校验数量是否超出,校验零件号是否有效
var rowAsn = m_base.dsBill.Tables[0].Select("[AsnNumber]='" + m_base.BillNo + "' and PartNumber = '" + partCode + "'");
if (rowAsn.Length != 1)
{
throw new Exception("托盘号 " + BarCode + " 不在扫描的ASN " + m_base.BillNo + " 中!");
}
else
{
var planQty = int.Parse(rowAsn[0]["Qty"].ToString());
var checkQty = int.Parse(rowAsn[0]["CheckQty"].ToString());
if (planQty < (checkQty + int.Parse(strQty)))
{
throw new Exception("托盘数量 " + strQty + " 超出待校验数量 " + (planQty-checkQty));
}
}
rowAsn[0]["CheckQty"] = int.Parse(strQty) + int.Parse(rowAsn[0]["CheckQty"].ToString());
if (int.Parse(rowAsn[0]["CheckQty"].ToString()) == int.Parse(rowAsn[0]["Qty"].ToString()))
{
rowAsn[0]["IsPackingVerification"] = 1;
}
//填加校验明细
var scanInfo = dtNowScan.NewRow();
scanInfo["AsnNumber"] = m_base.BillNo;
scanInfo["PackageNo"] = BarCode;
scanInfo["UserName"] = UserInfo.UserName;
dtNowScan.Rows.Add(scanInfo);
if (m_base.dsBill.Tables.Count == 1)
{
dtNowScan.TableName = "ScanInfo";
m_base.dsBill.Tables.Add(dtNowScan);
}
else
{
m_base.dsBill.Tables[1].Rows.Add(scanInfo.ItemArray);
} }
drs[0]["IsCheck"] = 1;
Total(); Total();
this.txtBarCode.Focus(); this.txtBarCode.Focus();
this.txtBarCode.SelectAll(); this.txtBarCode.SelectAll();
} }
@ -110,13 +156,7 @@ namespace PDAForm.Bill.AsnBill
if (m_base == null) throw new Exception("没有需要提示的数据!"); if (m_base == null) throw new Exception("没有需要提示的数据!");
if (MyMessageBox.ShowQuestion("是否要提交数据?")) if (MyMessageBox.ShowQuestion("是否要提交数据?"))
{ {
if (m_base.dsBill.Tables[0].Select("[IsCheck]=0").Length > 0) m_base.BillSubmit(dtNowScan);
{
throw new Exception("有未扫描记录!");
}
m_base.BillSubmit();
m_base = null; m_base = null;
Total(); Total();
@ -180,18 +220,10 @@ namespace PDAForm.Bill.AsnBill
else else
{ {
int a1 = m_base.dsBill.Tables[0].Rows.Count; int a1 = m_base.dsBill.Tables[0].Rows.Count;
int a2 = m_base.dsBill.Tables[0].Select("[IsCheck]=1").Length; int a2 = m_base.dsBill.Tables[0].Select("Qty = CheckQty").Length;
this.lblState.Text = a2 + "/" + a1; this.lblState.Text = a2 + "/" + a1;
} }
} }
} }
} }

116
PDAForm/PDAForm/Bill/AsnBill/frmAsnBill.resx

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<root> <root>
<!-- <!--
Microsoft ResX Schema Microsoft ResX Schema
Version 2.0 Version 2.0
@ -59,56 +59,68 @@
: using a System.ComponentModel.TypeConverter : using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding. : and then encoded with base64 encoding.
--> -->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/> <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true"> <xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType> <xsd:complexType>
<xsd:choice maxOccurs="unbounded"> <xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata"> <xsd:element name="metadata">
<xsd:complexType> <xsd:complexType>
<xsd:sequence> <xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0"/> <xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence> </xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string"/> <xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string"/> <xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string"/> <xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space"/> <xsd:attribute ref="xml:space" />
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
<xsd:element name="assembly"> <xsd:element name="assembly">
<xsd:complexType> <xsd:complexType>
<xsd:attribute name="alias" type="xsd:string"/> <xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string"/> <xsd:attribute name="name" type="xsd:string" />
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
<xsd:element name="data"> <xsd:element name="data">
<xsd:complexType> <xsd:complexType>
<xsd:sequence> <xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2"/> <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence> </xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1"/> <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3"/> <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4"/> <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space"/> <xsd:attribute ref="xml:space" />
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
<xsd:element name="resheader"> <xsd:element name="resheader">
<xsd:complexType> <xsd:complexType>
<xsd:sequence> <xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence> </xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required"/> <xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
</xsd:choice> </xsd:choice>
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
</xsd:schema> </xsd:schema>
<metadata name="$this.FormFactorShadowProperty" xml:space="preserve"> <resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="$this.FormFactorShadowProperty" xml:space="preserve">
<value>WEBPAD</value> <value>WEBPAD</value>
</metadata> </metadata>
<metadata name="$this.Skin" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="$this.Skin" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value> <value>False</value>
</metadata> </metadata>
<resheader name="resmimetype"><value>text/microsoft-resx</value></resheader><resheader name="version"><value>2.0</value></resheader><resheader name="reader"><value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader><resheader name="writer"><value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader></root> </root>

4
PDAForm/PDAForm/Bill/VDA/frmVDA.cs

@ -205,10 +205,6 @@ namespace PDAForm.Bill.VDA
#endregion #endregion
} }
} }
} }

2
PDAForm/PDAForm/PDAForm.csproj

@ -811,7 +811,7 @@
<ItemGroup> <ItemGroup>
<Content Include="FONTS.ICO" /> <Content Include="FONTS.ICO" />
<Content Include="PDAForm.xml"> <Content Include="PDAForm.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
</ItemGroup> </ItemGroup>
<Import Condition="'$(TargetFrameworkVersion)' == 'v1.0'" Project="$(MSBuildBinPath)\Microsoft.CompactFramework.CSharp.v1.targets" /> <Import Condition="'$(TargetFrameworkVersion)' == 'v1.0'" Project="$(MSBuildBinPath)\Microsoft.CompactFramework.CSharp.v1.targets" />

4
PDAForm/PDAForm/PDAForm.xml

@ -2,11 +2,11 @@
<NewDataSet> <NewDataSet>
<ConfigList> <ConfigList>
<Name>test</Name> <Name>test</Name>
<Value>刘洪辉</Value> <Value>闻荫</Value>
</ConfigList> </ConfigList>
<ConfigList> <ConfigList>
<Name>WebService</Name> <Name>WebService</Name>
<Value>http://127.0.0.1:8084/Service.asmx</Value> <Value>http://127.0.0.1:8009/Service.asmx</Value>
</ConfigList> </ConfigList>
<ConfigList> <ConfigList>
<Name>当前用户</Name> <Name>当前用户</Name>

29
PDAForm/PDAForm/frmMain.Designer.cs

@ -52,6 +52,7 @@
this.btnOnLine = new System.Windows.Forms.Button(); this.btnOnLine = new System.Windows.Forms.Button();
this.btnSort = new System.Windows.Forms.Button(); this.btnSort = new System.Windows.Forms.Button();
this.tabPage4 = new System.Windows.Forms.TabPage(); this.tabPage4 = new System.Windows.Forms.TabPage();
this.button2 = new System.Windows.Forms.Button();
this.btnNBCCH = new System.Windows.Forms.Button(); this.btnNBCCH = new System.Windows.Forms.Button();
this.btnVDA = new System.Windows.Forms.Button(); this.btnVDA = new System.Windows.Forms.Button();
this.btnShipBill = new System.Windows.Forms.Button(); this.btnShipBill = new System.Windows.Forms.Button();
@ -62,7 +63,6 @@
this.btnQuality = new System.Windows.Forms.Button(); this.btnQuality = new System.Windows.Forms.Button();
this.btnBarCodeCheck = new System.Windows.Forms.Button(); this.btnBarCodeCheck = new System.Windows.Forms.Button();
this.tabPage2 = new System.Windows.Forms.TabPage(); this.tabPage2 = new System.Windows.Forms.TabPage();
this.button2 = new System.Windows.Forms.Button();
this.panel1.SuspendLayout(); this.panel1.SuspendLayout();
this.tabControl1.SuspendLayout(); this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout(); this.tabPage1.SuspendLayout();
@ -313,6 +313,17 @@
this.tabPage4.Size = new System.Drawing.Size(230, 187); this.tabPage4.Size = new System.Drawing.Size(230, 187);
this.tabPage4.Text = "功能三"; this.tabPage4.Text = "功能三";
// //
// button2
//
this.button2.Font = new System.Drawing.Font("Tahoma", 8F, System.Drawing.FontStyle.Regular);
this.button2.Location = new System.Drawing.Point(128, 104);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(100, 50);
this.button2.TabIndex = 43;
this.button2.Text = "VDA标签照核";
this.button2.Visible = false;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// btnNBCCH // btnNBCCH
// //
this.btnNBCCH.Font = new System.Drawing.Font("Tahoma", 8F, System.Drawing.FontStyle.Regular); this.btnNBCCH.Font = new System.Drawing.Font("Tahoma", 8F, System.Drawing.FontStyle.Regular);
@ -321,20 +332,22 @@
this.btnNBCCH.Size = new System.Drawing.Size(100, 50); this.btnNBCCH.Size = new System.Drawing.Size(100, 50);
this.btnNBCCH.TabIndex = 43; this.btnNBCCH.TabIndex = 43;
this.btnNBCCH.Text = "内部参考号查询"; this.btnNBCCH.Text = "内部参考号查询";
this.btnNBCCH.Visible = false;
this.btnNBCCH.Click += new System.EventHandler(this.btnNBCCH_Click); this.btnNBCCH.Click += new System.EventHandler(this.btnNBCCH_Click);
// //
// btnVDA // btnVDA
// //
this.btnVDA.Location = new System.Drawing.Point(16, 24); this.btnVDA.Location = new System.Drawing.Point(127, 25);
this.btnVDA.Name = "btnVDA"; this.btnVDA.Name = "btnVDA";
this.btnVDA.Size = new System.Drawing.Size(100, 50); this.btnVDA.Size = new System.Drawing.Size(100, 50);
this.btnVDA.TabIndex = 43; this.btnVDA.TabIndex = 43;
this.btnVDA.Text = "装箱校验"; this.btnVDA.Text = "装箱校验";
this.btnVDA.Visible = false;
this.btnVDA.Click += new System.EventHandler(this.btnVDA_Click); this.btnVDA.Click += new System.EventHandler(this.btnVDA_Click);
// //
// btnShipBill // btnShipBill
// //
this.btnShipBill.Location = new System.Drawing.Point(127, 24); this.btnShipBill.Location = new System.Drawing.Point(16, 25);
this.btnShipBill.Name = "btnShipBill"; this.btnShipBill.Name = "btnShipBill";
this.btnShipBill.Size = new System.Drawing.Size(100, 50); this.btnShipBill.Size = new System.Drawing.Size(100, 50);
this.btnShipBill.TabIndex = 42; this.btnShipBill.TabIndex = 42;
@ -411,16 +424,6 @@
this.tabPage2.Size = new System.Drawing.Size(230, 187); this.tabPage2.Size = new System.Drawing.Size(230, 187);
this.tabPage2.Text = "设置"; this.tabPage2.Text = "设置";
// //
// button2
//
this.button2.Font = new System.Drawing.Font("Tahoma", 8F, System.Drawing.FontStyle.Regular);
this.button2.Location = new System.Drawing.Point(128, 104);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(100, 50);
this.button2.TabIndex = 43;
this.button2.Text = "VDA标签照核";
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// frmMain // frmMain
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);

BIN
Stone.WinForm/Stone.Common.Dlls/Stone.Entity.dll

Binary file not shown.

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;USER ID = sa;PASSWORD = Microsoft2008;INITIAL CATALOG = STD"/> <add key="LocalDB" value="DATA SOURCE = 127.0.0.1;USER ID = sa;PASSWORD = Microsoft2008;INITIAL CATALOG = STD_NA"/>
<add key="BarCodeDB" value=""/> <add key="BarCodeDB" value=""/>
</appSettings> </appSettings>
<connectionStrings/> <connectionStrings/>

70
Stone.WinForm/Stone.DataService/Stone.DataService.Biz/Bill/F_BillAsn.cs

@ -65,33 +65,37 @@ namespace Stone.DataService.Biz.Bill
if (dtVDA.Rows.Count == 0) if (dtVDA.Rows.Count == 0)
throw new Exception($"{AsnNumber} 在系统中不存在"); throw new Exception($"{AsnNumber} 在系统中不存在");
DataRow[] drs = dtVDA.Select($"[IsPackingVerification]=False"); // DataRow[] drs = dtVDA.Select($"[IsPackingVerification]=False");
if(drs.Length > 0) // if(drs.Length > 0)
{ // {
string msg = ""; // string msg = "";
foreach(DataRow dr in drs) // foreach(DataRow dr in drs)
{ // {
msg += dr["PackageNo"].ToString() + ","; // msg += dr["PackageNo"].ToString() + ",";
} // }
if(msg != "") // if(msg != "")
{ // {
throw new Exception($"未做装箱校验:{msg}"); // throw new Exception($"未做装箱校验:{msg}");
} // }
} // }
//
if (dtVDA.Select($"[IsShipingVerification]=False").Length == 0) // if (dtVDA.Select($"[IsShipingVerification]=False").Length == 0)
throw new Exception($"{AsnNumber} 已经完成发货校验"); // throw new Exception($"{AsnNumber} 已经完成发货校验");
foreach (DataRow drData in dsData.Tables[0].Rows) foreach (DataRow drData in dsData.Tables[0].Rows)
{ {
t_JIS_VDA.Edit( t_JIS_VDA.Edit(
$"[IsShipingVerification]=1", $"[IsPackingVerification]='{drData["IsPackingVerification"]}',[CheckQty] = {drData["CheckQty"]}",
$"[PackageNo]='{drData["PackageNo"]}'"); $"[PartNumber]='{drData["PartNumber"]}' and [AsnNumber] = '{drData["AsnNumber"]}'");
}
//装箱记录
foreach (DataRow drScan in dsData.Tables[1].Rows)
{
DataRow drNew = t_ShipingVerification.Table.NewRow(); DataRow drNew = t_ShipingVerification.Table.NewRow();
drNew["AsnNumber"] = drData["AsnNumber"].ToString(); drNew["AsnNumber"] = drScan["AsnNumber"].ToString();
drNew["PackageNo"] = drData["PackageNo"].ToString(); drNew["PackageNo"] = drScan["PackageNo"].ToString();
drNew["UserName"] = UserName; drNew["UserName"] = UserName;
t_ShipingVerification.Add(drNew); t_ShipingVerification.Add(drNew);
} }
@ -111,5 +115,31 @@ namespace Stone.DataService.Biz.Bill
} }
public DataSet GetVefiHis(Command cmd)
{
string AsnNumber = cmd.Pars[0];
string UserName = cmd.Pars[1];
Entity_t_ShipingVerification t_ShipingVerification = new Entity_t_ShipingVerification();
DataSet dsData = t_ShipingVerification.GetData(
$"AsnNumber,PackageNo,UserName",
$"[AsnNumber]='{AsnNumber}'",
$"[PackageNo] desc");
return dsData;
}
public DataSet GetASN(Command cmd)
{
string AsnNumber = cmd.Pars[0];
string UserName = cmd.Pars[1];
Entity_t_JIS_VDA t_JIS_VDA = new Entity_t_JIS_VDA();
DataSet dsData = t_JIS_VDA.GetData(
$"AsnNumber,PartNumber,Qty,CheckQty,IsPackingVerification",
$"[AsnNumber]='{AsnNumber}'",
$"[PackageNo] desc");
return dsData;
}
} }
} }

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

@ -84,7 +84,16 @@ namespace Stone.DataService.Biz
f_BillAsn = new F_BillAsn(); f_BillAsn = new F_BillAsn();
f_BillAsn.BillSubmit(cmd, dsData); f_BillAsn.BillSubmit(cmd, dsData);
return null; return null;
case "BILL_SUBMIT_WITHSCAN":
f_BillAsn = new F_BillAsn();
f_BillAsn.BillSubmit(cmd, dsData);
return null;
case "BILL_GET_VERIHIS":
f_BillAsn = new F_BillAsn();
return f_BillAsn.GetVefiHis(cmd);
case "BILL_GET_ASNBILL":
f_BillAsn = new F_BillAsn();
return f_BillAsn.GetASN(cmd);
#endregion #endregion
#region STDУÑé #region STDУÑé

27
Stone.WinForm/Stone.Entity/Entity_t_PartPO.cs

@ -0,0 +1,27 @@
using Gm_WMS.DataAccess.DataService;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Stone.Entity
{
public class Entity_t_PartPO : EntityBase
{
public static string TableNameNew = "t_PartPONumber";
public Entity_t_PartPO()
{
base.TableName = TableNameNew;
base.Init();
}
public Entity_t_PartPO(LocalDBService myDB)
{
base.db = myDB;
base.TableName = TableNameNew;
base.Init();
}
}
}

1
Stone.WinForm/Stone.Entity/Stone.Entity.csproj

@ -64,6 +64,7 @@
<Compile Include="EntityBase.cs" /> <Compile Include="EntityBase.cs" />
<Compile Include="Entity_t_ErrLog.cs" /> <Compile Include="Entity_t_ErrLog.cs" />
<Compile Include="Entity_t_ErrTypeLevel.cs" /> <Compile Include="Entity_t_ErrTypeLevel.cs" />
<Compile Include="Entity_t_PartPO.cs" />
<Compile Include="Entity_t_PartOutQty.cs" /> <Compile Include="Entity_t_PartOutQty.cs" />
<Compile Include="Entity_t_ShipingVerification.cs" /> <Compile Include="Entity_t_ShipingVerification.cs" />
<Compile Include="Entity_t_BillNo.cs" /> <Compile Include="Entity_t_BillNo.cs" />

7
Stone.WinForm/Stone.WinBiz/BasicData/F_Base.cs

@ -127,8 +127,11 @@ namespace Stone.WinBiz.BasicData
/// <param name="drData"></param> /// <param name="drData"></param>
public virtual void Checking(DataRow drData, bool isNew) public virtual void Checking(DataRow drData, bool isNew)
{ {
if (drData["Code"].ToString().Trim() == "") if (drData.Table.Columns.Contains("Code"))
throw new Exception("代码不能为空!"); {
if (drData["Code"].ToString().Trim() == "")
throw new Exception("代码不能为空!");
}
if (isNew) if (isNew)
{ {

70
Stone.WinForm/Stone.WinBiz/BasicData/F_PartPO.cs

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data;
using Stone.Entity;
using Gm_WMS.DataAccess.DataService;
using Stone.Common;
namespace Stone.WinBiz.BasicData
{
public class F_PartPO : F_Base
{
public F_PartPO()
{
this.type = "PartPO";
this.name = "基础资料_零件订单管理";
this.entity = new Entity_t_PartPO();
}
public override void GetView(DataGridView dgv)
{
base.GetView(dgv);
dgv.Columns["Code"].HeaderText = "存货代码";
dgv.Columns["PONumber"].HeaderText = "订单号";
dgv.Columns["IsCheck"].HeaderText = "发运校验";
dgv.Columns["PartType"].HeaderText = "零件类型";
}
public override void Checking(DataRow drData, bool isNew)
{
Entity_t_Product product = new Entity_t_Product();
if (product.GetData("", "Code='" + drData["Code"].ToString() + "'", "id asc").Tables[0].Rows.Count < 1)
{
//这NM的是个魔鬼~!
throw new Exception(drData["Code"].ToString()+"不存在");
}
base.Checking(drData, isNew);
}
public override void InputData(DataSet dsData, LocalDBService db)
{
Entity_t_PartPO t_Input = new Entity_t_PartPO(db);
DataRow drInput = null;
foreach (DataRow drData in dsData.Tables[0].Rows)
{
drInput = t_Input.Table.NewRow();
drInput["Code"] = drData["存货代码"].ToString().Trim();
drInput["PONumber"] = drData["订单号"].ToString().Trim();
drInput["IsCheck"] = drData["发运校验"].ToString().Trim();
drInput["PartType"] = drData["零件类型"].ToString().Trim();
if (drInput["Code"].ToString().Trim() == "")
throw new Exception("存货代码不能为空!");
if (t_Input.GetData("", "Code='" + drInput["Code"].ToString() + "'", "id asc").Tables[0].Rows.Count > 0)
throw new Exception("存货代码 " + drInput["Code"].ToString() + " 已经存在!");
t_Input.Add(drInput);
}
}
}
}

32
Stone.WinForm/Stone.WinBiz/JISAdmin/F_EDI_JIS5000Sequence.cs

@ -653,6 +653,9 @@ namespace Stone.WinBiz.JISAdmin
var alertMsg5 = ""; var alertMsg5 = "";
//零件ReleaseID 不连续 //零件ReleaseID 不连续
var alertMsg6 = ""; var alertMsg6 = "";
//零件号是否与PO绑定
var alertMsg7 = "";
status = "1"; status = "1";
//获取零件对应的版本号 add by jinh 20220419 //获取零件对应的版本号 add by jinh 20220419
@ -672,6 +675,7 @@ namespace Stone.WinBiz.JISAdmin
{ {
// partRelese.PartCode = sp_line[1].Split(':')[0]; // partRelese.PartCode = sp_line[1].Split(':')[0];
partRelese.PartCode = sp_line[3].Split(':')[0]; partRelese.PartCode = sp_line[3].Split(':')[0];
partCode = sp_line[3].Split(':')[0];
} }
//LAB调整 RFF+AAN:1747' ADI+00001509+220308 //LAB调整 RFF+AAN:1747' ADI+00001509+220308
// if (sp_line[0] == "ADI") // if (sp_line[0] == "ADI")
@ -695,6 +699,17 @@ namespace Stone.WinBiz.JISAdmin
lstPartRelease.Add(partRelese); lstPartRelease.Add(partRelese);
partRelese = new PartRelease(); partRelese = new PartRelease();
} }
if (sp_line[0] == "RFF" && sp_line[1].Substring(0, 2) == "ON")
{
orderNumber = sp_line[1].Split(':')[1];
//校验PO是否维护
if (string.IsNullOrEmpty(orderNumber))
{
strPartRelease += "零件号 " + partCode + " 未绑定PO!";
alertMsg7 += "零件号 " + partCode + " 未绑定PO!" + Environment.NewLine;
}
}
} }
//如果版本不连续,抛出异常,解析失败 考虑抛出在数据库中设置 //如果版本不连续,抛出异常,解析失败 考虑抛出在数据库中设置
if (alertMsg6.Trim() != "") if (alertMsg6.Trim() != "")
@ -712,6 +727,22 @@ namespace Stone.WinBiz.JISAdmin
} }
} }
//如果零件号未绑定PO,抛出异常,解析失败 考虑抛出在数据库中设置
if (alertMsg7.Trim() != "")
{
//通过前台配置ReleaseID不联系是否继续接续
var strsql = "select top 1 * from t_ErrTypeLevel where Code = '09' order by id desc";
var dsErrLevel = db.Exec_DataSet(strsql);
if (dsErrLevel.Tables[0].Rows.Count > 0)
{
var errLevel = dsErrLevel.Tables[0].Rows[0]["ErrLevel"].ToString();
if (errLevel == "0")
{
throw new Exception(strPartRelease);
}
}
}
foreach (string line_text in sp_text) foreach (string line_text in sp_text)
{ {
if (line_text.Trim() == "") continue; if (line_text.Trim() == "") continue;
@ -798,7 +829,6 @@ namespace Stone.WinBiz.JISAdmin
if (sp_line[0] == "RFF" && sp_line[1].Substring(0,2) == "ON") if (sp_line[0] == "RFF" && sp_line[1].Substring(0,2) == "ON")
{ {
orderNumber = sp_line[1].Split(':')[1]; orderNumber = sp_line[1].Split(':')[1];
//校验零件号是否失效 //校验零件号是否失效
var strsql = ""; var strsql = "";
strsql = "select top 1 * from t_Product where Code = '" + partNumber + "' order by id desc"; strsql = "select top 1 * from t_Product where Code = '" + partNumber + "' order by id desc";

9
Stone.WinForm/Stone.WinBiz/JISAdmin/F_JIS5000_Print.cs

@ -811,9 +811,9 @@ namespace Stone.WinBiz.JISAdmin
string text = GetASNTemp_Standard(); string text = GetASNTemp_Standard();
string LocationCode = dsData.Tables[0].Rows[0]["LocationCode"].ToString(); // string LocationCode = dsData.Tables[0].Rows[0]["LocationCode"].ToString();
if (LocationCode == "") // if (LocationCode == "")
throw new Exception("卸货点代码不能为空"); // throw new Exception("卸货点代码不能为空");
text = text.Replace("{DATE}", dtNow.ToString("yyMMdd")); text = text.Replace("{DATE}", dtNow.ToString("yyMMdd"));
text = text.Replace("{TIME}", dtNow.ToString("HHmm")); text = text.Replace("{TIME}", dtNow.ToString("HHmm"));
@ -825,7 +825,7 @@ namespace Stone.WinBiz.JISAdmin
text = text.Replace("{DATE2}", dtNow.ToString("yyMMdd:HHmm")); //发货时间 text = text.Replace("{DATE2}", dtNow.ToString("yyMMdd:HHmm")); //发货时间
text = text.Replace("{LINE}", dsData.Tables[0].Rows.Count.ToString()); text = text.Replace("{LINE}", dsData.Tables[0].Rows.Count.ToString());
text = text.Replace("{TOTAL}", dsData.Tables[0].Compute("SUM(Qty)", "1=1").ToString()); text = text.Replace("{TOTAL}", dsData.Tables[0].Compute("SUM(Qty)", "1=1").ToString());
text = text.Replace("{CUSTOMERCODE}", LocationCode); // text = text.Replace("{CUSTOMERCODE}", LocationCode);
string detail = ""; string detail = "";
foreach (DataRow drData in dsData.Tables[0].Rows) foreach (DataRow drData in dsData.Tables[0].Rows)
@ -856,6 +856,7 @@ namespace Stone.WinBiz.JISAdmin
#endregion #endregion
return lstName[1]; return lstName[1];
// return "";
} }
public static void WriteQAD_VDA(DataSet dsData, string AsnNumber) public static void WriteQAD_VDA(DataSet dsData, string AsnNumber)

18
Stone.WinForm/Stone.WinBiz/Standard/F_JIS_VDA_ASN.cs

@ -38,24 +38,24 @@ namespace Stone.WinBiz.Standard
dgv.Columns["fileType"].HeaderText = "工厂"; dgv.Columns["fileType"].HeaderText = "工厂";
dgv.Columns["AsnNumber"].HeaderText = "ASN编号"; dgv.Columns["AsnNumber"].HeaderText = "ASN编号";
dgv.Columns["PackageNo"].HeaderText = "装箱单号"; // dgv.Columns["PackageNo"].HeaderText = "装箱单号";
dgv.Columns["PartNumber"].HeaderText = "零件号"; dgv.Columns["PartNumber"].HeaderText = "零件号";
dgv.Columns["Description"].HeaderText = "零件描述"; dgv.Columns["Description"].HeaderText = "零件描述";
dgv.Columns["Date"].HeaderText = "需求日期"; dgv.Columns["Date"].HeaderText = "到货日期";
dgv.Columns["LabelDate"].HeaderText = "标签日期"; dgv.Columns["LabelDate"].HeaderText = "到货时间";
dgv.Columns["Qty"].HeaderText = "数量"; dgv.Columns["Qty"].HeaderText = "数量";
dgv.Columns["releaseId"].HeaderText = "版本号"; // dgv.Columns["releaseId"].HeaderText = "版本号";
dgv.Columns["location"].HeaderText = "卸货点"; // dgv.Columns["location"].HeaderText = "卸货点";
dgv.Columns["locationCode"].HeaderText = "卸货点代码"; dgv.Columns["locationCode"].HeaderText = "卸货点代码";
dgv.Columns["orderNumber"].HeaderText = "采购订单号"; dgv.Columns["orderNumber"].HeaderText = "采购订单号";
dgv.Columns["IsPrintLabel"].HeaderText = "打印标签"; // dgv.Columns["IsPrintLabel"].HeaderText = "打印标签";
dgv.Columns["IsPackingVerification"].HeaderText = "装箱校验"; dgv.Columns["IsPackingVerification"].HeaderText = "装箱校验";
dgv.Columns["IsPrintASN"].HeaderText = "打印ASN"; // dgv.Columns["IsPrintASN"].HeaderText = "打印ASN";
dgv.Columns["PrintASNTime"].HeaderText = "ASN打印时间"; // dgv.Columns["PrintASNTime"].HeaderText = "ASN打印时间";
dgv.Columns["IsShipingVerification"].HeaderText = "发货校验"; dgv.Columns["IsShipingVerification"].HeaderText = "发货校验";
dgv.Columns["IsUpload"].HeaderText = "是否上传"; dgv.Columns["IsUpload"].HeaderText = "是否上传";
dgv.Columns["UploadTime"].HeaderText = "上传时间"; dgv.Columns["UploadTime"].HeaderText = "发货时间";

2
Stone.WinForm/Stone.WinBiz/Stone.WinBiz.csproj

@ -83,6 +83,8 @@
<Compile Include="BasicData\F_ErrLog.cs" /> <Compile Include="BasicData\F_ErrLog.cs" />
<Compile Include="BasicData\F_JIS_Limits_List.cs" /> <Compile Include="BasicData\F_JIS_Limits_List.cs" />
<Compile Include="BasicData\F_ErrTypeLevel.cs" /> <Compile Include="BasicData\F_ErrTypeLevel.cs" />
<Compile Include="BasicData\F_BillNO.cs" />
<Compile Include="BasicData\F_PartPO.cs" />
<Compile Include="BasicData\F_PartOutQty.cs" /> <Compile Include="BasicData\F_PartOutQty.cs" />
<Compile Include="BasicData\F_Product.cs" /> <Compile Include="BasicData\F_Product.cs" />
<Compile Include="BasicData\F_User.cs" /> <Compile Include="BasicData\F_User.cs" />

10
Stone.WinForm/Stone.WinForm/frmMain.cs

@ -177,12 +177,20 @@ namespace Stone.WinForm
if (e.Node.Text == "ASN单流水管理") if (e.Node.Text == "ASN单流水管理")
{ {
Stone.WinModule.BasicData.frmASNManager frm = new WinModule.BasicData.frmASNManager(); Stone.WinModule.BasicData.frmBillNO frm = new WinModule.BasicData.frmBillNO();
frm.m_Base = new WinBiz.BasicData.F_BillNO();
frm.Text = "ASN单流水管理"; frm.Text = "ASN单流水管理";
ShowWindow(frm); ShowWindow(frm);
} }
if (e.Node.Text == "零件订单管理")
{
Stone.WinModule.BasicData.frmPartPO frm = new WinModule.BasicData.frmPartPO();
frm.m_Base = new WinBiz.BasicData.F_PartPO();
frm.init();
ShowWindow(frm);
}
#endregion #endregion

12
Stone.WinForm/Stone.WinModule/BasicData/F_Factory.cs

@ -103,7 +103,19 @@ namespace Stone.WinModule.BasicData
return frm; return frm;
} }
if (f_base.type == "PartPO")
{
frmPartPODetail frm = new frmPartPODetail();
frm.m_Base = f_base;
return frm;
}
if (f_base.type == "BillNO")
{
frmBillNODetail frm = new frmBillNODetail();
frm.m_Base = f_base;
return frm;
}
return null; return null;
} }
} }

36
Stone.WinForm/Stone.WinModule/BasicData/frmPartPO.Designer.cs

@ -0,0 +1,36 @@
namespace Stone.WinModule.BasicData
{
partial class frmPartPO
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
}
#endregion
}
}

26
Stone.WinForm/Stone.WinModule/BasicData/frmPartPO.cs

@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace Stone.WinModule.BasicData
{
public partial class frmPartPO : Stone.WinModule.BasicData.frmBaseMain
{
public frmPartPO()
{
InitializeComponent();
}
public override void Search(string code)
{
base.Search(code);
strWhere += " or [Code] like '%" + code + "%'";
}
}
}

163
Stone.WinForm/Stone.WinModule/BasicData/frmPartPODetail.Designer.cs

@ -0,0 +1,163 @@
namespace Stone.WinModule.BasicData
{
partial class frmPartPODetail
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.tbPONumber = new System.Windows.Forms.TextBox();
this.txtCode = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.colorDialog1 = new System.Windows.Forms.ColorDialog();
this.txtIsCheck = new System.Windows.Forms.CheckBox();
this.tbPartType = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// btnAddNewLine
//
this.btnAddNewLine.Location = new System.Drawing.Point(62, 255);
this.btnAddNewLine.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
//
// btnClose
//
this.btnClose.Location = new System.Drawing.Point(381, 255);
this.btnClose.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
//
// btnOK
//
this.btnOK.Location = new System.Drawing.Point(249, 255);
this.btnOK.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
//
// tbPONumber
//
this.tbPONumber.Location = new System.Drawing.Point(170, 106);
this.tbPONumber.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.tbPONumber.MaxLength = 100;
this.tbPONumber.Name = "tbPONumber";
this.tbPONumber.Size = new System.Drawing.Size(331, 28);
this.tbPONumber.TabIndex = 1;
//
// txtCode
//
this.txtCode.Location = new System.Drawing.Point(170, 60);
this.txtCode.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.txtCode.MaxLength = 10;
this.txtCode.Name = "txtCode";
this.txtCode.Size = new System.Drawing.Size(331, 28);
this.txtCode.TabIndex = 0;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(34, 111);
this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(80, 18);
this.label2.TabIndex = 109;
this.label2.Text = "订单号:";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(34, 66);
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(80, 18);
this.label1.TabIndex = 108;
this.label1.Text = "物料号:";
//
// txtIsCheck
//
this.txtIsCheck.AutoSize = true;
this.txtIsCheck.Location = new System.Drawing.Point(381, 221);
this.txtIsCheck.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.txtIsCheck.Name = "txtIsCheck";
this.txtIsCheck.Size = new System.Drawing.Size(142, 22);
this.txtIsCheck.TabIndex = 110;
this.txtIsCheck.Text = "是否发运校验";
this.txtIsCheck.UseVisualStyleBackColor = true;
//
// tbPartType
//
this.tbPartType.Location = new System.Drawing.Point(170, 156);
this.tbPartType.Margin = new System.Windows.Forms.Padding(4);
this.tbPartType.MaxLength = 100;
this.tbPartType.Name = "tbPartType";
this.tbPartType.Size = new System.Drawing.Size(331, 28);
this.tbPartType.TabIndex = 111;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(34, 161);
this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(98, 18);
this.label3.TabIndex = 112;
this.label3.Text = "零件类型:";
//
// frmPartPODetail
//
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
this.ClientSize = new System.Drawing.Size(572, 323);
this.Controls.Add(this.tbPartType);
this.Controls.Add(this.label3);
this.Controls.Add(this.txtIsCheck);
this.Controls.Add(this.tbPONumber);
this.Controls.Add(this.txtCode);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
this.Name = "frmPartPODetail";
this.Load += new System.EventHandler(this.frmColorDetail_Load);
this.Controls.SetChildIndex(this.btnOK, 0);
this.Controls.SetChildIndex(this.btnClose, 0);
this.Controls.SetChildIndex(this.btnAddNewLine, 0);
this.Controls.SetChildIndex(this.label1, 0);
this.Controls.SetChildIndex(this.label2, 0);
this.Controls.SetChildIndex(this.txtCode, 0);
this.Controls.SetChildIndex(this.tbPONumber, 0);
this.Controls.SetChildIndex(this.txtIsCheck, 0);
this.Controls.SetChildIndex(this.label3, 0);
this.Controls.SetChildIndex(this.tbPartType, 0);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox tbPONumber;
private System.Windows.Forms.TextBox txtCode;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.ColorDialog colorDialog1;
private System.Windows.Forms.CheckBox txtIsCheck;
private System.Windows.Forms.TextBox tbPartType;
private System.Windows.Forms.Label label3;
}
}

65
Stone.WinForm/Stone.WinModule/BasicData/frmPartPODetail.cs

@ -0,0 +1,65 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Stone.Common;
namespace Stone.WinModule.BasicData
{
public partial class frmPartPODetail : Stone.WinModule.BasicData.frmBaseMainDetail
{
public frmPartPODetail()
{
InitializeComponent();
}
private void frmColorDetail_Load(object sender, EventArgs e)
{
}
public override bool GetData()
{
if (!MyValidator.IsEmpty(this.txtCode, "")) return false;
if (!MyValidator.IsEmpty(this.tbPONumber, "")) return false;
base.GetData();
drData["Code"] = MyStrings.GetString(this.txtCode.Text.Trim());
drData["PONumber"] = MyStrings.GetString(this.tbPONumber.Text.Trim());
drData["PartType"] = MyStrings.GetString(this.tbPartType.Text.Trim());
drData["IsCheck"] = this.txtIsCheck.Checked ? true : false;
return true;
}
public override bool SetData()
{
if (type == 2)
{
this.txtCode.ReadOnly = true;
}
if (base.SetData())
{
this.txtCode.Text = drData["Code"].ToString();
this.tbPONumber.Text = drData["PONumber"].ToString();
this.tbPartType.Text = drData["PartType"].ToString();
this.txtIsCheck.Checked = Convert.ToBoolean(drData["IsCheck"]);
}
return false;
}
public override void Clear()
{
base.Clear();
this.txtCode.Text = "";
this.tbPONumber.Text = "";
this.tbPartType.Text = "";
this.txtCode.Focus();
txtIsCheck.Checked = true;
}
}
}

123
Stone.WinForm/Stone.WinModule/BasicData/frmPartPODetail.resx

@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="colorDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

92
Stone.WinForm/Stone.WinModule/Standard/frmASNScan.Designer.cs

@ -0,0 +1,92 @@
namespace Stone.WinModule.Standard
{
partial class frmASNScan
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.lblName = new System.Windows.Forms.Label();
this.txtAsnNumber = new System.Windows.Forms.TextBox();
this.btnClose = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// lblName
//
this.lblName.AutoSize = true;
this.lblName.Location = new System.Drawing.Point(21, 20);
this.lblName.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
this.lblName.Name = "lblName";
this.lblName.Size = new System.Drawing.Size(69, 27);
this.lblName.TabIndex = 0;
this.lblName.Text = "label1";
//
// txtAsnNumber
//
this.txtAsnNumber.Location = new System.Drawing.Point(26, 63);
this.txtAsnNumber.Margin = new System.Windows.Forms.Padding(6, 7, 6, 7);
this.txtAsnNumber.Name = "txtAsnNumber";
this.txtAsnNumber.Size = new System.Drawing.Size(350, 34);
this.txtAsnNumber.TabIndex = 1;
this.txtAsnNumber.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtPassword_KeyDown);
//
// btnClose
//
this.btnClose.Location = new System.Drawing.Point(109, 111);
this.btnClose.Margin = new System.Windows.Forms.Padding(6, 7, 6, 7);
this.btnClose.Name = "btnClose";
this.btnClose.Size = new System.Drawing.Size(150, 51);
this.btnClose.TabIndex = 3;
this.btnClose.Text = "退出";
this.btnClose.UseVisualStyleBackColor = true;
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
//
// frmASNScan
//
this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 27F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(407, 192);
this.Controls.Add(this.btnClose);
this.Controls.Add(this.txtAsnNumber);
this.Controls.Add(this.lblName);
this.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow;
this.Margin = new System.Windows.Forms.Padding(6, 7, 6, 7);
this.Name = "frmASNScan";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "ASN发运扫描";
this.Load += new System.EventHandler(this.frmPasswordVerify_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
public System.Windows.Forms.Label lblName;
private System.Windows.Forms.TextBox txtAsnNumber;
private System.Windows.Forms.Button btnClose;
}
}

93
Stone.WinForm/Stone.WinModule/Standard/frmASNScan.cs

@ -0,0 +1,93 @@
using Stone.Common;
using Stone.Entity;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Stone.WinModule.Standard
{
public partial class frmASNScan : Form
{
public frmASNScan()
{
InitializeComponent();
}
private void frmPasswordVerify_Load(object sender, EventArgs e)
{
this.lblName.Text = $"请扫描ASN号进行发运";
}
private void txtPassword_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
try
{
string asnNumber = this.txtAsnNumber.Text.Trim();
Entity_t_JIS_VDA t_jis_vda = new Entity_t_JIS_VDA();
DataSet dsAsn = t_jis_vda.GetData("", "[AsnNumber]='" + asnNumber + "'", "ID asc");
if (dsAsn.Tables[0].Rows.Count == 0) throw new Exception("扫描的ASN无效!");
var dtAsn = dsAsn.Tables[0];
if (dtAsn.Select("[IsShipingVerification]=0").Length > 0)
{
//取未校验的
var needCheck = dtAsn.Select("IsPackingVerification = 0");
//允许设置零件号不进行校验,判断未校验的零件是否在清单中
Entity_t_PartPO t_partpo = new Entity_t_PartPO();
DataSet dsPartPO = t_partpo.GetData("", "1 = 1", "ID asc");
if (dsPartPO.Tables[0].Rows.Count == 0)
{
throw new Exception("ASN中有未进行装箱校验的明细,禁止操作发货!");
}
var dtpartPO = dsPartPO.Tables[0];
foreach (var row in needCheck)
{
var partCode = row["PartNumber"].ToString();
var partRow = dtpartPO.Select("Code = '" + partCode + "'");
if (partRow.Length != 1)
{
throw new Exception("系统未定义唯一的零件号 " + partCode + " !");
}
else
{
if (bool.Parse(partRow[0]["IsCheck"].ToString()))
{
throw new Exception("零件号 " + partCode + " 未通过装箱校验,禁止操作发货!");
}
}
}
}
else
{
throw new Exception("扫描的ASN已发运!");
}
//保存数据
var db = new Gm_WMS.DataAccess.DataService.LocalDBService();
db.BeginTrans();
Entity_v_JIS_VDA t_JIS_VDA = new Entity_v_JIS_VDA(db);
t_JIS_VDA.Edit($"UpLoadTime='" + DateTime.Now + "',IsShipingVerification = 1", $"[AsnNumber]='{asnNumber}'");
db.Commit();
this.DialogResult = DialogResult.OK;
this.Close();
}
catch (Exception ex)
{
MyMessageBox.ShowErrorMessage(ex.Message);
}
}
}
private void btnClose_Click(object sender, EventArgs e)
{
this.Close();
}
}
}

120
Stone.WinForm/Stone.WinModule/Standard/frmASNScan.resx

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

7
Stone.WinForm/Stone.WinModule/Standard/frmJISVDAASN.Designer.cs

@ -34,6 +34,7 @@
this.dateTimePicker1 = new System.Windows.Forms.DateTimePicker(); this.dateTimePicker1 = new System.Windows.Forms.DateTimePicker();
this.chkUpload = new System.Windows.Forms.CheckBox(); this.chkUpload = new System.Windows.Forms.CheckBox();
this.imageList1 = new System.Windows.Forms.ImageList(this.components); this.imageList1 = new System.Windows.Forms.ImageList(this.components);
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
this.SuspendLayout(); this.SuspendLayout();
// //
// btnSerach // btnSerach
@ -86,6 +87,11 @@
this.imageList1.Images.SetKeyName(3, "(25,41).png"); this.imageList1.Images.SetKeyName(3, "(25,41).png");
this.imageList1.Images.SetKeyName(4, "redo.png"); this.imageList1.Images.SetKeyName(4, "redo.png");
// //
// openFileDialog1
//
this.openFileDialog1.Filter = "Excel2007文件(*.xlsx)|*.xlsx|Excel2003文件(*.xls)|*.xls";
this.openFileDialog1.Title = "选择要导入的文件";
//
// frmJISVDAASN // frmJISVDAASN
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@ -112,5 +118,6 @@
private System.Windows.Forms.DateTimePicker dateTimePicker1; private System.Windows.Forms.DateTimePicker dateTimePicker1;
private System.Windows.Forms.CheckBox chkUpload; private System.Windows.Forms.CheckBox chkUpload;
private System.Windows.Forms.ImageList imageList1; private System.Windows.Forms.ImageList imageList1;
private System.Windows.Forms.OpenFileDialog openFileDialog1;
} }
} }

498
Stone.WinForm/Stone.WinModule/Standard/frmJISVDAASN.cs

@ -2,7 +2,9 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.Data; using System.Data;
using System.Data.OleDb;
using System.Drawing; using System.Drawing;
using System.Linq;
using System.Text; using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
using Stone.Common; using Stone.Common;
@ -94,42 +96,54 @@ namespace Stone.WinModule.Standard
btnUpload.Click += BtnUpload_Click; btnUpload.Click += BtnUpload_Click;
this.toolStrip1.Items.Insert(0, btnUpload); this.toolStrip1.Items.Insert(0, btnUpload);
ToolStripButton btnPrintRe = new ToolStripButton("补打ASN"); // ToolStripButton btnPrintRe = new ToolStripButton("补打ASN");
btnPrintRe.Image = this.imageList1.Images[0]; // btnPrintRe.Image = this.imageList1.Images[0];
btnPrintRe.TextImageRelation = TextImageRelation.ImageAboveText; // btnPrintRe.TextImageRelation = TextImageRelation.ImageAboveText;
btnPrintRe.Click += new EventHandler(btnPrintRe_Click); // btnPrintRe.Click += new EventHandler(btnPrintRe_Click);
this.toolStrip1.Items.Insert(0, btnPrintRe); // this.toolStrip1.Items.Insert(0, btnPrintRe);
//
ToolStripButton btnPrint = new ToolStripButton("打印ASN"); // ToolStripButton btnPrint = new ToolStripButton("打印ASN");
btnPrint.Image = this.imageList1.Images[0]; // btnPrint.Image = this.imageList1.Images[0];
btnPrint.TextImageRelation = TextImageRelation.ImageAboveText; // btnPrint.TextImageRelation = TextImageRelation.ImageAboveText;
btnPrint.Click += new EventHandler(btnPrint_Click); // btnPrint.Click += new EventHandler(btnPrint_Click);
this.toolStrip1.Items.Insert(0, btnPrint); // this.toolStrip1.Items.Insert(0, btnPrint);
ToolStripButton btnPrintVDARight = new ToolStripButton("补打02标签"); // ToolStripButton btnPrintVDARight = new ToolStripButton("补打02标签");
btnPrintVDARight.Image = this.imageList1.Images[0]; // btnPrintVDARight.Image = this.imageList1.Images[0];
btnPrintVDARight.TextImageRelation = TextImageRelation.ImageAboveText; // btnPrintVDARight.TextImageRelation = TextImageRelation.ImageAboveText;
btnPrintVDARight.Click += new EventHandler(btnPrintVDARight_Click); // btnPrintVDARight.Click += new EventHandler(btnPrintVDARight_Click);
this.toolStrip1.Items.Insert(0, btnPrintVDARight); // this.toolStrip1.Items.Insert(0, btnPrintVDARight);
//
ToolStripButton btnPrintVDA = new ToolStripButton("补打01标签"); // ToolStripButton btnPrintVDA = new ToolStripButton("补打01标签");
btnPrintVDA.Image = this.imageList1.Images[0]; // btnPrintVDA.Image = this.imageList1.Images[0];
btnPrintVDA.TextImageRelation = TextImageRelation.ImageAboveText; // btnPrintVDA.TextImageRelation = TextImageRelation.ImageAboveText;
btnPrintVDA.Click += new EventHandler(btnPrintVDA_Click); // btnPrintVDA.Click += new EventHandler(btnPrintVDA_Click);
this.toolStrip1.Items.Insert(0, btnPrintVDA); // this.toolStrip1.Items.Insert(0, btnPrintVDA);
ToolStripButton btnPrintLabel = new ToolStripButton("打印VDA标签"); // ToolStripButton btnPrintLabel = new ToolStripButton("打印VDA标签");
btnPrintLabel.Image = this.imageList1.Images[0]; // btnPrintLabel.Image = this.imageList1.Images[0];
btnPrintLabel.TextImageRelation = TextImageRelation.ImageAboveText; // btnPrintLabel.TextImageRelation = TextImageRelation.ImageAboveText;
btnPrintLabel.Click += btnPrintLabel_Click; // btnPrintLabel.Click += btnPrintLabel_Click;
this.toolStrip1.Items.Insert(0, btnPrintLabel); // this.toolStrip1.Items.Insert(0, btnPrintLabel);
ToolStripButton btnPREDN = new ToolStripButton("PRE-DN生成"); ToolStripButton btnCreateASN = new ToolStripButton("ASN单号创建");
btnCreateASN.Image = this.imageList1.Images[3];
btnCreateASN.TextImageRelation = TextImageRelation.ImageAboveText;
btnCreateASN.Click += btnCreateASN_Click;
this.toolStrip1.Items.Insert(0, btnCreateASN);
ToolStripButton btnPREDN = new ToolStripButton("ASN发运");
btnPREDN.Image = this.imageList1.Images[1]; btnPREDN.Image = this.imageList1.Images[1];
btnPREDN.TextImageRelation = TextImageRelation.ImageAboveText; btnPREDN.TextImageRelation = TextImageRelation.ImageAboveText;
btnPREDN.Click += btnPREDN_Click; btnPREDN.Click += btnPREDN_Click;
this.toolStrip1.Items.Insert(0, btnPREDN); this.toolStrip1.Items.Insert(0, btnPREDN);
ToolStripButton btnImportDP = new ToolStripButton("拉动导入");
btnImportDP.Image = this.imageList1.Images[1];
btnImportDP.TextImageRelation = TextImageRelation.ImageAboveText;
btnImportDP.Click += btnImportDP_Click;
this.toolStrip1.Items.Insert(0, btnImportDP);
} }
@ -160,7 +174,14 @@ namespace Stone.WinModule.Standard
if (dsData.Tables[0].Select("[IsUpload]<>True").Length > 0) if (dsData.Tables[0].Select("[IsUpload]<>True").Length > 0)
throw new Exception(AsnNumber + " 未上传,不能补传"); throw new Exception(AsnNumber + " 未上传,不能补传");
string filename = F_JIS5000_Print.WriteASN_VDA(new LocalDBService(), dsData, AsnNumber); // string filename = F_JIS5000_Print.WriteASN_VDA(new LocalDBService(), dsData, AsnNumber);
string filename = AsnNumber;
var db = new LocalDBService();
#region 增加待生成报文数据 金杯李尔不使用FTP服务器 由服务器监听程序进行报文生成
var strsql = "";
strsql = "Insert into t_ASN_UPLOAD (AsnNum) values ('" + AsnNumber + "')";
db.Exec_NonQuery(strsql);
#endregion
F_JIS_Log.WriteLogsEnd(LogID, true, filename); F_JIS_Log.WriteLogsEnd(LogID, true, filename);
@ -189,7 +210,7 @@ namespace Stone.WinModule.Standard
if (!MyMessageBox.ShowQuestion($"是否要上传 {AsnNumber} ?")) return; if (!MyMessageBox.ShowQuestion($"是否要上传 {AsnNumber} ?")) return;
if (!CheckASN(AsnNumber)) return; // if (!CheckASN(AsnNumber)) return;
LogID = F_JIS_Log.WriteLogsStart($"上传ASN {AsnNumber}"); LogID = F_JIS_Log.WriteLogsStart($"上传ASN {AsnNumber}");
@ -206,14 +227,14 @@ namespace Stone.WinModule.Standard
if (dsData.Tables[0].Select("[IsUpload]=True").Length > 0) if (dsData.Tables[0].Select("[IsUpload]=True").Length > 0)
throw new Exception(AsnNumber + " 已经上传"); throw new Exception(AsnNumber + " 已经上传");
if (dsData.Tables[0].Select("[IsPrintASN]=False").Length > 0) // if (dsData.Tables[0].Select("[IsPrintASN]=False").Length > 0)
throw new Exception(AsnNumber + " 未打印"); // throw new Exception(AsnNumber + " 未打印");
if (dsData.Tables[0].Select("[IsPackingVerification]=False").Length > 0) if (dsData.Tables[0].Select("[IsPackingVerification]=False").Length > 0)
throw new Exception(AsnNumber + " 未完成装箱校验"); throw new Exception(AsnNumber + " 未完成装箱校验");
if (dsData.Tables[0].Select("[IsShipingVerification]=False").Length > 0) if (dsData.Tables[0].Select("[IsShipingVerification]=False").Length > 0)
throw new Exception(AsnNumber + " 未完成装车校验"); throw new Exception(AsnNumber + " 未完成发运操作");
DateTime UploadTime = t_JIS_VDA.GetDateTime(); DateTime UploadTime = t_JIS_VDA.GetDateTime();
@ -227,10 +248,16 @@ namespace Stone.WinModule.Standard
$"[AsnNumber]='{AsnNumber}'"); $"[AsnNumber]='{AsnNumber}'");
string filename = F_JIS5000_Print.WriteASN_VDA(db, dsData, AsnNumber); // string filename = F_JIS5000_Print.WriteASN_VDA(db, dsData, AsnNumber);
string filename = AsnNumber;
#region 增加待生成报文数据 金杯李尔不使用FTP服务器 由服务器监听程序进行报文生成
var strsql = "";
strsql = "Insert into t_ASN_UPLOAD (AsnNum) values ('" + AsnNumber + "')";
db.Exec_NonQuery(strsql);
#endregion
#region 计算累计发货数量 #region 计算累计发货数量
var strsql = ""; strsql = "";
var dtPartOutQty = new DataTable(); var dtPartOutQty = new DataTable();
strsql = "select * from t_PartOutQty"; strsql = "select * from t_PartOutQty";
dtPartOutQty = db.Exec_DataSet(strsql).Tables[0]; dtPartOutQty = db.Exec_DataSet(strsql).Tables[0];
@ -444,38 +471,49 @@ namespace Stone.WinModule.Standard
{ {
try try
{ {
if (this.dgrdView.SelectedRows.Count == 0) var frmAsnScan = new frmASNScan();
throw new Exception("请选择要生成的ASN"); frmAsnScan.ShowDialog();
frmAsnScan.Dispose();
if(frmAsnScan.DialogResult != DialogResult.OK) return;
Search("");
btnSerach_Click(sender,null);
}
catch (Exception ex)
{
MyMessageBox.ShowErrorMessage(ex.Message);
}
}
private void btnCreateASN_Click(object sender, EventArgs e)
{
try
{
if (this.dgrdView.SelectedRows.Count == 0) throw new Exception("请选择要打印标签的ASN");
string AsnNumber = this.dgrdView.SelectedRows[0].Cells["AsnNumber"].Value.ToString(); string AsnNumber = this.dgrdView.SelectedRows[0].Cells["AsnNumber"].Value.ToString();
if (!string.IsNullOrEmpty(AsnNumber))
{
if (!MyMessageBox.ShowQuestion($"【{AsnNumber}】已创建,是否要重新生成?")) return;
}
string LabelDate = this.dgrdView.SelectedRows[0].Cells["LabelDate"].Value.ToString();
if (!CheckASN(AsnNumber)) return; //对ASN进行赋值
Entity_t_JIS_VDA t_jis_vda = new Entity_t_JIS_VDA();
var strsql = $"select distinct PartType from t_PartPONumber where Code in (select PartNumber from t_JIS_VDA where LabelDate = '{LabelDate}')";
var db = new LocalDBService();
var dsPartType = db.Exec_DataSet(strsql);
Entity_v_JIS_VDA v_JIS_VDA = new Entity_v_JIS_VDA(); for (int i = 0; i < dsPartType.Tables[0].Rows.Count; i++)
DataTable dtData = v_JIS_VDA.GetData("", $"[AsnNumber]='{AsnNumber}'", "[PackageNo] asc").Tables[0]; {
if (dtData.Rows.Count == 0) throw new Exception("打印的数据不存在"); //背板是SJB00001和侧翼是SJC00002
var partType = dsPartType.Tables[0].Rows[i]["PartType"].ToString();
if (dtData.Rows[0]["IsPrintASN"].ToString() == "1") var asnNum = GetVDA_AsnLiushui(db, partType, 5);
throw new Exception($"{AsnNumber}已经完成,不能生成PREDN"); t_jis_vda.Edit(
$"[AsnNumber]='{asnNum}'",
var frmPickUpDate = new frmPickUpDate(); $"LabelDate = '{LabelDate}' and [PartNumber] in (select Code from t_PartPONumber where PartType = '{partType}')");
frmPickUpDate.dtSwetDate = Convert.ToDateTime(dtData.Rows[0]["Date"]).Date; }
frmPickUpDate.ShowDialog();
frmPickUpDate.Dispose(); Search("");
if(frmPickUpDate.DialogResult != DialogResult.OK) return; btnSerach_Click(sender, null);
frmPREDN frm = new frmPREDN();
frm.dtPickUpTime = frmPickUpDate.dtPickUp;
frm.dtData = dtData;
frm.ShowDialog();
frm.Dispose();
//更新需求日期 todo
var db = new Gm_WMS.DataAccess.DataService.LocalDBService();
db.BeginTrans();
Entity_v_JIS_VDA t_JIS_VDA = new Entity_v_JIS_VDA(db);
t_JIS_VDA.Edit($"[Date]='" + frmPickUpDate.dtPickUp + "'", $"[AsnNumber]='{AsnNumber}'");
db.Commit();
Search(AsnNumber);
btnSerach_Click(sender,null);
} }
catch (Exception ex) catch (Exception ex)
{ {
@ -845,5 +883,333 @@ namespace Stone.WinModule.Standard
return strsql; return strsql;
} }
private void btnImportDP_Click(object sender, EventArgs e)
{
try
{
if (this.openFileDialog1.ShowDialog() == DialogResult.OK)
{
Input(this.openFileDialog1.FileName);
UpdateGridView();
MyMessageBox.ShowInfoMessage("数据导入成功!");
}
}
catch (Exception ex)
{
MyMessageBox.ShowInfoMessage(ex.Message);
}
}
private void Input(string filename)
{
DataSet dsInput = null;
MyExcelDatabase.OpenDatabase(filename, true);
var sheetName = GetSheetName(filename);
dsInput = MyOleDbDatabase.ExecuteDataSet("select * from ["+sheetName+"]");
MyOleDbDatabase.CloseDatabase();
LocalDBService db = null;
try
{
db = new LocalDBService();
db.BeginTrans();
InputData(dsInput, db);
db.Commit();
}
catch (Exception ex)
{
if (db != null) db.Rollback();
throw new Exception("导入数据失败!\r\n" + "原因为:\r\n" + ex.Message);
}
finally
{
if (db != null) db.EndTrans();
}
Stone.WinBiz.BasicData.F_Log.WriteLog("导入Excel[" + filename + "]");
}
private string GetSheetName(string filename)
{
string HDR = "HDR=YES;"; ;
var m_oleconn = new OleDbConnection();
if (filename.ToLower().Substring(filename.Length - 3) == "xls") //excel 2003格式
{
m_oleconn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + filename + ";Extended Properties='Excel 8.0;" + HDR + "'");
}
else //excel 2007 格式
{
m_oleconn = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + filename + ";Extended Properties='Excel 12.0 Xml;" + HDR + "'");
}
m_oleconn.Open();
var m_olecmd = m_oleconn.CreateCommand();
DataTable dtSheetName = m_oleconn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, new object[] { null, null, null, "TABLE" });
string[] strTableNames = new string[dtSheetName.Rows.Count];
for (int k = 0; k < dtSheetName.Rows.Count; k++)
{
strTableNames[k] = dtSheetName.Rows[k]["TABLE_NAME"].ToString();
}
// 选择第一个sheet进行操作
string sheetName = strTableNames[0];
return sheetName;
}
public void InputData(DataSet dsData, LocalDBService db)
{
Entity_t_JIS_VDA t_Input = new Entity_t_JIS_VDA(db);
DataRow drInput = null;
//第四行开始读日期,第五行是到货时间,第六行车型不要,第七行读零件和数量
int readDPDateRow = 4;
//第7行是ASN
int readASNRowIndex = 7;
//导入的列数
var coloumnCount = dsData.Tables[0].Columns.Count;
//零件号所在的行 从0开始
var partRowIndex = 7;
//零件号所在的列数 从0 开始
var partIndex = 2;
//校验零件号是否有订单信息
var dtPartPo = new DataTable();
var strCheckPO = CheckPartPO(dsData.Tables[0], partRowIndex, partIndex,out dtPartPo);
if (strCheckPO != "OK")
{
throw new Exception("导入数据失败!\r\n" + "原因为:\r\n" + strCheckPO);
}
//删掉已导入的ASN
DelDPDateHis(dsData.Tables[0]);
//获取零件订单基础数据
var lstPartType = new List<string>();
for (int i = 0; i < dsData.Tables[0].Rows.Count; i++)
{
if (i == readDPDateRow-1)
{
var drDate = dsData.Tables[0].Rows[i];
for (int n = 0; n < coloumnCount; n++)
{
//第六列开始是时间
if (n >= 5)
{
var date = drDate[n].ToString();
if (string.IsNullOrEmpty(date))
{
continue;
}
date = GetDateTimeStyle4(date, MyDateTimeType.Date);
//校验是否是日期,如果是日期,循环读入天的需求
if (DateTime.TryParse(date, out DateTime dt))
{
var asnNum = dsData.Tables[0].Rows[readASNRowIndex-1][n].ToString();
//todo 校验ASN的规则 规则待定
var DPTime = dsData.Tables[0].Rows[i + 1][n].ToString();
//得到了发货日期 和 发货时间
//开始循坏要货明细
for (int nPart = i + 4; nPart < dsData.Tables[0].Rows.Count-1; nPart++)
{
//如果有数量 则填加
var dr = dsData.Tables[0].Rows[nPart];
var qty = dr[n].ToString();
if (int.TryParse(qty, out int planQty))
{
if (planQty > 0)
{
drInput = t_Input.Table.NewRow();
drInput["fileType"] = "SY88";
drInput["LabelDate"] = dt.ToString("yyyy-MM-dd") + " " + DPTime + ":00";
drInput["Date"] = dt;
drInput["AsnNumber"] = "";
drInput["PartNumber"] = dr[partIndex];
drInput["Qty"] = planQty;
//todo 从基础数据表获取PO
var partPO = dtPartPo.Select("Code = '" + dr[partIndex] + "'");
drInput["orderNumber"] = partPO[0]["PONumber"].ToString();
drInput["CheckQty"] = 0;
//是否完成装箱校验
drInput["IsPackingVerification"] = 0;
//是否发运
drInput["IsShipingVerification"] = 0;
//是否生成ASN
drInput["IsPrintASN"] = 0;
//是否上传ASN
drInput["IsUpload"] = 0;
t_Input.Add(drInput);
//添加零件类型
var partType = partPO[0]["PartType"].ToString();
if (!lstPartType.Contains(partType))
{
lstPartType.Add(partType);
}
}
}
}
}
}
}
}
}
}
private string GetVDA_AsnLiushui(LocalDBService db, string type, int len)
{
string value = db.Exec_Object("exec p_GetBillNo 'ASN流水号_"+type+ "'").ToString();
return type + MyStrings.PadLeftString(value, '0', len);
}
public static string GetDateTimeStyle4(string sDateTime, MyDateTimeType dType)
{
if (sDateTime.Length != 8) throw new Exception("[" + sDateTime + "]日期时间格式错误!");
string Result = "";
string year = sDateTime.Substring(0, 4);
string month = sDateTime.Substring(4, 2);
string day = sDateTime.Substring(6, 2);
string h = "0";
string m = "0";
string s = "0";
string mi = "0";
if (month.Length == 1) month = "0" + month;
if (day.Length == 1) day = "0" + day;
if (h.Length == 1) h = "0" + h;
if (m.Length == 1) m = "0" + m;
if (s.Length == 1) s = "0" + s;
if (mi.Length == 1) mi = "00" + mi;
if (mi.Length == 2) mi = "0" + mi;
if (dType == MyDateTimeType.DateTime)
{
Result = year + "-" + month + "-" + day + " " + h + ":" + m + ":" + s;
}
if (dType == MyDateTimeType.Date)
{
Result = year + "-" + month + "-" + day;
}
if (dType == MyDateTimeType.Time)
{
Result = h + ":" + m + ":" + s;
}
if (dType == MyDateTimeType.Batch)
{
Result = year.Substring(2, 2) + month + day;
}
if (dType == MyDateTimeType.BillNo)
{
Result = year + month + day + h + m + s + mi;
}
return Result;
}
private string CheckPartPO(DataTable dtImport,int startRowIndex,int columnIndex,out DataTable dtPartPo)
{
string strRtn = "";
Entity_t_PartPO partPO = new Entity_t_PartPO();
DataTable dtData = partPO.GetData($"1 = 1").Tables[0];
dtPartPo = dtData;
if (dtData.Rows.Count == 0)
{
return "系统中没有定义零件号对应的订单信息!";
}
for (int i = startRowIndex; i < dtImport.Rows.Count-1; i++)
{
var partCode = dtImport.Rows[i][columnIndex].ToString();
var row = dtData.Select("Code = '" + partCode + "'");
if (row.Length != 1)
{
strRtn += "零件号["+partCode + "]没有对应有效的订单号"+ Environment.NewLine;
}
else
{
if(string.IsNullOrEmpty(row[0]["PONumber"].ToString()))
{
strRtn += "零件号[" + partCode + "]没有对应有效的订单号" + Environment.NewLine;
}
}
}
if (string.IsNullOrEmpty(strRtn))
{
strRtn = "OK";
}
if (dtData.Rows.Count == 0) throw new Exception("补打的记录不存在");
return strRtn;
}
/// <summary>
/// 删除历史导入的ASN单 根据发货的计划时间进行删除
/// </summary>
private void DelDPDateHis(DataTable dtImport)
{
LocalDBService db = new LocalDBService();
var sql = "";
var deliverDate = "";
//日期 行位置
var dateRowIndex = 3;
//时间 行位置
var timeRowIndex = 4;
var dateRow = dtImport.Rows[dateRowIndex];
var timeRow = dtImport.Rows[timeRowIndex];
//ASN 列开始位置
var asnColumnStartIndex = 5;
var strLabelDate = "";
for (int i = asnColumnStartIndex; i < dtImport.Columns.Count; i++)
{
if (!string.IsNullOrEmpty(dateRow[i].ToString()))
{
var date = dateRow[i].ToString();
date = GetDateTimeStyle4(date, MyDateTimeType.Date);
var DPTime = timeRow[i].ToString();
var labelDate = DateTime.Parse(date).ToString("yyyy-MM-dd") + " " + DPTime + ":00";
strLabelDate += "'" + labelDate + "',";
}
}
if (strLabelDate.Length > 0)
{
strLabelDate = strLabelDate.Substring(0, strLabelDate.Length - 1);
sql = $"delete from t_JIS_VDA where LabelDate in (" + strLabelDate + ")";
db.Exec_NonQuery(sql);
}
}
/// <summary>
/// 删除历史导入的ASN单 根据发货的计划时间进行删除
/// </summary>
private void DelDPASNHis(DataTable dtImport)
{
LocalDBService db = new LocalDBService();
var sql = "";
var AsnNums = "";
//ASN 行位置
var asnRowIndex = 6;
var asnRow = dtImport.Rows[asnRowIndex];
//ASN 列开始位置
var asnColumnStartIndex = 5;
for (int i = asnColumnStartIndex; i < dtImport.Columns.Count; i++)
{
if (!string.IsNullOrEmpty(asnRow[i].ToString()))
{
AsnNums += "'" + asnRow[i].ToString() + "',";
}
}
if (AsnNums.Length > 0)
{
AsnNums = AsnNums.Substring(0, AsnNums.Length - 1);
sql = $"delete from t_JIS_VDA where AsnNumber in (" + AsnNums + ")";
db.Exec_NonQuery(sql);
}
}
} }
} }

5
Stone.WinForm/Stone.WinModule/Standard/frmJISVDAASN.resx

@ -125,7 +125,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAACM ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAACM
CwAAAk1TRnQBSQFMAgEBBQEAAVgBAAFYAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo CwAAAk1TRnQBSQFMAgEBBQEAAWABAAFgAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABQAMAASADAAEBAQABCAYAAQgYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA AwABQAMAASADAAEBAQABCAYAAQgYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
@ -177,4 +177,7 @@
AfgBAwHwAQEB/gEHBP8B/AEDBP8L AfgBAwHwAQEB/gEHBP8B/AEDBP8L
</value> </value>
</data> </data>
<metadata name="openFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>342, 17</value>
</metadata>
</root> </root>

2
Stone.WinForm/Stone.WinModule/Standard/frmMessageQuestion.cs

@ -34,7 +34,7 @@ namespace Stone.WinModule.Standard
{ {
frmPasswordVerify frm = new frmPasswordVerify(); frmPasswordVerify frm = new frmPasswordVerify();
// frm.UserName = User.UserInfo.UserName; // frm.UserName = User.UserInfo.UserName;
frm.UserName = "wping"; frm.UserName = "wzfeng";
if (frm.ShowDialog() == DialogResult.OK) if (frm.ShowDialog() == DialogResult.OK)
{ {
this.DialogResult = DialogResult.OK; this.DialogResult = DialogResult.OK;

39
Stone.WinForm/Stone.WinModule/Stone.WinModule.csproj

@ -166,6 +166,30 @@
<Compile Include="BasicData\frmErrLog.Designer.cs"> <Compile Include="BasicData\frmErrLog.Designer.cs">
<DependentUpon>frmErrLog.cs</DependentUpon> <DependentUpon>frmErrLog.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="BasicData\frmBillNO.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="BasicData\frmBillNO.Designer.cs">
<DependentUpon>frmBillNO.cs</DependentUpon>
</Compile>
<Compile Include="BasicData\frmBillNODetail.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="BasicData\frmBillNODetail.Designer.cs">
<DependentUpon>frmBillNODetail.cs</DependentUpon>
</Compile>
<Compile Include="BasicData\frmPartPODetail.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="BasicData\frmPartPODetail.Designer.cs">
<DependentUpon>frmPartPODetail.cs</DependentUpon>
</Compile>
<Compile Include="BasicData\frmPartPO.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="BasicData\frmPartPO.Designer.cs">
<DependentUpon>frmPartPO.cs</DependentUpon>
</Compile>
<Compile Include="BasicData\frmPartOutQtyDetail.cs"> <Compile Include="BasicData\frmPartOutQtyDetail.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
@ -395,6 +419,12 @@
<Compile Include="Standard\frmMessageQuestion.Designer.cs"> <Compile Include="Standard\frmMessageQuestion.Designer.cs">
<DependentUpon>frmMessageQuestion.cs</DependentUpon> <DependentUpon>frmMessageQuestion.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="Standard\frmASNScan.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Standard\frmASNScan.Designer.cs">
<DependentUpon>frmASNScan.cs</DependentUpon>
</Compile>
<Compile Include="Standard\frmPickUpDate.cs"> <Compile Include="Standard\frmPickUpDate.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
@ -682,6 +712,12 @@
<EmbeddedResource Include="BasicData\frmErrLog.resx"> <EmbeddedResource Include="BasicData\frmErrLog.resx">
<DependentUpon>frmErrLog.cs</DependentUpon> <DependentUpon>frmErrLog.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="BasicData\frmBillNODetail.resx">
<DependentUpon>frmBillNODetail.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="BasicData\frmPartPODetail.resx">
<DependentUpon>frmPartPODetail.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="BasicData\frmPartOutQtyDetail.resx"> <EmbeddedResource Include="BasicData\frmPartOutQtyDetail.resx">
<DependentUpon>frmPartOutQtyDetail.cs</DependentUpon> <DependentUpon>frmPartOutQtyDetail.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
@ -783,6 +819,9 @@
<EmbeddedResource Include="Standard\frmMessageQuestion.resx"> <EmbeddedResource Include="Standard\frmMessageQuestion.resx">
<DependentUpon>frmMessageQuestion.cs</DependentUpon> <DependentUpon>frmMessageQuestion.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="Standard\frmASNScan.resx">
<DependentUpon>frmASNScan.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Standard\frmPickUpDate.resx"> <EmbeddedResource Include="Standard\frmPickUpDate.resx">
<DependentUpon>frmPickUpDate.cs</DependentUpon> <DependentUpon>frmPickUpDate.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>

Loading…
Cancel
Save