From abf543267699f1a59e6290b16e0476c46aa450c2 Mon Sep 17 00:00:00 2001 From: fly-l <1420031550@qq.com> Date: Thu, 2 Nov 2023 15:34:51 +0800 Subject: [PATCH] 2023-11-02 --- .vs/SGGL_CWCEC/v17/.wsuo | Bin 32256 -> 32256 bytes .../InspectionManagementService.cs | 7 +- .../InspectionManagementStatisc.aspx | 125 ++++++++ .../InspectionManagementStatisc.aspx.cs | 222 ++++++++++++++ ...spectionManagementStatisc.aspx.designer.cs | 197 ++++++++++++ .../InspectionManagementStatiscItem.aspx | 65 ++++ .../InspectionManagementStatiscItem.aspx.cs | 289 ++++++++++++++++++ ...tionManagementStatiscItem.aspx.designer.cs | 116 +++++++ SGGL/FineUIPro.Web/FineUIPro.Web.csproj | 16 + SGGL/FineUIPro.Web/common/main_new1.aspx | 19 +- SGGL/FineUIPro.Web/common/main_new1.aspx.cs | 53 +++- 11 files changed, 1100 insertions(+), 9 deletions(-) create mode 100644 SGGL/FineUIPro.Web/DataShowLocal/InspectionManagementStatisc.aspx create mode 100644 SGGL/FineUIPro.Web/DataShowLocal/InspectionManagementStatisc.aspx.cs create mode 100644 SGGL/FineUIPro.Web/DataShowLocal/InspectionManagementStatisc.aspx.designer.cs create mode 100644 SGGL/FineUIPro.Web/DataShowLocal/InspectionManagementStatiscItem.aspx create mode 100644 SGGL/FineUIPro.Web/DataShowLocal/InspectionManagementStatiscItem.aspx.cs create mode 100644 SGGL/FineUIPro.Web/DataShowLocal/InspectionManagementStatiscItem.aspx.designer.cs diff --git a/.vs/SGGL_CWCEC/v17/.wsuo b/.vs/SGGL_CWCEC/v17/.wsuo index aadabc24bf73dc4edaf5093e9c267f0b8cbea900..53e01de7ebd9658d5af1853911236fc2f6c0000a 100644 GIT binary patch delta 1064 zcmb_by>HV%6!&wIrlbiiX+lW92oNO^#g*MSuH8r_l+q3esZt6;LO@-|K}85uWDiw9 z&dAq7Zec^}#MtH#L#F-#8DK-qjIiOMQbl-|q*cUFI$-PfzV5xd-+O0Q_o2EE+mHCr z=bwq>&CoZ9avZlyHu(x9h|4?hir5|po)XuSUJv0~0O3PK5Glm(R;$&I8dd95SNC-_ zi=9DxyvL8DJ=o*3oO6Hq1LTW$csz~K4B}#UbrSU@gn-Cl#^~Es?~sDd3_?ZZ5%jzF z1%$TW|Dzdy8bY{5%n4%+qrj+p5sdmUg0*)*owdlG<4`}3b!;r1ijF*@5&o!7`WJvE z17D#Q$h39+q{YK3v476%0Q}-+YvUGgTQRpCO;z2;11b| zjz-qHp;Av8c^4gn$G9A$&1eST9&t}Qpb^}#2|&kMzsSrOlgWXNUH)OA6gkyJs}bxlxn lT1n7k!<^2QBz1aCe;#CwBG^NBHU@$2J}f}*1zC*~e*lTvY=8g& delta 1009 zcmb_a&ubGw6yCQ@+L)$Mh!C=#-B8h3Tq?;&hMQVkDq!dJuYPQ)}{8_8J2T|C? zgCKgaI~Q+4bMYcd=ay5hLOgou-;kpV3dQZ4W>*sN*TI2r-h1D?8Q%9X#x5AU@Zkce}fMm>)*4YS4+! zk)3erSPvg}@`D(YJ^XM_p2B<_ak9&m-1qEkPm@cYMlOe#LgWzzgorqU*j$Rzj>mwJ zoc!+3Du>b@rV=mcM=&x)9)zn%z?>;(ikR|$QFH=(*^tbwpA@;X|4LB8{;MM2S)ii7 z4V%?~>7R7d?V!rTb)p^8VU=3A6EzA}9EKRe6@jT>C?UZjvx{_u zC!``oqq0NRoX8q(u!h&+IBTHo@Fc(rv5x8>5iO#FLaoRmz&trOIvXflUakPP&!1ne zke8#Pd1=m!%?*AmC!bkfdLh@lS;%o545 z#JxJZF!WnnS`Fi3I>YlE$39p}o)+_Uu~^ScNrhrYRFrx~p3W(mT1l#xib}4wT9D}7 rwa-AF-kfQ)HUNNJjg6DVW5K|ExprG#t3S-v*6%f1xB47bn+Ns){N9BE diff --git a/SGGL/BLL/CQMS/ProcessControl/InspectionManagementService.cs b/SGGL/BLL/CQMS/ProcessControl/InspectionManagementService.cs index a1445686..26bc8dd3 100644 --- a/SGGL/BLL/CQMS/ProcessControl/InspectionManagementService.cs +++ b/SGGL/BLL/CQMS/ProcessControl/InspectionManagementService.cs @@ -329,7 +329,12 @@ namespace BLL } public static List getInspectionManagementDetailListByCNProfessionalIdAndDate(string projectId, string cNProfessionalId, DateTime startDate, DateTime SoptDate, bool isOnceQualified) { - List InspectionMangementList = (from x in Funs.DB.View_CQMS_InspectionManagementDetail where x.ProjectId == projectId select x).ToList(); + List InspectionMangementList = (from x in Funs.DB.View_CQMS_InspectionManagementDetail select x).ToList(); + + if (!string.IsNullOrEmpty(projectId)) + { + InspectionMangementList = (from x in InspectionMangementList where x.ProjectId == projectId select x).ToList(); + } if (!string.IsNullOrEmpty(cNProfessionalId) && cNProfessionalId != "0") { InspectionMangementList = (from x in InspectionMangementList where x.CNProfessionalId == cNProfessionalId select x).ToList(); diff --git a/SGGL/FineUIPro.Web/DataShowLocal/InspectionManagementStatisc.aspx b/SGGL/FineUIPro.Web/DataShowLocal/InspectionManagementStatisc.aspx new file mode 100644 index 00000000..2dbc0a8f --- /dev/null +++ b/SGGL/FineUIPro.Web/DataShowLocal/InspectionManagementStatisc.aspx @@ -0,0 +1,125 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="InspectionManagementStatisc.aspx.cs" Inherits="FineUIPro.Web.DataShowLocal.InspectionManagementStatisc" %> + + + + + + + + 计量器具 + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/DataShowLocal/InspectionManagementStatisc.aspx.cs b/SGGL/FineUIPro.Web/DataShowLocal/InspectionManagementStatisc.aspx.cs new file mode 100644 index 00000000..e91e35ab --- /dev/null +++ b/SGGL/FineUIPro.Web/DataShowLocal/InspectionManagementStatisc.aspx.cs @@ -0,0 +1,222 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Data.SqlClient; +using System.Data; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.DataShowLocal +{ + public partial class InspectionManagementStatisc : PageBase + { + + #region 加载页面 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + Funs.DropDownPageSize(this.ddlPageSize); + ddlPageSize.SelectedValue = Grid1.PageSize.ToString(); + BLL.ProjectService.InitProjectDropDownList(this.drpProject, true); + // 绑定表格t + BindGrid(); + this.Panel1.Title = "质量验收数据(" + BLL.UnitService.GetUnitNameByUnitId(BLL.Const.UnitId_CWCEC) + ")"; + } + } + + + /// + /// 绑定数据 + /// + private void BindGrid() + { + string strSql = @"select ProjectId,ProjectCode, ProjectName from Base_Project where ProjectState =1"; + List listStr = new List(); + string cpara = string.Empty; + if (this.drpProject.SelectedValue != Const._Null) + { + strSql += " AND projectId = @projectId"; ///状态为已完成 + listStr.Add(new SqlParameter("@projectId", this.drpProject.SelectedValue)); + } + + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); + Grid1.RecordCount = tb.Rows.Count; + var table = this.GetPagedDataTable(Grid1, tb); + Grid1.DataSource = table; + Grid1.DataBind(); + } + #endregion + + #region 查询 + /// + /// 查询 + /// + /// + /// + protected void TextBox_TextChanged(object sender, EventArgs e) + { + this.BindGrid(); + } + #endregion + + #region 表排序、分页、关闭窗口 + /// + /// 分页 + /// + /// + /// + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + BindGrid(); + } + + /// + /// 排序 + /// + /// + /// + protected void Grid1_Sort(object sender, GridSortEventArgs e) + { + BindGrid(); + } + + /// + /// 分页显示条数下拉框 + /// + /// + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); + BindGrid(); + } + + /// + /// 关闭弹出窗 + /// + /// + /// + protected void Window1_Close(object sender, WindowCloseEventArgs e) + { + BindGrid(); + } + #endregion + + #region Grid双击事件 编辑 + /// + /// Grid行双击事件 + /// + /// + /// + protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) + { + EditData(); + } + + + /// + /// + /// + private void EditData() + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; + } + + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("InspectionManagementStatiscItem.aspx?projectId={0}", Grid1.SelectedRowID, "查看 - "))); + } + #endregion + + + protected void btnView_Click(object sender, EventArgs e) + { + EditData(); + } + + + /// + /// 共检总数 + /// + /// + /// + protected int Count1(object projectId) + { + int cout1 = 0; + if (projectId != null) + { + var datetime1 = Funs.GetNewDateTime(this.txtStartTime.Text); + var datetime2 = Funs.GetNewDateTime(this.txtStartTime.Text); + var getD1 = from x in Funs.DB.View_CQMS_InspectionManagementDetail where x.ProjectId == projectId.ToString() select x; + + if (datetime1.HasValue) + { + getD1 = getD1.Where(x => x.InspectionDate >= datetime1); + } + if (datetime2.HasValue) + { + getD1 = getD1.Where(x => x.InspectionDate <= datetime2); + } + cout1 = getD1.Count(); + } + return cout1; + } + + /// + /// 一次合格数 + /// + /// + /// + protected int Count2(object projectId) + { + int cout1 = 0; + if (projectId != null) + { + var datetime1 = Funs.GetNewDateTime(this.txtStartTime.Text); + var datetime2 = Funs.GetNewDateTime(this.txtStartTime.Text); + var getD1 = from x in Funs.DB.View_CQMS_InspectionManagementDetail + where x.ProjectId == projectId.ToString() && x.IsOnceQualified==true + select x; + + if (datetime1.HasValue) + { + getD1 = getD1.Where(x => x.InspectionDate >= datetime1); + } + if (datetime2.HasValue) + { + getD1 = getD1.Where(x => x.InspectionDate <= datetime2); + } + cout1 = getD1.Count(); + } + return cout1; + } + + protected string Count3(object projectId) + { + string result = ""; + if (projectId != null) + { + if (Count1(projectId) != 0)//被除数不能为零 + { + result = Math.Round((double)Count2(projectId) / (double)Count1(projectId) * 100, 2) + "%";//保留两位小数、后四舍五入 + } + else + { + result = "0%"; + } + + } + return result; + } + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/DataShowLocal/InspectionManagementStatisc.aspx.designer.cs b/SGGL/FineUIPro.Web/DataShowLocal/InspectionManagementStatisc.aspx.designer.cs new file mode 100644 index 00000000..fe953ac3 --- /dev/null +++ b/SGGL/FineUIPro.Web/DataShowLocal/InspectionManagementStatisc.aspx.designer.cs @@ -0,0 +1,197 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.DataShowLocal +{ + + + public partial class InspectionManagementStatisc + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// drpProject 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpProject; + + /// + /// txtStartTime 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtStartTime; + + /// + /// Label3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label Label3; + + /// + /// txtEndTime 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtEndTime; + + /// + /// btnClose 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnClose; + + /// + /// labNumber 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label labNumber; + + /// + /// Label2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label Label2; + + /// + /// Label4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label Label4; + + /// + /// Label5 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label Label5; + + /// + /// ToolbarSeparator1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnView 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnView; + } +} diff --git a/SGGL/FineUIPro.Web/DataShowLocal/InspectionManagementStatiscItem.aspx b/SGGL/FineUIPro.Web/DataShowLocal/InspectionManagementStatiscItem.aspx new file mode 100644 index 00000000..b94881d5 --- /dev/null +++ b/SGGL/FineUIPro.Web/DataShowLocal/InspectionManagementStatiscItem.aspx @@ -0,0 +1,65 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="InspectionManagementStatiscItem.aspx.cs" Inherits="FineUIPro.Web.DataShowLocal.InspectionManagementStatiscItem" %> + + + + + + + 控制点检查检测合格率统计 + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/DataShowLocal/InspectionManagementStatiscItem.aspx.cs b/SGGL/FineUIPro.Web/DataShowLocal/InspectionManagementStatiscItem.aspx.cs new file mode 100644 index 00000000..17415910 --- /dev/null +++ b/SGGL/FineUIPro.Web/DataShowLocal/InspectionManagementStatiscItem.aspx.cs @@ -0,0 +1,289 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.DataShowLocal +{ + public partial class InspectionManagementStatiscItem : PageBase + { + public DateTime StartDate; + public DateTime NextDate; + public DateTime NewDate; + public DateTime EndDate; + + public int SunNumber; + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + BLL.CNProfessionalService.InitCNProfessionalDownList(this.drpCNProfessional, true);//专业 + BindGvInspectionManagement(null); + } + } + #region 绑定GridView + /// + /// 绑定 + /// + /// + public void BindGvInspectionManagement(string cNProfessionalId) + { + if (string.IsNullOrEmpty(this.txtStartTime.Text.Trim()) && string.IsNullOrEmpty(this.txtEndTime.Text.Trim())) //未选择日期,统计项目开始起的每月数据 + { + List StatisticsList = new List(); + Model.Base_Project project = BLL.ProjectService.GetProjectByProjectId(Request.Params["projectId"]); + StartDate = Convert.ToDateTime(project.StartDate); + for (int i = 0; i < i + 1; i++) + { + Model.InspectionManagementStatistics Statistics = new Model.InspectionManagementStatistics(); + if (i == 0) + { + NextDate = Convert.ToDateTime(DateTime.Parse(StartDate.ToString("yyyy-MM-dd")).AddMonths(1).ToShortDateString()); + NewDate = Convert.ToDateTime(NextDate.Year + "-" + NextDate.Month + "-25"); + Statistics.CheckDate = string.Format("{0:yyyy-MM-dd}", StartDate) + " 至 "; + if (StartDate.Day < 25) + { + if (DateTime.Now < NewDate) + { + //统计所给时间段的全部数量 + List managementListSunNumber = BLL.InspectionManagementService.getInspectionManagementDetailListByCNProfessionalIdAndDate(Request.Params["projectId"], cNProfessionalId, StartDate, DateTime.Now, false); + //统计所给时间段的合格数量 + List managementListOneNumber = BLL.InspectionManagementService.getInspectionManagementDetailListByCNProfessionalIdAndDate(Request.Params["projectId"], cNProfessionalId, StartDate, DateTime.Now, true); + + Statistics.CheckDate += string.Format("{0:yyyy-MM-dd}", DateTime.Now); + Statistics.SunNumber = managementListSunNumber.Count(); + Statistics.OneStatisticsSunNumber = managementListOneNumber.Count(); + if (managementListSunNumber.Count() != 0)//被除数不能为零 + { + Statistics.OneStatistics = Math.Round((double)managementListOneNumber.Count() / (double)managementListSunNumber.Count() * 100, 2) + "%";//保留两位小数、后四舍五入 + } + else + { + Statistics.OneStatistics = "0%"; + } + StatisticsList.Add(Statistics); + break; + } + else + { + NextDate = Convert.ToDateTime(StartDate.Year + "-" + StartDate.Month + "-25"); + //统计所给事件段的全部数量 + List managementListSunNumber = BLL.InspectionManagementService.getInspectionManagementDetailListByCNProfessionalIdAndDate(Request.Params["projectId"], cNProfessionalId, StartDate, NextDate, false); + //统计所给事件段的合格数量 + List managementListOneNumber = BLL.InspectionManagementService.getInspectionManagementDetailListByCNProfessionalIdAndDate(Request.Params["projectId"], cNProfessionalId, StartDate, NextDate, true); + + Statistics.CheckDate += string.Format("{0:yyyy-MM-dd}", NextDate); + Statistics.SunNumber = managementListSunNumber.Count(); + Statistics.OneStatisticsSunNumber = managementListOneNumber.Count(); + if (managementListSunNumber.Count() != 0)//被除数不能为零 + { + Statistics.OneStatistics = Math.Round((double)managementListOneNumber.Count() / (double)managementListSunNumber.Count() * 100, 2) + "%";//保留两位小数、后四舍五入 + } + else + { + Statistics.OneStatistics = "0%"; + } + } + } + else + { + if (DateTime.Now < NewDate) + { + //统计所给事件段的全部数量 + List managementListSunNumber = BLL.InspectionManagementService.getInspectionManagementDetailListByCNProfessionalIdAndDate(Request.Params["projectId"], cNProfessionalId, StartDate, DateTime.Now, false); + //统计所给事件段的合格数量 + List managementListOneNumber = BLL.InspectionManagementService.getInspectionManagementDetailListByCNProfessionalIdAndDate(Request.Params["projectId"], cNProfessionalId, StartDate, DateTime.Now, true); + + Statistics.CheckDate += string.Format("{0:yyyy-MM-dd}", DateTime.Now); + Statistics.SunNumber = managementListSunNumber.Count(); + Statistics.OneStatisticsSunNumber = managementListOneNumber.Count(); + if (managementListSunNumber.Count() != 0)//被除数不能为零 + { + Statistics.OneStatistics = Math.Round((double)managementListOneNumber.Count() / (double)managementListSunNumber.Count() * 100, 2) + "%";//保留两位小数、后四舍五入 + } + else + { + Statistics.OneStatistics = "0%"; + } + + StatisticsList.Add(Statistics); + break; + } + else + { + //统计所给事件段的全部数量 + List managementListSunNumber = BLL.InspectionManagementService.getInspectionManagementDetailListByCNProfessionalIdAndDate(Request.Params["projectId"], cNProfessionalId, StartDate, NewDate, false); + //统计所给事件段的合格数量 + List managementListOneNumber = BLL.InspectionManagementService.getInspectionManagementDetailListByCNProfessionalIdAndDate(Request.Params["projectId"], cNProfessionalId, StartDate, NewDate, true); + Statistics.CheckDate += string.Format("{0:yyyy-MM-dd}", NewDate); + Statistics.SunNumber = managementListSunNumber.Count(); + Statistics.OneStatisticsSunNumber = managementListOneNumber.Count(); + if (managementListSunNumber.Count() != 0)//被除数不能为零 + { + Statistics.OneStatistics = Math.Round((double)managementListOneNumber.Count() / (double)managementListSunNumber.Count() * 100, 2) + "%";//保留两位小数、后四舍五入 + } + else + { + Statistics.OneStatistics = "0%"; + } + } + } + } + else + { + + if (StartDate.Day > 25) + { + Statistics.CheckDate = NewDate.Year + "-" + NewDate.Month + "-" + (NewDate.Day + 1) + " 至 "; + StartDate = Convert.ToDateTime(NewDate.Year + "-" + NewDate.Month + "-" + (NewDate.Day + 1));//获取上一记录的结束日期加一天为本次记录的开始日期 + } + else + { + Statistics.CheckDate = NextDate.Year + "-" + NextDate.Month + "-" + (NextDate.Day + 1) + " 至 "; + StartDate = Convert.ToDateTime(NextDate.Year + "-" + NextDate.Month + "-" + (NextDate.Day + 1));//获取上一记录的结束日期加一天为本次记录的开始日期 + } + + NextDate = Convert.ToDateTime(DateTime.Parse(NextDate.ToString("yyyy-MM-dd")).AddMonths(1).ToShortDateString()); + NewDate = Convert.ToDateTime(NextDate.Year + "-" + NextDate.Month + "-25"); + if (DateTime.Now < NewDate) + { + //统计所给事件段的全部数量 + List managementListSunNumber = BLL.InspectionManagementService.getInspectionManagementDetailListByCNProfessionalIdAndDate(Request.Params["projectId"], cNProfessionalId, StartDate, DateTime.Now, false); + //统计所给事件段的合格数量 + List managementListOneNumber = BLL.InspectionManagementService.getInspectionManagementDetailListByCNProfessionalIdAndDate(Request.Params["projectId"], cNProfessionalId, StartDate, DateTime.Now, true); + + Statistics.CheckDate += string.Format("{0:yyyy-MM-dd}", DateTime.Now); + Statistics.SunNumber = managementListSunNumber.Count(); + Statistics.OneStatisticsSunNumber = managementListOneNumber.Count(); + if (managementListSunNumber.Count() != 0)//被除数不能为零 + { + Statistics.OneStatistics = Math.Round((double)managementListOneNumber.Count() / (double)managementListSunNumber.Count() * 100, 2) + "%";//保留两位小数、后四舍五入 + } + else + { + Statistics.OneStatistics = "0%"; + } + + StatisticsList.Add(Statistics); + break; + } + else + { + //统计所给事件段的全部数量 + List managementListSunNumber = BLL.InspectionManagementService.getInspectionManagementDetailListByCNProfessionalIdAndDate(Request.Params["projectId"], cNProfessionalId, StartDate, NewDate, false); + //统计所给事件段的合格数量 + List managementListOneNumber = BLL.InspectionManagementService.getInspectionManagementDetailListByCNProfessionalIdAndDate(Request.Params["projectId"], cNProfessionalId, StartDate, NewDate, true); + Statistics.CheckDate += string.Format("{0:yyyy-MM-dd}", NewDate); + Statistics.SunNumber = managementListSunNumber.Count(); + Statistics.OneStatisticsSunNumber = managementListOneNumber.Count(); + if (managementListSunNumber.Count() != 0)//被除数不能为零 + { + Statistics.OneStatistics = Math.Round((double)managementListOneNumber.Count() / (double)managementListSunNumber.Count() * 100, 2) + "%";//保留两位小数、后四舍五入 + } + else + { + Statistics.OneStatistics = "0%"; + } + } + } + StatisticsList.Add(Statistics); + } + Model.InspectionManagementStatistics StatisticsLast = new Model.InspectionManagementStatistics(); + StatisticsLast.CheckDate = "合计"; + int sum1 = 0; + int sum2 = 0; + foreach (Model.InspectionManagementStatistics item in StatisticsList) + { + sum1 += item.OneStatisticsSunNumber; + sum2 += item.SunNumber; + + } + StatisticsLast.OneStatisticsSunNumber = sum1; + StatisticsLast.SunNumber = sum2; + if (sum2 != 0)//被除数不能为零 + { + StatisticsLast.OneStatistics = Math.Round((double)sum1 / (double)sum2 * 100, 2) + "%";//保留两位小数、后四舍五入 + } + else + { + StatisticsLast.OneStatistics = "0%"; + } + StatisticsList.Add(StatisticsLast); + this.Grid1.DataSource = StatisticsList; + this.Grid1.DataBind(); + } + else //选择日期,统计对应时间段内的数据 + { + List StatisticsList = new List(); + Model.Base_Project project = BLL.ProjectService.GetProjectByProjectId(Request.Params["projectId"]); + StartDate = Convert.ToDateTime(project.StartDate); + EndDate = DateTime.Now; + if (!string.IsNullOrEmpty(this.txtStartTime.Text.Trim())) + { + StartDate = Convert.ToDateTime(this.txtStartTime.Text.Trim()); + } + if (!string.IsNullOrEmpty(this.txtEndTime.Text.Trim())) + { + EndDate = Convert.ToDateTime(this.txtEndTime.Text.Trim()); + } + Model.InspectionManagementStatistics Statistics = new Model.InspectionManagementStatistics(); + //统计所给时间段的全部数量 + List managementListSunNumber = BLL.InspectionManagementService.getInspectionManagementDetailListByCNProfessionalIdAndDate(Request.Params["projectId"], cNProfessionalId, StartDate, EndDate, false); + //统计所给时间段的合格数量 + List managementListOneNumber = BLL.InspectionManagementService.getInspectionManagementDetailListByCNProfessionalIdAndDate(Request.Params["projectId"], cNProfessionalId, StartDate, EndDate, true); + Statistics.CheckDate = string.Format("{0:yyyy-MM-dd}", StartDate) + " 至 " + string.Format("{0:yyyy-MM-dd}", EndDate); + Statistics.SunNumber = managementListSunNumber.Count(); + Statistics.OneStatisticsSunNumber = managementListOneNumber.Count(); + if (managementListSunNumber.Count() != 0)//被除数不能为零 + { + Statistics.OneStatistics = Math.Round((double)managementListOneNumber.Count() / (double)managementListSunNumber.Count() * 100, 2) + "%";//保留两位小数、后四舍五入 + } + else + { + Statistics.OneStatistics = "0%"; + } + StatisticsList.Add(Statistics); + this.Grid1.DataSource = StatisticsList; + this.Grid1.DataBind(); + } + } + #endregion + + protected void btnSearch_Click(object sender, EventArgs e) + { + if (this.drpCNProfessional.SelectedValue != BLL.Const._Null) + { + BindGvInspectionManagement(this.drpCNProfessional.SelectedValue); + } + else + { + BindGvInspectionManagement(null); + } + } + + + protected void btnOut_Click(object sender, EventArgs e) + { + Response.ClearContent(); + string filename = Funs.GetNewFileName(); + Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("控制点检查检测合格率统计" + filename, System.Text.Encoding.UTF8) + ".xls"); + Response.ContentType = "application/excel"; + Response.ContentEncoding = Encoding.UTF8; + this.Grid1.PageSize = Grid1.RecordCount; + if (this.drpCNProfessional.SelectedValue != BLL.Const._Null) + { + BindGvInspectionManagement(this.drpCNProfessional.SelectedValue); + } + else + { + BindGvInspectionManagement(null); + } + Response.Write(GetGridTableHtml2(Grid1)); + Response.End(); + } + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/DataShowLocal/InspectionManagementStatiscItem.aspx.designer.cs b/SGGL/FineUIPro.Web/DataShowLocal/InspectionManagementStatiscItem.aspx.designer.cs new file mode 100644 index 00000000..5074e896 --- /dev/null +++ b/SGGL/FineUIPro.Web/DataShowLocal/InspectionManagementStatiscItem.aspx.designer.cs @@ -0,0 +1,116 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.DataShowLocal +{ + + + public partial class InspectionManagementStatiscItem + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// ToolSearch 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar ToolSearch; + + /// + /// drpCNProfessional 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpCNProfessional; + + /// + /// txtStartTime 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtStartTime; + + /// + /// txtEndTime 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtEndTime; + + /// + /// btnSearch 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSearch; + + /// + /// btnOut 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnOut; + + /// + /// lblPageIndex 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lblPageIndex; + } +} diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj index 2ace9e49..3d6c7419 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -562,6 +562,8 @@ + + @@ -8127,6 +8129,20 @@ WorkPackageSet2In.aspx + + InspectionManagementStatisc.aspx + ASPXCodeBehind + + + InspectionManagementStatisc.aspx + + + InspectionManagementStatiscItem.aspx + ASPXCodeBehind + + + InspectionManagementStatiscItem.aspx + NCRStatisc.aspx ASPXCodeBehind diff --git a/SGGL/FineUIPro.Web/common/main_new1.aspx b/SGGL/FineUIPro.Web/common/main_new1.aspx index c43a5cbc..24a2016d 100644 --- a/SGGL/FineUIPro.Web/common/main_new1.aspx +++ b/SGGL/FineUIPro.Web/common/main_new1.aspx @@ -105,21 +105,21 @@ -
+
质量验收数据
-
整改闭环项
-
<%=GetProblemCompletedNum() %>
+
共检总数
+
<%=getAllInspectionManagement() %>
-
未整改完成项
-
<%=GetProblemNotCompletedNum() %>
+
-次合格数量
+
<%=getIsOnceInspectionManagement() %>
-
整改率
-
<%=GetProblemZgl() %>
+
-次验收合格率
+
<%=GetInspectionManagementZgl() %>
@@ -544,6 +544,11 @@ // $('iframe').attr('src', '../InterfacePopup/CQMS/QualityProblem.aspx') //质量问题数据 window.open("../DataShow/QualityProblem.aspx") + } + else if (type == 'QualityInspection') { + // $('iframe').attr('src', '../InterfacePopup/CQMS/QualityProblem.aspx') //质量问题数据 + window.open("../DataShowLocal/InspectionManagementStatisc.aspx") + } else if (type == 'QualityControlPoint') { // $('iframe').attr('src', '../InterfacePopup/CQMS/QualityControlPoint.aspx') //质量控制点数据 diff --git a/SGGL/FineUIPro.Web/common/main_new1.aspx.cs b/SGGL/FineUIPro.Web/common/main_new1.aspx.cs index fcf542da..c21b0015 100644 --- a/SGGL/FineUIPro.Web/common/main_new1.aspx.cs +++ b/SGGL/FineUIPro.Web/common/main_new1.aspx.cs @@ -1,8 +1,10 @@ using BLL; +using FineUIPro.Web.BaseInfo; using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; +using System.Runtime.InteropServices.ComTypes; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; @@ -142,7 +144,7 @@ namespace FineUIPro.Web.common DateTime date = DateTime.Now.AddDays(-1); var result = (from x in Funs.DB.Comprehensive_DesignDetails where x.DetailsDate.Value.Year == date.Year && x.DetailsDate.Value.Month == date.Month && x.DetailsDate.Value.Day == date.Day - select x.JoinPersonNum).ToList().Sum(x => x.Value); + select x.JoinPersonNum??0).ToList().Sum(); var q = Funs.GetNewIntOrZero(result.ToString()); return q; } @@ -162,6 +164,55 @@ namespace FineUIPro.Web.common this.spanQualityChartAnalysis.InnerHtml = allCount.ToString(); } + #region 质量验收数据 + /// + /// 共检总数 + /// + /// + public static int getAllInspectionManagement() + { + int result = 0; + ; + //统计所给时间段的全部数量 + List managementListSunNumber = + BLL.InspectionManagementService.getInspectionManagementDetailListByCNProfessionalIdAndDate( + null, null, DateTime.Parse("2001-01-01"), DateTime.Now, false); + result = managementListSunNumber.Count; + //int result = (from x in Funs.DB.Check_CheckControl + // where x.CheckDate <= DateTime.Now && x.State == "7" + // select x).Count(); + return result; + } + /// + /// 次合格数量 + /// + /// + public static int getIsOnceInspectionManagement() + { + int result = 0; + //统计所给时间段的合格数量 + List managementListOneNumber = + BLL.InspectionManagementService.getInspectionManagementDetailListByCNProfessionalIdAndDate( + null, null, DateTime.Parse("2001-01-01"), DateTime.Now, true); + result = managementListOneNumber.Count; + + //int result = (from x in Funs.DB.Check_CheckControl + // where x.CheckDate <= DateTime.Now && x.State != "7" + // select x).Count(); + return result; + } + /// + /// 整改率 + /// + /// + public static string GetInspectionManagementZgl() + { + string zgl = String.Format("{0:N2}", 100.0 * getIsOnceInspectionManagement() / getAllInspectionManagement()); + return zgl + "%"; + } + + + #endregion #region 质量问题治理数据 ///