|
@@ -80,21 +80,24 @@ namespace UAS_MES.Make
|
|
|
bd_soncode.DbChange += Prodcode_DbChange;
|
|
|
|
|
|
//nrg_name.BringToFront();
|
|
|
- nrg_name.TableName = "QUA_NGREASONGROUP";
|
|
|
+ nrg_name.TableName = "QUA_NGREASONGROUP left join DATAINPUTRECORD ON NRG_NAME = DIR_COMMENT AND DIR_GROUP = '不良原因组' and DIR_SOURCECODE = '" + User.UserSourceCode+"'";
|
|
|
nrg_name.Field = "nrg_name";
|
|
|
nrg_name.ValueField = "nrg_code";
|
|
|
+ nrg_name.Condition = " 1=1 ORDER BY NVL(DIR_NUMBER,0) DESC,ROWNUM asc";
|
|
|
|
|
|
- nr_name.TableName = "QUA_NGREASONGROUPDET left join QUA_NGREASONGROUP on nrgd_nrgid=nrg_id left join QUA_NGReason on nrgd_nrcode=nr_code ";
|
|
|
+ nr_name.TableName = "QUA_NGREASONGROUPDET left join QUA_NGREASONGROUP on nrgd_nrgid=nrg_id left join QUA_NGReason on nrgd_nrcode=nr_code left join DATAINPUTRECORD ON nr_name = DIR_COMMENT AND DIR_GROUP = '不良原因' and DIR_SOURCECODE = '" + User.UserSourceCode + "' ";
|
|
|
nr_name.Field = "nr_name";
|
|
|
nr_name.ValueField = "nr_code";
|
|
|
|
|
|
- mbr_dutyname.TableName = "ngduty";
|
|
|
+ mbr_dutyname.TableName = "ngduty left join DATAINPUTRECORD ON nd_name = DIR_COMMENT AND DIR_GROUP = '责任别' and DIR_SOURCECODE = '" + User.UserSourceCode + "'";
|
|
|
mbr_dutyname.Field = "nd_name";
|
|
|
mbr_dutyname.ValueField = "nd_code";
|
|
|
+ mbr_dutyname.Condition = " 1=1 ORDER BY NVL(DIR_NUMBER,0) DESC,ROWNUM asc";
|
|
|
|
|
|
- so_name.TableName = "solution";
|
|
|
+ so_name.TableName = "solution left join DATAINPUTRECORD ON so_name = DIR_COMMENT AND DIR_GROUP = '解决方案' and DIR_SOURCECODE = '" + User.UserSourceCode + "'";
|
|
|
so_name.Field = "so_name";
|
|
|
so_name.ValueField = "so_code";
|
|
|
+ so_name.Condition = " 1=1 ORDER BY NVL(DIR_NUMBER,0) DESC,ROWNUM asc";
|
|
|
|
|
|
asc.controllInitializeSize(this);
|
|
|
mbc_component.SendToBack();
|
|
@@ -565,9 +568,9 @@ namespace UAS_MES.Make
|
|
|
else
|
|
|
SQLS.Add("update makeserial set ms_checkno='',ms_paststep = ms_paststep || case when instr(','||ms_paststep||',','" + User.CurrentStepCode + "')=0 then ','||'" + User.CurrentStepCode + "' end , ms_nextstepcode ='" + cd_stepcode.Text + "',ms_craftcode='" + cr_code.Text + "',ms_stepcode='" + User.CurrentStepCode + "',ms_reworkstatus=1 where ms_id='" + msid + "'");
|
|
|
}
|
|
|
- SQLS.Add("update makebad set mb_status=-1 where mb_sncode='" + ms_sncode.Text + "' and mb_makecode='" + ms_makecode.Text + "'");
|
|
|
+ SQLS.Add("update makebad set mb_status=-1,ms_checkpack = -1 where mb_sncode='" + ms_sncode.Text + "' and mb_makecode='" + ms_makecode.Text + "'");
|
|
|
//取消最近拆解部件
|
|
|
- SQLS.Add("update craftmaterial set cm_lastdeco=0 where cm_sncode='" + ms_sncode.Text + "' and cm_makecode='" + ms_makecode.Text + "' and nvl(cm_lastdeco,0)<>0");
|
|
|
+ SQLS.Add("update craftmaterial set cm_lastdeco=0 where cm_sncode='" + ms_sncode.Text + "' and cm_makecode='" + ms_makecode.Text + "' and nvl(cm_lastdeco,0)<>0");
|
|
|
dh.ExecuteSQLTran(SQLS.ToArray());
|
|
|
LogicHandler.InsertMakeProcess(ms_sncode.Text, ms_makecode.Text, User.UserSourceCode, "回流工序", "完成维修回流", User.UserCode);
|
|
|
LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, macode, User.UserLineCode, User.UserSourceCode, "回流工序", "完成维修回流", ms_sncode.Text, ms_checkno.Text);
|
|
@@ -703,6 +706,13 @@ namespace UAS_MES.Make
|
|
|
OperatResult.AppendText(">>解决方案不存在\n", Color.Red);
|
|
|
return;
|
|
|
}
|
|
|
+ //保存选择记录至后台,根据岗位资源代码记录
|
|
|
+ List<string> SQLS = new List<string>();
|
|
|
+ SQLS.Add("merge into DATAINPUTRECORD using (select NRG_NAME from QUA_NGREASONGROUP where NRG_NAME = '" + nrg_name.Text + "') ON (NRG_NAME = DIR_COMMENT AND DIR_GROUP = '不良原因组' and DIR_SOURCECODE = '" + User.UserSourceCode + "') when matched then update set DIR_NUMBER = DIR_NUMBER +1 when not matched then insert (DIR_COMMENT,DIR_NUMBER,DIR_SOURCECODE,DIR_GROUP) VALUES (NRG_NAME,1,'" + User.UserSourceCode + "','不良原因组')");
|
|
|
+ SQLS.Add("merge into DATAINPUTRECORD using (select nr_name from QUA_NGReason left join QUA_NGREASONGROUPDET on nrgd_nrcode=nr_code left join QUA_NGREASONGROUP on nrgd_nrgid=nrg_id where nr_name = '" + nr_name.Text + "' and NRG_NAME = '" + nrg_name.Text + "') ON (nr_name = DIR_COMMENT AND DIR_GROUP = '不良原因' and DIR_SOURCECODE = '" + User.UserSourceCode + "') when matched then update set DIR_NUMBER = DIR_NUMBER +1 when not matched then insert (DIR_COMMENT,DIR_NUMBER,DIR_SOURCECODE,DIR_GROUP) VALUES (nr_name,1,'" + User.UserSourceCode + "','不良原因')");
|
|
|
+ SQLS.Add("merge into DATAINPUTRECORD using (select nd_name from ngduty where nd_name = '" + mbr_dutyname.Text + "') ON (nd_name = DIR_COMMENT AND DIR_GROUP = '责任别' and DIR_SOURCECODE = '" + User.UserSourceCode + "') when matched then update set DIR_NUMBER = DIR_NUMBER +1 when not matched then insert (DIR_COMMENT,DIR_NUMBER,DIR_SOURCECODE,DIR_GROUP) VALUES (nd_name,1,'" + User.UserSourceCode + "','责任别')");
|
|
|
+ SQLS.Add("merge into DATAINPUTRECORD using (select so_name from solution where so_name = '" + so_name.Text + "') ON (so_name = DIR_COMMENT AND DIR_GROUP = '解决方案' and DIR_SOURCECODE = '" + User.UserSourceCode + "') when matched then update set DIR_NUMBER = DIR_NUMBER +1 when not matched then insert (DIR_COMMENT,DIR_NUMBER,DIR_SOURCECODE,DIR_GROUP) VALUES (so_name,1,'" + User.UserSourceCode + "','解决方案')");
|
|
|
+ dh.ExecuteSQLTran(SQLS.ToArray());
|
|
|
//保存不良原因
|
|
|
sql.Clear();
|
|
|
sql.Append("insert into makebadreason (mbr_mbid,mbr_id,mbr_brcode,mbr_solutioncode,");
|
|
@@ -915,7 +925,7 @@ namespace UAS_MES.Make
|
|
|
{
|
|
|
if (nrg_code.Text == "" || (nrg_code.Text != "" && nrg_code.Text != nrg_name.Value))
|
|
|
nrg_code.Text = nrg_name.Value;
|
|
|
- nr_name.Condition = "nrg_code in('" + (nrg_code.Text == "" ? "''" : nrg_code.Text) + "')";
|
|
|
+ nr_name.Condition = "nrg_code in('" + (nrg_code.Text == "" ? "''" : nrg_code.Text) + "') ORDER BY NVL(DIR_NUMBER,0) DESC,ROWNUM asc";
|
|
|
}
|
|
|
|
|
|
private void mbr_dutyname_UserControlTextChanged(object sender, EventArgs e)
|