diff --git a/MESClassLibrary/BLL/BasicInfo/StationBLL.cs b/MESClassLibrary/BLL/BasicInfo/StationBLL.cs
index 4478190..53967c7 100644
--- a/MESClassLibrary/BLL/BasicInfo/StationBLL.cs
+++ b/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;
+ }
+ }
///
/// 添加信息
///
@@ -201,6 +214,7 @@ namespace MESClassLibrary.BLL.BasicInfo
return "";
}
}
+
public DataTable SearchInfoByNo(string station)
{
diff --git a/MESClassLibrary/DAL/BasicDAL.cs b/MESClassLibrary/DAL/BasicDAL.cs
index e31373b..39b440f 100644
--- a/MESClassLibrary/DAL/BasicDAL.cs
+++ b/MESClassLibrary/DAL/BasicDAL.cs
@@ -123,6 +123,9 @@ namespace MESClassLibrary.DAL
return GetSjBarCodeSerialNo(stockNo, batch);
}
}
+
+
+
public static DateTime GetServerTime()
{
string sql = "";
diff --git a/MESClassLibrary/DAL/BasicInfo/StationDAL.cs b/MESClassLibrary/DAL/BasicInfo/StationDAL.cs
index af6e459..a03e83e 100644
--- a/MESClassLibrary/DAL/BasicInfo/StationDAL.cs
+++ b/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
diff --git a/PaintingPC/FrmQuality.cs b/PaintingPC/FrmQuality.cs
index c42e7fd..b203945 100644
--- a/PaintingPC/FrmQuality.cs
+++ b/PaintingPC/FrmQuality.cs
@@ -28,7 +28,10 @@ namespace PaintingPC
private Dictionary _lastJustDict = new Dictionary();
private string _foreighColor = string.Empty;
private string _lineCode = string.Empty;
+ private string _lineCodeSys = string.Empty;
+ private List _stations = new List();
private string _stationType = string.Empty;
+ private StationBLL _stationBLL = new StationBLL();
///
/// 从tb_ForeignColorMap表得到的零件号
///
@@ -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("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)
{