Pārlūkot izejas kodu

泽天打印修改

callm 3 gadi atpakaļ
vecāks
revīzija
df90c45c93

+ 4 - 4
UAS-出货标签管理(泽天)/UAS_出货标签管理.Designer.cs

@@ -1926,7 +1926,7 @@
             // 
             this.SingleLabelAutoPrint.AutoSize = true;
             this.SingleLabelAutoPrint.Checked = true;
-            this.SingleLabelAutoPrint.CheckState = System.Windows.Forms.CheckState.Checked;
+            this.SingleLabelAutoPrint.CheckState = System.Windows.Forms.CheckState.Unchecked;
             this.SingleLabelAutoPrint.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.SingleLabelAutoPrint.Location = new System.Drawing.Point(17, 183);
             this.SingleLabelAutoPrint.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
@@ -1974,7 +1974,7 @@
             // 
             this.AutoPrintMidBox.AutoSize = true;
             this.AutoPrintMidBox.Checked = true;
-            this.AutoPrintMidBox.CheckState = System.Windows.Forms.CheckState.Checked;
+            this.AutoPrintMidBox.CheckState = System.Windows.Forms.CheckState.Unchecked;
             this.AutoPrintMidBox.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.AutoPrintMidBox.Location = new System.Drawing.Point(18, 370);
             this.AutoPrintMidBox.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
@@ -1988,7 +1988,7 @@
             // 
             this.CurrentRowOnly.AutoSize = true;
             this.CurrentRowOnly.Checked = true;
-            this.CurrentRowOnly.CheckState = System.Windows.Forms.CheckState.Checked;
+            this.CurrentRowOnly.CheckState = System.Windows.Forms.CheckState.Unchecked;
             this.CurrentRowOnly.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.CurrentRowOnly.Location = new System.Drawing.Point(171, 193);
             this.CurrentRowOnly.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
@@ -2072,7 +2072,7 @@
             // 
             this.MidLabelAutoPrint.AutoSize = true;
             this.MidLabelAutoPrint.Checked = true;
-            this.MidLabelAutoPrint.CheckState = System.Windows.Forms.CheckState.Checked;
+            this.MidLabelAutoPrint.CheckState = System.Windows.Forms.CheckState.Unchecked;
             this.MidLabelAutoPrint.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.MidLabelAutoPrint.Location = new System.Drawing.Point(17, 191);
             this.MidLabelAutoPrint.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);

+ 57 - 38
UAS-出货标签管理(泽天)/UAS_出货标签管理.cs

@@ -398,41 +398,9 @@ namespace UAS_LabelMachine
             string pib_outboxcode2 = "";
 
             int BoxNum = LabelInfDataTable.Select("pib_outboxcode2='" + OutBoxNum.Text + "'").Length;
