积分优化

This commit is contained in:
2026-10-17 10:34:45 +08:00
parent 29b15d4b54
commit bbd0e6d392
27 changed files with 1054 additions and 335 deletions
+54 -29
View File
@@ -153,7 +153,9 @@ namespace BLL
/// <returns></returns>
public static List<Model.Base_Unit> GetUnitDropDownList()
{
var list = (from x in Funs.DB.Base_Unit select x).OrderBy(x => x.UnitCode).ToList();
var list = (from x in Funs.DB.Base_Unit
orderby x.IsThisUnit descending, x.UnitCode ascending
select x).ToList();
return list;
}
@@ -163,7 +165,10 @@ namespace BLL
/// <returns></returns>
public static List<Model.Base_Unit> GetThisUnitDropDownList()
{
var list = (from x in Funs.DB.Base_Unit where x.UnitId == Const.UnitId_XJYJ select x).ToList();
var list = (from x in Funs.DB.Base_Unit
where x.UnitId == Const.UnitId_XJYJ
orderby x.IsThisUnit descending, x.UnitCode ascending
select x).ToList();
return list;
}
@@ -181,7 +186,10 @@ namespace BLL
var unitIdList = GetChildrenUnitId(unitId);
if (unitIdList.Count() > 0)
{
unitList = (from x in Funs.DB.Base_Unit where unitIdList.Contains(x.UnitId) || x.UnitId == unitId select x).ToList();
unitList = (from x in Funs.DB.Base_Unit
where unitIdList.Contains(x.UnitId) || x.UnitId == unitId
orderby x.IsThisUnit descending, x.UnitCode ascending
select x).ToList();
}
return unitList;
}
@@ -212,12 +220,14 @@ namespace BLL
{
var list = (from x in Funs.DB.Base_Unit
where x.IsBranch == true
select x).OrderBy(x => x.UnitCode).ToList();
orderby x.IsThisUnit descending, x.UnitCode ascending
select x).ToList();
if (isThisUnit)
{
list = (from x in Funs.DB.Base_Unit
where x.IsBranch == true || x.UnitId == Const.UnitId_XJYJ
select x).OrderBy(x => x.UnitCode).ToList();
orderby x.IsThisUnit descending, x.UnitCode ascending
select x).ToList();
}
return list;
}
@@ -237,15 +247,16 @@ namespace BLL
units = (from x in db.Base_Unit
join y in db.Project_ProjectUnit on x.UnitId equals y.UnitId
where y.ProjectId == projectId
orderby x.IsThisUnit descending, x.UnitCode ascending
select x).ToList();
}
else
{
units = (from x in db.Base_Unit
orderby x.UnitCode
orderby x.IsThisUnit descending, x.UnitCode ascending
select x).ToList();
}
units = units.OrderBy(x => x.UnitCode).ToList();
//units = units.OrderBy(x => x.UnitCode).ToList();
return units;
}
}
@@ -263,7 +274,7 @@ namespace BLL
join y in db.Project_ProjectUnit
on x.UnitId equals y.UnitId
where y.ProjectId == projectId
orderby x.UnitCode
orderby x.IsThisUnit descending, x.UnitCode ascending
select x).ToList();
return q;
}
@@ -282,7 +293,7 @@ namespace BLL
join y in db.Project_ProjectUnit
on x.UnitId equals y.UnitId
where y.ProjectId == projectId && (y.UnitType == unitType || string.IsNullOrEmpty(unitType))
orderby x.UnitCode
orderby x.IsThisUnit descending, x.UnitCode ascending
select x).ToList();
return q;
}
@@ -301,7 +312,7 @@ namespace BLL
join y in db.Project_ProjectUnit
on x.UnitId equals y.UnitId
where y.ProjectId == projectId && (y.UnitType == BLL.Const.ProjectUnitType_2 || y.UnitType == BLL.Const.ProjectUnitType_1)
orderby x.UnitCode
orderby x.IsThisUnit descending, x.UnitCode ascending
select x).ToList();
return q;
}
@@ -320,7 +331,7 @@ namespace BLL
join y in db.Project_ProjectUnit
on x.UnitId equals y.UnitId
where y.ProjectId == projectId && (x.UnitId != unitId || unitId == null)
orderby x.UnitCode
orderby x.IsThisUnit descending, x.UnitCode ascending
select x).ToList();
return q;
}
@@ -333,7 +344,7 @@ namespace BLL
join y in db.Project_ProjectUnit
on x.UnitId equals y.UnitId
where y.ProjectId == projectId && (unitId == null || x.UnitId != unitId) && (key == null || x.UnitCode.Contains(key) || x.UnitName.Contains(key))
orderby x.UnitCode
orderby x.IsThisUnit descending, x.UnitCode ascending
select x).ToList();
return q;
}
@@ -421,7 +432,10 @@ namespace BLL
public static List<Model.Base_Unit> GetMainAndSubUnitList()
{
//return (from x in Funs.DB.Base_Unit where x.IsThisUnit == true || x.IsBranch == true orderby x.IsThisUnit descending select x).ToList();
return (from x in Funs.DB.Base_Unit where x.IsThisUnit == true || x.IsBranch == true select x).ToList();
return (from x in Funs.DB.Base_Unit
where x.IsThisUnit == true || x.IsBranch == true
orderby x.IsThisUnit descending, x.UnitCode ascending
select x).ToList();
}
#region 单位表下拉框
@@ -557,11 +571,11 @@ namespace BLL
using (Model.CNPCDB db = new Model.CNPCDB(Funs.ConnString))
{
var q = (from x in db.Base_Unit
join y in db.Project_ProjectUnit
on x.UnitId equals y.UnitId
join y in db.Project_ProjectUnit on x.UnitId equals y.UnitId
where y.ProjectId == projectId
&& (y.UnitType == BLL.Const.ProjectUnitType_1 || y.UnitType == BLL.Const.ProjectUnitType_2) && (y.OutTime == null || y.OutTime >= Convert.ToDateTime(DateTime.Now.Year.ToString() + "-" + DateTime.Now.Month.ToString() + "-01"))
select x).OrderBy(x => x.UnitCode).ToList();
orderby x.IsThisUnit descending, x.UnitCode ascending
select x).ToList();
return q;
}
}
@@ -620,16 +634,17 @@ namespace BLL
using (Model.CNPCDB db = new Model.CNPCDB(Funs.ConnString))
{
var q = (from x in db.Base_Unit
orderby x.UnitCode
orderby x.IsThisUnit descending, x.UnitCode ascending
select x).ToList();
if (!string.IsNullOrEmpty(projectId))
{
q = (from x in q
join y in db.Project_ProjectUnit on x.UnitId equals y.UnitId
where (y.ProjectId == projectId && y.UnitType != Const.ProjectUnitType_2)
orderby x.IsThisUnit descending, x.UnitCode ascending
select x).ToList();
}
q = q.OrderByDescending(x => x.UnitCode).ToList();
//q = q.OrderByDescending(x => x.UnitCode).ToList();
return q;
}
}
@@ -741,7 +756,8 @@ namespace BLL
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
where x.ProjectId == projectId
//where (x.UnitType == Const.ProjectUnitType_1 || x.UnitType == Const.ProjectUnitType_2)
orderby y.UnitCode
//orderby y.UnitCode
orderby y.IsThisUnit descending, y.UnitCode ascending
select y).ToList();
ListItem[] list = new ListItem[q.Count()];
for (int i = 0; i < list.Count(); i++)
@@ -805,7 +821,8 @@ namespace BLL
var q = (from x in Funs.DB.Project_ProjectUnit
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
where x.ProjectId == projectId
orderby y.UnitCode
//orderby y.UnitCode
orderby y.IsThisUnit descending, y.UnitCode ascending
select y).ToList();
ListItem[] list = new ListItem[q.Count()];
for (int i = 0; i < list.Count(); i++)
@@ -827,8 +844,9 @@ namespace BLL
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
join z in Funs.DB.ProjectData_WorkArea on y.UnitId equals z.UnitId
where x.ProjectId == projectId && (y.UnitId == unitId || z.SupervisorUnitId == unitId) && x.UnitType == BLL.Const.ProjectUnitType_2
orderby y.UnitCode
select y).Distinct().ToList();
//orderby y.UnitCode
orderby y.IsThisUnit descending, y.UnitCode ascending
select y).Distinct().ToList();
return q;
}
@@ -844,7 +862,8 @@ namespace BLL
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
join z in Funs.DB.ProjectData_WorkArea on y.UnitId equals z.UnitId
where x.ProjectId == projectId && (y.UnitId == unitId || z.SupervisorUnitId == unitId) && x.UnitType == BLL.Const.ProjectUnitType_2
orderby y.UnitCode
//orderby y.UnitCode
orderby y.IsThisUnit descending, y.UnitCode ascending
select y).Distinct().ToList();
ListItem[] list = new ListItem[q.Count()];
for (int i = 0; i < q.Count(); i++)
@@ -852,7 +871,7 @@ namespace BLL
list[i] = new ListItem(q[i].UnitName ?? "", q[i].UnitId.ToString());
}
return list;
}
}
/// <summary>
/// 获取登陆用户分包单位名称项
@@ -861,7 +880,7 @@ namespace BLL
/// <param name="projectId"></param>
/// <param name="unitId"></param>
/// <param name="isShowPlease"></param>
public static void InitSubUnitNameDownList(FineUIPro.DropDownList dropName, string projectId,string unitId, bool isShowPlease)
public static void InitSubUnitNameDownList(FineUIPro.DropDownList dropName, string projectId, string unitId, bool isShowPlease)
{
dropName.DataValueField = "Value";
dropName.DataTextField = "Text";
@@ -883,8 +902,9 @@ namespace BLL
{
var q = (from x in Funs.DB.Project_ProjectUnit
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
where x.ProjectId == projectId && y.UnitId == unitId && x.UnitType == BLL.Const.ProjectUnitType_2
orderby y.UnitCode
where x.ProjectId == projectId && y.UnitId == unitId && x.UnitType == BLL.Const.ProjectUnitType_2
//orderby y.UnitCode
orderby y.IsThisUnit descending, y.UnitCode ascending
select y).Distinct().ToList();
ListItem[] list = new ListItem[q.Count()];
for (int i = 0; i < q.Count(); i++)
@@ -952,7 +972,10 @@ namespace BLL
{
using (Model.CNPCDB db = new Model.CNPCDB(Funs.ConnString))
{
var q = (from x in db.Base_Unit where x.UnitId != BLL.Const.UnitId_XJYJ orderby x.UnitCode select x).ToList();
var q = (from x in db.Base_Unit
where x.UnitId != BLL.Const.UnitId_XJYJ
orderby x.IsThisUnit descending, x.UnitCode ascending
select x).ToList();
return q;
}
}
@@ -961,7 +984,9 @@ namespace BLL
{
dropName.DataValueField = "UnitId";
dropName.DataTextField = "UnitName";
dropName.DataSource = (from x in Funs.DB.Base_Unit orderby x.UnitCode select x).ToList();
dropName.DataSource = (from x in Funs.DB.Base_Unit
orderby x.IsThisUnit descending, x.UnitCode ascending
select x).ToList();
dropName.DataBind();
if (isShowPlease)
{
-1
View File
@@ -492,7 +492,6 @@ namespace BLL
orderby x.UserName
select x).ToList();
}
}
else
{