|
|
@@ -35,7 +35,9 @@ namespace UAS_MES.Query
|
|
|
ComBoxData.Columns.Add(status);
|
|
|
ComBoxData.Columns.Add(statuscode);
|
|
|
DataRow dr = ComBoxData.NewRow();
|
|
|
- dr[0] = "未上线"; dr[1] = "0"; ComBoxData.Rows.Add(dr);
|
|
|
+ dr[0] = "全部"; dr[1] = "null"; ComBoxData.Rows.Add(dr);
|
|
|
+ dr = ComBoxData.NewRow();
|
|
|
+ dr[0] = "未生产"; dr[1] = "0"; ComBoxData.Rows.Add(dr);
|
|
|
dr = ComBoxData.NewRow();
|
|
|
dr[0] = "在线"; dr[1] = "1"; ComBoxData.Rows.Add(dr);
|
|
|
dr = ComBoxData.NewRow();
|
|
|
@@ -63,29 +65,29 @@ namespace UAS_MES.Query
|
|
|
{
|
|
|
if (dh.CheckExist("make", "ma_code='" + ms_makecode.Text + "'"))
|
|
|
{
|
|
|
+ string condition = BaseUtil.GetScreenSqlCondition(ms_makecode, ms_stepcode, ms_nextstepcode);
|
|
|
string statuscode = ms_status.SelectedValue.ToString();
|
|
|
- if (statuscode == "1" || statuscode == "2" || statuscode == "3" || statuscode == "4")
|
|
|
+ sql.Clear();
|
|
|
+ sql.Append("select sncode ms_sncode,ms_linecode,ms_stepcode,ms_nextstepcode,ms_craftcode,makecode ms_makecode,case when ms_status is null then '未生产' when ms_status=1 then '在线' ");
|
|
|
+ sql.Append("when ms_status=2 then '已完工' when ms_status=3 then '不良待维修' when ms_status=4 then '已报废' ");
|
|
|
+ sql.Append("else 'null' end ms_status from((select msd_sncode sncode,msd_makecode makecode,msd_type type ");
|
|
|
+ sql.Append("from makesnruledetail where msd_makecode='" + ms_makecode.Text + "') union (select msl_sncode sncode,msl_makecode ");
|
|
|
+ sql.Append("makecode,msl_type type from makesnlist where msl_makecode='" + ms_makecode.Text + "'))A left join makeserial on ms_code=sncode");
|
|
|
+ sql.Append(condition);
|
|
|
+ if (statuscode == "0")
|
|
|
+ {
|
|
|
+ sql.Append("and ms_status is null");
|
|
|
+ }
|
|
|
+ else if (statuscode == "null")
|
|
|
{
|
|
|
- string condition = BaseUtil.GetScreenSqlCondition(ms_makecode, ms_status, ms_stepcode, ms_nextstepcode);
|
|
|
- sql.Clear();
|
|
|
- sql.Append("select ms_sncode,ms_stepcode,ms_nextstepcode,case when ms_status=1 then '在线' when ms_status=2 then ");
|
|
|
- sql.Append("'已完工' when ms_status=3 then '不良待维修' when ms_status=4 then '已报废' end ms_status,ms_craftcode");
|
|
|
- sql.Append(",mp_indate,mp_inman,mp_sourcecode from makeserial left join makeprocess on mp_makecode=ms_makecode ");
|
|
|
- sql.Append("and mp_sncode=ms_sncode and mp_stepcode=ms_stepcode " + condition + " order by ms_id ");
|
|
|
- DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
|
|
|
- BaseUtil.FillDgvWithDataTable(SnInf, dt);
|
|
|
+
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- sql.Clear();
|
|
|
- sql.Append("select DISTINCT nvl(msl_sncode,msd_sncode)ms_sncode,nvl(msl_makecode,msd_makecode) ms_makecode,'未上线' ms_status from ");
|
|
|
- sql.Append("makesnruledetail left join makesnlist on msl_makecode = msd_makecode and msl_sncode = msd_sncode left join makeserial on ");
|
|
|
- sql.Append("(ms_makecode='" + ms_makecode.Text + "' or msd_makecode='" + ms_makecode.Text + "' or msl_makecode='" + ms_makecode.Text + "')");
|
|
|
- sql.Append("and msd_sncode not in (select ms_sncode from makeserial where ms_makecode ='" + ms_makecode.Text + "')");
|
|
|
- sql.Append(" where msd_type='before' and msd_makecode='" + ms_makecode.Text + "' and ms_sncode is not null order by ms_sncode");
|
|
|
- DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
|
|
|
- BaseUtil.FillDgvWithDataTable(SnInf, dt);
|
|
|
+ sql.Append("and ms_status ='" + statuscode + "'");
|
|
|
}
|
|
|
+ DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
|
|
|
+ BaseUtil.FillDgvWithDataTable(SnInf, dt);
|
|
|
}
|
|
|
else
|
|
|
{
|