修改上报接口

This commit is contained in:
2023-07-24 16:42:54 +08:00
parent 97207481b2
commit cdf073a097
6 changed files with 685 additions and 585 deletions
@@ -411,9 +411,8 @@ 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
where x.ProjectId == projectid && x.IsTrain == true
select x).Count();
return result;
}
@@ -423,9 +422,8 @@ 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
where x.ProjectId == projectid
select x.JoinPersonNum).ToList().Sum(x => x.Value);
var q = Funs.GetNewIntOrZero(result.ToString());
return q;
@@ -301,10 +301,32 @@ namespace BLL
/// <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());
return 0;
int result = 0;
if (projectid != null)
{
var getD1 = from x in Funs.DB.HJGL_FL_TotalQuantity
where x.ProjectId == projectid.ToString()
select x;
if (getD1.Count() > 0)
{
foreach (var item in getD1)
{
result += Funs.GetNewIntOrZero(item.TotalWeldQuantity.Split('.')[0]);
}
}
else
{
var getD2 = (from x in Funs.DB.HJGL_FL_Data
where x.ProjectId == projectid.ToString()
orderby x.CompileDate descending
select x).FirstOrDefault();
if (getD2 != null)
{
result = Funs.GetNewIntOrZero(getD2.TotalWeldQuantity.Split('.')[0]);
}
}
}
return result;
}
/// <summary>
/// 获取完成达因数
@@ -312,10 +334,32 @@ namespace BLL
/// <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());
return 0;
int result = 0;
if (projectid != null)
{
var getD1 = from x in Funs.DB.HJGL_FL_TotalQuantity
where x.ProjectId == projectid.ToString()
select x;
if (getD1.Count() > 0)
{
foreach (var item in getD1)
{
result += Funs.GetNewIntOrZero(item.TotalCompleted.Split('.')[0]);
}
}
else
{
var getD2 = (from x in Funs.DB.HJGL_FL_Data
where x.ProjectId == projectid.ToString()
orderby x.CompileDate descending
select x).FirstOrDefault();
if (getD2 != null)
{
result = Funs.GetNewIntOrZero(getD2.TotalCompleted.Split('.')[0]);
}
}
}
return result;
}
/// <summary>
/// 获取总片数
@@ -323,11 +367,32 @@ namespace BLL
/// <returns></returns>
public static int GetTotalFilmNum(string projectid)
{
//int result = Convert.ToInt32((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());
return 0;
int result = 0;
if (projectid != null)
{
var getD1 = from x in Funs.DB.HJGL_FL_NdtList
where x.ProjectId == projectid.ToString()
select x;
if (getD1.Count() > 0)
{
foreach (var item in getD1)
{
result += Funs.GetNewIntOrZero(item.OneTimeFilmAmount.Split('.')[0]);
}
}
else
{
var getD2 = (from x in Funs.DB.HJGL_FL_Data
where x.ProjectId == projectid.ToString()
orderby x.CompileDate descending
select x).FirstOrDefault();
if (getD2 != null)
{
result = Funs.GetNewIntOrZero(getD2.OneTimeFilmAmount.Split('.')[0]);
}
}
}
return result;
}
/// <summary>
/// 获取合格片数
@@ -335,11 +400,32 @@ namespace BLL
/// <returns></returns>
public static int GetOKFilmNum(string projectid)
{
//int result = Convert.ToInt32((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());
return 0;
int result = 0;
if (projectid != null)
{
var getD1 = from x in Funs.DB.HJGL_FL_NdtList
where x.ProjectId == projectid.ToString()
select x;
if (getD1.Count() > 0)
{
foreach (var item in getD1)
{
result += Funs.GetNewIntOrZero(item.OneTimeFilmQualifiedAmount.Split('.')[0]);
}
}
else
{
var getD2 = (from x in Funs.DB.HJGL_FL_Data
where x.ProjectId == projectid.ToString()
orderby x.CompileDate descending
select x).FirstOrDefault();
if (getD2 != null)
{
result = Funs.GetNewIntOrZero(getD2.OneTimeFilmQualifiedAmount.Split('.')[0]);
}
}
}
return result;
}
}
@@ -682,12 +682,11 @@ namespace BLL
/// <returns></returns>
public static int GetTotalWorkingHour(string projectid)
{
DateTime date = DateTime.Now;
var result = (from x in Funs.DB.SitePerson_DayReportDetail
join y in Funs.DB.SitePerson_DayReport on x.DayReportId equals y.DayReportId
where y.ProjectId == projectid && y.CompileDate.Value.Year == date.Year && y.CompileDate.Value.Month == date.Month && y.CompileDate.Value.Day == date.Day
select x.PersonWorkTime ).ToList().Sum(x=>x.Value);
var q = Funs.GetNewIntOrZero(result.ToString());
where y.ProjectId == projectid
select x.PersonWorkTime).ToList().Sum(x => x.Value);
var q = Funs.GetNewIntOrZero(result.ToString());
return q;
}
/// <summary>
@@ -696,9 +695,8 @@ namespace BLL
/// <returns></returns>
public static int GetLostWorkingHour(string projectid)
{
DateTime date = DateTime.Now;
var result = (from x in Funs.DB.Accident_AccidentHandle where x.ProjectId == projectid && x.AccidentDate.Year == date.Year && x.AccidentDate.Month == date.Month && x.AccidentDate.Day == date.Day select x.WorkHoursLoss).ToList().Sum(x => x.Value)
+ (from x in Funs.DB.Accident_AccidentReport where x.ProjectId == projectid && x.AccidentDate.Value.Year == date.Year && x.AccidentDate.Value.Month == date.Month && x.AccidentDate.Value.Day == date.Day select x.WorkingHoursLoss).ToList().Sum(x => x.Value);
var result = (from x in Funs.DB.Accident_AccidentHandle where x.ProjectId == projectid select x.WorkHoursLoss).ToList().Sum(x => x.Value)
+ (from x in Funs.DB.Accident_AccidentReport where x.ProjectId == projectid select x.WorkingHoursLoss).ToList().Sum(x => x.Value);
var q = Funs.GetNewIntOrZero(result.ToString());
return q;
@@ -709,13 +707,12 @@ namespace BLL
/// <returns></returns>
public static int GetSafeWorkingHour(string projectid)
{
DateTime date = DateTime.Now;
var result1 = (from x in Funs.DB.SitePerson_DayReportDetail
join y in Funs.DB.SitePerson_DayReport on x.DayReportId equals y.DayReportId
where y.ProjectId == projectid && y.CompileDate.Value.Year == date.Year && y.CompileDate.Value.Month == date.Month && y.CompileDate.Value.Day == date.Day
where y.ProjectId == projectid
select x.PersonWorkTime).ToList().Sum(x => x.Value);
var result2 = (from x in Funs.DB.Accident_AccidentHandle where x.ProjectId == projectid && x.AccidentDate.Year == date.Year && x.AccidentDate.Month == date.Month && x.AccidentDate.Day == date.Day select x.WorkHoursLoss).ToList().Sum(x => x.Value)
+ (from x in Funs.DB.Accident_AccidentReport where x.ProjectId == projectid && x.AccidentDate.Value.Year == date.Year && x.AccidentDate.Value.Month == date.Month && x.AccidentDate.Value.Day == date.Day select x.WorkingHoursLoss).ToList().Sum(x => x.Value);
var result2 = (from x in Funs.DB.Accident_AccidentHandle where x.ProjectId == projectid select x.WorkHoursLoss).ToList().Sum(x => x.Value)
+ (from x in Funs.DB.Accident_AccidentReport where x.ProjectId == projectid select x.WorkingHoursLoss).ToList().Sum(x => x.Value);
var result = result1 - result2;
var q = Funs.GetNewIntOrZero(result.ToString());
@@ -727,10 +724,9 @@ namespace BLL
/// <returns></returns>
public static int GetSafeTrainNum(string projectid)
{
DateTime date = DateTime.Now;
int result = (from x in Funs.DB.EduTrain_TrainRecord
join y in Funs.DB.Base_TrainType on x.TrainTypeId equals y.TrainTypeId
where x.ProjectId == projectid && x.TrainStartDate.Value.Year == date.Year && x.TrainStartDate.Value.Month == date.Month && x.TrainStartDate.Value.Day == date.Day && y.TrainType == "1"
where x.ProjectId == projectid && y.TrainType == "1"
select x).Count();
return result;
}
@@ -740,10 +736,9 @@ namespace BLL
/// <returns></returns>
public static int GetSpecialTrainNum(string projectid)
{
DateTime date = DateTime.Now;
int result = (from x in Funs.DB.EduTrain_TrainRecord
join y in Funs.DB.Base_TrainType on x.TrainTypeId equals y.TrainTypeId
where x.ProjectId == projectid && x.TrainStartDate.Value.Year == date.Year && x.TrainStartDate.Value.Month == date.Month && x.TrainStartDate.Value.Day == date.Day && y.TrainType == "2"
where x.ProjectId == projectid && y.TrainType == "2"
select x).Count();
return result;
}
@@ -753,10 +748,9 @@ namespace BLL
/// <returns></returns>
public static int GetSpecialOperationTrainNum(string projectid)
{
DateTime date = DateTime.Now;
int result = (from x in Funs.DB.EduTrain_TrainRecord
join y in Funs.DB.Base_TrainType on x.TrainTypeId equals y.TrainTypeId
where x.ProjectId == projectid && x.TrainStartDate.Value.Year == date.Year && x.TrainStartDate.Value.Month == date.Month && x.TrainStartDate.Value.Day == date.Day && y.TrainType == "3"
where x.ProjectId == projectid && y.TrainType == "3"
select x).Count();
return result;
}
@@ -929,9 +923,8 @@ namespace BLL
/// <returns></returns>
public static int GetProjectSafetyLeadingGroupMeetingNum(string projectid)
{
//DateTime date = DateTime.Now;
//int result = (from x in Funs.DB.Meeting_SafetyLeaderGroupMeeting where x.ProjectId == projectid && x.SafetyLeaderGroupMeetingDate.Value.Year == date.Year && x.SafetyLeaderGroupMeetingDate.Value.Month == date.Month && x.SafetyLeaderGroupMeetingDate.Value.Day == date.Day select x).Count();
return 0;
int result = (from x in Funs.DB.Meeting_SafetyLeaderGroupMeeting where x.ProjectId == projectid select x).Count();
return result;
}
/// <summary>
/// 获取项目安全例会数
@@ -939,9 +932,8 @@ namespace BLL
/// <returns></returns>
public static int GetProjectSafetyMeetingNum(string projectid)
{
DateTime date = DateTime.Now;
int result = (from x in Funs.DB.Meeting_WeekMeeting where x.ProjectId == projectid && x.WeekMeetingDate.Value.Year == date.Year && x.WeekMeetingDate.Value.Month == date.Month && x.WeekMeetingDate.Value.Day == date.Day select x).Count()
+ (from x in Funs.DB.Meeting_MonthMeeting where x.ProjectId == projectid && x.MonthMeetingDate.Value.Year == date.Year && x.MonthMeetingDate.Value.Month == date.Month && x.MonthMeetingDate.Value.Day == date.Day select x).Count();
int result = (from x in Funs.DB.Meeting_WeekMeeting where x.ProjectId == projectid select x).Count()
+ (from x in Funs.DB.Meeting_MonthMeeting where x.ProjectId == projectid select x).Count();
return result;
}
/// <summary>
@@ -977,9 +969,8 @@ namespace BLL
/// <returns></returns>
public static int GetProjectLeadShiftCheckNum(string projectid)
{
//DateTime date = DateTime.Now;
//int result = (from x in Funs.DB.Check_ProjectLeaderCheck where x.ProjectId == projectid && x.CheckDate.Value.Year == date.Year && x.CheckDate.Value.Month == date.Month && x.CheckDate.Value.Day == date.Day select x).Count();
return 0;
int result = (from x in Funs.DB.Check_ProjectLeaderCheck where x.ProjectId == projectid select x).Count();
return result;
}
/// <summary>
/// 获取项目专项检查次数
@@ -987,8 +978,7 @@ namespace BLL
/// <returns></returns>
public static int GetProjectSpecialCheckNum(string projectid)
{
DateTime date = DateTime.Now;
int result = (from x in Funs.DB.Check_CheckSpecial where x.ProjectId == projectid && x.CheckTime.Value.Year == date.Year && x.CheckTime.Value.Month == date.Month && x.CheckTime.Value.Day == date.Day select x).Count();
int result = (from x in Funs.DB.Check_CheckSpecial where x.ProjectId == projectid select x).Count();
return result;
}
/// <summary>
@@ -997,8 +987,7 @@ namespace BLL
/// <returns></returns>
public static int GetProjectMajorCheckNum(string projectid)
{
DateTime date = DateTime.Now;
int result = (from x in Funs.DB.HSSE_Hazard_HazardRegister where x.ProjectId == projectid && x.CheckTime.Value.Year == date.Year && x.CheckTime.Value.Month == date.Month && x.CheckTime.Value.Day == date.Day select x).Count();
int result = (from x in Funs.DB.HSSE_Hazard_HazardRegister where x.ProjectId == projectid select x).Count();
return result;
}
/// <summary>
@@ -1007,10 +996,9 @@ namespace BLL
/// <returns></returns>
public static int GetNearMissNum(string projectid)
{
DateTime date = DateTime.Now;
int result = (from x in Funs.DB.Accident_AccidentPersonRecord
join y in Funs.DB.Base_AccidentType on x.AccidentTypeId equals y.AccidentTypeId
where x.ProjectId == projectid && x.AccidentDate.Year == date.Year && x.AccidentDate.Month == date.Month && x.AccidentDate.Day == date.Day && x.IsAttempt=="1"
where x.ProjectId == projectid && x.IsAttempt == "1"
select x).Count();
return result;
}
@@ -1020,10 +1008,9 @@ namespace BLL
/// <returns></returns>
public static int GetRecordableEventNum(string projectid)
{
DateTime date = DateTime.Now;
int result = (from x in Funs.DB.Accident_AccidentPersonRecord
join y in Funs.DB.Base_AccidentType on x.AccidentTypeId equals y.AccidentTypeId
where x.ProjectId == projectid && x.AccidentDate.Year == date.Year && x.AccidentDate.Month == date.Month && x.AccidentDate.Day == date.Day && x.IsAttempt != "1"
where x.ProjectId == projectid
select x).Count();
return result;
}
@@ -1033,8 +1020,7 @@ namespace BLL
/// <returns></returns>
public static int GetGeneralAccidentNum(string projectid)
{
DateTime date = DateTime.Now;
int result = (from x in Funs.DB.Accident_AccidentReport where x.ProjectId == projectid && x.AccidentDate.Value.Year == date.Year && x.AccidentDate.Value.Month == date.Month && x.AccidentDate.Value.Day == date.Day && x.AccidentDegree == "1" select x).Count();
int result = (from x in Funs.DB.Accident_AccidentReport where x.ProjectId == projectid && x.AccidentDegree == "1" select x).Count();
return result;
}
/// <summary>
@@ -1043,8 +1029,7 @@ namespace BLL
/// <returns></returns>
public static int GetMajorAccidentNum(string projectid)
{
DateTime date = DateTime.Now;
int result = (from x in Funs.DB.Accident_AccidentReport where x.ProjectId == projectid && x.AccidentDate.Value.Year == date.Year && x.AccidentDate.Value.Month == date.Month && x.AccidentDate.Value.Day == date.Day && x.AccidentDegree == "2" select x).Count();
int result = (from x in Funs.DB.Accident_AccidentReport where x.ProjectId == projectid && x.AccidentDegree == "2" select x).Count();
return result;
}
/// <summary>
@@ -1053,8 +1038,7 @@ namespace BLL
/// <returns></returns>
public static int GetSeriousAccidentNum(string projectid)
{
DateTime date = DateTime.Now;
int result = (from x in Funs.DB.Accident_AccidentReport where x.ProjectId == projectid && x.AccidentDate.Value.Year == date.Year && x.AccidentDate.Value.Month == date.Month && x.AccidentDate.Value.Day == date.Day && x.AccidentDegree == "3" select x).Count();
int result = (from x in Funs.DB.Accident_AccidentReport where x.ProjectId == projectid && x.AccidentDegree == "3" select x).Count();
return result;
}
/// <summary>
@@ -1063,8 +1047,7 @@ namespace BLL
/// <returns></returns>
public static int GetSpecialSeriousAccidentNum(string projectid)
{
DateTime date = DateTime.Now;
int result = (from x in Funs.DB.Accident_AccidentReport where x.ProjectId == projectid && x.AccidentDate.Value.Year == date.Year && x.AccidentDate.Value.Month == date.Month && x.AccidentDate.Value.Day == date.Day && x.AccidentDegree == "4" select x).Count();
int result = (from x in Funs.DB.Accident_AccidentReport where x.ProjectId == projectid && x.AccidentDegree == "4" select x).Count();
return result;
}
/// <summary>
@@ -1109,11 +1092,9 @@ namespace BLL
/// <returns></returns>
public static int GetProjectComprehensivePlanNum(string projectid)
{
DateTime date = DateTime.Now;
int result = (from x in Funs.DB.Emergency_EmergencyList
join y in Funs.DB.Base_EmergencyType on x.EmergencyTypeId equals y.EmergencyTypeId
where x.ProjectId == projectid && x.CompileDate.Value.Year == date.Year && x.CompileDate.Value.Month == date.Month
&& x.CompileDate.Value.Day == date.Day && y.EmergencyTypeName.Contains("综合")
where x.ProjectId == projectid && y.EmergencyTypeName.Contains("综合")
select x).Count();
return result;
}
@@ -1123,11 +1104,9 @@ namespace BLL
/// <returns></returns>
public static int GetProjectSpecialPlanNum(string projectid)
{
DateTime date = DateTime.Now;
int result = (from x in Funs.DB.Emergency_EmergencyList
join y in Funs.DB.Base_EmergencyType on x.EmergencyTypeId equals y.EmergencyTypeId
where x.ProjectId == projectid && x.CompileDate.Value.Year == date.Year && x.CompileDate.Value.Month == date.Month
&& x.CompileDate.Value.Day == date.Day && y.EmergencyTypeName.Contains("专项")
where x.ProjectId == projectid && y.EmergencyTypeName.Contains("专项")
select x).Count();
return result;
}
@@ -1137,11 +1116,9 @@ namespace BLL
/// <returns></returns>
public static int GetProjectOnSiteDisposalPlan(string projectid)
{
DateTime date = DateTime.Now;
int result = (from x in Funs.DB.Emergency_EmergencyList
join y in Funs.DB.Base_EmergencyType on x.EmergencyTypeId equals y.EmergencyTypeId
where x.ProjectId == projectid && x.CompileDate.Value.Year == date.Year && x.CompileDate.Value.Month == date.Month
&& x.CompileDate.Value.Day == date.Day && y.EmergencyTypeName.Contains("现场处置")
where x.ProjectId == projectid && y.EmergencyTypeName.Contains("现场处置")
select x).Count();
return result;
}
@@ -1151,10 +1128,8 @@ namespace BLL
/// <returns></returns>
public static int GetProjectDrillNum(string projectid)
{
DateTime date = DateTime.Now;
int result = (from x in Funs.DB.Emergency_DrillRecordList
where x.ProjectId == projectid && x.DrillRecordDate.Value.Year == date.Year && x.DrillRecordDate.Value.Month == date.Month
&& x.DrillRecordDate.Value.Day == date.Day
where x.ProjectId == projectid
select x).Count();
return result;
}
@@ -1174,6 +1149,12 @@ namespace BLL
public static int GetCostUse(string projectid)
{
int result = 0;
var costs = (from x in Funs.DB.CostGoods_CostSmallDetailItem
join y in Funs.DB.CostGoods_CostSmallDetail
on x.CostSmallDetailId equals y.CostSmallDetailId
where y.ProjectId == projectid
select x.CostMoney ?? 0).ToList().Sum();
result = Funs.GetNewIntOrZero(costs.ToString().Split('.')[0]);
return result;
}
/// <summary>
@@ -1341,7 +1322,7 @@ namespace BLL
{
int result = (from x in Funs.DB.Solution_LargerHazard
where x.ProjectId == projectid && x.IsSuperLargerHazard == false
select x.TrainPersonNum ).ToList().Sum(x=>x.Value);
select x.TrainPersonNum).ToList().Sum(x => x.Value);
return result;
}
/// <summary>