-            if (BoxNum + CodeCount > OutboxCapacity.Value && AutoSetOutBox.Checked)
+            if (ConnectToMachine)
             {
-                string maxoutbox = dh.getFieldDataByCondition("prodiobarcode", "max(to_number(pib_outboxcode2))", "pib_inoutno='" + pi_inoutno.Text + "'").ToString();
-                //如果没有则从开始插入
-                if (maxoutbox == "")
-                {
-                    pib_outboxcode2 = "1";
-                }
-                else
-                {
-                    pib_outboxcode2 = (int.Parse(maxoutbox) + 1).ToString();
-                }
-                OutBoxNum.Items.Clear();
-
-                DataTable dt = (DataTable)dh.ExecuteSql("select distinct pib_outboxcode2 from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' order by to_number(pib_outboxcode2) desc", "select");
-                ItemObject io = new ItemObject("新增", "新增");
-                OutBoxNum.Items.Add(io);
-                io = new ItemObject("全部", "全部");
-                OutBoxNum.Items.Add(io);
-                io = new ItemObject(pib_outboxcode2, pib_outboxcode2);
-                PassSixTenCount = 1;
-                OutBoxNum.Items.Add(io);
-
-                for (int i = 0; i < dt.Rows.Count; i++)
-                {
-                    string piboutboxcode2 = dt.Rows[i]["pib_outboxcode2"].ToString();
-                    io = new ItemObject(piboutboxcode2, piboutboxcode2);
-                    OutBoxNum.Items.Add(io);
-                }
-                if (OutBoxNum.Items.Count > 2)
-                    OutBoxNum.SelectedIndex = 2;
-            }
-            else
-            {
-                if (OutBoxNum.Text == "新增")
+                if (BoxNum + CodeCount > OutboxCapacity.Value && AutoSetOutBox.Checked)
                 {
                     string maxoutbox = dh.getFieldDataByCondition("prodiobarcode", "max(to_number(pib_outboxcode2))", "pib_inoutno='" + pi_inoutno.Text + "'").ToString();
                     //如果没有则从开始插入
@@ -445,14 +413,16 @@ namespace UAS_LabelMachine
                         pib_outboxcode2 = (int.Parse(maxoutbox) + 1).ToString();
                     }
                     OutBoxNum.Items.Clear();
-                    PassSixTenCount = 1;
+
                     DataTable dt = (DataTable)dh.ExecuteSql("select distinct pib_outboxcode2 from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' order by to_number(pib_outboxcode2) desc", "select");
                     ItemObject io = new ItemObject("新增", "新增");
                     OutBoxNum.Items.Add(io);
                     io = new ItemObject("全部", "全部");
                     OutBoxNum.Items.Add(io);
                     io = new ItemObject(pib_outboxcode2, pib_outboxcode2);
+                    PassSixTenCount = 1;
                     OutBoxNum.Items.Add(io);
+
                     for (int i = 0; i < dt.Rows.Count; i++)
                     {
                         string piboutboxcode2 = dt.Rows[i]["pib_outboxcode2"].ToString();
@@ -464,7 +434,52 @@ namespace UAS_LabelMachine
                 }
                 else
                 {
-                    pib_outboxcode2 = OutBoxNum.Text;
+                    if (OutBoxNum.Text == "新增")
+                    {
+                        string maxoutbox = dh.getFieldDataByCondition("prodiobarcode", "max(to_number(pib_outboxcode2))", "pib_inoutno='" + pi_inoutno.Text + "'").ToString();
+                        //如果没有则从开始插入
+                        if (maxoutbox == "")
+                        {
+                            pib_outboxcode2 = "1";
+                        }
+                        else
+                        {
+                            pib_outboxcode2 = (int.Parse(maxoutbox) + 1).ToString();
+                        }
+                        OutBoxNum.Items.Clear();
+                        PassSixTenCount = 1;
+                        DataTable dt = (DataTable)dh.ExecuteSql("select distinct pib_outboxcode2 from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' order by to_number(pib_outboxcode2) desc", "select");
+                        ItemObject io = new ItemObject("新增", "新增");
+                        OutBoxNum.Items.Add(io);
+                        io = new ItemObject("全部", "全部");
+                        OutBoxNum.Items.Add(io);
+                        io = new ItemObject(pib_outboxcode2, pib_outboxcode2);
+                        OutBoxNum.Items.Add(io);
+                        for (int i = 0; i < dt.Rows.Count; i++)
+                        {
+                            string piboutboxcode2 = dt.Rows[i]["pib_outboxcode2"].ToString();
+                            io = new ItemObject(piboutboxcode2, piboutboxcode2);
+                            OutBoxNum.Items.Add(io);
+                        }
+                        if (OutBoxNum.Items.Count > 2)
+                            OutBoxNum.SelectedIndex = 2;
+                    }
+                    else
+                    {
+                        pib_outboxcode2 = OutBoxNum.Text;
+                    }
+                }
+            }
+            else
+            {
+                if (BoxNum + CodeCount > OutboxCapacity.Value)
+                {
+                    string close = MessageBox.Show(this.ParentForm, "箱号【" + OutBoxNum.Text + "】后超数量为" + (BoxNum + CodeCount) + ",超出容量" + OutboxCapacity.Value + ",是否继续?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
+                    if (close != "Yes")
+                    {
+                        Input.SelectAll();
+                        return;
+                    }
                 }
             }
             if (OutBoxNum.Text == "全部")
@@ -590,7 +605,8 @@ namespace UAS_LabelMachine
             }
             if (CollectQty / double.Parse(CurrentZXBZ) % double.Parse(MidboxCapacity.Value.ToString()) == 0)
             {
-                LabelInf.Rows[LabelInf.Rows.Count - 1].Selected = true;
+                if (LabelInf.Rows.Count > 0)
+                    LabelInf.Rows[LabelInf.Rows.Count - 1].Selected = true;
                 if (AutoPrintMidBox.Checked)
                     MidLabelPrint.PerformClick();
             }
