3 Commits 43d6192a2c ... ee827a7715

Tác giả SHA1 Thông báo Ngày
  callm ee827a7715 暗码核对,中箱核对功能 1 tuần trước cách đây
  callm 37725c8307 去除参数配置 1 tuần trước cách đây
  callm f56e9393d2 修改过度标签打印功能 1 tuần trước cách đây

+ 21 - 27
UAS_MES_HYSX/FunctionCode/SystemSetting/SystemSetting_PrinterTest.cs

@@ -1,17 +1,11 @@
-using Seagull.BarTender.Print;
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
+using System;
 using System.Data;
 using System.Drawing;
 using System.Drawing.Printing;
-using System.Linq;
-using System.Text;
 using System.Windows.Forms;
 using UAS_MES_NEW.DataOperate;
 using UAS_MES_NEW.Entity;
 using UAS_MES_NEW.PublicMethod;
-using static System.Runtime.CompilerServices.RuntimeHelpers;
 
 namespace UAS_MES_NEW.SystemSetting
 {
@@ -86,8 +80,8 @@ namespace UAS_MES_NEW.SystemSetting
                         {
                             case "SN":
                                 format.NamedSubStrings.Item(j + 1).Value = (macode + ";" + lpad(int.Parse(numericUpDown1.Value.ToString()), (temp).ToString()));
-                                if (!dh.CheckExist("makesnlist", "msl_sncode='" + format.NamedSubStrings.Item(j + 1).Value + "' and msl_makecode='" + macode + "'"))
-                                    dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type,msl_printstatus)values(makesnlist_seq.nextval,sysdate,'" + macode + "','" + format.NamedSubStrings.Item(j + 1).Value + "','before',-1)", "insert");
+                                if (!dh.CheckExist("makesnlist", "msl_sncode='" + format.NamedSubStrings.Item(j + 1).Value + "' and msl_makecode='" + ma_code.Text + "'"))
+                                    dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type,msl_printstatus)values(makesnlist_seq.nextval,sysdate,'" + ma_code.Text + "','" + format.NamedSubStrings.Item(j + 1).Value + "','before',-1)", "insert");
                                 break;
                             case "COLOR":
                                 format.NamedSubStrings.Item(j + 1).Value = Color.Text;
@@ -128,13 +122,13 @@ namespace UAS_MES_NEW.SystemSetting
                         {
                             case "SN":
                                 format.NamedSubStrings.Item(j + 1).Value = (macode + ";" + lpad(int.Parse(numericUpDown1.Value.ToString()), (temp).ToString()));
-                                if (!dh.CheckExist("makesnlist", "msl_sncode='" + format.NamedSubStrings.Item(j + 1).Value + "' and msl_makecode='" + macode + "'"))
-                                    dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type,msl_printstatus)values(makesnlist_seq.nextval,sysdate,'" + macode + "','" + format.NamedSubStrings.Item(j + 1).Value + "','before',-1)", "insert");
+                                if (!dh.CheckExist("makesnlist", "msl_sncode='" + format.NamedSubStrings.Item(j + 1).Value + "' and msl_makecode='" + ma_code.Text + "'"))
+                                    dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type,msl_printstatus)values(makesnlist_seq.nextval,sysdate,'" + ma_code.Text + "','" + format.NamedSubStrings.Item(j + 1).Value + "','before',-1)", "insert");
                                 break;
                             case "SN2":
                                 format.NamedSubStrings.Item(j + 1).Value = (macode + ";" + lpad(int.Parse(numericUpDown1.Value.ToString()), (temp + 1).ToString()));
-                                if (!dh.CheckExist("makesnlist", "msl_sncode='" + format.NamedSubStrings.Item(j + 1).Value + "' and msl_makecode='" + macode + "'"))
-                                    dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type,msl_printstatus)values(makesnlist_seq.nextval,sysdate,'" + macode + "','" + format.NamedSubStrings.Item(j + 1).Value + "','before',-1)", "insert");
+                                if (!dh.CheckExist("makesnlist", "msl_sncode='" + format.NamedSubStrings.Item(j + 1).Value + "' and msl_makecode='" + ma_code.Text + "'"))
+                                    dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type,msl_printstatus)values(makesnlist_seq.nextval,sysdate,'" + ma_code.Text + "','" + format.NamedSubStrings.Item(j + 1).Value + "','before',-1)", "insert");
                                 break;
                             default:
                                 break;
