Browse Source

修改维修过站不重复记录PastStep

章政 8 năm trước cách đây
mục cha
commit
84a311ac11
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      UAS-MES/FunctionCode/Make/Make_Repair.cs

+ 2 - 2
UAS-MES/FunctionCode/Make/Make_Repair.cs

@@ -446,9 +446,9 @@ namespace UAS_MES.Make
                             return;
                         }
                         if (ms_ifrework == "0")
-                            dh.UpdateByCondition("makeserial", "ms_paststep = ms_paststep ||'," + User.CurrentStepCode + "',ms_nextstepcode='" + cd_stepcode.Text + "',ms_craftcode='" + cr_code.Text + "',ms_stepcode='" + User.CurrentStepCode + "',ms_status=1", "ms_id='" + msid + "'");
+                            dh.UpdateByCondition("makeserial", "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_id='" + msid + "'");
                         else
-                            dh.UpdateByCondition("makeserial", "ms_paststep = ms_paststep ||'," + User.CurrentStepCode + "',ms_nextstepcode='" + cd_stepcode.Text + "',ms_craftcode='" + cr_code.Text + "',ms_stepcode='" + User.CurrentStepCode + "',ms_reworkstatus=1", "ms_id='" + msid + "'");
+                            dh.UpdateByCondition("makeserial", "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_id='" + msid + "'");
                     }
                     dh.UpdateByCondition("makebad", "mb_status=-1", "mb_sncode='" + ms_sncode.Text + "' and mb_makecode='" + ms_makecode.Text + "'");
                     LogicHandler.InsertMakeProcess(ms_sncode.Text, ms_makecode.Text, User.UserSourceCode, "回流工序", "完成维修回流", User.UserCode);