wtt
2025-12-16 aaee43018e841815c1603d1425d7abb0f562b20b
DBUtility/ÒµÎñµ¥¾Ý/ClsXt_BaseBill.cs
@@ -520,19 +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 + " " +
                                "and a.HStandard = 1 " +
                                "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();