20230920 HSE管理月报

This commit is contained in:
2023-09-20 13:55:00 +08:00
parent 47f9a0e959
commit 374cad03f1
48 changed files with 6674 additions and 8104 deletions
+5
View File
@@ -467,6 +467,7 @@
<Compile Include="HSSE\Manager\ManagerMonthC\CheckCService.cs" />
<Compile Include="HSSE\Manager\ManagerMonthC\CheckDetailSortCService.cs" />
<Compile Include="HSSE\Manager\ManagerMonthC\CheckSortCService.cs" />
<Compile Include="HSSE\Manager\ManagerMonthC\ComplianceObligationsCService.cs" />
<Compile Include="HSSE\Manager\ManagerMonthC\CostInvestmentPlanCService.cs" />
<Compile Include="HSSE\Manager\ManagerMonthC\DrillSortCService.cs" />
<Compile Include="HSSE\Manager\ManagerMonthC\EmergencyExercisesCService.cs" />
@@ -478,18 +479,22 @@
<Compile Include="HSSE\Manager\ManagerMonthC\HazardSortCService.cs" />
<Compile Include="HSSE\Manager\ManagerMonthC\HseCostCService.cs" />
<Compile Include="HSSE\Manager\ManagerMonthC\IncentiveSortCService.cs" />
<Compile Include="HSSE\Manager\ManagerMonthC\InjuryAccidentCService.cs" />
<Compile Include="HSSE\Manager\ManagerMonthC\ManageDocPlanCService.cs" />
<Compile Include="HSSE\Manager\ManagerMonthC\MeetingCService.cs" />
<Compile Include="HSSE\Manager\ManagerMonthC\MeetingSortCService.cs" />
<Compile Include="HSSE\Manager\ManagerMonthC\MonthReportCService.cs" />
<Compile Include="HSSE\Manager\ManagerMonthC\NoInjuryAccidentCService.cs" />
<Compile Include="HSSE\Manager\ManagerMonthC\OtherActiveSortCService.cs" />
<Compile Include="HSSE\Manager\ManagerMonthC\OtherManagementCService.cs" />
<Compile Include="HSSE\Manager\ManagerMonthC\OtherWorkCService.cs" />
<Compile Include="HSSE\Manager\ManagerMonthC\OtherWorkPlanCService.cs" />
<Compile Include="HSSE\Manager\ManagerMonthC\PerformanceIndicatorCService.cs" />
<Compile Include="HSSE\Manager\ManagerMonthC\PersonSortCService.cs" />
<Compile Include="HSSE\Manager\ManagerMonthC\PlanCService.cs" />
<Compile Include="HSSE\Manager\ManagerMonthC\PromotionalActiviteSortCService.cs" />
<Compile Include="HSSE\Manager\ManagerMonthC\ReviewRecordCService.cs" />
<Compile Include="HSSE\Manager\ManagerMonthC\RewardAndPunishSortCService.cs" />
<Compile Include="HSSE\Manager\ManagerMonthC\SubExpenseCService.cs" />
<Compile Include="HSSE\Manager\ManagerMonthC\TrainActivitySortCService.cs" />
<Compile Include="HSSE\Manager\ManagerMonthC\TrainCService.cs" />
+7 -2
View File
@@ -207,6 +207,11 @@ namespace BLL
/// </summary>
public const string AppSecret_CWCEC = "a08b6ad503f1ced05d27bc11dc9198c3";
/// <summary>
/// 施工单位ID
/// </summary>
public const string UnitId_Con = "fedf9907-54f8-481d-ae4c-8f3dfb7c8eda";
/// <summary>
///施工部门id
/// </summary>
@@ -281,7 +286,7 @@ namespace BLL
/// <summary>
/// HSE工程师岗位Id
/// </summary>
public static string WorkPost_HSSEEngineer = "9b15af2e-6131-462c-9f8a-71533957ca0e";
public static string WorkPost_HSSEEngineer = "D1115B78-C9E1-43A4-8AB1-FF099CAF7BA4";
/// <summary>
/// 项目安全总监岗位Id
/// </summary>
@@ -289,7 +294,7 @@ namespace BLL
/// <summary>
/// HSE经理岗位Id
/// </summary>
public static string WorkPost_SafetyManager = "e426e560-9906-4aba-843e-2daef9ebeb05";
public static string WorkPost_SafetyManager = "eac153fd-4cf3-4f5f-984d-022a636d47aa";
/// <summary>
/// 无损检测工岗位Id
+19 -3
View File
@@ -475,15 +475,31 @@ namespace BLL
}
/// <summary>
/// 根据时间、项目获取安全费用投入登记信息
/// 根据时间、项目获取五环安全费用投入登记信息
/// </summary>
/// <param name="startTime"></param>
/// <param name="endTime"></param>
/// <param name="projectId"></param>
/// <returns></returns>
public static List<Model.CostGoods_PayRegistration> GetPayRegistrationByPayDate(DateTime startTime, DateTime endTime, string projectId)
public static List<Model.CostGoods_PayRegistration> GetPayRegistrationByPayDate(DateTime startTime, DateTime endTime, string projectId,string unitId)
{
return (from x in Funs.DB.CostGoods_PayRegistration where x.PayDate >= startTime && x.PayDate <= endTime && x.ProjectId == projectId select x).ToList();
return (from x in Funs.DB.CostGoods_PayRegistration where x.PayDate >= startTime && x.PayDate <= endTime && x.ProjectId == projectId && x.UnitId == unitId select x).ToList();
}
/// <summary>
/// 根据时间、项目获取施工分包商安全费用投入登记信息
/// </summary>
/// <param name="startTime"></param>
/// <param name="endTime"></param>
/// <param name="projectId"></param>
/// <returns></returns>
public static List<Model.CostGoods_PayRegistration> GetConPayRegistrationByPayDate(DateTime startTime, DateTime endTime, string projectId)
{
return (from x in Funs.DB.CostGoods_PayRegistration
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
where x.PayDate >= startTime && x.PayDate <= endTime && x.ProjectId == projectId
&& y.UnitTypeId == BLL.Const.UnitId_Con
select x).ToList();
}
}
}
@@ -219,6 +219,32 @@ namespace BLL
return (from x in Funs.DB.CostGoods_SubPayRegistration where x.PayDate >= startTime && x.PayDate <= endTime && x.ProjectId == projectId select x).ToList();
}
/// <summary>
/// 根据单位获取HSE措施费合同额
/// </summary>
/// <param name="unitId"></param>
/// <param name="startTime"></param>
/// <param name="endTime"></param>
/// <returns></returns>
public static decimal? GetSubPaySMonthTypeByUnitId(string unitId, DateTime startTime, DateTime endTime)
{
var q = (from x in Funs.DB.CostGoods_SubPayRegistration
where x.UnitId == unitId && x.PayDate >= startTime && x.PayDate < endTime
select x).ToList();
if (q.Count > 0)
{
return q.Sum(e => (e.SMonthType1 + e.SMonthType2 + e.SMonthType3 + e.SMonthType4 + e.SMonthType5 + e.SMonthType6 + e.SMonthType7 + e.SMonthType8 + e.SMonthType9 + e.SMonthType10 + e.SMonthType11 + e.SMonthType12 + e.SMonthType13 + e.SMonthType14 + e.SMonthType15 + e.SMonthType16 + e.SMonthType17 + e.SMonthType18 + e.SMonthType19 + e.SMonthType20 + e.SMonthType21 + e.SMonthType22 + e.SMonthType23 + e.SMonthType24 + e.SMonthType25 + e.SMonthType26 + e.SMonthType27 + e.SMonthType28 + e.SMonthType29));
}
return null;
}
/// <summary>
/// 根据单位获取本月项目分包商HSE费用支付统计
/// </summary>
/// <param name="unitId"></param>
/// <param name="startTime"></param>
/// <param name="endTime"></param>
/// <returns></returns>
public static decimal? GetSubPayRegistrationByUnitId(string unitId, DateTime startTime, DateTime endTime)
{
var q = (from x in Funs.DB.CostGoods_SubPayRegistration
@@ -102,5 +102,10 @@ namespace BLL
db.SubmitChanges();
}
}
public static int GetAccidentHandleByAccidentDate(DateTime startTime, DateTime endTime, string projectId, string unitId)
{
return (from x in Funs.DB.Accident_AccidentHandle where x.AccidentDate >= startTime && x.AccidentDate < endTime && x.ProjectId == projectId && x.UnitId == unitId select x).Count();
}
}
}
@@ -453,5 +453,10 @@ namespace BLL
db.SubmitChanges();
}
}
public static List<Model.Accident_AccidentReport> GetAccidentReportsByAccidentType(string accidentType,DateTime startTime, DateTime endTime, string projectId)
{
return (from x in Funs.DB.Accident_AccidentReport where x.AccidentTypeId==accidentType && x.AccidentDate >= startTime && x.AccidentDate < endTime && x.ProjectId == projectId && x.States == BLL.Const.State_2 select x).ToList();
}
}
}
@@ -154,5 +154,10 @@ namespace BLL
{
return (from x in Funs.DB.EduTrain_TrainRecord where x.TrainStartDate < time && x.ProjectId == projectId select x).Count();
}
public static int? GetTrainPersonCount(DateTime startTime, DateTime endTime, string projectId)
{
return (from x in Funs.DB.EduTrain_TrainRecord where x.TrainStartDate >= startTime && x.TrainStartDate <= endTime && x.ProjectId == projectId select x.TrainPersonNum).Sum();
}
}
}
@@ -0,0 +1,57 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
/// <summary>
/// HSE合规义务识别与评价
/// </summary>
public class ComplianceObligationsCService
{
/// <summary>
/// 根据月报ID获取相关HSE合规义务识别与评价
/// </summary>
/// <param name="monthRepportId"></param>
/// <returns></returns>
public static List<Model.Manager_Month_ComplianceObligationsC> GetComplianceObligationsCByMonthReportId(string monthRepportId)
{
return (from x in Funs.DB.Manager_Month_ComplianceObligationsC where x.MonthReportId == monthRepportId select x).ToList();
}
/// <summary>
/// 增加
/// </summary>
/// <param name="data"></param>
public static void AddComplianceObligationsC(Model.Manager_Month_ComplianceObligationsC data)
{
Model.Manager_Month_ComplianceObligationsC newData = new Model.Manager_Month_ComplianceObligationsC
{
ComplianceObligationsId = data.ComplianceObligationsId,
MonthReportId = data.MonthReportId,
InformationContent = data.InformationContent,
ResponseMeasures = data.ResponseMeasures,
ImplementationStatus = data.ImplementationStatus,
EvaluationConclusion = data.EvaluationConclusion
};
Funs.DB.Manager_Month_ComplianceObligationsC.InsertOnSubmit(newData);
Funs.DB.SubmitChanges();
}
/// <summary>
/// 根据HSE月报ID删除相关HSE合规义务识别与评价
/// </summary>
/// <param name="monthReportId"></param>
public static void DeleteComplianceObligationsCByMonthReportId(string monthReportId)
{
var q = (from x in Funs.DB.Manager_Month_ComplianceObligationsC where x.MonthReportId == monthReportId select x).ToList();
if (q != null)
{
Funs.DB.Manager_Month_ComplianceObligationsC.DeleteAllOnSubmit(q);
Funs.DB.SubmitChanges();
}
}
}
}
@@ -16,7 +16,7 @@ namespace BLL
/// <returns></returns>
public static List<Model.Manager_Month_HazardC> GetHazardByMonthReportId(string monthReportId)
{
return (from x in Funs.DB.Manager_Month_HazardC where x.MonthReportId == monthReportId orderby x.SortIndex select x).ToList();
return (from x in Funs.DB.Manager_Month_HazardC where x.MonthReportId == monthReportId select x).ToList();
}
/// <summary>
@@ -31,10 +31,10 @@ namespace BLL
HazardId = SQLHelper.GetNewID(typeof(Model.Manager_Month_HazardC)),
MonthReportId = hazard.MonthReportId,
WorkArea = hazard.WorkArea,
Subcontractor = hazard.Subcontractor,
DangerousSource = hazard.DangerousSource,
EnvironmentalFactors = hazard.EnvironmentalFactors,
Consequence = hazard.Consequence,
ControlMeasures = hazard.ControlMeasures,
SortIndex = hazard.SortIndex
IsMajor = hazard.IsMajor
};
db.Manager_Month_HazardC.InsertOnSubmit(newHazard);
db.SubmitChanges();
@@ -0,0 +1,64 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
/// <summary>
/// 伤害事故统计
/// </summary>
public class InjuryAccidentCService
{
/// <summary>
/// 根据月报ID获取伤害事故统计
/// </summary>
/// <param name="monthReportId"></param>
/// <returns></returns>
public static List<Model.Manager_Month_InjuryAccidentC> GetInjuryAccidentCByMonthReportId(string monthReportId)
{
return (from x in Funs.DB.Manager_Month_InjuryAccidentC where x.MonthReportId == monthReportId select x).ToList();
}
/// <summary>
/// 添加伤害事故统计
/// </summary>
/// <param name="injuryAccount"></param>
public static void AddInjuryAccidentC(Model.Manager_Month_InjuryAccidentC injuryAccident)
{
Model.Manager_Month_InjuryAccidentC newInjuryAccident = new Model.Manager_Month_InjuryAccidentC
{
InjuryAccidentId = injuryAccident.InjuryAccidentId,
MonthReportId = injuryAccident.MonthReportId,
UnitName = injuryAccident.UnitName,
AttemptedIncidents = injuryAccident.AttemptedIncidents,
FirstAidDressing = injuryAccident.FirstAidDressing,
MedicalTreatment = injuryAccident.MedicalTreatment,
WorkLimitation = injuryAccident.WorkLimitation,
LossPerson = injuryAccident.LossPerson,
LossWorkTime = injuryAccident.LossWorkTime,
LossEconomy = injuryAccident.LossEconomy,
DeathPerson = injuryAccident.DeathPerson,
DeathWorkTime = injuryAccident.DeathWorkTime,
DeathEconomy = injuryAccident.DeathEconomy
};
Funs.DB.Manager_Month_InjuryAccidentC.InsertOnSubmit(newInjuryAccident);
Funs.DB.SubmitChanges();
}
/// <summary>
/// 根据月报ID删除伤害事故
/// </summary>
/// <param name="montReportId"></param>
public static void DeleteInjuryAccidengtByMonthReportId(string montReportId)
{
var q = (from x in Funs.DB.Manager_Month_InjuryAccidentC where x.MonthReportId == montReportId select x).ToList();
if (q != null)
{
Funs.DB.Manager_Month_InjuryAccidentC.DeleteAllOnSubmit(q);
Funs.DB.SubmitChanges();
}
}
}
}
@@ -225,7 +225,8 @@ namespace BLL
YearSolutionNum = monthReport.YearSolutionNum,
AccidentDes = monthReport.AccidentDes,
Question = monthReport.Question,
SubcontractManHours = monthReport.SubcontractManHours
SubcontractManHours = monthReport.SubcontractManHours,
AccidentDef = monthReport.AccidentDef,
};
db.Manager_MonthReportC.InsertOnSubmit(newMonthReport);
@@ -295,6 +296,7 @@ namespace BLL
newMonthReport.AccidentDes = monthReport.AccidentDes;
newMonthReport.Question = monthReport.Question;
newMonthReport.SubcontractManHours = monthReport.SubcontractManHours;
newMonthReport.AccidentDef = monthReport.AccidentDef;
db.SubmitChanges();
}
@@ -0,0 +1,54 @@
using System.Collections.Generic;
using System.Linq;
namespace BLL
{
/// <summary>
/// 本月无伤害事故统计
/// </summary>
public class NoInjuryAccidentCService
{
/// <summary>
/// 根据月报ID获取本月无伤害事故统计
/// </summary>
/// <param name="monthReportId"></param>
/// <returns></returns>
public static List<Model.Manager_Month_NoInjuryAccidentC> GetNoInjuryAccidentByMonthReportId(string monthReportId)
{
return (from x in Funs.DB.Manager_Month_NoInjuryAccidentC where x.MonthReportId == monthReportId select x).ToList();
}
/// <summary>
/// 添加无伤害事故统计
/// </summary>
/// <param name="noInjury"></param>
public static void AddNoInjuryAccident(Model.Manager_Month_NoInjuryAccidentC noInjury)
{
Model.Manager_Month_NoInjuryAccidentC newNoInjury = new Model.Manager_Month_NoInjuryAccidentC
{
NoInjuryAccidentId = noInjury.NoInjuryAccidentId,
MonthReportId = noInjury.MonthReportId,
AccidentType = noInjury.AccidentType,
EconomicLosses = noInjury.EconomicLosses,
WHAccidentCount = noInjury.WHAccidentCount,
SubAccidentCount = noInjury.SubAccidentCount,
};
Funs.DB.Manager_Month_NoInjuryAccidentC.InsertOnSubmit(newNoInjury);
Funs.DB.SubmitChanges();
}
/// <summary>
/// 根据月报ID删除无伤害事故统计
/// </summary>
/// <param name="monthReportId"></param>
public static void DeleteNoInjuryAccidentByMonthReportId(string monthReportId)
{
var q = (from x in Funs.DB.Manager_Month_NoInjuryAccidentC where x.MonthReportId == monthReportId select x).ToList();
if (q!=null)
{
Funs.DB.Manager_Month_NoInjuryAccidentC.DeleteAllOnSubmit(q);
Funs.DB.SubmitChanges();
}
}
}
}
@@ -0,0 +1,57 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
/// <summary>
/// 项目HSE绩效指标
/// </summary>
public class PerformanceIndicatorCService
{
/// <summary>
/// 根据月报ID获取HSE绩效指标
/// </summary>
/// <param name="monthReportId"></param>
/// <returns></returns>
public static List<Model.Manager_Month_PerformanceIndicatorC> GetPerformanceIndicatorByMonthReportId(string monthReportId)
{
return (from x in Funs.DB.Manager_Month_PerformanceIndicatorC where x.MonthReportId == monthReportId orderby x.SortIndex select x).ToList();
}
/// <summary>
/// 添加HSE绩效指标
/// </summary>
/// <param name="indicator"></param>
public static void AddPerformanceIndicator(Model.Manager_Month_PerformanceIndicatorC indicator)
{
Model.Manager_Month_PerformanceIndicatorC newIndicator = new Model.Manager_Month_PerformanceIndicatorC
{
PerformanceIndicatorId = indicator.PerformanceIndicatorId,
MonthReportId = indicator.MonthReportId,
IndicatorType = indicator.IndicatorType,
IndicatorName = indicator.IndicatorName,
IndicatorValue = indicator.IndicatorValue,
SortIndex = indicator.SortIndex,
};
Funs.DB.Manager_Month_PerformanceIndicatorC.InsertOnSubmit(newIndicator);
Funs.DB.SubmitChanges();
}
/// <summary>
/// 根据主键删除HSE绩效指标
/// </summary>
/// <param name="monthReportId"></param>
public static void DeletePerformanceIndicatorByMonthReportId(string monthReportId)
{
var q = (from x in Funs.DB.Manager_Month_PerformanceIndicatorC where x.MonthReportId == monthReportId select x).ToList();
if (q != null)
{
Funs.DB.Manager_Month_PerformanceIndicatorC.DeleteAllOnSubmit(q);
Funs.DB.SubmitChanges();
}
}
}
}
@@ -39,11 +39,11 @@ namespace BLL
MonthReportId = checkSort.MonthReportId,
UnitId = checkSort.UnitId,
SumPersonNum = checkSort.SumPersonNum,
SumOutPersonNum = checkSort.SumOutPersonNum,
HSEPersonNum = checkSort.HSEPersonNum,
ContractRange = checkSort.ContractRange,
Remark = checkSort.Remark
};
db.Manager_PersonSortC.InsertOnSubmit(newPersonSort);
db.SubmitChanges();
}
@@ -0,0 +1,59 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
/// <summary>
/// HSE奖励与处罚
/// </summary>
public class RewardAndPunishSortCService
{
/// <summary>
/// 根据月报ID获取HSE奖励与处罚列表
/// </summary>
/// <param name="monthReportId"></param>
/// <returns></returns>
public static List<Model.Manager_RewardAndPunishSortC> GetRewardAndPunishSortCByMontReportId(string monthReportId)
{
return (from x in Funs.DB.Manager_RewardAndPunishSortC where x.MonthReportId == monthReportId select x).ToList();
}
/// <summary>
/// 增加HSE奖励与处罚
/// </summary>
/// <param name="sortC"></param>
public static void AddRewardAndPunishSortC(Model.Manager_RewardAndPunishSortC sortC)
{
Model.Manager_RewardAndPunishSortC newSortC = new Model.Manager_RewardAndPunishSortC
{
RewardAndPunishId = sortC.RewardAndPunishId,
MonthReportId = sortC.MonthReportId,
RewardNum = sortC.RewardNum,
RewardMoney = sortC.RewardMoney,
ProjectRewardMoney = sortC.ProjectRewardMoney,
PunishNum = sortC.PunishNum,
PunishMoney = sortC.PunishMoney,
ProjectPunishMoney = sortC.ProjectPunishMoney
};
Funs.DB.Manager_RewardAndPunishSortC.InsertOnSubmit(newSortC);
Funs.DB.SubmitChanges();
}
/// <summary>
/// 根据月报id删除HSE奖励与处罚
/// </summary>
/// <param name="monthReportId"></param>
public static void DeleteRewardAndPunishSortCByMonthReportId(string monthReportId)
{
var q = (from x in Funs.DB.Manager_RewardAndPunishSortC where x.MonthReportId == monthReportId select x).ToList();
if (q != null)
{
Funs.DB.Manager_RewardAndPunishSortC.DeleteAllOnSubmit(q);
Funs.DB.SubmitChanges();
}
}
}
}
@@ -33,7 +33,10 @@ namespace BLL
SubUnit = subExpense.SubUnit,
CostMonth = subExpense.CostMonth,
CostYear = subExpense.CostYear,
SortIndex = subExpense.SortIndex
SortIndex = subExpense.SortIndex,
ContractAmount=subExpense.ContractAmount,
MonthApprovalAmount = subExpense.MonthApprovalAmount,
ProjectApprovalAmount=subExpense.ProjectApprovalAmount
};
db.Manager_Month_SubExpenseC.InsertOnSubmit(newSubExpense);
db.SubmitChanges();
@@ -36,7 +36,9 @@ namespace BLL
TeachHour = trainSort.TeachHour,
TeachMan = trainSort.TeachMan,
UnitName = trainSort.UnitName,
PersonNum = trainSort.PersonNum
PersonNum = trainSort.PersonNum,
TrainType = trainSort.TrainType,
TotalPersonNum = trainSort.TotalPersonNum
};
db.Manager_TrainSortC.InsertOnSubmit(newTrainSort);
+14 -1
View File
@@ -1,4 +1,5 @@
using System.Linq;
using System;
using System.Linq;
namespace BLL
{
@@ -100,5 +101,17 @@ namespace BLL
db.SubmitChanges();
}
}
/// <summary>
/// 根据时间段获取班前会议集合
/// </summary>
/// <param name="startTime"></param>
/// <param name="endTime"></param>
/// <param name="projectId"></param>
/// <returns></returns>
public static int GetCountByTime(DateTime startTime, DateTime endTime, string projectId)
{
return (from x in Funs.DB.Meeting_ClassMeeting where x.ClassMeetingDate >= startTime && x.ClassMeetingDate < endTime && x.ProjectId == projectId select x).Count();
}
}
}
+2 -2
View File
@@ -384,9 +384,9 @@ namespace BLL
/// </summary>
/// <param name="unitId">单位Id</param>
/// <returns>人员的数量</returns>
public static int GetPersonCountByUnitId(string unitId, string projectId)
public static int GetPersonCountByUnitId(string unitId, string projectId, bool isOutside)
{
var q = (from x in Funs.DB.SitePerson_Person where x.UnitId == unitId && x.ProjectId == projectId && x.IsUsed == true select x).ToList();
var q = (from x in Funs.DB.SitePerson_Person where x.UnitId == unitId && x.ProjectId == projectId && x.IsUsed == true && x.IsOutside == isOutside select x).ToList();
return q.Count();
}