ruoxing.wang 3 days ago
parent
commit
5a3bde4d6f
  1. 440
      InjectionPC/FrmMain2408.Designer.cs
  2. 29
      InjectionPC/FrmMain2408.cs
  3. 50
      PaintingPC/FrmLogin.Designer.cs
  4. 6
      PaintingPC/FrmLogin.cs
  5. 1086
      PaintingPC/FrmLogin.resx
  6. 19
      PaintingPC/FrmQuality.cs
  7. 138
      PaintingPC/Function.cs

440
InjectionPC/FrmMain2408.Designer.cs

File diff suppressed because it is too large

29
InjectionPC/FrmMain2408.cs

@ -72,6 +72,8 @@ namespace InjectionPC
private Dictionary<string, string> _printNameDict = new Dictionary<string, string>(); private Dictionary<string, string> _printNameDict = new Dictionary<string, string>();
private PlasticBLL _plasticBLL = new PlasticBLL(); private PlasticBLL _plasticBLL = new PlasticBLL();
private int _plcRate = 100; //500 private int _plcRate = 100; //500
private int _allowChangeBoxSizeMaxPrint = 5;
#endregion #endregion
public FrmMain2408() public FrmMain2408()
@ -4120,6 +4122,19 @@ namespace InjectionPC
if(moudel == "0") if(moudel == "0")
{ {
string pcd = lbPackageCodeL.Text?.Trim(); string pcd = lbPackageCodeL.Text?.Trim();
//string printQtyLStr = lbCurrentlQtyL.Text;
//int printQtyL = 0;
//if (int.TryParse(printQtyLStr, out printQtyL))
//{
// if(printQtyL > _allowChangeBoxSizeMaxPrint)
// {
// MessageBox.Show($"左箱码[{pcd}]装箱数量超过限定值,请先手动打印左箱码,再进行切换.");
// return;
// }
//}
if (!string.IsNullOrEmpty(pcd)) if (!string.IsNullOrEmpty(pcd))
{ {
MessageBox.Show($"请先完成左箱码[{pcd}]装箱后,再进行切换."); MessageBox.Show($"请先完成左箱码[{pcd}]装箱后,再进行切换.");
@ -4128,6 +4143,20 @@ namespace InjectionPC
} }
else else
{ {
string pcd = lbPackageCodeR.Text?.Trim();
//string printQtyRStr = lbCurrentlQtyR.Text;
//int printQtyR = 0;
//if (int.TryParse(printQtyRStr, out printQtyR))
//{
// if (printQtyR > _allowChangeBoxSizeMaxPrint)
// {
// MessageBox.Show($"右箱码[{pcd}]装箱数量超过限定值,请先手动打印右箱码,再进行切换.");
// return;
// }
//}
string pcd = lbPackageCodeR.Text?.Trim(); string pcd = lbPackageCodeR.Text?.Trim();
if (!string.IsNullOrEmpty(pcd)) if (!string.IsNullOrEmpty(pcd))
{ {

50
PaintingPC/FrmLogin.Designer.cs

@ -43,44 +43,45 @@
// label1 // label1
// //
this.label1.AutoSize = true; this.label1.AutoSize = true;
this.label1.BackColor = System.Drawing.Color.White;
this.label1.Font = new System.Drawing.Font("宋体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label1.Font = new System.Drawing.Font("宋体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label1.Location = new System.Drawing.Point(432, 388); this.label1.Location = new System.Drawing.Point(396, 340);
this.label1.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); this.label1.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
this.label1.Name = "label1"; this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(131, 38); this.label1.Size = new System.Drawing.Size(117, 34);
this.label1.TabIndex = 0; this.label1.TabIndex = 0;
this.label1.Text = "用户名"; this.label1.Text = "用户名";
// //
// label2 // label2
// //
this.label2.AutoSize = true; this.label2.AutoSize = true;
this.label2.BackColor = System.Drawing.Color.Transparent; this.label2.BackColor = System.Drawing.Color.White;
this.label2.Font = new System.Drawing.Font("宋体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label2.Font = new System.Drawing.Font("宋体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label2.Location = new System.Drawing.Point(432, 494); this.label2.Location = new System.Drawing.Point(396, 432);
this.label2.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); this.label2.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
this.label2.Name = "label2"; this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(93, 38); this.label2.Size = new System.Drawing.Size(83, 34);
this.label2.TabIndex = 1; this.label2.TabIndex = 1;
this.label2.Text = "密码"; this.label2.Text = "密码";
// //
// textBox1 // textBox1
// //
this.textBox1.Font = new System.Drawing.Font("宋体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.textBox1.Font = new System.Drawing.Font("宋体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.textBox1.Location = new System.Drawing.Point(592, 370); this.textBox1.Location = new System.Drawing.Point(543, 324);
this.textBox1.Margin = new System.Windows.Forms.Padding(6); this.textBox1.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
this.textBox1.Name = "textBox1"; this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(314, 51); this.textBox1.Size = new System.Drawing.Size(288, 45);
this.textBox1.TabIndex = 2; this.textBox1.TabIndex = 2;
this.textBox1.Click += new System.EventHandler(this.textBox1_Click); this.textBox1.Click += new System.EventHandler(this.textBox1_Click);
// //
// textBox2 // textBox2
// //
this.textBox2.Font = new System.Drawing.Font("宋体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.textBox2.Font = new System.Drawing.Font("宋体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.textBox2.Location = new System.Drawing.Point(592, 494); this.textBox2.Location = new System.Drawing.Point(543, 432);
this.textBox2.Margin = new System.Windows.Forms.Padding(6); this.textBox2.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
this.textBox2.Name = "textBox2"; this.textBox2.Name = "textBox2";
this.textBox2.PasswordChar = '*'; this.textBox2.PasswordChar = '*';
this.textBox2.Size = new System.Drawing.Size(314, 51); this.textBox2.Size = new System.Drawing.Size(288, 45);
this.textBox2.TabIndex = 3; this.textBox2.TabIndex = 3;
this.textBox2.Click += new System.EventHandler(this.textBox2_Click); this.textBox2.Click += new System.EventHandler(this.textBox2_Click);
// //
@ -88,10 +89,10 @@
// //
this.button1.BackColor = System.Drawing.Color.LightSkyBlue; this.button1.BackColor = System.Drawing.Color.LightSkyBlue;
this.button1.Font = new System.Drawing.Font("宋体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.button1.Font = new System.Drawing.Font("宋体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button1.Location = new System.Drawing.Point(462, 612); this.button1.Location = new System.Drawing.Point(424, 536);
this.button1.Margin = new System.Windows.Forms.Padding(6); this.button1.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
this.button1.Name = "button1"; this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(168, 76); this.button1.Size = new System.Drawing.Size(154, 66);
this.button1.TabIndex = 4; this.button1.TabIndex = 4;
this.button1.Text = "登录"; this.button1.Text = "登录";
this.button1.UseVisualStyleBackColor = false; this.button1.UseVisualStyleBackColor = false;
@ -101,10 +102,10 @@
// //
this.button2.BackColor = System.Drawing.Color.LightSkyBlue; this.button2.BackColor = System.Drawing.Color.LightSkyBlue;
this.button2.Font = new System.Drawing.Font("宋体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.button2.Font = new System.Drawing.Font("宋体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button2.Location = new System.Drawing.Point(774, 612); this.button2.Location = new System.Drawing.Point(710, 536);
this.button2.Margin = new System.Windows.Forms.Padding(6); this.button2.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
this.button2.Name = "button2"; this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(166, 76); this.button2.Size = new System.Drawing.Size(152, 66);
this.button2.TabIndex = 5; this.button2.TabIndex = 5;
this.button2.Text = "取消"; this.button2.Text = "取消";
this.button2.UseVisualStyleBackColor = false; this.button2.UseVisualStyleBackColor = false;
@ -115,9 +116,9 @@
this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Fill; this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image"))); this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
this.pictureBox1.Location = new System.Drawing.Point(0, 0); this.pictureBox1.Location = new System.Drawing.Point(0, 0);
this.pictureBox1.Margin = new System.Windows.Forms.Padding(6); this.pictureBox1.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(1406, 906); this.pictureBox1.Size = new System.Drawing.Size(1289, 793);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
this.pictureBox1.TabIndex = 6; this.pictureBox1.TabIndex = 6;
this.pictureBox1.TabStop = false; this.pictureBox1.TabStop = false;
@ -125,19 +126,20 @@
// lbtip // lbtip
// //
this.lbtip.AutoSize = true; this.lbtip.AutoSize = true;
this.lbtip.BackColor = System.Drawing.Color.White;
this.lbtip.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lbtip.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lbtip.ForeColor = System.Drawing.Color.Red; this.lbtip.ForeColor = System.Drawing.Color.Red;
this.lbtip.Location = new System.Drawing.Point(422, 565); this.lbtip.Location = new System.Drawing.Point(387, 494);
this.lbtip.Name = "lbtip"; this.lbtip.Name = "lbtip";
this.lbtip.Size = new System.Drawing.Size(62, 24); this.lbtip.Size = new System.Drawing.Size(58, 21);
this.lbtip.TabIndex = 7; this.lbtip.TabIndex = 7;
this.lbtip.Text = " "; this.lbtip.Text = " ";
// //
// FrmLogin // FrmLogin
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F); this.AutoScaleDimensions = new System.Drawing.SizeF(11F, 21F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1406, 906); this.ClientSize = new System.Drawing.Size(1289, 793);
this.Controls.Add(this.lbtip); this.Controls.Add(this.lbtip);
this.Controls.Add(this.label2); this.Controls.Add(this.label2);
this.Controls.Add(this.textBox1); this.Controls.Add(this.textBox1);
@ -146,7 +148,7 @@
this.Controls.Add(this.button2); this.Controls.Add(this.button2);
this.Controls.Add(this.label1); this.Controls.Add(this.label1);
this.Controls.Add(this.pictureBox1); this.Controls.Add(this.pictureBox1);
this.Margin = new System.Windows.Forms.Padding(6); this.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
this.Name = "FrmLogin"; this.Name = "FrmLogin";
this.Text = "登录"; this.Text = "登录";
this.Load += new System.EventHandler(this.FrmLogin_Load); this.Load += new System.EventHandler(this.FrmLogin_Load);

6
PaintingPC/FrmLogin.cs

@ -62,7 +62,11 @@ namespace PaintingPC
OperatorBLL bll = new OperatorBLL(); OperatorBLL bll = new OperatorBLL();
if (string.IsNullOrEmpty(stationID))
{
lbtip.Text = "配置工位"+ Program.station+"在系统中不存在.";
return;
}
DataTable dt = bll.SearchInfoByNameAndPsw(textBox1.Text.Trim(), stationID, textBox2.Text.Trim()); DataTable dt = bll.SearchInfoByNameAndPsw(textBox1.Text.Trim(), stationID, textBox2.Text.Trim());
if (dt != null && dt.Rows.Count > 0) if (dt != null && dt.Rows.Count > 0)
{ {

1086
PaintingPC/FrmLogin.resx

File diff suppressed because it is too large

19
PaintingPC/FrmQuality.cs

@ -26,6 +26,7 @@ namespace PaintingPC
private string _carType = string.Empty; private string _carType = string.Empty;
private Dictionary<string, string> _lastJustDict = new Dictionary<string, string>(); private Dictionary<string, string> _lastJustDict = new Dictionary<string, string>();
private string _foreighColor = string.Empty; private string _foreighColor = string.Empty;
private string _lineCode = string.Empty;
/// <summary> /// <summary>
/// 从tb_ForeignColorMap表得到的零件号 /// 从tb_ForeignColorMap表得到的零件号
/// </summary> /// </summary>
@ -36,6 +37,7 @@ namespace PaintingPC
//WindowState = FormWindowState.Normal; //WindowState = FormWindowState.Normal;
this.Size = new Size(1280, 1020); this.Size = new Size(1280, 1020);
this._isWmsQuality = isWmsQuality; this._isWmsQuality = isWmsQuality;
_lineCode = ConfigurationManager.AppSettings["LineCode"].ToString();
string disableButtons = ConfigurationManager.AppSettings["DisableButtons"].ToString(); string disableButtons = ConfigurationManager.AppSettings["DisableButtons"].ToString();
if (!string.IsNullOrEmpty(disableButtons)) if (!string.IsNullOrEmpty(disableButtons))
{ {
@ -63,6 +65,13 @@ namespace PaintingPC
btnOk.Visible = false; btnOk.Visible = false;
btnAbt.Visible = false; btnAbt.Visible = false;
} }
if(_lineCode == "2")
{
groupBox1.Visible = false;
//label1.Visible = false;
//cboxAddColor.Visible = false;
}
} }
private void FrmSecondCheck_Load(object sender, EventArgs e) private void FrmSecondCheck_Load(object sender, EventArgs e)
@ -1183,8 +1192,16 @@ namespace PaintingPC
{ {
string paintError = string.Empty; string paintError = string.Empty;
//喷涂线边质检,没有质检结果,查询老外数据库,取产品信息 //喷涂线边质检,没有质检结果,查询老外数据库,取产品信息
string foreignVal = string.Empty;
if(_lineCode == "2")
{
foreignVal = Function.GetProductInfoFrWms(barcode, ref paintError);
}
else
{
foreignVal = Function.GetProductInfo2(barcode, ref paintError);
string foreignVal = Function.GetProductInfo2(barcode, ref paintError); }
if (!string.IsNullOrEmpty(paintError)) if (!string.IsNullOrEmpty(paintError))
{ {
lbForeig.Text = paintError; lbForeig.Text = paintError;

138
PaintingPC/Function.cs

@ -1978,6 +1978,144 @@ namespace PaintingPC
} }
} }
public static string GetProductInfoFrWms(string barcode, ref string errorMsg)
{
string res = "";
//string colorNo = "";
//string colorQQNo = "";
//string colorPRNo = "";
string colorInfo = "", paintCode = "", paintID = "", typeCode = "";
string barCode1_1 = "", barCode1_2 = "", barCode1_3 = "", barCode1_4 = "", barCode1_5 = "", barCode1_6 = "",
barCode2_1 = "", barCode2_2 = "", barCode2_3 = "", barCode2_4 = "", barCode2_5 = "", barCode2_6 = "";
string columnName = "", side = "";
try
{
DataTable dt1 = GetLastResult(barcode);
if (dt1 != null && dt1.Rows.Count > 0)
{
//productInfo 暗夜黑,M1前保险杠上体暗夜黑
colorInfo = dt1.Rows[0]["productInfo"].ToString() + "," + dt1.Rows[0]["remark3"].ToString();
}
else
{
#region 从老外系统获得颜色信息
string wmsSql = $"select TypeCode,WMSColor as paintcode from TM_BJBMPT_MES_DATA where ProductBarcode='{barcode}'";
string wmsSqlConnString = ConfigurationManager.ConnectionStrings["WmsSqlConnString"].ToString();
DataTable dtColor = SqlHelper.GetDataDateTable(wmsSqlConnString, CommandType.Text, wmsSql, null);
if (dtColor != null && dtColor.Rows.Count > 0)
{
paintCode = dtColor.Rows[0]["paintcode"].ToString();
typeCode = dtColor.Rows[0]["TypeCode"].ToString();
}
else
{
errorMsg = $"WmsDB 没有条码[{barcode}]对应的数据";
}
if (!string.IsNullOrEmpty(typeCode) && paintCode.ToLower() != "na")
{
string stockNo1 = barcode.Substring(0, 10);
string sqlmap = @"select * from tb_ForeignColorMap where TypeCode='" + typeCode + @"' and StockNo='" + stockNo1 + "'";
DataTable mapTable = SqlHelper.GetDataDateTable(SqlHelper.SqlConnString, CommandType.Text, sqlmap, null);
if (mapTable.Rows.Count > 0)
{
DataRow mapRow = mapTable.Rows[0];
string paintSql = @"select * from tb_PaintInfo where PaintCode='" + paintCode + @"'";
DataTable paintTable = SqlHelper.GetDataDateTable(SqlHelper.SqlConnString, CommandType.Text, sqlmap, null);
if (paintTable != null && paintTable.Rows.Count > 0)
{
paintID = paintTable.Rows[0]["ID"].ToString();
res = mapRow["Color"] + "," + mapRow["PartName"] + "," + paintID + "," + mapRow["PartCode"];
return res;
}
else
{
errorMsg = $"基础数据-油漆信息管理页面未配置油漆代码为{paintCode}的基础数据";
}
}
}
//根据颜色代码查颜色
if (!string.IsNullOrWhiteSpace(paintCode) && paintCode.ToLower() != "na")
{
DataTable dt = new DataTable();
string sql_c = "";
sql_c = @"select * from tb_PaintInfo where PaintCode='" + paintCode + @"'";
dt = SqlHelper.GetDataDateTable(SqlHelper.SqlConnString, CommandType.Text, sql_c, null);
if (dt != null && dt.Rows.Count > 0)
{
//res = dt.Rows[0]["ColorName"].ToString();
//colorInfo = dt.Rows[0]["Des"].ToString().Trim() + "," +
// dt.Rows[0]["ColorCode"].ToString().Trim() + "," +
// dt.Rows[0]["ColorNo"].ToString().Trim();
//colorInfo = dt.Rows[0]["ColorName"].ToString();
paintID = dt.Rows[0]["ID"].ToString();
}
else
{
errorMsg = $"基础数据-油漆信息管理页面未配置油漆代码为{paintCode}的基础数据";
}
string sql_1 = @"select Color from tb_PaintColorInfo where StockNo='" + barcode.Substring(0, 10) + @"' and PaintID='" + paintID + @"'";
DataTable dt_1 = SqlHelper.GetDataDateTable(SqlHelper.SqlConnString, CommandType.Text, sql_1, null);
if (dt_1 != null && dt_1.Rows.Count > 0)
{
colorInfo = dt_1.Rows[0]["Color"].ToString();
}
else
{
errorMsg = $"基础数据-产品颜色页面未配置存货代码代码为{barcode.Substring(0, 10)},油漆代码为[{paintCode}]的基础数据";
}
}
#endregion
barcode = UniteBarCodeToOne(barcode);
#region 根据条码查询产品信息
string stockNo = "";
string batchNo = "";
string partNo = "";
Function.GetCode(barcode, out stockNo, out batchNo, out partNo);
string productName = "";
GetInfoByStockNo2(stockNo, out partNo, out productName);
#endregion
colorInfo = colorInfo + "," + productName + "," + paintID;
}
res = colorInfo;
return res;
}
catch (Exception ex)
{
LogHelper.WriteLogManager(ex);
LogHelper.WriteErrLogBase(ex.ToString(), MethodBase.GetCurrentMethod().Name);
if (ex.Message.Contains("TCP Provider"))
{
errorMsg = "外库网络连接失败!";
}
else
{
errorMsg = ex.Message;
}
return res;
}
}
public static string GetWorkClass2() public static string GetWorkClass2()
{ {
//bool classA = IsBetweenTime(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), "2019-06-12 08:00:00", "2019-06-12 20:00:00"); //bool classA = IsBetweenTime(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), "2019-06-12 08:00:00", "2019-06-12 20:00:00");

Loading…
Cancel
Save