2023-05-09 接口更新
This commit is contained in:
@@ -17,7 +17,7 @@ namespace BLL
|
||||
/// <summary>
|
||||
/// CQMS数据类型
|
||||
/// </summary>
|
||||
public enum CQMSDateType
|
||||
public enum CQMSDateType
|
||||
{
|
||||
/// <summary>
|
||||
/// 质量培训数据
|
||||
@@ -145,9 +145,9 @@ namespace BLL
|
||||
}
|
||||
public static List<Model.Project_CQMSData_CQMS> GetProject_CQMSData_CQMSByprojectid(string projectid)
|
||||
{
|
||||
var q =( from x in db.Project_CQMSData_CQMS
|
||||
where x.ProjectId == projectid
|
||||
select x).ToList();
|
||||
var q = (from x in db.Project_CQMSData_CQMS
|
||||
where x.ProjectId == projectid
|
||||
select x).ToList();
|
||||
return q;
|
||||
}
|
||||
/// <summary>
|
||||
@@ -283,7 +283,7 @@ namespace BLL
|
||||
/// </summary>
|
||||
/// <param name="dateTime"></param>
|
||||
/// <returns></returns>
|
||||
public static bool IsReportByDate(DateTime dateTime,string projectid)
|
||||
public static bool IsReportByDate(DateTime dateTime, string projectid)
|
||||
{
|
||||
var result = false;
|
||||
var q = (from x in Funs.DB.Project_CQMSData_CQMS
|
||||
@@ -320,15 +320,20 @@ namespace BLL
|
||||
/// </summary>
|
||||
/// <param name="projectid">项目id</param>
|
||||
/// <param name="cQMSDateType">数据类型</param>
|
||||
public static void StatisticalData(string projectid,CQMSDateType cQMSDateType)
|
||||
public static void StatisticalData(string projectid, CQMSDateType cQMSDateType)
|
||||
{
|
||||
string thisUnitId = BLL.Const.UnitId_CWCEC;
|
||||
string thisUnitId = string.Empty;
|
||||
var thisUnit = Const.UnitId_CWCEC;
|
||||
if (thisUnit != null)
|
||||
{
|
||||
thisUnitId = thisUnit;
|
||||
}
|
||||
var base_Unit = BLL.UnitService.GetUnitByUnitId(thisUnitId);
|
||||
Model.Project_CQMSData_CQMS table = new Model.Project_CQMSData_CQMS();
|
||||
|
||||
if (IsReportByToday(projectid))
|
||||
{
|
||||
table= getTodayProject_CQMSData_CQMS(projectid);
|
||||
table = getTodayProject_CQMSData_CQMS(projectid);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -339,7 +344,7 @@ namespace BLL
|
||||
table.UnitName = base_Unit.UnitName;
|
||||
table.ProjectId = projectid;
|
||||
table.ReportDate = DateTime.Now.Date;
|
||||
if (cQMSDateType== CQMSDateType.QualityTraining|| cQMSDateType == CQMSDateType.All)
|
||||
if (cQMSDateType == CQMSDateType.QualityTraining || cQMSDateType == CQMSDateType.All)
|
||||
{
|
||||
table.TrainPersonNum = GetTrainPersonNum(projectid);
|
||||
table.TechnicalDisclosePersonNum = GetTechnicalDisclosePersonNum(projectid);
|
||||
@@ -388,7 +393,7 @@ namespace BLL
|
||||
table.SubProjectNum = GetSubProjectNum(projectid);
|
||||
table.SubdivisionalWorksNum = GetSubdivisionalWorksNum(projectid);
|
||||
table.InspectionLotNum = GetInspectionLotNum(projectid);
|
||||
}
|
||||
}
|
||||
|
||||
if (IsReportByToday(projectid))
|
||||
{
|
||||
@@ -406,11 +411,11 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetTrainPersonNum(string projectid)
|
||||
{
|
||||
//DateTime date = DateTime.Now;
|
||||
//int result = (from x in Funs.DB.Comprehensive_InspectionPerson
|
||||
// where x.ProjectId == projectid && x.IsTrain == true && x.CompileDate.Value.Year == date.Year && x.CompileDate.Value.Month == date.Month && x.CompileDate.Value.Day == date.Day
|
||||
// select x).Count();
|
||||
return 0;
|
||||
DateTime date = DateTime.Now;
|
||||
int result = (from x in Funs.DB.Comprehensive_InspectionPerson
|
||||
where x.ProjectId == projectid && x.IsTrain == true && x.CompileDate.Value.Year == date.Year && x.CompileDate.Value.Month == date.Month && x.CompileDate.Value.Day == date.Day
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取技术交底人次数
|
||||
@@ -418,12 +423,12 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetTechnicalDisclosePersonNum(string projectid)
|
||||
{
|
||||
//DateTime date = DateTime.Now;
|
||||
//var result = (from x in Funs.DB.Comprehensive_DesignDetails
|
||||
// where x.ProjectId == projectid && x.DetailsDate.Value.Year == date.Year && x.DetailsDate.Value.Month == date.Month && x.DetailsDate.Value.Day == date.Day
|
||||
// select x.JoinPersonNum ).ToList().Sum(x=>x.Value);
|
||||
//var q = Funs.GetNewIntOrZero(result.ToString());
|
||||
return 0;
|
||||
DateTime date = DateTime.Now;
|
||||
var result = (from x in Funs.DB.Comprehensive_DesignDetails
|
||||
where x.ProjectId == projectid && x.DetailsDate.Value.Year == date.Year && x.DetailsDate.Value.Month == date.Month && x.DetailsDate.Value.Day == date.Day
|
||||
select x.JoinPersonNum).ToList().Sum(x => x.Value);
|
||||
var q = Funs.GetNewIntOrZero(result.ToString());
|
||||
return q;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取在用计量器具数
|
||||
@@ -442,10 +447,10 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetOKNum(string projectid)
|
||||
{
|
||||
//int result = (from x in Funs.DB.Comprehensive_InspectionMachine
|
||||
// where x.ProjectId == projectid && x.IsOnSite == true && x.InspectionType.Contains("计量") && x.IsCheckOK == true
|
||||
// select x).Count();
|
||||
return 0;
|
||||
int result = (from x in Funs.DB.Comprehensive_InspectionMachine
|
||||
where x.ProjectId == projectid && x.IsOnSite == true && x.InspectionType.Contains("计量") && x.IsCheckOK == true
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取企业总部人数
|
||||
@@ -471,11 +476,11 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetProjectPersonNum(string projectid)
|
||||
{
|
||||
//int result = (from x in Funs.DB.Comprehensive_InspectionPerson
|
||||
// join y in Funs.DB.Base_WorkPost on x.PostId equals y.WorkPostId
|
||||
// where x.ProjectId == projectid && y.IsCQMS == true && x.IsOnSite == true
|
||||
// select x).Count();
|
||||
return 0;
|
||||
int result = (from x in Funs.DB.Comprehensive_InspectionPerson
|
||||
join y in Funs.DB.Base_WorkPost on x.PostId equals y.WorkPostId
|
||||
where x.ProjectId == projectid && y.IsCQMS == true && x.IsOnSite == true
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取问题个数
|
||||
@@ -517,7 +522,7 @@ namespace BLL
|
||||
public static int GetSNum(string projectid)
|
||||
{
|
||||
int result = (from x in Funs.DB.WBS_BreakdownProject
|
||||
where x.ProjectId == projectid && x.Class.Contains("S")
|
||||
where x.ProjectId == projectid && x.Class.Contains("S") && x.IsSelected == true
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
@@ -528,7 +533,7 @@ namespace BLL
|
||||
public static int GetANum(string projectid)
|
||||
{
|
||||
int result = (from x in Funs.DB.WBS_BreakdownProject
|
||||
where x.ProjectId == projectid && x.Class.Contains("A")
|
||||
where x.ProjectId == projectid && x.Class.Contains("A") && x.IsSelected == true
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
@@ -539,7 +544,7 @@ namespace BLL
|
||||
public static int GetBNum(string projectid)
|
||||
{
|
||||
int result = (from x in Funs.DB.WBS_BreakdownProject
|
||||
where x.ProjectId == projectid && x.Class.Contains("B")
|
||||
where x.ProjectId == projectid && x.Class.Contains("B") && x.IsSelected == true
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
@@ -550,7 +555,7 @@ namespace BLL
|
||||
public static int GetCNum(string projectid)
|
||||
{
|
||||
int result = (from x in Funs.DB.WBS_BreakdownProject
|
||||
where x.ProjectId == projectid && x.Class.Contains("C")
|
||||
where x.ProjectId == projectid && x.Class.Contains("C") && x.IsSelected == true
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
@@ -560,11 +565,11 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetKeyProcessNum(string projectid)
|
||||
{
|
||||
//int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
// join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
|
||||
// where y.ProjectId == projectid && y.CheckAcceptType == "1"
|
||||
// select x).Count();
|
||||
return 0;
|
||||
int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
|
||||
where y.ProjectId == projectid && y.CheckAcceptType == "1"
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取关键工序验收合格数
|
||||
@@ -572,12 +577,12 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetKeyProcessOKNum(string projectid)
|
||||
{
|
||||
//int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
// join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
|
||||
// join z in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals z.InspectionId
|
||||
// where y.ProjectId == projectid && y.CheckAcceptType == "1" && z.IsOnceQualified == true
|
||||
// select x).Count();
|
||||
return 0;
|
||||
int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
|
||||
join z in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals z.InspectionId
|
||||
where y.ProjectId == projectid && y.CheckAcceptType == "1" && z.IsOnceQualified == true
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取特殊过程验收数
|
||||
@@ -585,11 +590,11 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetSpecialProcessNum(string projectid)
|
||||
{
|
||||
//int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
// join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
|
||||
// where y.ProjectId == projectid && y.CheckAcceptType == "2"
|
||||
// select x).Count();
|
||||
return 0;
|
||||
int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
|
||||
where y.ProjectId == projectid && y.CheckAcceptType == "2"
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取特殊过程验收合格数
|
||||
@@ -597,12 +602,12 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetSpecialProcessOKNum(string projectid)
|
||||
{
|
||||
//int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
// join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
|
||||
// join z in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals z.InspectionId
|
||||
// where y.ProjectId == projectid && y.CheckAcceptType == "2" && z.IsOnceQualified == true
|
||||
// select x).Count();
|
||||
return 0;
|
||||
int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
|
||||
join z in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals z.InspectionId
|
||||
where y.ProjectId == projectid && y.CheckAcceptType == "2" && z.IsOnceQualified == true
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取隐蔽工程验收数
|
||||
@@ -610,11 +615,11 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetConcealedWorksNum(string projectid)
|
||||
{
|
||||
//int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
// join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
|
||||
// where y.ProjectId == projectid && y.CheckAcceptType == "3"
|
||||
// select x).Count();
|
||||
return 0;
|
||||
int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
|
||||
where y.ProjectId == projectid && y.CheckAcceptType == "3"
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取隐蔽工程验收合格数
|
||||
@@ -622,12 +627,12 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetConcealedWorksOKNum(string projectid)
|
||||
{
|
||||
//int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
// join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
|
||||
// join z in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals z.InspectionId
|
||||
// where y.ProjectId == projectid && y.CheckAcceptType == "3" && z.IsOnceQualified == true
|
||||
// select x).Count();
|
||||
return 0;
|
||||
int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
|
||||
join z in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals z.InspectionId
|
||||
where y.ProjectId == projectid && y.CheckAcceptType == "3" && z.IsOnceQualified == true
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取单位工程一次验收数
|
||||
@@ -635,11 +640,11 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetUnitProjectOnesNum(string projectid)
|
||||
{
|
||||
//int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
// join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
|
||||
// where y.ProjectId == projectid && y.CheckAcceptType == "4"
|
||||
// select x).Count();
|
||||
return 0;
|
||||
int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
|
||||
where y.ProjectId == projectid && y.CheckAcceptType == "4"
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取单位工程一次验收合格数
|
||||
@@ -647,12 +652,12 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetUnitProjectOnesOKNum(string projectid)
|
||||
{
|
||||
//int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
// join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
|
||||
// join z in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals z.InspectionId
|
||||
// where y.ProjectId == projectid && y.CheckAcceptType == "4" && z.IsOnceQualified == true
|
||||
// select x).Count();
|
||||
return 0;
|
||||
int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
|
||||
join z in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals z.InspectionId
|
||||
where y.ProjectId == projectid && y.CheckAcceptType == "4" && z.IsOnceQualified == true
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取材料进场复验数
|
||||
@@ -660,11 +665,11 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetMaterialInRecheckNum(string projectid)
|
||||
{
|
||||
//int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
// join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
|
||||
// where y.ProjectId == projectid && y.CheckAcceptType == "5"
|
||||
// select x).Count();
|
||||
return 0;
|
||||
int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
|
||||
where y.ProjectId == projectid && y.CheckAcceptType == "5"
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取材料进场复验合格数
|
||||
@@ -672,12 +677,12 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetMaterialInRecheckOKNum(string projectid)
|
||||
{
|
||||
//int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
// join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
|
||||
// join z in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals z.InspectionId
|
||||
// where y.ProjectId == projectid && y.CheckAcceptType == "5" && z.IsOnceQualified == true
|
||||
// select x).Count();
|
||||
return 0;
|
||||
int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
|
||||
join z in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals z.InspectionId
|
||||
where y.ProjectId == projectid && y.CheckAcceptType == "5" && z.IsOnceQualified == true
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取单项工程个数
|
||||
@@ -707,10 +712,10 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetSubProjectNum(string projectid)
|
||||
{
|
||||
//int result = (from x in Funs.DB.WBS_DivisionProject
|
||||
// where x.ProjectId == projectid && x.SubItemType == "1"
|
||||
// select x).Count();
|
||||
return 0;
|
||||
int result = (from x in Funs.DB.WBS_DivisionProject
|
||||
where x.ProjectId == projectid && x.SubItemType == "1" && x.IsSelected == true
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取分项工程个数
|
||||
@@ -718,10 +723,10 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetSubdivisionalWorksNum(string projectid)
|
||||
{
|
||||
//int result = (from x in Funs.DB.WBS_DivisionProject
|
||||
// where x.ProjectId == projectid && x.SubItemType == "3"
|
||||
// select x).Count();
|
||||
return 0;
|
||||
int result = (from x in Funs.DB.WBS_DivisionProject
|
||||
where x.ProjectId == projectid && x.SubItemType == "3" && x.IsSelected == true
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取检验批个数
|
||||
@@ -730,7 +735,7 @@ namespace BLL
|
||||
public static int GetInspectionLotNum(string projectid)
|
||||
{
|
||||
int result = (from x in Funs.DB.WBS_BreakdownProject
|
||||
where x.ProjectId == projectid
|
||||
where x.ProjectId == projectid && x.IsSelected == true
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user