Browse Source

老化上架

callm 5 months ago
parent
commit
2a4233104f

+ 9 - 2
UAS_MES_JWS/FunctionCode/Make/Make_Aging.cs

@@ -61,19 +61,26 @@ namespace UAS_MES_NEW.Make
                 {
                     string pa_makecode = dt.Rows[0]["pa_makecode"].ToString();
                     {
-                        OperateResult.AppendText(">>箱号" + sncode.Text + "采集完成,手动封箱成功\n", Color.Green);
                         dh.UpdateByCondition("package", "pa_status=1,pa_totalqty=pa_currentqty,pa_packageqty=pa_currentqty", "pa_outboxcode='" + sncode.Text + "'");
                         LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode, User.UserLineCode, User.UserSourceCode, "老化上架", "箱号" + sncode.Text + "上架成功", sncode.Text, "");
-
                         string ms_makecode = dh.getFieldDataByCondition("packagedetail", "pd_makecode", "pd_outboxcode = '" + sncode.Text + "'").ToString();
                         if (LogicHandler.OutBoxStepPass(sncode.Text, ms_makecode, User.UserSourceCode, User.UserCode, "卡通箱:" + sncode.Text + "整箱过站", "卡通箱整箱过站", out ErrorMessage))
                         {
                             dh.UpdateByCondition("package", "pa_nextstep='" + dh.getFieldDataByCondition("packagedetail left join makeserial on ms_sncode=pd_barcode and ms_makecode=pd_makecode", "max(ms_nextstepcode)", "pd_outboxcode='" + sncode.Text + "'").ToString() + "', PA_CURRENTSTEP = '' ", "pa_outboxcode='" + sncode.Text + "'");
+                            OperateResult.AppendText(">>箱号" + sncode.Text + "上架成功\n", Color.Green);
                         }
                         else
                         {
                             OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
                         }
+                        //写入老化明细表
+                        dh.ExecuteSql("insert into AGEINGDETAIL(AGD_ID, AGD_AGCODE, AGD_MAKECODE, AGD_SNCODE, AGD_INDATE)" +
+                            "select AGEINGDETAIL_seq.nextval,'" + sncode.Text + "',pd_makecode,pd_barcode,sysdate from packagedetail " +
+                            "where pd_outboxcode='" + sncode.Text + "'", "insert");
+                        //显示老化数据
+                        dt = (DataTable)dh.ExecuteSql("select AGD_AGCODE,AGD_MAKECODE,AGD_SNCODE,to_char(AGD_INDATE,'yyyy-mm-dd hh24:mi:ss')AGD_INDATE " +
+                            "from AGEINGDETAIL where AGD_AGCODE='" + sncode.Text + "'", "select");
+                        BaseUtil.FillDgvWithDataTable(LabelDataGridView, dt);
                     }
                 }
                 else OperateResult.AppendText(">>箱号" + sncode.Text + "已经上架\n", Color.Red);

+ 4 - 8
UAS_MES_JWS/FunctionCode/Packing/Packing_PackageCollection1.cs

@@ -107,7 +107,7 @@ namespace UAS_MES_NEW.Packing
         {
             //加载表单数据
             sql.Clear();
-            sql.Append("select pr_code,nvl(pr_sendchecktype,'LineCode')pr_sendchecktype,pa_remark,pa_outboxcode,pa_prodcode,pa_salecode,pa_makecode,pa_sccode,nvl(pa_downstatus,0) pa_downstatus,pa_checkno,pa_status,pr_packrule,nvl(PR_CHECKCARTONW,'0') PR_CHECKCARTONW,pr_detail,pa_packageqty,nvl(pa_standardqty,0) pa_standardqty,nvl(pr_outboxinnerqty,0)pr_outboxinnerqty,pa_currentqty from package left join product on pa_prodcode=");
+            sql.Append("select pr_code,nvl(pr_sendchecktype,'LineCode')pr_sendchecktype,pa_remark,pa_outboxcode,pa_prodcode,pa_salecode,pa_makecode,pa_sccode,nvl(pa_downstatus,0) pa_downstatus,pa_checkno,pa_status,pr_packrule,nvl(PR_CHECKCARTONW,'0') PR_CHECKCARTONW,pr_detail,pa_packageqty," + (pr_outboxinnerqty.Text == "" ? "0" : pr_outboxinnerqty.Text) + " pa_standardqty,nvl(pr_outboxinnerqty,0)pr_outboxinnerqty,pa_currentqty from package left join product on pa_prodcode=");
             sql.Append("pr_code where pa_outboxcode='" + pa_outboxcode.Text + "'");
             dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
             if (dt.Rows.Count > 0)
@@ -119,10 +119,6 @@ namespace UAS_MES_NEW.Packing
                     ms_salecode.Text = dt.Rows[0]["pa_salecode"].ToString();
                 }
                 BaseUtil.SetFormValue(this.Controls, dt);
