2023-11-11

This commit is contained in:
2023-11-11 16:02:42 +08:00
parent b2ffd4b8d0
commit 48dd589a7f
66 changed files with 2334 additions and 1232 deletions
@@ -57,7 +57,7 @@ namespace BLL
public static int count
{
get;
set;
set;
}
public static List<Model.Project_SYHSEData_SYHSE> GetProject_SYHSEData_SYHSEByModle(Model.Project_SYHSEData_SYHSE table)
{
@@ -67,7 +67,7 @@ namespace BLL
(string.IsNullOrEmpty(table.ProjectId) || x.Id.Contains(table.ProjectId)) &&
(string.IsNullOrEmpty(table.UnitId) || x.UnitId.Contains(table.UnitId)) &&
(string.IsNullOrEmpty(table.CollCropCode) || x.CollCropCode.Contains(table.CollCropCode)) &&
(string.IsNullOrEmpty(table.UnitName) || x.UnitName.Contains(table.UnitName))
(string.IsNullOrEmpty(table.UnitName) || x.UnitName.Contains(table.UnitName))
select x
;
@@ -81,13 +81,13 @@ namespace BLL
/// <returns></returns>
public static IEnumerable getListData(Model.Project_SYHSEData_SYHSE table, Grid Grid1)
{
var q = GetProject_SYHSEData_SYHSEByModle(table);
var q = GetProject_SYHSEData_SYHSEByModle(table);
count = q.Count();
if (count == 0)
{
return null;
}
//q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
//q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
return from x in q
select new
{
@@ -142,113 +142,118 @@ namespace BLL
}
public static void AddProject_SYHSEData_SYHSE(Model.Project_SYHSEData_SYHSE newtable)
{
Model.Project_SYHSEData_SYHSE table = new Model.Project_SYHSEData_SYHSE
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
Id = newtable.Id,
ProjectId = newtable.ProjectId,
UnitId = newtable.UnitId,
CollCropCode = newtable.CollCropCode,
UnitName = newtable.UnitName,
ReportDate = newtable.ReportDate,
GeneralRiskNum = newtable.GeneralRiskNum,
LowRiskNum = newtable.LowRiskNum,
MediumRiskNum = newtable.MediumRiskNum,
HighRiskNum = newtable.HighRiskNum,
GradedResponsiblePersonNum = newtable.GradedResponsiblePersonNum,
ChargeInsurancePersonNum = newtable.ChargeInsurancePersonNum,
DesignQuantity = newtable.DesignQuantity,
RunningCapacity = newtable.RunningCapacity,
InterlockSettingValue = newtable.InterlockSettingValue,
VideoSurveillanceNum = newtable.VideoSurveillanceNum,
TotalWorkinghours = newtable.TotalWorkinghours,
SafeWorkinghours = newtable.SafeWorkinghours,
LostWorkinghours = newtable.LostWorkinghours,
TotalEnergyConsumption = newtable.TotalEnergyConsumption,
IncomeComprehensiveEnergyConsumption = newtable.IncomeComprehensiveEnergyConsumption,
NewWaterConsumption = newtable.NewWaterConsumption,
GeneralClosedNum = newtable.GeneralClosedNum,
GeneralNotClosedNum = newtable.GeneralNotClosedNum,
MajorClosedNum = newtable.MajorClosedNum,
MajorNotClosedNum = newtable.MajorNotClosedNum,
HotWorkPermitNum = newtable.HotWorkPermitNum,
HotWorkClosedNum = newtable.HotWorkClosedNum,
HighPermitNum = newtable.HighPermitNum,
HighClosedNum = newtable.HighClosedNum,
TemporaryElectricityPermitNum = newtable.TemporaryElectricityPermitNum,
TemporaryElectricityClosedNum = newtable.TemporaryElectricityClosedNum,
BlindPlatePermitNum = newtable.BlindPlatePermitNum,
BlindPlateClosedNum = newtable.BlindPlateClosedNum,
GroundbreakingPermitNum = newtable.GroundbreakingPermitNum,
GroundbreakingClosedNum = newtable.GroundbreakingClosedNum,
OpenCircuitPermitNum = newtable.OpenCircuitPermitNum,
OpenCircuitClosedNum = newtable.OpenCircuitClosedNum,
HoistingPermitNum = newtable.HoistingPermitNum,
HoistingClosedNum = newtable.HoistingClosedNum,
};
db.Project_SYHSEData_SYHSE.InsertOnSubmit(table);
db.SubmitChanges();
Model.Project_SYHSEData_SYHSE table = new Model.Project_SYHSEData_SYHSE
{
Id = newtable.Id,
ProjectId = newtable.ProjectId,
UnitId = newtable.UnitId,
CollCropCode = newtable.CollCropCode,
UnitName = newtable.UnitName,
ReportDate = newtable.ReportDate,
GeneralRiskNum = newtable.GeneralRiskNum,
LowRiskNum = newtable.LowRiskNum,
MediumRiskNum = newtable.MediumRiskNum,
HighRiskNum = newtable.HighRiskNum,
GradedResponsiblePersonNum = newtable.GradedResponsiblePersonNum,
ChargeInsurancePersonNum = newtable.ChargeInsurancePersonNum,
DesignQuantity = newtable.DesignQuantity,
RunningCapacity = newtable.RunningCapacity,
InterlockSettingValue = newtable.InterlockSettingValue,
VideoSurveillanceNum = newtable.VideoSurveillanceNum,
TotalWorkinghours = newtable.TotalWorkinghours,
SafeWorkinghours = newtable.SafeWorkinghours,
LostWorkinghours = newtable.LostWorkinghours,
TotalEnergyConsumption = newtable.TotalEnergyConsumption,
IncomeComprehensiveEnergyConsumption = newtable.IncomeComprehensiveEnergyConsumption,
NewWaterConsumption = newtable.NewWaterConsumption,
GeneralClosedNum = newtable.GeneralClosedNum,
GeneralNotClosedNum = newtable.GeneralNotClosedNum,
MajorClosedNum = newtable.MajorClosedNum,
MajorNotClosedNum = newtable.MajorNotClosedNum,
HotWorkPermitNum = newtable.HotWorkPermitNum,
HotWorkClosedNum = newtable.HotWorkClosedNum,
HighPermitNum = newtable.HighPermitNum,
HighClosedNum = newtable.HighClosedNum,
TemporaryElectricityPermitNum = newtable.TemporaryElectricityPermitNum,
TemporaryElectricityClosedNum = newtable.TemporaryElectricityClosedNum,
BlindPlatePermitNum = newtable.BlindPlatePermitNum,
BlindPlateClosedNum = newtable.BlindPlateClosedNum,
GroundbreakingPermitNum = newtable.GroundbreakingPermitNum,
GroundbreakingClosedNum = newtable.GroundbreakingClosedNum,
OpenCircuitPermitNum = newtable.OpenCircuitPermitNum,
OpenCircuitClosedNum = newtable.OpenCircuitClosedNum,
HoistingPermitNum = newtable.HoistingPermitNum,
HoistingClosedNum = newtable.HoistingClosedNum,
};
db.Project_SYHSEData_SYHSE.InsertOnSubmit(table);
db.SubmitChanges();
}
}
public static void UpdateProject_SYHSEData_SYHSE(Model.Project_SYHSEData_SYHSE newtable)
{
Model.Project_SYHSEData_SYHSE table = db.Project_SYHSEData_SYHSE.FirstOrDefault(x => x.Id == newtable.Id);
if (table != null)
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
table.Id = newtable.Id;
table.ProjectId=newtable.ProjectId;
table.UnitId = newtable.UnitId;
table.CollCropCode = newtable.CollCropCode;
table.UnitName = newtable.UnitName;
table.ReportDate = newtable.ReportDate;
table.GeneralRiskNum = newtable.GeneralRiskNum;
table.LowRiskNum = newtable.LowRiskNum;
table.MediumRiskNum = newtable.MediumRiskNum;
table.HighRiskNum = newtable.HighRiskNum;
table.GradedResponsiblePersonNum = newtable.GradedResponsiblePersonNum;
table.ChargeInsurancePersonNum = newtable.ChargeInsurancePersonNum;
table.DesignQuantity = newtable.DesignQuantity;
table.RunningCapacity = newtable.RunningCapacity;
table.InterlockSettingValue = newtable.InterlockSettingValue;
table.VideoSurveillanceNum = newtable.VideoSurveillanceNum;
table.TotalWorkinghours = newtable.TotalWorkinghours;
table.SafeWorkinghours = newtable.SafeWorkinghours;
table.LostWorkinghours = newtable.LostWorkinghours;
table.TotalEnergyConsumption = newtable.TotalEnergyConsumption;
table.IncomeComprehensiveEnergyConsumption = newtable.IncomeComprehensiveEnergyConsumption;
table.NewWaterConsumption = newtable.NewWaterConsumption;
table.GeneralClosedNum = newtable.GeneralClosedNum;
table.GeneralNotClosedNum = newtable.GeneralNotClosedNum;
table.MajorClosedNum = newtable.MajorClosedNum;
table.MajorNotClosedNum = newtable.MajorNotClosedNum;
table.HotWorkPermitNum = newtable.HotWorkPermitNum;
table.HotWorkClosedNum = newtable.HotWorkClosedNum;
table.HighPermitNum = newtable.HighPermitNum;
table.HighClosedNum = newtable.HighClosedNum;
table.TemporaryElectricityPermitNum = newtable.TemporaryElectricityPermitNum;
table.TemporaryElectricityClosedNum = newtable.TemporaryElectricityClosedNum;
table.BlindPlatePermitNum = newtable.BlindPlatePermitNum;
table.BlindPlateClosedNum = newtable.BlindPlateClosedNum;
table.GroundbreakingPermitNum = newtable.GroundbreakingPermitNum;
table.GroundbreakingClosedNum = newtable.GroundbreakingClosedNum;
table.OpenCircuitPermitNum = newtable.OpenCircuitPermitNum;
table.OpenCircuitClosedNum = newtable.OpenCircuitClosedNum;
table.HoistingPermitNum = newtable.HoistingPermitNum;
table.HoistingClosedNum = newtable.HoistingClosedNum;
db.SubmitChanges();
Model.Project_SYHSEData_SYHSE table = db.Project_SYHSEData_SYHSE.FirstOrDefault(x => x.Id == newtable.Id);
if (table != null)
{
table.Id = newtable.Id;
table.ProjectId = newtable.ProjectId;
table.UnitId = newtable.UnitId;
table.CollCropCode = newtable.CollCropCode;
table.UnitName = newtable.UnitName;
table.ReportDate = newtable.ReportDate;
table.GeneralRiskNum = newtable.GeneralRiskNum;
table.LowRiskNum = newtable.LowRiskNum;
table.MediumRiskNum = newtable.MediumRiskNum;
table.HighRiskNum = newtable.HighRiskNum;
table.GradedResponsiblePersonNum = newtable.GradedResponsiblePersonNum;
table.ChargeInsurancePersonNum = newtable.ChargeInsurancePersonNum;
table.DesignQuantity = newtable.DesignQuantity;
table.RunningCapacity = newtable.RunningCapacity;
table.InterlockSettingValue = newtable.InterlockSettingValue;
table.VideoSurveillanceNum = newtable.VideoSurveillanceNum;
table.TotalWorkinghours = newtable.TotalWorkinghours;
table.SafeWorkinghours = newtable.SafeWorkinghours;
table.LostWorkinghours = newtable.LostWorkinghours;
table.TotalEnergyConsumption = newtable.TotalEnergyConsumption;
table.IncomeComprehensiveEnergyConsumption = newtable.IncomeComprehensiveEnergyConsumption;
table.NewWaterConsumption = newtable.NewWaterConsumption;
table.GeneralClosedNum = newtable.GeneralClosedNum;
table.GeneralNotClosedNum = newtable.GeneralNotClosedNum;
table.MajorClosedNum = newtable.MajorClosedNum;
table.MajorNotClosedNum = newtable.MajorNotClosedNum;
table.HotWorkPermitNum = newtable.HotWorkPermitNum;
table.HotWorkClosedNum = newtable.HotWorkClosedNum;
table.HighPermitNum = newtable.HighPermitNum;
table.HighClosedNum = newtable.HighClosedNum;
table.TemporaryElectricityPermitNum = newtable.TemporaryElectricityPermitNum;
table.TemporaryElectricityClosedNum = newtable.TemporaryElectricityClosedNum;
table.BlindPlatePermitNum = newtable.BlindPlatePermitNum;
table.BlindPlateClosedNum = newtable.BlindPlateClosedNum;
table.GroundbreakingPermitNum = newtable.GroundbreakingPermitNum;
table.GroundbreakingClosedNum = newtable.GroundbreakingClosedNum;
table.OpenCircuitPermitNum = newtable.OpenCircuitPermitNum;
table.OpenCircuitClosedNum = newtable.OpenCircuitClosedNum;
table.HoistingPermitNum = newtable.HoistingPermitNum;
table.HoistingClosedNum = newtable.HoistingClosedNum;
db.SubmitChanges();
}
}
}
public static void DeleteProject_SYHSEData_SYHSEById(string Id)
{
Model.Project_SYHSEData_SYHSE table = db.Project_SYHSEData_SYHSE.FirstOrDefault(x => x.Id == Id);
if (table != null)
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
db.Project_SYHSEData_SYHSE.DeleteOnSubmit(table);
db.SubmitChanges();
}
Model.Project_SYHSEData_SYHSE table = db.Project_SYHSEData_SYHSE.FirstOrDefault(x => x.Id == Id);
if (table != null)
{
db.Project_SYHSEData_SYHSE.DeleteOnSubmit(table);
db.SubmitChanges();
}
}
}
/// <summary>
/// 判断当天是否统计过数据
@@ -295,7 +300,7 @@ namespace BLL
/// </summary>
/// <param name="projectid"></param>
/// <param name="sYHSESDateType"></param>
public static void StatisticalData(string projectid,SYHSESDateType sYHSESDateType)
public static void StatisticalData(string projectid, SYHSESDateType sYHSESDateType)
{
string thisUnitId = string.Empty;
var thisUnit = CommonService.GetIsThisUnit();
@@ -319,7 +324,7 @@ namespace BLL
table.ProjectId = projectid;
table.ReportDate = DateTime.Now.Date;
if (sYHSESDateType== SYHSESDateType.RiskControl || sYHSESDateType == SYHSESDateType.All)
if (sYHSESDateType == SYHSESDateType.RiskControl || sYHSESDateType == SYHSESDateType.All)
{
table.GeneralRiskNum = GetGeneralRiskNum(projectid);
table.LowRiskNum = GetLowRiskNum(projectid);