Compare commits

..

No commits in common. "ea70665f8c0f925f71e390dfcd65eb4bfffcb5ab" and "5d9374cdd71cce987b603ca0584f175f3eb02e94" have entirely different histories.

2 changed files with 56 additions and 62 deletions

View File

@ -105,7 +105,7 @@ namespace FineUIPro.Web.common
divCqmsPxNum.InnerHtml = CqmsPxNum.ToString();
//施工审批量
int sgspl = Funs.DB.Solution_CQMSConstructSolution.Where(x => x.ProjectId == ProjectId && x.State == Const.CQMSConstructSolution_Complete).Count();
int sgspl = Funs.DB.Solution_CQMSConstructSolution.Where(x => x.ProjectId == ProjectId && x.State == "1").Count();
div_sgfaSpl.InnerHtml = sgspl.ToString();
GetJD();
//质量共检
@ -405,13 +405,12 @@ namespace FineUIPro.Web.common
{
int result = 0;
//机具报验的到期提醒和过期提醒记录数加一起
////机具报验的到期提醒数
//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();
//机具报验的到期提醒数
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();
//过期提醒记录数
var num2 = Funs.DB.Comprehensive_InspectionMachine.Where(x => x.IsOnSite == true && x.NextTestDate < DateTime.Now && x.ProjectId == ProjectId).Count();
//result = num1 + num2;
result = num2;
result = num1 + num2;
return result;
}
@ -637,64 +636,59 @@ namespace FineUIPro.Web.common
List<double> listdata = new List<double>();
double result = 0;
Model.SGGLDB db = Funs.DB;
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;
if (ndtList != null)
var ndtLists = from x in db.HJGL_FL_NdtList where x.ProjectId == ProjectId select x;
////一次检测合格焊口数
//int oneCheckJotNum = (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
// && 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)
{
if (ndtList.TotalQuantity.HasValue)
decimal a = 0, b = 0;
foreach (var item in ndtLists)
{
a += Math.Floor(ndtList.TotalQuantity.Value * Funs.GetNewDecimalOrZero(ndtList.TotalRate) / 100);
b += ndtList.TotalQuantity.Value;
a += Funs.GetNewDecimalOrZero(item.OneTimeFilmQualifiedAmount);
b += Funs.GetNewDecimalOrZero(item.OneTimeFilmAmount);
}
if (!string.IsNullOrEmpty(ndtList.TotalRate))
if (b > 0)
{
result = Convert.ToDouble(ndtList.TotalRate);
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();
}
}
if (b > 0)
else
{
hjallNumber = b.ToString();
hjfinishNumber = a.ToString();
hjzgl = result.ToString();
hjDataValue = (100 - result).ToString();
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();
}
}
}
//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

View File

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