-                if (pa_standardqty.Text != "0")
-                {
-                    pr_outboxinnerqty.Text = pa_standardqty.Text;
-                }
             }
             else
             {
@@ -243,7 +239,7 @@ namespace UAS_MES_NEW.Packing
                         //获取序列号信息
                         sql.Clear();
                         sql.Append("select nvl(ms_iostatus,0) ms_iostatus,pa_salecode,ms_salecode,ms_outno,ms_makecode,ms_prodcode,nvl(pa_downstatus,0) pa_downstatus,pa_sccode,pa_checkno,pr_packrule,");
-                        sql.Append("nvl(pr_outboxinnerqty,0)pr_outboxinnerqty,nvl(pr_sendchecktype,'LineCode')pr_sendchecktype from makeserial left join product on ms_prodcode=pr_code left join packagedetail ");
+                        sql.Append("" + pr_outboxinnerqty.Text == "" ? "0" : pr_outboxinnerqty.Text + " pr_outboxinnerqty,nvl(pr_sendchecktype,'LineCode')pr_sendchecktype from makeserial left join product on ms_prodcode=pr_code left join packagedetail ");
                         sql.Append("on pd_barcode=ms_sncode left join package on pa_id =pd_paid where ms_id='" + oMsID + "'");
                         dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                         string ms_makecode = "";
@@ -395,7 +391,7 @@ namespace UAS_MES_NEW.Packing
                                     return;
                                 }
                                 ////箱号不存在的情况
-                                if (LogicHandler.Packing(sn_code.Text, pa_outboxcode.Text, AutoGenBoxCode.Checked, "标准", User.UserSourceCode, User.UserCode, pr_outboxinnerqty.Text, Cancel.Checked, out oOutBoxCode, out ErrorMessage))
+                                if (LogicHandler.Packing1(sn_code.Text, pa_outboxcode.Text, AutoGenBoxCode.Checked, "标准", User.UserSourceCode, User.UserCode, pr_outboxinnerqty.Text, Cancel.Checked, out oOutBoxCode, out ErrorMessage))
                                 {
                                     if (md.IsOpen)
                                     {
@@ -477,7 +473,7 @@ namespace UAS_MES_NEW.Packing
                         //勾选了取消箱号先验证箱号存不存在,存在的话移除掉,重新加载一次数据
                         else
                         {
-                            if (LogicHandler.Packing(sn_code.Text, pa_outboxcode.Text, AutoGenBoxCode.Checked, "标准", User.UserSourceCode, User.UserCode, pr_outboxinnerqty.Text, Cancel.Checked, out oOutBoxCode, out ErrorMessage))
+                            if (LogicHandler.Packing1(sn_code.Text, pa_outboxcode.Text, AutoGenBoxCode.Checked, "标准", User.UserSourceCode, User.UserCode, pr_outboxinnerqty.Text, Cancel.Checked, out oOutBoxCode, out ErrorMessage))
                             {
                                 dh.UpdateByCondition("makeserial", "ms_outboxcode=''", "ms_id='" + oMsID + "'");
                                 dh.ExecuteSql("update packagedetail set pd_innerqty=(select pa_packageqty from package where pa_outboxcode='" + pa_outboxcode.Text + "') where pd_innerboxcode='" + pa_outboxcode.Text + "'", "update");

+ 14 - 0
UAS_MES_JWS/PublicMethod/LogicHandler.cs

@@ -1417,6 +1417,20 @@ namespace UAS_MES_NEW.PublicMethod
                 return false;
         }
 
+        public static bool Packing1(string iSN, string iOutBoxCode, bool iAutoNew, string iType, string iSource, string iUser, string iStandarqty, bool iInOrOut, out string oOutBoxCode, out string oErrorMessage)
+        {
+            oErrorMessage = "";
+            oOutBoxCode = "";
+            string[] param = new string[] { iSN, iOutBoxCode, iAutoNew ? "Y" : "N", iType, iSource, iUser, iStandarqty, iInOrOut ? "OUT" : "IN", oOutBoxCode, oErrorMessage };
+            dh.CallProcedure("CS_PACKCARTON1", ref param);
+            oOutBoxCode = param[8];
+            oErrorMessage = param[9];
+            if (oErrorMessage == "" || oErrorMessage == null || oErrorMessage == "null")
+                return true;
+            else
+                return false;
+        }
+
         public static bool Packing_Special(string iSN, string iOutBoxCode, bool iAutoNew, string iType, string iSource, string iUser, string iStandarqty, bool iInOrOut, out string oOutBoxCode, out string oErrorMessage)
         {
             oErrorMessage = "";