去除静态变量Funs.DB

This commit is contained in:
2025-01-07 19:00:48 +08:00
parent 188974fadc
commit 2c1a328bc1
290 changed files with 1205 additions and 1242 deletions
@@ -2,12 +2,12 @@
using System.Collections.Generic;
using System.Data;
using System.Linq;
using Model;
namespace BLL
{
public class CQMS_MainPlanApproveService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 获取总包施工计划模板列表
/// </summary>
@@ -16,14 +16,15 @@ namespace BLL
/// <returns></returns>
public static DataTable getListData(string MainPlanId)
{
var res = from x in db.Plan_MainPlanApprove
var db1 = Funs.DB;
var res = from x in db1.Plan_MainPlanApprove
where x.MainPlanId == MainPlanId && x.ApproveDate != null && x.ApproveType != "S"
orderby x.ApproveDate
select new
{
x.MainPlanApproveId,
x.MainPlanId,
ApproveMan = (from y in db.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(),
ApproveMan = (from y in db1.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(),
x.ApproveDate,
x.IsAgree,
x.ApproveIdea,
@@ -77,7 +78,7 @@ namespace BLL
/// <returns></returns>
public static Model.Plan_MainPlanApprove GetSee(string MainPlanId, string userId)
{
return db.Plan_MainPlanApprove.FirstOrDefault(x => x.MainPlanId == MainPlanId && x.ApproveType == "S" && x.ApproveMan == userId && x.ApproveDate == null);
return Funs.DB.Plan_MainPlanApprove.FirstOrDefault(x => x.MainPlanId == MainPlanId && x.ApproveType == "S" && x.ApproveMan == userId && x.ApproveDate == null);
}
public static void See(string MainPlanId, string userId)
{
@@ -98,7 +99,7 @@ namespace BLL
/// <returns>一个总包施工计划审批实体</returns>
public static Model.Plan_MainPlanApprove GetMainPlanApproveByMainPlanId(string MainPlanId)
{
return db.Plan_MainPlanApprove.FirstOrDefault(x => x.MainPlanId == MainPlanId && x.ApproveType != "S" && x.ApproveDate == null);
return Funs.DB.Plan_MainPlanApprove.FirstOrDefault(x => x.MainPlanId == MainPlanId && x.ApproveType != "S" && x.ApproveDate == null);
}
/// <summary>
@@ -108,12 +109,12 @@ namespace BLL
/// <returns>总包施工计划审批集合</returns>
public static List<Model.Plan_MainPlanApprove> GetMainPlanApprovesByMainPlanId(string MainPlanId)
{
return (from x in db.Plan_MainPlanApprove where x.MainPlanId == MainPlanId && x.ApproveType != "S" && x.ApproveDate == null select x).ToList();
return (from x in Funs.DB.Plan_MainPlanApprove where x.MainPlanId == MainPlanId && x.ApproveType != "S" && x.ApproveDate == null select x).ToList();
}
public static Model.Plan_MainPlanApprove GetAuditMan(string MainPlanId, string state)
{
return db.Plan_MainPlanApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.MainPlanId == MainPlanId && x.ApproveType == state);
return Funs.DB.Plan_MainPlanApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.MainPlanId == MainPlanId && x.ApproveType == state);
}
public static string GetHandleManName(string MainPlanId)
{
@@ -169,7 +170,7 @@ namespace BLL
/// <returns></returns>
public static Model.Plan_MainPlanApprove GetAudit1(string MainPlanId)
{
return db.Plan_MainPlanApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.MainPlanId == MainPlanId && x.ApproveType == BLL.Const.MainPlan_Audit1);
return Funs.DB.Plan_MainPlanApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.MainPlanId == MainPlanId && x.ApproveType == BLL.Const.MainPlan_Audit1);
}
/// <summary>
@@ -200,7 +201,7 @@ namespace BLL
/// <returns></returns>
public static Model.Plan_MainPlanApprove GetAudit3(string MainPlanId, string userId)
{
return db.Plan_MainPlanApprove.FirstOrDefault(x => x.MainPlanId == MainPlanId && x.ApproveMan == userId && x.ApproveDate == null);
return Funs.DB.Plan_MainPlanApprove.FirstOrDefault(x => x.MainPlanId == MainPlanId && x.ApproveMan == userId && x.ApproveDate == null);
}
/// <summary>
@@ -210,12 +211,12 @@ namespace BLL
/// <returns></returns>
public static List<string> GetAudit3PersonIds(string MainPlanId)
{
return (from x in db.Plan_MainPlanApprove where x.MainPlanId == MainPlanId && x.ApproveType == BLL.Const.MainPlan_Audit3 select x.ApproveMan).ToList();
return (from x in Funs.DB.Plan_MainPlanApprove where x.MainPlanId == MainPlanId && x.ApproveType == BLL.Const.MainPlan_Audit3 select x.ApproveMan).ToList();
}
public static Model.Plan_MainPlanApprove GetComplie(string MainPlanId)
{
return db.Plan_MainPlanApprove.FirstOrDefault(x => x.MainPlanId == MainPlanId && x.ApproveType == BLL.Const.MainPlan_Compile);
return Funs.DB.Plan_MainPlanApprove.FirstOrDefault(x => x.MainPlanId == MainPlanId && x.ApproveType == BLL.Const.MainPlan_Compile);
}
public static List<Model.Plan_MainPlanApprove> getApproveListDataByIdForApi(string MainPlanId)