yusijie
2024-08-07 36e2fbb6b4523b6dbbbab6dace3d5e05d49ca4e1
DBUtility/ÒµÎñµ¥¾Ý/ClsXt_BaseBill.cs
@@ -373,7 +373,7 @@
        }
        //发起多级审批
        public bool startCheckFlow(Int64 lngBillKey, Int64 HCheckFlowID_select, ref string sReturn)
        public bool startCheckFlow(Int64 lngBillKey,ref string sReturn)
        {
            try
            {
@@ -400,7 +400,7 @@
                    return false;
                }
                HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString();
                string HCheckFlowID_select = ds.Tables[0].Rows[0]["HCheckFlowID"].ToString();
                //获取单据类型对应的默认审批流
                string sql1 = "select b.HInterID,b.HCheckItemID from Xt_CheckFlowMain as a " +
                                "inner join Xt_CheckFlowSub as b on a.HInterID = b.HInterID " +
@@ -475,21 +475,21 @@
                oCn.BeginTran();
                //判断是否存在审核过的项目
                string sql0 = "select * from Xt_BillCheckFlowStatus where HBillInterID = " + lngBillKey + " and HBillTypeID = '" + this.BillType + "' and ISNULL(HChecker,'') <> ''";
                DataSet ds0 = oCn.RunProcReturn(sql0, "Xt_BillCheckFlowStatus");
                if (ds0 != null && ds0.Tables[0].Rows.Count == 0)
                {
                    sReturn = "单据不存在已经审核的项目!";
                    return false;
                }
                //string sql0 = "select * from Xt_BillCheckFlowStatus where HBillInterID = " + lngBillKey + " and HBillTypeID = '" + this.BillType + "' and ISNULL(HChecker,'') <> ''";
                //DataSet ds0 = oCn.RunProcReturn(sql0, "Xt_BillCheckFlowStatus");
                //if (ds0 != null && ds0.Tables[0].Rows.Count == 0)
                //{
                //    sReturn = "单据不存在已经审核的项目!";
                //    return false;
                //}
                //获取需要驳回的审核项目
                sql0 = "select c.* from Xt_CheckFlowMain as a " +
                string sql0 = "select c.* from Xt_CheckFlowMain as a " +
                              "inner join Xt_CheckFlowSub as b on a.HInterID = b.HInterID " +
                              "inner join Xt_BillCheckFlowStatus as c on a.HBillTypeID = c.HBillTypeID and b.HCheckItemID = c.HCheckItemID " +
                              "where c.HBillTypeID = '" + this.BillType + "' and c.HBillInterID = " + lngBillKey + " " +
                              "order by b.HFlowNo asc";
                ds0 = oCn.RunProcReturn(sql0, "Xt_BillCheckFlowStatus");
                DataSet ds0 = oCn.RunProcReturn(sql0, "Xt_BillCheckFlowStatus");
                if (ds0 == null || ds0.Tables[0].Rows.Count == 0)
                {
                    sReturn = "驳回失败!原因:未发起审批!!";
@@ -511,7 +511,7 @@
                //更新 é©³å›žåˆ é™¤å®¡æ ¸æµçŠ¶æ€è¡¨
                string sql02 = "Delete Xt_BillCheckFlowStatus where HBillTypeID = '" + this.BillType + "' and HBillInterID=" + lngBillKey + " and HCheckFlowID=" + HCheckFlowID;
                oCn.RunProc(sql02);
                oCn.RunProc(" Update " + MvarItemKey + " set HChecker='',HCheckDate=null,HBillStatus=5 Where HInterID=" + lngBillKey.ToString());
                oCn.RunProc(" Update " + MvarItemKey + " set HChecker='',HCheckDate=null,HBillStatus=5,HCheckItemNowID = 0,HCheckItemNextID = 0 Where HInterID=" + lngBillKey.ToString());
                //写入日志
                string WorkList = "驳回单据,单据号:" + HBillNo;