|
@@ -22,6 +22,8 @@ namespace UAS_MES_NEW.Query
|
|
|
string PastStep = "";
|
|
string PastStep = "";
|
|
|
//经过的步骤
|
|
//经过的步骤
|
|
|
string nextStepCode = "";
|
|
string nextStepCode = "";
|
|
|
|
|
+ //序列号对应抽检批
|
|
|
|
|
+ string checkno = "";
|
|
|
//拆分后的经过的步骤
|
|
//拆分后的经过的步骤
|
|
|
Dictionary<int, string> Step;
|
|
Dictionary<int, string> Step;
|
|
|
List<Brush> PaintColor = new List<Brush>();
|
|
List<Brush> PaintColor = new List<Brush>();
|
|
@@ -72,7 +74,7 @@ namespace UAS_MES_NEW.Query
|
|
|
//没有过转号
|
|
//没有过转号
|
|
|
ms_id = (DataTable)dh.ExecuteSql("select ms_id,ms_makecode from makeserial where ms_sncode='" + sn_code.Text + "' order by ms_id", "select");
|
|
ms_id = (DataTable)dh.ExecuteSql("select ms_id,ms_makecode from makeserial where ms_sncode='" + sn_code.Text + "' order by ms_id", "select");
|
|
|
}
|
|
}
|
|
|
- if (ms_id.Rows.Count==0)
|
|
|
|
|
|
|
+ if (ms_id.Rows.Count == 0)
|
|
|
{
|
|
{
|
|
|
//无值则提示
|
|
//无值则提示
|
|
|
MessageBox.Show("序列号" + sn_code.Text + "不存在");
|
|
MessageBox.Show("序列号" + sn_code.Text + "不存在");
|
|
@@ -80,14 +82,14 @@ namespace UAS_MES_NEW.Query
|
|
|
}
|
|
}
|
|
|
StringBuilder ms_ids = new StringBuilder();//存所有的ms_id
|
|
StringBuilder ms_ids = new StringBuilder();//存所有的ms_id
|
|
|
//设置界面工单号
|
|
//设置界面工单号
|
|
|
- ma_code.Text = ms_id.Rows[ms_id.Rows.Count-1]["ms_makecode"].ToString();
|
|
|
|
|
|
|
+ ma_code.Text = ms_id.Rows[ms_id.Rows.Count - 1]["ms_makecode"].ToString();
|
|
|
int idCount = ms_id.Rows.Count;
|
|
int idCount = ms_id.Rows.Count;
|
|
|
- for (int i=0;i<idCount;i++)
|
|
|
|
|
|
|
+ for (int i = 0; i < idCount; i++)
|
|
|
{
|
|
{
|
|
|
- ms_ids.Append("'"+ms_id.Rows[i]["ms_id"].ToString()+"',");
|
|
|
|
|
|
|
+ ms_ids.Append("'" + ms_id.Rows[i]["ms_id"].ToString() + "',");
|
|
|
}
|
|
}
|
|
|
- ListA = (DataTable)dh.ExecuteSql("select ms_beforesn,ms_firstsn,ms_sncode,ms_makecode from makeserial where ms_id in (" + ms_ids.ToString().Substring(0,ms_ids.ToString().Length-1)+")","select");
|
|
|
|
|
- dt = (DataTable)dh.ExecuteSql("select ms_status,ms_nextstepcode,ms_paststep,ms_stepcode,NVL(ms_ifrework, 0) ms_ifrework,NVL(ms_reworkstatus, 0) ms_reworkstatus from makeserial where ms_id in (" + ms_ids.ToString().Substring(0, ms_ids.ToString().Length - 1) + ") order by ms_id", "select");
|
|
|
|
|
|
|
+ ListA = (DataTable)dh.ExecuteSql("select ms_beforesn,ms_sncode,ms_firstsn,ms_makecode from makeserial where ms_id in (" + ms_ids.ToString().Substring(0, ms_ids.ToString().Length - 1) + ")", "select");
|
|
|
|
|
+ dt = (DataTable)dh.ExecuteSql("select ms_status,ms_nextstepcode,ms_paststep,ms_stepcode,ms_checkno,NVL(ms_ifrework, 0) ms_ifrework,NVL(ms_reworkstatus, 0) ms_reworkstatus from makeserial where ms_id in (" + ms_ids.ToString().Substring(0, ms_ids.ToString().Length - 1) + ") order by ms_id", "select");
|
|
|
if (dt.Rows.Count > 0)
|
|
if (dt.Rows.Count > 0)
|
|
|
{
|
|
{
|
|
|
if (Step != null && Step.Count > 0)
|
|
if (Step != null && Step.Count > 0)
|
|
@@ -96,11 +98,13 @@ namespace UAS_MES_NEW.Query
|
|
|
SerialPanel.Controls.Clear();
|
|
SerialPanel.Controls.Clear();
|
|
|
PaintColor.Clear();
|
|
PaintColor.Clear();
|
|
|
}
|
|
}
|
|
|
- string ifRework = dt.Rows[idCount-1]["ms_ifrework"].ToString();
|
|
|
|
|
|
|
+ string ifRework = dt.Rows[idCount - 1]["ms_ifrework"].ToString();
|
|
|
//执行过的步骤
|
|
//执行过的步骤
|
|
|
PastStep = dt.Rows[idCount - 1]["ms_paststep"].ToString();
|
|
PastStep = dt.Rows[idCount - 1]["ms_paststep"].ToString();
|
|
|
//下一步骤
|
|
//下一步骤
|
|
|
nextStepCode = dt.Rows[idCount - 1]["ms_nextstepcode"].ToString();
|
|
nextStepCode = dt.Rows[idCount - 1]["ms_nextstepcode"].ToString();
|
|
|
|
|
+ //序列号所属抽检批
|
|
|
|
|
+ checkno = dt.Rows[idCount - 1]["ms_checkno"].ToString();
|
|
|
//如果为不良的时候
|
|
//如果为不良的时候
|
|
|
string BadStep = "";
|
|
string BadStep = "";
|
|
|
string RejectStep = "";
|
|
string RejectStep = "";
|
|
@@ -175,7 +179,7 @@ namespace UAS_MES_NEW.Query
|
|
|
for (int i = 0; i < dt.Rows.Count; i++)
|
|
for (int i = 0; i < dt.Rows.Count; i++)
|
|
|
{
|
|
{
|
|
|
//正在生产的途程才算
|
|
//正在生产的途程才算
|
|
|
- if (dt.Rows[i]["ms_id"].ToString()==ms_id.Rows[ms_id.Rows.Count-1]["ms_id"].ToString())
|
|
|
|
|
|
|
+ if (dt.Rows[i]["ms_id"].ToString() == ms_id.Rows[ms_id.Rows.Count - 1]["ms_id"].ToString())
|
|
|
{
|
|
{
|
|
|
if (nextStepCode == dt.Rows[i]["CD_STEPCODE"].ToString())
|
|
if (nextStepCode == dt.Rows[i]["CD_STEPCODE"].ToString())
|
|
|
{
|
|
{
|
|
@@ -232,7 +236,22 @@ namespace UAS_MES_NEW.Query
|
|
|
if (i < index)
|
|
if (i < index)
|
|
|
{
|
|
{
|
|
|
//已执行
|
|
//已执行
|
|
|
- PaintColor.Add(Brushes.Green);
|
|
|
|
|
|
|
+ //判断是否为OQC工序
|
|
|
|
|
+ string st_ifoqc = dh.getFieldDataByCondition("Step", "st_ifoqc", "st_code = '" + dt.Rows[i]["CD_STEPCODE"].ToString() + "'").ToString();
|
|
|
|
|
+ if (st_ifoqc == "-1")
|
|
|
|
|
+ {
|
|
|
|
|
+ string oqcpass = dh.getFieldDataByCondition("oqcbatch", "ob_status", "ob_checkno = '" + checkno + "'").ToString();
|
|
|
|
|
+ if (oqcpass == "OK")
|
|
|
|
|
+ {
|
|
|
|
|
+ PaintColor.Add(Brushes.Green);
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ PaintColor.Add(Brushes.White);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ PaintColor.Add(Brushes.Green);
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
@@ -275,17 +294,17 @@ namespace UAS_MES_NEW.Query
|
|
|
StringBuilder mp_sncodes = new StringBuilder();
|
|
StringBuilder mp_sncodes = new StringBuilder();
|
|
|
StringBuilder makecodes = new StringBuilder();
|
|
StringBuilder makecodes = new StringBuilder();
|
|
|
//拼接序列号的和工单号的
|
|
//拼接序列号的和工单号的
|
|
|
- for (int i=0;i<ListA.Rows.Count;i++)
|
|
|
|
|
|
|
+ for (int i = 0; i < ListA.Rows.Count; i++)
|
|
|
{
|
|
{
|
|
|
//sql mp_sncode
|
|
//sql mp_sncode
|
|
|
- mp_sncodes.Append("'" + ListA.Rows[i]["ms_sncode"].ToString() + "',"+(ListA.Rows[i]["ms_firstsn"].ToString()==""?"":(" '"+ListA.Rows[i]["ms_firstsn"].ToString()+"',")));
|
|
|
|
|
|
|
+ mp_sncodes.Append("'" + ListA.Rows[i]["ms_sncode"].ToString() + "'," + (ListA.Rows[i]["ms_firstsn"].ToString() == "" ? "" : (" '" + ListA.Rows[i]["ms_firstsn"].ToString() + "',")));
|
|
|
//sql ma_code
|
|
//sql ma_code
|
|
|
- makecodes.Append("'"+ListA.Rows[i]["ms_makecode"].ToString()+"',");
|
|
|
|
|
|
|
+ makecodes.Append("'" + ListA.Rows[i]["ms_makecode"].ToString() + "',");
|
|
|
}
|
|
}
|
|
|
sql.Clear();
|
|
sql.Clear();
|
|
|
sql.Append("select mp_makecode,ma_prodcode,sc_linecode,ma_craftcode,mp_sourcecode,mp_sncode,");
|
|
sql.Append("select mp_makecode,ma_prodcode,sc_linecode,ma_craftcode,mp_sourcecode,mp_sncode,");
|
|
|
sql.Append("mp_indate,mp_inman,em_name from makeprocess left join make on mp_makecode=ma_code left join employee on mp_inman = em_code left join source on ");
|
|
sql.Append("mp_indate,mp_inman,em_name from makeprocess left join make on mp_makecode=ma_code left join employee on mp_inman = em_code left join source on ");
|
|
|
- sql.Append("mp_sourcecode=sc_code where mp_sncode in ("+mp_sncodes.ToString().Substring(0,mp_sncodes.ToString().Length-1)+") and ma_code in (" + makecodes.ToString().Substring(0,makecodes.ToString().Length-1)+ ") order by mp_indate");
|
|
|
|
|
|
|
+ sql.Append("mp_sourcecode=sc_code where mp_sncode in (" + mp_sncodes.ToString().Substring(0, mp_sncodes.ToString().Length - 1) + ") and ma_code in (" + makecodes.ToString().Substring(0, makecodes.ToString().Length - 1) + ") order by mp_indate");
|
|
|
dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
|
|
dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
|
|
|
BaseUtil.FillDgvWithDataTable(CraftInfDgv, dt);
|
|
BaseUtil.FillDgvWithDataTable(CraftInfDgv, dt);
|
|
|
}
|
|
}
|
|
@@ -355,7 +374,7 @@ namespace UAS_MES_NEW.Query
|
|
|
//如果是一行中的箭头
|
|
//如果是一行中的箭头
|
|
|
if (j + 1 < RectangleCountEachRow * i)
|
|
if (j + 1 < RectangleCountEachRow * i)
|
|
|
{
|
|
{
|
|
|
- g.DrawLine(p, SerialPanel.AutoScrollPosition.X+ x + r.Width + 10, SerialPanel.AutoScrollPosition.Y + y + r.Height / 2, SerialPanel.AutoScrollPosition.X + x + ScreenWidth / (RectangleCountEachRow), SerialPanel.AutoScrollPosition.Y + y + r.Height / 2);
|
|
|
|
|
|
|
+ g.DrawLine(p, SerialPanel.AutoScrollPosition.X + x + r.Width + 10, SerialPanel.AutoScrollPosition.Y + y + r.Height / 2, SerialPanel.AutoScrollPosition.X + x + ScreenWidth / (RectangleCountEachRow), SerialPanel.AutoScrollPosition.Y + y + r.Height / 2);
|
|
|
x += ScreenWidth / RectangleCountEachRow;
|
|
x += ScreenWidth / RectangleCountEachRow;
|
|
|
}
|
|
}
|
|
|
//如果是行的最后一个的箭头
|
|
//如果是行的最后一个的箭头
|