Browse Source

维修和站点回调功能优化

callm 1 day ago
parent
commit
fbb30696fe

+ 18 - 0
UAS_MES_XMW/FunctionCode/Make/Make_Repair.cs

@@ -537,6 +537,14 @@ namespace UAS_MES_NEW.Make
                 OperatResult.AppendText(">>序列号不允许为空\n", Color.Red);
                 OperatResult.AppendText(">>序列号不允许为空\n", Color.Red);
                 return;
                 return;
             }
             }
+
+
+            if (so_code.Text == "报废")
+            {
+                OperatResult.AppendText(">>解决方案为报废,不允许完成维修\n", Color.Red);
+                return;
+            }
+
             if (ifrework != "0" && reworkstatus == "0")
             if (ifrework != "0" && reworkstatus == "0")
             {
             {
                 if (dh.getRowCount("Makebad", "mb_sncode='" + ms_sncode.Text + "' and mb_makecode='" + ms_makecode.Text + "' and mb_status=0") == 0)
                 if (dh.getRowCount("Makebad", "mb_sncode='" + ms_sncode.Text + "' and mb_makecode='" + ms_makecode.Text + "' and mb_status=0") == 0)
@@ -648,6 +656,11 @@ namespace UAS_MES_NEW.Make
         {
         {
             if (ms_sncode.Text != "")
             if (ms_sncode.Text != "")
             {
             {
+                if (so_code.Text == "返工")
+                {
+                    OperatResult.AppendText(">>解决方案为返工,不允许报废\n", Color.Red);
+                    return;
+                }
                 //判断是否有无法维修的记录
                 //判断是否有无法维修的记录
                 int ScrapNum = int.Parse(dh.getFieldDataByCondition("makebadreason left join makebad on mb_id=mbr_mbid", "count(0) cn", "mb_sncode='" + ms_sncode.Text + "' and mb_status=0").ToString());
                 int ScrapNum = int.Parse(dh.getFieldDataByCondition("makebadreason left join makebad on mb_id=mbr_mbid", "count(0) cn", "mb_sncode='" + ms_sncode.Text + "' and mb_status=0").ToString());
                 if (ScrapNum == 0)
                 if (ScrapNum == 0)
@@ -1007,7 +1020,12 @@ namespace UAS_MES_NEW.Make
         private void so_name_UserControlTextChanged(object sender, EventArgs e)
         private void so_name_UserControlTextChanged(object sender, EventArgs e)
         {
         {
             if (so_code.Text == "" || (so_code.Text != "" && so_code.Text != so_name.Value))
             if (so_code.Text == "" || (so_code.Text != "" && so_code.Text != so_name.Value))
+            {
                 so_code.Text = so_name.Value;
                 so_code.Text = so_name.Value;
+
+            }
+
+
         }
         }
 
 
         private void BadCodeTree_AfterSelect(object sender, TreeViewEventArgs e)
         private void BadCodeTree_AfterSelect(object sender, TreeViewEventArgs e)

+ 4 - 0
UAS_MES_XMW/FunctionCode/Special/Special_Reset.cs

@@ -72,6 +72,10 @@ namespace UAS_MES_NEW.Special
             sql.Append("cm_dropdate =sysdate,CM_REMARK = '重置站点拆解',cm_dropstep='" + User.CurrentStepCode + "',");
             sql.Append("cm_dropdate =sysdate,CM_REMARK = '重置站点拆解',cm_dropstep='" + User.CurrentStepCode + "',");
             sql.Append("cm_dropsccode='" + User.UserSourceCode + "' where cm_sncode = '" + sncode + "' and cm_makecode='" + makecode + "' and cm_stepcode in (select cd_stepcode from craftdetail left join step on st_code=cd_stepcode left join craft on cd_crid=cr_id where ST_STATUSCODE='AUDITED' and cr_code='" + cr_code.Text + "' and cr_prodcode='" + ms_prodcode.Text + "' and cd_detno >=" + cd_stepno.Text + " )");
             sql.Append("cm_dropsccode='" + User.UserSourceCode + "' where cm_sncode = '" + sncode + "' and cm_makecode='" + makecode + "' and cm_stepcode in (select cd_stepcode from craftdetail left join step on st_code=cd_stepcode left join craft on cd_crid=cr_id where ST_STATUSCODE='AUDITED' and cr_code='" + cr_code.Text + "' and cr_prodcode='" + ms_prodcode.Text + "' and cd_detno >=" + cd_stepno.Text + " )");
             dh.ExecuteSql(sql.GetString(), "update");
             dh.ExecuteSql(sql.GetString(), "update");
+
+            sql.Clear();
+            sql.Append("update steppassed set sp_ifvalid=-1 where sp_stepcode in (select cd_stepcode from craftdetail left join step on st_code=cd_stepcode left join craft on cd_crid=cr_id where ST_STATUSCODE='AUDITED' and cr_code='" + cr_code.Text + "' and cr_prodcode='" + ms_prodcode.Text + "' and cd_detno >=" + cd_stepno.Text + " ) and sp_sncode='" + sncode + "'");
+            dh.ExecuteSql(sql.GetString(), "update");
             LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_makecode.Text, User.UserLineCode, User.UserSourceCode, "站点重置", "站点重置至" + stname, sncode, "");
             LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_makecode.Text, User.UserLineCode, User.UserSourceCode, "站点重置", "站点重置至" + stname, sncode, "");
             return true;
             return true;
         }
         }