|
|
|
@@ -352,10 +352,10 @@ namespace BLL
|
|
|
|
|
|
|
|
|
|
public static async Task<CQMSData> GetTodayCQMSData_CQMS()
|
|
|
|
|
{
|
|
|
|
|
// var data = new CQMSData();
|
|
|
|
|
// data = StatisticalData();
|
|
|
|
|
// var data = new CQMSData();
|
|
|
|
|
// data = StatisticalData();
|
|
|
|
|
|
|
|
|
|
// return data;
|
|
|
|
|
// return data;
|
|
|
|
|
|
|
|
|
|
var modelTask = StatisitcalDataAsync();
|
|
|
|
|
var model = await modelTask;
|
|
|
|
@@ -683,7 +683,7 @@ namespace BLL
|
|
|
|
|
BranchPersonNum = branchPersonNum,//
|
|
|
|
|
ProjectPersonNum = projectPersonNumList.Count(x => x.IsOffice == true),
|
|
|
|
|
ProjectSubPersonNum = projectPersonNumList.Count(x => x.IsOffice == false),
|
|
|
|
|
TrainPersonNum = trainPersonNumList.Count(),
|
|
|
|
|
TrainPersonNum = trainPersonNumList.Sum(x => x.TrainPersonNum),
|
|
|
|
|
TechnicalDisclosePersonNum = technicalDisclosePersonList.Sum(x => x.TrainPersonNum),
|
|
|
|
|
ComprehensiveConTechnologyDisclosureNum = comprehensiveConTechnologyDisclosureList.Count(),
|
|
|
|
|
ComprehensiveConTechnologyDisclosurePersonNum = comprehensiveConTechnologyDisclosureList.Sum(x => x.TrainPersonNum),
|
|
|
|
@@ -694,7 +694,7 @@ namespace BLL
|
|
|
|
|
PersonInspectionNum = inspectionPersonList.Count(),
|
|
|
|
|
PersonInspectionQualifiedNum = inspectionPersonList.Where(x => x.IsOnSite.HasValue && x.IsOnSite == true).Count(),
|
|
|
|
|
MachineInspectionNum = inspectionMachineList.Count(),
|
|
|
|
|
MachineInspectionQualifiedNum = inspectionMachineList.Where(x => x.IsCheckOK.HasValue && x.IsCheckOK == true).Count(),
|
|
|
|
|
MachineInspectionQualifiedNum = inspectionMachineList.Where(x => x.IsCheckCertificate == true).Count(),
|
|
|
|
|
|
|
|
|
|
MaterialInspectionNum = 0,
|
|
|
|
|
MaterialInspectionQualifiedNum = 0,
|
|
|
|
@@ -757,7 +757,7 @@ namespace BLL
|
|
|
|
|
BranchPersonNum = branchPersonNum,//
|
|
|
|
|
ProjectPersonNum = projectPersonNumList.Count(x => x.ProjectId == projectid && x.IsOffice == true),
|
|
|
|
|
ProjectSubPersonNum = projectPersonNumList.Count(x => x.ProjectId == projectid && x.IsOffice == false),
|
|
|
|
|
TrainPersonNum = trainPersonNumList.Count(x => x.ProjectId == projectid),
|
|
|
|
|
TrainPersonNum = trainPersonNumList.Where(x => x.ProjectId == projectid).Sum(x => x.TrainPersonNum),
|
|
|
|
|
TechnicalDisclosePersonNum = technicalDisclosePersonList.Where(x => x.ProjectId == projectid).Sum(x => x.TrainPersonNum),
|
|
|
|
|
ComprehensiveConTechnologyDisclosureNum = comprehensiveConTechnologyDisclosureList.Count(x => x.ProjectId == projectid),
|
|
|
|
|
ComprehensiveConTechnologyDisclosurePersonNum = comprehensiveConTechnologyDisclosureList.Where(x => x.ProjectId == projectid).Sum(x => x.TrainPersonNum),
|
|
|
|
@@ -767,7 +767,7 @@ namespace BLL
|
|
|
|
|
PersonInspectionNum = inspectionPersonList.Count(x => x.ProjectId == projectid),
|
|
|
|
|
PersonInspectionQualifiedNum = inspectionPersonList.Where(x => x.IsOnSite.HasValue && x.IsOnSite == true && x.ProjectId == projectid).Count(),
|
|
|
|
|
MachineInspectionNum = inspectionMachineList.Count(x => x.ProjectId == projectid),
|
|
|
|
|
MachineInspectionQualifiedNum = inspectionMachineList.Where(x => x.IsCheckOK.HasValue && x.IsCheckOK == true && x.ProjectId == projectid).Count(),
|
|
|
|
|
MachineInspectionQualifiedNum = inspectionMachineList.Where(x => x.IsCheckCertificate == true && x.ProjectId == projectid).Count(),
|
|
|
|
|
MaterialInspectionNum = 0,
|
|
|
|
|
MaterialInspectionQualifiedNum = 0,
|
|
|
|
|
UseNum = useNum.Count(x => x.ProjectId == projectid),
|
|
|
|
@@ -949,7 +949,8 @@ namespace BLL
|
|
|
|
|
if (thisUnit != null) unitId = thisUnit.UnitId;
|
|
|
|
|
var result = (from x in Funs.DB.Person_Persons
|
|
|
|
|
join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId
|
|
|
|
|
where x.IsPost == true && y.IsCQMS == true && x.UnitId != unitId
|
|
|
|
|
join z in Funs.DB.Base_Unit on x.UnitId equals z.UnitId
|
|
|
|
|
where x.IsPost == true && y.IsCQMS == true && z.IsBranch == true && x.UnitId != unitId
|
|
|
|
|
select x).Count();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
@@ -970,7 +971,7 @@ namespace BLL
|
|
|
|
|
public static IEnumerable<Model.OfSafetySupervisorsOutput> GetProjectPersonNum()
|
|
|
|
|
{
|
|
|
|
|
var result = (from x in Funs.DB.SitePerson_Person
|
|
|
|
|
join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId
|
|
|
|
|
join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId
|
|
|
|
|
join z in Funs.DB.Person_Persons on x.PersonId equals z.PersonId
|
|
|
|
|
join p in Funs.DB.Base_Project on x.ProjectId equals p.ProjectId into pGroup
|
|
|
|
|
from p in pGroup.DefaultIfEmpty()
|
|
|
|
@@ -1114,29 +1115,19 @@ namespace BLL
|
|
|
|
|
/// 获取质量培训人次数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<Model.OfSafetySupervisorsOutput> GetTrainPersonNum()
|
|
|
|
|
public static List<Model.TrainPlanItem> GetTrainPersonNum()
|
|
|
|
|
{
|
|
|
|
|
var result = (from x in Funs.DB.Comprehensive_InspectionPerson
|
|
|
|
|
var result = (from x in Funs.DB.Train_TrainPlan
|
|
|
|
|
join p in Funs.DB.Base_Project on x.ProjectId equals p.ProjectId into pGroup
|
|
|
|
|
from p in pGroup.DefaultIfEmpty()
|
|
|
|
|
join u in Funs.DB.Base_Unit on x.UnitId equals u.UnitId into uGroup
|
|
|
|
|
from u in uGroup.DefaultIfEmpty()
|
|
|
|
|
join y in Funs.DB.Person_Persons on x.InspectionPersonId equals y.PersonId into yGroup
|
|
|
|
|
from y in yGroup.DefaultIfEmpty()
|
|
|
|
|
join m in Funs.DB.Base_WorkPost on y.WorkPostId equals m.WorkPostId into mGroup
|
|
|
|
|
from m in mGroup.DefaultIfEmpty()
|
|
|
|
|
where BeUnderConstructionList.Contains(p.ProjectId) && x.IsTrain == true && x.CompileDate > Const.DtmarkTime
|
|
|
|
|
select new Model.OfSafetySupervisorsOutput
|
|
|
|
|
where BeUnderConstructionList.Contains(p.ProjectId) && x.CompileDate > Const.DtmarkTime
|
|
|
|
|
select new Model.TrainPlanItem
|
|
|
|
|
{
|
|
|
|
|
ProjectId = x.ProjectId,
|
|
|
|
|
ProjectName = p.ProjectName,
|
|
|
|
|
UnitId = u.UnitId,
|
|
|
|
|
UnitName = u.UnitName,
|
|
|
|
|
Name = x.PersonName,
|
|
|
|
|
Sex = y.Sex == null ? "" : (y.Sex == "1" ? "男" : "女"),
|
|
|
|
|
IdentityCard = y.IdentityCard,
|
|
|
|
|
WorkPostName = m.WorkPostName == null ? "" : m.WorkPostName,
|
|
|
|
|
Phone = y.Telephone
|
|
|
|
|
UnitId = BLL.Const.UnitId_SEDIN,
|
|
|
|
|
UnitName = "赛鼎工程有限公司",
|
|
|
|
|
TrainPersonNum = x.TrainPersonNum.HasValue ? x.TrainPersonNum.Value : 0
|
|
|
|
|
}).ToList();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
@@ -1144,7 +1135,7 @@ namespace BLL
|
|
|
|
|
/// 获取质量培训人次数(异步)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static async Task<List<Model.OfSafetySupervisorsOutput>> GetTrainPersonNumAsync()
|
|
|
|
|
public static async Task<List<Model.TrainPlanItem>> GetTrainPersonNumAsync()
|
|
|
|
|
{
|
|
|
|
|
return await Task.Run(GetTrainPersonNum);
|
|
|
|
|
}
|
|
|
|
@@ -1240,9 +1231,9 @@ namespace BLL
|
|
|
|
|
/// 获取机具报验
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<Model.Comprehensive_InspectionMachine> GetComprehensive_InspectionMachine()
|
|
|
|
|
public static List<Model.Check_CheckEquipment> GetComprehensive_InspectionMachine()
|
|
|
|
|
{
|
|
|
|
|
var result = (from x in Funs.DB.Comprehensive_InspectionMachine
|
|
|
|
|
var result = (from x in Funs.DB.Check_CheckEquipment
|
|
|
|
|
where BeUnderConstructionList.Contains(x.ProjectId) && x.CompileDate > Const.DtmarkTime
|
|
|
|
|
select x).ToList();
|
|
|
|
|
return result;
|
|
|
|
@@ -1252,7 +1243,7 @@ namespace BLL
|
|
|
|
|
/// 获取机具报验(异步)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static async Task<List<Comprehensive_InspectionMachine>> GetComprehensive_InspectionMachineAsync()
|
|
|
|
|
public static async Task<List<Check_CheckEquipment>> GetComprehensive_InspectionMachineAsync()
|
|
|
|
|
{
|
|
|
|
|
return await Task.Run(GetComprehensive_InspectionMachine);
|
|
|
|
|
}
|
|
|
|
@@ -1261,10 +1252,10 @@ namespace BLL
|
|
|
|
|
/// 获取在用计量器具数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<Comprehensive_InspectionMachine> GetUseNum()
|
|
|
|
|
public static List<Check_CheckEquipment> GetUseNum()
|
|
|
|
|
{
|
|
|
|
|
var result = (from x in Funs.DB.Comprehensive_InspectionMachine
|
|
|
|
|
where BeUnderConstructionList.Contains(x.ProjectId) && x.IsOnSite == true && x.InspectionType.Contains("计量") && x.CompileDate > Const.DtmarkTime
|
|
|
|
|
var result = (from x in Funs.DB.Check_CheckEquipment
|
|
|
|
|
where BeUnderConstructionList.Contains(x.ProjectId) && x.CompileDate > Const.DtmarkTime
|
|
|
|
|
select x).ToList();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
@@ -1273,7 +1264,7 @@ namespace BLL
|
|
|
|
|
/// 获取在用计量器具数(异步)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static async Task<List<Comprehensive_InspectionMachine>> GetUseNumAsync()
|
|
|
|
|
public static async Task<List<Check_CheckEquipment>> GetUseNumAsync()
|
|
|
|
|
{
|
|
|
|
|
return await Task.Run(GetUseNum);
|
|
|
|
|
}
|
|
|
|
@@ -1282,10 +1273,10 @@ namespace BLL
|
|
|
|
|
/// 获取校准合格数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<Comprehensive_InspectionMachine> GetOkNum()
|
|
|
|
|
public static List<Check_CheckEquipment> GetOkNum()
|
|
|
|
|
{
|
|
|
|
|
var result = (from x in Funs.DB.Comprehensive_InspectionMachine
|
|
|
|
|
where BeUnderConstructionList.Contains(x.ProjectId) && x.IsOnSite == true && x.InspectionType.Contains("计量") && x.IsCheckOK == true
|
|
|
|
|
var result = (from x in Funs.DB.Check_CheckEquipment
|
|
|
|
|
where BeUnderConstructionList.Contains(x.ProjectId) && x.IsCheckCertificate == true
|
|
|
|
|
&& x.CompileDate > Const.DtmarkTime
|
|
|
|
|
select x).ToList();
|
|
|
|
|
return result;
|
|
|
|
@@ -1295,7 +1286,7 @@ namespace BLL
|
|
|
|
|
/// 获取校准合格数(异步)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static async Task<List<Comprehensive_InspectionMachine>> GetOkNumAsync()
|
|
|
|
|
public static async Task<List<Check_CheckEquipment>> GetOkNumAsync()
|
|
|
|
|
{
|
|
|
|
|
return await Task.Run(GetOkNum);
|
|
|
|
|
}
|
|
|
|
@@ -1307,7 +1298,7 @@ namespace BLL
|
|
|
|
|
public static List<ProjectData_MainItem> GetSingleProjectNum()
|
|
|
|
|
{
|
|
|
|
|
var result = (from x in Funs.DB.ProjectData_MainItem
|
|
|
|
|
where BeUnderConstructionList.Contains(x.ProjectId)
|
|
|
|
|
where BeUnderConstructionList.Contains(x.ProjectId)
|
|
|
|
|
select x).ToList();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
@@ -1396,8 +1387,8 @@ namespace BLL
|
|
|
|
|
select new Model.WBSBreakdownProjectOutput()
|
|
|
|
|
{
|
|
|
|
|
ProjectId = g.Key,
|
|
|
|
|
Sum = g.Count(),
|
|
|
|
|
}).ToList() ;
|
|
|
|
|
Sum = g.Count(),
|
|
|
|
|
}).ToList();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|