章政 6 years ago
parent
commit
c054455381
1 changed files with 294 additions and 128 deletions
  1. 294 128
      TestProject/DrawHelper.cs

+ 294 - 128
TestProject/DrawHelper.cs

@@ -1,136 +1,302 @@
-using System;
-using System.Collections.Generic;
-using System.Drawing;
-using System.Drawing.Drawing2D;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+//create or replace PROCEDURE "CS_PACKCARTON"
+//-- =============================================
+//-- Author:    <XIAOST>
+//-- Create date: <2017-09-23>
+//-- Description:  <装卡通箱
+//--                1、 支持自动生成箱号,
+//--                2、 支持转入已存在箱号,
+//--                3、 标准装箱需要产品和箱号的包装规则一致 包含:按合同 SALE,按订单 MAKE ,按产品 PROD,混合 MIX
+//--                4、 特殊装箱,无需考虑装箱规则等限制
+//--               >
+//-- =============================================
+//(  /*
+//    参数:输入 -- SN号,箱号,是否自动生成,装箱类型,岗位资源,操作人编号
+//         输出  --箱号,异常信息
+//   */
+//    v_i_sncode in varchar2, --SN
+//    v_i_outboxcode in varchar2, --卡通箱号
+//    v_i_autonew in varchar2 default 'N', --默认否
+//    v_i_type    in varchar2 ,-- 装箱类型,标准或者特殊,默认标准
+//    v_i_sourcecode  in varchar2,  --岗位资源编号
+//    v_i_usercode  in varchar2,  --人员编号
+//    v_i_standardqty in number,  --标准容量
+//    v_i_inorout in varchar2,  ---装箱或取消装箱入或者出 IN, OUT
+//    v_o_outboxcode out varchar2,   --输出卡通箱号
+//    v_o_errmsg out varchar2      ---输入异常信息
+//) as   
+//    v_pr_packrule product.pr_packrule%type;  --产品包装规则
+//v_pr_outboxinnerqty  product.pr_outboxinnerqty%type;--装箱容量
+//v_pa_packtype        varchar2(20);  --卡通箱装箱类型
+//v_pa_standardqty     number;   ---标准容量
+//v_pa_currentqty      number; 
+//    v_pa_prodcode varchar2(50);
+//v_pa_makecode varchar2(50);
+//v_pa_salecode varchar2(50);
+//v_pa_downstatus number; --是否下地
+//v_pa_id              number;
+//    v_pa_status number;
+//v_pa_checkno varchar2(30);
+//v_pa_currentstep varchar2(60);
+//v_pa_mothercode varchar2(50);
+//v_pa_outno varchar2(50);
+//v_ob_status varchar2(20);
+//v_outboxcode varchar2(30);
 
