提交代码

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
+56 -50
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 == "1").Count();
int sgspl = Funs.DB.Solution_CQMSConstructSolution.Where(x => x.ProjectId == ProjectId && x.State == Const.CQMSConstructSolution_Complete).Count();
div_sgfaSpl.InnerHtml = sgspl.ToString();
GetJD();
//质量共检
@@ -405,12 +405,13 @@ 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 = num1 + num2;
result = num2;
return result;
}
@@ -636,59 +637,64 @@ namespace FineUIPro.Web.common
List<double> listdata = new List<double>();
double result = 0;
Model.SGGLDB db = Funs.DB;
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)
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)
{
decimal a = 0, b = 0;
foreach (var item in ndtLists)
if (ndtList.TotalQuantity.HasValue)
{
a += Funs.GetNewDecimalOrZero(item.OneTimeFilmQualifiedAmount);
b += Funs.GetNewDecimalOrZero(item.OneTimeFilmAmount);
a += Math.Floor(ndtList.TotalQuantity.Value * Funs.GetNewDecimalOrZero(ndtList.TotalRate) / 100);
b += ndtList.TotalQuantity.Value;
}
if (b > 0)
if (!string.IsNullOrEmpty(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();
result = Convert.ToDouble(ndtList.TotalRate);
}
}
else
if (b > 0)
{
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();
}
}
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