提交代码
This commit is contained in:
@@ -7,12 +7,14 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using Model;
|
||||
using Newtonsoft.Json;
|
||||
using Microsoft.SqlServer.Dts.Runtime;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
|
||||
public static class Project_CQMSDataService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
/// <summary>
|
||||
/// CQMS数据类型
|
||||
/// </summary>
|
||||
@@ -47,6 +49,18 @@ namespace BLL
|
||||
/// </summary>
|
||||
ProjectDivision,
|
||||
/// <summary>
|
||||
/// 报验数据
|
||||
/// </summary>
|
||||
Inspection,
|
||||
/// <summary>
|
||||
/// 施工方案数据
|
||||
/// </summary>
|
||||
ConstructSolution,
|
||||
/// <summary>
|
||||
/// 特种设备质保体系和图纸会审/设计交底
|
||||
/// </summary>
|
||||
SpecialEquipmentAndDesignDetails,
|
||||
/// <summary>
|
||||
/// 全部数据
|
||||
/// </summary>
|
||||
All
|
||||
@@ -63,7 +77,7 @@ namespace BLL
|
||||
}
|
||||
public static List<Model.Project_CQMSData_CQMS> GetProject_CQMSData_CQMSByModle(Model.Project_CQMSData_CQMS table)
|
||||
{
|
||||
var q = from x in Funs.DB.Project_CQMSData_CQMS
|
||||
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)) &&
|
||||
@@ -140,11 +154,11 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static Model.Project_CQMSData_CQMS GetProject_CQMSData_CQMSById(string Id)
|
||||
{
|
||||
return Funs.DB.Project_CQMSData_CQMS.FirstOrDefault(x => x.Id == 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 Funs.DB.Project_CQMSData_CQMS
|
||||
var q = (from x in db.Project_CQMSData_CQMS
|
||||
where x.ProjectId == projectid
|
||||
select x).ToList();
|
||||
return q;
|
||||
@@ -194,6 +208,25 @@ namespace BLL
|
||||
SubProjectNum = newtable.SubProjectNum,
|
||||
SubdivisionalWorksNum = newtable.SubdivisionalWorksNum,
|
||||
InspectionLotNum = newtable.InspectionLotNum,
|
||||
EquipmentInspectionNum = newtable.EquipmentInspectionNum,
|
||||
EquipmentInspectionQualifiedNum = newtable.EquipmentInspectionQualifiedNum,
|
||||
MachineInspectionNum = newtable.MachineInspectionNum,
|
||||
MachineInspectionQualifiedNum = newtable.MachineInspectionQualifiedNum,
|
||||
PersonInspectionNum = newtable.PersonInspectionNum,
|
||||
PersonInspectionQualifiedNum = newtable.PersonInspectionQualifiedNum,
|
||||
MaterialInspectionNum = newtable.MaterialInspectionNum,
|
||||
MaterialInspectionQualifiedNum = newtable.MaterialInspectionQualifiedNum,
|
||||
ConstructSolutionNum = newtable.ConstructSolutionNum,
|
||||
ConstructSolutionProjectApproveNum = newtable.ConstructSolutionProjectApproveNum,
|
||||
ConstructSolutionUnitApproveNum = newtable.ConstructSolutionUnitApproveNum,
|
||||
SpecialEquipmentQualityAssuranceSystemNum = newtable.SpecialEquipmentQualityAssuranceSystemNum,
|
||||
DesignDetailsNum = newtable.DesignDetailsNum,
|
||||
UnitProjectAcceptNum = newtable.UnitProjectAcceptNum,
|
||||
UnitProjectAcceptOKNum = newtable.UnitProjectAcceptOKNum,
|
||||
SubProjectAcceptNum = newtable.SubProjectAcceptNum,
|
||||
SubProjectAcceptOKNum = newtable.SubProjectAcceptOKNum,
|
||||
SubdivisionalWorksAcceptNum = newtable.SubdivisionalWorksAcceptNum,
|
||||
SubdivisionalWorksAcceptOKNum = newtable.SubdivisionalWorksAcceptOKNum
|
||||
};
|
||||
db.Project_CQMSData_CQMS.InsertOnSubmit(table);
|
||||
db.SubmitChanges();
|
||||
@@ -246,6 +279,25 @@ namespace BLL
|
||||
table.SubProjectNum = newtable.SubProjectNum;
|
||||
table.SubdivisionalWorksNum = newtable.SubdivisionalWorksNum;
|
||||
table.InspectionLotNum = newtable.InspectionLotNum;
|
||||
table.EquipmentInspectionNum = newtable.EquipmentInspectionNum;
|
||||
table.EquipmentInspectionQualifiedNum = newtable.EquipmentInspectionQualifiedNum;
|
||||
table.MachineInspectionNum = newtable.MachineInspectionNum;
|
||||
table.MachineInspectionQualifiedNum = newtable.MachineInspectionQualifiedNum;
|
||||
table.PersonInspectionNum = newtable.PersonInspectionNum;
|
||||
table.PersonInspectionQualifiedNum = newtable.PersonInspectionQualifiedNum;
|
||||
table.MaterialInspectionNum = newtable.MaterialInspectionNum;
|
||||
table.MaterialInspectionQualifiedNum = newtable.MaterialInspectionQualifiedNum;
|
||||
table.ConstructSolutionNum = newtable.ConstructSolutionNum;
|
||||
table.ConstructSolutionProjectApproveNum = newtable.ConstructSolutionProjectApproveNum;
|
||||
table.ConstructSolutionUnitApproveNum = newtable.ConstructSolutionUnitApproveNum;
|
||||
table.SpecialEquipmentQualityAssuranceSystemNum = newtable.SpecialEquipmentQualityAssuranceSystemNum;
|
||||
table.DesignDetailsNum = newtable.DesignDetailsNum;
|
||||
table.UnitProjectAcceptNum = newtable.UnitProjectAcceptNum;
|
||||
table.UnitProjectAcceptOKNum = newtable.UnitProjectAcceptOKNum;
|
||||
table.SubProjectAcceptNum = newtable.SubProjectAcceptNum;
|
||||
table.SubProjectAcceptOKNum = newtable.SubProjectAcceptOKNum;
|
||||
table.SubdivisionalWorksAcceptNum = newtable.SubdivisionalWorksAcceptNum;
|
||||
table.SubdivisionalWorksAcceptOKNum = newtable.SubdivisionalWorksAcceptOKNum;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
@@ -268,6 +320,20 @@ namespace BLL
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static void DeleteProject_CQMSData_CQMByDate(DateTime? reportDate)
|
||||
{
|
||||
using (var db = new SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var table = db.Project_CQMSData_CQMS.Where(x => x.ReportDate.Value.Date.CompareTo(reportDate.Value.Date) == 0);
|
||||
if (table != null)
|
||||
{
|
||||
db.Project_CQMSData_CQMS.DeleteAllOnSubmit(table);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据projectid判断当天项目是否已统计数据
|
||||
/// </summary>
|
||||
@@ -321,6 +387,7 @@ namespace BLL
|
||||
StatisticalData(item.ProjectId, CQMSDateType.All);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 统计数据
|
||||
/// </summary>
|
||||
@@ -391,6 +458,13 @@ namespace BLL
|
||||
table.UnitProjectOnesOKNum = GetUnitProjectOnesOKNum(projectid);
|
||||
table.MaterialInRecheckNum = GetMaterialInRecheckNum(projectid);
|
||||
table.MaterialInRecheckOKNum = GetMaterialInRecheckOKNum(projectid);
|
||||
|
||||
table.UnitProjectAcceptNum = GetUnitProjectOnesNum(projectid);
|
||||
table.UnitProjectAcceptOKNum = GetUnitProjectOnesOKNum(projectid);
|
||||
table.SubProjectAcceptNum = GetMaterialInRecheckNum(projectid);
|
||||
table.SubProjectAcceptOKNum = GetMaterialInRecheckOKNum(projectid);
|
||||
table.SubdivisionalWorksAcceptNum = GetSubdivisionalWorksAcceptNum(projectid);
|
||||
table.SubdivisionalWorksAcceptOKNum = GetSubdivisionalWorksAcceptOKNum(projectid);
|
||||
}
|
||||
if (cQMSDateType == CQMSDateType.ProjectDivision || cQMSDateType == CQMSDateType.All)
|
||||
{
|
||||
@@ -400,6 +474,28 @@ namespace BLL
|
||||
table.SubdivisionalWorksNum = GetSubdivisionalWorksNum(projectid);
|
||||
table.InspectionLotNum = GetInspectionLotNum(projectid);
|
||||
}
|
||||
if (cQMSDateType == CQMSDateType.Inspection || cQMSDateType == CQMSDateType.All)
|
||||
{
|
||||
table.EquipmentInspectionNum = GetComprehensiveInspectionEquipmentNum(projectid);
|
||||
table.EquipmentInspectionQualifiedNum = GetComprehensiveInspectionEquipmentOKNum(projectid);
|
||||
table.MachineInspectionNum = GetComprehensiveInspectionMachineNum(projectid);
|
||||
table.MachineInspectionQualifiedNum = GetComprehensiveInspectionMachineOKNum(projectid);
|
||||
table.PersonInspectionNum = GetComprehensiveInspectionPersonNum(projectid);
|
||||
table.PersonInspectionQualifiedNum = GetComprehensiveInspectionPersonOKNum(projectid);
|
||||
table.MaterialInspectionNum = GetComprehensiveInspectionMaterialNum(projectid);
|
||||
table.MaterialInspectionQualifiedNum = GetComprehensiveInspectionMaterialOKNum(projectid);
|
||||
}
|
||||
if (cQMSDateType == CQMSDateType.ConstructSolution || cQMSDateType == CQMSDateType.All)
|
||||
{
|
||||
table.ConstructSolutionNum = GetConstructSolutionNum(projectid);
|
||||
table.ConstructSolutionProjectApproveNum = GetConstructSolutionProjectApproveNum(projectid);
|
||||
table.ConstructSolutionUnitApproveNum = GetConstructSolutionUnitApproveNum(projectid);
|
||||
}
|
||||
if (cQMSDateType == CQMSDateType.SpecialEquipmentAndDesignDetails || cQMSDateType == CQMSDateType.All)
|
||||
{
|
||||
table.SpecialEquipmentQualityAssuranceSystemNum = GetSpecialEquipmentQualityAssuranceSystemNum(projectid);
|
||||
table.DesignDetailsNum = GetTechnicalDisclosePersonNum(projectid);
|
||||
}
|
||||
|
||||
if (IsReportByToday(projectid))
|
||||
{
|
||||
@@ -484,7 +580,7 @@ namespace BLL
|
||||
{
|
||||
int result = (from x in Funs.DB.SitePerson_Person
|
||||
join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId
|
||||
where x.ProjectId == projectid && y.IsCQMS == true && x.States == "1"
|
||||
where x.ProjectId == projectid && y.IsCQMS == true
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
@@ -690,14 +786,40 @@ namespace BLL
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取分项工程验收数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetSubdivisionalWorksAcceptNum(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 == "6" && x.CreateDate > Const.DtmarkTime
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取分项工程验收合格数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetSubdivisionalWorksAcceptOKNum(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 == "6" && z.IsOnceQualified == true && x.CreateDate > Const.DtmarkTime
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取单项工程个数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetSingleProjectNum(string projectid)
|
||||
{
|
||||
int result = (from x in Funs.DB.WBS_UnitWork
|
||||
where x.ProjectId == projectid
|
||||
int result = (from x in Funs.DB.ProjectData_MainItem
|
||||
where x.ProjectId == projectid
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
@@ -746,6 +868,148 @@ namespace BLL
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设备报验-报检数
|
||||
/// </summary>
|
||||
/// <param name="projectid"></param>
|
||||
/// <returns></returns>
|
||||
public static int GetComprehensiveInspectionEquipmentNum(string projectid)
|
||||
{
|
||||
int result = (from x in Funs.DB.Check_CheckEquipment
|
||||
where x.ProjectId == projectid && x.CompileDate > Const.DtmarkTime
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 设备报验-报检合格数
|
||||
/// </summary>
|
||||
/// <param name="projectid"></param>
|
||||
/// <returns></returns>
|
||||
public static int GetComprehensiveInspectionEquipmentOKNum(string projectid)
|
||||
{
|
||||
int result = (from x in Funs.DB.Check_CheckEquipment
|
||||
where x.ProjectId == projectid && x.IsCheckCertificate == true && x.CompileDate > Const.DtmarkTime
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取机具报验-报检数
|
||||
/// </summary>
|
||||
/// <param name="projectid"></param>
|
||||
/// <returns></returns>
|
||||
public static int GetComprehensiveInspectionMachineNum(string projectid)
|
||||
{
|
||||
int result = (from x in Funs.DB.Comprehensive_InspectionMachine
|
||||
where x.ProjectId == projectid && x.CompileDate > Const.DtmarkTime
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取机具报验-报检合格数
|
||||
/// </summary>
|
||||
/// <param name="projectid"></param>
|
||||
/// <returns></returns>
|
||||
public static int GetComprehensiveInspectionMachineOKNum(string projectid)
|
||||
{
|
||||
int result = (from x in Funs.DB.Comprehensive_InspectionMachine
|
||||
where x.ProjectId == projectid && x.IsCheckOK.HasValue && x.IsCheckOK == true && x.CompileDate > Const.DtmarkTime
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取人员报验-报检数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetComprehensiveInspectionPersonNum(string projectid)
|
||||
{
|
||||
var result = (from x in Funs.DB.Comprehensive_InspectionPerson
|
||||
where x.ProjectId == projectid && x.IsOnSite.HasValue && x.CompileDate > Const.DtmarkTime
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取人员报验-报检合格数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetComprehensiveInspectionPersonOKNum(string projectid)
|
||||
{
|
||||
var result = (from x in Funs.DB.Comprehensive_InspectionPerson
|
||||
where x.ProjectId == projectid && x.IsOnSite == true && x.CompileDate > Const.DtmarkTime
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取材料报验-报检数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetComprehensiveInspectionMaterialNum(string projectid)
|
||||
{
|
||||
var result = 0;
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取材料报验-报检合格数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetComprehensiveInspectionMaterialOKNum(string projectid)
|
||||
{
|
||||
var result = 0;
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 施工方案数量
|
||||
/// </summary>
|
||||
/// <param name="projectid"></param>
|
||||
/// <returns></returns>
|
||||
public static int GetConstructSolutionNum(string projectid)
|
||||
{
|
||||
var result = (from x in Funs.DB.Solution_CQMSConstructSolution
|
||||
where x.ProjectId == projectid
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 施工方案数量——项目审批数量
|
||||
/// </summary>
|
||||
/// <param name="projectid"></param>
|
||||
/// <returns></returns>
|
||||
public static int GetConstructSolutionProjectApproveNum(string projectid)
|
||||
{
|
||||
var result = (from x in Funs.DB.Solution_CQMSConstructSolution
|
||||
where x.ProjectId == projectid && x.State == "1"
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 施工方案数量——项目审批数量
|
||||
/// </summary>
|
||||
/// <param name="projectid"></param>
|
||||
/// <returns></returns>
|
||||
public static int GetConstructSolutionUnitApproveNum(string projectid)
|
||||
{
|
||||
var result = 0;
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 特种设备质保体系
|
||||
/// </summary>
|
||||
/// <param name="projectid"></param>
|
||||
/// <returns></returns>
|
||||
public static int GetSpecialEquipmentQualityAssuranceSystemNum(string projectid)
|
||||
{
|
||||
var result = 0;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#region 推送项目质量数据
|
||||
|
||||
|
||||
Reference in New Issue
Block a user