瀏覽代碼

Merge remote-tracking branch 'refs/remotes/origin/master'

shim 8 年之前
父節點
當前提交
4d7c6b1ec7

+ 2 - 0
UAS-MES/FunctionCode/Make/Make_ColorBoxLoadPrint.cs

@@ -257,6 +257,7 @@ namespace UAS_MES.Make
                             Print.CodeSoft(Tag.ToString(), doc, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, ms_sncode.Text, int.Parse(PrintNum.Text));
                             RemainIndex = 0;
                             TSN.Clear();
+                            SPID.Clear();
                             CollectData.Clear();
                             CollectDataSonCode.Clear();
                             BaseUtil.CleanDataTable(ListA);
@@ -314,6 +315,7 @@ namespace UAS_MES.Make
             if (ListA != null)
                 BaseUtil.CleanDataTableData(ListA);
             TSN.Clear();
+            SPID.Clear();
             CollectDataSonCode.Clear();
             CollectData.Clear();
             RemainIndex = 0;

+ 2 - 0
UAS-MES/FunctionCode/Make/Make_FeedingCollection.cs

@@ -413,6 +413,7 @@ namespace UAS_MES.Make
                 }
                 CollectData.Clear();
                 TSN.Clear();
+                SPID.Clear();
                 CollectDataSonCode.Clear();
                 //采集成功,设置序列号栏目为空
                 RemainIndex = 0;
