2023-10-8

This commit is contained in:
2023-10-08 15:32:21 +08:00
parent f4173186a0
commit 2343cca1fa
7 changed files with 149 additions and 88 deletions
@@ -59,6 +59,7 @@ namespace FineUIPro.Web.CQMS.ManageReport
{
if (!IsPostBack)
{
this.EnableViewState = true;
this.lblProjectName.Text = BLL.ProjectService.GetProjectByProjectId(this.CurrUser.LoginProjectId).ProjectName;
this.ReportId = Request.Params["reportId"];
if (!string.IsNullOrEmpty(Request.Params["view"]))
@@ -87,15 +88,18 @@ namespace FineUIPro.Web.CQMS.ManageReport
//this.txtPeriod.ReadOnly = true;
//this.txtStartDate.Enabled = false;
//this.txtEndDate.Enabled = false;
GetThisWeekOrMonthContentList(this.ReportId);//本主要工作内容
GetThisWeekOrMonthContentList(this.ReportId);//本主要工作内容
GetRowMaterialProblemList(this.ReportId);//原材料问题
GetConstructionProblemsList(this.ReportId);//施工过程问题
GetNextQualityControlList(this.ReportId);//下质量控制重点
GetNextQualityControlList(this.ReportId);//下质量控制重点
}
else
{
this.txtStartDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now.AddDays(-6));
this.txtEndDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
this.txtStartDate.Text = string.IsNullOrEmpty(Request.Params["startdate"]) ? string.Format("{0:yyyy-MM-dd}", DateTime.Now.AddDays(-6)) : Request.Params["startdate"];
this.txtEndDate.Text = string.IsNullOrEmpty(Request.Params["enddate"]) ? string.Format("{0:yyyy-MM-dd}", DateTime.Now ): Request.Params["enddate"];
//this.txtStartDate.Text = string.Format("{0:yyyy-MM-dd}", "2022-11-02 01:01:00");
//this.txtEndDate.Text = string.Format("{0:yyyy-MM-dd}", "2023-10-18 01:01:00");
}
CheckLotBindStatisc("CV");//检验批统计:土建
CheckLotBindStatisc("EQ");//检验批统计:设备
@@ -110,7 +114,6 @@ namespace FineUIPro.Web.CQMS.ManageReport
DesignChangeOrderBindStatisc();//设计变更统计
PassWelderBindStatisc();//合格焊工统计
ConstructionStatisticsr();//施工方案统计
}
}
@@ -119,23 +122,29 @@ namespace FineUIPro.Web.CQMS.ManageReport
/// </summary>
private void GetComprehensive()
{
int count = 0;
decimal? count = 0;
var inspectionEquipments = (from x in Funs.DB.Comprehensive_InspectionEquipment where x.ProjectId == this.CurrUser.LoginProjectId && x.CNProfessionalId == BLL.Const.EQCNProfessionalId && x.EquipmentOrMatail == "设备" select x).ToList();
foreach (var item in inspectionEquipments)
{
count += Funs.GetNewIntOrZero(item.Counts);
}
//this.txt1.Text = Convert.ToString(count);
this.txt3.Text = Convert.ToString(count);
int thisWeekCount = 0;
decimal? thisWeekCount = 0;
var equpments = (from x in Funs.DB.Comprehensive_InspectionEquipment where x.ProjectId == this.CurrUser.LoginProjectId && x.CNProfessionalId == BLL.Const.EQCNProfessionalId && x.EquipmentOrMatail == "设备" && x.InspectionDate >= Convert.ToDateTime(this.txtStartDate.Text) && x.InspectionDate <= Convert.ToDateTime(this.txtEndDate.Text) select x).ToList();
foreach (var item in equpments)
{
thisWeekCount += Funs.GetNewIntOrZero(item.Counts);
}
this.txt2.Text = Convert.ToString(thisWeekCount);
//if (Convert.ToDecimal(this.txt3.Text.Trim()) > 0)
//{
// this.txt4.Text = Math.Round((double)(Convert.ToDecimal(this.txt2.Text.Trim()) / Convert.ToDecimal(this.txt3.Text.Trim())) * 100, 2) + "%";
//}
//else
//{
// this.txt4.Text = "0";
//}
var Uequipments = (from x in Funs.DB.Comprehensive_InspectionEquipment
where x.ProjectId == this.CurrUser.LoginProjectId
&& x.EquipmentOrMatail == "材料"
@@ -209,7 +218,7 @@ namespace FineUIPro.Web.CQMS.ManageReport
}
/// <summary>
/// 本主要工作内容
/// 本主要工作内容
/// </summary>
private void GetThisWeekOrMonthContentList(string reportId)
{
@@ -244,7 +253,7 @@ namespace FineUIPro.Web.CQMS.ManageReport
}
/// <summary>
/// 下质量控制重点
/// 下质量控制重点
/// </summary>
/// <param name="p"></param>
private void GetNextQualityControlList(string reportId)
@@ -256,9 +265,9 @@ namespace FineUIPro.Web.CQMS.ManageReport
}
#endregion
#region
#region
/// <summary>
/// 增加本主要内容
/// 增加本主要内容
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
@@ -275,7 +284,7 @@ namespace FineUIPro.Web.CQMS.ManageReport
}
/// <summary>
/// 检查并保存本主要内容集合
/// 检查并保存本主要内容集合
/// </summary>
private void saveThisWeekAndMonthContent()
{
@@ -292,7 +301,7 @@ namespace FineUIPro.Web.CQMS.ManageReport
}
/// <summary>
/// 本主要内容行点击事件
/// 本主要内容行点击事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
@@ -385,6 +394,7 @@ namespace FineUIPro.Web.CQMS.ManageReport
this.gvRowMaterialProblem.DataBind();
}
}
#endregion
#region
@@ -480,10 +490,11 @@ namespace FineUIPro.Web.CQMS.ManageReport
#endregion
#region
#region GridView
/// <summary>
/// 绑定数据
/// 绑定
/// </summary>
/// <param name="cNProfessionalCode"></param>
/// <param name="cNProfessionalId"></param>
public void CheckLotBindStatisc(string cNProfessionalCode)
{
DateTime startDate = Convert.ToDateTime(this.txtStartDate.Text.Trim());
@@ -514,7 +525,7 @@ namespace FineUIPro.Web.CQMS.ManageReport
Model.WBS_DivisionProject divisionProject = BLL.DivisionProjectService.GetDivisionProjectById(breakdownProject.DivisionProjectId);
if (divisionProject != null)
{
Model.WBS_UnitWork ins = BLL.UnitWorkService.getUnitWorkByUnitWorkId(divisionProject.UnitWorkId);
Model.WBS_UnitWork ins = BLL.UnitWorkService.GetUnitWorkByUnitWorkId(divisionProject.UnitWorkId);
if (ins != null)
{
if (!workNames.Contains(ins.UnitWorkName)) //新增记录
@@ -542,9 +553,9 @@ namespace FineUIPro.Web.CQMS.ManageReport
}
}
}
/*if (cNProfessionalId == BLL.Const.CNProfessionalCVId) //土建按单位工程统计
{
}
else
{
@@ -631,6 +642,34 @@ namespace FineUIPro.Web.CQMS.ManageReport
}
StatisticsList.Add(StatisticsLast);
}
else //新增本周/月无验收数据的也需要列出表格
{
Model.CheckStatisc StatisticsLast = new Model.CheckStatisc();
StatisticsLast.Num = StatisticsList.Count() + 1;
StatisticsLast.WorkName = "合计";
StatisticsLast.CheckNum = 0;
StatisticsLast.TotalCheckNum = 0;
StatisticsLast.OKNum = 0;
StatisticsLast.TotalOKNum = 0;
if (StatisticsLast.CheckNum != 0)//被除数不能为零
{
StatisticsLast.OneOKRate = Math.Round((double)StatisticsLast.OKNum / (double)StatisticsLast.CheckNum * 100, 2) + "%";//保留两位小数、后四舍五入
}
else
{
StatisticsLast.OneOKRate = "0%";
}
if (StatisticsLast.TotalCheckNum != 0)//被除数不能为零
{
StatisticsLast.TotalOneOKRate = Math.Round((double)StatisticsLast.TotalOKNum / (double)StatisticsLast.TotalCheckNum * 100, 2) + "%";//保留两位小数、后四舍五入
}
else
{
StatisticsLast.TotalOneOKRate = "0%";
}
StatisticsList.Add(StatisticsLast);
}
if (cNProfessionalCode == "CV")
{
@@ -668,6 +707,7 @@ namespace FineUIPro.Web.CQMS.ManageReport
this.gvXF.DataBind();
}
}
#endregion
/// <summary>
/// GridView创建行时激发
@@ -808,7 +848,7 @@ namespace FineUIPro.Web.CQMS.ManageReport
{
if (e.Row.RowType == DataControlRowType.Header)
{
string headerStr = "序号#分包商#探伤部位#RT数量 本,累计#一次合格 本,累计#一次合格率 本,累计";
string headerStr = "序号#分包商#探伤部位#RT数量 本,累计#一次合格 本,累计#一次合格率 本,累计";
DynamicTHeaderHepler dHelper = new DynamicTHeaderHepler();
dHelper.SplitTableHeader(e.Row, headerStr);
}
@@ -833,7 +873,7 @@ namespace FineUIPro.Web.CQMS.ManageReport
{
projectStartDate = project.StartDate.Value;
}
//当期集合
//所有集合
List<Model.Comprehensive_NCRManagement> totalManagementList = BLL.NCRManagementService.GetNCRManagementListByDate(this.CurrUser.LoginProjectId, startDate, endDate);
List<string> unitNames = (from x in totalManagementList select x.ReceiveUnit).Distinct().ToList();
foreach (var item in unitNames)
@@ -894,7 +934,7 @@ namespace FineUIPro.Web.CQMS.ManageReport
{
if (e.Row.RowType == DataControlRowType.Header)
{
string headerStr = "序号#接收单位#本已完成#累计已完成#NCR总数#累计完成比例";
string headerStr = "序号#接收单位#本已完成#累计已完成#NCR总数#累计完成比例";
DynamicTHeaderHepler dHelper = new DynamicTHeaderHepler();
dHelper.SplitTableHeader(e.Row, headerStr);
}
@@ -975,7 +1015,7 @@ namespace FineUIPro.Web.CQMS.ManageReport
{
if (e.Row.RowType == DataControlRowType.Header)
{
string headerStr = "序号#专业#发布数量 本,累计#业主批准数量 本,累计#完成情况 本,累计";
string headerStr = "序号#专业#发布数量 本,累计#业主批准数量 本,累计#完成情况 本,累计";
DynamicTHeaderHepler dHelper = new DynamicTHeaderHepler();
dHelper.SplitTableHeader(e.Row, headerStr);
}
@@ -1008,7 +1048,6 @@ namespace FineUIPro.Web.CQMS.ManageReport
where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitType == BLL.Const.ProjectUnitType_2
orderby y.UnitCode
select new { x.UnitId, y.UnitName };
var db = Funs.DB;
foreach (var item in units)
{
@@ -1091,7 +1130,7 @@ namespace FineUIPro.Web.CQMS.ManageReport
{
if (e.Row.RowType == DataControlRowType.Header)
{
string headerStr = "序号#分包商#管道焊工 本上岗,累计#钢结构焊工 本上岗,累计#设备焊工 本上岗,累计#其他 本上岗,累计";
string headerStr = "序号#分包商#管道焊工 本上岗,累计#钢结构焊工 本上岗,累计#设备焊工 本上岗,累计#其他 本上岗,累计";
DynamicTHeaderHepler dHelper = new DynamicTHeaderHepler();
dHelper.SplitTableHeader(e.Row, headerStr);
}
@@ -1162,9 +1201,9 @@ namespace FineUIPro.Web.CQMS.ManageReport
#endregion
#region
#region
/// <summary>
/// 增加下质量控制重点
/// 增加下质量控制重点
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
@@ -1233,20 +1272,26 @@ namespace FineUIPro.Web.CQMS.ManageReport
{
if (!string.IsNullOrEmpty(this.txtStartDate.Text.Trim()))
{
CheckLotBindStatisc("CV");//检验批统计:土建
CheckLotBindStatisc("EQ");//检验批统计:设备
CheckLotBindStatisc("PP");//检验批统计:管道
CheckLotBindStatisc("EL");//检验批统计:电气
CheckLotBindStatisc("IN");//检验批统计:仪表
CheckLotBindStatisc("FF");//检验批统计:反腐
CheckLotBindStatisc("XF");//检验批统计:消防
GetComprehensive();//综合管理
BindStatisc();//无损检测统计
NCRBindStatisc();//NCR统计
DesignChangeOrderBindStatisc();//设计变更统计
PassWelderBindStatisc();//合格焊工统计
ConstructionStatisticsr();//施工方案统计
//CheckLotBindStatisc("CV");//检验批统计:土建
//CheckLotBindStatisc("EQ");//检验批统计:设备
//CheckLotBindStatisc("PP");//检验批统计:管道
//CheckLotBindStatisc("EL");//检验批统计:电气
//CheckLotBindStatisc("IN");//检验批统计:仪表
//CheckLotBindStatisc("FF");//检验批统计:反腐
//CheckLotBindStatisc("XF");//检验批统计:消防
//GetComprehensive();//综合管理
//BindStatisc();//无损检测统计
//NCRBindStatisc();//NCR统计
//DesignChangeOrderBindStatisc();//设计变更统计
//PassWelderBindStatisc();//合格焊工统计
//ConstructionStatisticsr();//施工方案统计
//Response.AddHeader("Refresh", "0");
string url = Request.Url.ToString();
if (url.Contains("?"))
{
url = Request.Url.ToString().Substring(0, Request.Url.ToString().LastIndexOf('?'));
}
Response.Redirect(url + "?startdate=" + txtStartDate.Text + "&enddate=" + txtEndDate.Text);
}
}
#endregion
@@ -1272,7 +1317,6 @@ namespace FineUIPro.Web.CQMS.ManageReport
ScriptManager.RegisterStartupScript(this, typeof(string), "_alert", "alert('周期输入格式不正确,请重新输入!')", true);
return;
}
}
if (!string.IsNullOrEmpty(this.txtStartDate.Text))
{
@@ -1282,7 +1326,7 @@ namespace FineUIPro.Web.CQMS.ManageReport
{
report.EndDate = Convert.ToDateTime(this.txtEndDate.Text);
}
report.ReportType = "1";
report.ReportType = "2";
BLL.ThisWeekOrMonthContentService.DeleteThisWeekOrMonthContentByReportId(this.ReportId);
BLL.RowMaterialProblemService.DeleteRowMaterialProbleByReportId(this.ReportId);
@@ -1300,7 +1344,7 @@ namespace FineUIPro.Web.CQMS.ManageReport
report.ReportId = this.ReportId;
BLL.WeekAndMonthReportService.AddWeekAndMonthReport(report);
}
//本主要工作内容
//本主要工作内容
saveThisWeekAndMonthContent();
foreach (var item in thisWeekOrMonthContentLists)
{
@@ -1336,7 +1380,7 @@ namespace FineUIPro.Web.CQMS.ManageReport
comprehensive.Others = this.txt9.Text.Trim();
BLL.ComprehensiveService.AddComprehensive(comprehensive);
//下质量控制重点
//下质量控制重点
saveNextQualityControl();
foreach (var item in nextQualityControlLists)
{
@@ -1369,5 +1413,7 @@ namespace FineUIPro.Web.CQMS.ManageReport
}
#endregion
}
}