Преглед изворни кода

回退删除打印记录,自动找未封箱的箱号

callm пре 1 месец
родитељ
комит
3ee83ba52a

+ 9 - 2
UAS_MES_JH/FunctionCode/Packing/Packing_PackageCollection.cs

@@ -374,8 +374,15 @@ namespace UAS_MES_NEW.Packing
                                 //如果勾选了自动生成箱号,在封箱或者首次
                                 if (AutoGenBoxCode.Checked && (pa_status.Text == "1" || pa_status.Text == "" || pa_status.Text == "0"))
                                 {
-                                    pa_outboxcode.Text = LogicHandler.GetOutBoxCode("PACKAGE", ms_makecode, pr_code.Text, User.UserCode);
-                                    LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, oMakeCode, User.UserLineCode, User.UserSourceCode, "卡通箱采集", "卡通箱" + pa_outboxcode.Text + "自动生成", sn_code.Text, PreFix.Text + ":" + OutBoxLength.Text);
+                                    string maxbox = dh.getFieldDataByCondition("package", "min(pa_outboxcode)", "pa_makecode='"+ms_makecode+ "' and PA_PACKAGEQTY<PA_STANDARDQTY").ToString();
+                                    if (maxbox != "")
+                                    {
+                                        pa_outboxcode.Text = maxbox;
+                                    }
+                                    else {
+                                        pa_outboxcode.Text = LogicHandler.GetOutBoxCode("PACKAGE", ms_makecode, pr_code.Text, User.UserCode);
+                                        LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, oMakeCode, User.UserLineCode, User.UserSourceCode, "卡通箱采集", "卡通箱" + pa_outboxcode.Text + "自动生成", sn_code.Text, PreFix.Text + ":" + OutBoxLength.Text);
+                                    }
                                 }
                             }
                         }

+ 1 - 0
UAS_MES_JH/FunctionCode/Special/Special_Reset.cs

@@ -93,6 +93,7 @@ namespace UAS_MES_NEW.Special
                         }
                         dh.ExecuteSql("insert into PACKAGEBACKUP select * from package where pa_outboxcode='" + sb[i].ToString() + "'", "insert");
                         dh.ExecuteSql("insert into PACKAGEBACKUPDETAIL select * from packagedetail where pd_outboxcode='" + sb[i].ToString() + "'", "insert");
+                        dh.ExecuteSql("delete from labelprintlog where lpl_value= '" + sb[i].ToString() + "'", "delete");
                         dh.ExecuteSql("delete from package where pa_outboxcode = '" + sb[i].ToString() + "'", "delete");
                         //删除箱的明细
                         dh.ExecuteSql("delete from packagedetail where pd_outboxcode='" + sb[i].ToString() + "'", "delete");