-namespace TestProject
-{
-    class DrawHelper
-    {
-        #region RendererBackground 渲染背景图片,使背景图片不失真
+//v_ms_prodcode varchar2(50);
+//v_ms_makecode make.ma_code%type;
+//v_ms_id makeserial.ms_id%type;
+//v_ms_outboxcode varchar2(50);
+//v_ms_craftcode varchar2(50);
+//v_ms_salecode varchar2(50);
+//v_ms_downstatus number; --是否下地
 
-        /// <summary>
-        /// 渲染背景图片,使背景图片不失真
-        /// </summary>
-        /// <param name="g"></param>
-        /// <param name="rect"></param>
-        /// <param name="backgroundImage"></param>
-        /// <param name="method"></param>
-        public static void RendererBackground(Graphics g, Rectangle rect, Image backgroundImage, bool method)
-        {
-            if (!method)
-            {
-                g.DrawImage(backgroundImage, new Rectangle(rect.X + 0, rect.Y, 5, rect.Height), 0, 0, 5, backgroundImage.Height, GraphicsUnit.Pixel);
-                g.DrawImage(backgroundImage, new Rectangle(rect.X + 5, rect.Y, rect.Width - 10, rect.Height), 5, 0, backgroundImage.Width - 10, backgroundImage.Height, GraphicsUnit.Pixel);
-                g.DrawImage(backgroundImage, new Rectangle(rect.X + rect.Width - 5, rect.Y, 5, rect.Height), backgroundImage.Width - 5, 0, 5, backgroundImage.Height, GraphicsUnit.Pixel);
-            }
-            else
-            {
-                DrawHelper.RendererBackground(g, rect, 5, backgroundImage);
-            }
-        }
+//v_currentstep       varchar2(50);
+//v_linecode varchar2(50);
+//v_scstatuscode varchar2(50);
+//v_stepname varchar2(100);
+//v_wccode varchar2(30);
 
-        /// <summary>
-        /// 渲染背景图片,使背景图片不失真
-        /// </summary>
-        /// <param name="g"></param>
-        /// <param name="rect"></param>
-        /// <param name="cut"></param>
-        /// <param name="backgroundImage"></param>
-        public static void RendererBackground(Graphics g, Rectangle rect, int cut, Image backgroundImage)
-        {
-            //左上角
-            g.DrawImage(backgroundImage, new Rectangle(rect.X, rect.Y, cut, cut), 0, 0, cut, cut, GraphicsUnit.Pixel);
-            //上边
-            g.DrawImage(backgroundImage, new Rectangle(rect.X + cut, rect.Y, rect.Width - cut * 2, cut), cut, 0, backgroundImage.Width - cut * 2, cut, GraphicsUnit.Pixel);
-            //右上角
-            g.DrawImage(backgroundImage, new Rectangle(rect.X + rect.Width - cut, rect.Y, cut, cut), backgroundImage.Width - cut, 0, cut, cut, GraphicsUnit.Pixel);
-            //左边
-            g.DrawImage(backgroundImage, new Rectangle(rect.X, rect.Y + cut, cut, rect.Height - cut * 2), 0, cut, cut, backgroundImage.Height - cut * 2, GraphicsUnit.Pixel);
-            //左下角
-            g.DrawImage(backgroundImage, new Rectangle(rect.X, rect.Y + rect.Height - cut, cut, cut), 0, backgroundImage.Height - cut, cut, cut, GraphicsUnit.Pixel);
-            //右边
-            g.DrawImage(backgroundImage, new Rectangle(rect.X + rect.Width - cut, rect.Y + cut, cut, rect.Height - cut * 2), backgroundImage.Width - cut, cut, cut, backgroundImage.Height - cut * 2, GraphicsUnit.Pixel);
-            //右下角
-            g.DrawImage(backgroundImage, new Rectangle(rect.X + rect.Width - cut, rect.Y + rect.Height - cut, cut, cut), backgroundImage.Width - cut, backgroundImage.Height - cut, cut, cut, GraphicsUnit.Pixel);
-            //下边
-            g.DrawImage(backgroundImage, new Rectangle(rect.X + cut, rect.Y + rect.Height - cut, rect.Width - cut * 2, cut), cut, backgroundImage.Height - cut, backgroundImage.Width - cut * 2, cut, GraphicsUnit.Pixel);
-            //平铺中间
-            g.DrawImage(backgroundImage, new Rectangle(rect.X + cut, rect.Y + cut, rect.Width - cut * 2, rect.Height - cut * 2), cut, cut, backgroundImage.Width - cut * 2, backgroundImage.Height - cut * 2, GraphicsUnit.Pixel);
-        }
+//v_count int;
+//    v_new int:=0; ---0表示否,-1 需要新增箱号
 
-        #endregion
+//BEGIN
+//          --初始化输出参数值
+//          v_o_errmsg:=null;
+//          v_o_outboxcode:=null;
+//          --判定岗位资源
+//          select sc_statuscode,sc_stepcode,sc_linecode,sc_stepname,sc_wccode into v_scstatuscode,v_currentstep,v_linecode,v_stepname ,v_wccode from source where sc_code=v_i_sourcecode;
+//          IF v_scstatuscode<>'AUDITED' or v_scstatuscode is null THEN
+//              v_o_errmsg:='岗位资源不存在或者未审核';
+//RETURN;
+//          END IF;
+          
+//          --获取序列号
+//          select max(ms_id) into v_ms_id from makeserial where ms_sncode = v_i_sncode;
+//          IF(v_ms_id>0)THEN
+//              select ms_outboxcode,ms_prodcode,ms_salecode,ms_makecode,pr_packrule,ms_craftcode,pr_outboxinnerqty,nvl(ms_downstatus,0) into v_ms_outboxcode, v_ms_prodcode, v_ms_salecode, v_ms_makecode, v_pr_packrule, v_ms_craftcode, v_pr_outboxinnerqty, v_ms_downstatus from makeserial left join product on pr_code=ms_prodcode where ms_id=v_ms_id;
+//          ELSE
+//              v_o_errmsg:='序列号:'||v_i_sncode||'不存在';
+//              RETURN;
+//          END IF;
+          
+//          --判断是否下地
+//          IF(v_ms_downstatus<>0)THEN
+//              v_o_errmsg:='序列号:'||v_i_sncode||'不允许采集,下地状态不允许采集';
+//              RETURN;
+//          END IF;
+          
+//          --装箱
+//          IF('IN'=v_i_inorout)THEN
+//             --必须是未装箱,如果是已装箱提示
+//             IF(NVL(v_ms_outboxcode,' ')<>' ')THEN
+//                 IF(v_ms_outboxcode= v_i_outboxcode)THEN
+//                      v_o_errmsg:='序列号:'||v_i_sncode||'已在箱内';
+//                     RETURN;
+//                 ELSE
+//                     v_o_errmsg:='序列号:'||v_i_sncode||'不允许采集,已装入箱号:'||v_ms_outboxcode;
+//                     RETURN;
+//                 END IF;
+//END IF;
+//             --判断有传入需装箱号
+//             IF(nvl(v_i_outboxcode,' ')<>' ')THEN
+//                v_outboxcode :=v_i_outboxcode;
+//              BEGIN
+//                 select pa_id,pa_prodcode,pa_salecode,pa_maKEcode,pa_packtype,pa_standardqty,nvl(pa_currentqty,0),pa_status,pa_downstatus into v_pa_id,v_pa_prodcode,v_pa_salecode,v_pa_makecode,v_pa_packtype,v_pa_standardqty,v_pa_currentqty,v_pa_status,v_pa_downstatus from package where pa_outboxcode=v_i_outboxcode and pa_type=1;
+//                 IF(NVL(v_pa_downstatus,0)<>0)THEN
+//                     v_o_errmsg:='箱号:'||v_i_outboxcode||'处于下地状态,不允许操作!';
+//                     RETURN;
+//                 END IF;
+//EXCEPTION
+//WHEN OTHERS THEN   --需要新增箱号
+//        v_new := -1;
+//              END;
+//            ELSE   --没有传入箱号,并且也没有勾选自动生成箱号
+//               IF(NVL(v_i_autonew,'N')='N')THEN
+//                   v_o_errmsg:='无装箱箱号,请输入装箱箱号或者勾选自动生成箱号!';
+//                   RETURN;
+//               ELSE --生成新箱号
+//                  v_new := -1;
+//                  SP_GETPACKORPALLETCODE('PACKAGE', v_ms_makecode, v_ms_prodcode, v_linecode, v_outboxcode);
+//END IF;
+//END IF;
 
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="g"></param>
-        /// <param name="image"></param>
-        /// <param name="x1"></param>
-        /// <param name="y1"></param>
-        /// <param name="width1"></param>
-        /// <param name="height1"></param>
-        /// <param name="x2"></param>
-        /// <param name="y2"></param>
-        /// <param name="width2"></param>
-        /// <param name="height2"></param>
-        public static void DrawImage(Graphics g, Image image, int x1, int y1, int width1, int height1, int x2, int y2, int width2, int height2)
-        {
-            g.DrawImage(image, new Rectangle(x1, y1, width1, height1), x2, y2, width2, height2, GraphicsUnit.Pixel);
-        }
 
-        #region CreateRoundPath 构建圆角路径
+//            IF(v_i_type= '标准')THEN--标准装箱
+//                IF(v_new= -1)THEN
+//                     ---页面传了标准容量
+//                     /*IF(v_i_standardqty<=0)THEN
+//                         IF(v_pr_outboxinnerqty>0)THEN
+//                            v_pa_standardqty:=v_pr_outboxinnerqty;
+//                         ELSE
+//                             v_outboxcode:=null;
+//                             v_o_errmsg:='请维护箱标准容量或者维护产品资料中的包装容量!';
+//                             RETURN;
+//                         END IF;
+//                     ELSE
+//                        v_pa_standardqty:=v_i_standardqty;
+//                     END IF;*/
+//                     IF(v_pr_outboxinnerqty>0)THEN
+//                           v_pa_standardqty:=v_pr_outboxinnerqty;
+//                     ELSE
+//                          v_outboxcode:=null;
+//                          v_o_errmsg:='请维护箱标准容量或者维护产品资料中的包装容量!';
+//                          RETURN;
+//                     END IF;
+//v_pa_id := package_seq.nextval;    
+//                    insert into package(PA_ID, PA_OUTBOXCODE, PA_PRODCODE, PA_LEVEL, PA_PACKAGEQTY, PA_TOTALQTY,
+//                    PA_MAKECODE, PA_STATUS, PA_INDATE, PA_SALECODE, PA_TYPE, PA_CURRENTQTY, PA_PACKTYPE, PA_STANDARDQTY, PA_SCCODE)
+//                    values(v_pa_id, v_outboxcode,case when nvl(v_pr_packrule,' ')<>'MIX' then v_ms_prodcode ELSE''END,3,0,0,case when v_pr_packrule = 'MAKE' THEN v_ms_makecode ELSE '' END,
+//                    0,SYSDATE,case when v_pr_packrule = 'SALE' then v_ms_salecode else ''end,1,0,v_pr_packrule,v_pa_standardqty,v_i_sourcecode);
+//               ELSE  --无需新增箱号
+//                   --判断箱是否已装满
+//                   IF(v_pa_currentqty= v_pa_standardqty)THEN
+//                        v_o_errmsg:='箱号:'||v_outboxcode||'已经满箱,请输入新箱号或勾选自动生成箱号!';
+//                        RETURN;
+//                   ELSIF(nvl(v_pa_status,0)<>0)THEN
+//                        v_o_errmsg:='箱号:'||v_outboxcode||'已经封箱,请输入新箱号或勾选自动生成箱号!';
+//                        RETURN;
+//                   END IF;
+                   
+//                   --判断序列号包装规则与箱内规则一致
+//                   --IF(v_pa_currentqty= 0 or (v_pa_currentqty>0 and v_pr_packrule = v_pa_packtype))THEN
+//                        IF(v_pa_currentqty>0 and v_pr_packrule = v_pa_packtype)THEN
+//                           IF(v_pr_packrule= 'SALE' AND v_ms_salecode<>v_pa_salecode)THEN
+//                               v_o_errmsg:='包装规则为:合同,序列号和卡通箱合同号不一致,不能装入该箱';
+//                         RETURN;
+//                      ELSIF(v_pr_packrule= 'SALE' AND v_ms_prodcode<>v_pa_prodcode)THEN
+//                         v_o_errmsg:='包装规则为:合同,序列号产品编号'||v_ms_prodcode||'和箱的产品编号'||v_pa_prodcode||'不一致,不能装入该箱';
+//                         RETURN;
+//                      ELSIF(v_pr_packrule= 'MAKE' AND v_ms_makecode<>v_pa_makecode)THEN
+//                          v_o_errmsg:='包装规则为:工单,序列号和卡通箱工单号不一致,不能装入该箱';
+//                         RETURN;
+//                      ELSIF(NVL(v_pr_packrule,'PROD')='PROD' AND v_ms_prodcode<>v_pa_prodcode)THEN
+//                         v_o_errmsg:='序列号:'||v_i_sncode||'产品编号和卡通箱产品编号不一致,不能装入该箱';
+//                         RETURN;
+//                      END IF;
+//                   ELSIF(v_pa_currentqty>0 and NVL(v_pr_packrule,' ')<>NVL(v_pa_packtype,' '))THEN
+//                     v_o_errmsg:='序列号:'||v_i_sncode||'对应产品的包装规则与箱号的包装规则不一致,不能装入同一箱';
+//                      RETURN;
+//                   END IF;
+//END IF;
+//ELSE  --特殊装箱
+//   v_pr_packrule:='SPEC';
+//               IF(v_new= -1)THEN
+//                     ---页面必须传标准容量
+//                     IF(v_i_standardqty<=0)THEN
+//                         v_outboxcode:=null;
+//                         v_o_errmsg:='请维护箱标准容量!';
+//                         RETURN;                        
+//                     END IF;
+//v_pa_id := package_seq.nextval;    
+//                    insert into package(PA_ID, PA_OUTBOXCODE, PA_PRODCODE, PA_LEVEL, PA_PACKAGEQTY, PA_TOTALQTY,
+//                    PA_MAKECODE, PA_STATUS, PA_INDATE, PA_SALECODE, PA_TYPE, PA_CURRENTQTY, PA_PACKTYPE, PA_STANDARDQTY, PA_SCCODE)
+//                    values(v_pa_id, v_outboxcode, v_ms_prodcode,3,0,0,'',0, SYSDATE,'',1,0, v_pr_packrule, v_i_standardqty, v_i_sourcecode);
+//ELSE  --无需新增箱号
+//                   --判断箱是否已装满
+//                   IF(v_pa_currentqty= v_pa_standardqty)THEN
+//                        v_o_errmsg:='箱号:'||v_outboxcode||'已经满箱,请输入新箱号或勾选自动生成箱号!';
+//                        RETURN;
+//                -- ELSIF(nvl(v_pa_status,0)<>0)THEN
+//                --      v_o_errmsg:='箱号:'||v_outboxcode||'已经封箱,请输入新箱号或勾选自动生成箱号!';
+//                --      RETURN;
+//                   END IF;
+//END IF;
+//END IF;  
+//            --装明细
+//            insert into packagedetail(PD_ID, PD_PAID, PD_OUTBOXCODE, PD_INNERQTY, PD_BARCODE, PD_MAKECODE, PD_PRODCODE, PD_BUILDDATE, PD_YMD)
+//            VALUES(packagedetail_seq.NEXTVAL, v_pa_id, v_outboxcode,1, v_i_sncode, v_ms_makecode, v_ms_prodcode, sysdate, to_char(sysdate,'yyyymmdd'));
+//            --更新序列号所在箱号
+//            update makeserial set ms_outboxcode=v_outboxcode,ms_currentstepcode=v_currentstep where ms_id=v_ms_id;
+//               --更新装箱规则 pa_currentqty = 0
+//            update package set pa_packtype = v_pr_packrule, PA_SCCODE = v_i_sourcecode, pa_salecode =case when v_pr_packrule = 'SALE' then v_ms_salecode else ''end,pa_makecode=case when v_pr_packrule = 'MAKE' THEN v_ms_makecode ELSE '' END,pa_prodcode=case when v_pr_packrule<>'MIX' then v_ms_prodcode ELSE''END where pa_outboxcode= v_outboxcode and pa_currentqty = 0;
+//update package set pa_currentqty = nvl(pa_currentqty, 0) + 1, pa_totalqty = nvl(pa_totalqty, 0) + 1, pa_packageqty = nvl(pa_packageqty, 0) + 1 where pa_outboxcode = v_outboxcode;
+//          --取消装箱
+//          ELSIF('OUT'=v_i_inorout)THEN
+//             IF(NVL(v_ms_outboxcode,' ')=' ')THEN
+//                  v_o_errmsg:='序列号没有装箱,无需取消装箱';
+//                  RETURN;
+//             END IF;
+//             --取消装箱必须有箱号v_i_outboxcode
+//             IF(NVL(v_i_outboxcode,' ')=' ' OR v_i_outboxcode = NULL)then
+//                   v_o_errmsg:='请选择需要取消装箱的箱号';
+//                 RETURN;
+//             END IF;
 
-        /// <summary>
-        /// 构建圆角路径
-        /// </summary>
-        /// <param name="rect"></param>
-        /// <param name="cornerRadius"></param>
-        /// <returns></returns>
-        public static GraphicsPath CreateRoundPath(Rectangle rect, int cornerRadius)
-        {
-            GraphicsPath roundedRect = new GraphicsPath();
-            roundedRect.AddArc(rect.X, rect.Y, cornerRadius * 2, cornerRadius * 2, 180, 90);
-            roundedRect.AddLine(rect.X + cornerRadius, rect.Y, rect.Right - cornerRadius * 2, rect.Y);
-            roundedRect.AddArc(rect.X + rect.Width - cornerRadius * 2, rect.Y, cornerRadius * 2, cornerRadius * 2, 270, 90);
-            roundedRect.AddLine(rect.Right, rect.Y + cornerRadius * 2, rect.Right, rect.Y + rect.Height - cornerRadius * 2);
-            roundedRect.AddArc(rect.X + rect.Width - cornerRadius * 2, rect.Y + rect.Height - cornerRadius * 2, cornerRadius * 2, cornerRadius * 2, 0, 90);
-            roundedRect.AddLine(rect.Right - cornerRadius * 2, rect.Bottom, rect.X + cornerRadius * 2, rect.Bottom);
-            roundedRect.AddArc(rect.X, rect.Bottom - cornerRadius * 2, cornerRadius * 2, cornerRadius * 2, 90, 90);
-            roundedRect.AddLine(rect.X, rect.Bottom - cornerRadius * 2, rect.X, rect.Y + cornerRadius * 2);
-            roundedRect.CloseFigure();
-            return roundedRect;
-        }
 
-        /// <summary>
-        /// 构建圆角路径
-        /// </summary>
-        /// <param name="r"></param>
-        /// <param name="r1"></param>
-        /// <param name="r2"></param>
-        /// <param name="r3"></param>
-        /// <param name="r4"></param>
-        /// <returns></returns>
-        public static GraphicsPath CreateRoundRect(RectangleF r, float r1, float r2, float r3, float r4)
-        {
-            float x = r.X;
-            float y = r.Y;
-            float width = r.Width;
-            float height = r.Height;
-            GraphicsPath path = new GraphicsPath();
-            path.AddBezier(x, y + r1, x, y, x + r1, y, x + r1, y);
-            path.AddLine(x + r1, y, (x + width) - r2, y);
-            path.AddBezier((x + width) - r2, y, x + width, y, x + width, y + r2, x + width, y + r2);
-            path.AddLine((float)(x + width), (float)(y + r2), (float)(x + width), (float)((y + height) - r3));
-            path.AddBezier((float)(x + width), (float)((y + height) - r3), (float)(x + width), (float)(y + height), (float)((x + width) - r3), (float)(y + height), (float)((x + width) - r3), (float)(y + height));
-            path.AddLine((float)((x + width) - r3), (float)(y + height), (float)(x + r4), (float)(y + height));
-            path.AddBezier(x + r4, y + height, x, y + height, x, (y + height) - r4, x, (y + height) - r4);
-            path.AddLine(x, (y + height) - r4, x, y + r1);
-            return path;
-        }
-        #endregion
-    }
-}
+//             IF(v_i_outboxcode<> v_ms_outboxcode)THEN
+//                  v_o_errmsg:='序列号不在箱号:'||v_i_outboxcode||',无法取消装箱';
+//                 RETURN;
+//             END IF;
+//             --箱号未封装,允许取消
+//             select count(1) into v_count from packagedetail where pd_outboxcode = v_i_outboxcode and pd_barcode = v_i_sncode;
+//             IF(v_count= 0)THEN
+//                  v_o_errmsg:='序列号不在箱号:'||v_i_outboxcode||',无法取消装箱';
+//                 RETURN;
+//             END IF;
+//select pa_id, pa_prodcode, pa_status, pa_checkno, pa_currentqty, pa_downstatus into v_pa_id, v_pa_prodcode, v_pa_status, v_pa_checkno, v_pa_currentqty, v_pa_downstatus from package where pa_outboxcode = v_i_outboxcode and pa_type = 1;
+//             IF(NVL(v_pa_downstatus,0)<>0)THEN
+//                   v_o_errmsg:='箱号:'||v_i_outboxcode||'处于下地状态,不允许操作!';
+//                   RETURN;
+//              END IF;
+
+//delete from packagedetail where pd_outboxcode=v_i_outboxcode and pd_barcode=v_i_sncode; 
+//              --更新序列号所在箱号
+//              update makeserial set ms_outboxcode='',ms_currentstepcode=null where ms_id = v_ms_id;
+//              --更新数量,抽检批次号,更新未封箱
+//              update package set pa_currentqty=pa_currentqty-1,pa_totalqty=pa_totalqty-1,pa_packageqty=pa_packageqty-1,pa_status=0 where pa_outboxcode = v_i_outboxcode;
+//update package set pa_packtype = null, pa_sccode = null, pa_checkno = null, pa_salecode = null, pa_makecode = null, pa_prodcode = null where pa_outboxcode = v_i_outboxcode and pa_currentqty = 0;
+//              IF(nvl(v_pa_checkno,' ')<>' ')THEN
+//                  --未断批直接移除,更新数量
+//                 select MAX(OB_STATUS) INTO v_ob_status from oqcbatch where ob_checkno = v_pa_checkno;
+//                 IF(NVL(v_ob_status,' ')=' ' or v_ob_status = 'ENTERING')THEN
+//                   --更新序列号抽检批次号
+//                    update makeserial set ms_checkno=null where ms_id = v_ms_id;
+//                    --删除oqcbatchdetail
+//                    delete from oqcbatchdetail where obd_checkno = v_pa_checkno and obd_sncode = v_i_sncode;
+//                    --更新OQCBATCH 数量
+//                    update OQCBATCH set ob_nowcheckqty = ob_nowcheckqty - 1 where ob_checkno = v_pa_checkno;
+//END IF;
+//END IF;
+//              --如果序列号已有抽检批次号,
+//            /* IF(nvl(v_pa_checkno,' ')<>' ')THEN
+//                 --未断批直接移除,更新数量
+//                 select MAX(OB_STATUS) INTO v_ob_status from oqcbatch where ob_checkno=v_pa_checkno;
+//                 IF(NVL(v_ob_status,' ')=' ' or v_ob_status='ENTERING')THEN
+//                     --取消装箱
+//                     delete from packagedetail where pd_outboxcode=v_i_outboxcode and pd_barcode=v_i_sncode; 
+//                     --更新序列号所在箱号
+//                     update makeserial set ms_outboxcode='',ms_checkno='',ms_currentstepcode=null where ms_id=v_ms_id;
+//                     --更新数量,抽检批次号,更新未封箱
+//                     update package set pa_currentqty=pa_currentqty-1,pa_status=0 where pa_outboxcode=v_i_outboxcode;
+//                     update package set pa_packtype='',pa_checkno='',pa_sccode='' where pa_outboxcode=v_i_outboxcode and pa_currentqty=0;
+//                     --删除oqcbatchdetail
+//                     delete from oqcbatchdetail where obd_checkno=v_pa_checkno and obd_sncode=v_i_sncode;
+//                     --更新OQCBATCH 数量
+//                     update OQCBATCH set ob_nowcheckqty=ob_nowcheckqty-1 where ob_checkno=v_pa_checkno;
+//                 ELSE
+//                     v_o_errmsg:='序列号对应的抽检批次号已经断批.不允许取消装箱';
+//                     RETURN;
+//                 END IF;  
+//             ELSE  --无送检批次号
+//                  delete from packagedetail where pd_outboxcode=v_i_outboxcode and pd_barcode=v_i_sncode; 
+//                  --更新序列号所在箱号
+//                  update makeserial set ms_outboxcode='',ms_currentstepcode=null where ms_id=v_ms_id;
+//                  --更新数量,抽检批次号,更新未封箱
+//                  update package set pa_currentqty=pa_currentqty-1,pa_status=0 where pa_outboxcode=v_i_outboxcode;
+//                  update package set pa_packtype='',pa_sccode='' where pa_outboxcode=v_i_outboxcode and pa_currentqty=0;
+//             END IF; */
+//             --修改完工状态,mcd_inqty
+//             v_o_outboxcode:=v_i_outboxcode;
+//          END IF;
+//EXCEPTION--统一的异常捕捉
+//  WHEN OTHERS THEN
+//      BEGIN
+//          v_o_errmsg:=SQLERRM;
+//          ROLLBACK;
+//          IF SQLCODE<> 0 THEN
+//            BEGIN
+//               v_o_errmsg := v_o_errmsg || dbms_utility.format_error_backtrace();
+//END;
+//          END IF;
+//END;
+//   END;