@@ -166,18 +160,18 @@ namespace UAS_MES_NEW.SystemSetting
                         {
                             case "SN":
                                 format.NamedSubStrings.Item(j + 1).Value = (macode + ";" + lpad(int.Parse(numericUpDown1.Value.ToString()), (temp).ToString()));
-                                if (!dh.CheckExist("makesnlist", "msl_sncode='" + format.NamedSubStrings.Item(j + 1).Value + "' and msl_makecode='" + macode + "'"))
-                                    dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type,msl_printstatus)values(makesnlist_seq.nextval,sysdate,'" + macode + "','" + format.NamedSubStrings.Item(j + 1).Value + "','before',-1)", "insert");
+                                if (!dh.CheckExist("makesnlist", "msl_sncode='" + format.NamedSubStrings.Item(j + 1).Value + "' and msl_makecode='" + ma_code.Text + "'"))
+                                    dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type,msl_printstatus)values(makesnlist_seq.nextval,sysdate,'" + ma_code.Text + "','" + format.NamedSubStrings.Item(j + 1).Value + "','before',-1)", "insert");
                                 break;
                             case "SN2":
                                 format.NamedSubStrings.Item(j + 1).Value = (macode + ";" + lpad(int.Parse(numericUpDown1.Value.ToString()), (temp + 1).ToString()));
-                                if (!dh.CheckExist("makesnlist", "msl_sncode='" + format.NamedSubStrings.Item(j + 1).Value + "' and msl_makecode='" + macode + "'"))
-                                    dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type,msl_printstatus)values(makesnlist_seq.nextval,sysdate,'" + macode + "','" + format.NamedSubStrings.Item(j + 1).Value + "','before',-1)", "insert");
+                                if (!dh.CheckExist("makesnlist", "msl_sncode='" + format.NamedSubStrings.Item(j + 1).Value + "' and msl_makecode='" + ma_code.Text + "'"))
+                                    dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type,msl_printstatus)values(makesnlist_seq.nextval,sysdate,'" + ma_code.Text + "','" + format.NamedSubStrings.Item(j + 1).Value + "','before',-1)", "insert");
                                 break;
                             case "SN3":
                                 format.NamedSubStrings.Item(j + 1).Value = (macode + ";" + lpad(int.Parse(numericUpDown1.Value.ToString()), (temp + 2).ToString()));
-                                if (!dh.CheckExist("makesnlist", "msl_sncode='" + format.NamedSubStrings.Item(j + 1).Value + "' and msl_makecode='" + macode + "'"))
-                                    dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type,msl_printstatus)values(makesnlist_seq.nextval,sysdate,'" + macode + "','" + format.NamedSubStrings.Item(j + 1).Value + "','before',-1)", "insert");
+                                if (!dh.CheckExist("makesnlist", "msl_sncode='" + format.NamedSubStrings.Item(j + 1).Value + "' and msl_makecode='" + ma_code.Text + "'"))
+                                    dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type,msl_printstatus)values(makesnlist_seq.nextval,sysdate,'" + ma_code.Text + "','" + format.NamedSubStrings.Item(j + 1).Value + "','before',-1)", "insert");
                                 break;
                             default:
                                 break;
@@ -209,23 +203,23 @@ namespace UAS_MES_NEW.SystemSetting
                         {
                             case "SN":
                                 format.NamedSubStrings.Item(j + 1).Value = (macode + ";" + lpad(int.Parse(numericUpDown1.Value.ToString()), (temp).ToString()));
-                                if (!dh.CheckExist("makesnlist", "msl_sncode='" + format.NamedSubStrings.Item(j + 1).Value + "' and msl_makecode='" + macode + "'"))
-                                    dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type,msl_printstatus)values(makesnlist_seq.nextval,sysdate,'" + macode + "','" + format.NamedSubStrings.Item(j + 1).Value + "','before',-1)", "insert");
+                                if (!dh.CheckExist("makesnlist", "msl_sncode='" + format.NamedSubStrings.Item(j + 1).Value + "' and msl_makecode='" + ma_code.Text + "'"))
+                                    dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type,msl_printstatus)values(makesnlist_seq.nextval,sysdate,'" + ma_code.Text + "','" + format.NamedSubStrings.Item(j + 1).Value + "','before',-1)", "insert");
                                 break;
                             case "SN2":
                                 format.NamedSubStrings.Item(j + 1).Value = (macode + ";" + lpad(int.Parse(numericUpDown1.Value.ToString()), (temp + 1).ToString()));
