20241028 共检通知单专业
This commit is contained in:
@@ -333,50 +333,100 @@ namespace FineUIPro.Web
|
||||
Model.BusinessColumn businessColumn = new Model.BusinessColumn();
|
||||
List<string> listCategories = new List<string>();
|
||||
businessColumn.title = "质量一次合格率";
|
||||
var cns = BLL.CNProfessionalService.GetCnProList();
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
List<Model.ProcessControl_InspectionManagement> TotalCheckDetailOKLists = (from x in db.ProcessControl_InspectionManagement
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId && x.IsOnceQualified == true
|
||||
select x).ToList();
|
||||
List<Model.ProcessControl_InspectionManagement> TotalCheckDetailLists = (from x in db.ProcessControl_InspectionManagement
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
select x).ToList();
|
||||
Model.SingleSerie s = new Model.SingleSerie();
|
||||
Model.SingleSerie s2 = new Model.SingleSerie();
|
||||
List<double> listdata = new List<double>();
|
||||
List<double> listdata2 = new List<double>();
|
||||
double result = 0, result2 = 0;
|
||||
foreach (var cn in cns)
|
||||
|
||||
//专业测试阶段,仅hfnbd使用
|
||||
if (this.CurrUser.UserId == BLL.Const.hfnbdId)
|
||||
{
|
||||
listCategories.Add(cn.DetectionItems);
|
||||
var okChecks = TotalCheckDetailOKLists.Where(x => x.CNProfessionalId == cn.ControlId).ToList();
|
||||
var totalChecks = TotalCheckDetailLists.Where(x => x.CNProfessionalId == cn.ControlId).ToList();
|
||||
if (okChecks.Count > 0 && totalChecks.Count > 0)
|
||||
var cns = BLL.CNProfessionalService.GetCnProList();
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
List<Model.ProcessControl_InspectionManagement> TotalCheckDetailOKLists = (from x in db.ProcessControl_InspectionManagement
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId && x.IsOnceQualified == true
|
||||
select x).ToList();
|
||||
List<Model.ProcessControl_InspectionManagement> TotalCheckDetailLists = (from x in db.ProcessControl_InspectionManagement
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
select x).ToList();
|
||||
Model.SingleSerie s = new Model.SingleSerie();
|
||||
Model.SingleSerie s2 = new Model.SingleSerie();
|
||||
List<double> listdata = new List<double>();
|
||||
List<double> listdata2 = new List<double>();
|
||||
double result = 0, result2 = 0;
|
||||
foreach (var cn in cns)
|
||||
{
|
||||
var a = Convert.ToDouble(okChecks.Count);
|
||||
var b = Convert.ToDouble(totalChecks.Count);
|
||||
result = Convert.ToDouble(decimal.Round(decimal.Parse((a / b * 100).ToString()), 1));
|
||||
}
|
||||
if (cn.DetectionItems.Contains("管道"))
|
||||
{
|
||||
var ndtList = (from x in db.ProcessControl_NondestructiveTest_New where x.ProfessionalName == "工艺管道" && x.ProjectId == this.CurrUser.LoginProjectId orderby x.CreateDate descending select x).FirstOrDefault();
|
||||
if (ndtList != null && !string.IsNullOrEmpty(ndtList.TotalRate))
|
||||
listCategories.Add(cn.DetectionItems);
|
||||
var okChecks = TotalCheckDetailOKLists.Where(x => x.CNProfessionalId == cn.ControlId).ToList();
|
||||
var totalChecks = TotalCheckDetailLists.Where(x => x.CNProfessionalId == cn.ControlId).ToList();
|
||||
if (okChecks.Count > 0 && totalChecks.Count > 0)
|
||||
{
|
||||
result2 = Convert.ToDouble(ndtList.TotalRate);
|
||||
var a = Convert.ToDouble(okChecks.Count);
|
||||
var b = Convert.ToDouble(totalChecks.Count);
|
||||
result = Convert.ToDouble(decimal.Round(decimal.Parse((a / b * 100).ToString()), 1));
|
||||
}
|
||||
if (cn.DetectionItems.Contains("管道"))
|
||||
{
|
||||
var ndtList = (from x in db.ProcessControl_NondestructiveTest_New where x.ProfessionalName == "工艺管道" && x.ProjectId == this.CurrUser.LoginProjectId orderby x.CreateDate descending select x).FirstOrDefault();
|
||||
if (ndtList != null && !string.IsNullOrEmpty(ndtList.TotalRate))
|
||||
{
|
||||
result2 = Convert.ToDouble(ndtList.TotalRate);
|
||||
}
|
||||
}
|
||||
listdata.Add(result);
|
||||
listdata2.Add(result2);
|
||||
result = 0;
|
||||
result2 = 0;
|
||||
}
|
||||
listdata.Add(result);
|
||||
listdata2.Add(result2);
|
||||
result = 0;
|
||||
result2 = 0;
|
||||
s.data = listdata;
|
||||
s2.data = listdata2;
|
||||
series.Add(s);
|
||||
series.Add(s2);
|
||||
}
|
||||
else
|
||||
{
|
||||
var cns = BLL.CNProfessionalService.GetList();
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
List<Model.ProcessControl_InspectionManagement> TotalCheckDetailOKLists = (from x in db.ProcessControl_InspectionManagement
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId && x.IsOnceQualified == true
|
||||
select x).ToList();
|
||||
List<Model.ProcessControl_InspectionManagement> TotalCheckDetailLists = (from x in db.ProcessControl_InspectionManagement
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
select x).ToList();
|
||||
Model.SingleSerie s = new Model.SingleSerie();
|
||||
Model.SingleSerie s2 = new Model.SingleSerie();
|
||||
List<double> listdata = new List<double>();
|
||||
List<double> listdata2 = new List<double>();
|
||||
double result = 0, result2 = 0;
|
||||
foreach (var cn in cns)
|
||||
{
|
||||
listCategories.Add(cn.ProfessionalName);
|
||||
var okChecks = TotalCheckDetailOKLists.Where(x => x.CNProfessionalId == cn.CNProfessionalId).ToList();
|
||||
var totalChecks = TotalCheckDetailLists.Where(x => x.CNProfessionalId == cn.CNProfessionalId).ToList();
|
||||
if (okChecks.Count > 0 && totalChecks.Count > 0)
|
||||
{
|
||||
var a = Convert.ToDouble(okChecks.Count);
|
||||
var b = Convert.ToDouble(totalChecks.Count);
|
||||
result = Convert.ToDouble(decimal.Round(decimal.Parse((a / b * 100).ToString()), 1));
|
||||
}
|
||||
if (cn.ProfessionalName.Contains("管道"))
|
||||
{
|
||||
var ndtList = (from x in db.ProcessControl_NondestructiveTest_New where x.ProfessionalName == "工艺管道" && x.ProjectId == this.CurrUser.LoginProjectId orderby x.CreateDate descending select x).FirstOrDefault();
|
||||
if (ndtList != null && !string.IsNullOrEmpty(ndtList.TotalRate))
|
||||
{
|
||||
result2 = Convert.ToDouble(ndtList.TotalRate);
|
||||
}
|
||||
}
|
||||
listdata.Add(result);
|
||||
listdata2.Add(result2);
|
||||
result = 0;
|
||||
result2 = 0;
|
||||
}
|
||||
s.data = listdata;
|
||||
s2.data = listdata2;
|
||||
series.Add(s);
|
||||
series.Add(s2);
|
||||
}
|
||||
s.data = listdata;
|
||||
s2.data = listdata2;
|
||||
series.Add(s);
|
||||
series.Add(s2);
|
||||
businessColumn.categories = listCategories;
|
||||
businessColumn.series = series;
|
||||
return JsonConvert.SerializeObject(businessColumn);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user