2023-08-04

This commit is contained in:
2023-08-04 17:06:50 +08:00
parent 70a51ab125
commit 78e8037f08
81 changed files with 8897 additions and 2763 deletions
@@ -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,26 +320,31 @@ 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_SEDIN;
var base_Unit = BLL.UnitService.GetUnitByUnitId(thisUnitId);
string thisUnitId = string.Empty;
var thisUnit = CommonService.GetIsThisUnit();
if (thisUnit != null)
{
thisUnitId = thisUnit.UnitId;
}
var baseUnit = 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
{
table.Id = SQLHelper.GetNewID();
}
table.UnitId = thisUnitId;
table.CollCropCode = base_Unit.CollCropCode;
table.UnitName = base_Unit.UnitName;
table.CollCropCode = baseUnit.CollCropCode;
table.UnitName = baseUnit.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);
@@ -347,7 +352,7 @@ namespace BLL
if (cQMSDateType == CQMSDateType.MeasuringInstruments || cQMSDateType == CQMSDateType.All)
{
table.UseNum = GetUseNum(projectid);
table.OKNum = GetOKNum(projectid);
table.OKNum = GetOkNum(projectid);
}
if (cQMSDateType == CQMSDateType.ManagerData || cQMSDateType == CQMSDateType.All)
{
@@ -371,11 +376,11 @@ namespace BLL
if (cQMSDateType == CQMSDateType.QualityAcceptance || cQMSDateType == CQMSDateType.All)
{
table.KeyProcessNum = GetKeyProcessNum(projectid);
table.KeyProcessOKNum = GetKeyProcessOKNum(projectid);
table.KeyProcessOKNum = GetKeyProcessOkNum(projectid);
table.SpecialProcessNum = GetSpecialProcessNum(projectid);
table.SpecialProcessOKNum = GetSpecialProcessOKNum(projectid);
table.SpecialProcessOKNum = GetSpecialProcessOkNum(projectid);
table.ConcealedWorksNum = GetConcealedWorksNum(projectid);
table.ConcealedWorksOKNum = GetConcealedWorksOKNum(projectid);
table.ConcealedWorksOKNum = GetConcealedWorksOkNum(projectid);
table.UnitProjectOnesNum = GetUnitProjectOnesNum(projectid);
table.UnitProjectOnesOKNum = GetUnitProjectOnesOKNum(projectid);
table.MaterialInRecheckNum = GetMaterialInRecheckNum(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,10 @@ 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;
var result = (from x in Funs.DB.Comprehensive_InspectionPerson
where x.ProjectId == projectid && x.IsTrain == true && x.CompileDate > Const.DtmarkTime
select x).Count();
return result;
}
/// <summary>
/// 获取技术交底人次数
@@ -418,12 +422,11 @@ 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;
var result = (from x in Funs.DB.Comprehensive_DesignDetails
where x.ProjectId == projectid && x.CompileDate > Const.DtmarkTime
select x.JoinPersonNum).ToList().Sum(x => x.Value);
var q = Funs.GetNewIntOrZero(result.ToString());
return q;
}
/// <summary>
/// 获取在用计量器具数
@@ -431,21 +434,23 @@ namespace BLL
/// <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 0;
int result = (from x in Funs.DB.Comprehensive_InspectionMachine
where x.ProjectId == projectid && x.IsOnSite == true && x.InspectionType.Contains("计量")
&& x.CompileDate > Const.DtmarkTime
select x).Count();
return result;
}
/// <summary>
/// 获取校准合格数
/// </summary>
/// <returns></returns>
public static int GetOKNum(string projectid)
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
&& x.CompileDate > Const.DtmarkTime
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.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"
select x).Count();
return result;
}
/// <summary>
/// 获取问题个数
@@ -484,7 +489,7 @@ namespace BLL
public static int GetProblemNum(string projectid)
{
int result = (from x in Funs.DB.Check_CheckControl
where x.ProjectId == projectid && x.CheckDate <= DateTime.Now
where x.ProjectId == projectid && x.CheckDate > Const.DtmarkTime
select x).Count();
return result;
}
@@ -495,7 +500,7 @@ namespace BLL
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"
where x.ProjectId == projectid && x.CheckDate > Const.DtmarkTime && x.State == "7"
select x).Count();
return result;
}
@@ -506,7 +511,7 @@ namespace BLL
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"
where x.ProjectId == projectid && x.CheckDate > Const.DtmarkTime && x.State != "7"
select x).Count();
return result;
}
@@ -516,10 +521,10 @@ namespace BLL
/// <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 0;
int result = (from x in Funs.DB.WBS_BreakdownProject
where x.ProjectId == projectid && x.Class.Contains("S") && x.IsSelected == true && x.CompileDate > Const.DtmarkTime
select x).Count();
return result;
}
/// <summary>
/// 获取A级数
@@ -527,10 +532,10 @@ namespace BLL
/// <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 0;
int result = (from x in Funs.DB.WBS_BreakdownProject
where x.ProjectId == projectid && x.Class.Contains("A") && x.IsSelected == true && x.CompileDate > Const.DtmarkTime
select x).Count();
return result;
}
/// <summary>
/// 获取B级数
@@ -538,10 +543,10 @@ namespace BLL
/// <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 0;
int result = (from x in Funs.DB.WBS_BreakdownProject
where x.ProjectId == projectid && x.Class.Contains("B") && x.IsSelected == true && x.CompileDate > Const.DtmarkTime
select x).Count();
return result;
}
/// <summary>
/// 获取C级数
@@ -549,10 +554,10 @@ namespace BLL
/// <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 0;
int result = (from x in Funs.DB.WBS_BreakdownProject
where x.ProjectId == projectid && x.Class.Contains("C") && x.IsSelected == true && x.CompileDate > Const.DtmarkTime
select x).Count();
return result;
}
/// <summary>
/// 获取关键工序验收数
@@ -560,24 +565,24 @@ 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" && x.CreateDate > Const.DtmarkTime
select x).Count();
return result;
}
/// <summary>
/// 获取关键工序验收合格数
/// </summary>
/// <returns></returns>
public static int GetKeyProcessOKNum(string projectid)
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 && x.CreateDate > Const.DtmarkTime
select x).Count();
return result;
}
/// <summary>
/// 获取特殊过程验收数
@@ -585,24 +590,24 @@ 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" && x.CreateDate > Const.DtmarkTime
select x).Count();
return result;
}
/// <summary>
/// 获取特殊过程验收合格数
/// </summary>
/// <returns></returns>
public static int GetSpecialProcessOKNum(string projectid)
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;
var 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 && x.CreateDate > Const.DtmarkTime
select x).Count();
return result;
}
/// <summary>
/// 获取隐蔽工程验收数
@@ -610,24 +615,24 @@ 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" && x.CreateDate > Const.DtmarkTime
select x).Count();
return result;
}
/// <summary>
/// 获取隐蔽工程验收合格数
/// </summary>
/// <returns></returns>
public static int GetConcealedWorksOKNum(string projectid)
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 && x.CreateDate > Const.DtmarkTime
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" && x.CreateDate > Const.DtmarkTime
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 && x.CreateDate > Const.DtmarkTime
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" && x.CreateDate > Const.DtmarkTime
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 && x.CreateDate > Const.DtmarkTime
select x).Count();
return result;
}
/// <summary>
/// 获取单项工程个数
@@ -685,10 +690,10 @@ namespace BLL
/// <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 0;
int result = (from x in Funs.DB.WBS_UnitWork
where x.ProjectId == projectid
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>
/// 获取检验批个数
@@ -729,10 +734,10 @@ namespace BLL
/// <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 0;
int result = (from x in Funs.DB.WBS_BreakdownProject
where x.ProjectId == projectid && x.IsSelected == true
select x).Count();
return result;
}