Browse Source

SN号生成修改

callm 3 months ago
parent
commit
8f9c141339

+ 2 - 2
UAS_MES_JC/FunctionCode/Make/Make_FeedingCollection.cs

@@ -146,10 +146,10 @@ namespace UAS_MES_NEW.Make
                         }
                         else if (sn_code.Text != "")
                         {
-                            if (dh.CheckExist("makesnlist", "msl_sncode='" + code.Text + "'") && pr_lightbox == "0")
+                            if (dh.CheckExist("makesnlist", "msl_sncode='" + code.Text + "' and msl_makecode='" + ma_code.Text + "'") && pr_lightbox == "0")
                             {
                                 if (CollectDataSonCode.ToArray().Length > 0)
-                                {
+                                {  
                                     sql.Clear();
                                     sql.Append("insert into Craftmaterial (cm_id ,cm_makecode,cm_maid,cm_maprodcode, cm_soncode, cm_mscode, cm_sncode, cm_stepcode, cm_stepname,cm_fsoncode,");
                                     sql.Append("cm_craftcode,cm_craftname,cm_barcode,cm_inqty,cm_indate,cm_inman,cm_linecode,cm_wccode,cm_sourcecode,cm_spid,cm_status,cm_materialtype,cm_firstsn)");

+ 1 - 1
UAS_MES_JC/FunctionCode/Make/Make_TestCollectionModule.cs

@@ -248,7 +248,7 @@ namespace UAS_MES_NEW.Make
                             {
                                 if (needdata&&GoodProduct.Checked)
                                 {
-                                    dh.ExecuteSql("insert into STEPTESTDETAIL (std_id,std_sn,std_makecode,std_indate,STD_RESCODE,std_stepcode,STD_TESTRESULT,std_class)select STEPTESTDETAIL_seq.nextval,'" + arr[i] + "','" + oMakeCode + "',sysdate,'" + User.UserSourceCode + "','" + User.CurrentStepCode + "','','http://10.1.81.208:8099/ftp" + ftppath + sn + FilePath.Text.Substring(FilePath.Text.LastIndexOf(".")) + "' from dual", "insert");
+                                    dh.ExecuteSql("insert into STEPTESTDETAIL (std_id,std_sn,std_makecode,std_indate,STD_RESCODE,std_stepcode,STD_TESTRESULT,std_class)select STEPTESTDETAIL_seq.nextval,'" + arr[i] + "','" + oMakeCode + "',sysdate,'" + User.UserSourceCode + "','" + User.CurrentStepCode + "','','http://172.16.51.3:8099/ftp" + ftppath + sn + FilePath.Text.Substring(FilePath.Text.LastIndexOf(".")) + "' from dual", "insert");
                                 }
                                 //是否提示过工单切换框,检测前后执行
                                 if (!LogicHandler.CheckDiffMakeCodeAfterStepCheck(ms_sncode.Text, oMakeCode, NoteForChange.Checked, NoteAlready, ma_code, out ErrorMessage))

+ 2 - 2
UAS_MES_JC/FunctionCode/Query/Query_SN.cs

@@ -147,7 +147,7 @@ namespace UAS_MES_NEW.Query
                 pr_exbarcode = dt.Rows[0]["pr_exbarcode"].ToString();
                 ma_qty = dt.Rows[0]["ma_qty"].ToString();
             }
-            if (dh.getRowCount("makesnlist", "msl_makecode='" + ma_code.Text + "'") + int.Parse(ma_qty) > int.Parse(ma_qty))
+            if (dh.getRowCount("makesnlist", "msl_makecode='" + ma_code.Text + "'") + PrintNum.Value > int.Parse(ma_qty))
             {
                 MessageBox.Show("工单号" + ma_code.Text + "生产序列号超出工单数");
                 return;
@@ -237,7 +237,7 @@ namespace UAS_MES_NEW.Query
             }
             //遍历整个Grid,勾选的项目全部进行条码生成
             ArrayList<string> custbarcode = new ArrayList<string>();
-            for (int i = 0; i < int.Parse(ma_qty); i++)
+            for (int i = 0; i < PrintNum.Value; i++)
             {
                 string data = BarcodeMethod1(PrefixFixed, Suffix, SerialNumIndex, SerialNumLength, Radix);
                 if (!custbarcode.Contains(data))

+ 2 - 2
UAS_MES_JC/FunctionCode/Query/Query_SN1.cs

@@ -146,7 +146,7 @@ namespace UAS_MES_NEW.Query
                 pr_exbarcode = dt.Rows[0]["pr_exbarcode"].ToString();
                 ma_qty = dt.Rows[0]["ma_qty"].ToString();
             }
-            if (dh.getRowCount("makesnlist", "msl_makecode='" + ma_code.Text + "'") + int.Parse(ma_qty) > int.Parse(ma_qty))
+            if (dh.getRowCount("makesnlist", "msl_makecode='" + ma_code.Text + "'") + PrintNum.Value > int.Parse(ma_qty))
             {
                 MessageBox.Show("工单号" + ma_code.Text + "生产序列号超出工单数");
                 return;
@@ -236,7 +236,7 @@ namespace UAS_MES_NEW.Query
             }
             //遍历整个Grid,勾选的项目全部进行条码生成
             ArrayList<string> custbarcode = new ArrayList<string>();
-            for (int i = 0; i < int.Parse(ma_qty); i++)
+            for (int i = 0; i < PrintNum.Value; i++)
             {
                 string data = BarcodeMethod1(PrefixFixed, Suffix, SerialNumIndex, SerialNumLength, Radix);
                 if (!custbarcode.Contains(data))