|
|
@@ -68,7 +68,7 @@ namespace UAS_MES.Query
|
|
|
//如果为不良的时候
|
|
|
string BadStep = "";
|
|
|
string RejectStep = "";
|
|
|
- string reworkStep ="";
|
|
|
+ string currentStep = "";
|
|
|
//先判断是否是返工的
|
|
|
if (ifRework!= "0")
|
|
|
{
|
|
|
@@ -81,7 +81,6 @@ namespace UAS_MES.Query
|
|
|
{
|
|
|
RejectStep = dt.Rows[0]["ms_stepcode"].ToString();
|
|
|
}
|
|
|
- reworkStep = dt.Rows[0]["ms_stepcode"].ToString();
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
@@ -95,6 +94,7 @@ namespace UAS_MES.Query
|
|
|
RejectStep = dt.Rows[0]["ms_stepcode"].ToString();
|
|
|
}
|
|
|
}
|
|
|
+ currentStep= dt.Rows[0]["ms_stepcode"].ToString();
|
|
|
//查询执行过的步骤
|
|
|
sql.Clear();
|
|
|
sql.Append("select CD_DETNO,CD_STEPCODE from craft left join craftdetail on cd_crid = cr_id left join makeserial ");
|
|
|
@@ -116,81 +116,44 @@ namespace UAS_MES.Query
|
|
|
bool passed = true;
|
|
|
for (int i = 0; i < dt.Rows.Count; i++)
|
|
|
{
|
|
|
- //如果是返工的,根据工序里的步骤判断,如果cd_detno大于当前步骤的cd_detno时候就显示白色
|
|
|
- if (ifRework != "0")
|
|
|
+ //还未开始返工
|
|
|
+ if (currentStep == "")
|
|
|
{
|
|
|
- //还未开始返工
|
|
|
- if (reworkStep=="") {
|
|
|
+ passed = false;
|
|
|
+ }
|
|
|
+ //passed==true;说明经过了这一步
|
|
|
+ if (passed)
|
|
|
+ {
|
|
|
+ if (BadStep == dt.Rows[i]["CD_STEPCODE"].ToString())
|
|
|
+ {
|
|
|
+ PaintColor.Add(Brushes.Red);
|
|
|
+ //是不良品,后面就不执行
|
|
|
passed = false;
|
|
|
}
|
|
|
- //passed==true;说明经过了这一步
|
|
|
- if (passed)
|
|
|
+ else
|
|
|
{
|
|
|
- if (BadStep == dt.Rows[i]["CD_STEPCODE"].ToString())
|
|
|
- {
|
|
|
- PaintColor.Add(Brushes.Red);
|
|
|
- }
|
|
|
+ if (!PastStep.Contains(dt.Rows[i]["CD_STEPCODE"].ToString() + "," + RejectStep) || RejectStep == "")
|
|
|
+ PaintColor.Add(Brushes.Green);
|
|
|
else
|
|
|
{
|
|
|
- if (!PastStep.Contains(dt.Rows[i]["CD_STEPCODE"].ToString() + "," + RejectStep) || RejectStep == "")
|
|
|
- PaintColor.Add(Brushes.Green);
|
|
|
- else
|
|
|
+ //判断之前有没有添加过黑色
|
|
|
+ if (PaintColor.Contains(Brushes.Black))
|
|
|
{
|
|
|
- //判断之前有没有添加过黑色
|
|
|
- if (PaintColor.Contains(Brushes.Black))
|
|
|
- {
|
|
|
- //移除之前的,
|
|
|
- int index = PaintColor.IndexOf(Brushes.Black);
|
|
|
- PaintColor.RemoveAt(PaintColor.IndexOf(Brushes.Black));
|
|
|
- PaintColor.Insert(index, Brushes.Green);
|
|
|
- }
|
|
|
- PaintColor.Add(Brushes.Black);
|
|
|
+ //移除之前的,
|
|
|
+ int index = PaintColor.IndexOf(Brushes.Black);
|
|
|
+ PaintColor.RemoveAt(PaintColor.IndexOf(Brushes.Black));
|
|
|
+ PaintColor.Insert(index, Brushes.Green);
|
|
|
}
|
|
|
+ PaintColor.Add(Brushes.Black);
|
|
|
+ //是报废品,后面也不执行
|
|
|
+ passed = false;
|
|
|
}
|
|
|
}
|
|
|
- //还没经过
|
|
|
- else {
|
|
|
- PaintColor.Add(Brushes.White);
|
|
|
- }
|
|
|
- //如果返工执行到了当前步
|
|
|
- if (reworkStep == dt.Rows[i]["CD_STEPCODE"].ToString())
|
|
|
- {
|
|
|
- passed = false;
|
|
|
- }
|
|
|
}
|
|
|
+ //还没经过
|
|
|
else
|
|
|
- //非返工,是正常
|
|
|
{
|
|
|
- //包含说明是线内工序
|
|
|
- if (PastStep.Contains(dt.Rows[i]["CD_STEPCODE"].ToString()))
|
|
|
- {
|
|
|
- if (BadStep == dt.Rows[i]["CD_STEPCODE"].ToString())
|
|
|
- {
|
|
|
- PaintColor.Add(Brushes.Red);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- if (!PastStep.Contains(dt.Rows[i]["CD_STEPCODE"].ToString() + "," + RejectStep) || RejectStep == "")
|
|
|
- PaintColor.Add(Brushes.Green);
|
|
|
- else
|
|
|
- {
|
|
|
- //判断之前有没有添加过黑色
|
|
|
- if (PaintColor.Contains(Brushes.Black))
|
|
|
- {
|
|
|
- //移除之前的,
|
|
|
- int index = PaintColor.IndexOf(Brushes.Black);
|
|
|
- PaintColor.RemoveAt(PaintColor.IndexOf(Brushes.Black));
|
|
|
- PaintColor.Insert(index, Brushes.Green);
|
|
|
- }
|
|
|
- PaintColor.Add(Brushes.Black);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- //不包含说明是线外工序
|
|
|
- else
|
|
|
- {
|
|
|
- PaintColor.Add(Brushes.White);
|
|
|
- }
|
|
|
+ PaintColor.Add(Brushes.White);
|
|
|
}
|
|
|
}
|
|
|
if (ifRework != "0") {
|