20261103 HSE月报

This commit is contained in:
2026-11-03 15:09:22 +08:00
parent 96763bdb39
commit 5763ff9468
15 changed files with 2252 additions and 34 deletions
+1
View File
@@ -863,6 +863,7 @@
<Compile Include="PZHGL\ProjectData\ProjectPageDataService.cs" />
<Compile Include="ReportManage\HazardFactor\HazardFactorOccHealthService.cs" />
<Compile Include="ReportManage\HazardFactor\HazardFactorSafetyService.cs" />
<Compile Include="ReportManage\SafeEnvBudget\HSEMonthReportService.cs" />
<Compile Include="ReportManage\SafeEnvBudget\SafetyManagementDataService.cs" />
<Compile Include="Score\ScoreService.cs" />
<Compile Include="Score\ScoreUserService.cs" />
+5
View File
@@ -3543,6 +3543,11 @@ namespace BLL
/// </summary>
public const string SafetyManagementDataTotalMenuId = "B2E6FF41-8379-4603-9560-E2DD84080058";
/// <summary>
/// HSE月报
/// </summary>
public const string HSEMonthReportMenuId = "2CACC0DE-5EA9-48B2-ADB2-03E79D8D1C13";
/// <summary>
/// 安全危害因素清单
/// </summary>
@@ -0,0 +1,114 @@
using FastReport;
using Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
/// <summary>
/// HSE月报
/// </summary>
public class HSEMonthReportService
{
/// <summary>
/// 根据主键获取HSE月报
/// </summary>
/// <param name="reportId"></param>
/// <returns></returns>
public static Model.Report_HSEMonthReport GetHSEMonthReportById(string reportId)
{
return Funs.DB.Report_HSEMonthReport.FirstOrDefault(e => e.ReportId == reportId);
}
/// <summary>
/// 添加HSE月报
/// </summary>
/// <param name="report"></param>
public static void AddHSEMonthReport(Model.Report_HSEMonthReport report)
{
CNPCDB db = Funs.DB;
Model.Report_HSEMonthReport newReport = new Report_HSEMonthReport();
newReport.ReportId = report.ReportId;
newReport.UnitId = report.UnitId;
newReport.ReportDate = report.ReportDate;
newReport.TotalEmployees = report.TotalEmployees;
newReport.TotalHours = report.TotalHours;
newReport.ContractorEmployees = report.ContractorEmployees;
newReport.ContractorHours = report.ContractorHours;
newReport.MonthHours = report.MonthHours;
newReport.MonthHoursAvg = report.MonthHoursAvg;
newReport.YearHours = report.YearHours;
newReport.Remark = report.Remark;
newReport.BranchTraining = report.BranchTraining;
newReport.ProjectTraining = report.ProjectTraining;
newReport.TeamGroupTraining = report.TeamGroupTraining;
newReport.SelfTraining = report.SelfTraining;
newReport.ContractorOrganizeTraining = report.ContractorOrganizeTraining;
newReport.ContractorTraining = report.ContractorTraining;
newReport.CompileMan = report.CompileMan;
newReport.CompileDate = report.CompileDate;
db.Report_HSEMonthReport.InsertOnSubmit(newReport);
db.SubmitChanges();
}
/// <summary>
/// 修改HSE月报
/// </summary>
/// <param name="report"></param>
public static void UpdateHSEMonthReport(Model.Report_HSEMonthReport report)
{
CNPCDB db = Funs.DB;
Model.Report_HSEMonthReport newReport = db.Report_HSEMonthReport.FirstOrDefault(e => e.ReportId == report.ReportId);
if (newReport != null)
{
newReport.UnitId = report.UnitId;
newReport.ReportDate = report.ReportDate;
newReport.TotalEmployees = report.TotalEmployees;
newReport.TotalHours = report.TotalHours;
newReport.ContractorEmployees = report.ContractorEmployees;
newReport.ContractorHours = report.ContractorHours;
newReport.MonthHours = report.MonthHours;
newReport.MonthHoursAvg = report.MonthHoursAvg;
newReport.YearHours = report.YearHours;
newReport.Remark = report.Remark;
newReport.BranchTraining = report.BranchTraining;
newReport.ProjectTraining = report.ProjectTraining;
newReport.TeamGroupTraining = report.TeamGroupTraining;
newReport.SelfTraining = report.SelfTraining;
newReport.ContractorOrganizeTraining = report.ContractorOrganizeTraining;
newReport.ContractorTraining = report.ContractorTraining;
db.SubmitChanges();
}
}
/// <summary>
/// 根据主键删除HSE月报
/// </summary>
/// <param name="reportId"></param>
public static void DeleteHSEMonthReportByReportId(string reportId)
{
CNPCDB db = Funs.DB;
Model.Report_HSEMonthReport report = db.Report_HSEMonthReport.FirstOrDefault(e => e.ReportId == reportId);
if (report != null)
{
db.Report_HSEMonthReport.DeleteOnSubmit(report);
db.SubmitChanges();
}
}
/// <summary>
/// 根据月报日期获取HSE月报信息
/// </summary>
/// <param name="unitId"></param>
/// <param name="reportDate"></param>
/// <returns></returns>
public static Model.Report_HSEMonthReport GetHSEMonthReportByReportDate(string unitId, DateTime? reportDate)
{
return Funs.DB.Report_HSEMonthReport.FirstOrDefault(e => e.UnitId == unitId && e.ReportDate == reportDate);
}
}
}