提交代码

This commit is contained in:
高飞 2024-04-22 11:21:48 +08:00
parent 4e9dddbaed
commit 7baffe5c70
3 changed files with 1444 additions and 1609 deletions

View File

@ -105,7 +105,7 @@ namespace FineUIPro.Web.common
divCqmsPxNum.InnerHtml = CqmsPxNum.ToString(); divCqmsPxNum.InnerHtml = CqmsPxNum.ToString();
//施工审批量 //施工审批量
int sgspl = Funs.DB.Solution_CQMSConstructSolution.Where(x => x.ProjectId == ProjectId && x.State == "1").Count(); int sgspl = Funs.DB.Solution_CQMSConstructSolution.Where(x => x.ProjectId == ProjectId && x.State == Const.CQMSConstructSolution_Complete).Count();
div_sgfaSpl.InnerHtml = sgspl.ToString(); div_sgfaSpl.InnerHtml = sgspl.ToString();
GetJD(); GetJD();
//质量共检 //质量共检
@ -405,12 +405,13 @@ namespace FineUIPro.Web.common
{ {
int result = 0; int result = 0;
//机具报验的到期提醒和过期提醒记录数加一起 //机具报验的到期提醒和过期提醒记录数加一起
//机具报验的到期提醒数 ////机具报验的到期提醒数
var num1 = Funs.DB.Comprehensive_InspectionMachine.Where(x => x.IsOnSite == true && DateTime.Now < x.NextTestDate && x.ProjectId == ProjectId //var num1 = Funs.DB.Comprehensive_InspectionMachine.Where(x => x.IsOnSite == true && DateTime.Now < x.NextTestDate && x.ProjectId == ProjectId
&& ((DateTime)x.NextTestDate).AddDays(-15) < DateTime.Now).Count(); // && ((DateTime)x.NextTestDate).AddDays(-15) < DateTime.Now).Count();
//过期提醒记录数 //过期提醒记录数
var num2 = Funs.DB.Comprehensive_InspectionMachine.Where(x => x.IsOnSite == true && x.NextTestDate < DateTime.Now && x.ProjectId == ProjectId).Count(); var num2 = Funs.DB.Comprehensive_InspectionMachine.Where(x => x.IsOnSite == true && x.NextTestDate < DateTime.Now && x.ProjectId == ProjectId).Count();
result = num1 + num2; //result = num1 + num2;
result = num2;
return result; return result;
} }
@ -636,59 +637,64 @@ namespace FineUIPro.Web.common
List<double> listdata = new List<double>(); List<double> listdata = new List<double>();
double result = 0; double result = 0;
Model.SGGLDB db = Funs.DB; Model.SGGLDB db = Funs.DB;
var ndtLists = from x in db.HJGL_FL_NdtList where x.ProjectId == ProjectId select x; var ndtList = (from x in db.ProcessControl_NondestructiveTest_New where x.ProfessionalName == "工艺管道" && x.ProjectId == ProjectId orderby x.CreateDate descending select x).FirstOrDefault();
////一次检测合格焊口数 decimal a = 0, b = 0;
//int oneCheckJotNum = (from x in db.HJGL_Batch_NDEItem if (ndtList != null)
// join y in db.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals y.TrustBatchItemId
// join z in db.HJGL_Batch_PointBatchItem on y.PointBatchItemId equals z.PointBatchItemId
// join a in db.HJGL_Batch_NDE on x.NDEID equals a.NDEID
// where z.PointDate != null && z.PointState == "1" && y.RepairRecordId == null
// && a.ProjectId == ProjectId
// select x.NDEItemID).Count();
////一次检测返修焊口数
//int oneCheckRepairJotNum = (from x in db.HJGL_Batch_NDEItem
// join y in db.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals y.TrustBatchItemId
// join z in db.HJGL_Batch_PointBatchItem on y.PointBatchItemId equals z.PointBatchItemId
// join a in db.HJGL_Batch_NDE on x.NDEID equals a.NDEID
// where z.PointDate != null && z.PointState == "1" && y.RepairRecordId == null && x.CheckResult == "2"
// && a.ProjectId == ProjectId
// select x.NDEItemID).Count();
if (ndtLists.Count() > 0)
{ {
decimal a = 0, b = 0; if (ndtList.TotalQuantity.HasValue)
foreach (var item in ndtLists)
{ {
a += Funs.GetNewDecimalOrZero(item.OneTimeFilmQualifiedAmount); a += Math.Floor(ndtList.TotalQuantity.Value * Funs.GetNewDecimalOrZero(ndtList.TotalRate) / 100);
b += Funs.GetNewDecimalOrZero(item.OneTimeFilmAmount); b += ndtList.TotalQuantity.Value;
} }
if (b > 0) if (!string.IsNullOrEmpty(ndtList.TotalRate))
{ {
result = Convert.ToDouble(decimal.Round(decimal.Parse((a / b * 100).ToString()), 2)); result = Convert.ToDouble(ndtList.TotalRate);
hjallNumber = b.ToString();
hjfinishNumber = a.ToString();
hjzgl = result.ToString();
hjDataValue = (100 - result).ToString();
} }
} }
else if (b > 0)
{ {
var data = (from x in db.HJGL_FL_Data where x.ProjectId == ProjectId orderby x.CompileDate descending select x).FirstOrDefault(); hjallNumber = b.ToString();
if (data != null) hjfinishNumber = a.ToString();
{ hjzgl = result.ToString();
decimal a = Funs.GetNewDecimalOrZero(data.OneTimeFilmQualifiedAmount); hjDataValue = (100 - result).ToString();
decimal b = Funs.GetNewDecimalOrZero(data.OneTimeFilmAmount);
if (b > 0)
{
result = Convert.ToDouble(decimal.Round(decimal.Parse((a / b * 100).ToString()), 2));
hjallNumber = b.ToString();
hjfinishNumber = a.ToString();
hjzgl = result.ToString();
hjDataValue = (100 - result).ToString();
}
}
} }
//var ndtLists = from x in db.HJGL_FL_NdtList where x.ProjectId == ProjectId select x;
//if (ndtLists.Count() > 0)
//{
// decimal a = 0, b = 0;
// foreach (var item in ndtLists)
// {
// a += Funs.GetNewDecimalOrZero(item.OneTimeFilmQualifiedAmount);
// b += Funs.GetNewDecimalOrZero(item.OneTimeFilmAmount);
// }
// if (b > 0)
// {
// result = Convert.ToDouble(decimal.Round(decimal.Parse((a / b * 100).ToString()), 2));
// hjallNumber = b.ToString();
// hjfinishNumber = a.ToString();
// hjzgl = result.ToString();
// hjDataValue = (100 - result).ToString();
// }
//}
//else
//{
// var data = (from x in db.HJGL_FL_Data where x.ProjectId == ProjectId orderby x.CompileDate descending select x).FirstOrDefault();
// if (data != null)
// {
// decimal a = Funs.GetNewDecimalOrZero(data.OneTimeFilmQualifiedAmount);
// decimal b = Funs.GetNewDecimalOrZero(data.OneTimeFilmAmount);
// if (b > 0)
// {
// result = Convert.ToDouble(decimal.Round(decimal.Parse((a / b * 100).ToString()), 2));
// hjallNumber = b.ToString();
// hjfinishNumber = a.ToString();
// hjzgl = result.ToString();
// hjDataValue = (100 - result).ToString();
// }
// }
//}
} }
#endregion #endregion

