|
|
@@ -74,7 +74,7 @@ namespace UAS_MES.Query
|
|
|
//没有过转号
|
|
|
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 + "不存在");
|
|
|
@@ -82,13 +82,13 @@ namespace UAS_MES.Query
|
|
|
}
|
|
|
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;
|
|
|
- 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_sncode,ms_firstsn,ms_makecode from makeserial where ms_id in (" + ms_ids.ToString().Substring(0,ms_ids.ToString().Length-1)+")","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)
|
|
|
{
|
|
|
@@ -98,7 +98,7 @@ namespace UAS_MES.Query
|
|
|
SerialPanel.Controls.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();
|
|
|
//下一步骤
|
|
|
@@ -160,7 +160,7 @@ namespace UAS_MES.Query
|
|
|
}
|
|
|
//查询执行过的步骤
|
|
|
sql.Clear();
|
|
|
- sql.Append("select CD_DETNO,CD_STEPCODE,ms_makecode,ms_id from craft left join craftdetail on cd_crid = cr_id left join makeserial ");
|
|
|
+ sql.Append("select CD_DETNO,CD_STEPCODE,cd_ifoqc,ms_makecode,ms_id from craft left join craftdetail on cd_crid = cr_id left join makeserial ");
|
|
|
sql.Append("on ms_craftcode=cr_code and ms_prodcode=cr_prodcode where ms_id in (" + ms_ids.ToString().Substring(0, ms_ids.ToString().Length - 1) + ") order by ms_id,cd_detno");
|
|
|
dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
|
|
|
Step = new Dictionary<int, string>();
|
|
|
@@ -179,7 +179,7 @@ namespace UAS_MES.Query
|
|
|
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())
|
|
|
{
|
|
|
@@ -237,8 +237,7 @@ namespace UAS_MES.Query
|
|
|
{
|
|
|
//已执行
|
|
|
//判断是否为OQC工序
|
|
|
- string st_ifoqc = dh.getFieldDataByCondition("Step", "st_ifoqc", "st_code = '" + dt.Rows[i]["CD_STEPCODE"].ToString() + "'").ToString();
|
|
|
- if (st_ifoqc == "-1")
|
|
|
+ if (dt.Rows[i]["cd_ifoqc"].ToString() == "-1")
|
|
|
{
|
|
|
string oqcpass = dh.getFieldDataByCondition("oqcbatch", "ob_status", "ob_checkno = '" + checkno + "'").ToString();
|
|
|
if (oqcpass == "OK")
|
|
|
@@ -294,17 +293,17 @@ namespace UAS_MES.Query
|
|
|
StringBuilder mp_sncodes = 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
|
|
|
- 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
|
|
|
- makecodes.Append("'"+ListA.Rows[i]["ms_makecode"].ToString()+"',");
|
|
|
+ makecodes.Append("'" + ListA.Rows[i]["ms_makecode"].ToString() + "',");
|
|
|
}
|
|
|
sql.Clear();
|
|
|
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_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");
|
|
|
BaseUtil.FillDgvWithDataTable(CraftInfDgv, dt);
|
|
|
}
|
|
|
@@ -374,7 +373,7 @@ namespace UAS_MES.Query
|
|
|
//如果是一行中的箭头
|
|
|
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;
|
|
|
}
|
|
|
//如果是行的最后一个的箭头
|