提交代码

This commit is contained in:
2024-04-28 14:14:52 +08:00
parent fbc54e00b2
commit 176ae6433b
10 changed files with 96 additions and 43 deletions
@@ -24,8 +24,13 @@ namespace FineUIPro.Web
{
get
{
List<Model.View_Check_SoptCheckDetail> TotalCheckDetailOKLists = SpotCheckDetailService.GetTotalOKSpotCheckDetailListByTime1(CurrUser.LoginProjectId, DateTime.Now);
List<Model.View_Check_SoptCheckDetail> TotalCheckDetailLists = SpotCheckDetailService.GetTotalAllSpotCheckDetailListByTime(CurrUser.LoginProjectId, DateTime.Now);
var db = new Model.SGGLDB(Funs.ConnString);
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();
double result = 0;
if (TotalCheckDetailOKLists.Count > 0 && TotalCheckDetailLists.Count > 0)
{
@@ -48,7 +53,7 @@ namespace FineUIPro.Web
if (ndtList != null && !string.IsNullOrEmpty(ndtList.TotalRate))
{
result = Convert.ToDouble(ndtList.TotalRate) / 100;
result = Convert.ToDouble(ndtList.TotalRate);
}
return JsonConvert.SerializeObject(result);
}
@@ -60,12 +65,14 @@ namespace FineUIPro.Web
{
get
{
List<Model.View_Check_JointCheckDetail> totalCheckLists = JointCheckDetailService.GetTotalJointCheckDetailListByTime(CurrUser.LoginProjectId, DateTime.Now);
int a = totalCheckLists.Where(x => x.OK == 1).Count();
var checks = from x in Funs.DB.Check_CheckControl
where x.CheckDate <= DateTime.Now && x.ProjectId == CurrUser.LoginProjectId
select x;
int a = checks.Where(x => x.State == "7").Count();
double result = 0;
if (a > 0 && totalCheckLists.Count > 0)
if (a > 0 && checks.Count() > 0)
{
var b = Convert.ToDouble(totalCheckLists.Count);
var b = Convert.ToDouble(checks.Count());
result = Convert.ToDouble(decimal.Round(decimal.Parse((a / b * 100).ToString()), 1));
}
return JsonConvert.SerializeObject(result);