2023-08-24 10:00:59 +08:00
|
|
|
|
using BLL;
|
2023-11-02 15:34:51 +08:00
|
|
|
|
using FineUIPro.Web.BaseInfo;
|
2023-08-24 10:00:59 +08:00
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
2023-11-21 15:44:14 +08:00
|
|
|
|
using System.IO;
|
2023-08-24 10:00:59 +08:00
|
|
|
|
using System.Linq;
|
2023-11-02 15:34:51 +08:00
|
|
|
|
using System.Runtime.InteropServices.ComTypes;
|
2023-08-24 10:00:59 +08:00
|
|
|
|
using System.Web;
|
|
|
|
|
using System.Web.UI;
|
|
|
|
|
using System.Web.UI.WebControls;
|
|
|
|
|
|
|
|
|
|
namespace FineUIPro.Web.common
|
|
|
|
|
{
|
|
|
|
|
public partial class main_new1 : PageBase
|
|
|
|
|
{
|
2023-11-21 15:44:14 +08:00
|
|
|
|
protected string divProjectImg;
|
2024-04-19 15:48:37 +08:00
|
|
|
|
protected string hjallNumber = "0";
|
|
|
|
|
protected string hjfinishNumber = "0";
|
|
|
|
|
protected string hjzgl = "0";
|
2024-09-11 10:36:09 +08:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 公司级项目筛选
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string[] pids { get; set; }
|
|
|
|
|
|
2023-08-24 10:00:59 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// 页面加载
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (!IsPostBack)
|
2024-04-19 15:48:37 +08:00
|
|
|
|
{
|
2024-09-11 10:36:09 +08:00
|
|
|
|
if (!string.IsNullOrEmpty(CurrUser.CompanyProjectId))
|
|
|
|
|
{
|
|
|
|
|
pids = CurrUser.CompanyProjectId.Split(',');
|
|
|
|
|
}
|
2024-09-23 10:31:03 +08:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
//加载所有在建项目的数据
|
|
|
|
|
var pidArray = Funs.DB.Base_Project.Where(x => x.ProjectState == "1").Select(x => x.ProjectId).ToArray();
|
|
|
|
|
if (pidArray.Length > 0)
|
|
|
|
|
{
|
|
|
|
|
pids = pidArray;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-11-21 15:44:14 +08:00
|
|
|
|
ProjectService.InitProjectShortNameByStateDropDownList(this.drpProject, this.CurrUser.UserId, BLL.Const.ProjectState_1, false);
|
|
|
|
|
if (this.drpProject.Items.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
this.drpProject.SelectedIndex = 0;
|
|
|
|
|
}
|
|
|
|
|
divProjectImg = "<div class=\"swiper-slide\"><img src=\"./imags/16.png\"></div>";
|
2023-08-24 10:00:59 +08:00
|
|
|
|
//质量问题治理数据
|
|
|
|
|
getProblemNums();
|
|
|
|
|
|
|
|
|
|
//质量验收图表
|
|
|
|
|
getInspectionManagementInfo();
|
|
|
|
|
|
|
|
|
|
//NCR数据图表
|
|
|
|
|
getNcrInfo();
|
2023-08-25 09:52:24 +08:00
|
|
|
|
|
|
|
|
|
//资质预警
|
|
|
|
|
getEarlyWarningCounts();
|
2024-04-19 15:48:37 +08:00
|
|
|
|
|
2025-03-19 15:02:56 +08:00
|
|
|
|
getCNEN();
|
2024-04-19 15:48:37 +08:00
|
|
|
|
//在建项目
|
|
|
|
|
var allProjects = ProjectService.GetAllProjectDropDownList();
|
|
|
|
|
//焊接数据
|
|
|
|
|
double result = 0;
|
|
|
|
|
Model.SGGLDB db = Funs.DB;
|
|
|
|
|
var ndtLists = from x in db.ProcessControl_NondestructiveTest_New where x.ProfessionalName == "工艺管道" select x;
|
|
|
|
|
decimal a = 0, b = 0;
|
|
|
|
|
if (ndtLists.Count() > 0)
|
|
|
|
|
{
|
|
|
|
|
foreach (var project in allProjects)
|
|
|
|
|
{
|
|
|
|
|
var ndt = (from x in ndtLists
|
|
|
|
|
where x.ProjectId == project.ProjectId
|
|
|
|
|
orderby x.CreateDate descending
|
|
|
|
|
select x).FirstOrDefault();
|
|
|
|
|
if (ndt != null)
|
|
|
|
|
{
|
|
|
|
|
if (ndt.TotalQuantity.HasValue)
|
|
|
|
|
{
|
|
|
|
|
a += Math.Floor(ndt.TotalQuantity.Value * Funs.GetNewDecimalOrZero(ndt.TotalRate) / 100);
|
|
|
|
|
b += ndt.TotalQuantity.Value;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (b > 0)
|
|
|
|
|
{
|
|
|
|
|
result = Convert.ToDouble(decimal.Round(decimal.Parse((a / b * 100).ToString()), 2));
|
|
|
|
|
|
|
|
|
|
hjallNumber = b.ToString();
|
|
|
|
|
hjfinishNumber = a.ToString();
|
|
|
|
|
hjzgl = result.ToString() + "%";
|
|
|
|
|
}
|
2023-08-24 10:00:59 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取企业总部人数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static int GetCompanyPersonNum()
|
|
|
|
|
{
|
|
|
|
|
string unitId = string.Empty;
|
|
|
|
|
var thisUnit = CommonService.GetIsThisUnit();
|
|
|
|
|
if (thisUnit != null)
|
|
|
|
|
{
|
|
|
|
|
unitId = thisUnit.UnitId;
|
|
|
|
|
}
|
|
|
|
|
int result = (from x in Funs.DB.Person_CompanyBranchPerson
|
2024-04-18 15:04:08 +08:00
|
|
|
|
join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId
|
|
|
|
|
where x.IsOnJob == true && x.UnitId == unitId && y.IsCQMS == true
|
2023-08-24 10:00:59 +08:00
|
|
|
|
select x).Count();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取分支机构人数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static int GetBranchPersonNum()
|
|
|
|
|
{
|
|
|
|
|
string unitId = string.Empty;
|
|
|
|
|
var thisUnit = CommonService.GetIsThisUnit();
|
|
|
|
|
if (thisUnit != null)
|
|
|
|
|
{
|
|
|
|
|
unitId = thisUnit.UnitId;
|
|
|
|
|
}
|
|
|
|
|
int result = (from x in Funs.DB.Person_CompanyBranchPerson
|
2024-04-18 15:04:08 +08:00
|
|
|
|
join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId
|
|
|
|
|
where x.IsOnJob == true && x.UnitId != unitId && y.IsCQMS == true
|
2023-08-24 10:00:59 +08:00
|
|
|
|
select x).Count();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取项目部人数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
2024-10-28 15:19:46 +08:00
|
|
|
|
public int GetProjectPersonNum()
|
2023-08-24 10:00:59 +08:00
|
|
|
|
{
|
2024-09-11 10:36:09 +08:00
|
|
|
|
if (pids == null)
|
|
|
|
|
{
|
|
|
|
|
int result = (from x in Funs.DB.SitePerson_Person
|
|
|
|
|
join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId
|
|
|
|
|
where y.IsCQMS == true && x.IsUsed == true
|
|
|
|
|
select x).Count();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
int result = (from x in Funs.DB.SitePerson_Person
|
|
|
|
|
join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId
|
2024-10-28 15:19:46 +08:00
|
|
|
|
where y.IsCQMS == true && x.IsUsed == true && pids.Contains(x.ProjectId)
|
2024-09-11 10:36:09 +08:00
|
|
|
|
select x).Count();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
2024-10-28 15:19:46 +08:00
|
|
|
|
|
2023-08-24 10:00:59 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取在用计量器具数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
2024-10-28 15:19:46 +08:00
|
|
|
|
public int GetUseNum()
|
2023-08-24 10:00:59 +08:00
|
|
|
|
{
|
2024-09-11 10:36:09 +08:00
|
|
|
|
if (pids == null)
|
|
|
|
|
{
|
|
|
|
|
int result = (from x in Funs.DB.Comprehensive_InspectionMachine
|
|
|
|
|
where x.IsOnSite == true && x.InspectionType.Contains("计量")
|
|
|
|
|
select x).Count();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
int result = (from x in Funs.DB.Comprehensive_InspectionMachine
|
|
|
|
|
where x.IsOnSite == true && x.InspectionType.Contains("计量") && pids.Contains(x.ProjectId)
|
|
|
|
|
select x).Count();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
2024-10-28 15:19:46 +08:00
|
|
|
|
|
2023-08-24 10:00:59 +08:00
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取校准合格数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
2024-10-28 15:19:46 +08:00
|
|
|
|
public int GetOKNum()
|
2023-08-24 10:00:59 +08:00
|
|
|
|
{
|
2024-09-11 10:36:09 +08:00
|
|
|
|
if (pids == null)
|
|
|
|
|
{
|
|
|
|
|
int result = (from x in Funs.DB.Comprehensive_InspectionMachine
|
|
|
|
|
where x.IsOnSite == true && x.InspectionType.Contains("计量") && x.IsCheckOK == true
|
|
|
|
|
select x).Count();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
int result = (from x in Funs.DB.Comprehensive_InspectionMachine
|
|
|
|
|
where x.IsOnSite == true && x.InspectionType.Contains("计量") && x.IsCheckOK == true && pids.Contains(x.ProjectId)
|
|
|
|
|
select x).Count();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
2023-08-24 10:00:59 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 机械预警
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
2024-10-28 15:19:46 +08:00
|
|
|
|
public int GetJxyjNum()
|
2024-04-19 15:48:37 +08:00
|
|
|
|
{
|
2024-09-11 10:36:09 +08:00
|
|
|
|
if (pids == null)
|
|
|
|
|
{
|
|
|
|
|
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 num2 = Funs.DB.Comprehensive_InspectionMachine.Where(x => x.IsOnSite == true && x.NextTestDate < DateTime.Now).Count();
|
|
|
|
|
//result = num1 + num2;
|
|
|
|
|
result = num2;
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
int result = 0;
|
|
|
|
|
//过期提醒记录数
|
|
|
|
|
var num2 = Funs.DB.Comprehensive_InspectionMachine.Where(x => x.IsOnSite == true && x.NextTestDate < DateTime.Now
|
|
|
|
|
&& pids.Contains(x.ProjectId)).Count();
|
|
|
|
|
//result = num1 + num2;
|
|
|
|
|
result = num2;
|
|
|
|
|
return result;
|
|
|
|
|
}
|
2023-08-24 10:00:59 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取质量培训人次数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
2024-10-28 15:19:46 +08:00
|
|
|
|
public int GetTrainPersonNum()
|
2023-08-24 10:00:59 +08:00
|
|
|
|
{
|
2024-09-11 10:36:09 +08:00
|
|
|
|
if (pids == null)
|
|
|
|
|
{
|
|
|
|
|
int result = (from x in Funs.DB.Comprehensive_InspectionPerson
|
|
|
|
|
where x.IsTrain == true
|
|
|
|
|
select x).Count();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
int result = (from x in Funs.DB.Comprehensive_InspectionPerson
|
|
|
|
|
where x.IsTrain == true && pids.Contains(x.ProjectId)
|
|
|
|
|
select x).Count();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
2023-08-24 10:00:59 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取技术交底人次数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
2024-10-28 15:19:46 +08:00
|
|
|
|
public int GetTechnicalDisclosePersonNum()
|
2023-08-24 10:00:59 +08:00
|
|
|
|
{
|
2024-09-11 10:36:09 +08:00
|
|
|
|
if (pids == null)
|
|
|
|
|
{
|
|
|
|
|
var result = (from x in Funs.DB.Comprehensive_DesignDetails
|
|
|
|
|
select x.JoinPersonNum ?? 0).ToList().Sum();
|
|
|
|
|
var q = Funs.GetNewIntOrZero(result.ToString());
|
|
|
|
|
return q;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
var result = (from x in Funs.DB.Comprehensive_DesignDetails
|
2024-10-28 15:19:46 +08:00
|
|
|
|
where pids.Contains(x.ProjectId)
|
2024-09-11 10:36:09 +08:00
|
|
|
|
select x.JoinPersonNum ?? 0).ToList().Sum();
|
|
|
|
|
var q = Funs.GetNewIntOrZero(result.ToString());
|
|
|
|
|
return q;
|
|
|
|
|
}
|
2023-08-24 10:00:59 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 资质预警
|
|
|
|
|
/// </summary>
|
|
|
|
|
private void getEarlyWarningCounts()
|
|
|
|
|
{
|
2024-09-11 10:36:09 +08:00
|
|
|
|
if (pids == null)
|
|
|
|
|
{
|
|
|
|
|
int allCount = 0;
|
|
|
|
|
var getPersonQualitys = from x in Funs.DB.Comprehensive_InspectionPerson
|
|
|
|
|
where x.ValidityDate.HasValue && x.ValidityDate < DateTime.Now && x.IsOnSite == true
|
|
|
|
|
select x;
|
|
|
|
|
//// 预警人数
|
|
|
|
|
allCount = getPersonQualitys.Count();
|
|
|
|
|
this.spanQualityChartAnalysis.InnerHtml = allCount.ToString();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
int allCount = 0;
|
|
|
|
|
var getPersonQualitys = from x in Funs.DB.Comprehensive_InspectionPerson
|
|
|
|
|
where x.ValidityDate.HasValue && x.ValidityDate < DateTime.Now && x.IsOnSite == true && pids.Contains(x.ProjectId)
|
|
|
|
|
select x;
|
|
|
|
|
//// 预警人数
|
|
|
|
|
allCount = getPersonQualitys.Count();
|
|
|
|
|
this.spanQualityChartAnalysis.InnerHtml = allCount.ToString();
|
|
|
|
|
}
|
2023-08-24 10:00:59 +08:00
|
|
|
|
}
|
|
|
|
|
|
2023-11-02 15:34:51 +08:00
|
|
|
|
#region 质量验收数据
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 共检总数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
2024-10-28 15:19:46 +08:00
|
|
|
|
public int getAllInspectionManagement()
|
2023-11-02 15:34:51 +08:00
|
|
|
|
{
|
2024-09-11 10:36:09 +08:00
|
|
|
|
if (pids == null)
|
|
|
|
|
{
|
|
|
|
|
int result = 0;
|
|
|
|
|
//统计所给时间段的全部数量
|
|
|
|
|
//List<Model.View_CQMS_InspectionManagementDetail> managementListSunNumber =
|
|
|
|
|
// BLL.InspectionManagementService.getInspectionManagementDetailListByCNProfessionalIdAndDate(
|
|
|
|
|
// null, null, DateTime.Parse("2001-01-01"), DateTime.Now, false);
|
|
|
|
|
var num1 = (from x in Funs.DB.ProcessControl_InspectionManagement
|
|
|
|
|
select x).Count();
|
|
|
|
|
result = num1;
|
|
|
|
|
//int result = (from x in Funs.DB.Check_CheckControl
|
|
|
|
|
// where x.CheckDate <= DateTime.Now && x.State == "7"
|
|
|
|
|
// select x).Count();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
int result = 0;
|
|
|
|
|
var num1 = (from x in Funs.DB.ProcessControl_InspectionManagement
|
2024-10-28 15:19:46 +08:00
|
|
|
|
where pids.Contains(x.ProjectId)
|
2024-09-11 10:36:09 +08:00
|
|
|
|
select x).Count();
|
|
|
|
|
result = num1;
|
2024-10-28 15:19:46 +08:00
|
|
|
|
|
2024-09-11 10:36:09 +08:00
|
|
|
|
return result;
|
|
|
|
|
}
|
2023-11-02 15:34:51 +08:00
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 次合格数量
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
2024-10-28 15:19:46 +08:00
|
|
|
|
public int getIsOnceInspectionManagement()
|
2023-11-02 15:34:51 +08:00
|
|
|
|
{
|
2024-09-11 10:36:09 +08:00
|
|
|
|
if (pids == null)
|
|
|
|
|
{
|
|
|
|
|
int result = 0;
|
|
|
|
|
//统计所给时间段的合格数量
|
|
|
|
|
//List<Model.View_CQMS_InspectionManagementDetail> managementListOneNumber =
|
|
|
|
|
// BLL.InspectionManagementService.getInspectionManagementDetailListByCNProfessionalIdAndDate(
|
|
|
|
|
// null, null, DateTime.Parse("2001-01-01"), DateTime.Now, true);
|
|
|
|
|
var num2 = (from x in Funs.DB.ProcessControl_InspectionManagement
|
|
|
|
|
where x.IsOnceQualified == true
|
|
|
|
|
select x).Count();
|
|
|
|
|
result = num2;
|
|
|
|
|
|
|
|
|
|
//int result = (from x in Funs.DB.Check_CheckControl
|
|
|
|
|
// where x.CheckDate <= DateTime.Now && x.State != "7"
|
|
|
|
|
// select x).Count();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
int result = 0;
|
2024-10-28 15:19:46 +08:00
|
|
|
|
|
2024-09-11 10:36:09 +08:00
|
|
|
|
var num2 = (from x in Funs.DB.ProcessControl_InspectionManagement
|
|
|
|
|
where x.IsOnceQualified == true && pids.Contains(x.ProjectId)
|
|
|
|
|
select x).Count();
|
|
|
|
|
result = num2;
|
|
|
|
|
|
2024-10-28 15:19:46 +08:00
|
|
|
|
|
2024-09-11 10:36:09 +08:00
|
|
|
|
return result;
|
|
|
|
|
}
|
2023-11-02 15:34:51 +08:00
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 整改率
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
2024-10-28 15:19:46 +08:00
|
|
|
|
public string GetInspectionManagementZgl()
|
2023-11-02 15:34:51 +08:00
|
|
|
|
{
|
|
|
|
|
string zgl = String.Format("{0:N2}", 100.0 * getIsOnceInspectionManagement() / getAllInspectionManagement());
|
|
|
|
|
return zgl + "%";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
2023-08-24 10:00:59 +08:00
|
|
|
|
#region 质量问题治理数据
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取整改完成数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
2024-10-28 15:19:46 +08:00
|
|
|
|
public int GetProblemCompletedNum()
|
2023-08-24 10:00:59 +08:00
|
|
|
|
{
|
2024-09-11 10:36:09 +08:00
|
|
|
|
if (pids == null)
|
|
|
|
|
{
|
|
|
|
|
int result = (from x in Funs.DB.Check_CheckControl
|
|
|
|
|
where x.CheckDate <= DateTime.Now && x.State == "7"
|
|
|
|
|
select x).Count();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
int result = (from x in Funs.DB.Check_CheckControl
|
|
|
|
|
where x.CheckDate <= DateTime.Now && x.State == "7" && pids.Contains(x.ProjectId)
|
|
|
|
|
select x).Count();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
2023-08-24 10:00:59 +08:00
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取未整改数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
2024-10-28 15:19:46 +08:00
|
|
|
|
public int GetProblemNotCompletedNum()
|
2023-08-24 10:00:59 +08:00
|
|
|
|
{
|
2024-09-11 10:36:09 +08:00
|
|
|
|
if (pids == null)
|
|
|
|
|
{
|
|
|
|
|
int result = (from x in Funs.DB.Check_CheckControl
|
|
|
|
|
where x.CheckDate <= DateTime.Now && x.State != "7"
|
|
|
|
|
select x).Count();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
int result = (from x in Funs.DB.Check_CheckControl
|
|
|
|
|
where x.CheckDate <= DateTime.Now && x.State != "7" && pids.Contains(x.ProjectId)
|
|
|
|
|
select x).Count();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
2023-08-24 10:00:59 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 整改率
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
2024-10-28 15:19:46 +08:00
|
|
|
|
public string GetProblemZgl()
|
2023-08-24 10:00:59 +08:00
|
|
|
|
{
|
|
|
|
|
string zgl = String.Format("{0:N2}", 100.0 * GetProblemCompletedNum() / (GetProblemCompletedNum() + GetProblemNotCompletedNum()));
|
|
|
|
|
return zgl + "%";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 质量问题治理数据
|
|
|
|
|
/// </summary>
|
|
|
|
|
protected string ProblemNum;
|
|
|
|
|
protected void getProblemNums()
|
|
|
|
|
{
|
|
|
|
|
var num1 = GetProblemNum();
|
|
|
|
|
var num2 = GetProblemCompletedNum();
|
|
|
|
|
var num3 = GetProblemNotCompletedNum();
|
|
|
|
|
ProblemNum = "'" + num1 + "'," +
|
|
|
|
|
"'" + num2 + "'," +
|
|
|
|
|
"'" + num3 + "'," +
|
|
|
|
|
"'" + String.Format("{0:N2}", 100.0 * num2 / (num2 + num3)) + "'";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// 获取问题个数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
2024-10-28 15:19:46 +08:00
|
|
|
|
public int GetProblemNum()
|
2023-08-24 10:00:59 +08:00
|
|
|
|
{
|
2024-09-11 10:36:09 +08:00
|
|
|
|
if (pids == null)
|
|
|
|
|
{
|
|
|
|
|
int result = (from x in Funs.DB.Check_CheckControl
|
|
|
|
|
where x.CheckDate <= DateTime.Now
|
|
|
|
|
select x).Count();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
int result = (from x in Funs.DB.Check_CheckControl
|
|
|
|
|
where x.CheckDate <= DateTime.Now && pids.Contains(x.ProjectId)
|
|
|
|
|
select x).Count();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
2023-08-24 10:00:59 +08:00
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取焊工总数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
2024-10-28 15:19:46 +08:00
|
|
|
|
public int GetWelderNum()
|
2023-08-24 10:00:59 +08:00
|
|
|
|
{
|
2024-09-11 10:36:09 +08:00
|
|
|
|
if (pids == null)
|
|
|
|
|
{
|
|
|
|
|
int result = (from x in Funs.DB.BS_Welder
|
|
|
|
|
where x.WED_IfOnGuard == true
|
|
|
|
|
select x).Count();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
int result = (from x in Funs.DB.BS_Welder
|
|
|
|
|
where x.WED_IfOnGuard == true && pids.Contains(x.ProjectId)
|
|
|
|
|
select x).Count();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
2023-08-24 10:00:59 +08:00
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取总达因数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
2024-10-28 15:19:46 +08:00
|
|
|
|
public int GetTotalDineNum()
|
2023-08-24 10:00:59 +08:00
|
|
|
|
{
|
2024-09-11 10:36:09 +08:00
|
|
|
|
if (pids == null)
|
2023-08-24 10:00:59 +08:00
|
|
|
|
{
|
2024-09-11 10:36:09 +08:00
|
|
|
|
int result = 0;
|
|
|
|
|
var getD1 = from x in Funs.DB.HJGL_FL_TotalQuantity
|
|
|
|
|
select x;
|
|
|
|
|
if (getD1.Count() > 0)
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in getD1)
|
|
|
|
|
{
|
|
|
|
|
result += Funs.GetNewIntOrZero(item.TotalWeldQuantity.Split('.')[0]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
2023-08-24 10:00:59 +08:00
|
|
|
|
{
|
2024-09-11 10:36:09 +08:00
|
|
|
|
var getD2 = (from x in Funs.DB.HJGL_FL_Data
|
|
|
|
|
orderby x.CompileDate descending
|
|
|
|
|
select x).FirstOrDefault();
|
|
|
|
|
if (getD2 != null)
|
|
|
|
|
{
|
|
|
|
|
result = Funs.GetNewIntOrZero(getD2.TotalWeldQuantity.Split('.')[0]);
|
|
|
|
|
}
|
2023-08-24 10:00:59 +08:00
|
|
|
|
}
|
2024-09-11 10:36:09 +08:00
|
|
|
|
return result;
|
2023-08-24 10:00:59 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2024-09-11 10:36:09 +08:00
|
|
|
|
int result = 0;
|
|
|
|
|
var getD1 = from x in Funs.DB.HJGL_FL_TotalQuantity
|
|
|
|
|
where pids.Contains(x.ProjectId)
|
|
|
|
|
select x;
|
|
|
|
|
if (getD1.Count() > 0)
|
2023-08-24 10:00:59 +08:00
|
|
|
|
{
|
2024-09-11 10:36:09 +08:00
|
|
|
|
foreach (var item in getD1)
|
|
|
|
|
{
|
|
|
|
|
result += Funs.GetNewIntOrZero(item.TotalWeldQuantity.Split('.')[0]);
|
|
|
|
|
}
|
2023-08-24 10:00:59 +08:00
|
|
|
|
}
|
2024-09-11 10:36:09 +08:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
var getD2 = (from x in Funs.DB.HJGL_FL_Data
|
|
|
|
|
where pids.Contains(x.ProjectId)
|
|
|
|
|
orderby x.CompileDate descending
|
|
|
|
|
select x).FirstOrDefault();
|
|
|
|
|
if (getD2 != null)
|
|
|
|
|
{
|
|
|
|
|
result = Funs.GetNewIntOrZero(getD2.TotalWeldQuantity.Split('.')[0]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return result;
|
2023-08-24 10:00:59 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取完成达因数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
2024-10-28 15:19:46 +08:00
|
|
|
|
public int GetCompleteDineNum()
|
2023-08-24 10:00:59 +08:00
|
|
|
|
{
|
2024-09-11 10:36:09 +08:00
|
|
|
|
if (pids == null)
|
|
|
|
|
{
|
|
|
|
|
int result = 0;
|
2023-08-24 10:00:59 +08:00
|
|
|
|
|
2024-09-11 10:36:09 +08:00
|
|
|
|
var getD1 = from x in Funs.DB.HJGL_FL_TotalQuantity
|
2023-08-24 10:00:59 +08:00
|
|
|
|
|
2024-09-11 10:36:09 +08:00
|
|
|
|
select x;
|
|
|
|
|
if (getD1.Count() > 0)
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in getD1)
|
|
|
|
|
{
|
|
|
|
|
result += Funs.GetNewIntOrZero(item.TotalCompleted.Split('.')[0]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
2023-08-24 10:00:59 +08:00
|
|
|
|
{
|
2024-09-11 10:36:09 +08:00
|
|
|
|
var getD2 = (from x in Funs.DB.HJGL_FL_Data
|
|
|
|
|
orderby x.CompileDate descending
|
|
|
|
|
select x).FirstOrDefault();
|
|
|
|
|
if (getD2 != null)
|
|
|
|
|
{
|
|
|
|
|
result = Funs.GetNewIntOrZero(getD2.TotalCompleted.Split('.')[0]);
|
|
|
|
|
}
|
|
|
|
|
|
2023-08-24 10:00:59 +08:00
|
|
|
|
}
|
2024-09-11 10:36:09 +08:00
|
|
|
|
return result;
|
2023-08-24 10:00:59 +08:00
|
|
|
|
}
|
2024-09-11 10:36:09 +08:00
|
|
|
|
else {
|
|
|
|
|
int result = 0;
|
|
|
|
|
|
|
|
|
|
var getD1 = from x in Funs.DB.HJGL_FL_TotalQuantity
|
|
|
|
|
where pids.Contains(x.ProjectId)
|
|
|
|
|
select x;
|
|
|
|
|
if (getD1.Count() > 0)
|
2023-08-24 10:00:59 +08:00
|
|
|
|
{
|
2024-09-11 10:36:09 +08:00
|
|
|
|
foreach (var item in getD1)
|
|
|
|
|
{
|
|
|
|
|
result += Funs.GetNewIntOrZero(item.TotalCompleted.Split('.')[0]);
|
|
|
|
|
}
|
2023-08-24 10:00:59 +08:00
|
|
|
|
}
|
2024-09-11 10:36:09 +08:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
var getD2 = (from x in Funs.DB.HJGL_FL_Data
|
|
|
|
|
where pids.Contains(x.ProjectId)
|
|
|
|
|
orderby x.CompileDate descending
|
|
|
|
|
select x).FirstOrDefault();
|
|
|
|
|
if (getD2 != null)
|
|
|
|
|
{
|
|
|
|
|
result = Funs.GetNewIntOrZero(getD2.TotalCompleted.Split('.')[0]);
|
|
|
|
|
}
|
2023-08-24 10:00:59 +08:00
|
|
|
|
|
2024-09-11 10:36:09 +08:00
|
|
|
|
}
|
|
|
|
|
return result;
|
2023-08-24 10:00:59 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取总片数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
2024-09-11 10:36:09 +08:00
|
|
|
|
public int GetTotalFilmNum()
|
2023-08-24 10:00:59 +08:00
|
|
|
|
{
|
2024-09-11 10:36:09 +08:00
|
|
|
|
if (pids == null)
|
2023-10-31 18:03:55 +08:00
|
|
|
|
{
|
2024-09-11 10:36:09 +08:00
|
|
|
|
//int result = Convert.ToInt32((from x in Funs.DB.CH_CheckItem
|
|
|
|
|
// join y in Funs.DB.CH_Check on x.CHT_CheckID equals y.CHT_CheckID
|
|
|
|
|
// select x.CHT_TotalFilm).ToList().Sum());
|
|
|
|
|
int result = 0;
|
|
|
|
|
|
|
|
|
|
var getD2 = (from x in Funs.DB.HJGL_FL_Data
|
|
|
|
|
orderby x.CompileDate descending
|
|
|
|
|
select x).FirstOrDefault();
|
|
|
|
|
if (getD2 != null)
|
|
|
|
|
{
|
|
|
|
|
result = Funs.GetNewIntOrZero(getD2.OneTimeFilmAmount.Split('.')[0]);
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
int result = 0;
|
|
|
|
|
|
|
|
|
|
var getD2 = (from x in Funs.DB.HJGL_FL_Data
|
|
|
|
|
where pids.Contains(x.ProjectId)
|
|
|
|
|
orderby x.CompileDate descending
|
|
|
|
|
select x).FirstOrDefault();
|
|
|
|
|
if (getD2 != null)
|
|
|
|
|
{
|
|
|
|
|
result = Funs.GetNewIntOrZero(getD2.OneTimeFilmAmount.Split('.')[0]);
|
|
|
|
|
}
|
|
|
|
|
return result;
|
2023-10-31 18:03:55 +08:00
|
|
|
|
}
|
2023-08-24 10:00:59 +08:00
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取合格片数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
2024-10-28 15:19:46 +08:00
|
|
|
|
public int GetOKFilmNum()
|
2023-08-24 10:00:59 +08:00
|
|
|
|
{
|
2024-09-11 10:36:09 +08:00
|
|
|
|
if (pids == null)
|
|
|
|
|
{
|
|
|
|
|
int result = 0;
|
|
|
|
|
var getD2 = (from x in Funs.DB.HJGL_FL_Data
|
|
|
|
|
orderby x.CompileDate descending
|
|
|
|
|
select x).FirstOrDefault();
|
|
|
|
|
if (getD2 != null)
|
|
|
|
|
{
|
|
|
|
|
result = Funs.GetNewIntOrZero(getD2.OneTimeFilmQualifiedAmount.Split('.')[0]);
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
else
|
2023-10-31 18:03:55 +08:00
|
|
|
|
{
|
2024-09-11 10:36:09 +08:00
|
|
|
|
int result = 0;
|
|
|
|
|
var getD2 = (from x in Funs.DB.HJGL_FL_Data
|
|
|
|
|
where pids.Contains(x.ProjectId)
|
|
|
|
|
orderby x.CompileDate descending
|
|
|
|
|
select x).FirstOrDefault();
|
|
|
|
|
if (getD2 != null)
|
|
|
|
|
{
|
|
|
|
|
result = Funs.GetNewIntOrZero(getD2.OneTimeFilmQualifiedAmount.Split('.')[0]);
|
|
|
|
|
}
|
|
|
|
|
return result;
|
2023-10-31 18:03:55 +08:00
|
|
|
|
}
|
2023-08-24 10:00:59 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 一次拍片合格率
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
2024-10-28 15:19:46 +08:00
|
|
|
|
public string GetOKFilmHgl()
|
2023-08-24 10:00:59 +08:00
|
|
|
|
{
|
|
|
|
|
string zgl = "0";
|
2024-04-19 15:48:37 +08:00
|
|
|
|
if (GetOKFilmNum() > 0)
|
2023-08-24 10:00:59 +08:00
|
|
|
|
{
|
|
|
|
|
zgl = String.Format("{0:N2}", 100.0 * GetOKFilmNum() / GetTotalFilmNum());
|
|
|
|
|
}
|
|
|
|
|
return zgl + "%";
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#region 质量验收数据
|
|
|
|
|
//专业
|
|
|
|
|
protected string InspectionManagementZy;
|
|
|
|
|
//总计
|
|
|
|
|
protected string InspectionManagementSumCount;
|
|
|
|
|
//合格
|
|
|
|
|
protected string InspectionManagementOkCount;
|
|
|
|
|
//一次验收合格率
|
|
|
|
|
protected string InspectionManagementOneOkCount;
|
2024-04-19 15:48:37 +08:00
|
|
|
|
private void getInspectionManagementInfo()
|
|
|
|
|
{
|
|
|
|
|
|
2024-10-28 15:19:46 +08:00
|
|
|
|
if (this.CurrUser.UserId == BLL.Const.hfnbdId)
|
2023-08-24 10:00:59 +08:00
|
|
|
|
{
|
2024-10-28 15:19:46 +08:00
|
|
|
|
//var q=(from x in Funs.DB.Base_CNProfessional where x.CNProfessionalId != BLL.Const.CNProfessionalConstructId && x.CNProfessionalId != BLL.Const.CNProfessionalHSEId orderby x.SortIndex select x).ToList();
|
|
|
|
|
var q = (from x in Funs.DB.Control_PointCropping where x.ParentId == null || x.ParentId == "" orderby x.OperateTime select x).ToList();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var item in q)
|
2024-09-11 10:36:09 +08:00
|
|
|
|
{
|
2024-10-28 15:19:46 +08:00
|
|
|
|
//获取专业
|
|
|
|
|
InspectionManagementZy += "'" + item.DetectionItems + "',";
|
|
|
|
|
//根据专业获取总计
|
|
|
|
|
//var num1 = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
|
|
|
|
// join y in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals y.InspectionId
|
|
|
|
|
// where y.CNProfessionalId == item.CNProfessionalId
|
|
|
|
|
// select x).ToList().Count;
|
|
|
|
|
var num1 = 0;
|
|
|
|
|
var num2 = 0;
|
|
|
|
|
if (pids == null)
|
|
|
|
|
{
|
|
|
|
|
num1 = (from x in Funs.DB.ProcessControl_InspectionManagement
|
|
|
|
|
where x.CNProfessionalId == item.ControlId
|
|
|
|
|
select x).Count();
|
|
|
|
|
num2 = (from x in Funs.DB.ProcessControl_InspectionManagement
|
2024-10-21 16:29:59 +08:00
|
|
|
|
where x.CNProfessionalId == item.ControlId && x.IsOnceQualified == true
|
2024-09-11 10:36:09 +08:00
|
|
|
|
select x).Count();
|
2024-10-28 15:19:46 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
num1 = (from x in Funs.DB.ProcessControl_InspectionManagement
|
|
|
|
|
where x.CNProfessionalId == item.ControlId && pids.Contains(x.ProjectId)
|
|
|
|
|
select x).Count();
|
|
|
|
|
num2 = (from x in Funs.DB.ProcessControl_InspectionManagement
|
|
|
|
|
where x.CNProfessionalId == item.ControlId && x.IsOnceQualified == true && pids.Contains(x.ProjectId)
|
|
|
|
|
select x).Count();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
InspectionManagementSumCount += "'" + num1 + "',";
|
|
|
|
|
|
|
|
|
|
//根据专业获取合格数
|
|
|
|
|
//var num2 = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
|
|
|
|
// join y in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals y.InspectionId
|
|
|
|
|
// where y.CNProfessionalId == item.CNProfessionalId && y.IsOnceQualified==true
|
|
|
|
|
// select x).ToList().Count;
|
|
|
|
|
|
|
|
|
|
InspectionManagementOkCount += "'" + num2 + "',";
|
|
|
|
|
|
|
|
|
|
//一次验收合格率
|
|
|
|
|
var hgl = "0";
|
|
|
|
|
if (num1 > 0)
|
|
|
|
|
{
|
|
|
|
|
hgl += String.Format("{0:N2}", 100.0 * num2 / num1);
|
|
|
|
|
}
|
|
|
|
|
InspectionManagementOneOkCount += "'" + hgl + "',";
|
2024-09-11 10:36:09 +08:00
|
|
|
|
}
|
2024-10-28 15:19:46 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
var q = (from x in Funs.DB.Base_CNProfessional where x.CNProfessionalId != BLL.Const.CNProfessionalConstructId && x.CNProfessionalId != BLL.Const.CNProfessionalHSEId orderby x.SortIndex select x).ToList();
|
2024-09-11 10:36:09 +08:00
|
|
|
|
|
2024-10-28 15:19:46 +08:00
|
|
|
|
foreach (var item in q)
|
2023-08-24 10:00:59 +08:00
|
|
|
|
{
|
2024-10-28 15:19:46 +08:00
|
|
|
|
//获取专业
|
|
|
|
|
InspectionManagementZy += "'" + item.ProfessionalName + "',";
|
|
|
|
|
//根据专业获取总计
|
|
|
|
|
//var num1 = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
|
|
|
|
// join y in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals y.InspectionId
|
|
|
|
|
// where y.CNProfessionalId == item.CNProfessionalId
|
|
|
|
|
// select x).ToList().Count;
|
|
|
|
|
var num1 = 0;
|
|
|
|
|
var num2 = 0;
|
|
|
|
|
if (pids == null)
|
|
|
|
|
{
|
|
|
|
|
num1 = (from x in Funs.DB.ProcessControl_InspectionManagement
|
|
|
|
|
where x.CNProfessionalId == item.CNProfessionalId
|
|
|
|
|
select x).Count();
|
|
|
|
|
num2 = (from x in Funs.DB.ProcessControl_InspectionManagement
|
|
|
|
|
where x.CNProfessionalId == item.CNProfessionalId && x.IsOnceQualified == true
|
|
|
|
|
select x).Count();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
num1 = (from x in Funs.DB.ProcessControl_InspectionManagement
|
|
|
|
|
where x.CNProfessionalId == item.CNProfessionalId && pids.Contains(x.ProjectId)
|
|
|
|
|
select x).Count();
|
|
|
|
|
num2 = (from x in Funs.DB.ProcessControl_InspectionManagement
|
|
|
|
|
where x.CNProfessionalId == item.CNProfessionalId && x.IsOnceQualified == true && pids.Contains(x.ProjectId)
|
|
|
|
|
select x).Count();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
InspectionManagementSumCount += "'" + num1 + "',";
|
|
|
|
|
|
|
|
|
|
//根据专业获取合格数
|
|
|
|
|
//var num2 = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
|
|
|
|
// join y in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals y.InspectionId
|
|
|
|
|
// where y.CNProfessionalId == item.CNProfessionalId && y.IsOnceQualified==true
|
|
|
|
|
// select x).ToList().Count;
|
|
|
|
|
|
|
|
|
|
InspectionManagementOkCount += "'" + num2 + "',";
|
|
|
|
|
|
|
|
|
|
//一次验收合格率
|
|
|
|
|
var hgl = "0";
|
|
|
|
|
if (num1 > 0)
|
|
|
|
|
{
|
|
|
|
|
hgl += String.Format("{0:N2}", 100.0 * num2 / num1);
|
|
|
|
|
}
|
|
|
|
|
InspectionManagementOneOkCount += "'" + hgl + "',";
|
2023-08-24 10:00:59 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
InspectionManagementZy = InspectionManagementZy.TrimEnd(',');
|
|
|
|
|
InspectionManagementSumCount = InspectionManagementSumCount.TrimEnd(',');
|
|
|
|
|
InspectionManagementOkCount = InspectionManagementOkCount.TrimEnd(',');
|
|
|
|
|
InspectionManagementOneOkCount = InspectionManagementOneOkCount.TrimEnd(',');
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region NCR数据
|
|
|
|
|
//整改闭环项
|
|
|
|
|
protected string ncrZgbhx;
|
|
|
|
|
//未整改完成项
|
|
|
|
|
protected string ncrwZgbhx;
|
|
|
|
|
//整改率
|
2024-04-19 15:48:37 +08:00
|
|
|
|
protected string ncrZgl = "0%";
|
2023-08-24 10:00:59 +08:00
|
|
|
|
|
|
|
|
|
//图表数据
|
|
|
|
|
//专业
|
|
|
|
|
protected string ncrZy;
|
|
|
|
|
protected string ncrCount;
|
|
|
|
|
private void getNcrInfo()
|
|
|
|
|
{
|
2024-09-11 10:36:09 +08:00
|
|
|
|
if (pids==null)
|
2023-08-24 10:00:59 +08:00
|
|
|
|
{
|
2024-09-11 10:36:09 +08:00
|
|
|
|
//闭环项 有完成日期的
|
|
|
|
|
//var num1 = Funs.DB.Comprehensive_NCRManagement.Where(x => x.CompleteDate != null).Count();
|
|
|
|
|
//var num2 = Funs.DB.Comprehensive_NCRManagement.Where(x => x.CompleteDate == null).Count();
|
|
|
|
|
var num1 = Funs.DB.Comprehensive_NCRManagement.Where(x => x.ImplementationFrontState == "已闭合").Count();
|
|
|
|
|
var num2 = Funs.DB.Comprehensive_NCRManagement.Where(x => x.ImplementationFrontState == "整改中").Count();
|
|
|
|
|
ncrZgbhx = num1.ToString();
|
|
|
|
|
ncrwZgbhx = num2.ToString();
|
|
|
|
|
if ((num1 + num2) > 0)
|
|
|
|
|
{
|
|
|
|
|
ncrZgl = String.Format("{0:N2}", 100.0 * num1 / (num1 + num2)) + "%";
|
|
|
|
|
}
|
2023-08-24 10:00:59 +08:00
|
|
|
|
|
2024-09-11 10:36:09 +08:00
|
|
|
|
//加载专业
|
|
|
|
|
var list = (from x in Funs.DB.Base_CNProfessional where x.CNProfessionalId != BLL.Const.CNProfessionalConstructId && x.CNProfessionalId != BLL.Const.CNProfessionalHSEId orderby x.SortIndex select x).ToList();
|
|
|
|
|
foreach (var item in list)
|
|
|
|
|
{
|
|
|
|
|
ncrZy += "'" + item.ProfessionalName + "',";
|
|
|
|
|
//根据专业加载数据量
|
|
|
|
|
var num3 = Funs.DB.Comprehensive_NCRManagement.Where(x => x.CNProfessionalId == item.CNProfessionalId).Count();
|
|
|
|
|
ncrCount += "'" + num3 + "',";
|
|
|
|
|
}
|
|
|
|
|
ncrZy = ncrZy.TrimEnd(',');
|
|
|
|
|
ncrCount = ncrCount.TrimEnd(',');
|
|
|
|
|
}
|
|
|
|
|
else
|
2023-08-24 10:00:59 +08:00
|
|
|
|
{
|
2024-09-11 10:36:09 +08:00
|
|
|
|
var num1 = Funs.DB.Comprehensive_NCRManagement.Where(x => x.ImplementationFrontState == "已闭合" && pids.Contains(x.ProjectId)).Count();
|
|
|
|
|
var num2 = Funs.DB.Comprehensive_NCRManagement.Where(x => x.ImplementationFrontState == "整改中" && pids.Contains(x.ProjectId)).Count();
|
|
|
|
|
ncrZgbhx = num1.ToString();
|
|
|
|
|
ncrwZgbhx = num2.ToString();
|
|
|
|
|
if ((num1 + num2) > 0)
|
|
|
|
|
{
|
|
|
|
|
ncrZgl = String.Format("{0:N2}", 100.0 * num1 / (num1 + num2)) + "%";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//加载专业
|
|
|
|
|
var list = (from x in Funs.DB.Base_CNProfessional where x.CNProfessionalId != BLL.Const.CNProfessionalConstructId && x.CNProfessionalId != BLL.Const.CNProfessionalHSEId orderby x.SortIndex select x).ToList();
|
|
|
|
|
foreach (var item in list)
|
|
|
|
|
{
|
|
|
|
|
ncrZy += "'" + item.ProfessionalName + "',";
|
|
|
|
|
//根据专业加载数据量
|
|
|
|
|
var num3 = Funs.DB.Comprehensive_NCRManagement.Where(x => x.CNProfessionalId == item.CNProfessionalId && pids.Contains(x.ProjectId)).Count();
|
|
|
|
|
ncrCount += "'" + num3 + "',";
|
|
|
|
|
}
|
|
|
|
|
ncrZy = ncrZy.TrimEnd(',');
|
|
|
|
|
ncrCount = ncrCount.TrimEnd(',');
|
2023-08-24 10:00:59 +08:00
|
|
|
|
}
|
2024-09-11 10:36:09 +08:00
|
|
|
|
|
2023-08-24 10:00:59 +08:00
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
2023-11-21 15:44:14 +08:00
|
|
|
|
private string GetFileType(string fileName)
|
|
|
|
|
{
|
|
|
|
|
string fileType = String.Empty;
|
|
|
|
|
int lastDotIndex = fileName.LastIndexOf(".");
|
|
|
|
|
if (lastDotIndex >= 0)
|
|
|
|
|
{
|
|
|
|
|
fileType = fileName.Substring(lastDotIndex + 1).ToLower();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return fileType;
|
|
|
|
|
}
|
2023-08-24 10:00:59 +08:00
|
|
|
|
|
2023-11-21 15:44:14 +08:00
|
|
|
|
protected void drpProject_SelectedIndexChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
var project = ProjectService.GetProjectByProjectId(this.drpProject.SelectedValue);
|
|
|
|
|
var allowExtensions = new List<string>
|
|
|
|
|
{
|
2023-08-24 10:00:59 +08:00
|
|
|
|
|
2023-11-21 15:44:14 +08:00
|
|
|
|
"jpg", "jpeg", "png", "bmp", "gif", // 图片文件类型
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
var getImag = Funs.DB.AttachFile.FirstOrDefault(x => x.ToKeyId == project.ProjectId);
|
|
|
|
|
if (getImag != null && !string.IsNullOrEmpty(getImag.AttachUrl))
|
|
|
|
|
{
|
|
|
|
|
string url = getImag.AttachUrl.Replace('\\', '/');
|
|
|
|
|
var UrlList = Funs.GetStrListByStr(url, ',');
|
|
|
|
|
bool isHiddDefaultImg = false;
|
|
|
|
|
foreach (var item in UrlList)
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrEmpty(item))
|
|
|
|
|
{
|
|
|
|
|
string atturl = Funs.RootPath + item.Replace(';', ' ').Trim();
|
|
|
|
|
string fileType = GetFileType(atturl);
|
|
|
|
|
|
|
|
|
|
if (File.Exists(atturl) && allowExtensions.Contains(fileType))
|
|
|
|
|
{
|
|
|
|
|
isHiddDefaultImg = true;
|
|
|
|
|
divProjectImg += string.Format(" <div class=\"swiper-slide\"><img src=\"{0}\"></div>",
|
2024-04-19 15:48:37 +08:00
|
|
|
|
atturl.Replace(Funs.RootPath, "/"));
|
2023-11-21 15:44:14 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
divProjectImg =
|
|
|
|
|
divProjectImg.Replace("<div class=\"swiper-slide\"><img src=\"./imags/16.png\"></div>", "");
|
|
|
|
|
}
|
|
|
|
|
if (string.IsNullOrEmpty(divProjectImg))
|
|
|
|
|
{
|
|
|
|
|
divProjectImg = "<div class=\"swiper-slide\"><img src=\"./imags/16.png\"></div>";
|
|
|
|
|
}
|
|
|
|
|
string jsCode = "var swiperWrapper = document.getElementById('swiper-wrapper');";
|
|
|
|
|
jsCode += "swiperWrapper.innerHTML = '" + divProjectImg + "';";
|
2024-04-19 15:48:37 +08:00
|
|
|
|
string script2 = " createSwiper();";
|
|
|
|
|
PageContext.RegisterStartupScript(jsCode);
|
|
|
|
|
PageContext.RegisterStartupScript(script2);
|
|
|
|
|
|
2023-11-21 15:44:14 +08:00
|
|
|
|
}
|
2025-03-19 15:02:56 +08:00
|
|
|
|
|
|
|
|
|
protected string Number_of_questions = string.Empty;
|
|
|
|
|
protected string Number_of_corrections_completed = string.Empty;
|
|
|
|
|
protected string Uncorrected_number = string.Empty;
|
|
|
|
|
protected string RectificationRate = string.Empty;
|
|
|
|
|
protected string total = string.Empty;
|
|
|
|
|
protected string Up_to_standard = string.Empty;
|
|
|
|
|
protected string construction_quality_pass_rate = string.Empty;
|
|
|
|
|
protected void getCNEN()
|
|
|
|
|
{
|
|
|
|
|
Number_of_questions = Resources.Lan.Number_of_questions;
|
|
|
|
|
Number_of_corrections_completed = Resources.Lan.Number_of_corrections_completed;
|
|
|
|
|
Uncorrected_number = Resources.Lan.Uncorrected_number;
|
|
|
|
|
RectificationRate = Resources.Lan.RectificationRate;
|
|
|
|
|
total = Resources.Lan.total;
|
|
|
|
|
Up_to_standard = Resources.Lan.Up_to_standard;
|
|
|
|
|
construction_quality_pass_rate = Resources.Lan.construction_quality_pass_rate;
|
|
|
|
|
}
|
2023-08-24 10:00:59 +08:00
|
|
|
|
}
|
|
|
|
|
}
|