2023-05-09 接口更新
This commit is contained in:
@@ -17,7 +17,7 @@ namespace BLL
|
||||
/// <summary>
|
||||
/// CQMS数据类型
|
||||
/// </summary>
|
||||
public enum CQMSDateType
|
||||
public enum CQMSDateType
|
||||
{
|
||||
/// <summary>
|
||||
/// 质量培训数据
|
||||
@@ -145,9 +145,9 @@ namespace BLL
|
||||
}
|
||||
public static List<Model.Project_CQMSData_CQMS> GetProject_CQMSData_CQMSByprojectid(string projectid)
|
||||
{
|
||||
var q =( from x in db.Project_CQMSData_CQMS
|
||||
where x.ProjectId == projectid
|
||||
select x).ToList();
|
||||
var q = (from x in db.Project_CQMSData_CQMS
|
||||
where x.ProjectId == projectid
|
||||
select x).ToList();
|
||||
return q;
|
||||
}
|
||||
/// <summary>
|
||||
@@ -283,7 +283,7 @@ namespace BLL
|
||||
/// </summary>
|
||||
/// <param name="dateTime"></param>
|
||||
/// <returns></returns>
|
||||
public static bool IsReportByDate(DateTime dateTime,string projectid)
|
||||
public static bool IsReportByDate(DateTime dateTime, string projectid)
|
||||
{
|
||||
var result = false;
|
||||
var q = (from x in Funs.DB.Project_CQMSData_CQMS
|
||||
@@ -320,15 +320,20 @@ namespace BLL
|
||||
/// </summary>
|
||||
/// <param name="projectid">项目id</param>
|
||||
/// <param name="cQMSDateType">数据类型</param>
|
||||
public static void StatisticalData(string projectid,CQMSDateType cQMSDateType)
|
||||
public static void StatisticalData(string projectid, CQMSDateType cQMSDateType)
|
||||
{
|
||||
string thisUnitId = BLL.Const.UnitId_CWCEC;
|
||||
string thisUnitId = string.Empty;
|
||||
var thisUnit = Const.UnitId_CWCEC;
|
||||
if (thisUnit != null)
|
||||
{
|
||||
thisUnitId = thisUnit;
|
||||
}
|
||||
var base_Unit = BLL.UnitService.GetUnitByUnitId(thisUnitId);
|
||||
Model.Project_CQMSData_CQMS table = new Model.Project_CQMSData_CQMS();
|
||||
|
||||
if (IsReportByToday(projectid))
|
||||
{
|
||||
table= getTodayProject_CQMSData_CQMS(projectid);
|
||||
table = getTodayProject_CQMSData_CQMS(projectid);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -339,7 +344,7 @@ namespace BLL
|
||||
table.UnitName = base_Unit.UnitName;
|
||||
table.ProjectId = projectid;
|
||||
table.ReportDate = DateTime.Now.Date;
|
||||
if (cQMSDateType== CQMSDateType.QualityTraining|| cQMSDateType == CQMSDateType.All)
|
||||
if (cQMSDateType == CQMSDateType.QualityTraining || cQMSDateType == CQMSDateType.All)
|
||||
{
|
||||
table.TrainPersonNum = GetTrainPersonNum(projectid);
|
||||
table.TechnicalDisclosePersonNum = GetTechnicalDisclosePersonNum(projectid);
|
||||
@@ -388,7 +393,7 @@ namespace BLL
|
||||
table.SubProjectNum = GetSubProjectNum(projectid);
|
||||
table.SubdivisionalWorksNum = GetSubdivisionalWorksNum(projectid);
|
||||
table.InspectionLotNum = GetInspectionLotNum(projectid);
|
||||
}
|
||||
}
|
||||
|
||||
if (IsReportByToday(projectid))
|
||||
{
|
||||
@@ -406,11 +411,11 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetTrainPersonNum(string projectid)
|
||||
{
|
||||
//DateTime date = DateTime.Now;
|
||||
//int result = (from x in Funs.DB.Comprehensive_InspectionPerson
|
||||
// where x.ProjectId == projectid && x.IsTrain == true && x.CompileDate.Value.Year == date.Year && x.CompileDate.Value.Month == date.Month && x.CompileDate.Value.Day == date.Day
|
||||
// select x).Count();
|
||||
return 0;
|
||||
DateTime date = DateTime.Now;
|
||||
int result = (from x in Funs.DB.Comprehensive_InspectionPerson
|
||||
where x.ProjectId == projectid && x.IsTrain == true && x.CompileDate.Value.Year == date.Year && x.CompileDate.Value.Month == date.Month && x.CompileDate.Value.Day == date.Day
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取技术交底人次数
|
||||
@@ -418,12 +423,12 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetTechnicalDisclosePersonNum(string projectid)
|
||||
{
|
||||
//DateTime date = DateTime.Now;
|
||||
//var result = (from x in Funs.DB.Comprehensive_DesignDetails
|
||||
// where x.ProjectId == projectid && x.DetailsDate.Value.Year == date.Year && x.DetailsDate.Value.Month == date.Month && x.DetailsDate.Value.Day == date.Day
|
||||
// select x.JoinPersonNum ).ToList().Sum(x=>x.Value);
|
||||
//var q = Funs.GetNewIntOrZero(result.ToString());
|
||||
return 0;
|
||||
DateTime date = DateTime.Now;
|
||||
var result = (from x in Funs.DB.Comprehensive_DesignDetails
|
||||
where x.ProjectId == projectid && x.DetailsDate.Value.Year == date.Year && x.DetailsDate.Value.Month == date.Month && x.DetailsDate.Value.Day == date.Day
|
||||
select x.JoinPersonNum).ToList().Sum(x => x.Value);
|
||||
var q = Funs.GetNewIntOrZero(result.ToString());
|
||||
return q;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取在用计量器具数
|
||||
@@ -442,10 +447,10 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetOKNum(string projectid)
|
||||
{
|
||||
//int result = (from x in Funs.DB.Comprehensive_InspectionMachine
|
||||
// where x.ProjectId == projectid && x.IsOnSite == true && x.InspectionType.Contains("计量") && x.IsCheckOK == true
|
||||
// select x).Count();
|
||||
return 0;
|
||||
int result = (from x in Funs.DB.Comprehensive_InspectionMachine
|
||||
where x.ProjectId == projectid && x.IsOnSite == true && x.InspectionType.Contains("计量") && x.IsCheckOK == true
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取企业总部人数
|
||||
@@ -471,11 +476,11 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetProjectPersonNum(string projectid)
|
||||
{
|
||||
//int result = (from x in Funs.DB.Comprehensive_InspectionPerson
|
||||
// join y in Funs.DB.Base_WorkPost on x.PostId equals y.WorkPostId
|
||||
// where x.ProjectId == projectid && y.IsCQMS == true && x.IsOnSite == true
|
||||
// select x).Count();
|
||||
return 0;
|
||||
int result = (from x in Funs.DB.Comprehensive_InspectionPerson
|
||||
join y in Funs.DB.Base_WorkPost on x.PostId equals y.WorkPostId
|
||||
where x.ProjectId == projectid && y.IsCQMS == true && x.IsOnSite == true
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取问题个数
|
||||
@@ -517,7 +522,7 @@ namespace BLL
|
||||
public static int GetSNum(string projectid)
|
||||
{
|
||||
int result = (from x in Funs.DB.WBS_BreakdownProject
|
||||
where x.ProjectId == projectid && x.Class.Contains("S")
|
||||
where x.ProjectId == projectid && x.Class.Contains("S") && x.IsSelected == true
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
@@ -528,7 +533,7 @@ namespace BLL
|
||||
public static int GetANum(string projectid)
|
||||
{
|
||||
int result = (from x in Funs.DB.WBS_BreakdownProject
|
||||
where x.ProjectId == projectid && x.Class.Contains("A")
|
||||
where x.ProjectId == projectid && x.Class.Contains("A") && x.IsSelected == true
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
@@ -539,7 +544,7 @@ namespace BLL
|
||||
public static int GetBNum(string projectid)
|
||||
{
|
||||
int result = (from x in Funs.DB.WBS_BreakdownProject
|
||||
where x.ProjectId == projectid && x.Class.Contains("B")
|
||||
where x.ProjectId == projectid && x.Class.Contains("B") && x.IsSelected == true
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
@@ -550,7 +555,7 @@ namespace BLL
|
||||
public static int GetCNum(string projectid)
|
||||
{
|
||||
int result = (from x in Funs.DB.WBS_BreakdownProject
|
||||
where x.ProjectId == projectid && x.Class.Contains("C")
|
||||
where x.ProjectId == projectid && x.Class.Contains("C") && x.IsSelected == true
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
@@ -560,11 +565,11 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetKeyProcessNum(string projectid)
|
||||
{
|
||||
//int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
// join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
|
||||
// where y.ProjectId == projectid && y.CheckAcceptType == "1"
|
||||
// select x).Count();
|
||||
return 0;
|
||||
int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
|
||||
where y.ProjectId == projectid && y.CheckAcceptType == "1"
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取关键工序验收合格数
|
||||
@@ -572,12 +577,12 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetKeyProcessOKNum(string projectid)
|
||||
{
|
||||
//int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
// join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
|
||||
// join z in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals z.InspectionId
|
||||
// where y.ProjectId == projectid && y.CheckAcceptType == "1" && z.IsOnceQualified == true
|
||||
// select x).Count();
|
||||
return 0;
|
||||
int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
|
||||
join z in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals z.InspectionId
|
||||
where y.ProjectId == projectid && y.CheckAcceptType == "1" && z.IsOnceQualified == true
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取特殊过程验收数
|
||||
@@ -585,11 +590,11 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetSpecialProcessNum(string projectid)
|
||||
{
|
||||
//int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
// join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
|
||||
// where y.ProjectId == projectid && y.CheckAcceptType == "2"
|
||||
// select x).Count();
|
||||
return 0;
|
||||
int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
|
||||
where y.ProjectId == projectid && y.CheckAcceptType == "2"
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取特殊过程验收合格数
|
||||
@@ -597,12 +602,12 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetSpecialProcessOKNum(string projectid)
|
||||
{
|
||||
//int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
// join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
|
||||
// join z in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals z.InspectionId
|
||||
// where y.ProjectId == projectid && y.CheckAcceptType == "2" && z.IsOnceQualified == true
|
||||
// select x).Count();
|
||||
return 0;
|
||||
int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
|
||||
join z in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals z.InspectionId
|
||||
where y.ProjectId == projectid && y.CheckAcceptType == "2" && z.IsOnceQualified == true
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取隐蔽工程验收数
|
||||
@@ -610,11 +615,11 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetConcealedWorksNum(string projectid)
|
||||
{
|
||||
//int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
// join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
|
||||
// where y.ProjectId == projectid && y.CheckAcceptType == "3"
|
||||
// select x).Count();
|
||||
return 0;
|
||||
int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
|
||||
where y.ProjectId == projectid && y.CheckAcceptType == "3"
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取隐蔽工程验收合格数
|
||||
@@ -622,12 +627,12 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetConcealedWorksOKNum(string projectid)
|
||||
{
|
||||
//int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
// join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
|
||||
// join z in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals z.InspectionId
|
||||
// where y.ProjectId == projectid && y.CheckAcceptType == "3" && z.IsOnceQualified == true
|
||||
// select x).Count();
|
||||
return 0;
|
||||
int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
|
||||
join z in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals z.InspectionId
|
||||
where y.ProjectId == projectid && y.CheckAcceptType == "3" && z.IsOnceQualified == true
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取单位工程一次验收数
|
||||
@@ -635,11 +640,11 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetUnitProjectOnesNum(string projectid)
|
||||
{
|
||||
//int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
// join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
|
||||
// where y.ProjectId == projectid && y.CheckAcceptType == "4"
|
||||
// select x).Count();
|
||||
return 0;
|
||||
int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
|
||||
where y.ProjectId == projectid && y.CheckAcceptType == "4"
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取单位工程一次验收合格数
|
||||
@@ -647,12 +652,12 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetUnitProjectOnesOKNum(string projectid)
|
||||
{
|
||||
//int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
// join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
|
||||
// join z in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals z.InspectionId
|
||||
// where y.ProjectId == projectid && y.CheckAcceptType == "4" && z.IsOnceQualified == true
|
||||
// select x).Count();
|
||||
return 0;
|
||||
int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
|
||||
join z in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals z.InspectionId
|
||||
where y.ProjectId == projectid && y.CheckAcceptType == "4" && z.IsOnceQualified == true
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取材料进场复验数
|
||||
@@ -660,11 +665,11 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetMaterialInRecheckNum(string projectid)
|
||||
{
|
||||
//int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
// join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
|
||||
// where y.ProjectId == projectid && y.CheckAcceptType == "5"
|
||||
// select x).Count();
|
||||
return 0;
|
||||
int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
|
||||
where y.ProjectId == projectid && y.CheckAcceptType == "5"
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取材料进场复验合格数
|
||||
@@ -672,12 +677,12 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetMaterialInRecheckOKNum(string projectid)
|
||||
{
|
||||
//int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
// join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
|
||||
// join z in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals z.InspectionId
|
||||
// where y.ProjectId == projectid && y.CheckAcceptType == "5" && z.IsOnceQualified == true
|
||||
// select x).Count();
|
||||
return 0;
|
||||
int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
|
||||
join z in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals z.InspectionId
|
||||
where y.ProjectId == projectid && y.CheckAcceptType == "5" && z.IsOnceQualified == true
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取单项工程个数
|
||||
@@ -707,10 +712,10 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetSubProjectNum(string projectid)
|
||||
{
|
||||
//int result = (from x in Funs.DB.WBS_DivisionProject
|
||||
// where x.ProjectId == projectid && x.SubItemType == "1"
|
||||
// select x).Count();
|
||||
return 0;
|
||||
int result = (from x in Funs.DB.WBS_DivisionProject
|
||||
where x.ProjectId == projectid && x.SubItemType == "1" && x.IsSelected == true
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取分项工程个数
|
||||
@@ -718,10 +723,10 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetSubdivisionalWorksNum(string projectid)
|
||||
{
|
||||
//int result = (from x in Funs.DB.WBS_DivisionProject
|
||||
// where x.ProjectId == projectid && x.SubItemType == "3"
|
||||
// select x).Count();
|
||||
return 0;
|
||||
int result = (from x in Funs.DB.WBS_DivisionProject
|
||||
where x.ProjectId == projectid && x.SubItemType == "3" && x.IsSelected == true
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取检验批个数
|
||||
@@ -730,7 +735,7 @@ namespace BLL
|
||||
public static int GetInspectionLotNum(string projectid)
|
||||
{
|
||||
int result = (from x in Funs.DB.WBS_BreakdownProject
|
||||
where x.ProjectId == projectid
|
||||
where x.ProjectId == projectid && x.IsSelected == true
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -202,39 +202,44 @@ namespace BLL
|
||||
/// <param name="projectid"></param>
|
||||
public static void StatisticalData(string projectid)
|
||||
{
|
||||
//string thisUnitId = BLL.Const.UnitId_CWCEC;
|
||||
//var base_Unit = BLL.UnitService.GetUnitByUnitId(thisUnitId);
|
||||
//var list = from x in db.CH_CheckItem
|
||||
// join y in db.CH_Check on x.CHT_CheckID equals y.CHT_CheckID
|
||||
// where y.ProjectId == projectid
|
||||
// select x;
|
||||
//var types = (from x in list select x.Defects_Definition).Distinct().ToList();
|
||||
//foreach (var t in types)
|
||||
//{
|
||||
// if (!string.IsNullOrEmpty(t))
|
||||
// {
|
||||
// Model.Project_HJGLData_Defect table = new Model.Project_HJGLData_Defect
|
||||
// {
|
||||
// UnitId = thisUnitId,
|
||||
// CollCropCode = base_Unit.CollCropCode,
|
||||
// UnitName = base_Unit.UnitName,
|
||||
// ProjectId = projectid,
|
||||
// ReportDate = DateTime.Now.Date,
|
||||
// DefectName = t,
|
||||
// DefectNum = list.Count(x => x.Defects_Definition == t),
|
||||
// };
|
||||
// if (IsReportByToday(projectid, t))
|
||||
// {
|
||||
// table.Id = getTodayProject_HJGLData_Defect(projectid, t).Id;
|
||||
// UpdateProject_HJGLData_Defect(table);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// table.Id = SQLHelper.GetNewID();
|
||||
// AddProject_HJGLData_Defect(table);
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
string thisUnitId = string.Empty;
|
||||
var thisUnit = Const.UnitId_CWCEC;
|
||||
if (thisUnit != null)
|
||||
{
|
||||
thisUnitId = thisUnit;
|
||||
}
|
||||
var base_Unit = BLL.UnitService.GetUnitByUnitId(thisUnitId);
|
||||
var list = from x in db.CH_CheckItem
|
||||
join y in db.CH_Check on x.CHT_CheckID equals y.CHT_CheckID
|
||||
where y.ProjectId == projectid
|
||||
select x;
|
||||
var types = (from x in list select x.Defects_Definition).Distinct().ToList();
|
||||
foreach (var t in types)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(t))
|
||||
{
|
||||
Model.Project_HJGLData_Defect table = new Model.Project_HJGLData_Defect
|
||||
{
|
||||
UnitId = thisUnitId,
|
||||
CollCropCode = base_Unit.CollCropCode,
|
||||
UnitName = base_Unit.UnitName,
|
||||
ProjectId = projectid,
|
||||
ReportDate = DateTime.Now.Date,
|
||||
DefectName = t,
|
||||
DefectNum = list.Count(x => x.Defects_Definition == t),
|
||||
};
|
||||
if (IsReportByToday(projectid, t))
|
||||
{
|
||||
table.Id = getTodayProject_HJGLData_Defect(projectid, t).Id;
|
||||
UpdateProject_HJGLData_Defect(table);
|
||||
}
|
||||
else
|
||||
{
|
||||
table.Id = SQLHelper.GetNewID();
|
||||
AddProject_HJGLData_Defect(table);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取缺陷名称
|
||||
|
||||
@@ -228,7 +228,12 @@ namespace BLL
|
||||
/// <param name="hJGLDateType">数据类型</param>
|
||||
public static void StatisticalData(string projectid,HJGLDateType hJGLDateType)
|
||||
{
|
||||
string thisUnitId = BLL.Const.UnitId_CWCEC;
|
||||
string thisUnitId = string.Empty;
|
||||
var thisUnit = Const.UnitId_CWCEC;
|
||||
if (thisUnit != null)
|
||||
{
|
||||
thisUnitId = thisUnit;
|
||||
}
|
||||
var base_Unit = BLL.UnitService.GetUnitByUnitId(thisUnitId);
|
||||
Model.Project_HJGLData_HJGL table = new Model.Project_HJGLData_HJGL();
|
||||
if (IsReportByToday(projectid))
|
||||
@@ -298,7 +303,7 @@ namespace BLL
|
||||
{
|
||||
//int result = Convert.ToInt32((from x in Funs.DB.PW_JointInfo
|
||||
// where x.ProjectId == projectid
|
||||
// select x.JOT_Size).ToList().Sum(x=>x.Value));
|
||||
// select x.JOT_Size).ToList().Sum());
|
||||
return 0;
|
||||
}
|
||||
/// <summary>
|
||||
@@ -309,7 +314,7 @@ namespace BLL
|
||||
{
|
||||
//int result = Convert.ToInt32((from x in Funs.DB.PW_JointInfo
|
||||
// where x.ProjectId == projectid
|
||||
// select x.JOT_DoneDin ).ToList().Sum(x => x.Value));
|
||||
// select x.JOT_DoneDin ).ToList().Sum());
|
||||
return 0;
|
||||
}
|
||||
/// <summary>
|
||||
@@ -318,10 +323,10 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetTotalFilmNum(string projectid)
|
||||
{
|
||||
//int result = (from x in Funs.DB.CH_CheckItem
|
||||
//int result = Convert.ToInt32((from x in Funs.DB.CH_CheckItem
|
||||
// join y in Funs.DB.CH_Check on x.CHT_CheckID equals y.CHT_CheckID
|
||||
// where y.ProjectId == projectid
|
||||
// select x.CHT_TotalFilm ).ToList().Sum(x => x.Value);
|
||||
// select x.CHT_TotalFilm ).ToList().Sum());
|
||||
return 0;
|
||||
}
|
||||
/// <summary>
|
||||
@@ -330,10 +335,10 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetOKFilmNum(string projectid)
|
||||
{
|
||||
//int result = (from x in Funs.DB.CH_CheckItem
|
||||
//int result = Convert.ToInt32((from x in Funs.DB.CH_CheckItem
|
||||
// join y in Funs.DB.CH_Check on x.CHT_CheckID equals y.CHT_CheckID
|
||||
// where y.ProjectId == projectid
|
||||
// select x.CHT_PassFilm).ToList().Sum(x => x.Value);
|
||||
// select x.CHT_PassFilm).ToList().Sum());
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -216,88 +216,90 @@ namespace BLL
|
||||
/// <param name="newtable"></param>
|
||||
public static void AddProject_HSSEData_HSSE(Model.Project_HSSEData_HSSE newtable)
|
||||
{
|
||||
|
||||
Model.Project_HSSEData_HSSE table = new Model.Project_HSSEData_HSSE
|
||||
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,
|
||||
BeUnderConstructionNum = newtable.BeUnderConstructionNum,
|
||||
ShutdownNum = newtable.ShutdownNum,
|
||||
JoinConstructionPersonNum = newtable.JoinConstructionPersonNum,
|
||||
MajorProjectsUnderConstructionNum = newtable.MajorProjectsUnderConstructionNum,
|
||||
TotalWorkingHour = newtable.TotalWorkingHour,
|
||||
LostWorkingHour = newtable.LostWorkingHour,
|
||||
SafeWorkingHour = newtable.SafeWorkingHour,
|
||||
SafeTrainNum = newtable.SafeTrainNum,
|
||||
SpecialTrainNum = newtable.SpecialTrainNum,
|
||||
SpecialOperationTrainNum = newtable.SpecialOperationTrainNum,
|
||||
TotalEnergyConsumption = newtable.TotalEnergyConsumption,
|
||||
IncomeComprehensiveEnergyConsumption = newtable.IncomeComprehensiveEnergyConsumption,
|
||||
NewWaterConsumption = newtable.NewWaterConsumption,
|
||||
HeadOfficeInspectorGeneralNum = newtable.HeadOfficeInspectorGeneralNum,
|
||||
HeadOfficeFullTimeNum = newtable.HeadOfficeFullTimeNum,
|
||||
BranchInspectorGeneralNum = newtable.BranchInspectorGeneralNum,
|
||||
BranchFullTimeNum = newtable.BranchFullTimeNum,
|
||||
ProjectInspectorGeneralNum = newtable.ProjectInspectorGeneralNum,
|
||||
ProjectFullTimeNum = newtable.ProjectFullTimeNum,
|
||||
ProjectSafetyMonitorNum = newtable.ProjectSafetyMonitorNum,
|
||||
SafetyInjectionEngineer = newtable.SafetyInjectionEngineer,
|
||||
CertificateANum = newtable.CertificateANum,
|
||||
CertificateBNum = newtable.CertificateBNum,
|
||||
CertificateCNum = newtable.CertificateCNum,
|
||||
SafetyCommitteeMeetingNum = newtable.SafetyCommitteeMeetingNum,
|
||||
EnterpriseTopicsMeetingNum = newtable.EnterpriseTopicsMeetingNum,
|
||||
ProjectSafetyLeadingGroupMeetingNum = newtable.ProjectSafetyLeadingGroupMeetingNum,
|
||||
ProjectSafetyMeetingNum = newtable.ProjectSafetyMeetingNum,
|
||||
CompanyLeadShiftCheckNum = newtable.CompanyLeadShiftCheckNum,
|
||||
CompanyComprehensiveCheckNum = newtable.CompanyComprehensiveCheckNum,
|
||||
CompanySpecialCheckNum = newtable.CompanySpecialCheckNum,
|
||||
ProjectLeadShiftCheckNum = newtable.ProjectLeadShiftCheckNum,
|
||||
ProjectSpecialCheckNum = newtable.ProjectSpecialCheckNum,
|
||||
ProjectMajorCheckNum = newtable.ProjectMajorCheckNum,
|
||||
NearMissNum = newtable.NearMissNum,
|
||||
RecordableEventNum = newtable.RecordableEventNum,
|
||||
GeneralAccidentNum = newtable.GeneralAccidentNum,
|
||||
MajorAccidentNum = newtable.MajorAccidentNum,
|
||||
SeriousAccidentNum = newtable.SeriousAccidentNum,
|
||||
SpecialSeriousAccidentNum = newtable.SpecialSeriousAccidentNum,
|
||||
CompanyComprehensivePlanNum = newtable.CompanyComprehensivePlanNum,
|
||||
CompanySpecialPlanNum = newtable.CompanySpecialPlanNum,
|
||||
CompanyOnSiteDisposalPlan = newtable.CompanyOnSiteDisposalPlan,
|
||||
CompanyDrillNum = newtable.CompanyDrillNum,
|
||||
ProjectComprehensivePlanNum = newtable.ProjectComprehensivePlanNum,
|
||||
ProjectSpecialPlanNum = newtable.ProjectSpecialPlanNum,
|
||||
ProjectOnSiteDisposalPlan = newtable.ProjectOnSiteDisposalPlan,
|
||||
ProjectDrillNum = newtable.ProjectDrillNum,
|
||||
CostExtract = newtable.CostExtract,
|
||||
CostUse = newtable.CostUse,
|
||||
UseEquipmentNum = newtable.UseEquipmentNum,
|
||||
SpecialEquipmentNum = newtable.SpecialEquipmentNum,
|
||||
LicensesNum = newtable.LicensesNum,
|
||||
LicensesCloseNum = newtable.LicensesCloseNum,
|
||||
GeneralClosedNum = newtable.GeneralClosedNum,
|
||||
GeneralNotClosedNum = newtable.GeneralNotClosedNum,
|
||||
MajorClosedNum = newtable.MajorClosedNum,
|
||||
MajorNotClosedNum = newtable.MajorNotClosedNum,
|
||||
GeneralRiskNum = newtable.GeneralRiskNum,
|
||||
LowRiskNum = newtable.LowRiskNum,
|
||||
MediumRiskNum = newtable.MediumRiskNum,
|
||||
HighRiskNum = newtable.HighRiskNum,
|
||||
CompletedNum = newtable.CompletedNum,
|
||||
TrainPersonNum = newtable.TrainPersonNum,
|
||||
ConstructionNum = newtable.ConstructionNum,
|
||||
FinishedNum = newtable.FinishedNum,
|
||||
SuperCompletedNum = newtable.SuperCompletedNum,
|
||||
SuperTrainPersonNum = newtable.SuperTrainPersonNum,
|
||||
SuperConstructionNum = newtable.SuperConstructionNum,
|
||||
SuperFinishedNum = newtable.SuperFinishedNum,
|
||||
};
|
||||
db.Project_HSSEData_HSSE.InsertOnSubmit(table);
|
||||
db.SubmitChanges();
|
||||
Model.Project_HSSEData_HSSE table = new Model.Project_HSSEData_HSSE
|
||||
{
|
||||
Id = newtable.Id,
|
||||
ProjectId = newtable.ProjectId,
|
||||
UnitId = newtable.UnitId,
|
||||
CollCropCode = newtable.CollCropCode,
|
||||
UnitName = newtable.UnitName,
|
||||
ReportDate = newtable.ReportDate,
|
||||
BeUnderConstructionNum = newtable.BeUnderConstructionNum,
|
||||
ShutdownNum = newtable.ShutdownNum,
|
||||
JoinConstructionPersonNum = newtable.JoinConstructionPersonNum,
|
||||
MajorProjectsUnderConstructionNum = newtable.MajorProjectsUnderConstructionNum,
|
||||
TotalWorkingHour = newtable.TotalWorkingHour,
|
||||
LostWorkingHour = newtable.LostWorkingHour,
|
||||
SafeWorkingHour = newtable.SafeWorkingHour,
|
||||
SafeTrainNum = newtable.SafeTrainNum,
|
||||
SpecialTrainNum = newtable.SpecialTrainNum,
|
||||
SpecialOperationTrainNum = newtable.SpecialOperationTrainNum,
|
||||
TotalEnergyConsumption = newtable.TotalEnergyConsumption,
|
||||
IncomeComprehensiveEnergyConsumption = newtable.IncomeComprehensiveEnergyConsumption,
|
||||
NewWaterConsumption = newtable.NewWaterConsumption,
|
||||
HeadOfficeInspectorGeneralNum = newtable.HeadOfficeInspectorGeneralNum,
|
||||
HeadOfficeFullTimeNum = newtable.HeadOfficeFullTimeNum,
|
||||
BranchInspectorGeneralNum = newtable.BranchInspectorGeneralNum,
|
||||
BranchFullTimeNum = newtable.BranchFullTimeNum,
|
||||
ProjectInspectorGeneralNum = newtable.ProjectInspectorGeneralNum,
|
||||
ProjectFullTimeNum = newtable.ProjectFullTimeNum,
|
||||
ProjectSafetyMonitorNum = newtable.ProjectSafetyMonitorNum,
|
||||
SafetyInjectionEngineer = newtable.SafetyInjectionEngineer,
|
||||
CertificateANum = newtable.CertificateANum,
|
||||
CertificateBNum = newtable.CertificateBNum,
|
||||
CertificateCNum = newtable.CertificateCNum,
|
||||
SafetyCommitteeMeetingNum = newtable.SafetyCommitteeMeetingNum,
|
||||
EnterpriseTopicsMeetingNum = newtable.EnterpriseTopicsMeetingNum,
|
||||
ProjectSafetyLeadingGroupMeetingNum = newtable.ProjectSafetyLeadingGroupMeetingNum,
|
||||
ProjectSafetyMeetingNum = newtable.ProjectSafetyMeetingNum,
|
||||
CompanyLeadShiftCheckNum = newtable.CompanyLeadShiftCheckNum,
|
||||
CompanyComprehensiveCheckNum = newtable.CompanyComprehensiveCheckNum,
|
||||
CompanySpecialCheckNum = newtable.CompanySpecialCheckNum,
|
||||
ProjectLeadShiftCheckNum = newtable.ProjectLeadShiftCheckNum,
|
||||
ProjectSpecialCheckNum = newtable.ProjectSpecialCheckNum,
|
||||
ProjectMajorCheckNum = newtable.ProjectMajorCheckNum,
|
||||
NearMissNum = newtable.NearMissNum,
|
||||
RecordableEventNum = newtable.RecordableEventNum,
|
||||
GeneralAccidentNum = newtable.GeneralAccidentNum,
|
||||
MajorAccidentNum = newtable.MajorAccidentNum,
|
||||
SeriousAccidentNum = newtable.SeriousAccidentNum,
|
||||
SpecialSeriousAccidentNum = newtable.SpecialSeriousAccidentNum,
|
||||
CompanyComprehensivePlanNum = newtable.CompanyComprehensivePlanNum,
|
||||
CompanySpecialPlanNum = newtable.CompanySpecialPlanNum,
|
||||
CompanyOnSiteDisposalPlan = newtable.CompanyOnSiteDisposalPlan,
|
||||
CompanyDrillNum = newtable.CompanyDrillNum,
|
||||
ProjectComprehensivePlanNum = newtable.ProjectComprehensivePlanNum,
|
||||
ProjectSpecialPlanNum = newtable.ProjectSpecialPlanNum,
|
||||
ProjectOnSiteDisposalPlan = newtable.ProjectOnSiteDisposalPlan,
|
||||
ProjectDrillNum = newtable.ProjectDrillNum,
|
||||
CostExtract = newtable.CostExtract,
|
||||
CostUse = newtable.CostUse,
|
||||
UseEquipmentNum = newtable.UseEquipmentNum,
|
||||
SpecialEquipmentNum = newtable.SpecialEquipmentNum,
|
||||
LicensesNum = newtable.LicensesNum,
|
||||
LicensesCloseNum = newtable.LicensesCloseNum,
|
||||
GeneralClosedNum = newtable.GeneralClosedNum,
|
||||
GeneralNotClosedNum = newtable.GeneralNotClosedNum,
|
||||
MajorClosedNum = newtable.MajorClosedNum,
|
||||
MajorNotClosedNum = newtable.MajorNotClosedNum,
|
||||
GeneralRiskNum = newtable.GeneralRiskNum,
|
||||
LowRiskNum = newtable.LowRiskNum,
|
||||
MediumRiskNum = newtable.MediumRiskNum,
|
||||
HighRiskNum = newtable.HighRiskNum,
|
||||
CompletedNum = newtable.CompletedNum,
|
||||
TrainPersonNum = newtable.TrainPersonNum,
|
||||
ConstructionNum = newtable.ConstructionNum,
|
||||
FinishedNum = newtable.FinishedNum,
|
||||
SuperCompletedNum = newtable.SuperCompletedNum,
|
||||
SuperTrainPersonNum = newtable.SuperTrainPersonNum,
|
||||
SuperConstructionNum = newtable.SuperConstructionNum,
|
||||
SuperFinishedNum = newtable.SuperFinishedNum,
|
||||
};
|
||||
db.Project_HSSEData_HSSE.InsertOnSubmit(table);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 删除实体
|
||||
@@ -305,14 +307,15 @@ namespace BLL
|
||||
/// <param name="Id"></param>
|
||||
public static void DeleteProject_HSSEData_HSSEById(string Id)
|
||||
{
|
||||
|
||||
Model.Project_HSSEData_HSSE table = db.Project_HSSEData_HSSE.FirstOrDefault(x => x.Id == Id);
|
||||
if (table != null)
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
db.Project_HSSEData_HSSE.DeleteOnSubmit(table);
|
||||
db.SubmitChanges();
|
||||
Model.Project_HSSEData_HSSE table = db.Project_HSSEData_HSSE.FirstOrDefault(x => x.Id == Id);
|
||||
if (table != null)
|
||||
{
|
||||
db.Project_HSSEData_HSSE.DeleteOnSubmit(table);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据id获取实体
|
||||
@@ -325,97 +328,100 @@ namespace BLL
|
||||
}
|
||||
public static List<Model.Project_HSSEData_HSSE> GetProject_HSSEData_HSSEByProjectid(string Projectid)
|
||||
{
|
||||
var q = (from x in db.Project_HSSEData_HSSE
|
||||
where x.ProjectId == Projectid
|
||||
select x).ToList();
|
||||
return q;
|
||||
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var q = (from x in db.Project_HSSEData_HSSE
|
||||
where x.ProjectId == Projectid
|
||||
select x).ToList();
|
||||
return q;
|
||||
}
|
||||
}
|
||||
public static void UpdateProject_HSSEData_HSSE(Model.Project_HSSEData_HSSE newtable)
|
||||
{
|
||||
|
||||
Model.Project_HSSEData_HSSE table = db.Project_HSSEData_HSSE.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.BeUnderConstructionNum = newtable.BeUnderConstructionNum;
|
||||
table.ShutdownNum = newtable.ShutdownNum;
|
||||
table.JoinConstructionPersonNum = newtable.JoinConstructionPersonNum;
|
||||
table.MajorProjectsUnderConstructionNum = newtable.MajorProjectsUnderConstructionNum;
|
||||
table.TotalWorkingHour = newtable.TotalWorkingHour;
|
||||
table.LostWorkingHour = newtable.LostWorkingHour;
|
||||
table.SafeWorkingHour = newtable.SafeWorkingHour;
|
||||
table.SafeTrainNum = newtable.SafeTrainNum;
|
||||
table.SpecialTrainNum = newtable.SpecialTrainNum;
|
||||
table.SpecialOperationTrainNum = newtable.SpecialOperationTrainNum;
|
||||
table.TotalEnergyConsumption = newtable.TotalEnergyConsumption;
|
||||
table.IncomeComprehensiveEnergyConsumption = newtable.IncomeComprehensiveEnergyConsumption;
|
||||
table.NewWaterConsumption = newtable.NewWaterConsumption;
|
||||
table.HeadOfficeInspectorGeneralNum = newtable.HeadOfficeInspectorGeneralNum;
|
||||
table.HeadOfficeFullTimeNum = newtable.HeadOfficeFullTimeNum;
|
||||
table.BranchInspectorGeneralNum = newtable.BranchInspectorGeneralNum;
|
||||
table.BranchFullTimeNum = newtable.BranchFullTimeNum;
|
||||
table.ProjectInspectorGeneralNum = newtable.ProjectInspectorGeneralNum;
|
||||
table.ProjectFullTimeNum = newtable.ProjectFullTimeNum;
|
||||
table.ProjectSafetyMonitorNum = newtable.ProjectSafetyMonitorNum;
|
||||
table.SafetyInjectionEngineer = newtable.SafetyInjectionEngineer;
|
||||
table.CertificateANum = newtable.CertificateANum;
|
||||
table.CertificateBNum = newtable.CertificateBNum;
|
||||
table.CertificateCNum = newtable.CertificateCNum;
|
||||
table.SafetyCommitteeMeetingNum = newtable.SafetyCommitteeMeetingNum;
|
||||
table.EnterpriseTopicsMeetingNum = newtable.EnterpriseTopicsMeetingNum;
|
||||
table.ProjectSafetyLeadingGroupMeetingNum = newtable.ProjectSafetyLeadingGroupMeetingNum;
|
||||
table.ProjectSafetyMeetingNum = newtable.ProjectSafetyMeetingNum;
|
||||
table.CompanyLeadShiftCheckNum = newtable.CompanyLeadShiftCheckNum;
|
||||
table.CompanyComprehensiveCheckNum = newtable.CompanyComprehensiveCheckNum;
|
||||
table.CompanySpecialCheckNum = newtable.CompanySpecialCheckNum;
|
||||
table.ProjectLeadShiftCheckNum = newtable.ProjectLeadShiftCheckNum;
|
||||
table.ProjectSpecialCheckNum = newtable.ProjectSpecialCheckNum;
|
||||
table.ProjectMajorCheckNum = newtable.ProjectMajorCheckNum;
|
||||
table.NearMissNum = newtable.NearMissNum;
|
||||
table.RecordableEventNum = newtable.RecordableEventNum;
|
||||
table.GeneralAccidentNum = newtable.GeneralAccidentNum;
|
||||
table.MajorAccidentNum = newtable.MajorAccidentNum;
|
||||
table.SeriousAccidentNum = newtable.SeriousAccidentNum;
|
||||
table.SpecialSeriousAccidentNum = newtable.SpecialSeriousAccidentNum;
|
||||
table.CompanyComprehensivePlanNum = newtable.CompanyComprehensivePlanNum;
|
||||
table.CompanySpecialPlanNum = newtable.CompanySpecialPlanNum;
|
||||
table.CompanyOnSiteDisposalPlan = newtable.CompanyOnSiteDisposalPlan;
|
||||
table.CompanyDrillNum = newtable.CompanyDrillNum;
|
||||
table.ProjectComprehensivePlanNum = newtable.ProjectComprehensivePlanNum;
|
||||
table.ProjectSpecialPlanNum = newtable.ProjectSpecialPlanNum;
|
||||
table.ProjectOnSiteDisposalPlan = newtable.ProjectOnSiteDisposalPlan;
|
||||
table.ProjectDrillNum = newtable.ProjectDrillNum;
|
||||
table.CostExtract = newtable.CostExtract;
|
||||
table.CostUse = newtable.CostUse;
|
||||
table.UseEquipmentNum = newtable.UseEquipmentNum;
|
||||
table.SpecialEquipmentNum = newtable.SpecialEquipmentNum;
|
||||
table.LicensesNum = newtable.LicensesNum;
|
||||
table.LicensesCloseNum = newtable.LicensesCloseNum;
|
||||
table.GeneralClosedNum = newtable.GeneralClosedNum;
|
||||
table.GeneralNotClosedNum = newtable.GeneralNotClosedNum;
|
||||
table.MajorClosedNum = newtable.MajorClosedNum;
|
||||
table.MajorNotClosedNum = newtable.MajorNotClosedNum;
|
||||
table.GeneralRiskNum = newtable.GeneralRiskNum;
|
||||
table.LowRiskNum = newtable.LowRiskNum;
|
||||
table.MediumRiskNum = newtable.MediumRiskNum;
|
||||
table.HighRiskNum = newtable.HighRiskNum;
|
||||
table.CompletedNum = newtable.CompletedNum;
|
||||
table.TrainPersonNum = newtable.TrainPersonNum;
|
||||
table.ConstructionNum = newtable.ConstructionNum;
|
||||
table.FinishedNum = newtable.FinishedNum;
|
||||
table.SuperCompletedNum = newtable.SuperCompletedNum;
|
||||
table.SuperTrainPersonNum = newtable.SuperTrainPersonNum;
|
||||
table.SuperConstructionNum = newtable.SuperConstructionNum;
|
||||
table.SuperFinishedNum = newtable.SuperFinishedNum;
|
||||
db.SubmitChanges();
|
||||
Model.Project_HSSEData_HSSE table = db.Project_HSSEData_HSSE.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.BeUnderConstructionNum = newtable.BeUnderConstructionNum;
|
||||
table.ShutdownNum = newtable.ShutdownNum;
|
||||
table.JoinConstructionPersonNum = newtable.JoinConstructionPersonNum;
|
||||
table.MajorProjectsUnderConstructionNum = newtable.MajorProjectsUnderConstructionNum;
|
||||
table.TotalWorkingHour = newtable.TotalWorkingHour;
|
||||
table.LostWorkingHour = newtable.LostWorkingHour;
|
||||
table.SafeWorkingHour = newtable.SafeWorkingHour;
|
||||
table.SafeTrainNum = newtable.SafeTrainNum;
|
||||
table.SpecialTrainNum = newtable.SpecialTrainNum;
|
||||
table.SpecialOperationTrainNum = newtable.SpecialOperationTrainNum;
|
||||
table.TotalEnergyConsumption = newtable.TotalEnergyConsumption;
|
||||
table.IncomeComprehensiveEnergyConsumption = newtable.IncomeComprehensiveEnergyConsumption;
|
||||
table.NewWaterConsumption = newtable.NewWaterConsumption;
|
||||
table.HeadOfficeInspectorGeneralNum = newtable.HeadOfficeInspectorGeneralNum;
|
||||
table.HeadOfficeFullTimeNum = newtable.HeadOfficeFullTimeNum;
|
||||
table.BranchInspectorGeneralNum = newtable.BranchInspectorGeneralNum;
|
||||
table.BranchFullTimeNum = newtable.BranchFullTimeNum;
|
||||
table.ProjectInspectorGeneralNum = newtable.ProjectInspectorGeneralNum;
|
||||
table.ProjectFullTimeNum = newtable.ProjectFullTimeNum;
|
||||
table.ProjectSafetyMonitorNum = newtable.ProjectSafetyMonitorNum;
|
||||
table.SafetyInjectionEngineer = newtable.SafetyInjectionEngineer;
|
||||
table.CertificateANum = newtable.CertificateANum;
|
||||
table.CertificateBNum = newtable.CertificateBNum;
|
||||
table.CertificateCNum = newtable.CertificateCNum;
|
||||
table.SafetyCommitteeMeetingNum = newtable.SafetyCommitteeMeetingNum;
|
||||
table.EnterpriseTopicsMeetingNum = newtable.EnterpriseTopicsMeetingNum;
|
||||
table.ProjectSafetyLeadingGroupMeetingNum = newtable.ProjectSafetyLeadingGroupMeetingNum;
|
||||
table.ProjectSafetyMeetingNum = newtable.ProjectSafetyMeetingNum;
|
||||
table.CompanyLeadShiftCheckNum = newtable.CompanyLeadShiftCheckNum;
|
||||
table.CompanyComprehensiveCheckNum = newtable.CompanyComprehensiveCheckNum;
|
||||
table.CompanySpecialCheckNum = newtable.CompanySpecialCheckNum;
|
||||
table.ProjectLeadShiftCheckNum = newtable.ProjectLeadShiftCheckNum;
|
||||
table.ProjectSpecialCheckNum = newtable.ProjectSpecialCheckNum;
|
||||
table.ProjectMajorCheckNum = newtable.ProjectMajorCheckNum;
|
||||
table.NearMissNum = newtable.NearMissNum;
|
||||
table.RecordableEventNum = newtable.RecordableEventNum;
|
||||
table.GeneralAccidentNum = newtable.GeneralAccidentNum;
|
||||
table.MajorAccidentNum = newtable.MajorAccidentNum;
|
||||
table.SeriousAccidentNum = newtable.SeriousAccidentNum;
|
||||
table.SpecialSeriousAccidentNum = newtable.SpecialSeriousAccidentNum;
|
||||
table.CompanyComprehensivePlanNum = newtable.CompanyComprehensivePlanNum;
|
||||
table.CompanySpecialPlanNum = newtable.CompanySpecialPlanNum;
|
||||
table.CompanyOnSiteDisposalPlan = newtable.CompanyOnSiteDisposalPlan;
|
||||
table.CompanyDrillNum = newtable.CompanyDrillNum;
|
||||
table.ProjectComprehensivePlanNum = newtable.ProjectComprehensivePlanNum;
|
||||
table.ProjectSpecialPlanNum = newtable.ProjectSpecialPlanNum;
|
||||
table.ProjectOnSiteDisposalPlan = newtable.ProjectOnSiteDisposalPlan;
|
||||
table.ProjectDrillNum = newtable.ProjectDrillNum;
|
||||
table.CostExtract = newtable.CostExtract;
|
||||
table.CostUse = newtable.CostUse;
|
||||
table.UseEquipmentNum = newtable.UseEquipmentNum;
|
||||
table.SpecialEquipmentNum = newtable.SpecialEquipmentNum;
|
||||
table.LicensesNum = newtable.LicensesNum;
|
||||
table.LicensesCloseNum = newtable.LicensesCloseNum;
|
||||
table.GeneralClosedNum = newtable.GeneralClosedNum;
|
||||
table.GeneralNotClosedNum = newtable.GeneralNotClosedNum;
|
||||
table.MajorClosedNum = newtable.MajorClosedNum;
|
||||
table.MajorNotClosedNum = newtable.MajorNotClosedNum;
|
||||
table.GeneralRiskNum = newtable.GeneralRiskNum;
|
||||
table.LowRiskNum = newtable.LowRiskNum;
|
||||
table.MediumRiskNum = newtable.MediumRiskNum;
|
||||
table.HighRiskNum = newtable.HighRiskNum;
|
||||
table.CompletedNum = newtable.CompletedNum;
|
||||
table.TrainPersonNum = newtable.TrainPersonNum;
|
||||
table.ConstructionNum = newtable.ConstructionNum;
|
||||
table.FinishedNum = newtable.FinishedNum;
|
||||
table.SuperCompletedNum = newtable.SuperCompletedNum;
|
||||
table.SuperTrainPersonNum = newtable.SuperTrainPersonNum;
|
||||
table.SuperConstructionNum = newtable.SuperConstructionNum;
|
||||
table.SuperFinishedNum = newtable.SuperFinishedNum;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 判断该项目的该日期是否统计数据
|
||||
@@ -481,7 +487,12 @@ namespace BLL
|
||||
/// <param name="projectid"></param>
|
||||
public static void StatisticalData(string projectid, HSSEDateType hSSEDateType)
|
||||
{
|
||||
string thisUnitId = BLL.Const.UnitId_CWCEC;
|
||||
string thisUnitId = string.Empty;
|
||||
var thisUnit = Const.UnitId_CWCEC;
|
||||
if (thisUnit != null)
|
||||
{
|
||||
thisUnitId = thisUnit;
|
||||
}
|
||||
var base_Unit = BLL.UnitService.GetUnitByUnitId(thisUnitId);
|
||||
Model.Project_HSSEData_HSSE table = new Model.Project_HSSEData_HSSE();
|
||||
if (IsReportByToday(projectid))
|
||||
@@ -716,12 +727,12 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetSafeTrainNum(string projectid)
|
||||
{
|
||||
//DateTime date = DateTime.Now;
|
||||
//int result = (from x in Funs.DB.EduTrain_TrainRecord
|
||||
// join y in Funs.DB.Base_TrainType on x.TrainTypeId equals y.TrainTypeId
|
||||
// where x.ProjectId == projectid && x.TrainStartDate.Value.Year == date.Year && x.TrainStartDate.Value.Month == date.Month && x.TrainStartDate.Value.Day == date.Day && y.TrainType == "1"
|
||||
// select x).Count();
|
||||
return 0;
|
||||
DateTime date = DateTime.Now;
|
||||
int result = (from x in Funs.DB.EduTrain_TrainRecord
|
||||
join y in Funs.DB.Base_TrainType on x.TrainTypeId equals y.TrainTypeId
|
||||
where x.ProjectId == projectid && x.TrainStartDate.Value.Year == date.Year && x.TrainStartDate.Value.Month == date.Month && x.TrainStartDate.Value.Day == date.Day && y.TrainType == "1"
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取专项培训数
|
||||
@@ -729,12 +740,12 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetSpecialTrainNum(string projectid)
|
||||
{
|
||||
//DateTime date = DateTime.Now;
|
||||
//int result = (from x in Funs.DB.EduTrain_TrainRecord
|
||||
// join y in Funs.DB.Base_TrainType on x.TrainTypeId equals y.TrainTypeId
|
||||
// where x.ProjectId == projectid && x.TrainStartDate.Value.Year == date.Year && x.TrainStartDate.Value.Month == date.Month && x.TrainStartDate.Value.Day == date.Day && y.TrainType == "2"
|
||||
// select x).Count();
|
||||
return 0;
|
||||
DateTime date = DateTime.Now;
|
||||
int result = (from x in Funs.DB.EduTrain_TrainRecord
|
||||
join y in Funs.DB.Base_TrainType on x.TrainTypeId equals y.TrainTypeId
|
||||
where x.ProjectId == projectid && x.TrainStartDate.Value.Year == date.Year && x.TrainStartDate.Value.Month == date.Month && x.TrainStartDate.Value.Day == date.Day && y.TrainType == "2"
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取特种作业培训数
|
||||
@@ -742,12 +753,12 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetSpecialOperationTrainNum(string projectid)
|
||||
{
|
||||
//DateTime date = DateTime.Now;
|
||||
//int result = (from x in Funs.DB.EduTrain_TrainRecord
|
||||
// join y in Funs.DB.Base_TrainType on x.TrainTypeId equals y.TrainTypeId
|
||||
// where x.ProjectId == projectid && x.TrainStartDate.Value.Year == date.Year && x.TrainStartDate.Value.Month == date.Month && x.TrainStartDate.Value.Day == date.Day && y.TrainType == "3"
|
||||
// select x).Count();
|
||||
return 0;
|
||||
DateTime date = DateTime.Now;
|
||||
int result = (from x in Funs.DB.EduTrain_TrainRecord
|
||||
join y in Funs.DB.Base_TrainType on x.TrainTypeId equals y.TrainTypeId
|
||||
where x.ProjectId == projectid && x.TrainStartDate.Value.Year == date.Year && x.TrainStartDate.Value.Month == date.Month && x.TrainStartDate.Value.Day == date.Day && y.TrainType == "3"
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取能耗总量
|
||||
@@ -818,10 +829,10 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetProjectInspectorGeneralNum(string projectid)
|
||||
{
|
||||
//int result = (from x in Funs.DB.SitePerson_Person
|
||||
// where x.ProjectId == projectid && x.WorkPostId == BLL.Const.WorkPost_ProjectHSSEDirector && x.IsUsed == true
|
||||
// select x).Count();
|
||||
return 0;
|
||||
int result = (from x in Funs.DB.SitePerson_Person
|
||||
where x.ProjectId == projectid && x.WorkPostId == BLL.Const.WorkPost_ProjectHSSEDirector && x.IsUsed == true
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取项目专职人数
|
||||
@@ -841,10 +852,10 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetProjectSafetyMonitorNum(string projectid)
|
||||
{
|
||||
//int result = (from x in Funs.DB.SitePerson_Person
|
||||
// where x.ProjectId == projectid && x.IsSafetyMonitoring == true && x.IsUsed == true
|
||||
// select x).Count();
|
||||
return 0;
|
||||
int result = (from x in Funs.DB.SitePerson_Person
|
||||
where x.ProjectId == projectid && x.IsSafetyMonitoring == true && x.IsUsed == true
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取在岗执业注安师
|
||||
@@ -852,11 +863,11 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetSafetyInjectionEngineer(string projectid)
|
||||
{
|
||||
//int result = (from x in Funs.DB.SitePerson_Person
|
||||
// join y in Funs.DB.Base_Certificate on x.CertificateId equals y.CertificateId
|
||||
// where x.ProjectId == projectid && y.IsRegisterHSSE == true && x.IsUsed == true
|
||||
// select x).Count();
|
||||
return 0;
|
||||
int result = (from x in Funs.DB.SitePerson_Person
|
||||
join y in Funs.DB.Base_Certificate on x.CertificateId equals y.CertificateId
|
||||
where x.ProjectId == projectid && y.IsRegisterHSSE == true && x.IsUsed == true
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取A证人员
|
||||
@@ -864,11 +875,11 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetCertificateANum(string projectid)
|
||||
{
|
||||
//int result = (from x in Funs.DB.SitePerson_Person
|
||||
// join y in Funs.DB.Base_Certificate on x.CertificateId equals y.CertificateId
|
||||
// where x.ProjectId == projectid && y.CertificateType == "A" && x.IsUsed == true
|
||||
// select x).Count();
|
||||
return 0;
|
||||
int result = (from x in Funs.DB.SitePerson_Person
|
||||
join y in Funs.DB.Base_Certificate on x.CertificateId equals y.CertificateId
|
||||
where x.ProjectId == projectid && y.CertificateType == "A" && x.IsUsed == true
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取B证人员
|
||||
@@ -876,11 +887,11 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetCertificateBNum(string projectid)
|
||||
{
|
||||
//int result = (from x in Funs.DB.SitePerson_Person
|
||||
// join y in Funs.DB.Base_Certificate on x.CertificateId equals y.CertificateId
|
||||
// where x.ProjectId == projectid && y.CertificateType == "B" && x.IsUsed == true
|
||||
// select x).Count();
|
||||
return 0;
|
||||
int result = (from x in Funs.DB.SitePerson_Person
|
||||
join y in Funs.DB.Base_Certificate on x.CertificateId equals y.CertificateId
|
||||
where x.ProjectId == projectid && y.CertificateType == "B" && x.IsUsed == true
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取C证人员
|
||||
@@ -888,11 +899,11 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetCertificateCNum(string projectid)
|
||||
{
|
||||
//int result = (from x in Funs.DB.SitePerson_Person
|
||||
// join y in Funs.DB.Base_Certificate on x.CertificateId equals y.CertificateId
|
||||
// where x.ProjectId == projectid && y.CertificateType == "C" && x.IsUsed == true
|
||||
// select x).Count();
|
||||
return 0;
|
||||
int result = (from x in Funs.DB.SitePerson_Person
|
||||
join y in Funs.DB.Base_Certificate on x.CertificateId equals y.CertificateId
|
||||
where x.ProjectId == projectid && y.CertificateType == "C" && x.IsUsed == true
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取企业安委会会议数
|
||||
@@ -999,7 +1010,7 @@ namespace BLL
|
||||
DateTime date = DateTime.Now;
|
||||
int result = (from x in Funs.DB.Accident_AccidentPersonRecord
|
||||
join y in Funs.DB.Base_AccidentType on x.AccidentTypeId equals y.AccidentTypeId
|
||||
where x.ProjectId == projectid && x.AccidentDate.Year == date.Year && x.AccidentDate.Month == date.Month && x.AccidentDate.Day == date.Day && y.AccidentTypeName.Contains("未遂")
|
||||
where x.ProjectId == projectid && x.AccidentDate.Year == date.Year && x.AccidentDate.Month == date.Month && x.AccidentDate.Day == date.Day && x.IsAttempt=="1"
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
@@ -1012,7 +1023,7 @@ namespace BLL
|
||||
DateTime date = DateTime.Now;
|
||||
int result = (from x in Funs.DB.Accident_AccidentPersonRecord
|
||||
join y in Funs.DB.Base_AccidentType on x.AccidentTypeId equals y.AccidentTypeId
|
||||
where x.ProjectId == projectid && x.AccidentDate.Year == date.Year && x.AccidentDate.Month == date.Month && x.AccidentDate.Day == date.Day && !y.AccidentTypeName.Contains("未遂")
|
||||
where x.ProjectId == projectid && x.AccidentDate.Year == date.Year && x.AccidentDate.Month == date.Month && x.AccidentDate.Day == date.Day && x.IsAttempt != "1"
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
@@ -1022,9 +1033,9 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetGeneralAccidentNum(string projectid)
|
||||
{
|
||||
//DateTime date = DateTime.Now;
|
||||
//int result = (from x in Funs.DB.Accident_AccidentReport where x.ProjectId == projectid && x.AccidentDate.Value.Year == date.Year && x.AccidentDate.Value.Month == date.Month && x.AccidentDate.Value.Day == date.Day && x.AccidentDegree == "1" select x).Count();
|
||||
return 0;
|
||||
DateTime date = DateTime.Now;
|
||||
int result = (from x in Funs.DB.Accident_AccidentReport where x.ProjectId == projectid && x.AccidentDate.Value.Year == date.Year && x.AccidentDate.Value.Month == date.Month && x.AccidentDate.Value.Day == date.Day && x.AccidentDegree == "1" select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取较大事故数
|
||||
@@ -1032,9 +1043,9 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetMajorAccidentNum(string projectid)
|
||||
{
|
||||
//DateTime date = DateTime.Now;
|
||||
//int result = (from x in Funs.DB.Accident_AccidentReport where x.ProjectId == projectid && x.AccidentDate.Value.Year == date.Year && x.AccidentDate.Value.Month == date.Month && x.AccidentDate.Value.Day == date.Day && x.AccidentDegree == "2" select x).Count();
|
||||
return 0;
|
||||
DateTime date = DateTime.Now;
|
||||
int result = (from x in Funs.DB.Accident_AccidentReport where x.ProjectId == projectid && x.AccidentDate.Value.Year == date.Year && x.AccidentDate.Value.Month == date.Month && x.AccidentDate.Value.Day == date.Day && x.AccidentDegree == "2" select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取重大事故数
|
||||
@@ -1042,9 +1053,9 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetSeriousAccidentNum(string projectid)
|
||||
{
|
||||
//DateTime date = DateTime.Now;
|
||||
//int result = (from x in Funs.DB.Accident_AccidentReport where x.ProjectId == projectid && x.AccidentDate.Value.Year == date.Year && x.AccidentDate.Value.Month == date.Month && x.AccidentDate.Value.Day == date.Day && x.AccidentDegree == "3" select x).Count();
|
||||
return 0;
|
||||
DateTime date = DateTime.Now;
|
||||
int result = (from x in Funs.DB.Accident_AccidentReport where x.ProjectId == projectid && x.AccidentDate.Value.Year == date.Year && x.AccidentDate.Value.Month == date.Month && x.AccidentDate.Value.Day == date.Day && x.AccidentDegree == "3" select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取特别重大事故数
|
||||
@@ -1052,9 +1063,9 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetSpecialSeriousAccidentNum(string projectid)
|
||||
{
|
||||
//DateTime date = DateTime.Now;
|
||||
//int result = (from x in Funs.DB.Accident_AccidentReport where x.ProjectId == projectid && x.AccidentDate.Value.Year == date.Year && x.AccidentDate.Value.Month == date.Month && x.AccidentDate.Value.Day == date.Day && x.AccidentDegree == "4" select x).Count();
|
||||
return 0;
|
||||
DateTime date = DateTime.Now;
|
||||
int result = (from x in Funs.DB.Accident_AccidentReport where x.ProjectId == projectid && x.AccidentDate.Value.Year == date.Year && x.AccidentDate.Value.Month == date.Month && x.AccidentDate.Value.Day == date.Day && x.AccidentDegree == "4" select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取企业级综合预案数
|
||||
@@ -1171,15 +1182,15 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetUseEquipmentNum(string projectid)
|
||||
{
|
||||
//int result = (from x in Funs.DB.InApproveManager_EquipmentInItem
|
||||
// join y in Funs.DB.InApproveManager_EquipmentIn on x.EquipmentInId equals y.EquipmentInId
|
||||
// where y.ProjectId == projectid && x.IsUsed == true
|
||||
// select x).Count() +
|
||||
// (from x in Funs.DB.InApproveManager_GeneralEquipmentInItem
|
||||
// join y in Funs.DB.InApproveManager_GeneralEquipmentIn on x.GeneralEquipmentInId equals y.GeneralEquipmentInId
|
||||
// where y.ProjectId == projectid && x.IsUsed == true
|
||||
// select x).Count();
|
||||
return 0;
|
||||
int result = (from x in Funs.DB.InApproveManager_EquipmentInItem
|
||||
join y in Funs.DB.InApproveManager_EquipmentIn on x.EquipmentInId equals y.EquipmentInId
|
||||
where y.ProjectId == projectid && x.IsUsed == true
|
||||
select x).Count() +
|
||||
(from x in Funs.DB.InApproveManager_GeneralEquipmentInItem
|
||||
join y in Funs.DB.InApproveManager_GeneralEquipmentIn on x.GeneralEquipmentInId equals y.GeneralEquipmentInId
|
||||
where y.ProjectId == projectid && x.IsUsed == true
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取施工机具特种设备数
|
||||
@@ -1187,11 +1198,11 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetSpecialEquipmentNum(string projectid)
|
||||
{
|
||||
//int result = (from x in Funs.DB.InApproveManager_EquipmentInItem
|
||||
// join y in Funs.DB.InApproveManager_EquipmentIn on x.EquipmentInId equals y.EquipmentInId
|
||||
// where y.ProjectId == projectid && x.IsUsed == true
|
||||
// select x).Count();
|
||||
return 0;
|
||||
int result = (from x in Funs.DB.InApproveManager_EquipmentInItem
|
||||
join y in Funs.DB.InApproveManager_EquipmentIn on x.EquipmentInId equals y.EquipmentInId
|
||||
where y.ProjectId == projectid && x.IsUsed == true
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取作业许可项数
|
||||
@@ -1199,10 +1210,10 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetLicensesNum(string projectid)
|
||||
{
|
||||
//int result = (from x in Funs.DB.License_LicenseManager
|
||||
// where x.ProjectId == projectid && x.IsHighRisk == true
|
||||
// select x).Count();
|
||||
return 0;
|
||||
int result = (from x in Funs.DB.License_LicenseManager
|
||||
where x.ProjectId == projectid && x.IsHighRisk == true
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取作业许可关闭项数
|
||||
@@ -1210,10 +1221,10 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetLicensesCloseNum(string projectid)
|
||||
{
|
||||
//int result = (from x in Funs.DB.License_LicenseManager
|
||||
// where x.ProjectId == projectid && x.IsHighRisk == true && x.WorkStates == "3"
|
||||
// select x).Count();
|
||||
return 0;
|
||||
int result = (from x in Funs.DB.License_LicenseManager
|
||||
where x.ProjectId == projectid && x.IsHighRisk == true && x.WorkStates == "3"
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取一般隐患整改闭环项
|
||||
@@ -1269,11 +1280,11 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetGeneralRiskNum(string projectid)
|
||||
{
|
||||
//int result = (from x in Funs.DB.Hazard_HazardSelectedItem
|
||||
// join y in Funs.DB.Base_RiskLevel on x.HazardLevel equals y.RiskLevelId
|
||||
// where x.ProjectId == projectid && y.RiskLevel == 2 && x.IsStart == true
|
||||
// select x).Count();
|
||||
return 0;
|
||||
int result = (from x in Funs.DB.Hazard_HazardSelectedItem
|
||||
join y in Funs.DB.Base_RiskLevel on x.HazardLevel equals y.RiskLevelId
|
||||
where x.ProjectId == projectid && y.RiskLevel == 2 && x.IsStart == true
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取低风险数
|
||||
@@ -1281,11 +1292,11 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetLowRiskNum(string projectid)
|
||||
{
|
||||
//int result = (from x in Funs.DB.Hazard_HazardSelectedItem
|
||||
// join y in Funs.DB.Base_RiskLevel on x.HazardLevel equals y.RiskLevelId
|
||||
// where x.ProjectId == projectid && y.RiskLevel == 1 && x.IsStart == true
|
||||
// select x).Count();
|
||||
return 0;
|
||||
int result = (from x in Funs.DB.Hazard_HazardSelectedItem
|
||||
join y in Funs.DB.Base_RiskLevel on x.HazardLevel equals y.RiskLevelId
|
||||
where x.ProjectId == projectid && y.RiskLevel == 1 && x.IsStart == true
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取中风险数
|
||||
@@ -1293,11 +1304,11 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetMediumRiskNum(string projectid)
|
||||
{
|
||||
//int result = (from x in Funs.DB.Hazard_HazardSelectedItem
|
||||
// join y in Funs.DB.Base_RiskLevel on x.HazardLevel equals y.RiskLevelId
|
||||
// where x.ProjectId == projectid && y.RiskLevel == 3 && x.IsStart == true
|
||||
// select x).Count();
|
||||
return 0;
|
||||
int result = (from x in Funs.DB.Hazard_HazardSelectedItem
|
||||
join y in Funs.DB.Base_RiskLevel on x.HazardLevel equals y.RiskLevelId
|
||||
where x.ProjectId == projectid && y.RiskLevel == 3 && x.IsStart == true
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取高风险数
|
||||
@@ -1305,11 +1316,11 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetHighRiskNum(string projectid)
|
||||
{
|
||||
//int result = (from x in Funs.DB.Hazard_HazardSelectedItem
|
||||
// join y in Funs.DB.Base_RiskLevel on x.HazardLevel equals y.RiskLevelId
|
||||
// where x.ProjectId == projectid && y.RiskLevel == 4 && x.IsStart == true
|
||||
// select x).Count();
|
||||
return 0;
|
||||
int result = (from x in Funs.DB.Hazard_HazardSelectedItem
|
||||
join y in Funs.DB.Base_RiskLevel on x.HazardLevel equals y.RiskLevelId
|
||||
where x.ProjectId == projectid && y.RiskLevel == 4 && x.IsStart == true
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取危大工程审批完成数
|
||||
@@ -1317,10 +1328,10 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetCompletedNum(string projectid)
|
||||
{
|
||||
//int result = (from x in Funs.DB.Solution_LargerHazard
|
||||
// where x.ProjectId == projectid && x.States == "1" && x.IsSuperLargerHazard == false
|
||||
// select x).Count();
|
||||
return 0;
|
||||
int result = (from x in Funs.DB.Solution_LargerHazard
|
||||
where x.ProjectId == projectid && x.States == "1" && x.IsSuperLargerHazard == false
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取危大工程培训人次数
|
||||
@@ -1328,10 +1339,10 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetTrainPersonNum(string projectid)
|
||||
{
|
||||
//int result = (from x in Funs.DB.Solution_LargerHazard
|
||||
// where x.ProjectId == projectid && x.IsSuperLargerHazard == false
|
||||
// select x.TrainPersonNum ).ToList().Sum(x=>x.Value);
|
||||
return 0;
|
||||
int result = (from x in Funs.DB.Solution_LargerHazard
|
||||
where x.ProjectId == projectid && x.IsSuperLargerHazard == false
|
||||
select x.TrainPersonNum ).ToList().Sum(x=>x.Value);
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取危大工程施工个数
|
||||
@@ -1339,10 +1350,10 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetConstructionNum(string projectid)
|
||||
{
|
||||
//int result = (from x in Funs.DB.Solution_LargerHazard
|
||||
// where x.ProjectId == projectid && x.States == "2" && x.IsSuperLargerHazard == false
|
||||
// select x).Count();
|
||||
return 0;
|
||||
int result = (from x in Funs.DB.Solution_LargerHazard
|
||||
where x.ProjectId == projectid && x.States == "2" && x.IsSuperLargerHazard == false
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取危大工程完工个数
|
||||
@@ -1350,10 +1361,10 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetFinishedNum(string projectid)
|
||||
{
|
||||
//int result = (from x in Funs.DB.Solution_LargerHazard
|
||||
// where x.ProjectId == projectid && x.States == "3" && x.IsSuperLargerHazard == false
|
||||
// select x).Count();
|
||||
return 0;
|
||||
int result = (from x in Funs.DB.Solution_LargerHazard
|
||||
where x.ProjectId == projectid && x.States == "3" && x.IsSuperLargerHazard == false
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取超危大工程审批完成数
|
||||
@@ -1361,10 +1372,10 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetSuperCompletedNum(string projectid)
|
||||
{
|
||||
//int result = (from x in Funs.DB.Solution_LargerHazard
|
||||
// where x.ProjectId == projectid && x.States == "1" && x.IsSuperLargerHazard == true
|
||||
// select x).Count();
|
||||
return 0;
|
||||
int result = (from x in Funs.DB.Solution_LargerHazard
|
||||
where x.ProjectId == projectid && x.States == "1" && x.IsSuperLargerHazard == true
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取超危大工程培训人次数
|
||||
@@ -1372,8 +1383,8 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetSuperTrainPersonNum(string projectid)
|
||||
{
|
||||
//int result = (from x in Funs.DB.Solution_LargerHazard where x.ProjectId == projectid && x.IsSuperLargerHazard == true select x.TrainPersonNum).ToList().Sum(x => x.Value);
|
||||
return 0;
|
||||
int result = (from x in Funs.DB.Solution_LargerHazard where x.ProjectId == projectid && x.IsSuperLargerHazard == true select x.TrainPersonNum).ToList().Sum(x => x.Value);
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取超危大工程施工个数
|
||||
@@ -1381,10 +1392,10 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetSuperConstructionNum(string projectid)
|
||||
{
|
||||
//int result = (from x in Funs.DB.Solution_LargerHazard
|
||||
// where x.ProjectId == projectid && x.States == "2" && x.IsSuperLargerHazard == true
|
||||
// select x).Count();
|
||||
return 0;
|
||||
int result = (from x in Funs.DB.Solution_LargerHazard
|
||||
where x.ProjectId == projectid && x.States == "2" && x.IsSuperLargerHazard == true
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取超危大工程完工个数
|
||||
@@ -1392,10 +1403,10 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetSuperFinishedNum(string projectid)
|
||||
{
|
||||
//int result = (from x in Funs.DB.Solution_LargerHazard
|
||||
// where x.ProjectId == projectid && x.States == "3" && x.IsSuperLargerHazard == true
|
||||
// select x).Count();
|
||||
return 0;
|
||||
int result = (from x in Funs.DB.Solution_LargerHazard
|
||||
where x.ProjectId == projectid && x.States == "3" && x.IsSuperLargerHazard == true
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+40
-34
@@ -210,40 +210,46 @@ namespace BLL
|
||||
/// <param name="projectid"></param>
|
||||
public static void StatisticalData(string projectid)
|
||||
{
|
||||
//var base_Unit = BLL.UnitService.GetUnitByUnitId(BLL.Const.UnitId_CWCEC);
|
||||
//DateTime date = DateTime.Now;
|
||||
//Model.SGGLDB db = Funs.DB;
|
||||
//var list = from x in db.Check_RectifyNoticesItem
|
||||
// join y in db.Check_RectifyNotices on x.RectifyNoticesId equals y.RectifyNoticesId
|
||||
// where y.ProjectId == projectid && y.CheckedDate.Value.Year == date.Year && y.CheckedDate.Value.Month == date.Month && y.CheckedDate.Value.Day == date.Day
|
||||
// select x;
|
||||
//var types = (from x in db.Technique_Rectify
|
||||
// join y in list on x.RectifyId equals y.RectifyId
|
||||
// select new { x.RectifyId, x.RectifyName }).Distinct().ToList();
|
||||
//foreach (var type in types)
|
||||
//{
|
||||
// Model.Project_HSSEData_HiddenDangerDetail table = new Model.Project_HSSEData_HiddenDangerDetail
|
||||
// {
|
||||
// UnitId = BLL.Const.UnitId_CWCEC,
|
||||
// CollCropCode = base_Unit.CollCropCode,
|
||||
// UnitName = base_Unit.UnitName,
|
||||
// ProjectId = projectid,
|
||||
// ReportDate = DateTime.Now.Date,
|
||||
// TypeName = type.RectifyName,
|
||||
// TotalNum = list.Count(x => x.RectifyId == type.RectifyId),
|
||||
// NeedRectifyNum = list.Count(x => x.RectifyId == type.RectifyId && (x.IsRectify == null || x.IsRectify == false)),
|
||||
// };
|
||||
// if (IsReportByToday(projectid, type.RectifyName))
|
||||
// {
|
||||
// table.Id = GetTodayModelByProjectAndType(projectid, type.RectifyName).Id;
|
||||
// UpdateProject_HSSEData_HiddenDangerDetail(table);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// table.Id = SQLHelper.GetNewID();
|
||||
// AddProject_HSSEData_HiddenDangerDetail(table);
|
||||
// }
|
||||
//}
|
||||
string thisUnitId = string.Empty;
|
||||
var thisUnit = Const.UnitId_CWCEC;
|
||||
if (thisUnit != null)
|
||||
{
|
||||
thisUnitId = thisUnit;
|
||||
}
|
||||
var base_Unit = BLL.UnitService.GetUnitByUnitId(thisUnitId);
|
||||
DateTime date = DateTime.Now;
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var list = from x in db.Check_RectifyNoticesItem
|
||||
join y in db.Check_RectifyNotices on x.RectifyNoticesId equals y.RectifyNoticesId
|
||||
where y.ProjectId == projectid && y.CheckedDate.Value.Year == date.Year && y.CheckedDate.Value.Month == date.Month && y.CheckedDate.Value.Day == date.Day
|
||||
select x;
|
||||
var types = (from x in db.Technique_Rectify
|
||||
join y in list on x.RectifyId equals y.RectifyId
|
||||
select new { x.RectifyId, x.RectifyName }).Distinct().ToList();
|
||||
foreach (var type in types)
|
||||
{
|
||||
Model.Project_HSSEData_HiddenDangerDetail table = new Model.Project_HSSEData_HiddenDangerDetail
|
||||
{
|
||||
UnitId = thisUnitId,
|
||||
CollCropCode = base_Unit.CollCropCode,
|
||||
UnitName = base_Unit.UnitName,
|
||||
ProjectId = projectid,
|
||||
ReportDate = DateTime.Now.Date,
|
||||
TypeName = type.RectifyName,
|
||||
TotalNum = list.Count(x => x.RectifyId == type.RectifyId),
|
||||
NeedRectifyNum = list.Count(x => x.RectifyId == type.RectifyId && (x.IsRectify == null || x.IsRectify == false)),
|
||||
};
|
||||
if (IsReportByToday(projectid, type.RectifyName))
|
||||
{
|
||||
table.Id = GetTodayModelByProjectAndType(projectid, type.RectifyName).Id;
|
||||
UpdateProject_HSSEData_HiddenDangerDetail(table);
|
||||
}
|
||||
else
|
||||
{
|
||||
table.Id = SQLHelper.GetNewID();
|
||||
AddProject_HSSEData_HiddenDangerDetail(table);
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取类别名称
|
||||
|
||||
@@ -297,7 +297,12 @@ namespace BLL
|
||||
/// <param name="sYHSESDateType"></param>
|
||||
public static void StatisticalData(string projectid,SYHSESDateType sYHSESDateType)
|
||||
{
|
||||
string thisUnitId = BLL.Const.UnitId_CWCEC;
|
||||
string thisUnitId = string.Empty;
|
||||
var thisUnit = Const.UnitId_CWCEC;
|
||||
if (thisUnit != null)
|
||||
{
|
||||
thisUnitId = thisUnit;
|
||||
}
|
||||
var base_Unit = BLL.UnitService.GetUnitByUnitId(thisUnitId);
|
||||
Model.Project_SYHSEData_SYHSE table = new Model.Project_SYHSEData_SYHSE();
|
||||
if (IsReportByToday(projectid))
|
||||
|
||||
Reference in New Issue
Block a user