-                                if (!dh.CheckExist("makesnlist", "msl_sncode='" + format.NamedSubStrings.Item(j + 1).Value + "' and msl_makecode='" + macode + "'"))
-                                    dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type,msl_printstatus)values(makesnlist_seq.nextval,sysdate,'" + macode + "','" + format.NamedSubStrings.Item(j + 1).Value + "','before',-1)", "insert");
+                                if (!dh.CheckExist("makesnlist", "msl_sncode='" + format.NamedSubStrings.Item(j + 1).Value + "' and msl_makecode='" + ma_code.Text + "'"))
+                                    dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type,msl_printstatus)values(makesnlist_seq.nextval,sysdate,'" + ma_code.Text + "','" + format.NamedSubStrings.Item(j + 1).Value + "','before',-1)", "insert");
                                 break;
                             case "SN3":
                                 format.NamedSubStrings.Item(j + 1).Value = (macode + ";" + lpad(int.Parse(numericUpDown1.Value.ToString()), (temp + 2).ToString()));
-                                if (!dh.CheckExist("makesnlist", "msl_sncode='" + format.NamedSubStrings.Item(j + 1).Value + "' and msl_makecode='" + macode + "'"))
-                                    dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type,msl_printstatus)values(makesnlist_seq.nextval,sysdate,'" + macode + "','" + format.NamedSubStrings.Item(j + 1).Value + "','before',-1)", "insert");
+                                if (!dh.CheckExist("makesnlist", "msl_sncode='" + format.NamedSubStrings.Item(j + 1).Value + "' and msl_makecode='" + ma_code.Text + "'"))
+                                    dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type,msl_printstatus)values(makesnlist_seq.nextval,sysdate,'" + ma_code.Text + "','" + format.NamedSubStrings.Item(j + 1).Value + "','before',-1)", "insert");
                                 break;
                             case "SN4":
                                 format.NamedSubStrings.Item(j + 1).Value = (macode + ";" + lpad(int.Parse(numericUpDown1.Value.ToString()), (temp + 3).ToString()));
-                                if (!dh.CheckExist("makesnlist", "msl_sncode='" + format.NamedSubStrings.Item(j + 1).Value + "' and msl_makecode='" + macode + "'"))
-                                    dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type,msl_printstatus)values(makesnlist_seq.nextval,sysdate,'" + macode + "','" + format.NamedSubStrings.Item(j + 1).Value + "','before',-1)", "insert");
+                                if (!dh.CheckExist("makesnlist", "msl_sncode='" + format.NamedSubStrings.Item(j + 1).Value + "' and msl_makecode='" + ma_code.Text + "'"))
+                                    dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type,msl_printstatus)values(makesnlist_seq.nextval,sysdate,'" + ma_code.Text + "','" + format.NamedSubStrings.Item(j + 1).Value + "','before',-1)", "insert");
                                 break;
                             default:
                                 break;

+ 0 - 1
UAS_MES_XMW/App.config

@@ -13,7 +13,6 @@
   </configSections>
   <startup useLegacyV2RuntimeActivationPolicy="true"> 
     <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
-    <supportedRuntime version="v2.0.50727" />
   </startup>
   <userSettings>
     <UAS_MES_NEW.Properties.Settings>

+ 2 - 1
UAS_MES_YDCY/FunctionCode/Make/Make_SNLabelCheckDark.cs

@@ -263,6 +263,8 @@ namespace UAS_MES_NEW.Make
                                     return;
                                 }
                                 OperateResult.AppendText(">>校验完成\n", Color.Green, code);
