chenhaozhe
2026-03-07 291fdb29daf239a13fcfb3f5e08a2f5bf9167534
DBUtility/ÒµÎñµ¥¾Ý/ClsXt_BaseBill.cs
@@ -520,18 +520,40 @@
                }
                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 " +
                                "where a.HBillTypeID = '" + this.BillType + "' " +
                                "and a.HInterID = " + HCheckFlowID_select + " " +
                                "order by b.HFlowNo asc";
                DataSet ds1 = oCn.RunProcReturn(sql1, "Xt_CheckFlowMain");
                if (ds1 == null || ds1.Tables[0].Rows.Count == 0)
                //若单据未绑定审批流
                DataSet ds1;
                if(HCheckFlowID_select=="0")
                {
                    sReturn = "默认审批流不存在!";
                    return false;
                    //获取单据类型对应的默认审批流
                    string sql1 = "select b.HInterID,b.HCheckItemID from Xt_CheckFlowMain as a " +
                                    "inner join Xt_CheckFlowSub as b on a.HInterID = b.HInterID " +
                                    "where a.HBillTypeID = '" + this.BillType + "' " +
                                    //"and a.HInterID = " + HCheckFlowID_select + " " +
                                    "and a.HStandard = 1 " +
                                    "order by b.HFlowNo asc";
                    ds1 = oCn.RunProcReturn(sql1, "Xt_CheckFlowMain");
                    if (ds1 == null || ds1.Tables[0].Rows.Count == 0)
                    {
                        sReturn = "单据未绑定审批流且默认审批流不存在!";
                        return false;
                    }
                }
                else
                {
                    //获取单据对应的审批流
                    string sql1 = "select b.HInterID,b.HCheckItemID from Xt_CheckFlowMain as a " +
                                    "inner join Xt_CheckFlowSub as b on a.HInterID = b.HInterID " +
                                    "where a.HBillTypeID = '" + this.BillType + "' " +
                                    "and a.HInterID = " + HCheckFlowID_select + " " +
                                    "order by b.HFlowNo asc";
                    ds1 = oCn.RunProcReturn(sql1, "Xt_CheckFlowMain");
                    if (ds1 == null || ds1.Tables[0].Rows.Count == 0)
                    {
                        sReturn = "审批流不存在!";
                        return false;
                    }
                }
                HCheckFlowID = ds1.Tables[0].Rows[0]["HInterID"].ToString();
                HCheckItemNowID = ds1.Tables[0].Rows[0]["HCheckItemID"].ToString();
@@ -581,7 +603,7 @@
        }
        //驳回
        public bool RejectCheckFlowProgress(Int64 lngBillKey, string HBillNo,string sUser, ref string sReturn)
        public virtual bool RejectCheckFlowProgress(Int64 lngBillKey, string HBillNo,string sUser, ref string sReturn)
        {
            if (isUse(lngBillKey, ref sReturn))
@@ -622,7 +644,7 @@
                //查找是否有权限
                string sql01 = "select * from Xt_CheckUserRight where HUserID = '" + sUser + "' and HCheckFlowInterID = " + HCheckFlowID + " and HCheckItemID = " + HCheckItemNowID + "";
                DataSet ds01 = oCn.RunProcReturn(sql01, "Xt_CheckUserRight");
                if (ds01.Tables[0].Rows.Count == 0)
                if (ds01.Tables[0].Rows.Count == 0)//单据原审核权限为多级审核驳回权限
                {
                    sReturn = "无权限!";
                    return false;
@@ -696,7 +718,7 @@
                if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
                {
                    string HBillType = ds.Tables[0].Rows[0]["HBillType"].ToString();
                    if (HBillType == "1201" || HBillType == "1202" || HBillType == "1203" || HBillType == "1247" || HBillType == "1244" || HBillType == "1251" || HBillType == "1210" || HBillType == "1205" || HBillType == "1250" || HBillType == "1206" || HBillType == "1245" || HBillType == "1239")
                    if (HBillType == "1201" || HBillType == "1202" || HBillType == "1203" || HBillType == "1247" || HBillType == "1244" || HBillType == "1251" || HBillType == "1210" || HBillType == "1205" || HBillType == "1250" || HBillType == "1206" || HBillType == "1245" || HBillType == "1239"|| HBillType == "1256")
                    {
                        //反审核更新 åŠæ—¶åº“存表 å¢žåŠ åº“å­˜ 1201 1202 1203 1247 1244 1251 1210
                        //反审核更新 åŠæ—¶åº“存表 å‡å°‘库存 1205 1250 1206 1245 1239 
@@ -900,7 +922,7 @@
                if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
                {
                    string HBillType = ds.Tables[0].Rows[0]["HBillType"].ToString();
                    if (HBillType == "1201" || HBillType == "1202" || HBillType == "1203" || HBillType == "1247" || HBillType == "1244" || HBillType == "1251" || HBillType == "1210" || HBillType == "1250" || HBillType == "1206" || HBillType == "1245" || HBillType == "1239")
                    if (HBillType == "1201" || HBillType == "1202" || HBillType == "1203" || HBillType == "1247" || HBillType == "1244" || HBillType == "1251" || HBillType == "1210" || HBillType == "1250" || HBillType == "1206" || HBillType == "1245" || HBillType == "1239" || HBillType == "1256")
                    {
                        //审核更新 åŠæ—¶åº“存表 å¢žåŠ åº“å­˜ 1201 1202 1203 1247 1244 1251 1210
                        //审核更新 åŠæ—¶åº“存表 å‡å°‘库存 1204 1250 1206 1245 1239 
@@ -1578,7 +1600,18 @@
        {
            return true;
        }
        //修改单据_APP
        public virtual bool ModifyBill_APP(Int64 lngBillKey, ref string sReturn)
        {
            return true;
        }
        //新增单据_APP
        public virtual bool AddBill_APP(ref string sReturn)
        {
            return true;
        }
        //删除关联
        public virtual void  DeleteRelation(ref string sReturn, Int64 lngBillKey)