ccflow 删除附件bug&审核时节点字段数据丢失bug&递归查找签核人bug

本文档详细介绍了CCFLOW系统中遇到的四个关键bug:1) 递归查找签核人导致的错误;2) 加签操作时的自我加签限制bug;3) 完成时间记录不准确的问题;4) 删除附件功能的bug。每个bug都提供了相应的代码段和解决方案,以帮助开发者理解和修复这些问题。
摘要由CSDN通过智能技术生成

递归查找签核人bug  D:\CCOA\trunk\Components\BP.WF\Templete\FindWorker\FindWorker.cs

public DataTable Func_GenerWorkerList_DiGui(string deptNo, string empNo)
        {

       ............

     if (dt.Rows.Count == 0)
                {
                    //remove by 

                    //sql = "SELECT No FROM Port_Emp WHERE No!=" + dbStr + "FK_Emp AND No IN ";
                    //sql += "(SELECT  FK_Emp  FROM Port_EmpStation WHERE FK_Station IN (SELECT FK_Station FROM WF_NodeStation WHERE FK_Node=" + dbStr + "FK_Node ) )";
                    //ps = new Paras();
                    //ps.SQL = sql;
                    //ps.Add("FK_Emp", empNo);
                    //ps.Add("FK_Node", town.HisNode.NodeID);
                    //dt = DBAccess.RunSQLReturnTable(ps);
                    //if (dt.Rows.Count == 0)     
                    BP.Port.Dept myDept = new BP.Port.Dept(deptNo);
                    string nowDeptID = myDept.ParentNo;
                    if (nowDeptID == "-1" || nowDeptID.ToString() == "0")
                    {
                        throw new Exception("@岗位(" + town.HisNode.HisStationsStr + ")下没有人员,对应节点:" + town.HisNode.Name);
                    }
                    else
                        dt = Func_GenerWorkerList_DiGui(nowDeptID, empNo);
                   
                }
                return dt;

 

        }

====jbox返回值 ----jbox参数 http://www.ablanxue.com/prone_15180_1.html

 

function ReturnVal(ctrl, fk_mapExt, refEnPK)

{ //如果是chrome,执行下列方法
         $.jBox("iframe:" + url, {
             title: 'PopWin',
             width: 700,
             height: 550,

            //loaded加载完成后执行

             // loaded: function (h) {
           //     window.parent.window.jBox.close();  //关闭窗口

           //}
             buttons: { 'Submit': true },
             submit: function (v, h, f) {
                 if ('undefined' == typeof(h[0].firstChild.contentWindow.returnValue)) {
                     ctrl.value = '';
                 }
                 else
                     ctrl.value = h[0].firstChild.contentWindow.returnValue;
             }
         });
    
    }

服务端

 protected void WinClose(string val)
        {
            string clientscript = "<script language='javascript'> window.returnValue = '" + val + "'; window.close(); </script>";
            this.Page.Response.Write(clientscript);
        }

=======加签bug

 public static string Node_Askfor(Int64 workid, AskforHelpSta askforSta, string askForEmp, string askForNote)
        {
            if (askForEmp==WebUser.No)//add by
            {
                return "Could not ask for yourself.";
            }
            Emp emp = new Emp(askForEmp);

........................
  // 更换主键后,执行insert ,让被加签人有代办工作.
            gwl.IsPassInt = 0;
            gwl.FK_Emp = emp.No;
            gwl.FK_EmpText = emp.Name;
            // 添加是否存在判断 add by
            string sql = string.Format(@"select WorkID,FK_Emp,FK_Node from WF_GenerWorkerlist where WorkID={0} and FK_Emp='{1}' and FK_Node='{2}'",workid,emp.No,gwf.FK_Node);
            DataTable dt = BP.DA.DBAccess.RunSQLReturnTable(sql);
            if (dt != null && dt.Rows.Count > 0)
            {
                gwl.Update();
            }
            else
            {
                gwl.Insert();
            }
            //写入track.
.........................
}

====完成时间bug 

D:\CCFLOW\trunk\Components\BP.WF\WF\WorkNode.cs

 public Node NodeSend_GenerNextStepNode_Ext1()
        {...........

 skip.OID = this.WorkID;
                    skip.FID = this.HisWork.FID;
                    skip.Rec = WebUser.No;
                    skip.SetValByKey(WorkAttr.RDT, DataType.CurrentDataTimess);
                    skip.SetValByKey(WorkAttr.CDT, DataType.CurrentDataTimess);//add

.................

}

private void NodeSend_11(Node toND)
        {

......................

 toWK.Copy(this.HisWork); // 执行 copy 上一个节点的数据。
                    toWK.Rec = BP.Web.WebUser.No;
                    toWK.SetValByKey("CDT",DataType.CurrentData);//add by

................

}

====删除附件bug

D:\CCFLOW2015\CCPortal\CCOA\CCOA\WF\CCForm\Do.aspx.cs 

case "DelDtl":
                        GEDtls dtls = new GEDtls(this.EnsName);
                        GEDtl dtl = (GEDtl)dtls.GetNewEntity;
                        dtl.OID = this.RefOID;
                        if (dtl.RetrieveFromDBSources() == 0)
                        {
                            this.WinClose();
                            break;
                        }

                        FrmEvents fes = new FrmEvents(this.EnsName); //获得事件.
                        // 处理删除前事件.
                        try
                        {
                           string r= fes.DoEventNode(BP.WF.XML.EventListDtlList.DtlItemDelBefore, dtl);
                           if (r == "false" || r == "0")
                           {
                               this.WinClose();
                               return;
                           }
                        }
                        catch (Exception ex)
                        {
                            this.WinCloseWithMsg(ex.Message);
                            break;
                        }
                        dtl.Delete();
                        //删除附件
                        Paras ps = new Paras();
                        ps.SQL = "select TOP 1 FileFullName,MyPK from Sys_FrmAttachmentDB whereFK_MapData=@FK_MapData andRefPKVal=@RefPKVal";
                Para p1=new Para();
                p1.ParaName = "@RefPKVal";
                p1.Size = this.RefOID.ToString().Length;
                p1.val = this.RefOID;           
                ps.Add(p1);
                         Para p2=new Para();
                         p2.ParaName = "@FK_MapData";
                p2.val = this.EnsName;
                p2.Size = this.EnsName.Length;
                ps.Add(p2);
                DataTable attTable = BP.DA.DBAccess.RunSQLReturnTable(ps);
                if (attTable!=null&&attTable.Rows.Count>0)
                {
                    string path = attTable.Rows[0][0].ToString();
                    if (System.IO.File.Exists(path))
                    {
                        try
                        {
                            System.IO.File.Delete(path);
                        }
                        catch { }
                    }
                    FrmAttachmentDB dtlDB = new FrmAttachmentDB();
                    dtlDB.MyPK = attTable.Rows[0][1].ToString();
                    dtlDB.DirectDelete();
                }
                        // 处理删除后事件.
                        try
                        {
                            fes.DoEventNode(BP.WF.XML.EventListDtlList.DtlItemDelAfter, dtl);
                        }
                        catch (Exception ex)
                        {
                            this.WinCloseWithMsg(ex.Message);
                            break;
                        }
                        this.WinClose();
                        break;
                    case "EmpDoUp":

///审核时节点字段数据丢失

是因为从邮件链接进去的,地址栏中没有FK_Node字段,需在do.cs中补上

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值