+                                sn_code.Text = "";
+                                code.Str = ma_prodcode.Text;
                             }
                         }
                     }
@@ -428,7 +430,6 @@ namespace UAS_MES_NEW.Make
 
         private void ma_prodcode_TextChanged(object sender, EventArgs e)
         {
-           
             code.Str = ma_prodcode.Text;
         }
     }

+ 13 - 5
UAS_MES_YDCY/FunctionCode/Make/Make_SNLabelCheckMidBox.cs

@@ -260,23 +260,31 @@ namespace UAS_MES_NEW.Make
                                 double ActualWeight = double.Parse(weight.Text == "" ? "0" : weight.Text.Replace("kg", "").Replace("g", "").Trim());
                                 if (MinWeight == 0 || MaxWeight == 0)
                                 {
-                                    OperateResult.AppendText(">>产品" + ma_prodcode.Text + "未维护彩盒重量范围\n", Color.Red);
+                                    OperateResult.AppendText(">>产品" + ma_prodcode.Text + "未维护中箱重量范围\n", Color.Red);
                                     return;
                                 }
                                 if ((ActualWeight >= MinWeight) && (ActualWeight <= MaxWeight))
                                 {
-                                    OperateResult.AppendText(">>彩盒" + sn_code.Text + "重量检测检测合格\n", Color.Green);
-                                    LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "彩盒称重:" + weight.Text, "称量合格", sn_code.Text, "");
+                                    OperateResult.AppendText(">>中箱" + sn_code.Text + "重量检测检测合格\n", Color.Green);
+                                    LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "中箱称重:" + weight.Text, "称量合格", sn_code.Text, "");
                                     LogicHandler.RecordProdWeight(sn_code.Text, "SN", float.Parse(ActualWeight.ToString()), "kg", User.UserLineCode, ma_prodcode.Text, User.UserSourceCode, User.UserName);
                                     dh.ExecuteSql("update makeserial set ms_grossw='" + ActualWeight + "' where ms_id='" + oMsid + "'", "update");
                                 }
                                 else
                                 {
-                                    OperateResult.AppendText(">>彩盒" + sn_code.Text + "重量检测未通过\n", Color.Red);
-                                    LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "彩盒称重:" + weight.Text, "称量不合格", sn_code.Text, "");
+                                    OperateResult.AppendText(">>中箱" + sn_code.Text + "重量检测未通过\n", Color.Red);
+                                    LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "中箱称重:" + weight.Text, "称量不合格", sn_code.Text, "");
                                     LogicHandler.RecordProdWeight(sn_code.Text, "SN", float.Parse(ActualWeight.ToString()), "kg", User.UserLineCode, ma_prodcode.Text, User.UserSourceCode, User.UserName);
                                     return;
                                 }
+                                //如果称重到了50个,则重量信息重新自动设置到产品信息
+                                int weight_count = dh.getRowCount("makeserail", " ms_makecode='" + ma_code.Text + "' and ms_midboxweight is not null");
+                                if (weight_count == 50)
+                                {
+                                    double pr_miderror = double.Parse(dh.getFieldDataByCondition("product", "nvl(pr_miderror,0)", "pr_code='" + ma_prodcode.Text + "'").ToString());
+                                    double avgweight = double.Parse(dh.getFieldDataByCondition("makeserial", "sum(ms_midboxweight)/50", " ms_makecode='" + ma_code.Text + "' and ms_outboxcode is not null").ToString());
+                                    dh.ExecuteSql("update product set PR_MIDBOXMINWEIGHT=(" + avgweight + "-" + pr_miderror + "), PR_MIDBOXMAXWEIGHT=(" + avgweight + "+" + pr_miderror + ") where pr_code=v_ms_prodcode", "update");
+                                }
                                 sql.Clear();
                                 sql.Append("insert into labelchecklog(LCL_ID, LCL_SN, LCL_LABELTYPE, lcl_prefix,lcl_length, LCL_LABELVALUE, LCL_STEPCODE, LCL_SOURCECODE," +
                                     " LCL_INMAN, LCL_DATE)" +