五环二期集团数据对接

This commit is contained in:
2025-06-19 16:55:10 +08:00
parent 5ed020c7e1
commit 0736adf719
105 changed files with 14375 additions and 1224 deletions
@@ -61,6 +61,10 @@ namespace BLL
/// </summary>
SpecialEquipmentAndDesignDetails,
/// <summary>
/// 设备报验报检
/// </summary>
InspectionMachineEquipment,
/// <summary>
/// 全部数据
/// </summary>
All
@@ -181,11 +185,15 @@ namespace BLL
ReportDate = newtable.ReportDate,
TrainPersonNum = newtable.TrainPersonNum,
TechnicalDisclosePersonNum = newtable.TechnicalDisclosePersonNum,
ComprehensiveReviewDrawingsNum = newtable.ComprehensiveReviewDrawingsNum,
ComprehensiveConTechnologyDisclosureNum = newtable.ComprehensiveConTechnologyDisclosureNum,
ComprehensiveConTechnologyDisclosurePersonNum = newtable.ComprehensiveConTechnologyDisclosurePersonNum,
UseNum = newtable.UseNum,
OKNum = newtable.OKNum,
CompanyPersonNum = newtable.CompanyPersonNum,
BranchPersonNum = newtable.BranchPersonNum,
ProjectPersonNum = newtable.ProjectPersonNum,
ProjectSubPersonNum = newtable.ProjectSubPersonNum,
ProblemNum = newtable.ProblemNum,
ProblemCompletedNum = newtable.ProblemCompletedNum,
ProblemNotCompletedNum = newtable.ProblemNotCompletedNum,
@@ -226,7 +234,9 @@ namespace BLL
SubProjectAcceptNum = newtable.SubProjectAcceptNum,
SubProjectAcceptOKNum = newtable.SubProjectAcceptOKNum,
SubdivisionalWorksAcceptNum = newtable.SubdivisionalWorksAcceptNum,
SubdivisionalWorksAcceptOKNum = newtable.SubdivisionalWorksAcceptOKNum
SubdivisionalWorksAcceptOKNum = newtable.SubdivisionalWorksAcceptOKNum,
InspectionMachineNum = newtable.InspectionMachineNum,
InspectionMachineQualifiedNum = newtable.InspectionMachineQualifiedNum,
};
db.Project_CQMSData_CQMS.InsertOnSubmit(table);
db.SubmitChanges();
@@ -252,11 +262,15 @@ namespace BLL
table.ReportDate = newtable.ReportDate;
table.TrainPersonNum = newtable.TrainPersonNum;
table.TechnicalDisclosePersonNum = newtable.TechnicalDisclosePersonNum;
table.ComprehensiveConTechnologyDisclosureNum = newtable.ComprehensiveConTechnologyDisclosureNum;
table.ComprehensiveConTechnologyDisclosurePersonNum = newtable.ComprehensiveConTechnologyDisclosurePersonNum;
table.ComprehensiveReviewDrawingsNum = newtable.ComprehensiveReviewDrawingsNum;
table.UseNum = newtable.UseNum;
table.OKNum = newtable.OKNum;
table.CompanyPersonNum = newtable.CompanyPersonNum;
table.BranchPersonNum = newtable.BranchPersonNum;
table.ProjectPersonNum = newtable.ProjectPersonNum;
table.ProjectSubPersonNum = newtable.ProjectSubPersonNum;
table.ProblemNum = newtable.ProblemNum;
table.ProblemCompletedNum = newtable.ProblemCompletedNum;
table.ProblemNotCompletedNum = newtable.ProblemNotCompletedNum;
@@ -298,6 +312,8 @@ namespace BLL
table.SubProjectAcceptOKNum = newtable.SubProjectAcceptOKNum;
table.SubdivisionalWorksAcceptNum = newtable.SubdivisionalWorksAcceptNum;
table.SubdivisionalWorksAcceptOKNum = newtable.SubdivisionalWorksAcceptOKNum;
table.InspectionMachineNum = newtable.InspectionMachineNum;
table.InspectionMachineQualifiedNum = newtable.InspectionMachineQualifiedNum;
db.SubmitChanges();
}
}
@@ -495,6 +511,17 @@ namespace BLL
{
table.SpecialEquipmentQualityAssuranceSystemNum = GetSpecialEquipmentQualityAssuranceSystemNum(projectid);
table.DesignDetailsNum = GetTechnicalDisclosePersonNum(projectid);
table.ComprehensiveConTechnologyDisclosureNum = GetComprehensiveConTechnologyDisclosureNum(projectid);
table.ComprehensiveConTechnologyDisclosurePersonNum = GetComprehensiveConTechnologyDisclosurePersonNum(projectid);
table.ComprehensiveReviewDrawingsNum = GetComprehensiveReviewDrawings(projectid);
}
if (cQMSDateType == CQMSDateType.InspectionMachineEquipment || cQMSDateType == CQMSDateType.All)
{
//table.InspectionMachineNum = GetInspectionMachineEquipmentNum(projectid);
//table.InspectionMachineQualifiedNum = GetInspectionMachineEquipmentQualifiedNum(projectid);
table.InspectionMachineNum = GetComprehensiveInspectionEquipmentNum(projectid);
table.InspectionMachineQualifiedNum = GetComprehensiveInspectionEquipmentOKNum(projectid);
}
if (IsReportByToday(projectid))
@@ -519,7 +546,7 @@ namespace BLL
return result;
}
/// <summary>
/// 获取技术交底人次数
/// 获取设计交底人次数
/// </summary>
/// <returns></returns>
public static int GetTechnicalDisclosePersonNum(string projectid)
@@ -531,6 +558,40 @@ namespace BLL
return q;
}
/// <summary>
/// 获取施工技术交底数
/// </summary>
/// <returns></returns>
public static int GetComprehensiveConTechnologyDisclosureNum(string projectid)
{
var result = (from x in Funs.DB.Comprehensive_ConTechnologyDisclosure
where x.ProjectId == projectid && x.CompileDate > Const.DtmarkTime
select x).ToList().Count();
return result;
}
/// <summary>
/// 获取施工技术交底人数
/// </summary>
/// <returns></returns>
public static int GetComprehensiveConTechnologyDisclosurePersonNum(string projectid)
{
var result = (from x in Funs.DB.Comprehensive_ConTechnologyDisclosure
where x.ProjectId == projectid && x.CompileDate > Const.DtmarkTime
select x.DisclosurePersonNum).ToList().Sum(x => x.Value);
var q = Funs.GetNewIntOrZero(result.ToString());
return q;
}
/// <summary>
/// 获取图纸会审
/// </summary>
/// <returns></returns>
public static int GetComprehensiveReviewDrawings(string projectid)
{
var result = (from x in Funs.DB.Comprehensive_ReviewDrawings
where x.ProjectId == projectid && x.CreateDate > Const.DtmarkTime
select x).ToList().Count();
return result;
}
/// <summary>
/// 获取在用计量器具数
/// </summary>
/// <returns></returns>
@@ -876,7 +937,7 @@ namespace BLL
public static int GetComprehensiveInspectionEquipmentNum(string projectid)
{
int result = (from x in Funs.DB.Comprehensive_InspectionEquipment
where x.ProjectId == projectid && x.CompileDate > Const.DtmarkTime
where x.ProjectId == projectid && x.EquipmentOrMatail == "设备" && x.CompileDate > Const.DtmarkTime
select x).Count();
return result;
}
@@ -888,7 +949,7 @@ namespace BLL
public static int GetComprehensiveInspectionEquipmentOKNum(string projectid)
{
int result = (from x in Funs.DB.Comprehensive_InspectionEquipment
where x.ProjectId == projectid && x.SamplingResult == "1" && x.CompileDate > Const.DtmarkTime
where x.ProjectId == projectid && x.EquipmentOrMatail == "设备" && x.SamplingResult == "1" && x.CompileDate > Const.DtmarkTime
select x).Count();
return result;
}
@@ -949,7 +1010,9 @@ namespace BLL
/// <returns></returns>
public static int GetComprehensiveInspectionMaterialNum(string projectid)
{
var result = 0;
int result = (from x in Funs.DB.Comprehensive_InspectionEquipment
where x.ProjectId == projectid && x.EquipmentOrMatail == "材料" && x.CompileDate > Const.DtmarkTime
select x).Count();
return result;
}
@@ -959,7 +1022,9 @@ namespace BLL
/// <returns></returns>
public static int GetComprehensiveInspectionMaterialOKNum(string projectid)
{
var result = 0;
int result = (from x in Funs.DB.Comprehensive_InspectionEquipment
where x.ProjectId == projectid && x.EquipmentOrMatail == "材料" && x.SamplingResult == "1" && x.CompileDate > Const.DtmarkTime
select x).Count();
return result;
}
@@ -1040,5 +1105,348 @@ namespace BLL
}
#endregion
#region
/// <summary>
/// 推送项目质量巡检数据
/// </summary>
/// <returns></returns>
public static ReturnData PushProjectHazardRegisterData()
{
var thisUnit = CommonService.GetIsThisUnit();
Model.SGGLDB db = Funs.DB;
var items = (from x in db.View_Hazard_HazardRegister
where x.IsUpdate == null || x.IsUpdate == false
select new Model.Hazard_HazardRegisterItem
{
HazardRegisterId = x.HazardRegisterId,
SourceUnitId = thisUnit.UnitId,
RegisterDate = x.RegisterDate,
RegisterDef = x.RegisterDef,
Rectification = x.Rectification,
WorkAreaName = x.WorkAreaName,
ResponsibilityUnitName = x.ResponsibilityUnitName,
ResponsibilityUnitCollCropCode = x.ResponsibilityUnitCollCropCode,
Risk_Level = x.Risk_Level,
ProjectId = x.ProjectId,
ProjectName = x.ProjectName,
States = x.States,
StatesStr = x.StatesStr,
ResponsibilityManName = x.ResponsibilityManName,
CheckManName = x.CheckManName,
CheckTime = x.CheckTime,
RectificationPeriod = x.RectificationPeriod,
ImageUrl = x.ImageUrl,
ImageUrlFileContext = AttachFileService.GetMoreFileStructByAttachUrl(x.ImageUrl),
RectificationImageUrl = x.RectificationImageUrl,
RectificationImageUrlFileContext = AttachFileService.GetMoreFileStructByAttachUrl(x.RectificationImageUrl),
RectificationTime = x.RectificationTime,
ConfirmManName = x.ConfirmManName,
ConfirmDate = x.ConfirmDate,
HandleIdea = x.HandleIdea,
CutPayment = x.CutPayment,
CheckCycle = x.CheckCycle,
RegisterTypesName = x.RegisterTypesName,
Requirements = x.Requirements
}).ToList();
Model.ReturnData responeData = new Model.ReturnData();
if (items.Count() > 0)
{
var newItem = new { CollCropCode = thisUnit.CollCropCode, Items = items };
var str = JsonConvert.SerializeObject(newItem);
var baseurl = "/api/HSSEData/SaveProjectHazardRegisterData";
responeData = ServerService.PushCNCEC(str, baseurl);
if (responeData.code == 1)
{
var list = from x in db.HSSE_Hazard_HazardRegister
where x.IsUpdate == null || x.IsUpdate == false
select x;
foreach (var item in list)
{
item.IsUpdate = true;
}
db.SubmitChanges();
}
}
else
{
responeData.code = 0;
responeData.message = "当前没有项目质量巡检数据";
}
return responeData;
}
#endregion
#region
/// <summary>
/// 推送项目质量隐患数据
/// </summary>
/// <returns></returns>
public static ReturnData PushProjectQualityProblemData(int pushNum)
{
var thisUnit = CommonService.GetIsThisUnit();
Model.SGGLDB db = Funs.DB;
var items = (from x in db.Check_CheckControl
join unit in db.Base_Unit on x.UnitId equals unit.UnitId into unitJ
from unit in unitJ.DefaultIfEmpty()
join cNProfessional in db.Base_CNProfessional on x.CNProfessionalCode equals cNProfessional.CNProfessionalId into cNProfessionalJ
from cNProfessional in cNProfessionalJ.DefaultIfEmpty()
join unitWork in db.WBS_UnitWork on x.UnitWorkId equals unitWork.UnitWorkId into unitWorkJ
from unitWork in unitWorkJ.DefaultIfEmpty()
join QualityQuestionType in db.Base_QualityQuestionType on x.QuestionType equals QualityQuestionType.QualityQuestionTypeId
where (x.IsUpdate == null || x.IsUpdate == false) && x.CheckDate > BLL.Const.DtmarkTime
select new Model.QualityProblemItem
{
Id = x.CheckControlCode,
SourceUnitId = thisUnit.UnitId,
ProjectId = x.ProjectId,
CollCropCode = thisUnit.CollCropCode,
DataDate = x.CheckDate,
CheckDate = x.CheckDate,
UnitWorkName = unitWork.UnitWorkName + (unitWork.ProjectType == "1" ? "(建筑)" : "(安装)"),
UnitName = unit.UnitName,
ProfessionalName = cNProfessional.ProfessionalName,
QuestionType = QualityQuestionType.QualityQuestionType,
ImageUrl = AttachFileService.getFileUrl(x.CheckControlCode.ToString()),
RectificationImageUrl = AttachFileService.getFileUrl(x.CheckControlCode.ToString() + "r"),
CheckSite = x.CheckSite,
States = x.State,
StatesStr = x.State == "5" || x.State == "6" ? "未确认" :
x.State == "7" ? "已闭环" :
Convert.ToDateTime(x.LimitDate).AddDays(1) < DateTime.Now ? "超期未整改" : "未整改",
}).Take(pushNum).ToList();
Model.ReturnData responeData = new Model.ReturnData();
if (items.Count() > 0)
{
var newItem = new { CollCropCode = thisUnit.CollCropCode, Items = items };
var str = JsonConvert.SerializeObject(newItem);
var baseurl = "/api/CQMSData/SaveProjectQualityProblemData";
responeData = ServerService.PushCNCEC(str, baseurl);
if (responeData.code == 1)
{
foreach (var item in items)
{
var data = db.Check_CheckControl.FirstOrDefault(x =>
x.CheckControlCode == item.Id && (x.IsUpdate == null || x.IsUpdate == false));
data.IsUpdate = true;
db.SubmitChanges();
}
}
}
else
{
responeData.code = 0;
responeData.message = "当前没有项目质量隐患数据";
}
return responeData;
}
#endregion
#region
/// <summary>
/// 删除项目质量隐患数据
/// </summary>
/// <returns></returns>
public static ReturnData DeleteProjectQualityProblemData(string Id)
{
Model.ReturnData responeData = new Model.ReturnData();
try
{
var thisUnit = CommonService.GetIsThisUnit();
Model.SGGLDB db = Funs.DB;
var items = (from x in db.Check_CheckControl
join unit in db.Base_Unit on x.UnitId equals unit.UnitId into unitJ
from unit in unitJ.DefaultIfEmpty()
join cNProfessional in db.Base_CNProfessional on x.CNProfessionalCode equals cNProfessional.CNProfessionalId into cNProfessionalJ
from cNProfessional in cNProfessionalJ.DefaultIfEmpty()
join unitWork in db.WBS_UnitWork on x.UnitWorkId equals unitWork.UnitWorkId into unitWorkJ
from unitWork in unitWorkJ.DefaultIfEmpty()
join QualityQuestionType in db.Base_QualityQuestionType on x.QuestionType equals QualityQuestionType.QualityQuestionTypeId
where x.CheckControlCode == Id
select new Model.QualityProblemItem
{
Id = x.CheckControlCode,
SourceUnitId = thisUnit.UnitId,
ProjectId = x.ProjectId,
CollCropCode = thisUnit.CollCropCode,
DataDate = x.CheckDate,
CheckDate = x.CheckDate,
UnitWorkName = unitWork.UnitWorkName + (unitWork.ProjectType == "1" ? "(建筑)" : "(安装)"),
UnitName = unit.UnitName,
ProfessionalName = cNProfessional.ProfessionalName,
QuestionType = QualityQuestionType.QualityQuestionType,
ImageUrl = AttachFileService.getFileUrl(x.CheckControlCode.ToString()),
RectificationImageUrl = AttachFileService.getFileUrl(x.CheckControlCode.ToString() + "r"),
CheckSite = x.CheckSite,
States = x.State,
StatesStr = x.State == "5" || x.State == "6" ? "未确认" :
x.State == "7" ? "已闭环" :
Convert.ToDateTime(x.LimitDate).AddDays(1) < DateTime.Now ? "超期未整改" : "未整改",
}).ToList();
if (items.Count() > 0)
{
var newItem = new { CollCropCode = thisUnit.CollCropCode, Items = items };
var str = JsonConvert.SerializeObject(newItem);
var baseurl = "/api/CQMSData/DeleteProjectQualityProblemData";
responeData = ServerService.PushCNCEC(str, baseurl);
}
else
{
responeData.code = 0;
responeData.message = "集团数据删除失败";
}
}
catch (Exception)
{
responeData.code = 0;
responeData.message = "集团数据删除失败";
}
return responeData;
}
#endregion
#region QC活动注册数据
/// <summary>
/// 推送质量QC活动注册数据
/// </summary>
/// <returns></returns>
public static ReturnData PushQCRegistrationData(int pushNum)
{
var thisUnit = CommonService.GetIsThisUnit();
Model.SGGLDB db = Funs.DB;
var items = (from x in db.QCManage_QCGroupRegistration
join unit in db.Base_Unit on x.UnitId equals unit.UnitId into unitJ
from u in unitJ.DefaultIfEmpty()
join s in db.Sys_User on x.CompileMan equals s.UserId into userJ
from s in userJ.DefaultIfEmpty()
where (x.IsUpdate == null || x.IsUpdate == false) && x.CompileDate > BLL.Const.DtmarkTime
select new Model.QCRegistrationItem
{
Id = x.QCGroupRegistrationId,
SourceUnitId = thisUnit.UnitId,
ProjectId = x.ProjectId,
CollCropCode = thisUnit.CollCropCode,
DataDate = x.CompileDate,
AttachFile = AttachFileService.getFileUrl(x.QCGroupRegistrationId.ToString()),
Code = x.Code,
Name = x.Name,
CompileManName = s.UserName,
CompileDate = x.CompileDate,
UnitName = u.UnitName,
UnitCollCropCode = Funs.DB.Base_Unit.FirstOrDefault(e => e.UnitId == x.UnitId).CollCropCode,
Subjects = x.Subjects,
Process = x.Process,
Achievement = x.Achievement,
AwardName = x.AwardName,
AwardType = x.AwardType,
AwardLevel = x.AwardLevel,
AwardingUnit = x.AwardingUnit,
}).Take(pushNum).ToList();
Model.ReturnData responeData = new Model.ReturnData();
if (items.Count() > 0)
{
var newItem = new { CollCropCode = thisUnit.CollCropCode, Items = items };
var str = JsonConvert.SerializeObject(newItem);
var baseurl = "/api/CQMSData/SaveQCRegistrationData";
responeData = ServerService.PushCNCEC(str, baseurl);
if (responeData.code == 1)
{
foreach (var item in items)
{
var data = db.QCManage_QCGroupRegistration.FirstOrDefault(x =>
x.QCGroupRegistrationId == item.Id && (x.IsUpdate == null || x.IsUpdate == false));
data.IsUpdate = true;
db.SubmitChanges();
}
}
}
else
{
responeData.code = 0;
responeData.message = "当前没有质量QC活动注册数据";
}
return responeData;
}
#endregion
#region QC活动注册数据
/// <summary>
/// 删除质量QC活动注册数据
/// </summary>
/// <returns></returns>
public static ReturnData DeleteQCRegistrationData(string Id)
{
Model.ReturnData responeData = new Model.ReturnData();
try
{
var thisUnit = CommonService.GetIsThisUnit();
Model.SGGLDB db = Funs.DB;
var items = (from x in db.QCManage_QCGroupRegistration
join unit in db.Base_Unit on x.UnitId equals unit.UnitId into unitJ
from u in unitJ.DefaultIfEmpty()
join s in db.Sys_User on x.CompileMan equals s.UserId into userJ
from s in userJ.DefaultIfEmpty()
where x.QCGroupRegistrationId == Id
select new Model.QCRegistrationItem
{
Id = x.QCGroupRegistrationId,
SourceUnitId = thisUnit.UnitId,
ProjectId = x.ProjectId,
CollCropCode = thisUnit.CollCropCode,
DataDate = x.CompileDate,
AttachFile = AttachFileService.getFileUrl(x.QCGroupRegistrationId.ToString()),
Code = x.Code,
Name = x.Name,
CompileManName = s.UserName,
CompileDate = x.CompileDate,
UnitName = u.UnitName,
UnitCollCropCode = Funs.DB.Base_Unit.FirstOrDefault(e => e.UnitId == x.UnitId).CollCropCode,
Subjects = x.Subjects,
Process = x.Process,
Achievement = x.Achievement,
AwardName = x.AwardName,
AwardLevel = x.AwardLevel,
AwardingUnit = x.AwardingUnit,
}).ToList();
if (items.Count() > 0)
{
var newItem = new { CollCropCode = thisUnit.CollCropCode, Items = items };
var str = JsonConvert.SerializeObject(newItem);
var baseurl = "/api/CQMSData/DeleteQCRegistrationData";
responeData = ServerService.PushCNCEC(str, baseurl);
}
else
{
responeData.code = 0;
responeData.message = "集团数据删除失败";
}
}
catch (Exception)
{
responeData.code = 0;
responeData.message = "集团数据删除失败";
}
return responeData;
}
#endregion
}
}
@@ -139,11 +139,13 @@ namespace BLL
BranchFullTimeNum = newtable.BranchFullTimeNum,
ProjectInspectorGeneralNum = newtable.ProjectInspectorGeneralNum,
ProjectFullTimeNum = newtable.ProjectFullTimeNum,
ProjectSubFullTimeNum = newtable.ProjectSubFullTimeNum,
ProjectSafetyMonitorNum = newtable.ProjectSafetyMonitorNum,
SafetyInjectionEngineer = newtable.SafetyInjectionEngineer,
CertificateANum = newtable.CertificateANum,
CertificateBNum = newtable.CertificateBNum,
CertificateCNum = newtable.CertificateCNum,
QualityPersonNum = newtable.QualityPersonNum,
SafetyCommitteeMeetingNum = newtable.SafetyCommitteeMeetingNum,
EnterpriseTopicsMeetingNum = newtable.EnterpriseTopicsMeetingNum,
ProjectSafetyLeadingGroupMeetingNum = newtable.ProjectSafetyLeadingGroupMeetingNum,
@@ -151,6 +153,9 @@ namespace BLL
CompanyLeadShiftCheckNum = newtable.CompanyLeadShiftCheckNum,
CompanyComprehensiveCheckNum = newtable.CompanyComprehensiveCheckNum,
CompanySpecialCheckNum = newtable.CompanySpecialCheckNum,
BranchLeadShiftCheckNum = newtable.BranchLeadShiftCheckNum,
BranchComprehensiveCheckNum = newtable.BranchComprehensiveCheckNum,
BranchSpecialCheckNum = newtable.BranchSpecialCheckNum,
ProjectLeadShiftCheckNum = newtable.ProjectLeadShiftCheckNum,
ProjectSpecialCheckNum = newtable.ProjectSpecialCheckNum,
ProjectMajorCheckNum = newtable.ProjectMajorCheckNum,
@@ -163,8 +168,13 @@ namespace BLL
CompanyComprehensivePlanNum = newtable.CompanyComprehensivePlanNum,
CompanySpecialPlanNum = newtable.CompanySpecialPlanNum,
CompanyOnSiteDisposalPlan = newtable.CompanyOnSiteDisposalPlan,
BranchComprehensivePlanNum = newtable.BranchComprehensivePlanNum,
BranchSpecialPlanNum = newtable.BranchSpecialPlanNum,
BranchOnSiteDisposalPlan = newtable.BranchOnSiteDisposalPlan,
CompanyDrillNum = newtable.CompanyDrillNum,
CompanyDrillPersonNum = newtable.CompanyDrillPersonNum,
BranchDrillNum = newtable.BranchDrillNum,
BranchDrillPersonNum = newtable.BranchDrillPersonNum,
ProjectComprehensivePlanNum = newtable.ProjectComprehensivePlanNum,
ProjectSpecialPlanNum = newtable.ProjectSpecialPlanNum,
ProjectOnSiteDisposalPlan = newtable.ProjectOnSiteDisposalPlan,
@@ -186,11 +196,13 @@ namespace BLL
HighRiskNum = newtable.HighRiskNum,
CompletedNum = newtable.CompletedNum,
TrainPersonNum = newtable.TrainPersonNum,
OperativesNum = newtable.OperativesNum,
ConstructionNum = newtable.ConstructionNum,
FinishedNum = newtable.FinishedNum,
ArgumentNum = newtable.ArgumentNum,
SuperCompletedNum = newtable.SuperCompletedNum,
SuperTrainPersonNum = newtable.SuperTrainPersonNum,
SuperOperativesNum = newtable.SuperOperativesNum,
SuperConstructionNum = newtable.SuperConstructionNum,
SuperFinishedNum = newtable.SuperFinishedNum,
SuperArgumentNum = newtable.SuperArgumentNum
@@ -200,6 +212,7 @@ namespace BLL
}
}
/// <summary>
/// 删除实体
/// </summary>
@@ -270,11 +283,13 @@ namespace BLL
table.BranchFullTimeNum = newtable.BranchFullTimeNum;
table.ProjectInspectorGeneralNum = newtable.ProjectInspectorGeneralNum;
table.ProjectFullTimeNum = newtable.ProjectFullTimeNum;
table.ProjectSubFullTimeNum = newtable.ProjectSubFullTimeNum;
table.ProjectSafetyMonitorNum = newtable.ProjectSafetyMonitorNum;
table.SafetyInjectionEngineer = newtable.SafetyInjectionEngineer;
table.CertificateANum = newtable.CertificateANum;
table.CertificateBNum = newtable.CertificateBNum;
table.CertificateCNum = newtable.CertificateCNum;
table.QualityPersonNum = newtable.QualityPersonNum;
table.SafetyCommitteeMeetingNum = newtable.SafetyCommitteeMeetingNum;
table.EnterpriseTopicsMeetingNum = newtable.EnterpriseTopicsMeetingNum;
table.ProjectSafetyLeadingGroupMeetingNum = newtable.ProjectSafetyLeadingGroupMeetingNum;
@@ -294,7 +309,13 @@ namespace BLL
table.CompanyComprehensivePlanNum = newtable.CompanyComprehensivePlanNum;
table.CompanySpecialPlanNum = newtable.CompanySpecialPlanNum;
table.CompanyOnSiteDisposalPlan = newtable.CompanyOnSiteDisposalPlan;
table.BranchComprehensivePlanNum = newtable.BranchComprehensivePlanNum;
table.BranchSpecialPlanNum = newtable.BranchSpecialPlanNum;
table.BranchOnSiteDisposalPlan = newtable.BranchOnSiteDisposalPlan;
table.CompanyDrillNum = newtable.CompanyDrillNum;
table.CompanyDrillPersonNum = newtable.CompanyDrillPersonNum;
table.BranchDrillNum = newtable.BranchDrillNum;
table.BranchDrillPersonNum = newtable.BranchDrillPersonNum;
table.ProjectComprehensivePlanNum = newtable.ProjectComprehensivePlanNum;
table.ProjectSpecialPlanNum = newtable.ProjectSpecialPlanNum;
table.ProjectOnSiteDisposalPlan = newtable.ProjectOnSiteDisposalPlan;
@@ -315,10 +336,12 @@ namespace BLL
table.HighRiskNum = newtable.HighRiskNum;
table.CompletedNum = newtable.CompletedNum;
table.TrainPersonNum = newtable.TrainPersonNum;
table.OperativesNum = newtable.OperativesNum;
table.ConstructionNum = newtable.ConstructionNum;
table.FinishedNum = newtable.FinishedNum;
table.SuperCompletedNum = newtable.SuperCompletedNum;
table.SuperTrainPersonNum = newtable.SuperTrainPersonNum;
table.SuperOperativesNum = newtable.SuperOperativesNum;
table.SuperConstructionNum = newtable.SuperConstructionNum;
table.SuperFinishedNum = newtable.SuperFinishedNum;
db.SubmitChanges();
@@ -457,6 +480,7 @@ namespace BLL
table.CertificateANum = GetCertificateANum(projectid);
table.CertificateBNum = GetCertificateBNum(projectid);
table.CertificateCNum = GetCertificateCNum(projectid);
table.QualityPersonNum = GetQualityPersonNum(projectid);
}
if (hSseDateType == HSSEDateType.SafetyMeeting || hSseDateType == HSSEDateType.All)
@@ -492,11 +516,18 @@ namespace BLL
table.CompanyComprehensivePlanNum = GetCompanyComprehensivePlanNum(projectid);
table.CompanySpecialPlanNum = GetCompanySpecialPlanNum(projectid);
table.CompanyOnSiteDisposalPlan = GetCompanyOnSiteDisposalPlan(projectid);
table.BranchComprehensivePlanNum = GetBranchComprehensivePlanNum(projectid);
table.BranchSpecialPlanNum = GetBranchSpecialPlanNum(projectid);
table.BranchOnSiteDisposalPlan = GetBranchOnSiteDisposalPlan(projectid);
table.CompanyDrillNum = GetCompanyDrillNum(projectid);
table.CompanyDrillPersonNum = GetCompanyDrillPersonNum(projectid);
table.BranchDrillNum = GetBranchDrillNum(projectid);
table.BranchDrillPersonNum = GetBranchDrillPersonNum(projectid);
table.ProjectComprehensivePlanNum = GetProjectComprehensivePlanNum(projectid);
table.ProjectSpecialPlanNum = GetProjectSpecialPlanNum(projectid);
table.ProjectOnSiteDisposalPlan = GetProjectOnSiteDisposalPlan(projectid);
table.ProjectDrillNum = GetProjectDrillNum(projectid);
table.ProjectDrillNum = GetProjectDrillNum(projectid);
}
if (hSseDateType == HSSEDateType.SecurityCost || hSseDateType == HSSEDateType.All)
@@ -579,10 +610,12 @@ namespace BLL
{
table.CompletedNum = GetCompletedNum(projectid);
table.TrainPersonNum = GetTrainPersonNum(projectid);
table.OperativesNum = GetOperativesNum(projectid);
table.ConstructionNum = GetConstructionNum(projectid);
table.FinishedNum = GetFinishedNum(projectid);
table.SuperCompletedNum = GetSuperCompletedNum(projectid);
table.SuperTrainPersonNum = GetSuperTrainPersonNum(projectid);
table.SuperOperativesNum = GetSuperOperativesNum(projectid);
table.SuperConstructionNum = GetSuperConstructionNum(projectid);
table.SuperFinishedNum = GetSuperFinishedNum(projectid);
}
@@ -903,6 +936,20 @@ namespace BLL
return result;
}
/// <summary>
/// 获取在岗特种作业人员数量
/// </summary>
/// <returns></returns>
public static int GetQualityPersonNum(string projectid)
{
var result = (from x in Funs.DB.SitePerson_Person
join y in Funs.DB.QualityAudit_PersonQuality on x.PersonId equals y.PersonId
join m in Funs.DB.Base_WorkPost on x.WorkPostId equals m.WorkPostId
where x.ProjectId == projectid && m.PostType == Const.PostType_2 && x.IsUsed == true && (y.LimitDate == null || y.LimitDate < DateTime.Now)
select x).Count();
return result;
}
/// <summary>
/// 获取企业安委会会议数
/// </summary>
@@ -1120,6 +1167,35 @@ namespace BLL
var result = 0;
return result;
}
/// <summary>
/// 获取分支机构综合预案数
/// </summary>
/// <returns></returns>
public static int GetBranchComprehensivePlanNum(string projectid)
{
var result = 0;
return result;
}
/// <summary>
/// 获取分支机构专项预案数
/// </summary>
/// <returns></returns>
public static int GetBranchSpecialPlanNum(string projectid)
{
var result = 0;
return result;
}
/// <summary>
/// 获取分支机构现场处置预案
/// </summary>
/// <returns></returns>
public static int GetBranchOnSiteDisposalPlan(string projectid)
{
var result = 0;
return result;
}
/// <summary>
/// 获取企业级演练次数
@@ -1130,6 +1206,33 @@ namespace BLL
var result = 0;
return result;
}
/// <summary>
/// 获取企业级演练人次数
/// </summary>
/// <returns></returns>
public static int GetCompanyDrillPersonNum(string projectid)
{
var result = 0;
return result;
}
/// <summary>
/// 获取分支机构演练次数
/// </summary>
/// <returns></returns>
public static int GetBranchDrillNum(string projectid)
{
var result = 0;
return result;
}
/// <summary>
/// 获取分支机构演练人次数
/// </summary>
/// <returns></returns>
public static int GetBranchDrillPersonNum(string projectid)
{
var result = 0;
return result;
}
/// <summary>
/// 获取项目级综合预案
@@ -1393,6 +1496,17 @@ namespace BLL
select x).ToList().Sum(x => x.TrainPersonNum ?? 0);
return result;
}
/// <summary>
/// 获取危大工程作业人次数
/// </summary>
/// <returns></returns>
public static int GetOperativesNum(string projectid)
{
var result = (from x in Funs.DB.Solution_LargerHazard
where x.ProjectId == projectid && x.IsSuperLargerHazard == false && x.RecordTime > Const.DtmarkTime
select x.OperativesNum).ToList().Sum(x => x.Value);
return result;
}
/// <summary>
/// 获取危大工程施工个数
@@ -1445,6 +1559,18 @@ namespace BLL
select x.TrainPersonNum).ToList().Sum(x => x.Value);
return result;
}
/// <summary>
/// 获取超危大工程作业人员数
/// </summary>
/// <returns></returns>
public static int GetSuperOperativesNum(string projectid)
{
var result =
(from x in Funs.DB.Solution_LargerHazard
where x.ProjectId == projectid && x.IsSuperLargerHazard == true && x.RecordTime > Const.DtmarkTime
select x.OperativesNum).ToList().Sum(x => x.Value);
return result;
}
/// <summary>
/// 获取超危大工程施工个数
@@ -1588,6 +1714,167 @@ namespace BLL
#endregion
#region
/// <summary>
/// 转换工作阶段
/// </summary>
/// <param name="workStage"></param>
/// <returns></returns>
public static string ConvertWorkStage(object workStage)
{
if (workStage != null)
{
string workStages = string.Empty;
string[] strList = workStage.ToString().Split(',');
foreach (string str in strList)
{
Model.Base_WorkStage c = BLL.WorkStageService.GetWorkStageById(str);
if (c != null)
{
workStages += c.WorkStageName + ",";
}
}
if (!string.IsNullOrEmpty(workStages))
{
workStages = workStages.Substring(0, workStages.LastIndexOf(","));
}
return workStages;
}
return "";
}
/// <summary>
/// 获取危险源编号
/// </summary>
/// <param name="WorkStage"></param>
/// <returns></returns>
public static string ConvertHazardCode(object HazardId)
{
string hazardCode = string.Empty;
if (HazardId != null)
{
Model.Technique_HazardList hazardList = BLL.HazardListService.GetHazardListById(HazardId.ToString());
if (hazardList != null)
{
hazardCode = hazardList.HazardCode;
}
}
return hazardCode;
}
/// <summary>
/// 获取危险源类别
/// </summary>
/// <param name="hazardListTypeId"></param>
/// <returns></returns>
public static string ConvertSupHazardListTypeId(object hazardListTypeId)
{
if (hazardListTypeId != null)
{
Model.Technique_HazardListType hazardListType =
BLL.HazardListTypeService.GetHazardListTypeById(hazardListTypeId.ToString());
if (hazardListType != null)
{
var hazard = BLL.HazardListTypeService.GetHazardListTypeById(hazardListType.SupHazardListTypeId);
if (hazard != null)
{
return hazard.HazardListTypeName;
}
}
}
return null;
}
/// <summary>
/// 获取危险源项
/// </summary>
/// <param name="hazardListTypeId"></param>
/// <returns></returns>
public static string ConvertHazardListTypeId(object hazardListTypeId)
{
if (hazardListTypeId != null)
{
Model.Technique_HazardListType hazardListType =
BLL.HazardListTypeService.GetHazardListTypeById(hazardListTypeId.ToString());
if (hazardListType != null)
{
return hazardListType.HazardListTypeName;
}
}
return null;
}
#endregion
#region
/// <summary>
/// 推送安全作业许可业务明细数据
/// </summary>
/// <returns></returns>
public static ReturnData PushProjectLicenseData(int pushNum)
{
var thisUnit = CommonService.GetIsThisUnit();
Model.SGGLDB db = Funs.DB;
var items = (from x in db.View_License_LicenseManager
where (x.IsUpdate == null || x.IsUpdate == false) && x.CompileDate > BLL.Const.DtmarkTime
select new Model.ProjectLicenseItem
{
Id = x.LicenseManagerId,
SourceUnitId = thisUnit.UnitId,
ProjectId = x.ProjectId,
CollCropCode = thisUnit.CollCropCode,
DataDate = x.CompileDate,
AttachFile = AttachFileService.getFileUrl(x.LicenseManagerId.ToString()),
LicenseManagerCode = x.LicenseManagerCode,
UnitId = x.UnitId,
UnitName = x.UnitName,
LicenseTypeName = x.LicenseTypeName,
UnitTypeName = x.UnitTypeName,
IsHighRisk = x.IsHighRisk,
WorkAreaName = x.WorkAreaName,
CompileDate = x.CompileDate,
StartDate = x.StartDate,
EndDate = x.EndDate,
WorkStatesStr = x.WorkStatesStr,
}).Take(pushNum).ToList();
Model.ReturnData responeData = new Model.ReturnData();
if (items.Count() > 0)
{
var newItem = new { CollCropCode = thisUnit.CollCropCode, Items = items };
var str = JsonConvert.SerializeObject(newItem);
var baseurl = "/api/HSSEData/SaveProjectLicenseData";
responeData = ServerService.PushCNCEC(str, baseurl);
if (responeData.code == 1)
{
foreach (var item in items)
{
var data = db.License_LicenseManager.FirstOrDefault(x =>
x.LicenseManagerId == item.Id && (x.IsUpdate == null || x.IsUpdate == false));
data.IsUpdate = true;
db.SubmitChanges();
}
}
}
else
{
responeData.code = 0;
responeData.message = "当前没有项目安全作业许可业务明细数据";
}
return responeData;
}
#endregion
#region
/// <summary>
@@ -1620,5 +1907,489 @@ namespace BLL
}
#endregion
#region
/// <summary>
/// 推送项目安全隐患数据
/// </summary>
/// <returns></returns>
public static ReturnData PushProjectHazardRegisterData(int pushNum)
{
var thisUnit = CommonService.GetIsThisUnit();
Model.SGGLDB db = Funs.DB;
var items = (from x in db.View_Hazard_HazardRegister
where (x.IsUpdate == null || x.IsUpdate == false) && x.CheckTime > BLL.Const.DtmarkTime
&& x.ProblemTypes == "1"
&& x.ProjectState == "1"
// && x.IsBranch.Value == true
&& (x.IsDelete == null || x.IsDelete == false)
select new Model.Hazard_HazardRegisterItem
{
HazardRegisterId = x.HazardRegisterId,
SourceUnitId = thisUnit.UnitId,
RegisterDate = x.RegisterDate,
RegisterDef = x.RegisterDef,
Rectification = x.Rectification,
WorkAreaName = x.WorkAreaName,
ResponsibilityUnitName = x.ResponsibilityUnitName,
ResponsibilityUnitCollCropCode = x.ResponsibilityUnitCollCropCode,
Risk_Level = x.Risk_Level,
ProjectId = x.ProjectId,
ProjectName = x.ProjectName,
States = x.States,
StatesStr = x.StatesStr,
ResponsibilityManName = x.ResponsibilityManName,
CheckManName = x.CheckManName,
CheckTime = x.CheckTime,
RectificationPeriod = x.RectificationPeriod,
ImageUrl = x.ImageUrl,
// ImageUrlFileContext = AttachFileService.GetMoreFileStructByAttachUrl(x.ImageUrl),
RectificationImageUrl = x.RectificationImageUrl,
// RectificationImageUrlFileContext = AttachFileService.GetMoreFileStructByAttachUrl(x.RectificationImageUrl),
RectificationTime = x.RectificationTime,
ConfirmManName = x.ConfirmManName,
ConfirmDate = x.ConfirmDate,
HandleIdea = x.HandleIdea,
CutPayment = x.CutPayment,
CheckCycle = x.CheckCycle,
RegisterTypesName = x.RegisterTypesName,
Requirements = x.Requirements
}).Take(pushNum).ToList();
Model.ReturnData responeData = new Model.ReturnData();
if (items.Count() > 0)
{
var newItem = new { CollCropCode = thisUnit.CollCropCode, Items = items };
var str = JsonConvert.SerializeObject(newItem);
var baseurl = "/api/HSSEData/SaveProjectHazardRegisterData";
responeData = ServerService.PushCNCEC(str, baseurl);
if (responeData.code == 1)
{
foreach (var item in items)
{
var data = db.HSSE_Hazard_HazardRegister.FirstOrDefault(x =>
x.HazardRegisterId == item.HazardRegisterId && (x.IsUpdate == null || x.IsUpdate == false));
data.IsUpdate = true;
db.SubmitChanges();
}
// var list = from x in db.HSSE_Hazard_HazardRegister
// where x.IsUpdate == null || x.IsUpdate == false
// select x;
// foreach (var item in list)
// {
// item.IsUpdate = true;
// }
// db.SubmitChanges();
}
}
else
{
responeData.code = 0;
responeData.message = "当前没有项目安全隐患数据";
}
return responeData;
}
#endregion
#region
/// <summary>
/// 推送安全风险数据
/// </summary>
/// <returns></returns>
public static ReturnData PushProjectSecurityRiskData(int pushNum)
{
var thisUnit = CommonService.GetIsThisUnit();
Model.SGGLDB db = Funs.DB;
var items = (from x in db.Hazard_HazardSelectedItem
join List in db.Hazard_HazardList on x.HazardListId equals List.HazardListId into ListJ
from list in ListJ.DefaultIfEmpty()
join Level in db.Base_RiskLevel on x.HazardLevel equals Level.RiskLevelId into LevelJ
from level in LevelJ.DefaultIfEmpty()
where (x.IsUpdate == null || x.IsUpdate == false) && level.RiskLevelName != "" && list.States == BLL.Const.State_2
select new Model.ProjectSecurityRiskItem
{
Id = x.HazardSelectedItemId,
SourceUnitId = thisUnit.UnitId,
ProjectId = x.ProjectId,
CollCropCode = thisUnit.CollCropCode,
DataDate = x.CheckStartDate,
// AttachFile = AttachFileService.getFileUrl(x.HazardListId.ToString()),
WorkAreaName = list.WorkAreaName,
WorkStageName = ConvertWorkStage(x.WorkStage),
SupHazardListType = ConvertSupHazardListTypeId(x.HazardListTypeId),
HazardListType = ConvertHazardListTypeId(x.HazardListTypeId),
Hazard = ConvertHazardCode(x.HazardId),
HazardItems = x.HazardItems,
DefectsType = x.DefectsType,
MayLeadAccidents = x.MayLeadAccidents,
HelperMethod = x.HelperMethod,
HazardJudge_L = x.HazardJudge_L,
HazardJudge_E = x.HazardJudge_E,
HazardJudge_C = x.HazardJudge_C,
HazardJudge_D = x.HazardJudge_D,
RiskLevelName = level.RiskLevelName,
RiskLevel = level.RiskLevel,
ControlMeasures = x.ControlMeasures,
}).Take(pushNum).ToList();
Model.ReturnData responeData = new Model.ReturnData();
if (items.Count() > 0)
{
var newItem = new { CollCropCode = thisUnit.CollCropCode, Items = items };
var str = JsonConvert.SerializeObject(newItem);
var baseurl = "/api/HSSEData/SaveProjectSecurityRiskData";
responeData = ServerService.PushCNCEC(str, baseurl);
if (responeData.code == 1)
{
foreach (var item in items)
{
var data = db.Hazard_HazardSelectedItem.FirstOrDefault(x =>
x.HazardSelectedItemId == item.Id && (x.IsUpdate == null || x.IsUpdate == false));
data.IsUpdate = true;
db.SubmitChanges();
}
}
}
else
{
responeData.code = 0;
responeData.message = "当前没有项目安全风险数据";
}
return responeData;
}
#endregion
#region
/// <summary>
/// 推送危大工程业务明细数据
/// </summary>
/// <returns></returns>
public static ReturnData PushProjectLargeEngineeringData(int pushNum)
{
var thisUnit = CommonService.GetIsThisUnit();
Model.SGGLDB db = Funs.DB;
var items = (from x in db.Solution_LargerHazard
where (x.IsUpdate == null || x.IsUpdate == false) && x.RecordTime > BLL.Const.DtmarkTime
select new Model.LargeEngineeringItem
{
Id = x.HazardId,
SourceUnitId = thisUnit.UnitId,
ProjectId = x.ProjectId,
CollCropCode = thisUnit.CollCropCode,
DataDate = x.RecordTime,
AttachFile = AttachFileService.getFileUrl(x.HazardId.ToString()),
//HazardName = x.HazardName,
TypeName = db.Sys_Const.FirstOrDefault(y =>
y.ConstValue == x.HazardType && y.GroupId == ConstValue.Group_LargerHazardType).ConstText,
IsSuperLargerHazard = x.IsSuperLargerHazard,
IsArgument = x.IsArgument,
Address = x.Address,
Descriptions = x.Descriptions,
TrainPersonNum = x.TrainPersonNum,
RecordTime = x.RecordTime,
ExpectedTime = x.ExpectedTime,
States = x.States,
StatesStr = x.States == "0" ? "已取消" :
x.States == "1" ? "未开始" :
x.States == "2" ? "作业中" :
x.States == "3" ? "已完工" : "",
}).Take(pushNum).ToList();
Model.ReturnData responeData = new Model.ReturnData();
if (items.Count() > 0)
{
var newItem = new { CollCropCode = thisUnit.CollCropCode, Items = items };
var str = JsonConvert.SerializeObject(newItem);
var baseurl = "/api/HSSEData/SaveProjectLargeEngineeringData";
responeData = ServerService.PushCNCEC(str, baseurl);
if (responeData.code == 1)
{
foreach (var item in items)
{
var data = db.Solution_LargerHazard.FirstOrDefault(x =>
x.HazardId == item.Id && (x.IsUpdate == null || x.IsUpdate == false));
data.IsUpdate = true;
db.SubmitChanges();
}
}
}
else
{
responeData.code = 0;
responeData.message = "当前没有项目危大工程业务明细数据";
}
return responeData;
}
#endregion
#region
/// <summary>
/// 删除安全作业许可业务明细数据
/// </summary>
/// <returns></returns>
public static ReturnData DeleteProjectLicenseData(string Id)
{
Model.ReturnData responeData = new Model.ReturnData();
try
{
var thisUnit = CommonService.GetIsThisUnit();
Model.SGGLDB db = Funs.DB;
var items = (from x in db.View_License_LicenseManager
where x.LicenseManagerId == Id
select new Model.ProjectLicenseItem
{
Id = x.LicenseManagerId,
SourceUnitId = thisUnit.UnitId,
ProjectId = x.ProjectId,
CollCropCode = thisUnit.CollCropCode,
DataDate = x.CompileDate,
AttachFile = AttachFileService.getFileUrl(x.LicenseManagerId.ToString()),
LicenseManagerCode = x.LicenseManagerCode,
UnitId = x.UnitId,
UnitName = x.UnitName,
LicenseTypeName = x.LicenseTypeName,
UnitTypeName = x.UnitTypeName,
IsHighRisk = x.IsHighRisk,
WorkAreaName = x.WorkAreaName,
CompileDate = x.CompileDate,
StartDate = x.StartDate,
EndDate = x.EndDate,
WorkStatesStr = x.WorkStatesStr,
}).ToList();
if (items.Count() > 0)
{
var newItem = new { CollCropCode = thisUnit.CollCropCode, Items = items };
var str = JsonConvert.SerializeObject(newItem);
var baseurl = "/api/HSSEData/DeleteProjectLicenseData";
responeData = ServerService.PushCNCEC(str, baseurl);
}
else
{
responeData.code = 0;
responeData.message = "集团数据删除失败";
}
}
catch (Exception)
{
responeData.code = 0;
responeData.message = "集团数据删除失败";
}
return responeData;
}
#endregion
#region
/// <summary>
/// 删除项目安全隐患数据
/// </summary>
/// <returns></returns>
public static ReturnData DeleteProjectHazardRegisterData(string hazardRegisterId)
{
Model.ReturnData responeData = new Model.ReturnData();
try
{
var thisUnit = CommonService.GetIsThisUnit();
Model.SGGLDB db = Funs.DB;
var items = (from x in db.View_Hazard_HazardRegister
where x.HazardRegisterId == hazardRegisterId
select new Model.Hazard_HazardRegisterItem
{
HazardRegisterId = x.HazardRegisterId,
SourceUnitId = thisUnit.UnitId,
RegisterDate = x.RegisterDate,
RegisterDef = x.RegisterDef,
Rectification = x.Rectification,
WorkAreaName = x.WorkAreaName,
ResponsibilityUnitName = x.ResponsibilityUnitName,
ResponsibilityUnitCollCropCode = x.ResponsibilityUnitCollCropCode,
Risk_Level = x.Risk_Level,
ProjectId = x.ProjectId,
ProjectName = x.ProjectName,
States = x.States,
StatesStr = x.StatesStr,
ResponsibilityManName = x.ResponsibilityManName,
CheckManName = x.CheckManName,
CheckTime = x.CheckTime,
RectificationPeriod = x.RectificationPeriod,
ImageUrl = x.ImageUrl,
ImageUrlFileContext = AttachFileService.GetMoreFileStructByAttachUrl(x.ImageUrl),
RectificationImageUrl = x.RectificationImageUrl,
RectificationImageUrlFileContext = AttachFileService.GetMoreFileStructByAttachUrl(x.RectificationImageUrl),
RectificationTime = x.RectificationTime,
ConfirmManName = x.ConfirmManName,
ConfirmDate = x.ConfirmDate,
HandleIdea = x.HandleIdea,
CutPayment = x.CutPayment,
CheckCycle = x.CheckCycle,
RegisterTypesName = x.RegisterTypesName,
Requirements = x.Requirements
}).ToList();
if (items.Count() > 0)
{
var newItem = new { CollCropCode = thisUnit.CollCropCode, Items = items };
var str = JsonConvert.SerializeObject(newItem);
var baseurl = "/api/HSSEData/DeleteProjectHazardRegisterData";
responeData = ServerService.PushCNCEC(str, baseurl);
}
else
{
responeData.code = 0;
responeData.message = "集团数据删除失败";
}
}
catch (Exception)
{
responeData.code = 0;
responeData.message = "集团数据删除失败";
}
return responeData;
}
#endregion
#region
/// <summary>
/// 删除危大工程业务明细数据
/// </summary>
/// <returns></returns>
public static ReturnData DeleteProjectLargeEngineeringData(string Id)
{
Model.ReturnData responeData = new Model.ReturnData();
try
{
var thisUnit = CommonService.GetIsThisUnit();
Model.SGGLDB db = Funs.DB;
var items = (from x in db.Solution_LargerHazard
where x.HazardId == Id
select new Model.LargeEngineeringItem
{
Id = x.HazardId,
SourceUnitId = thisUnit.UnitId,
ProjectId = x.ProjectId,
CollCropCode = thisUnit.CollCropCode,
DataDate = x.RecordTime,
AttachFile = AttachFileService.getFileUrl(x.HazardId.ToString()),
//HazardName = x.HazardName,
TypeName = db.Sys_Const.FirstOrDefault(y =>
y.ConstValue == x.HazardType && y.GroupId == ConstValue.Group_LargerHazardType).ConstText,
IsSuperLargerHazard = x.IsSuperLargerHazard,
IsArgument = x.IsArgument,
Address = x.Address,
Descriptions = x.Descriptions,
TrainPersonNum = x.TrainPersonNum,
OperativesNum = x.OperativesNum,
RecordTime = x.RecordTime,
ExpectedTime = x.ExpectedTime,
States = x.States,
StatesStr = x.States == "0" ? "已取消" :
x.States == "1" ? "未开始" :
x.States == "2" ? "作业中" :
x.States == "3" ? "已完工" : "",
}).ToList();
if (items.Count() > 0)
{
var newItem = new { CollCropCode = thisUnit.CollCropCode, Items = items };
var str = JsonConvert.SerializeObject(newItem);
var baseurl = "/api/HSSEData/DeleteProjectLargeEngineeringData";
responeData = ServerService.PushCNCEC(str, baseurl);
}
else
{
responeData.code = 0;
responeData.message = "集团数据删除失败";
}
}
catch (Exception)
{
responeData.code = 0;
responeData.message = "集团数据删除失败";
}
return responeData;
}
#endregion
#region
/// <summary>
/// 删除安全风险数据
/// </summary>
/// <returns></returns>
public static ReturnData DeleteProjectSecurityRiskData(string Id)
{
Model.ReturnData responeData = new Model.ReturnData();
try
{
var thisUnit = CommonService.GetIsThisUnit();
Model.SGGLDB db = Funs.DB;
var items = (from x in db.Hazard_HazardSelectedItem
join List in db.Hazard_HazardList on x.HazardListId equals List.HazardListId into ListJ
from list in ListJ.DefaultIfEmpty()
join Level in db.Base_RiskLevel on x.HazardLevel equals Level.RiskLevelId into LevelJ
from level in LevelJ.DefaultIfEmpty()
where x.HazardSelectedItemId == Id
select new Model.ProjectSecurityRiskItem
{
Id = x.HazardSelectedItemId,
SourceUnitId = thisUnit.UnitId,
ProjectId = x.ProjectId,
CollCropCode = thisUnit.CollCropCode,
DataDate = x.CheckStartDate,
// AttachFile = AttachFileService.getFileUrl(x.HazardListId.ToString()),
WorkAreaName = list.WorkAreaName,
WorkStageName = ConvertWorkStage(x.WorkStage),
SupHazardListType = ConvertSupHazardListTypeId(x.HazardListTypeId),
HazardListType = ConvertHazardListTypeId(x.HazardListTypeId),
Hazard = ConvertHazardCode(x.HazardId),
HazardItems = x.HazardItems,
DefectsType = x.DefectsType,
MayLeadAccidents = x.MayLeadAccidents,
HelperMethod = x.HelperMethod,
HazardJudge_L = x.HazardJudge_L,
HazardJudge_E = x.HazardJudge_E,
HazardJudge_C = x.HazardJudge_C,
HazardJudge_D = x.HazardJudge_D,
RiskLevelName = level.RiskLevelName,
RiskLevel = level.RiskLevel,
ControlMeasures = x.ControlMeasures,
}).ToList();
if (items.Count() > 0)
{
var newItem = new { CollCropCode = thisUnit.CollCropCode, Items = items };
var str = JsonConvert.SerializeObject(newItem);
var baseurl = "/api/HSSEData/DeleteProjectSecurityRiskData";
responeData = ServerService.PushCNCEC(str, baseurl);
}
else
{
responeData.code = 0;
responeData.message = "集团数据删除失败";
}
}
catch (Exception)
{
responeData.code = 0;
responeData.message = "集团数据删除失败";
}
return responeData;
}
#endregion
}
}