@@ -1260,7 +1276,6 @@ namespace UAS_LabelMachine
                 {
                     if (!MidLabelCombox.SelectedValue.ToString().Contains("System.Data.DataRowView"))
                         MidReport.Load(MidLabelCombox.SelectedValue.ToString());
-                 
                     for (int j = 0; j < MidReport.Parameters.Count; j++)
                     {
                         MidReport.SetParameterValue(MidReport.Parameters[j].Name, "");
@@ -2562,6 +2577,10 @@ namespace UAS_LabelMachine
 
         private void Connect_Click(object sender, EventArgs e)
         {
+            SingleLabelAutoPrint.Checked = true;
+            MidLabelAutoPrint.Checked = true;
+            CurrentRowOnly.Checked = true;
+            AutoPrintMidBox.Checked = true;
             receiveClient = new TcpClient();
             sendClient = new TcpClient();
             resetClient = new TcpClient();

+ 2 - 2
UAS_MES_PW/FunctionCode/Make/Make_ColorBoxWeigh.Designer.cs

@@ -35,7 +35,7 @@
             this.pr_colorboxunit = new System.Windows.Forms.Label();
             this.weight_label = new System.Windows.Forms.Label();
             this.panel4 = new UAS_MES_NEW.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
-            this.weight = new System.Windows.Forms.Label();
+            this.weight = new System.Windows.Forms.TextBox();
             this.label15 = new System.Windows.Forms.Label();
             this.pr_detail_label = new System.Windows.Forms.Label();
             this.ma_qty_label = new System.Windows.Forms.Label();
@@ -930,6 +930,6 @@
         public System.Windows.Forms.Label ob_checkno;
         private CustomControl.CustomCheckBox.LockCheckBox LockMakeCode;
         private CustomControl.TextBoxWithIcon.MaCodeSearchTextBox ma_code;
-        private System.Windows.Forms.Label weight;
+        private System.Windows.Forms.TextBox weight;
     }
 }

+ 40 - 22
UAS_MES_PW/FunctionCode/Make/Make_Repair.cs

@@ -240,10 +240,10 @@ namespace UAS_MES_NEW.Make
                     {
                         //验证makeserial或者ms_firstsn表序列号是否存在
                         sql.Clear();
-                        sql.Append("select max(ms_id) ms_id,ms_makecode,ma_craftcode,ms_stepcode,ms_firstsn,ms_prodcode,ms_sncode,pr_detail,ms_craftcode,ms_checkno,ms_ifrework,ms_reworkcheckno ");
+                        sql.Append("select max(ms_id) ms_id,ms_makecode,ma_craftcode,ms_stepcode,ms_firstsn,ms_prodcode,ms_sncode,ma_bomversion,pr_detail,ms_craftcode,ms_checkno,ms_ifrework,ms_reworkcheckno ");
                         sql.Append("from makeserial left join make on ms_makecode=ma_code left join product on pr_code=ms_prodcode where ms_makecode ='" + macode + "' and ms_sncode in(");
                         sql.Append("select '" + GetSNCode.Text + "' from dual union select firstsn from makesnrelation where ");
-                        sql.Append("sn='" + GetSNCode.Text + "') group by ms_makecode,ms_stepcode,ms_prodcode,ma_craftcode,ms_sncode,pr_detail,ms_firstsn,ms_craftcode,ms_checkno,ms_ifrework,ms_reworkcheckno");
+                        sql.Append("sn='" + GetSNCode.Text + "') group by ms_makecode,ms_stepcode,ms_prodcode,ma_craftcode,ms_sncode,ma_bomversion,pr_detail,ms_firstsn,ms_craftcode,ms_checkno,ms_ifrework,ms_reworkcheckno");
                         dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                         if (dt.Rows.Count > 0)
                         {
@@ -252,31 +252,40 @@ namespace UAS_MES_NEW.Make
                             BaseUtil.SetFormValue(this.Controls, dt);
                             //判断是否当前工单途程的上料记录
                             firstsn = dt.Rows[0]["ms_firstsn"].ToString();
+                            string ma_bomversion = dt.Rows[0]["ma_bomversion"].ToString();
                             string cdstepcode = "";
+                            //sql.Clear();
+                            //sql.Append("select cm_craftcode,cm_stepcode,cm_soncode,min(cm_indate)cm_indate,sum(case when cm_status=-1 ");
+                            //sql.Append("then 0 else 1 end)qty from craftmaterial left join product on pr_code=cm_soncode where(cm_sncode ");
+                            //sql.Append("in (select sn from makesnrelation where firstsn='" + firstsn + "' union select '" + firstsn + "' from dual)) ");
+                            //sql.Append("and cm_craftcode='" + cr_code.Text + "'and nvl(cm_lastdeco,0)<>0 group by cm_craftcode,cm_stepcode,cm_soncode having ");
+                            //sql.Append("sum(case when cm_status=-1 then 0 else 1 end)=0 order by cm_indate");
                             sql.Clear();
-                            sql.Append("select cm_craftcode,cm_stepcode,cm_soncode,min(cm_indate)cm_indate,sum(case when cm_status=-1 ");
-                            sql.Append("then 0 else 1 end)qty from craftmaterial left join product on pr_code=cm_soncode where(cm_sncode ");
-                            sql.Append("in (select sn from makesnrelation where firstsn='" + firstsn + "' union select '" + firstsn + "' from dual)) ");
-                            sql.Append("and cm_craftcode='" + cr_code.Text + "'and nvl(cm_lastdeco,0)<>0 group by cm_craftcode,cm_stepcode,cm_soncode having ");
-                            sql.Append("sum(case when cm_status=-1 then 0 else 1 end)=0 order by cm_indate");
+                            sql.Append("select sp_stepcode cm_stepcode,sp_craftcode cm_craftcode from stepproduct left join product on pr_code=sp_fsoncode where sp_bomversion='" + ma_bomversion + "' and ");
+                            sql.Append("sp_craftcode='" + cr_code.Text + "' And sp_mothercode ='" + ms_prodcode.Text + "' and sp_tracekind=1 ");
+                            //sql.Append("sp_craftcode=v_v_mscraftcode and sp_stepcode='' And sp_mothercode ='"+ms_prodcode.Text+"' and sp_tracekind=1");
+                            sql.Append("and not exists(select 1 from craftmaterial where cm_sncode in (select '" + firstsn + "' from dual union ");
+                            sql.Append("select sn from makesnrelation where firstsn='" + firstsn + "') and cm_makecode='" + macode + "' and ");
+                            sql.Append("cm_fsoncode=sp_fsoncode and cm_status=0) and instr((select ms_paststep from makeserial where ms_firstsn='" + firstsn + "'),sp_stepcode)>0 order by SP_DETNO asc");
                             dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                             if (dt.Rows.Count > 0)
                             {
+                                cdstepcode = dt.Rows[0]["cm_stepcode"].ToString();
                                 //如果本工序包含老化则默认选择本工序,否则选择上料的后一道工序
-                                if (dh.getFieldDataByCondition("craft left join craftdetail on cr_id=cd_crid", "nvl(cd_ifburnin,0)", "cr_code='" + cr_code.Text + "' and cr_prodcode='" + ms_prodcode.Text + "' and cd_stepcode='" + dt.Rows[0]["cm_stepcode"].ToString() + "'").ToString() != "0")
-                                    cdstepcode = dt.Rows[0]["cm_stepcode"].ToString();
-                                else
-                                {
-                                    string nextstep = LogicHandler.GetNextStep(dt.Rows[0]["cm_craftcode"].ToString(), dt.Rows[0]["cm_stepcode"].ToString(), ms_prodcode.Text);
-                                    if (ms_paststep.Contains(nextstep))
-                                    {
-                                        cdstepcode = nextstep;
-                                    }
-                                    else
-                                    {
-                                        cdstepcode = dt.Rows[0]["cm_stepcode"].ToString();
-                                    }
-                                }
+                                //if (dh.getFieldDataByCondition("craft left join craftdetail on cr_id=cd_crid", "nvl(cd_ifburnin,0)", "cr_code='" + cr_code.Text + "' and cr_prodcode='" + ms_prodcode.Text + "' and cd_stepcode='" + dt.Rows[0]["cm_stepcode"].ToString() + "'").ToString() != "0")
+                                //    cdstepcode = dt.Rows[0]["cm_stepcode"].ToString();
+                                //else
+                                //{
+                                //string nextstep = LogicHandler.GetNextStep(dt.Rows[0]["cm_craftcode"].ToString(), dt.Rows[0]["cm_stepcode"].ToString(), ms_prodcode.Text);
+                                //    if (ms_paststep.Contains(nextstep))
+                                //    {
+                                //        cdstepcode = nextstep;
+                                //    }
+                                //    else
+                                //    {
+                                //        cdstepcode = dt.Rows[0]["cm_stepcode"].ToString();
+                                //    }
+                                //}
                             }
                             else
                             {
@@ -309,7 +318,15 @@ namespace UAS_MES_NEW.Make
                             //如果ms_stepcode和扣料工序均没有查到返修的工序
                             if (cdstepcode == "")
                             {
-                                cdstepcode = ms_stepcode;
+                                string flowback = dh.getFieldDataByCondition("craftdetail left JOIN craft on cr_id = cd_crid", "cd_stepcode", "cr_code=  '" + cr_code.Text + "' and cr_prodcode = '" + ms_prodcode.Text + "' and nvl(cd_ifflowback,0)=-1").ToString();
+                                if (flowback != "")
+                                {
+                                    cdstepcode = flowback;
+                                }
+                                else
+                                {
+                                    cdstepcode = ms_stepcode;
+                                }
                             }
                             cd_stepcode.Text = cdstepcode;
                             //if (dh.getFieldDataByCondition("craftdetail left JOIN craft on cr_id = cd_crid", "nvl(cd_ifinput,0)cd_ifinput", "cr_code=  '" + cr_code.Text + "' and cr_prodcode = '" + ms_prodcode.Text + "' and cd_stepcode = '" + cd_stepcode.Text + "'").ToString() == "-1")
@@ -584,6 +601,7 @@ namespace UAS_MES_NEW.Make
                     BaseUtil.CleanForm(this);
                     BadCodeTree.Nodes.Clear();
                     GetSNCode.Clear();
+                    GetSNCode.Focus();
                 }
             }
         }

+ 2 - 2
UAS_MES_PW/FunctionCode/Packing/Packing_PalletWightCollection.Designer.cs

@@ -59,7 +59,7 @@
             this.OutBoxLength_label = new System.Windows.Forms.Label();
             this.PalletPreFix_label = new System.Windows.Forms.Label();
             this.panel4 = new UAS_MES_NEW.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
-            this.weight = new System.Windows.Forms.Label();
+            this.weight = new System.Windows.Forms.TextBox();
             this.pr_colorboxunit = new System.Windows.Forms.Label();
             this.weight_label = new System.Windows.Forms.Label();
             this.ComList = new System.Windows.Forms.Label();
@@ -994,6 +994,6 @@
         private CustomControl.ValueLabel.ValueLabel ma_code;
         private CustomControl.ValueLabel.ValueLabel pr_code;
         private CustomControl.ButtonUtil.NormalButton RefreshWeigh;
-        private System.Windows.Forms.Label weight;
+        private System.Windows.Forms.TextBox weight;
     }
 }