Просмотр исходного кода

维修次数修改,设备最大使用次数修改

callm 2 дней назад
Родитель
Сommit
7e419c89f7

+ 20 - 2
UAS_MES_JWS/FunctionCode/Make/Make_Repair.cs

@@ -622,9 +622,27 @@ namespace UAS_MES_NEW.Make
                             return;
                         }
                         if (ms_ifrework == "0")
-                            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_status=1,ms_qccheck=-1 where ms_id='" + msid + "'");
+                        {
+                            if (ms_stepcode == "B_TEST02")
+                            {
+                                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_status=1,ms_qccheck=-1 where ms_id='" + msid + "'");
+                            }
+                            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_status=1 where ms_id='" + msid + "'");
+                            }
+                        }
                         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,ms_qccheck=-1 where ms_id='" + msid + "'");
+                        {
+                            if (ms_stepcode == "B_TEST02")
+                            {
+                                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,ms_qccheck=-1 where ms_id='" + msid + "'");
+                            }
+                            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 + "' or mb_mscode='" + ms_sncode.Text + "') and mb_makecode='" + ms_makecode.Text + "'");
                     //取消最近拆解部件

+ 4 - 3
UAS_MES_JWS/FunctionCode/Make/Make_TestCollection.cs

@@ -235,13 +235,14 @@ namespace UAS_MES_NEW.Make
                         }
                         if (DeviceCode.Text != "")
                         {
-                            dt = (DataTable)dh.ExecuteSql("select nvl(0,de_usercount)de_usercount from device where de_code='" + DeviceCode.Text + "'", "select");
+                            dt = (DataTable)dh.ExecuteSql("select nvl(0,de_usercount)de_usercount,nvl(de_maxusecount,0)de_maxusecount from device where de_code='" + DeviceCode.Text + "'", "select");
                             if (dt.Rows.Count > 0)
                             {
                                 string de_usercount = dt.Rows[0]["de_usercount"].ToString();
-                                if (int.Parse(de_usercount) > 5000)
+                                string de_maxusecount = dt.Rows[0]["de_maxusecount"].ToString();
+                                if (double.Parse(de_usercount) > double.Parse(de_maxusecount))
                                 {
-                                    OperateResult.AppendText(">>" + DeviceCode.Text + " 设备当前使用次数" + de_usercount + "\n", Color.Red);
+                                    OperateResult.AppendText(">>" + DeviceCode.Text + " 设备当前使用次数" + de_usercount + ",最大使用次数" + de_maxusecount + "\n", Color.Red);
                                 }
                                 dh.ExecuteSql("update device set de_usercount=nvl(de_usercount,0)+1 where de_code='" + DeviceCode.Text + "'", "update");
                             }