Procházet zdrojové kódy

Merge branch 'master' of ssh://10.10.100.21/source/mes-client

Hcsy před 8 roky
rodič
revize
5586f1ce03

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

@@ -222,7 +222,7 @@ namespace UAS_MES.Make
                 }
                 //判定通过进行打印
                 //doc = lbl.Documents.Open(PrintLabel.Text);
-                if (Print.CodeSoft(Tag.ToString(), lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, inputValue.Text, int.Parse(printNum.Text),ms_makecode.Text,pr_code.Text,giftBox.Checked?"彩盒标":"机身标","-1",out errorMessage))
+                if (Print.CodeSoft(Tag.ToString(), ref lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, inputValue.Text, int.Parse(printNum.Text),ms_makecode.Text,pr_code.Text,giftBox.Checked?"彩盒标":"机身标","-1",out errorMessage))
                 {
                     //按照打印张数打印
                     OperateResult.AppendText("<<打印成功\n", Color.Green);
@@ -254,7 +254,7 @@ namespace UAS_MES.Make
                     return;
                 }
                 //doc = lbl.Documents.Open(PrintLabel.Text);
-                if (Print.CodeSoft(Tag.ToString(), lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, inputValue.Text, int.Parse(printNum.Text),ms_makecode.Text,pr_code.Text,"卡通箱标","-1",out errorMessage))
+                if (Print.CodeSoft(Tag.ToString(), ref lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, inputValue.Text, int.Parse(printNum.Text),ms_makecode.Text,pr_code.Text,"卡通箱标","-1",out errorMessage))
                 {
                     //判断通过,打印
                     OperateResult.AppendText("<<打印成功\n", Color.Green);

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

@@ -217,19 +217,19 @@ namespace UAS_MES.Make
                     BadCodeTree.Nodes.Clear();
                     return;
                 }
-                dt = (DataTable)dh.ExecuteSql("select mb_stepcode from makebad where mb_sncode='" + GetSNCode.Text + "' and mb_status=0 order by mb_id desc", "select");
-                //打不良的资源和当前资源相等可以快速维修,无须登录维修资源
-                bool QuickRepair = false;
-                if (dt.Rows.Count > 0)
-                {
-                    if (dt.Rows[0]["mb_stepcode"].ToString() == User.CurrentStepCode)
-                    {
-                        QuickRepair = true;
-                    }
-                }
+                //dt = (DataTable)dh.ExecuteSql("select mb_stepcode from makebad where mb_sncode='" + GetSNCode.Text + "' and mb_status=0 order by mb_id desc", "select");
+                ////打不良的资源和当前资源相等可以快速维修,无须登录维修资源
+                //bool QuickRepair = false;
+                //if (dt.Rows.Count > 0)
+                //{
+                //    if (dt.Rows[0]["mb_stepcode"].ToString() == User.CurrentStepCode)
+                //    {
+                //        QuickRepair = true;
+                //    }
+                //}
                 string ErrorMessage = "";
                 //验证工序是否正确
-                if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrorMessage) || QuickRepair)
+                if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrorMessage))
                 {
                     BadInf_1.Clear();
                     string oStatus = "";

+ 6 - 1
UAS-MES/PublicMethod/BaseUtil.cs

@@ -1006,7 +1006,12 @@ namespace UAS_MES.PublicMethod
             int PID = 0;
             for (int i = 0; i < processes.Length; i++)
             {
-                ProInf.Add(processes[i].StartTime.ToString(), processes[i].Id);
+                try
+                {
+                    ProInf.Add(processes[i].StartTime.ToString(), processes[i].Id);
+                }
+                catch {
+                }
             }
             var temp = ProInf.Keys.Max();
             String str = SystemInf.ProcessesID + "|" + ProInf[temp];

+ 2 - 1
UAS-MES/PublicMethod/Print.cs

@@ -120,7 +120,7 @@ namespace UAS_MES.PublicMethod
         }
 
 
-        public static bool CodeSoft(string iCaller, ApplicationClass lbl, string LabelName, string LaID, string PrinterName, string SnCode, int PrintNum, string MakeCode, string ProdCode, string LabelType, string IfRePrint, out string ErrorMessage)
+        public static bool CodeSoft(string iCaller, ref ApplicationClass lbl, string LabelName, string LaID, string PrinterName, string SnCode, int PrintNum, string MakeCode, string ProdCode, string LabelType, string IfRePrint, out string ErrorMessage)
         {
             ErrorMessage = "";
             DataTable dt = new DataTable();
@@ -154,6 +154,7 @@ namespace UAS_MES.PublicMethod
             }
             if (PrintFile.LastWriteTime.ToString() != filelastwritetime)
             {
+                lbl.Quit();
                 lbl = new ApplicationClass();
                 BaseUtil.WriteLbl(lbl);
                 dh.UpdateByCondition("label", "la_lastwritetime = to_date('"+PrintFile.LastWriteTime.ToString()+"', 'yyyy-mm-dd hh24:mi:ss') ", "la_id = '"+ LaID + "'");