@@ -436,6 +437,7 @@ namespace UAS_MES.Make
         private void ClearSn_code_Click(object sender, EventArgs e)
         {
             sn_code.Clear();
+            SPID.Clear();
             TSN.Clear();
             CollectData.Clear();
             CollectDataSonCode.Clear();

+ 5 - 3
UAS-MES/FunctionCode/Make/Make_FuselageLabelPrint.cs

@@ -30,6 +30,9 @@ namespace UAS_MES.Make
 
         ApplicationClass lbl;
 
+        string oMakeCode = "";
+        string oMsId = "";
+
         string oErrorMessage = "";
 
         Thread InitPrint;
@@ -81,11 +84,9 @@ namespace UAS_MES.Make
                 if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out oErrorMessage))
                 {
                     //定义临时变量
-                    string oMakeCode = "";
-                    string oMsId = "";
                     string oStatus = "";
                     //调用公共方法CheckStepSNAndMacode判断工序是否正确
-                    if (LogicHandler.CheckStepSNAndMacode(ma_code.Text == oMakeCode ? oMakeCode : "", User.UserSourceCode, sncode.Text, User.UserCode, out oMakeCode, out oMsId, out oErrorMessage))
+                    if (LogicHandler.CheckStepSNAndMacode("", User.UserSourceCode, sncode.Text, User.UserCode, out oMakeCode, out oMsId, out oErrorMessage))
                     {
                         //IF (如果ma_code 为空)THEN
                         if (ma_code.Text == "" || ma_code.Text != oMakeCode)
@@ -125,6 +126,7 @@ namespace UAS_MES.Make
                             else
                             {
                                 OperateResult.AppendText(">>无序列号" + sncode.Text + "对应工单信息\n", Color.Red);
+                                return;
                             }
                         }
                         //所选标签不为空

+ 14 - 2
UAS-MES/FunctionCode/Make/Make_PackageCollection.cs

@@ -270,12 +270,12 @@ namespace UAS_MES.Make
                         sql.Clear();
                         sql.Append("select nvl(pa_iostatus,0)pa_iostatus,pa_outno,pa_mothercode from package where pa_outboxcode='" + pa_outboxcode.Text + "'");
                         dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                        string MotherBoxCode = "";
                         if (dt.Rows.Count > 0)
                         {
                             if (dt.Rows[0]["pa_mothercode"].ToString() != "")
                             {
-                                OperateResult.AppendText(">>卡通箱" + pa_outboxcode.Text + "已被大箱或栈板" + dt.Rows[0]["pa_mothercode"].ToString() + "采集,不允许操作\n", Color.Red, sn_code);
-                                return;
+                                MotherBoxCode = dt.Rows[0]["pa_mothercode"].ToString();
                             }
                             if (dt.Rows[0]["pa_outno"].ToString() != "")
                             {
@@ -329,6 +329,12 @@ namespace UAS_MES.Make
                                     LoadData();
                                     LoadGridData();
                                     LoadCheckQTY();
+                                    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");
+                                    //如果母箱号不为空,需要更新总数
+                                    if (MotherBoxCode != "")
+                                    {
+                                        dh.ExecuteSql("update package set PA_TOTALQTY=(select sum(pd_innerqty) from packagedetail left join package on pa_id=pd_paid where pa_outboxcode='" + MotherBoxCode + "') where pa_outboxcode='" + MotherBoxCode + "' and pa_type=3", "update");
+                                    }
                                     //采集完后如果是第一个装的序列号,把序列号的NextStepCode赋值给箱号
                                     if (pa_currentqty.Text == "1")
                                     {
@@ -364,6 +370,12 @@ namespace UAS_MES.Make
                         {
                             if (LogicHandler.Packing(sn_code.Text, pa_outboxcode.Text, AutoGenBoxCode.Checked, "标准", User.UserSourceCode, User.UserCode, pr_outboxinnerqty.Text, Cancel.Checked, out oOutBoxCode, out ErrorMessage))
                             {
+                                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");
+                                //如果母箱号不为空,需要更新总数
+                                if (MotherBoxCode != "")
+                                {
+                                    dh.ExecuteSql("update package set PA_TOTALQTY=(select sum(pd_innerqty) from packagedetail left join package on pa_id=pd_paid where pa_outboxcode='" + MotherBoxCode + "') where pa_outboxcode='" + MotherBoxCode + "' and pa_type=3", "update");
+                                }
                                 LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, oMakeCode, User.UserLineCode, User.UserSourceCode, "卡通箱采集", "卡通箱" + pa_outboxcode.Text + "取消采集成功", sn_code.Text, "");
                                 LoadGridData();
                                 pa_status.Text = "0";

+ 15 - 2
UAS-MES/FunctionCode/Make/Make_PackageCollectionWeigh.cs

@@ -345,12 +345,12 @@ namespace UAS_MES.Make
                         sql.Clear();
                         sql.Append("select nvl(pa_iostatus,0) pa_iostatus,pa_outno,pa_mothercode from package where pa_outboxcode='" + pa_outboxcode.Text + "'");
                         dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                        string MotherBoxCode = "";
                         if (dt.Rows.Count > 0)
                         {
                             if (dt.Rows[0]["pa_mothercode"].ToString() != "")
                             {
-                                OperateResult.AppendText(">>卡通箱" + pa_outboxcode.Text + "已被大箱或栈板" + dt.Rows[0]["pa_mothercode"].ToString() + "采集,不允许操作\n", Color.Red, sn_code);
-                                return;
+                                MotherBoxCode = dt.Rows[0]["pa_mothercode"].ToString();
                             }
                             if (dt.Rows[0]["pa_outno"].ToString() != "")
                             {
@@ -402,6 +402,12 @@ namespace UAS_MES.Make
                                     LastSncode = sn_code.Text;
                                     //满箱更新状态为1
                                     LoadData();
+                                    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");
+                                    //如果母箱号不为空,需要更新总数
+                                    if (MotherBoxCode != "")
+                                    {
+                                        dh.ExecuteSql("update package set PA_TOTALQTY=(select sum(pd_innerqty) from packagedetail left join package on pa_id=pd_paid where pa_outboxcode='" + MotherBoxCode + "') where pa_outboxcode='" + MotherBoxCode + "' and pa_type=3", "update");
+                                    }
                                     //采集完后如果是第一个装的序列号,把序列号的NextStepCode赋值给箱号
                                     if (pa_currentqty.Text == "1")
                                     {
@@ -432,6 +438,7 @@ namespace UAS_MES.Make
                                         LogicHandler.CartonBoxStepPass(pa_makecode.Text, User.UserSourceCode, pa_outboxcode.Text, User.UserCode, "卡通箱:" + pa_outboxcode.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='" + pa_outboxcode.Text + "'").ToString() + "', PA_CURRENTSTEP = '' ", "pa_outboxcode='" + pa_outboxcode.Text + "'");
                                         LoadCheckQTY();
+
                                         OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "称量完成\n", Color.Green);
                                         if (AutoPrint.Checked)
                                             Print_Click(new object(), new EventArgs());
@@ -447,6 +454,12 @@ namespace UAS_MES.Make
                         {
                             if (LogicHandler.Packing(sn_code.Text, pa_outboxcode.Text, AutoGenBoxCode.Checked, "标准", User.UserSourceCode, User.UserCode, pr_outboxinnerqty.Text, Cancel.Checked, out oOutBoxCode, out ErrorMessage))
                             {
+                                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");
+                                //如果母箱号不为空,需要更新总数
+                                if (MotherBoxCode != "")
+                                {
+                                    dh.ExecuteSql("update package set PA_TOTALQTY=(select sum(pd_innerqty) from packagedetail left join package on pa_id=pd_paid where pa_outboxcode='" + MotherBoxCode + "') where pa_outboxcode='" + MotherBoxCode + "' and pa_type=3", "update");
+                                }
                                 LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, oMakeCode, User.UserLineCode, User.UserSourceCode, "卡通箱采集", "卡通箱" + pa_outboxcode.Text + "取消采集成功", sn_code.Text, "");
                                 LoadGridData();
                                 pa_status.Text = "0";

+ 3 - 9
UAS-MES/FunctionCode/Make/Make_PalletCollection.cs

@@ -143,8 +143,9 @@ namespace UAS_MES.Make
                                 palletcode_KeyDown(sender, e);
                             }
                         }
+                        string unfinpack = dh.getFieldDataByCondition("Line", "nvl(li_allowUnFinPack,0)", "li_code='" + User.UserLineCode + "'").ToString();
                         pa_nextstep = dt.Rows[0]["pa_nextstep"].ToString();
-                        if (pa_nextstep != User.CurrentStepCode && pa_nextstep != "")
+                        if (pa_nextstep != User.CurrentStepCode && pa_nextstep != "" && (unfinpack == "0" || unfinpack == ""))
                         {
                             OperateResult.AppendText(">>箱号" + outboxcode.Text + "的下一工序不是当前岗位资源对应工序\n", Color.Red, outboxcode);
                             return;
@@ -170,15 +171,8 @@ namespace UAS_MES.Make
                         {
                             //判断线外,必须已完工并且未入库
                             dt = (DataTable)dh.ExecuteSql("select wm_concat(ms_sncode) from mes_package_view  left join makeserial on v_barcode=ms_sncode where  v_outboxcode='" + outboxcode.Text + "' and ms_status<>2", "select");
-                            if (dt.Rows[0][0].ToString() != "")
+                            if (dt.Rows[0][0].ToString() != "" &&  (unfinpack != "0" || unfinpack == ""))
                             {
-                                ////判断箱未入库
-                                //dt = (DataTable)dh.ExecuteSql("select count(1) from package where pa_outboxcode='" + outboxcode.Text + "' and nvl(pa_iostatus,0)<>0", "select");
-                                //if (dt.Rows[0][0].ToString() != "0")
-                                //{
-                                //    OperateResult.AppendText(">>箱号" + outboxcode.Text + "已入库,不允许装箱\n", Color.Red);
-                                //    return;
-                                //}
                                 OperateResult.AppendText(">>序列号" + dt.Rows[0][0].ToString() + "尚未完工\n", Color.Red);
                                 return;
                             }

+ 1 - 1
UAS-MES/FunctionCode/Packing/Packing_CartonTransfer.cs

@@ -134,7 +134,7 @@ namespace UAS_MES.Packing
                             string ob_result = dh.getFieldDataByCondition("oqcbatch", "ob_result", "ob_checkno = '" + pa_checkno + "'").ToString();
                             if (pa_mothercode != "")
                             {
-                                OperateResult.AppendText(">>原箱" + ms_outboxcode + "已装入大箱,不允许转移\n", Color.Red, sn_code);
+                                OperateResult.AppendText(">>原箱" + ms_outboxcode + "已装入大箱或栈板"+ pa_mothercode + ",不允许转移\n", Color.Red, sn_code);
                                 return;
                             }
                             if (PA_DOWNSTATUS == "0")

+ 4 - 4
UAS-MES/FunctionCode/Warehouse/Warehouse_FinishedProductOut.cs

@@ -348,10 +348,10 @@ namespace UAS_MES.Warehouse
                                                 return;
                                             }
                                         }
-                                        if (needMakeIn != "0")
-                                        {
-                                            dh.UpdateByCondition("package", "pa_iostatus = 1", "pa_outboxcode = '" + input.Text + "'");
-                                        }
+                                        //if (needMakeIn != "0")
+                                        //{
+                                        //    dh.UpdateByCondition("package", "pa_iostatus = 1", "pa_outboxcode = '" + input.Text + "'");
+                                        //}
                                     }
                                     else
                                     {