0915-gaofei
This commit is contained in:
@@ -27,12 +27,21 @@ namespace BLL
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据Id获取对应费控项明细历史记录信息
|
||||
/// 根据Id获取对应费控项月明细历史记录信息
|
||||
/// </summary>
|
||||
/// <param name="toWbs">对应wbsId</param>
|
||||
public static List<Model.WBS_CostControlDetailHistory> GetCostControlDetailHistorysByCostControlId(string costControlId)
|
||||
public static List<Model.WBS_CostControlDetailHistory> GetMonthCostControlDetailHistorysByCostControlId(string costControlId)
|
||||
{
|
||||
return (from x in Funs.DB.WBS_CostControlDetailHistory where x.CostControlId == costControlId orderby x.VersionNum, x.Months select x).ToList();
|
||||
return (from x in Funs.DB.WBS_CostControlDetailHistory where x.CostControlId == costControlId && x.StartDate == null orderby x.VersionNum, x.Months select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据Id获取对应费控项周明细历史记录信息
|
||||
/// </summary>
|
||||
/// <param name="toWbs">对应wbsId</param>
|
||||
public static List<Model.WBS_CostControlDetailHistory> GetWeekCostControlDetailHistorysByCostControlId(string costControlId, DateTime months)
|
||||
{
|
||||
return (from x in Funs.DB.WBS_CostControlDetailHistory where x.CostControlId == costControlId && x.Months == months && x.StartDate != null orderby x.VersionNum, x.StartDate select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -81,13 +90,28 @@ namespace BLL
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据CostControlId月获取当前最大版本
|
||||
/// 根据CostControlId月获取当前月计划最大版本
|
||||
/// </summary>
|
||||
/// <param name="costControlId">costControlId</param>
|
||||
public static int GetMaxVersionNumByCostControlId(string costControlId)
|
||||
public static int GetMonthMaxVersionNumByCostControlId(string costControlId)
|
||||
{
|
||||
int i = 0;
|
||||
var q = (from x in Funs.DB.WBS_CostControlDetailHistory where x.CostControlId == costControlId orderby x.VersionNum descending select x.VersionNum ?? 0).ToList();
|
||||
var q = (from x in Funs.DB.WBS_CostControlDetailHistory where x.CostControlId == costControlId && x.StartDate == null orderby x.VersionNum descending select x.VersionNum ?? 0).ToList();
|
||||
if (q.Count > 0)
|
||||
{
|
||||
i = q[0];
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据CostControlId月获取当前周计划最大版本
|
||||
/// </summary>
|
||||
/// <param name="costControlId">costControlId</param>
|
||||
public static int GetWeekMaxVersionNumByCostControlId(string costControlId, DateTime months)
|
||||
{
|
||||
int i = 0;
|
||||
var q = (from x in Funs.DB.WBS_CostControlDetailHistory where x.CostControlId == costControlId && x.Months == months && x.StartDate != null orderby x.VersionNum descending select x.VersionNum ?? 0).ToList();
|
||||
if (q.Count > 0)
|
||||
{
|
||||
i = q[0];
|
||||
@@ -106,6 +130,8 @@ namespace BLL
|
||||
newWBS_CostControlDetailHistory.CostControlDetailHistoryId = costControlDetailHistory.CostControlDetailHistoryId;
|
||||
newWBS_CostControlDetailHistory.CostControlId = costControlDetailHistory.CostControlId;
|
||||
newWBS_CostControlDetailHistory.Months = costControlDetailHistory.Months;
|
||||
newWBS_CostControlDetailHistory.StartDate = costControlDetailHistory.StartDate;
|
||||
newWBS_CostControlDetailHistory.EndDate = costControlDetailHistory.EndDate;
|
||||
newWBS_CostControlDetailHistory.PlanNum = costControlDetailHistory.PlanNum;
|
||||
newWBS_CostControlDetailHistory.VersionNum = costControlDetailHistory.VersionNum;
|
||||
|
||||
@@ -121,6 +147,8 @@ namespace BLL
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.WBS_CostControlDetailHistory newWBS_CostControlDetailHistory = db.WBS_CostControlDetailHistory.First(e => e.CostControlDetailHistoryId == costControlDetailHistory.CostControlDetailHistoryId);
|
||||
newWBS_CostControlDetailHistory.StartDate = costControlDetailHistory.StartDate;
|
||||
newWBS_CostControlDetailHistory.EndDate = costControlDetailHistory.EndDate;
|
||||
newWBS_CostControlDetailHistory.PlanNum = costControlDetailHistory.PlanNum;
|
||||
|
||||
db.SubmitChanges();
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
@@ -35,7 +36,19 @@ namespace BLL
|
||||
/// <param name="months">月</param>
|
||||
public static Model.WBS_CostControlDetail GetCostControlDetailByCostControlIdAndMonths(string costControlId, DateTime months)
|
||||
{
|
||||
return (from x in Funs.DB.WBS_CostControlDetail where x.CostControlId == costControlId && x.Months == months select x).FirstOrDefault();
|
||||
return (from x in Funs.DB.WBS_CostControlDetail where x.CostControlId == costControlId && x.Months == months && x.StartDate == null select x).FirstOrDefault();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据costControlId和年及月获取对应费控项明细信息
|
||||
/// </summary>
|
||||
/// <param name="costControlId">对应wbsId</param>
|
||||
/// <param name="toFlag">对应标志</param>
|
||||
/// <param name="years">年</param>
|
||||
/// <param name="months">月</param>
|
||||
public static Model.WBS_CostControlDetail GetCostControlDetailByCostControlIdAndMonthsWeek(string costControlId, DateTime months,DateTime startDate)
|
||||
{
|
||||
return (from x in Funs.DB.WBS_CostControlDetail where x.CostControlId == costControlId && x.Months == months && x.StartDate == startDate select x).FirstOrDefault();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -57,9 +70,21 @@ namespace BLL
|
||||
/// <param name="toFlag">对应标志</param>
|
||||
/// <param name="years">年</param>
|
||||
/// <param name="months">月</param>
|
||||
public static Model.View_WBS_CostControlDetail GetViewCostControlDetailByCostControlIdYearMonth(string costControlId, DateTime months)
|
||||
public static Model.View_WBS_CostControlDetail GetViewCostControlDetailByCostControlIdAndMonth(string costControlId, DateTime months)
|
||||
{
|
||||
return (from x in Funs.DB.View_WBS_CostControlDetail where x.CostControlId == costControlId && x.Months == months select x).FirstOrDefault();
|
||||
return (from x in Funs.DB.View_WBS_CostControlDetail where x.CostControlId == costControlId && x.Months == months && x.StartDate == null select x).FirstOrDefault();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据costControlId和年及月获取对应费控项明细信息
|
||||
/// </summary>
|
||||
/// <param name="costControlId">对应wbsId</param>
|
||||
/// <param name="toFlag">对应标志</param>
|
||||
/// <param name="years">年</param>
|
||||
/// <param name="months">月</param>
|
||||
public static Model.View_WBS_CostControlDetail GetViewCostControlDetailByCostControlIdAndMonthWeek(string costControlId, DateTime months, DateTime startDate)
|
||||
{
|
||||
return (from x in Funs.DB.View_WBS_CostControlDetail where x.CostControlId == costControlId && x.Months == months && x.StartDate == startDate select x).FirstOrDefault();
|
||||
}
|
||||
|
||||
public static Model.WBS_CostControlDetail GetWBS_CostControlDetailByCostControlId(string costControlId)
|
||||
@@ -74,7 +99,7 @@ namespace BLL
|
||||
/// <param name="toFlag"></param>
|
||||
/// <param name="months"></param>
|
||||
/// <returns></returns>
|
||||
public static bool IsExitWBS_CostControlDetailByCostControlIdOrMonth(string costControlId, DateTime months)
|
||||
public static bool IsExitWeekCostControlDetailByCostControlIdAndMonth(string costControlId, DateTime months)
|
||||
{
|
||||
bool result = false;
|
||||
var q = Funs.DB.WBS_CostControlDetail.FirstOrDefault(e => e.CostControlId == costControlId && e.Months == months);
|
||||
@@ -99,9 +124,18 @@ namespace BLL
|
||||
/// 根据CostControlId月获取所有月份的对应费控项明细信息集合
|
||||
/// </summary>
|
||||
/// <param name="costControlId">costControlId</param>
|
||||
public static List<Model.WBS_CostControlDetail> GetCostControlDetailsByCostControlId(string costControlId)
|
||||
public static List<Model.WBS_CostControlDetail> GetMonthCostControlDetailsByCostControlId(string costControlId)
|
||||
{
|
||||
return (from x in Funs.DB.WBS_CostControlDetail where x.CostControlId == costControlId orderby x.Months select x).ToList();
|
||||
return (from x in Funs.DB.WBS_CostControlDetail where x.CostControlId == costControlId && x.StartDate == null orderby x.Months select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据CostControlId月获取对应月份的对应费控项周明细信息集合
|
||||
/// </summary>
|
||||
/// <param name="costControlId">costControlId</param>
|
||||
public static List<Model.WBS_CostControlDetail> GetWeekCostControlDetailsByCostControlId(string costControlId, DateTime months)
|
||||
{
|
||||
return (from x in Funs.DB.WBS_CostControlDetail where x.CostControlId == costControlId && x.Months == months && x.StartDate != null orderby x.StartDate select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -115,6 +149,8 @@ namespace BLL
|
||||
newWBS_CostControlDetail.CostControlDetailId = costControlDetail.CostControlDetailId;
|
||||
newWBS_CostControlDetail.CostControlId = costControlDetail.CostControlId;
|
||||
newWBS_CostControlDetail.Months = costControlDetail.Months;
|
||||
newWBS_CostControlDetail.StartDate = costControlDetail.StartDate;
|
||||
newWBS_CostControlDetail.EndDate = costControlDetail.EndDate;
|
||||
newWBS_CostControlDetail.PlanNum = costControlDetail.PlanNum;
|
||||
newWBS_CostControlDetail.ThisNum = costControlDetail.ThisNum;
|
||||
|
||||
@@ -130,6 +166,8 @@ namespace BLL
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.WBS_CostControlDetail newWBS_CostControlDetail = db.WBS_CostControlDetail.First(e => e.CostControlDetailId == costControlDetail.CostControlDetailId);
|
||||
newWBS_CostControlDetail.StartDate = costControlDetail.StartDate;
|
||||
newWBS_CostControlDetail.EndDate = costControlDetail.EndDate;
|
||||
newWBS_CostControlDetail.PlanNum = costControlDetail.PlanNum;
|
||||
newWBS_CostControlDetail.ThisNum = costControlDetail.ThisNum;
|
||||
|
||||
@@ -162,5 +200,54 @@ namespace BLL
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 周计划下拉框
|
||||
/// </summary>
|
||||
/// <param name="dropName">下拉框名字</param>
|
||||
/// <param name="isShowPlease">是否显示请选择</param>
|
||||
public static void InitWeekPlanList(FineUIPro.DropDownList dropName, string costControlId, DateTime months, bool isShowPlease)
|
||||
{
|
||||
dropName.DataValueField = "Value";
|
||||
dropName.DataTextField = "Text";
|
||||
dropName.DataSource = GetWeekPlanList(costControlId, months);
|
||||
dropName.DataBind();
|
||||
if (isShowPlease)
|
||||
{
|
||||
Funs.FineUIPleaseSelect(dropName);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据费控项Id和月份获取对应月份的周计划记录
|
||||
/// </summary>
|
||||
/// <param name="projectId">项目Id</param>
|
||||
/// <returns></returns>
|
||||
public static ListItem[] GetWeekPlanList(string costControlId, DateTime months)
|
||||
{
|
||||
var q = (from x in Funs.DB.WBS_CostControlDetail
|
||||
where x.CostControlId == costControlId && x.Months == months && x.StartDate != null
|
||||
orderby x.StartDate
|
||||
select x).ToList();
|
||||
ListItem[] list = new ListItem[q.Count()];
|
||||
string dateStr = string.Empty, date = string.Empty;
|
||||
for (int i = 0; i < list.Count(); i++)
|
||||
{
|
||||
date = string.Empty;
|
||||
dateStr = string.Empty;
|
||||
if (q[i].StartDate != null)
|
||||
{
|
||||
dateStr = string.Format("{0:yyyy-MM-dd}", q[i].StartDate);
|
||||
date = string.Format("{0:yyyy-MM-dd}", q[i].StartDate);
|
||||
}
|
||||
if (q[i].EndDate != null)
|
||||
{
|
||||
dateStr += "至" + string.Format("{0:yyyy-MM-dd}", q[i].EndDate);
|
||||
date += "," + string.Format("{0:yyyy-MM-dd}", q[i].EndDate);
|
||||
}
|
||||
list[i] = new ListItem(dateStr, date);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace BLL
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据costControlParentId和年及月获取对应费控项父级明细信息
|
||||
/// 根据costControlParentId和年及月获取对应月费控项父级明细信息
|
||||
/// </summary>
|
||||
/// <param name="costControlParentId">对应wbsId</param>
|
||||
/// <param name="toFlag">对应标志</param>
|
||||
@@ -35,7 +35,19 @@ namespace BLL
|
||||
/// <param name="months">月</param>
|
||||
public static Model.WBS_CostControlParentDetail GetCostControlParentDetailByParentIdAndMonths(string parentId, DateTime months)
|
||||
{
|
||||
return (from x in Funs.DB.WBS_CostControlParentDetail where x.ParentId == parentId && x.Months == months select x).FirstOrDefault();
|
||||
return (from x in Funs.DB.WBS_CostControlParentDetail where x.ParentId == parentId && x.Months == months && x.StartDate == null select x).FirstOrDefault();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据costControlParentId和年及月获取对应周费控项父级明细信息
|
||||
/// </summary>
|
||||
/// <param name="costControlParentId">对应wbsId</param>
|
||||
/// <param name="toFlag">对应标志</param>
|
||||
/// <param name="years">年</param>
|
||||
/// <param name="months">月</param>
|
||||
public static Model.WBS_CostControlParentDetail GetCostControlParentDetailByParentIdAndMonthsWeek(string parentId, DateTime months, DateTime startDate)
|
||||
{
|
||||
return (from x in Funs.DB.WBS_CostControlParentDetail where x.ParentId == parentId && x.Months == months && x.StartDate == startDate select x).FirstOrDefault();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -93,6 +105,8 @@ namespace BLL
|
||||
newWBS_CostControlParentDetail.CostControlParentDetailId = costControlParentDetail.CostControlParentDetailId;
|
||||
newWBS_CostControlParentDetail.ParentId = costControlParentDetail.ParentId;
|
||||
newWBS_CostControlParentDetail.Months = costControlParentDetail.Months;
|
||||
newWBS_CostControlParentDetail.StartDate = costControlParentDetail.StartDate;
|
||||
newWBS_CostControlParentDetail.EndDate = costControlParentDetail.EndDate;
|
||||
newWBS_CostControlParentDetail.ThisPlanValue = costControlParentDetail.ThisPlanValue;
|
||||
newWBS_CostControlParentDetail.ThisRealCost = costControlParentDetail.ThisRealCost;
|
||||
newWBS_CostControlParentDetail.ThisPlanCost = costControlParentDetail.ThisPlanCost;
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 里程碑
|
||||
/// </summary>
|
||||
public static class MilePostService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据主键获取里程碑
|
||||
/// </summary>
|
||||
/// <param name="milePostId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.WBS_MilePost GetMilePostById(string milePostId)
|
||||
{
|
||||
return Funs.DB.WBS_MilePost.FirstOrDefault(e => e.MilePostId == milePostId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加里程碑
|
||||
/// </summary>
|
||||
/// <param name="milePost"></param>
|
||||
public static void AddMilePost(Model.WBS_MilePost milePost)
|
||||
{
|
||||
Model.WBS_MilePost newMilePost = new Model.WBS_MilePost
|
||||
{
|
||||
MilePostId = milePost.MilePostId,
|
||||
ProjectId = milePost.ProjectId,
|
||||
CnProfessionId = milePost.CnProfessionId,
|
||||
MilePostName = milePost.MilePostName,
|
||||
PlanDate = milePost.PlanDate,
|
||||
RealDate = milePost.RealDate,
|
||||
CompileMan = milePost.CompileMan,
|
||||
CompileDate = milePost.CompileDate,
|
||||
Remark = milePost.Remark
|
||||
};
|
||||
Funs.DB.WBS_MilePost.InsertOnSubmit(newMilePost);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改里程碑
|
||||
/// </summary>
|
||||
/// <param name="milePost"></param>
|
||||
public static void UpdateMilePost(Model.WBS_MilePost milePost)
|
||||
{
|
||||
Model.WBS_MilePost newMilePost = Funs.DB.WBS_MilePost.FirstOrDefault(e => e.MilePostId == milePost.MilePostId);
|
||||
if (newMilePost != null)
|
||||
{
|
||||
newMilePost.CnProfessionId = milePost.CnProfessionId;
|
||||
newMilePost.MilePostName = milePost.MilePostName;
|
||||
newMilePost.PlanDate = milePost.PlanDate;
|
||||
newMilePost.RealDate = milePost.RealDate;
|
||||
newMilePost.Remark = milePost.Remark;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除里程碑
|
||||
/// </summary>
|
||||
/// <param name="milePostId"></param>
|
||||
public static void DeleteMilePostById(string milePostId)
|
||||
{
|
||||
Model.WBS_MilePost milePost = Funs.DB.WBS_MilePost.FirstOrDefault(e => e.MilePostId == milePostId);
|
||||
if (milePost != null)
|
||||
{
|
||||
CommonService.DeleteAttachFileById(milePostId);
|
||||
Funs.DB.WBS_MilePost.DeleteOnSubmit(milePost);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -46,6 +46,27 @@ namespace BLL
|
||||
return list;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据装置、专业Id和分部编号获取分部Id
|
||||
/// </summary>
|
||||
/// <param name="unitProjectId">专业Id</param>
|
||||
/// <returns></returns>
|
||||
public static Model.Wbs_UnitProject GetUnitProjectIdByInstallationId(string installationId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
string inId = string.Empty;
|
||||
Model.Project_Installation ins = db.Project_Installation.FirstOrDefault(x => x.InstallationId == installationId);
|
||||
if (ins.IsEnd == true)
|
||||
{
|
||||
inId = installationId;
|
||||
}
|
||||
else
|
||||
{
|
||||
inId = Project_InstallationService.GetEndInstallationId(installationId);
|
||||
}
|
||||
return (from x in db.Wbs_UnitProject where x.InstallationId==inId select x).FirstOrDefault();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据装置、专业Id和分部编号获取分部Id
|
||||
/// </summary>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user