提交首页修改
This commit is contained in:
@@ -0,0 +1,740 @@
|
||||
using FineUIPro;
|
||||
using RestSharp;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Model;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
|
||||
public static class Project_CQMSDataService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
/// <summary>
|
||||
/// CQMS数据类型
|
||||
/// </summary>
|
||||
public enum CQMSDateType
|
||||
{
|
||||
/// <summary>
|
||||
/// 质量培训数据
|
||||
/// </summary>
|
||||
QualityTraining,
|
||||
/// <summary>
|
||||
/// 计量器具数据
|
||||
/// </summary>
|
||||
MeasuringInstruments,
|
||||
/// <summary>
|
||||
/// 管理人员数据
|
||||
/// </summary>
|
||||
ManagerData,
|
||||
/// <summary>
|
||||
/// 质量问题数据
|
||||
/// </summary>
|
||||
QualityProblem,
|
||||
/// <summary>
|
||||
/// 质量控制点数据
|
||||
/// </summary>
|
||||
QualityControlPoint,
|
||||
/// <summary>
|
||||
/// 质量验收数据
|
||||
/// </summary>
|
||||
QualityAcceptance,
|
||||
/// <summary>
|
||||
/// 工程划分数据
|
||||
/// </summary>
|
||||
ProjectDivision,
|
||||
/// <summary>
|
||||
/// 全部数据
|
||||
/// </summary>
|
||||
All
|
||||
|
||||
};
|
||||
#region 获取列表
|
||||
/// <summary>
|
||||
/// 记录数
|
||||
/// </summary>
|
||||
public static int count
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
public static List<Model.Project_CQMSData_CQMS> GetProject_CQMSData_CQMSByModle(Model.Project_CQMSData_CQMS table)
|
||||
{
|
||||
var q = from x in db.Project_CQMSData_CQMS
|
||||
where
|
||||
(string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) &&
|
||||
(string.IsNullOrEmpty(table.ProjectId) || x.Id.Contains(table.ProjectId)) &&
|
||||
(string.IsNullOrEmpty(table.UnitId) || x.UnitId.Contains(table.UnitId)) &&
|
||||
(string.IsNullOrEmpty(table.CollCropCode) || x.CollCropCode.Contains(table.CollCropCode)) &&
|
||||
(string.IsNullOrEmpty(table.UnitName) || x.UnitName.Contains(table.UnitName))
|
||||
select x
|
||||
;
|
||||
|
||||
return q.ToList();
|
||||
}
|
||||
|
||||
/// 获取分页列表
|
||||
/// </summary>
|
||||
/// <param name="PageIndex">页码</param>
|
||||
/// <param name="PageSize">每页数量</param>
|
||||
/// <returns></returns>
|
||||
public static IEnumerable getListData(Model.Project_CQMSData_CQMS table, Grid Grid1)
|
||||
{
|
||||
var q = GetProject_CQMSData_CQMSByModle(table);
|
||||
count = q.Count();
|
||||
if (count == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
// q= q.Take(Grid1.PageSize * Grid1.PageIndex).Skip(Grid1.PageSize * (Grid1.PageIndex)).ToList();
|
||||
// q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
|
||||
return from x in q
|
||||
select new
|
||||
{
|
||||
x.Id,
|
||||
x.ProjectId,
|
||||
x.UnitId,
|
||||
x.CollCropCode,
|
||||
x.UnitName,
|
||||
x.ReportDate,
|
||||
x.TrainPersonNum,
|
||||
x.TechnicalDisclosePersonNum,
|
||||
x.UseNum,
|
||||
x.OKNum,
|
||||
x.CompanyPersonNum,
|
||||
x.BranchPersonNum,
|
||||
x.ProjectPersonNum,
|
||||
x.ProblemNum,
|
||||
x.ProblemCompletedNum,
|
||||
x.ProblemNotCompletedNum,
|
||||
x.SNum,
|
||||
x.ANum,
|
||||
x.BNum,
|
||||
x.CNum,
|
||||
x.KeyProcessNum,
|
||||
x.KeyProcessOKNum,
|
||||
x.SpecialProcessNum,
|
||||
x.SpecialProcessOKNum,
|
||||
x.ConcealedWorksNum,
|
||||
x.ConcealedWorksOKNum,
|
||||
x.UnitProjectOnesNum,
|
||||
x.UnitProjectOnesOKNum,
|
||||
x.MaterialInRecheckNum,
|
||||
x.MaterialInRecheckOKNum,
|
||||
x.SingleProjectNum,
|
||||
x.UnitProjectNum,
|
||||
x.SubProjectNum,
|
||||
x.SubdivisionalWorksNum,
|
||||
x.InspectionLotNum,
|
||||
|
||||
};
|
||||
}
|
||||
#endregion
|
||||
/// <summary>
|
||||
/// 根据id获取实体
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Project_CQMSData_CQMS GetProject_CQMSData_CQMSById(string Id)
|
||||
{
|
||||
return db.Project_CQMSData_CQMS.FirstOrDefault(x => x.Id == Id);
|
||||
}
|
||||
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();
|
||||
return q;
|
||||
}
|
||||
/// <summary>
|
||||
/// 新增
|
||||
/// </summary>
|
||||
/// <param name="newtable"></param>
|
||||
public static void AddProject_CQMSData_CQMS(Model.Project_CQMSData_CQMS newtable)
|
||||
{
|
||||
|
||||
Model.Project_CQMSData_CQMS table = new Model.Project_CQMSData_CQMS
|
||||
{
|
||||
Id = newtable.Id,
|
||||
ProjectId = newtable.ProjectId,
|
||||
UnitId = newtable.UnitId,
|
||||
CollCropCode = newtable.CollCropCode,
|
||||
UnitName = newtable.UnitName,
|
||||
ReportDate = newtable.ReportDate,
|
||||
TrainPersonNum = newtable.TrainPersonNum,
|
||||
TechnicalDisclosePersonNum = newtable.TechnicalDisclosePersonNum,
|
||||
UseNum = newtable.UseNum,
|
||||
OKNum = newtable.OKNum,
|
||||
CompanyPersonNum = newtable.CompanyPersonNum,
|
||||
BranchPersonNum = newtable.BranchPersonNum,
|
||||
ProjectPersonNum = newtable.ProjectPersonNum,
|
||||
ProblemNum = newtable.ProblemNum,
|
||||
ProblemCompletedNum = newtable.ProblemCompletedNum,
|
||||
ProblemNotCompletedNum = newtable.ProblemNotCompletedNum,
|
||||
SNum = newtable.SNum,
|
||||
ANum = newtable.ANum,
|
||||
BNum = newtable.BNum,
|
||||
CNum = newtable.CNum,
|
||||
KeyProcessNum = newtable.KeyProcessNum,
|
||||
KeyProcessOKNum = newtable.KeyProcessOKNum,
|
||||
SpecialProcessNum = newtable.SpecialProcessNum,
|
||||
SpecialProcessOKNum = newtable.SpecialProcessOKNum,
|
||||
ConcealedWorksNum = newtable.ConcealedWorksNum,
|
||||
ConcealedWorksOKNum = newtable.ConcealedWorksOKNum,
|
||||
UnitProjectOnesNum = newtable.UnitProjectOnesNum,
|
||||
UnitProjectOnesOKNum = newtable.UnitProjectOnesOKNum,
|
||||
MaterialInRecheckNum = newtable.MaterialInRecheckNum,
|
||||
MaterialInRecheckOKNum = newtable.MaterialInRecheckOKNum,
|
||||
SingleProjectNum = newtable.SingleProjectNum,
|
||||
UnitProjectNum = newtable.UnitProjectNum,
|
||||
SubProjectNum = newtable.SubProjectNum,
|
||||
SubdivisionalWorksNum = newtable.SubdivisionalWorksNum,
|
||||
InspectionLotNum = newtable.InspectionLotNum,
|
||||
};
|
||||
db.Project_CQMSData_CQMS.InsertOnSubmit(table);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
/// <summary>
|
||||
/// 修改
|
||||
/// </summary>
|
||||
/// <param name="newtable"></param>
|
||||
public static void UpdateProject_CQMSData_CQMS(Model.Project_CQMSData_CQMS newtable)
|
||||
{
|
||||
|
||||
Model.Project_CQMSData_CQMS table = db.Project_CQMSData_CQMS.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.TrainPersonNum = newtable.TrainPersonNum;
|
||||
table.TechnicalDisclosePersonNum = newtable.TechnicalDisclosePersonNum;
|
||||
table.UseNum = newtable.UseNum;
|
||||
table.OKNum = newtable.OKNum;
|
||||
table.CompanyPersonNum = newtable.CompanyPersonNum;
|
||||
table.BranchPersonNum = newtable.BranchPersonNum;
|
||||
table.ProjectPersonNum = newtable.ProjectPersonNum;
|
||||
table.ProblemNum = newtable.ProblemNum;
|
||||
table.ProblemCompletedNum = newtable.ProblemCompletedNum;
|
||||
table.ProblemNotCompletedNum = newtable.ProblemNotCompletedNum;
|
||||
table.SNum = newtable.SNum;
|
||||
table.ANum = newtable.ANum;
|
||||
table.BNum = newtable.BNum;
|
||||
table.CNum = newtable.CNum;
|
||||
table.KeyProcessNum = newtable.KeyProcessNum;
|
||||
table.KeyProcessOKNum = newtable.KeyProcessOKNum;
|
||||
table.SpecialProcessNum = newtable.SpecialProcessNum;
|
||||
table.SpecialProcessOKNum = newtable.SpecialProcessOKNum;
|
||||
table.ConcealedWorksNum = newtable.ConcealedWorksNum;
|
||||
table.ConcealedWorksOKNum = newtable.ConcealedWorksOKNum;
|
||||
table.UnitProjectOnesNum = newtable.UnitProjectOnesNum;
|
||||
table.UnitProjectOnesOKNum = newtable.UnitProjectOnesOKNum;
|
||||
table.MaterialInRecheckNum = newtable.MaterialInRecheckNum;
|
||||
table.MaterialInRecheckOKNum = newtable.MaterialInRecheckOKNum;
|
||||
table.SingleProjectNum = newtable.SingleProjectNum;
|
||||
table.UnitProjectNum = newtable.UnitProjectNum;
|
||||
table.SubProjectNum = newtable.SubProjectNum;
|
||||
table.SubdivisionalWorksNum = newtable.SubdivisionalWorksNum;
|
||||
table.InspectionLotNum = newtable.InspectionLotNum;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据id删除
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
public static void DeleteProject_CQMSData_CQMSById(string Id)
|
||||
{
|
||||
|
||||
Model.Project_CQMSData_CQMS table = db.Project_CQMSData_CQMS.FirstOrDefault(x => x.Id == Id);
|
||||
if (table != null)
|
||||
{
|
||||
db.Project_CQMSData_CQMS.DeleteOnSubmit(table);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据projectid判断当天项目是否已统计数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static bool IsReportByToday(string projectid)
|
||||
{
|
||||
var result = false;
|
||||
var q = (from x in Funs.DB.Project_CQMSData_CQMS
|
||||
where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date && x.ProjectId == projectid
|
||||
select x).ToList();
|
||||
if (q != null && q.Count > 0)
|
||||
{
|
||||
result = true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 判断该项目的该日期是否统计数据
|
||||
/// </summary>
|
||||
/// <param name="dateTime"></param>
|
||||
/// <returns></returns>
|
||||
public static bool IsReportByDate(DateTime dateTime,string projectid)
|
||||
{
|
||||
var result = false;
|
||||
var q = (from x in Funs.DB.Project_CQMSData_CQMS
|
||||
where x.ReportDate >= dateTime.Date && x.ReportDate < (dateTime.Date.AddDays(1).Date) && x.ProjectId == projectid
|
||||
select x).ToList();
|
||||
if (q != null && q.Count > 0)
|
||||
{
|
||||
result = true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据projectid,获取该项目当天的统计数据
|
||||
/// </summary>
|
||||
/// <param name="projectid"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Project_CQMSData_CQMS getTodayProject_CQMSData_CQMS(string projectid)
|
||||
{
|
||||
var q = (from x in Funs.DB.Project_CQMSData_CQMS
|
||||
where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date && x.ProjectId == projectid
|
||||
select x).FirstOrDefault();
|
||||
return q;
|
||||
}
|
||||
public static void StatisticalAllProjectData()
|
||||
{
|
||||
var projectlist = ProjectService.GetProjectWorkList();
|
||||
foreach (var item in projectlist)
|
||||
{
|
||||
StatisticalData(item.ProjectId, CQMSDateType.All);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 统计数据
|
||||
/// </summary>
|
||||
/// <param name="projectid">项目id</param>
|
||||
/// <param name="cQMSDateType">数据类型</param>
|
||||
public static void StatisticalData(string projectid,CQMSDateType cQMSDateType)
|
||||
{
|
||||
string thisUnitId = BLL.Const.UnitId_CD;
|
||||
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);
|
||||
}
|
||||
else
|
||||
{
|
||||
table.Id = SQLHelper.GetNewID();
|
||||
}
|
||||
table.UnitId = thisUnitId;
|
||||
table.CollCropCode = base_Unit.CollCropCode;
|
||||
table.UnitName = base_Unit.UnitName;
|
||||
table.ProjectId = projectid;
|
||||
table.ReportDate = DateTime.Now.Date;
|
||||
if (cQMSDateType== CQMSDateType.QualityTraining|| cQMSDateType == CQMSDateType.All)
|
||||
{
|
||||
table.TrainPersonNum = GetTrainPersonNum(projectid);
|
||||
table.TechnicalDisclosePersonNum = GetTechnicalDisclosePersonNum(projectid);
|
||||
}
|
||||
if (cQMSDateType == CQMSDateType.MeasuringInstruments || cQMSDateType == CQMSDateType.All)
|
||||
{
|
||||
table.UseNum = GetUseNum(projectid);
|
||||
table.OKNum = GetOKNum(projectid);
|
||||
}
|
||||
if (cQMSDateType == CQMSDateType.ManagerData || cQMSDateType == CQMSDateType.All)
|
||||
{
|
||||
table.CompanyPersonNum = GetCompanyPersonNum(projectid);
|
||||
table.BranchPersonNum = GetBranchPersonNum(projectid);
|
||||
table.ProjectPersonNum = GetProjectPersonNum(projectid);
|
||||
}
|
||||
if (cQMSDateType == CQMSDateType.QualityProblem || cQMSDateType == CQMSDateType.All)
|
||||
{
|
||||
table.ProblemNum = GetProblemNum(projectid);
|
||||
table.ProblemCompletedNum = GetProblemCompletedNum(projectid);
|
||||
table.ProblemNotCompletedNum = GetProblemNotCompletedNum(projectid);
|
||||
}
|
||||
if (cQMSDateType == CQMSDateType.QualityControlPoint || cQMSDateType == CQMSDateType.All)
|
||||
{
|
||||
table.SNum = GetSNum(projectid);
|
||||
table.ANum = GetANum(projectid);
|
||||
table.BNum = GetBNum(projectid);
|
||||
table.CNum = GetCNum(projectid);
|
||||
}
|
||||
if (cQMSDateType == CQMSDateType.QualityAcceptance || cQMSDateType == CQMSDateType.All)
|
||||
{
|
||||
table.KeyProcessNum = GetKeyProcessNum(projectid);
|
||||
table.KeyProcessOKNum = GetKeyProcessOKNum(projectid);
|
||||
table.SpecialProcessNum = GetSpecialProcessNum(projectid);
|
||||
table.SpecialProcessOKNum = GetSpecialProcessOKNum(projectid);
|
||||
table.ConcealedWorksNum = GetConcealedWorksNum(projectid);
|
||||
table.ConcealedWorksOKNum = GetConcealedWorksOKNum(projectid);
|
||||
table.UnitProjectOnesNum = GetUnitProjectOnesNum(projectid);
|
||||
table.UnitProjectOnesOKNum = GetUnitProjectOnesOKNum(projectid);
|
||||
table.MaterialInRecheckNum = GetMaterialInRecheckNum(projectid);
|
||||
table.MaterialInRecheckOKNum = GetMaterialInRecheckOKNum(projectid);
|
||||
}
|
||||
if (cQMSDateType == CQMSDateType.ProjectDivision || cQMSDateType == CQMSDateType.All)
|
||||
{
|
||||
table.SingleProjectNum = GetSingleProjectNum(projectid);
|
||||
table.UnitProjectNum = GetUnitProjectNum(projectid);
|
||||
table.SubProjectNum = GetSubProjectNum(projectid);
|
||||
table.SubdivisionalWorksNum = GetSubdivisionalWorksNum(projectid);
|
||||
table.InspectionLotNum = GetInspectionLotNum(projectid);
|
||||
}
|
||||
|
||||
if (IsReportByToday(projectid))
|
||||
{
|
||||
UpdateProject_CQMSData_CQMS(table);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddProject_CQMSData_CQMS(table);
|
||||
}
|
||||
CQMSDataService.UpdateTodyData_State();
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取质量培训人次数
|
||||
/// </summary>
|
||||
/// <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;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取技术交底人次数
|
||||
/// </summary>
|
||||
/// <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;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取在用计量器具数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetUseNum(string projectid)
|
||||
{
|
||||
int result = (from x in Funs.DB.Comprehensive_InspectionMachine
|
||||
where x.ProjectId == projectid && x.IsOnSite == true && x.InspectionType.Contains("计量")
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取校准合格数
|
||||
/// </summary>
|
||||
/// <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;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取企业总部人数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetCompanyPersonNum(string projectid)
|
||||
{
|
||||
int result = 0;
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取分支机构人数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetBranchPersonNum(string projectid)
|
||||
{
|
||||
int result = 0;
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取项目部人数
|
||||
/// </summary>
|
||||
/// <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;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取问题个数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetProblemNum(string projectid)
|
||||
{
|
||||
int result = (from x in Funs.DB.Check_CheckControl
|
||||
where x.ProjectId == projectid && x.CheckDate <= DateTime.Now
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取整改完成数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetProblemCompletedNum(string projectid)
|
||||
{
|
||||
int result = (from x in Funs.DB.Check_CheckControl
|
||||
where x.ProjectId == projectid && x.CheckDate <= DateTime.Now && x.State == "7"
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取未整改数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetProblemNotCompletedNum(string projectid)
|
||||
{
|
||||
int result = (from x in Funs.DB.Check_CheckControl
|
||||
where x.ProjectId == projectid && x.CheckDate <= DateTime.Now && x.State != "7"
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取S级数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetSNum(string projectid)
|
||||
{
|
||||
int result = (from x in Funs.DB.WBS_BreakdownProject
|
||||
where x.ProjectId == projectid && x.Class.Contains("S")
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取A级数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetANum(string projectid)
|
||||
{
|
||||
int result = (from x in Funs.DB.WBS_BreakdownProject
|
||||
where x.ProjectId == projectid && x.Class.Contains("A")
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取B级数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetBNum(string projectid)
|
||||
{
|
||||
int result = (from x in Funs.DB.WBS_BreakdownProject
|
||||
where x.ProjectId == projectid && x.Class.Contains("B")
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取C级数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetCNum(string projectid)
|
||||
{
|
||||
int result = (from x in Funs.DB.WBS_BreakdownProject
|
||||
where x.ProjectId == projectid && x.Class.Contains("C")
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取关键工序验收数
|
||||
/// </summary>
|
||||
/// <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;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取关键工序验收合格数
|
||||
/// </summary>
|
||||
/// <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;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取特殊过程验收数
|
||||
/// </summary>
|
||||
/// <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;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取特殊过程验收合格数
|
||||
/// </summary>
|
||||
/// <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;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取隐蔽工程验收数
|
||||
/// </summary>
|
||||
/// <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;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取隐蔽工程验收合格数
|
||||
/// </summary>
|
||||
/// <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;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取单位工程一次验收数
|
||||
/// </summary>
|
||||
/// <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;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取单位工程一次验收合格数
|
||||
/// </summary>
|
||||
/// <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;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取材料进场复验数
|
||||
/// </summary>
|
||||
/// <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;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取材料进场复验合格数
|
||||
/// </summary>
|
||||
/// <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;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取单项工程个数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetSingleProjectNum(string projectid)
|
||||
{
|
||||
int result = (from x in Funs.DB.Project_Installation
|
||||
where x.ProjectId == projectid && x.SuperInstallationId == "0"
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取单位工程个数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetUnitProjectNum(string projectid)
|
||||
{
|
||||
int result = (from x in Funs.DB.WBS_UnitWork
|
||||
where x.ProjectId == projectid
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取分部工程个数
|
||||
/// </summary>
|
||||
/// <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;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取分项工程个数
|
||||
/// </summary>
|
||||
/// <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;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取检验批个数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetInspectionLotNum(string projectid)
|
||||
{
|
||||
int result = (from x in Funs.DB.WBS_BreakdownProject
|
||||
where x.ProjectId == projectid
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,260 @@
|
||||
using FineUIPro;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
namespace BLL
|
||||
{
|
||||
|
||||
public static class Project_HJGLData_DefectService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
|
||||
#region 获取列表
|
||||
/// <summary>
|
||||
/// 记录数
|
||||
/// </summary>
|
||||
public static int count
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
public static List<Model.Project_HJGLData_Defect> GetProject_HJGLData_DefectByModle(Model.Project_HJGLData_Defect table)
|
||||
{
|
||||
var q = from x in db.Project_HJGLData_Defect
|
||||
where
|
||||
(string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) &&
|
||||
(string.IsNullOrEmpty(table.ProjectId) || x.Id.Contains(table.ProjectId)) &&
|
||||
(string.IsNullOrEmpty(table.UnitId) || x.UnitId.Contains(table.UnitId)) &&
|
||||
(string.IsNullOrEmpty(table.CollCropCode) || x.CollCropCode.Contains(table.CollCropCode)) &&
|
||||
(string.IsNullOrEmpty(table.UnitName) || x.UnitName.Contains(table.UnitName)) &&
|
||||
(string.IsNullOrEmpty(table.DefectName) || x.DefectName.Contains(table.DefectName))
|
||||
select x
|
||||
;
|
||||
|
||||
return q.ToList();
|
||||
}
|
||||
|
||||
/// 获取分页列表
|
||||
/// </summary>
|
||||
/// <param name="PageIndex">页码</param>
|
||||
/// <param name="PageSize">每页数量</param>
|
||||
/// <returns></returns>
|
||||
public static IEnumerable getListData(Model.Project_HJGLData_Defect table, Grid Grid1)
|
||||
{
|
||||
var q = GetProject_HJGLData_DefectByModle(table);
|
||||
count = q.Count();
|
||||
if (count == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
// q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
|
||||
return from x in q
|
||||
select new
|
||||
{
|
||||
x.Id,
|
||||
x.ProjectId,
|
||||
x.UnitId,
|
||||
x.CollCropCode,
|
||||
x.UnitName,
|
||||
x.ReportDate,
|
||||
x.DefectName,
|
||||
x.DefectNum,
|
||||
|
||||
};
|
||||
}
|
||||
#endregion
|
||||
|
||||
public static Model.Project_HJGLData_Defect GetProject_HJGLData_DefectById(string Id)
|
||||
{
|
||||
return db.Project_HJGLData_Defect.FirstOrDefault(x => x.Id == Id);
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取项目该日期的缺陷分析数据
|
||||
/// </summary>
|
||||
/// <param name="reportDate"></param>
|
||||
/// <param name="projectid"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.Project_HJGLData_Defect> GetProject_HJGLData_DefectByDate(DateTime? reportDate, string projectid)
|
||||
{
|
||||
var q = from x in db.Project_HJGLData_Defect
|
||||
where x.ReportDate.Value.Date.CompareTo(reportDate.Value.Date) == 0 && x.ProjectId == projectid
|
||||
select x;
|
||||
return q.ToList();
|
||||
}
|
||||
|
||||
public static void AddProject_HJGLData_Defect(Model.Project_HJGLData_Defect newtable)
|
||||
{
|
||||
|
||||
Model.Project_HJGLData_Defect table = new Model.Project_HJGLData_Defect
|
||||
{
|
||||
Id = newtable.Id,
|
||||
ProjectId = newtable.ProjectId,
|
||||
UnitId = newtable.UnitId,
|
||||
CollCropCode = newtable.CollCropCode,
|
||||
UnitName = newtable.UnitName,
|
||||
ReportDate = newtable.ReportDate,
|
||||
DefectName = newtable.DefectName,
|
||||
DefectNum = newtable.DefectNum,
|
||||
};
|
||||
db.Project_HJGLData_Defect.InsertOnSubmit(table);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
public static void UpdateProject_HJGLData_Defect(Model.Project_HJGLData_Defect newtable)
|
||||
{
|
||||
|
||||
Model.Project_HJGLData_Defect table = db.Project_HJGLData_Defect.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.DefectName = newtable.DefectName;
|
||||
table.DefectNum = newtable.DefectNum;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void DeleteProject_HJGLData_DefectById(string Id)
|
||||
{
|
||||
|
||||
Model.Project_HJGLData_Defect table = db.Project_HJGLData_Defect.FirstOrDefault(x => x.Id == Id);
|
||||
if (table != null)
|
||||
{
|
||||
db.Project_HJGLData_Defect.DeleteOnSubmit(table);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
public static void DeleteProject_HJGLData_DefectByDate(DateTime? reportDate, string projectid)
|
||||
{
|
||||
|
||||
var table = db.Project_HJGLData_Defect.Where(x => x.ReportDate.Value.Date.CompareTo(reportDate.Value.Date) == 0 && x.ProjectId == projectid);
|
||||
if (table != null)
|
||||
{
|
||||
db.Project_HJGLData_Defect.DeleteAllOnSubmit(table);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 判断当天是否已统计数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static bool IsReportByToday(string projectid, string type)
|
||||
{
|
||||
var result = false;
|
||||
var q = (from x in Funs.DB.Project_HJGLData_Defect
|
||||
where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date && x.ProjectId == projectid && x.DefectName == type
|
||||
select x).ToList();
|
||||
if (q != null && q.Count > 0)
|
||||
{
|
||||
result = true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据projectid,获取当天的统计后的数据
|
||||
/// </summary>
|
||||
/// <param name="projectid"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Project_HJGLData_Defect getTodayProject_HJGLData_Defect(string projectid, string type)
|
||||
{
|
||||
var q = (from x in Funs.DB.Project_HJGLData_Defect
|
||||
where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date && x.ProjectId == projectid && x.DefectName == type
|
||||
select x).FirstOrDefault();
|
||||
return q;
|
||||
}
|
||||
public static List<Model.HJGLDataDefectItems> getTodayProject_HJGLData_Defect()
|
||||
{
|
||||
var q = (from x in Funs.DB.Project_HJGLData_Defect
|
||||
where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date
|
||||
group x by x.DefectName into g
|
||||
select new Model.HJGLDataDefectItems
|
||||
{
|
||||
Id = SQLHelper.GetNewID(),
|
||||
DefectName = g.Key,
|
||||
DefectNum=g.Sum (p=>p.DefectNum)
|
||||
}).ToList();
|
||||
return q;
|
||||
}
|
||||
/// <summary>
|
||||
/// 统计所有在建项目数据
|
||||
/// </summary>
|
||||
public static void StatisticalAllProjectData()
|
||||
{
|
||||
var projectlist = ProjectService.GetProjectWorkList();
|
||||
foreach (var item in projectlist)
|
||||
{
|
||||
StatisticalData(item.ProjectId);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 统计数据
|
||||
/// </summary>
|
||||
/// <param name="projectid"></param>
|
||||
public static void StatisticalData(string projectid)
|
||||
{
|
||||
string thisUnitId = BLL.Const.UnitId_CD;
|
||||
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>
|
||||
/// 获取缺陷名称
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static string GetDefectName(string projectid)
|
||||
{
|
||||
string result = "";
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取缺陷数量
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetDefectNum(string projectid)
|
||||
{
|
||||
int result = 0;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,341 @@
|
||||
using FineUIPro;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Model;
|
||||
using RestSharp;
|
||||
using Newtonsoft.Json;
|
||||
using static BLL.Project_CQMSDataService;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
|
||||
public static class Project_HJGLData_HJGLService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
/// <summary>
|
||||
/// HJGL数据类型
|
||||
/// </summary>
|
||||
public enum HJGLDateType
|
||||
{
|
||||
/// <summary>
|
||||
/// 全部数据
|
||||
/// </summary>
|
||||
All,
|
||||
/// <summary>
|
||||
/// 焊工总数
|
||||
/// </summary>
|
||||
TotalNumberOfWelders,
|
||||
/// <summary>
|
||||
/// 达因数
|
||||
/// </summary>
|
||||
ArrivalFactor,
|
||||
/// <summary>
|
||||
/// 拍片数
|
||||
/// </summary>
|
||||
NumberOfFilms,
|
||||
/// <summary>
|
||||
/// 缺陷分析
|
||||
/// </summary>
|
||||
DefectAnalysis
|
||||
|
||||
}
|
||||
|
||||
#region 获取列表
|
||||
/// <summary>
|
||||
/// 记录数
|
||||
/// </summary>
|
||||
public static int count
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
public static List<Model.Project_HJGLData_HJGL> GetProject_HJGLData_HJGLByModle(Model.Project_HJGLData_HJGL table)
|
||||
{
|
||||
var q = from x in db.Project_HJGLData_HJGL
|
||||
where
|
||||
(string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) &&
|
||||
(string.IsNullOrEmpty(table.ProjectId) || x.Id.Contains(table.ProjectId)) &&
|
||||
(string.IsNullOrEmpty(table.UnitId) || x.UnitId.Contains(table.UnitId)) &&
|
||||
(string.IsNullOrEmpty(table.CollCropCode) || x.CollCropCode.Contains(table.CollCropCode)) &&
|
||||
(string.IsNullOrEmpty(table.UnitName) || x.UnitName.Contains(table.UnitName))
|
||||
select x
|
||||
;
|
||||
|
||||
return q.ToList();
|
||||
}
|
||||
|
||||
/// 获取分页列表
|
||||
/// </summary>
|
||||
/// <param name="PageIndex">页码</param>
|
||||
/// <param name="PageSize">每页数量</param>
|
||||
/// <returns></returns>
|
||||
public static IEnumerable getListData(Model.Project_HJGLData_HJGL table, Grid Grid1)
|
||||
{
|
||||
var q = GetProject_HJGLData_HJGLByModle(table);
|
||||
count = q.Count();
|
||||
if (count == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
// q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
|
||||
return from x in q
|
||||
select new
|
||||
{
|
||||
x.Id,
|
||||
x.ProjectId,
|
||||
x.UnitId,
|
||||
x.CollCropCode,
|
||||
x.UnitName,
|
||||
x.ReportDate,
|
||||
x.WelderNum,
|
||||
x.TotalDineNum,
|
||||
x.CompleteDineNum,
|
||||
x.TotalFilmNum,
|
||||
x.OKFilmNum,
|
||||
|
||||
};
|
||||
}
|
||||
#endregion
|
||||
|
||||
public static Model.Project_HJGLData_HJGL GetProject_HJGLData_HJGLById(string Id)
|
||||
{
|
||||
return db.Project_HJGLData_HJGL.FirstOrDefault(x => x.Id == Id);
|
||||
}
|
||||
|
||||
public static List<Model.Project_HJGLData_HJGL> GetProject_HJGLData_HJGLByProjectid (string Projectid)
|
||||
{
|
||||
var q =( from x in db.Project_HJGLData_HJGL
|
||||
where x.ProjectId == Projectid
|
||||
select x).ToList();
|
||||
return q;
|
||||
}
|
||||
public static void AddProject_HJGLData_HJGL(Model.Project_HJGLData_HJGL newtable)
|
||||
{
|
||||
|
||||
Model.Project_HJGLData_HJGL table = new Model.Project_HJGLData_HJGL
|
||||
{
|
||||
Id = newtable.Id,
|
||||
ProjectId = newtable.ProjectId,
|
||||
UnitId = newtable.UnitId,
|
||||
CollCropCode = newtable.CollCropCode,
|
||||
UnitName = newtable.UnitName,
|
||||
ReportDate = newtable.ReportDate,
|
||||
WelderNum = newtable.WelderNum,
|
||||
TotalDineNum = newtable.TotalDineNum,
|
||||
CompleteDineNum = newtable.CompleteDineNum,
|
||||
TotalFilmNum = newtable.TotalFilmNum,
|
||||
OKFilmNum = newtable.OKFilmNum,
|
||||
};
|
||||
db.Project_HJGLData_HJGL.InsertOnSubmit(table);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
public static void UpdateProject_HJGLData_HJGL(Model.Project_HJGLData_HJGL newtable)
|
||||
{
|
||||
|
||||
Model.Project_HJGLData_HJGL table = db.Project_HJGLData_HJGL.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.WelderNum = newtable.WelderNum;
|
||||
table.TotalDineNum = newtable.TotalDineNum;
|
||||
table.CompleteDineNum = newtable.CompleteDineNum;
|
||||
table.TotalFilmNum = newtable.TotalFilmNum;
|
||||
table.OKFilmNum = newtable.OKFilmNum;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
public static void DeleteProject_HJGLData_HJGLById(string Id)
|
||||
{
|
||||
|
||||
Model.Project_HJGLData_HJGL table = db.Project_HJGLData_HJGL.FirstOrDefault(x => x.Id == Id);
|
||||
if (table != null)
|
||||
{
|
||||
db.Project_HJGLData_HJGL.DeleteOnSubmit(table);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 判断该项目的该日期是否统计数据
|
||||
/// </summary>
|
||||
/// <param name="dateTime"></param>
|
||||
/// <returns></returns>
|
||||
public static bool IsReportByDate(DateTime dateTime, string projectid)
|
||||
{
|
||||
var result = false;
|
||||
var q = (from x in Funs.DB.Project_HJGLData_HJGL
|
||||
where x.ReportDate >= dateTime.Date && x.ReportDate < (dateTime.Date.AddDays(1).Date) && x.ProjectId == projectid
|
||||
select x).ToList();
|
||||
if (q != null && q.Count > 0)
|
||||
{
|
||||
result = true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据projectid判断当天项目是否已统计数据
|
||||
/// </summary>
|
||||
/// <param name="projectid"></param>
|
||||
/// <returns></returns>
|
||||
public static bool IsReportByToday(string projectid)
|
||||
{
|
||||
var result = false;
|
||||
var q = (from x in Funs.DB.Project_HJGLData_HJGL
|
||||
where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date && x.ProjectId == projectid
|
||||
select x).ToList();
|
||||
if (q != null && q.Count > 0)
|
||||
{
|
||||
result = true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据projectid,获取该项目当天的统计数据
|
||||
/// </summary>
|
||||
/// <param name="projectid"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Project_HJGLData_HJGL getTodayProject_HJGLData_HJGL(string projectid)
|
||||
{
|
||||
var q = (from x in Funs.DB.Project_HJGLData_HJGL
|
||||
where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date && x.ProjectId == projectid
|
||||
select x).FirstOrDefault();
|
||||
return q;
|
||||
}
|
||||
/// <summary>
|
||||
/// 统计所有在建项目数据
|
||||
/// </summary>
|
||||
public static void StatisticalAllProjectData()
|
||||
{
|
||||
var projectlist = ProjectService.GetProjectWorkList();
|
||||
foreach (var item in projectlist)
|
||||
{
|
||||
StatisticalData(item.ProjectId, HJGLDateType.All);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 统计数据
|
||||
/// </summary>
|
||||
/// <param name="projectid">项目id</param>
|
||||
/// <param name="hJGLDateType">数据类型</param>
|
||||
public static void StatisticalData(string projectid,HJGLDateType hJGLDateType)
|
||||
{
|
||||
string thisUnitId = BLL.Const.UnitId_CD;
|
||||
var base_Unit = BLL.UnitService.GetUnitByUnitId(thisUnitId);
|
||||
Model.Project_HJGLData_HJGL table = new Model.Project_HJGLData_HJGL();
|
||||
if (IsReportByToday(projectid))
|
||||
{
|
||||
table = getTodayProject_HJGLData_HJGL(projectid);
|
||||
}
|
||||
else
|
||||
{
|
||||
table.Id = SQLHelper.GetNewID();
|
||||
}
|
||||
table.UnitId = thisUnitId;
|
||||
table.CollCropCode = base_Unit.CollCropCode;
|
||||
table.UnitName = base_Unit.UnitName;
|
||||
table.ProjectId = projectid;
|
||||
table.ReportDate = DateTime.Now.Date;
|
||||
|
||||
if (hJGLDateType== HJGLDateType.TotalNumberOfWelders|| hJGLDateType == HJGLDateType.All)
|
||||
{
|
||||
table.WelderNum = GetWelderNum(projectid);
|
||||
|
||||
}
|
||||
if (hJGLDateType == HJGLDateType.ArrivalFactor || hJGLDateType == HJGLDateType.All)
|
||||
{
|
||||
table.TotalDineNum = GetTotalDineNum(projectid);
|
||||
table.CompleteDineNum = GetCompleteDineNum(projectid);
|
||||
|
||||
}
|
||||
if (hJGLDateType == HJGLDateType.NumberOfFilms || hJGLDateType == HJGLDateType.All)
|
||||
{
|
||||
table.TotalFilmNum = GetTotalFilmNum(projectid);
|
||||
table.OKFilmNum = GetOKFilmNum(projectid);
|
||||
|
||||
|
||||
}
|
||||
if (hJGLDateType == HJGLDateType.DefectAnalysis || hJGLDateType == HJGLDateType.All)
|
||||
{
|
||||
Project_HJGLData_DefectService.StatisticalData(projectid);
|
||||
}
|
||||
|
||||
if (IsReportByToday(projectid))
|
||||
{
|
||||
UpdateProject_HJGLData_HJGL(table);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddProject_HJGLData_HJGL(table);
|
||||
}
|
||||
HJGLData_HJGLService.UpdateTodyData_State();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取焊工总数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetWelderNum(string projectid)
|
||||
{
|
||||
int result = (from x in Funs.DB.BS_Welder
|
||||
where x.ProjectId == projectid && x.WED_IfOnGuard == true
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取总达因数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetTotalDineNum(string projectid)
|
||||
{
|
||||
int result = Convert.ToInt32((from x in Funs.DB.PW_JointInfo
|
||||
where x.ProjectId == projectid
|
||||
select x.JOT_Size).ToList().Sum(x=>x.Value));
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取完成达因数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetCompleteDineNum(string projectid)
|
||||
{
|
||||
int result = Convert.ToInt32((from x in Funs.DB.PW_JointInfo
|
||||
where x.ProjectId == projectid
|
||||
select x.JOT_DoneDin ).ToList().Sum(x => x.Value));
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取总片数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetTotalFilmNum(string projectid)
|
||||
{
|
||||
int result = (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);
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取合格片数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetOKFilmNum(string projectid)
|
||||
{
|
||||
int result = (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);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,277 @@
|
||||
using FineUIPro;
|
||||
using Microsoft.SqlServer.Dts.Runtime;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
|
||||
public static class Project_HSSEData_HiddenDangerDetailService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
|
||||
#region 获取列表
|
||||
/// <summary>
|
||||
/// 记录数
|
||||
/// </summary>
|
||||
public static int count
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
public static List<Model.Project_HSSEData_HiddenDangerDetail> GetProject_HSSEData_HiddenDangerDetailByModle(Model.Project_HSSEData_HiddenDangerDetail table)
|
||||
{
|
||||
var q = from x in db.Project_HSSEData_HiddenDangerDetail
|
||||
where
|
||||
(string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) &&
|
||||
(string.IsNullOrEmpty(table.ProjectId) || x.Id.Contains(table.ProjectId)) &&
|
||||
(string.IsNullOrEmpty(table.UnitId) || x.UnitId.Contains(table.UnitId)) &&
|
||||
(string.IsNullOrEmpty(table.CollCropCode) || x.CollCropCode.Contains(table.CollCropCode)) &&
|
||||
(string.IsNullOrEmpty(table.UnitName) || x.UnitName.Contains(table.UnitName)) &&
|
||||
(string.IsNullOrEmpty(table.TypeName) || x.TypeName.Contains(table.TypeName))
|
||||
select x
|
||||
;
|
||||
|
||||
return q.ToList();
|
||||
}
|
||||
|
||||
/// 获取分页列表
|
||||
/// </summary>
|
||||
/// <param name="PageIndex">页码</param>
|
||||
/// <param name="PageSize">每页数量</param>
|
||||
/// <returns></returns>
|
||||
public static IEnumerable getListData(Model.Project_HSSEData_HiddenDangerDetail table, Grid Grid1)
|
||||
{
|
||||
var q = GetProject_HSSEData_HiddenDangerDetailByModle(table);
|
||||
count = q.Count();
|
||||
if (count == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
// q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
|
||||
return from x in q
|
||||
select new
|
||||
{
|
||||
x.Id,
|
||||
x.ProjectId,
|
||||
x.UnitId,
|
||||
x.CollCropCode,
|
||||
x.UnitName,
|
||||
x.ReportDate,
|
||||
x.TypeName,
|
||||
x.TotalNum,
|
||||
x.NeedRectifyNum,
|
||||
|
||||
};
|
||||
}
|
||||
#endregion
|
||||
|
||||
public static Model.Project_HSSEData_HiddenDangerDetail GetModelById(string Id)
|
||||
{
|
||||
return db.Project_HSSEData_HiddenDangerDetail.FirstOrDefault(x => x.Id == Id);
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取项目该日期的隐患类别数据
|
||||
/// </summary>
|
||||
/// <param name="reportDate"></param>
|
||||
/// <param name="projectid"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.Project_HSSEData_HiddenDangerDetail> GetProject_HSSEData_HiddenDangerDetailByDate(DateTime? reportDate, string projectid)
|
||||
{
|
||||
var q = from x in db.Project_HSSEData_HiddenDangerDetail
|
||||
where x.ReportDate.Value.Date.CompareTo(reportDate.Value.Date) == 0 && x.ProjectId == projectid
|
||||
select x;
|
||||
return q.ToList();
|
||||
}
|
||||
public static void AddProject_HSSEData_HiddenDangerDetail(Model.Project_HSSEData_HiddenDangerDetail newtable)
|
||||
{
|
||||
|
||||
Model.Project_HSSEData_HiddenDangerDetail table = new Model.Project_HSSEData_HiddenDangerDetail
|
||||
{
|
||||
Id = newtable.Id,
|
||||
ProjectId = newtable.ProjectId,
|
||||
UnitId = newtable.UnitId,
|
||||
CollCropCode = newtable.CollCropCode,
|
||||
UnitName = newtable.UnitName,
|
||||
ReportDate = newtable.ReportDate,
|
||||
TypeName = newtable.TypeName,
|
||||
TotalNum = newtable.TotalNum,
|
||||
NeedRectifyNum = newtable.NeedRectifyNum,
|
||||
};
|
||||
db.Project_HSSEData_HiddenDangerDetail.InsertOnSubmit(table);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
public static void UpdateProject_HSSEData_HiddenDangerDetail(Model.Project_HSSEData_HiddenDangerDetail newtable)
|
||||
{
|
||||
|
||||
Model.Project_HSSEData_HiddenDangerDetail table = db.Project_HSSEData_HiddenDangerDetail.FirstOrDefault(x => x.Id == newtable.Id);
|
||||
if (table != null)
|
||||
{
|
||||
table.Id = newtable.Id;
|
||||
table.ProjectId = table.ProjectId;
|
||||
table.UnitId = newtable.UnitId;
|
||||
table.CollCropCode = newtable.CollCropCode;
|
||||
table.UnitName = newtable.UnitName;
|
||||
table.ReportDate = newtable.ReportDate;
|
||||
table.TypeName = newtable.TypeName;
|
||||
table.TotalNum = newtable.TotalNum;
|
||||
table.NeedRectifyNum = newtable.NeedRectifyNum;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
public static void DeleteProject_HSSEData_HiddenDangerDetailById(string Id)
|
||||
{
|
||||
|
||||
Model.Project_HSSEData_HiddenDangerDetail table = db.Project_HSSEData_HiddenDangerDetail.FirstOrDefault(x => x.Id == Id);
|
||||
if (table != null)
|
||||
{
|
||||
db.Project_HSSEData_HiddenDangerDetail.DeleteOnSubmit(table);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据项目id和日期删除隐患类别数据
|
||||
/// </summary>
|
||||
/// <param name="reportDate"></param>
|
||||
/// <param name="projectid"></param>
|
||||
public static void DeleteProject_HSSEData_HiddenDangerDetailByDate(DateTime? reportDate, string projectid)
|
||||
{
|
||||
|
||||
var table = db.Project_HSSEData_HiddenDangerDetail.Where(x => x.ReportDate.Value.Date.CompareTo(reportDate.Value.Date) == 0 && x.ProjectId == projectid);
|
||||
if (table != null)
|
||||
{
|
||||
db.Project_HSSEData_HiddenDangerDetail.DeleteAllOnSubmit(table);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据projectid判断当天项目是否已统计数据
|
||||
/// </summary>
|
||||
/// <param name="projectid"></param>
|
||||
/// <returns></returns>
|
||||
public static bool IsReportByToday(string projectid, string type)
|
||||
{
|
||||
var result = false;
|
||||
var q = (from x in Funs.DB.Project_HSSEData_HiddenDangerDetail
|
||||
where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date && x.ProjectId == projectid && x.TypeName == type
|
||||
select x).ToList();
|
||||
if (q != null && q.Count > 0)
|
||||
{
|
||||
result = true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据projectid,获取该项目当天的统计数据
|
||||
/// </summary>
|
||||
/// <param name="projectid"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Project_HSSEData_HiddenDangerDetail GetTodayModelByProjectAndType(string projectid, string type)
|
||||
{
|
||||
var q = (from x in Funs.DB.Project_HSSEData_HiddenDangerDetail
|
||||
where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date && x.ProjectId == projectid && x.TypeName == type
|
||||
select x).FirstOrDefault();
|
||||
return q;
|
||||
}
|
||||
public static List<Model.HSSEDataHiddenDangerDetailItem> GetTodayModel()
|
||||
{
|
||||
var q = (from x in Funs.DB.Project_HSSEData_HiddenDangerDetail
|
||||
where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date
|
||||
group x by x.TypeName into g
|
||||
select new Model.HSSEDataHiddenDangerDetailItem
|
||||
{
|
||||
Id = SQLHelper.GetNewID(),
|
||||
TypeName= g.Key,
|
||||
NeedRectifyNum= g.Sum(p => p.NeedRectifyNum),
|
||||
TotalNum= g.Sum(p => p.TotalNum)
|
||||
}).ToList();
|
||||
return q;
|
||||
}
|
||||
public static void StatisticalAllProjectData()
|
||||
{
|
||||
var projectlist = ProjectService.GetProjectWorkList();
|
||||
foreach (var item in projectlist)
|
||||
{
|
||||
StatisticalData(item.ProjectId);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 统计数据
|
||||
/// </summary>
|
||||
/// <param name="projectid"></param>
|
||||
public static void StatisticalData(string projectid)
|
||||
{
|
||||
//var base_Unit = BLL.UnitService.GetUnitByUnitId(BLL.Const.UnitId_CD);
|
||||
//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_CD,
|
||||
// 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>
|
||||
/// 获取类别名称
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static string GetTypeName(string projectid)
|
||||
{
|
||||
string result = "";
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取全部数量
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetTotalNum(string projectid)
|
||||
{
|
||||
int result = 0;
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取待整改数量
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetNeedRectifyNum(string projectid)
|
||||
{
|
||||
int result = 0;
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,714 @@
|
||||
using FineUIPro;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Model;
|
||||
using Newtonsoft.Json;
|
||||
using static BLL.Project_HJGLData_HJGLService;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
|
||||
public static class Project_SYHSEData_SYHSEService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
/// <summary>
|
||||
/// 实业数据类型
|
||||
/// </summary>
|
||||
public enum SYHSESDateType
|
||||
{
|
||||
/// <summary>
|
||||
/// 全部数据
|
||||
/// </summary>
|
||||
All,
|
||||
/// <summary>
|
||||
/// 风险管控数据
|
||||
/// </summary>
|
||||
RiskControl,
|
||||
/// <summary>
|
||||
/// 重大危险源数据
|
||||
/// </summary>
|
||||
MajorHazardSources,
|
||||
/// <summary>
|
||||
/// 基本数据
|
||||
/// </summary>
|
||||
Basic,
|
||||
/// <summary>
|
||||
/// 环保数据
|
||||
/// </summary>
|
||||
EnvironmentalData,
|
||||
/// <summary>
|
||||
/// 隐患排查治理数据
|
||||
/// </summary>
|
||||
TroubleshootingAndTreatment,
|
||||
/// <summary>
|
||||
/// 作业管理数据
|
||||
/// </summary>
|
||||
JobManagementData
|
||||
|
||||
}
|
||||
|
||||
#region 获取列表
|
||||
/// <summary>
|
||||
/// 记录数
|
||||
/// </summary>
|
||||
public static int count
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
public static List<Model.Project_SYHSEData_SYHSE> GetProject_SYHSEData_SYHSEByModle(Model.Project_SYHSEData_SYHSE table)
|
||||
{
|
||||
var q = from x in db.Project_SYHSEData_SYHSE
|
||||
where
|
||||
(string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) &&
|
||||
(string.IsNullOrEmpty(table.ProjectId) || x.Id.Contains(table.ProjectId)) &&
|
||||
(string.IsNullOrEmpty(table.UnitId) || x.UnitId.Contains(table.UnitId)) &&
|
||||
(string.IsNullOrEmpty(table.CollCropCode) || x.CollCropCode.Contains(table.CollCropCode)) &&
|
||||
(string.IsNullOrEmpty(table.UnitName) || x.UnitName.Contains(table.UnitName))
|
||||
select x
|
||||
;
|
||||
|
||||
return q.ToList();
|
||||
}
|
||||
|
||||
/// 获取分页列表
|
||||
/// </summary>
|
||||
/// <param name="PageIndex">页码</param>
|
||||
/// <param name="PageSize">每页数量</param>
|
||||
/// <returns></returns>
|
||||
public static IEnumerable getListData(Model.Project_SYHSEData_SYHSE table, Grid Grid1)
|
||||
{
|
||||
var q = GetProject_SYHSEData_SYHSEByModle(table);
|
||||
count = q.Count();
|
||||
if (count == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
//q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
|
||||
return from x in q
|
||||
select new
|
||||
{
|
||||
x.Id,
|
||||
x.ProjectId,
|
||||
x.UnitId,
|
||||
x.CollCropCode,
|
||||
x.UnitName,
|
||||
x.ReportDate,
|
||||
x.GeneralRiskNum,
|
||||
x.LowRiskNum,
|
||||
x.MediumRiskNum,
|
||||
x.HighRiskNum,
|
||||
x.GradedResponsiblePersonNum,
|
||||
x.ChargeInsurancePersonNum,
|
||||
x.DesignQuantity,
|
||||
x.RunningCapacity,
|
||||
x.InterlockSettingValue,
|
||||
x.VideoSurveillanceNum,
|
||||
x.TotalWorkinghours,
|
||||
x.SafeWorkinghours,
|
||||
x.LostWorkinghours,
|
||||
x.TotalEnergyConsumption,
|
||||
x.IncomeComprehensiveEnergyConsumption,
|
||||
x.NewWaterConsumption,
|
||||
x.GeneralClosedNum,
|
||||
x.GeneralNotClosedNum,
|
||||
x.MajorClosedNum,
|
||||
x.MajorNotClosedNum,
|
||||
x.HotWorkPermitNum,
|
||||
x.HotWorkClosedNum,
|
||||
x.HighPermitNum,
|
||||
x.HighClosedNum,
|
||||
x.TemporaryElectricityPermitNum,
|
||||
x.TemporaryElectricityClosedNum,
|
||||
x.BlindPlatePermitNum,
|
||||
x.BlindPlateClosedNum,
|
||||
x.GroundbreakingPermitNum,
|
||||
x.GroundbreakingClosedNum,
|
||||
x.OpenCircuitPermitNum,
|
||||
x.OpenCircuitClosedNum,
|
||||
x.HoistingPermitNum,
|
||||
x.HoistingClosedNum,
|
||||
|
||||
};
|
||||
}
|
||||
#endregion
|
||||
|
||||
public static Model.Project_SYHSEData_SYHSE GetProject_SYHSEData_SYHSEById(string Id)
|
||||
{
|
||||
return db.Project_SYHSEData_SYHSE.FirstOrDefault(x => x.Id == Id);
|
||||
}
|
||||
public static void AddProject_SYHSEData_SYHSE(Model.Project_SYHSEData_SYHSE newtable)
|
||||
{
|
||||
|
||||
Model.Project_SYHSEData_SYHSE table = new Model.Project_SYHSEData_SYHSE
|
||||
{
|
||||
Id = newtable.Id,
|
||||
ProjectId = newtable.ProjectId,
|
||||
UnitId = newtable.UnitId,
|
||||
CollCropCode = newtable.CollCropCode,
|
||||
UnitName = newtable.UnitName,
|
||||
ReportDate = newtable.ReportDate,
|
||||
GeneralRiskNum = newtable.GeneralRiskNum,
|
||||
LowRiskNum = newtable.LowRiskNum,
|
||||
MediumRiskNum = newtable.MediumRiskNum,
|
||||
HighRiskNum = newtable.HighRiskNum,
|
||||
GradedResponsiblePersonNum = newtable.GradedResponsiblePersonNum,
|
||||
ChargeInsurancePersonNum = newtable.ChargeInsurancePersonNum,
|
||||
DesignQuantity = newtable.DesignQuantity,
|
||||
RunningCapacity = newtable.RunningCapacity,
|
||||
InterlockSettingValue = newtable.InterlockSettingValue,
|
||||
VideoSurveillanceNum = newtable.VideoSurveillanceNum,
|
||||
TotalWorkinghours = newtable.TotalWorkinghours,
|
||||
SafeWorkinghours = newtable.SafeWorkinghours,
|
||||
LostWorkinghours = newtable.LostWorkinghours,
|
||||
TotalEnergyConsumption = newtable.TotalEnergyConsumption,
|
||||
IncomeComprehensiveEnergyConsumption = newtable.IncomeComprehensiveEnergyConsumption,
|
||||
NewWaterConsumption = newtable.NewWaterConsumption,
|
||||
GeneralClosedNum = newtable.GeneralClosedNum,
|
||||
GeneralNotClosedNum = newtable.GeneralNotClosedNum,
|
||||
MajorClosedNum = newtable.MajorClosedNum,
|
||||
MajorNotClosedNum = newtable.MajorNotClosedNum,
|
||||
HotWorkPermitNum = newtable.HotWorkPermitNum,
|
||||
HotWorkClosedNum = newtable.HotWorkClosedNum,
|
||||
HighPermitNum = newtable.HighPermitNum,
|
||||
HighClosedNum = newtable.HighClosedNum,
|
||||
TemporaryElectricityPermitNum = newtable.TemporaryElectricityPermitNum,
|
||||
TemporaryElectricityClosedNum = newtable.TemporaryElectricityClosedNum,
|
||||
BlindPlatePermitNum = newtable.BlindPlatePermitNum,
|
||||
BlindPlateClosedNum = newtable.BlindPlateClosedNum,
|
||||
GroundbreakingPermitNum = newtable.GroundbreakingPermitNum,
|
||||
GroundbreakingClosedNum = newtable.GroundbreakingClosedNum,
|
||||
OpenCircuitPermitNum = newtable.OpenCircuitPermitNum,
|
||||
OpenCircuitClosedNum = newtable.OpenCircuitClosedNum,
|
||||
HoistingPermitNum = newtable.HoistingPermitNum,
|
||||
HoistingClosedNum = newtable.HoistingClosedNum,
|
||||
};
|
||||
db.Project_SYHSEData_SYHSE.InsertOnSubmit(table);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
public static void UpdateProject_SYHSEData_SYHSE(Model.Project_SYHSEData_SYHSE newtable)
|
||||
{
|
||||
|
||||
Model.Project_SYHSEData_SYHSE table = db.Project_SYHSEData_SYHSE.FirstOrDefault(x => x.Id == newtable.Id);
|
||||
if (table != null)
|
||||
{
|
||||
table.Id = newtable.Id;
|
||||
table.ProjectId=newtable.ProjectId;
|
||||
table.UnitId = newtable.UnitId;
|
||||
table.CollCropCode = newtable.CollCropCode;
|
||||
table.UnitName = newtable.UnitName;
|
||||
table.ReportDate = newtable.ReportDate;
|
||||
table.GeneralRiskNum = newtable.GeneralRiskNum;
|
||||
table.LowRiskNum = newtable.LowRiskNum;
|
||||
table.MediumRiskNum = newtable.MediumRiskNum;
|
||||
table.HighRiskNum = newtable.HighRiskNum;
|
||||
table.GradedResponsiblePersonNum = newtable.GradedResponsiblePersonNum;
|
||||
table.ChargeInsurancePersonNum = newtable.ChargeInsurancePersonNum;
|
||||
table.DesignQuantity = newtable.DesignQuantity;
|
||||
table.RunningCapacity = newtable.RunningCapacity;
|
||||
table.InterlockSettingValue = newtable.InterlockSettingValue;
|
||||
table.VideoSurveillanceNum = newtable.VideoSurveillanceNum;
|
||||
table.TotalWorkinghours = newtable.TotalWorkinghours;
|
||||
table.SafeWorkinghours = newtable.SafeWorkinghours;
|
||||
table.LostWorkinghours = newtable.LostWorkinghours;
|
||||
table.TotalEnergyConsumption = newtable.TotalEnergyConsumption;
|
||||
table.IncomeComprehensiveEnergyConsumption = newtable.IncomeComprehensiveEnergyConsumption;
|
||||
table.NewWaterConsumption = newtable.NewWaterConsumption;
|
||||
table.GeneralClosedNum = newtable.GeneralClosedNum;
|
||||
table.GeneralNotClosedNum = newtable.GeneralNotClosedNum;
|
||||
table.MajorClosedNum = newtable.MajorClosedNum;
|
||||
table.MajorNotClosedNum = newtable.MajorNotClosedNum;
|
||||
table.HotWorkPermitNum = newtable.HotWorkPermitNum;
|
||||
table.HotWorkClosedNum = newtable.HotWorkClosedNum;
|
||||
table.HighPermitNum = newtable.HighPermitNum;
|
||||
table.HighClosedNum = newtable.HighClosedNum;
|
||||
table.TemporaryElectricityPermitNum = newtable.TemporaryElectricityPermitNum;
|
||||
table.TemporaryElectricityClosedNum = newtable.TemporaryElectricityClosedNum;
|
||||
table.BlindPlatePermitNum = newtable.BlindPlatePermitNum;
|
||||
table.BlindPlateClosedNum = newtable.BlindPlateClosedNum;
|
||||
table.GroundbreakingPermitNum = newtable.GroundbreakingPermitNum;
|
||||
table.GroundbreakingClosedNum = newtable.GroundbreakingClosedNum;
|
||||
table.OpenCircuitPermitNum = newtable.OpenCircuitPermitNum;
|
||||
table.OpenCircuitClosedNum = newtable.OpenCircuitClosedNum;
|
||||
table.HoistingPermitNum = newtable.HoistingPermitNum;
|
||||
table.HoistingClosedNum = newtable.HoistingClosedNum;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
public static void DeleteProject_SYHSEData_SYHSEById(string Id)
|
||||
{
|
||||
|
||||
Model.Project_SYHSEData_SYHSE table = db.Project_SYHSEData_SYHSE.FirstOrDefault(x => x.Id == Id);
|
||||
if (table != null)
|
||||
{
|
||||
db.Project_SYHSEData_SYHSE.DeleteOnSubmit(table);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 判断当天是否统计过数据
|
||||
/// </summary>
|
||||
/// <param name="projectid"></param>
|
||||
/// <returns></returns>
|
||||
public static bool IsReportByToday(string projectid)
|
||||
{
|
||||
var result = false;
|
||||
var q = (from x in Funs.DB.Project_SYHSEData_SYHSE
|
||||
where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date && x.ProjectId == projectid
|
||||
select x).ToList();
|
||||
if (q != null && q.Count > 0)
|
||||
{
|
||||
result = true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取当天统计后的数据
|
||||
/// </summary>
|
||||
/// <param name="projectid"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Project_SYHSEData_SYHSE getTodayProject_SYHSEData_SYHSE(string projectid)
|
||||
{
|
||||
var q = (from x in Funs.DB.Project_SYHSEData_SYHSE
|
||||
where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date && x.ProjectId == projectid
|
||||
select x).FirstOrDefault();
|
||||
return q;
|
||||
}
|
||||
/// <summary>
|
||||
/// 统计所有在建项目数据
|
||||
/// </summary>
|
||||
public static void StatisticalAllProjectData()
|
||||
{
|
||||
var projectlist = ProjectService.GetProjectWorkList();
|
||||
foreach (var item in projectlist)
|
||||
{
|
||||
StatisticalData(item.ProjectId, SYHSESDateType.All);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 统计数据
|
||||
/// </summary>
|
||||
/// <param name="projectid"></param>
|
||||
/// <param name="sYHSESDateType"></param>
|
||||
public static void StatisticalData(string projectid,SYHSESDateType sYHSESDateType)
|
||||
{
|
||||
string thisUnitId = BLL.Const.UnitId_CD;
|
||||
var base_Unit = BLL.UnitService.GetUnitByUnitId(thisUnitId);
|
||||
Model.Project_SYHSEData_SYHSE table = new Model.Project_SYHSEData_SYHSE();
|
||||
if (IsReportByToday(projectid))
|
||||
{
|
||||
table = getTodayProject_SYHSEData_SYHSE(projectid);
|
||||
}
|
||||
else
|
||||
{
|
||||
table.Id = SQLHelper.GetNewID();
|
||||
}
|
||||
table.UnitId = thisUnitId;
|
||||
table.CollCropCode = base_Unit.CollCropCode;
|
||||
table.UnitName = base_Unit.UnitName;
|
||||
table.ProjectId = projectid;
|
||||
table.ReportDate = DateTime.Now.Date;
|
||||
|
||||
if (sYHSESDateType== SYHSESDateType.RiskControl || sYHSESDateType == SYHSESDateType.All)
|
||||
{
|
||||
table.GeneralRiskNum = GetGeneralRiskNum(projectid);
|
||||
table.LowRiskNum = GetLowRiskNum(projectid);
|
||||
table.MediumRiskNum = GetMediumRiskNum(projectid);
|
||||
table.HighRiskNum = GetHighRiskNum(projectid);
|
||||
|
||||
}
|
||||
if (sYHSESDateType == SYHSESDateType.MajorHazardSources || sYHSESDateType == SYHSESDateType.All)
|
||||
{
|
||||
table.GradedResponsiblePersonNum = GetGradedResponsiblePersonNum(projectid);
|
||||
table.ChargeInsurancePersonNum = GetChargeInsurancePersonNum(projectid);
|
||||
table.DesignQuantity = GetDesignQuantity(projectid);
|
||||
table.RunningCapacity = GetRunningCapacity(projectid);
|
||||
table.InterlockSettingValue = GetInterlockSettingValue(projectid);
|
||||
table.VideoSurveillanceNum = GetVideoSurveillanceNum(projectid);
|
||||
|
||||
}
|
||||
if (sYHSESDateType == SYHSESDateType.Basic || sYHSESDateType == SYHSESDateType.All)
|
||||
{
|
||||
table.TotalWorkinghours = GetTotalWorkinghours(projectid);
|
||||
table.SafeWorkinghours = GetSafeWorkinghours(projectid);
|
||||
table.LostWorkinghours = GetLostWorkinghours(projectid);
|
||||
|
||||
}
|
||||
if (sYHSESDateType == SYHSESDateType.EnvironmentalData || sYHSESDateType == SYHSESDateType.All)
|
||||
{
|
||||
table.TotalEnergyConsumption = GetTotalEnergyConsumption(projectid);
|
||||
table.IncomeComprehensiveEnergyConsumption = GetIncomeComprehensiveEnergyConsumption(projectid);
|
||||
table.NewWaterConsumption = GetNewWaterConsumption(projectid);
|
||||
|
||||
}
|
||||
if (sYHSESDateType == SYHSESDateType.TroubleshootingAndTreatment || sYHSESDateType == SYHSESDateType.All)
|
||||
{
|
||||
table.GeneralClosedNum = GetGeneralClosedNum(projectid);
|
||||
table.GeneralNotClosedNum = GetGeneralNotClosedNum(projectid);
|
||||
table.MajorClosedNum = GetMajorClosedNum(projectid);
|
||||
table.MajorNotClosedNum = GetMajorNotClosedNum(projectid);
|
||||
|
||||
}
|
||||
if (sYHSESDateType == SYHSESDateType.JobManagementData || sYHSESDateType == SYHSESDateType.All)
|
||||
{
|
||||
table.HotWorkPermitNum = GetHotWorkPermitNum(projectid);
|
||||
table.HotWorkClosedNum = GetHotWorkClosedNum(projectid);
|
||||
table.HighPermitNum = GetHighPermitNum(projectid);
|
||||
table.HighClosedNum = GetHighClosedNum(projectid);
|
||||
table.TemporaryElectricityPermitNum = GetTemporaryElectricityPermitNum(projectid);
|
||||
table.TemporaryElectricityClosedNum = GetTemporaryElectricityClosedNum(projectid);
|
||||
table.BlindPlatePermitNum = GetBlindPlatePermitNum(projectid);
|
||||
table.BlindPlateClosedNum = GetBlindPlateClosedNum(projectid);
|
||||
table.GroundbreakingPermitNum = GetGroundbreakingPermitNum(projectid);
|
||||
table.GroundbreakingClosedNum = GetGroundbreakingClosedNum(projectid);
|
||||
table.OpenCircuitPermitNum = GetOpenCircuitPermitNum(projectid);
|
||||
table.OpenCircuitClosedNum = GetOpenCircuitClosedNum(projectid);
|
||||
table.HoistingPermitNum = GetHoistingPermitNum(projectid);
|
||||
table.HoistingClosedNum = GetHoistingClosedNum(projectid);
|
||||
|
||||
}
|
||||
|
||||
if (IsReportByToday(projectid))
|
||||
{
|
||||
UpdateProject_SYHSEData_SYHSE(table);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddProject_SYHSEData_SYHSE(table);
|
||||
}
|
||||
SYHSEData_SYHSEService.UpdateTodyData_State();
|
||||
}
|
||||
/// <summary>
|
||||
/// 判断该项目的该日期是否统计数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static bool IsReportByDate(DateTime dateTime, string projectid)
|
||||
{
|
||||
var result = false;
|
||||
var q = (from x in Funs.DB.Project_SYHSEData_SYHSE
|
||||
where x.ReportDate >= dateTime.Date && x.ReportDate < (dateTime.Date.AddDays(1).Date) && x.ProjectId == projectid
|
||||
select x).ToList();
|
||||
if (q != null && q.Count > 0)
|
||||
{
|
||||
result = true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取一般风险数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetGeneralRiskNum(string projectid)
|
||||
{
|
||||
int result = 0;
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取低风险数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetLowRiskNum(string projectid)
|
||||
{
|
||||
int result = 0;
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取中风险数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetMediumRiskNum(string projectid)
|
||||
{
|
||||
int result = 0;
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取高风险数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetHighRiskNum(string projectid)
|
||||
{
|
||||
int result = 0;
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取分级责任人数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetGradedResponsiblePersonNum(string projectid)
|
||||
{
|
||||
int result = 0;
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取包保责任人数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetChargeInsurancePersonNum(string projectid)
|
||||
{
|
||||
int result = 0;
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取设计量
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetDesignQuantity(string projectid)
|
||||
{
|
||||
int result = 0;
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取运行量
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetRunningCapacity(string projectid)
|
||||
{
|
||||
int result = 0;
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取联锁设定值
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetInterlockSettingValue(string projectid)
|
||||
{
|
||||
int result = 0;
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取视频监控数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetVideoSurveillanceNum(string projectid)
|
||||
{
|
||||
int result = 0;
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取总工时数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetTotalWorkinghours(string projectid)
|
||||
{
|
||||
int result = 0;
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取安全工时数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetSafeWorkinghours(string projectid)
|
||||
{
|
||||
int result = 0;
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取损失工时数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetLostWorkinghours(string projectid)
|
||||
{
|
||||
int result = 0;
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取能耗总量
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetTotalEnergyConsumption(string projectid)
|
||||
{
|
||||
int result = 0;
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取万元营业收入综合能耗
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetIncomeComprehensiveEnergyConsumption(string projectid)
|
||||
{
|
||||
int result = 0;
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取用新水量
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetNewWaterConsumption(string projectid)
|
||||
{
|
||||
int result = 0;
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取一般隐患整改闭环项
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetGeneralClosedNum(string projectid)
|
||||
{
|
||||
int result = 0;
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取一般隐患未整改完成项
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetGeneralNotClosedNum(string projectid)
|
||||
{
|
||||
int result = 0;
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取重大隐患整改闭环项
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetMajorClosedNum(string projectid)
|
||||
{
|
||||
int result = 0;
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取重大隐患未整改完成项
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetMajorNotClosedNum(string projectid)
|
||||
{
|
||||
int result = 0;
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取动火许可项数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetHotWorkPermitNum(string projectid)
|
||||
{
|
||||
int result = 0;
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取动火关闭项数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetHotWorkClosedNum(string projectid)
|
||||
{
|
||||
int result = 0;
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取高处许可项数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetHighPermitNum(string projectid)
|
||||
{
|
||||
int result = 0;
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取高处关闭项数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetHighClosedNum(string projectid)
|
||||
{
|
||||
int result = 0;
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取临电许可项数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetTemporaryElectricityPermitNum(string projectid)
|
||||
{
|
||||
int result = 0;
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取临电关闭项数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetTemporaryElectricityClosedNum(string projectid)
|
||||
{
|
||||
int result = 0;
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取盲板许可项数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetBlindPlatePermitNum(string projectid)
|
||||
{
|
||||
int result = 0;
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取盲板关闭项数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetBlindPlateClosedNum(string projectid)
|
||||
{
|
||||
int result = 0;
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取动土许可项数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetGroundbreakingPermitNum(string projectid)
|
||||
{
|
||||
int result = 0;
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取动土关闭项数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetGroundbreakingClosedNum(string projectid)
|
||||
{
|
||||
int result = 0;
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取断路许可项数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetOpenCircuitPermitNum(string projectid)
|
||||
{
|
||||
int result = 0;
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取断路关闭项数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetOpenCircuitClosedNum(string projectid)
|
||||
{
|
||||
int result = 0;
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取吊装许可项数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetHoistingPermitNum(string projectid)
|
||||
{
|
||||
int result = 0;
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取吊装关闭项数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetHoistingClosedNum(string projectid)
|
||||
{
|
||||
int result = 0;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user