20240318 开车报告 总结

This commit is contained in:
2024-03-18 15:59:06 +08:00
parent 4d8f810268
commit b625a475e2
57 changed files with 7034 additions and 3490 deletions
@@ -0,0 +1,63 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
/// <summary>
/// 开车绩效测量数据
/// </summary>
public class TestRun_MonthReportItem2Service
{
/// <summary>
/// 根据月报告id获取开车绩效测量数据
/// </summary>
/// <param name="monthReportId"></param>
/// <returns></returns>
public static List<Model.TestRun_MonthReportItem2> GetMonthReportItem2ByReportId(string monthReportId, string reportType)
{
return (from x in Funs.DB.TestRun_MonthReportItem2 where x.MonthReportId == monthReportId && x.ReportType == reportType orderby x.SortIndex select x).ToList();
}
/// <summary>
/// 添加开车绩效测量数据
/// </summary>
/// <param name="item"></param>
public static void AddMonthReportItem2(Model.TestRun_MonthReportItem2 item)
{
Model.TestRun_MonthReportItem2 newItem = new Model.TestRun_MonthReportItem2
{
MonthReportItem2Id = item.MonthReportItem2Id,
MonthReportId = item.MonthReportId,
ReportType = item.ReportType,
TypeName = item.TypeName,
PV = item.PV,
EV = item.EV,
AC = item.AC,
CV = item.CV,
SV = item.SV,
CPI = item.CPI,
SPI = item.SPI,
SortIndex=item.SortIndex,
};
Funs.DB.TestRun_MonthReportItem2.InsertOnSubmit(newItem);
Funs.DB.SubmitChanges();
}
/// <summary>
/// 根据月报告id删除开车绩效测量数据
/// </summary>
/// <param name="reportId"></param>
public static void DeleteMonthReportItem2ByReportId(string reportId)
{
var q = (from x in Funs.DB.TestRun_MonthReportItem2 where x.MonthReportId == reportId select x).ToList();
if (q.Count > 0)
{
Funs.DB.TestRun_MonthReportItem2.DeleteAllOnSubmit(q);
Funs.DB.SubmitChanges();
}
}
}
}
@@ -0,0 +1,59 @@
using System.Collections.Generic;
using System.Linq;
namespace BLL
{
/// <summary>
/// 工作包完成情况统计
/// </summary>
public class TestRun_MonthReportItemService
{
/// <summary>
/// 根据月报id获取工作包完成情况
/// </summary>
/// <param name="monthReportId"></param>
/// <returns></returns>
public static List<Model.TestRun_MonthReportItem> GetMonthReportItemByReportId(string monthReportId)
{
return (from x in Funs.DB.TestRun_MonthReportItem where x.MonthReportId == monthReportId orderby x.SortIndex select x).ToList();
}
/// <summary>
/// 添加工作包完成情况
/// </summary>
/// <param name="item"></param>
public static void AddMonthReportItem(Model.TestRun_MonthReportItem item)
{
Model.TestRun_MonthReportItem newItem = new Model.TestRun_MonthReportItem
{
MonthReportItemId = item.MonthReportItemId,
MonthReportId = item.MonthReportId,
SortIndex = item.SortIndex,
WorkPackageType = item.WorkPackageType,
Unit = item.Unit,
DesignCount = item.DesignCount,
MonthPlan = item.MonthPlan,
MonthActual = item.MonthActual,
TotalPlan = item.TotalPlan,
TatalActual = item.TatalActual,
CompletionRate = item.CompletionRate
};
Funs.DB.TestRun_MonthReportItem.InsertOnSubmit(newItem);
Funs.DB.SubmitChanges();
}
/// <summary>
/// 根据月报告id删除工作包完成情况
/// </summary>
/// <param name="reportItemId"></param>
public static void DeleteMonthReportItemByMonthReportId(string monthReportId)
{
var q = (from x in Funs.DB.TestRun_MonthReportItem where x.MonthReportId == monthReportId select x).ToList();
if (q.Count > 0)
{
Funs.DB.TestRun_MonthReportItem.DeleteAllOnSubmit(q);
Funs.DB.SubmitChanges();
}
}
}
}
@@ -0,0 +1,117 @@
using System;
using System.Linq;
namespace BLL
{
/// <summary>
/// 开车月报告
/// </summary>
public class TestRun_MonthReportService
{
/// <summary>
/// 根据主键获取开车月报告
/// </summary>
/// <param name="monthReportId"></param>
/// <returns></returns>
public static Model.TestRun_MonthReport GetMonthReportById(string monthReportId)
{
return Funs.DB.TestRun_MonthReport.FirstOrDefault(e => e.MonthReportId == monthReportId);
}
/// <summary>
/// 根据月份获取开车月报告
/// </summary>
/// <param name="month"></param>
/// <returns></returns>
public static Model.TestRun_MonthReport GetMonthReportByMonth(string month)
{
return Funs.DB.TestRun_MonthReport.FirstOrDefault(e => e.MonthReportDate == Convert.ToDateTime(month));
}
/// <summary>
/// 添加开车月报告
/// </summary>
/// <param name="monthReport"></param>
public static void AddMonthReport(Model.TestRun_MonthReport monthReport)
{
Model.TestRun_MonthReport newMonthReport = new Model.TestRun_MonthReport
{
MonthReportId = monthReport.MonthReportId,
ProjectId = monthReport.ProjectId,
MonthReportCode = monthReport.MonthReportCode,
MonthReportDate = monthReport.MonthReportDate,
ProjectOverview = monthReport.ProjectOverview,
ProjectBaseInfo = monthReport.ProjectBaseInfo,
EngineeringPlant = monthReport.EngineeringPlant,
ProjectContract = monthReport.ProjectContract,
Milestone = monthReport.Milestone,
CompleteWork = monthReport.CompleteWork,
ProblemSituation = monthReport.ProblemSituation,
Budget = monthReport.Budget,
BudgetTotal = monthReport.BudgetTotal,
ActualCost = monthReport.ActualCost,
ActualCostTotal = monthReport.ActualCostTotal,
PublicationStatus = monthReport.PublicationStatus,
ImplementationStatus = monthReport.ImplementationStatus,
HSEManageSituation = monthReport.HSEManageSituation,
NextMonthMilestone = monthReport.NextMonthMilestone,
NextMonthCompleteWork = monthReport.NextMonthCompleteWork,
NextMonthSchedule = monthReport.NextMonthSchedule,
NextMonthDrivingCost = monthReport.NextMonthDrivingCost,
ProblemsMeasures = monthReport.ProblemsMeasures,
SolvedProblems = monthReport.SolvedProblems,
};
Funs.DB.TestRun_MonthReport.InsertOnSubmit(newMonthReport);
Funs.DB.SubmitChanges();
}
/// <summary>
/// 修改开车月报告
/// </summary>
/// <param name="monthReport"></param>
public static void UpdateMonthReport(Model.TestRun_MonthReport monthReport)
{
Model.TestRun_MonthReport newMonthReport = Funs.DB.TestRun_MonthReport.FirstOrDefault(e => e.MonthReportId == monthReport.MonthReportId);
if (newMonthReport != null)
{
newMonthReport.MonthReportCode = monthReport.MonthReportCode;
newMonthReport.MonthReportDate = monthReport.MonthReportDate;
newMonthReport.ProjectOverview = monthReport.ProjectOverview;
newMonthReport.ProjectBaseInfo = monthReport.ProjectBaseInfo;
newMonthReport.EngineeringPlant = monthReport.EngineeringPlant;
newMonthReport.ProjectContract = monthReport.ProjectContract;
newMonthReport.Milestone = monthReport.Milestone;
newMonthReport.CompleteWork = monthReport.CompleteWork;
newMonthReport.ProblemSituation = monthReport.ProblemSituation;
newMonthReport.Budget = monthReport.Budget;
newMonthReport.BudgetTotal = monthReport.BudgetTotal;
newMonthReport.ActualCost = monthReport.ActualCost;
newMonthReport.ActualCostTotal = monthReport.ActualCostTotal;
newMonthReport.PublicationStatus = monthReport.PublicationStatus;
newMonthReport.ImplementationStatus = monthReport.ImplementationStatus;
newMonthReport.HSEManageSituation = monthReport.HSEManageSituation;
newMonthReport.NextMonthMilestone = monthReport.NextMonthMilestone;
newMonthReport.NextMonthCompleteWork = monthReport.NextMonthCompleteWork;
newMonthReport.NextMonthSchedule = monthReport.NextMonthSchedule;
newMonthReport.NextMonthDrivingCost = monthReport.NextMonthDrivingCost;
newMonthReport.ProblemsMeasures = monthReport.ProblemsMeasures;
newMonthReport.SolvedProblems = monthReport.SolvedProblems;
Funs.DB.SubmitChanges();
}
}
/// <summary>
/// 根据主键删除开车月报告
/// </summary>
/// <param name="monthReportId"></param>
public static void DeleteMonthReportById(string monthReportId)
{
Model.TestRun_MonthReport newMonthReport = Funs.DB.TestRun_MonthReport.FirstOrDefault(e => e.MonthReportId == monthReportId);
if (newMonthReport != null)
{
Funs.DB.TestRun_MonthReport.DeleteOnSubmit(newMonthReport);
Funs.DB.SubmitChanges();
}
}
}
}