View File

@ -162,11 +162,12 @@ namespace FineUIPro.Web.common
int result = 0; int result = 0;
//机具报验的到期提醒和过期提醒记录数加一起 //机具报验的到期提醒和过期提醒记录数加一起
//机具报验的到期提醒数 //机具报验的到期提醒数
var num1 = Funs.DB.Comprehensive_InspectionMachine.Where(x => x.IsOnSite == true && DateTime.Now < x.NextTestDate //var num1 = Funs.DB.Comprehensive_InspectionMachine.Where(x => x.IsOnSite == true && DateTime.Now < x.NextTestDate
&& ((DateTime)x.NextTestDate).AddDays(-15) < DateTime.Now).Count(); // && ((DateTime)x.NextTestDate).AddDays(-15) < DateTime.Now).Count();
//过期提醒记录数 //过期提醒记录数
var num2 = Funs.DB.Comprehensive_InspectionMachine.Where(x => x.IsOnSite == true && x.NextTestDate < DateTime.Now).Count(); var num2 = Funs.DB.Comprehensive_InspectionMachine.Where(x => x.IsOnSite == true && x.NextTestDate < DateTime.Now).Count();
result = num1 + num2; //result = num1 + num2;
result = num2;
return result; return result;
} }
@ -200,9 +201,8 @@ namespace FineUIPro.Web.common
private void getEarlyWarningCounts() private void getEarlyWarningCounts()
{ {
int allCount = 0; int allCount = 0;
var getPersonQualitys = from x in Funs.DB.QualityAudit_PersonQuality var getPersonQualitys = from x in Funs.DB.Comprehensive_InspectionPerson
join y in Funs.DB.SitePerson_Person on x.PersonId equals y.PersonId where x.ValidityDate.HasValue && x.ValidityDate < DateTime.Now && x.IsOnSite == true
where x.LimitDate.HasValue && x.LimitDate < DateTime.Now
select x; select x;
//// 预警人数 //// 预警人数
allCount = getPersonQualitys.Count(); allCount = getPersonQualitys.Count();

File diff suppressed because it is too large Load Diff