Browse Source

单工位不能在一检进行

点修补工位隐藏其它按钮
  点修补工位去掉了点修补按钮,缺陷是否串位置.
  点修补工位和二检多工位,增加产线判定,M2不能扫M1的产品
master
ruoxing.wang 2 weeks ago
parent
commit
dc74254710
  1. 14
      MESClassLibrary/BLL/BasicInfo/StationBLL.cs
  2. 3
      MESClassLibrary/DAL/BasicDAL.cs
  3. 13
      MESClassLibrary/DAL/BasicInfo/StationDAL.cs
  4. 82
      PaintingPC/FrmQuality.cs

14
MESClassLibrary/BLL/BasicInfo/StationBLL.cs

@ -77,6 +77,19 @@ namespace MESClassLibrary.BLL.BasicInfo
}
public DataTable GetStationInfo(string LineCode)
{
try
{
DataTable list = da.GetStationInfos(LineCode) ;//判断是否有重复数据
return list;
}
catch (Exception)
{
return null;
}
}
/// <summary>
/// 添加信息
/// </summary>
@ -201,6 +214,7 @@ namespace MESClassLibrary.BLL.BasicInfo
return "";
}
}
public DataTable SearchInfoByNo(string station)
{

3
MESClassLibrary/DAL/BasicDAL.cs

@ -123,6 +123,9 @@ namespace MESClassLibrary.DAL
return GetSjBarCodeSerialNo(stockNo, batch);
}
}
public static DateTime GetServerTime()
{
string sql = "";

13
MESClassLibrary/DAL/BasicInfo/StationDAL.cs

@ -36,7 +36,20 @@ namespace MESClassLibrary.DAL.BasicInfo
return null;
}
}
public DataTable GetStationInfos(string lineCode)
{
try
{
DataTable dt = SqlHelper.ExecuteDataset(SqlHelper.GetConnSting(), CommandType.Text, $"select s.* from tb_Station s ,tb_Line l where l.LineID = s.LineID and l.LineName='{lineCode}'", null).Tables[0];
return dt;
}
catch (Exception ex)
{
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
return null;
}
}
public bool UpdateTime(DateTime time,string staionNo)
{
try

82
PaintingPC/FrmQuality.cs

@ -28,7 +28,10 @@ namespace PaintingPC
private Dictionary<string, string> _lastJustDict = new Dictionary<string, string>();
private string _foreighColor = string.Empty;
private string _lineCode = string.Empty;
private string _lineCodeSys = string.Empty;
private List<string> _stations = new List<string>();
private string _stationType = string.Empty;
private StationBLL _stationBLL = new StationBLL();
/// <summary>
/// 从tb_ForeignColorMap表得到的零件号
/// </summary>
@ -45,6 +48,27 @@ namespace PaintingPC
this.Size = new Size(1280, 1020);
this._isWmsQuality = isWmsQuality;
_lineCode = ConfigurationManager.AppSettings["LineCode"].ToString();
if(_lineCode == "1")
{
_lineCodeSys = "1207";
}
else if (_lineCode == "2")
{
_lineCodeSys = "1210";
}
DataTable stationTable = _stationBLL.GetStationInfo(_lineCodeSys);
if(stationTable == null || stationTable.Rows.Count == 0)
{
ShowHint("查询产线["+ _lineCodeSys + "]关联工位时异常,请进行确认产线是否存在关联工位.", false);
}
if (stationTable.Rows.Count > 0)
{
_stations = stationTable.AsEnumerable().Select(p => p.Field<string>("StationNo")).ToList();
if(_stations.Count ==0 )
ShowHint("产线[" + _lineCodeSys + "]不存在关联工位,请先进行配置.", false);
}
_stationType = ConfigurationManager.AppSettings["Position"].ToString();
string disableButtons = ConfigurationManager.AppSettings["DisableButtons"].ToString();
string single = ConfigurationManager.AppSettings["SingleStation"].ToString();
@ -87,7 +111,10 @@ namespace PaintingPC
{
btnAllowChangeColor.Visible = true;
}
if (_stationType == "下线点修补")
{
btnNok.Visible = false;
}
// }
}
void HidenColorSelect(bool isHidden)
@ -125,11 +152,12 @@ namespace PaintingPC
{
try
{
string title = _stationType;
string title = ConfigurationManager.AppSettings["Display"].ToString(); ;
string workClass = Function.GetWorkClass2();
string station = ConfigurationManager.AppSettings["Station"].ToString();
labTitle.Text = title;
labWorkClass.Text = workClass;
labStation.Text = station;
labelVersion.Text = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
@ -1059,10 +1087,14 @@ namespace PaintingPC
DataTable dt3 = Function.SearchDefectInfo(ConfigurationManager.AppSettings["Station"].Trim());
if (dt3 != null && dt3.Rows.Count > 0)
{
DataRow newRow = dt3.NewRow();
newRow.ItemArray = dt3.Rows[0].ItemArray;
newRow["DefectName"] = "点修补";
dt3.Rows.InsertAt(newRow, 0);
if(_stationType != "下线点修补")
{
DataRow newRow = dt3.NewRow();
newRow.ItemArray = dt3.Rows[0].ItemArray;
newRow["DefectName"] = "点修补";
dt3.Rows.InsertAt(newRow, 0);
}
drow = Convert.ToInt32(Math.Ceiling((double)dt3.Rows.Count / dcol));
Label[] dLb = new Label[7];
@ -1080,19 +1112,7 @@ namespace PaintingPC
dLb[i] = new Label();
if ((i + dcol * j) < dstr.Length)
{
//if(i==0 && j == 0)
//{
// Label lbl = new Label();
// lbl.Text = "点修补";
// lbl.Font = new Font(dLb[i].Font.FontFamily, 36, FontStyle.Bold);
// lbl.Size = new Size(170, 60);
// lbl.Location = new Point(20 + i * (dLb[i].Size.Width + 25), 5 + j * (dLb[i].Size.Height + 20));
// lbl.BorderStyle = BorderStyle.FixedSingle;
// lbl.BackColor = Color.Red;
// lbl.TextAlign = ContentAlignment.MiddleCenter;
// panel2.Controls.Add(lbl);
// continue;
//}
dLb[i].Text = dstr[i + dcol * j].ToString();
dLb[i].Font = new Font(dLb[i].Font.FontFamily, 24, FontStyle.Bold);
dLb[i].Size = new Size(150, 50);
@ -1231,8 +1251,18 @@ namespace PaintingPC
position= dtInspect.Rows[0]["damnPosition"].ToString(); //缺陷位置
reason= dtInspect.Rows[0]["reason"].ToString(); //原因
paintId = dtInspect.Rows[0]["remark3"].ToString(); //原因
string stationNo = dtInspect.Rows[0]["stationNo"].ToString(); //质检工位
if(!_stations.Contains(stationNo))
{
string em = $"扫描条码[{barcode}]与当前产线[{_lineCodeSys}]不匹配,上一工序非当前产线完成!";
MessageBox.Show(em);
ShowHint(em, false);
txtBarCode.Text = "";
txtBarCode.TabIndex = 0;
txtBarCode.Select();
return;
}
#region 选中缺陷位置及原因
@ -1304,7 +1334,7 @@ namespace PaintingPC
paintId = info[2];
labProPosition.Tag = paintId;
labProductInfo.Tag = Function.GetSide(barcode, paintId);
labProPosition.Text = labTitle.Text.Trim() + " " + labProductInfo.Tag.ToString().Replace(';', ' ');
labProPosition.Text = _stationType + " " + labProductInfo.Tag.ToString().Replace(';', ' ');
if (info.Length == 4)
{
_foreignPartCode = info[3];
@ -1346,7 +1376,7 @@ namespace PaintingPC
{
case "下线一检": return First(barcode);
case "下线二检": return Second(barcode);;
case "点修补": return Third(barcode);
case "下线点修补": return Third(barcode);
default:return true;
}
@ -1355,6 +1385,12 @@ namespace PaintingPC
private bool First(string barcode)
{
if(_isSingleStation == true)
{
ShowHint("当前系统配置为[单工位生产],无法在此工位扫码,请去终检工位进行操作.", false);
return false;
}
DataTable dt = Function.GetLastResult(barcode);
if (dt.Rows.Count > 0)
{

Loading…
Cancel
Save