2024-03-18 09:04:53 +08:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Data;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Web.UI;
|
|
|
|
|
using System.Web.UI.WebControls;
|
|
|
|
|
using BLL;
|
|
|
|
|
using Newtonsoft.Json.Linq;
|
2024-03-18 10:42:10 +08:00
|
|
|
|
|
2024-03-18 09:04:53 +08:00
|
|
|
|
namespace FineUIPro.Web.CQMS.ManageReportNew
|
|
|
|
|
{
|
|
|
|
|
public partial class MonthReportEdit : PageBase
|
|
|
|
|
{
|
|
|
|
|
#region 定义项
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 主键
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string ReportId
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return (string)ViewState["ReportId"];
|
|
|
|
|
}
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
ViewState["ReportId"] = value;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public string AddOrUpdate
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return (string)ViewState["AddOrUpdate"];
|
|
|
|
|
}
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
ViewState["AddOrUpdate"] = value;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 列表集合
|
|
|
|
|
private static List<Model.Report_CqmsTarget> detailsGrid1 = new List<Model.Report_CqmsTarget>();
|
2024-03-22 16:38:14 +08:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 18.本月质量问题处理情况
|
|
|
|
|
/// (1)原材料问题
|
|
|
|
|
/// </summary>
|
|
|
|
|
private static List<Model.Report_RowMaterialProblem> rowMaterialProblemLists = new List<Model.Report_RowMaterialProblem>();
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 18.本月质量问题处理情况
|
|
|
|
|
/// (2)施工过程问题
|
|
|
|
|
/// </summary>
|
|
|
|
|
private static List<Model.Report_ConstructionProblems> constructionProblemsLists = new List<Model.Report_ConstructionProblems>();
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 19.下月质量控制重点
|
|
|
|
|
/// </summary>
|
|
|
|
|
private static List<Model.Report_NextQualityControl> nextQualityControlLists = new List<Model.Report_NextQualityControl>();
|
2024-03-18 09:04:53 +08:00
|
|
|
|
#endregion
|
2024-03-18 10:42:10 +08:00
|
|
|
|
|
2024-03-18 09:04:53 +08:00
|
|
|
|
#region 加载页面
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 加载页面
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (!IsPostBack)
|
|
|
|
|
{
|
2024-03-20 10:59:25 +08:00
|
|
|
|
BLL.UnitService.InitUnitDownListByText(this.drpUnitIdGrid9, this.CurrUser.LoginProjectId, true);
|
2024-03-18 09:04:53 +08:00
|
|
|
|
this.EnableViewState = true;
|
|
|
|
|
this.lblProjectName.Text = BLL.ProjectService.GetProjectByProjectId(this.CurrUser.LoginProjectId).ProjectName;
|
|
|
|
|
this.ReportId = Request.Params["reportId"];
|
|
|
|
|
if (!string.IsNullOrEmpty(Request.Params["view"]))
|
|
|
|
|
{
|
|
|
|
|
this.Button1.Visible = false;
|
|
|
|
|
this.Button2.Visible = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(this.ReportId))
|
|
|
|
|
{
|
|
|
|
|
Model.Report_WeekAndMonthReport_New weekAndMonthReport = WeekAndMonthReportNewService.Detail(this.ReportId);
|
|
|
|
|
if (weekAndMonthReport != null)
|
|
|
|
|
{
|
|
|
|
|
if (weekAndMonthReport.SortId != null)
|
|
|
|
|
{
|
|
|
|
|
this.txtPeriod.Text = Convert.ToString(weekAndMonthReport.SortId);
|
|
|
|
|
}
|
|
|
|
|
if (weekAndMonthReport.StartDate != null)
|
|
|
|
|
{
|
|
|
|
|
this.txtStartDate.Text = string.Format("{0:yyyy-MM-dd}", weekAndMonthReport.StartDate);
|
|
|
|
|
}
|
|
|
|
|
if (weekAndMonthReport.EndDate != null)
|
|
|
|
|
{
|
|
|
|
|
this.txtEndDate.Text = string.Format("{0:yyyy-MM-dd}", weekAndMonthReport.EndDate);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
AddOrUpdate = "update";
|
|
|
|
|
|
|
|
|
|
#region 加载本月质量目标管理情况
|
|
|
|
|
detailsGrid1.Clear();
|
|
|
|
|
detailsGrid1 = (from x in Funs.DB.Report_CqmsTarget
|
2024-03-20 10:59:25 +08:00
|
|
|
|
where x.ReportId == this.ReportId
|
|
|
|
|
orderby x.SortId
|
|
|
|
|
select x).ToList();
|
|
|
|
|
if (detailsGrid1.Count > 0)
|
2024-03-18 09:04:53 +08:00
|
|
|
|
{
|
|
|
|
|
Grid1.Hidden = false;
|
|
|
|
|
Grid1.DataSource = detailsGrid1;
|
|
|
|
|
Grid1.DataBind();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
2024-03-20 10:59:25 +08:00
|
|
|
|
#region 加载7.2 PQR/WPS报验情况
|
|
|
|
|
var detailsGrid9 = (from x in Funs.DB.Report_Construction_Plan
|
|
|
|
|
where x.ReportId == ReportId && x.ReType == "5"
|
|
|
|
|
select x).ToList();
|
|
|
|
|
if (detailsGrid9.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
Grid9.Hidden = false;
|
|
|
|
|
Grid9.DataSource = detailsGrid9;
|
|
|
|
|
Grid9.DataBind();
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(Request.Params["view"]))
|
|
|
|
|
{
|
|
|
|
|
//查看页面
|
|
|
|
|
Button4.Hidden = true;
|
|
|
|
|
Button3.Hidden = true;
|
|
|
|
|
//合计
|
|
|
|
|
OutPutSummaryGrid9();
|
|
|
|
|
Grid1.FindColumn("Delete1").Hidden = true;
|
|
|
|
|
Grid9.FindColumn("Delete9").Hidden = true;
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
2024-03-22 16:38:14 +08:00
|
|
|
|
#region 加载18.本月质量问题处理情况
|
|
|
|
|
//(1)原材料问题
|
|
|
|
|
rowMaterialProblemLists.Clear();
|
|
|
|
|
rowMaterialProblemLists = (from x in Funs.DB.Report_RowMaterialProblem
|
|
|
|
|
where x.ReportId == this.ReportId
|
|
|
|
|
select x).ToList();
|
|
|
|
|
if (rowMaterialProblemLists.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
gvRowMaterialProblem.Hidden = false;
|
|
|
|
|
gvRowMaterialProblem.DataSource = rowMaterialProblemLists;
|
|
|
|
|
gvRowMaterialProblem.DataBind();
|
|
|
|
|
}
|
|
|
|
|
//(2)施工过程问题
|
|
|
|
|
constructionProblemsLists.Clear();
|
|
|
|
|
constructionProblemsLists = (from x in Funs.DB.Report_ConstructionProblems
|
|
|
|
|
where x.ReportId == this.ReportId
|
|
|
|
|
select x).ToList();
|
|
|
|
|
if (constructionProblemsLists.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
gvConstructionProblems.Hidden = false;
|
|
|
|
|
gvConstructionProblems.DataSource = constructionProblemsLists;
|
|
|
|
|
gvConstructionProblems.DataBind();
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 加载19.下月质量控制重点
|
|
|
|
|
nextQualityControlLists.Clear();
|
|
|
|
|
nextQualityControlLists = (from x in Funs.DB.Report_NextQualityControl
|
|
|
|
|
where x.ReportId == this.ReportId
|
|
|
|
|
select x).ToList();
|
|
|
|
|
if (nextQualityControlLists.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
gvNextQualityControl.Hidden = false;
|
|
|
|
|
gvNextQualityControl.DataSource = nextQualityControlLists;
|
|
|
|
|
gvNextQualityControl.DataBind();
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
2024-03-20 10:59:25 +08:00
|
|
|
|
|
2024-03-18 09:04:53 +08:00
|
|
|
|
#region 加载文本框内容
|
|
|
|
|
var txtReportList = Funs.DB.Report_TextBoxContent.Where(x => x.ReportId == ReportId).ToList();
|
|
|
|
|
txtAre0.Text = txtReportList.FirstOrDefault(x => x.ContentType == "0").ContentText;
|
|
|
|
|
txtAre1.Text = txtReportList.FirstOrDefault(x => x.ContentType == "1").ContentText;
|
|
|
|
|
txtAre2.Text = txtReportList.FirstOrDefault(x => x.ContentType == "2").ContentText;
|
|
|
|
|
|
|
|
|
|
txtAre20.Text = txtReportList.FirstOrDefault(x => x.ContentType == "20").ContentText;
|
|
|
|
|
txtAre21.Text = txtReportList.FirstOrDefault(x => x.ContentType == "21").ContentText;
|
|
|
|
|
txtAre22.Text = txtReportList.FirstOrDefault(x => x.ContentType == "22").ContentText;
|
2024-03-20 10:59:25 +08:00
|
|
|
|
txtAre8.Text = txtReportList.FirstOrDefault(x => x.ContentType == "8").ContentText;
|
|
|
|
|
if (txtAre8.Text != "本月报验的主要材料钢筋、水泥、预应力xxx等,其中现场抽检xx批,合格xx批")
|
|
|
|
|
{
|
|
|
|
|
Form19.Hidden = false;
|
|
|
|
|
Toolbar4.Hidden = true;
|
|
|
|
|
}
|
2024-03-18 09:04:53 +08:00
|
|
|
|
#endregion
|
2024-03-20 10:59:25 +08:00
|
|
|
|
|
2024-03-19 10:46:55 +08:00
|
|
|
|
//加载所有grid
|
|
|
|
|
lodAllGrid("1");
|
2024-03-18 09:04:53 +08:00
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
this.txtStartDate.Text = string.IsNullOrEmpty(Request.Params["startdate"]) ? string.Format("{0:yyyy-MM-dd}", DateTime.Now) : Request.Params["startdate"];
|
|
|
|
|
this.txtEndDate.Text = string.IsNullOrEmpty(Request.Params["enddate"]) ? string.Format("{0:yyyy-MM-dd}", Convert.ToDateTime(this.txtStartDate.Text).AddMonths(1).AddDays(-1)) : Request.Params["enddate"];
|
|
|
|
|
//给个新的主键
|
|
|
|
|
ReportId = Guid.NewGuid().ToString();
|
|
|
|
|
AddOrUpdate = "add";
|
2024-03-19 10:46:55 +08:00
|
|
|
|
|
|
|
|
|
//加载所有grid
|
|
|
|
|
lodAllGrid("0");
|
2024-03-18 09:04:53 +08:00
|
|
|
|
}
|
|
|
|
|
hidReportId.Value = ReportId;
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-03-19 10:46:55 +08:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 加载grid
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="objType"></param>
|
2024-03-20 10:59:25 +08:00
|
|
|
|
void lodAllGrid(string objType)
|
|
|
|
|
{
|
|
|
|
|
//3.1 加载一般施工方案审批情况
|
2024-03-19 10:46:55 +08:00
|
|
|
|
loadGeneralPlanApproval(objType);
|
|
|
|
|
|
2024-03-20 10:59:25 +08:00
|
|
|
|
//3.2 加载危大工程方案审批情况
|
2024-03-19 10:46:55 +08:00
|
|
|
|
loadMajorPlanApproval(objType);
|
|
|
|
|
|
2024-03-20 10:59:25 +08:00
|
|
|
|
//3.3 质量控制点或检验试验计划(ITP)情况
|
2024-03-19 10:46:55 +08:00
|
|
|
|
loadInspectionTestPlan(objType);
|
|
|
|
|
|
2024-03-20 10:59:25 +08:00
|
|
|
|
//4 加载设计交底管理情况
|
2024-03-19 10:46:55 +08:00
|
|
|
|
loadDesignDetailsApprove(objType);
|
|
|
|
|
|
2024-03-20 10:59:25 +08:00
|
|
|
|
//5 加载图纸会审管理情况
|
2024-03-19 10:46:55 +08:00
|
|
|
|
loadReviewDrawings(objType);
|
|
|
|
|
|
2024-03-20 10:59:25 +08:00
|
|
|
|
//6 加载设计变更管理情况
|
2024-03-19 10:46:55 +08:00
|
|
|
|
loadDesignChangeOrder();
|
2024-03-20 10:59:25 +08:00
|
|
|
|
|
|
|
|
|
//7.1 加载合格焊工管理情况
|
|
|
|
|
loadPassWelder();
|
|
|
|
|
|
|
|
|
|
//7.3 加载无损检测管理
|
|
|
|
|
loadProcessControl_NondestructiveTest_New();
|
|
|
|
|
|
|
|
|
|
//8 设备报验管理Grid11
|
|
|
|
|
LoadInspectionEquipment(objType);
|
2024-03-22 16:38:14 +08:00
|
|
|
|
|
|
|
|
|
//加载15.质量巡检情况
|
|
|
|
|
loadQualityInspection(objType);
|
|
|
|
|
//加载16.质量专项检查情况
|
|
|
|
|
loadSpecialCheck(objType);
|
|
|
|
|
//加载17.质量文件上报情况
|
|
|
|
|
loadFileReport(objType);
|
2024-03-19 10:46:55 +08:00
|
|
|
|
}
|
2024-03-18 09:04:53 +08:00
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 时间选择事件
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 开始时间选择事件
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
protected void txtStartDate_TextChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrEmpty(this.txtStartDate.Text.Trim()))
|
|
|
|
|
{
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-03-19 10:46:55 +08:00
|
|
|
|
|
2024-03-20 10:59:25 +08:00
|
|
|
|
protected void TextBox_TextChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrEmpty(this.txtStartDate.Text.Trim()) && !string.IsNullOrEmpty(this.txtEndDate.Text.Trim()))
|
|
|
|
|
{
|
2024-03-19 10:46:55 +08:00
|
|
|
|
|
|
|
|
|
if (Funs.GetNewDateTime(this.txtStartDate.Text.Trim()) > Funs.GetNewDateTime(this.txtEndDate.Text.Trim()))
|
|
|
|
|
{
|
|
|
|
|
Alert.ShowInTop("开始时间不能大于结束时间!", MessageBoxIcon.Warning);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (AddOrUpdate == "update")
|
|
|
|
|
{
|
|
|
|
|
lodAllGrid("1");
|
|
|
|
|
}
|
2024-03-20 10:59:25 +08:00
|
|
|
|
else
|
|
|
|
|
{
|
2024-03-19 10:46:55 +08:00
|
|
|
|
lodAllGrid("0");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-03-18 09:04:53 +08:00
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 本月质量目标管理情况 Grid1方法
|
2024-03-20 10:59:25 +08:00
|
|
|
|
protected void btnAddGrid1_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
2024-03-18 09:04:53 +08:00
|
|
|
|
Grid1.Hidden = false;
|
|
|
|
|
|
|
|
|
|
JArray teamGroupData = Grid1.GetMergedData();
|
|
|
|
|
List<JObject> list = new List<JObject>();
|
|
|
|
|
foreach (JObject teamGroupRow in teamGroupData)
|
|
|
|
|
{
|
|
|
|
|
JObject values = teamGroupRow.Value<JObject>("values");
|
|
|
|
|
values.Add("Id", teamGroupRow.Value<string>("id"));
|
|
|
|
|
list.Add(values);
|
|
|
|
|
}
|
|
|
|
|
JObject defaultObj = new JObject
|
|
|
|
|
{ { "Id",Guid.NewGuid() },
|
|
|
|
|
{ "ReportId", ReportId },
|
|
|
|
|
{ "ProStage", "" },
|
|
|
|
|
{ "ProDescribe",""},
|
|
|
|
|
{ "TargetValue", "" },
|
|
|
|
|
{ "MonthPer","" },
|
|
|
|
|
{ "Remarks", "" },
|
|
|
|
|
{ "SortId","" },
|
|
|
|
|
{ "Delete1", String.Format("<a href=\"javascript:;\" onclick=\"{0}\"><img src=\"{1}\"/></a>", GetDeleteScriptGrid1(), IconHelper.GetResolvedIconUrl(Icon.Delete)) }
|
|
|
|
|
};
|
|
|
|
|
list.Add(defaultObj);
|
|
|
|
|
Grid1.DataSource = list;
|
|
|
|
|
Grid1.DataBind();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected void Grid1_PreDataBound(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
// 设置LinkButtonField的点击客户端事件
|
|
|
|
|
LinkButtonField deleteField = Grid1.FindColumn("Delete1") as LinkButtonField;
|
|
|
|
|
deleteField.OnClientClick = GetDeleteScriptGrid1();
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 删除提示
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
private string GetDeleteScriptGrid1()
|
|
|
|
|
{
|
|
|
|
|
return Confirm.GetShowReference("删除选中行?", String.Empty, MessageBoxIcon.Question, Grid1.GetDeleteSelectedRowsReference(), String.Empty);
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
2024-03-19 10:46:55 +08:00
|
|
|
|
#region 3.1一般施工方案审批情况 Grid2方法
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 加载一般施工审批情况
|
|
|
|
|
/// </summary>
|
|
|
|
|
void loadGeneralPlanApproval(string objType)
|
|
|
|
|
{
|
|
|
|
|
var db = Funs.DB;
|
|
|
|
|
DateTime startDate = Convert.ToDateTime(this.txtStartDate.Text.Trim());
|
|
|
|
|
DateTime endDate = Convert.ToDateTime(this.txtEndDate.Text.Trim());
|
|
|
|
|
var list = new List<Model.Report_Construction_Plan>();
|
|
|
|
|
int i = 1;
|
|
|
|
|
|
|
|
|
|
int Quantity1Sum = 0;
|
|
|
|
|
int Quantity2Sum = 0;
|
|
|
|
|
//加载所有单位
|
|
|
|
|
var units = from x in Funs.DB.Project_ProjectUnit
|
|
|
|
|
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
|
2024-03-20 10:59:25 +08:00
|
|
|
|
where x.ProjectId == this.CurrUser.LoginProjectId && (x.UnitType == BLL.Const.ProjectUnitType_2 || x.UnitType == BLL.Const.ProjectUnitType_1)
|
2024-03-19 10:46:55 +08:00
|
|
|
|
orderby y.UnitCode
|
|
|
|
|
select new { x.UnitId, y.UnitName };
|
|
|
|
|
foreach (var item in units)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var query = from c in db.Comprehensive_GeneralPlanApproval
|
|
|
|
|
|
|
|
|
|
join u in db.Base_Unit on c.UnitId equals u.UnitId into unitJoin
|
|
|
|
|
|
|
|
|
|
from u in unitJoin.DefaultIfEmpty()
|
|
|
|
|
|
|
|
|
|
where c.ProjectId == this.CurrUser.LoginProjectId && c.UnitId == item.UnitId
|
|
|
|
|
select new
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
c.ApprovalDate,
|
|
|
|
|
c.ProjectId,
|
|
|
|
|
u.UnitId,
|
|
|
|
|
u.UnitName,
|
|
|
|
|
c.CompileDate
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var AllList = query.ToList();
|
|
|
|
|
var monethCount = query
|
|
|
|
|
.Where(x => (x.ApprovalDate >= Convert.ToDateTime(startDate) && x.ApprovalDate <= Convert.ToDateTime(endDate)));
|
|
|
|
|
|
|
|
|
|
Model.Report_Construction_Plan model = new Model.Report_Construction_Plan();
|
|
|
|
|
|
|
|
|
|
model.Id = Guid.NewGuid().ToString();
|
|
|
|
|
model.UnitOrMajor = item.UnitName;
|
|
|
|
|
model.Quantity1 = monethCount.Count();
|
|
|
|
|
model.Quantity2 = AllList.Count();
|
|
|
|
|
model.ReportId = ReportId;
|
|
|
|
|
//如果是修改,查询表中数据
|
2024-03-20 10:59:25 +08:00
|
|
|
|
if (objType == "1")
|
2024-03-19 10:46:55 +08:00
|
|
|
|
{
|
|
|
|
|
var NewModel = db.Report_Construction_Plan.FirstOrDefault(x => x.ReportId == ReportId && x.UnitOrMajor == item.UnitName && x.ReType == "0");
|
2024-03-20 10:59:25 +08:00
|
|
|
|
if (NewModel != null)
|
2024-03-19 10:46:55 +08:00
|
|
|
|
{
|
|
|
|
|
model.Remarks = NewModel.Remarks;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
list.Add(model);
|
|
|
|
|
|
2024-03-20 10:59:25 +08:00
|
|
|
|
Quantity1Sum += monethCount.Count();
|
2024-03-19 10:46:55 +08:00
|
|
|
|
Quantity2Sum += AllList.Count();
|
|
|
|
|
i++;
|
|
|
|
|
}
|
|
|
|
|
Grid2.DataSource = list;
|
|
|
|
|
Grid2.DataBind();
|
|
|
|
|
|
|
|
|
|
//合计
|
|
|
|
|
JObject summary = new JObject();
|
|
|
|
|
summary.Add("UnitOrMajor", "合计");
|
|
|
|
|
summary.Add("Quantity1", Quantity1Sum.ToString());
|
|
|
|
|
summary.Add("Quantity2", Quantity2Sum.ToString());
|
|
|
|
|
|
|
|
|
|
Grid2.SummaryData = summary;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 3.2 危大工程方案审批情况 Grid3方法
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 加载一般施工审批情况
|
|
|
|
|
/// </summary>
|
|
|
|
|
void loadMajorPlanApproval(string objType)
|
|
|
|
|
{
|
|
|
|
|
var db = Funs.DB;
|
|
|
|
|
DateTime startDate = Convert.ToDateTime(this.txtStartDate.Text.Trim());
|
|
|
|
|
DateTime endDate = Convert.ToDateTime(this.txtEndDate.Text.Trim());
|
|
|
|
|
var list = new List<Model.Report_Construction_Plan>();
|
|
|
|
|
int i = 1;
|
|
|
|
|
|
|
|
|
|
int Quantity1Sum = 0;
|
|
|
|
|
int Quantity2Sum = 0;
|
|
|
|
|
int Quantity3Sum = 0;
|
|
|
|
|
//加载所有单位
|
|
|
|
|
var units = from x in Funs.DB.Project_ProjectUnit
|
|
|
|
|
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
|
|
|
|
|
where x.ProjectId == this.CurrUser.LoginProjectId && (x.UnitType == BLL.Const.ProjectUnitType_2 || x.UnitType == BLL.Const.ProjectUnitType_1)
|
|
|
|
|
orderby y.UnitCode
|
|
|
|
|
select new { x.UnitId, y.UnitName };
|
|
|
|
|
foreach (var item in units)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var query = from c in db.Comprehensive_MajorPlanApproval
|
|
|
|
|
|
|
|
|
|
join u in db.Base_Unit on c.UnitId equals u.UnitId into unitJoin
|
|
|
|
|
|
|
|
|
|
from u in unitJoin.DefaultIfEmpty()
|
|
|
|
|
|
|
|
|
|
where c.ProjectId == this.CurrUser.LoginProjectId && c.UnitId == item.UnitId
|
|
|
|
|
select new
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
c.ApprovalDate,
|
|
|
|
|
c.ProjectId,
|
|
|
|
|
u.UnitId,
|
|
|
|
|
u.UnitName,
|
|
|
|
|
c.ExpertReviewMan,
|
|
|
|
|
c.CompileDate
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var AllList = query.ToList();
|
|
|
|
|
var monethCount = query
|
|
|
|
|
.Where(x => (x.ApprovalDate >= Convert.ToDateTime(startDate) && x.ApprovalDate <= Convert.ToDateTime(endDate)));
|
|
|
|
|
|
|
|
|
|
Model.Report_Construction_Plan model = new Model.Report_Construction_Plan();
|
|
|
|
|
|
|
|
|
|
model.Id = Guid.NewGuid().ToString();
|
|
|
|
|
model.UnitOrMajor = item.UnitName;
|
|
|
|
|
model.Quantity1 = monethCount.Count();
|
|
|
|
|
model.Quantity2 = AllList.Count();
|
|
|
|
|
model.Quantity3 = AllList.Where(x => x.ExpertReviewMan != "").ToList().Count();
|
|
|
|
|
model.ReportId = ReportId;
|
|
|
|
|
//如果是修改,查询表中数据
|
|
|
|
|
if (objType == "1")
|
|
|
|
|
{
|
|
|
|
|
var NewModel = db.Report_Construction_Plan.FirstOrDefault(x => x.ReportId == ReportId && x.UnitOrMajor == item.UnitName && x.ReType == "1");
|
|
|
|
|
if (NewModel != null)
|
|
|
|
|
{
|
|
|
|
|
model.Remarks = NewModel.Remarks;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
list.Add(model);
|
|
|
|
|
|
|
|
|
|
Quantity1Sum += monethCount.Count();
|
|
|
|
|
Quantity2Sum += AllList.Count();
|
|
|
|
|
Quantity3Sum += Convert.ToInt32(model.Quantity3);
|
|
|
|
|
i++;
|
|
|
|
|
}
|
|
|
|
|
Grid3.DataSource = list;
|
|
|
|
|
Grid3.DataBind();
|
|
|
|
|
|
|
|
|
|
//合计
|
|
|
|
|
JObject summary = new JObject();
|
|
|
|
|
summary.Add("UnitOrMajor", "合计");
|
|
|
|
|
summary.Add("Quantity1", Quantity1Sum.ToString());
|
|
|
|
|
summary.Add("Quantity2", Quantity2Sum.ToString());
|
|
|
|
|
summary.Add("Quantity3", Quantity3Sum.ToString());
|
|
|
|
|
Grid3.SummaryData = summary;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 3.3 质量控制点或检验试验计划(ITP)情况 Grid4方法
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 加载一般施工审批情况
|
|
|
|
|
/// </summary>
|
|
|
|
|
void loadInspectionTestPlan(string objType)
|
|
|
|
|
{
|
|
|
|
|
var db = Funs.DB;
|
|
|
|
|
DateTime startDate = Convert.ToDateTime(this.txtStartDate.Text.Trim());
|
|
|
|
|
DateTime endDate = Convert.ToDateTime(this.txtEndDate.Text.Trim());
|
|
|
|
|
var list = new List<Model.Report_Construction_Plan>();
|
|
|
|
|
int i = 1;
|
|
|
|
|
|
|
|
|
|
int Quantity1Sum = 0;
|
|
|
|
|
int Quantity2Sum = 0;
|
|
|
|
|
//加载所有专业
|
|
|
|
|
var CNProfessionals = from x in Funs.DB.Base_CNProfessional
|
|
|
|
|
where x.CNProfessionalId != BLL.Const.CNProfessionalConstructId
|
|
|
|
|
orderby x.SortIndex
|
|
|
|
|
select new
|
|
|
|
|
{
|
|
|
|
|
x.CNProfessionalId,
|
|
|
|
|
x.ProfessionalName
|
|
|
|
|
};
|
|
|
|
|
|
2024-03-20 10:59:25 +08:00
|
|
|
|
|
2024-03-19 10:46:55 +08:00
|
|
|
|
foreach (var item in CNProfessionals)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var query = from c in db.Inspection_Test_Plan
|
|
|
|
|
|
|
|
|
|
join u in db.Base_Unit on c.UnitId equals u.UnitId into unitJoin
|
|
|
|
|
|
|
|
|
|
from u in unitJoin.DefaultIfEmpty()
|
|
|
|
|
|
|
|
|
|
where c.ProjectId == this.CurrUser.LoginProjectId && c.CNProfessionalId == item.CNProfessionalId
|
|
|
|
|
select new
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
c.ApprovalDate,
|
|
|
|
|
c.ProjectId,
|
|
|
|
|
u.UnitId,
|
|
|
|
|
u.UnitName,
|
|
|
|
|
c.CreateDate
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var AllList = query.ToList();
|
|
|
|
|
var monethCount = query
|
|
|
|
|
.Where(x => (x.CreateDate >= Convert.ToDateTime(startDate) && x.CreateDate <= Convert.ToDateTime(endDate)));
|
|
|
|
|
|
|
|
|
|
Model.Report_Construction_Plan model = new Model.Report_Construction_Plan();
|
|
|
|
|
|
|
|
|
|
model.Id = Guid.NewGuid().ToString();
|
|
|
|
|
model.UnitOrMajor = item.ProfessionalName;
|
|
|
|
|
model.Quantity1 = monethCount.Count();
|
|
|
|
|
model.Quantity2 = AllList.Count();
|
2024-03-20 10:59:25 +08:00
|
|
|
|
|
2024-03-19 10:46:55 +08:00
|
|
|
|
model.ReportId = ReportId;
|
|
|
|
|
//如果是修改,查询表中数据
|
|
|
|
|
if (objType == "1")
|
|
|
|
|
{
|
|
|
|
|
var NewModel = db.Report_Construction_Plan.FirstOrDefault(x => x.ReportId == ReportId && x.UnitOrMajor == item.ProfessionalName && x.ReType == "2");
|
|
|
|
|
if (NewModel != null)
|
|
|
|
|
{
|
|
|
|
|
model.Remarks = NewModel.Remarks;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
list.Add(model);
|
|
|
|
|
|
|
|
|
|
Quantity1Sum += monethCount.Count();
|
|
|
|
|
Quantity2Sum += AllList.Count();
|
2024-03-20 10:59:25 +08:00
|
|
|
|
|
2024-03-19 10:46:55 +08:00
|
|
|
|
i++;
|
|
|
|
|
}
|
|
|
|
|
Grid4.DataSource = list;
|
|
|
|
|
Grid4.DataBind();
|
|
|
|
|
|
|
|
|
|
//合计
|
|
|
|
|
JObject summary = new JObject();
|
|
|
|
|
summary.Add("UnitOrMajor", "合计");
|
|
|
|
|
summary.Add("Quantity1", Quantity1Sum.ToString());
|
|
|
|
|
summary.Add("Quantity2", Quantity2Sum.ToString());
|
|
|
|
|
Grid4.SummaryData = summary;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 4 设计交底管理情况 Grid5方法
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 加载一般施工审批情况
|
|
|
|
|
/// </summary>
|
|
|
|
|
void loadDesignDetailsApprove(string objType)
|
|
|
|
|
{
|
|
|
|
|
var db = Funs.DB;
|
|
|
|
|
DateTime startDate = Convert.ToDateTime(this.txtStartDate.Text.Trim());
|
|
|
|
|
DateTime endDate = Convert.ToDateTime(this.txtEndDate.Text.Trim());
|
|
|
|
|
var list = new List<Model.Report_Construction_Plan>();
|
|
|
|
|
int i = 1;
|
|
|
|
|
|
|
|
|
|
int Quantity1Sum = 0;
|
|
|
|
|
int Quantity2Sum = 0;
|
|
|
|
|
//加载所有专业
|
|
|
|
|
var CNProfessionals = from x in Funs.DB.Base_CNProfessional
|
|
|
|
|
where x.CNProfessionalId != BLL.Const.CNProfessionalConstructId
|
|
|
|
|
orderby x.SortIndex
|
|
|
|
|
select new
|
|
|
|
|
{
|
|
|
|
|
x.CNProfessionalId,
|
|
|
|
|
x.ProfessionalName
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var item in CNProfessionals)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var query = from c in db.Comprehensive_DesignDetails
|
|
|
|
|
|
|
|
|
|
where c.ProjectId == this.CurrUser.LoginProjectId && c.CNProfessionalId == item.CNProfessionalId
|
2024-03-20 10:59:25 +08:00
|
|
|
|
&& c.Status == "3"
|
2024-03-19 10:46:55 +08:00
|
|
|
|
select new
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
c.Status,
|
|
|
|
|
c.CompileDate,
|
|
|
|
|
c.ProjectId,
|
2024-03-20 10:59:25 +08:00
|
|
|
|
|
2024-03-19 10:46:55 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var AllList = query.ToList();
|
|
|
|
|
var monethCount = query
|
|
|
|
|
.Where(x => (x.CompileDate >= Convert.ToDateTime(startDate) && x.CompileDate <= Convert.ToDateTime(endDate)));
|
|
|
|
|
|
|
|
|
|
Model.Report_Construction_Plan model = new Model.Report_Construction_Plan();
|
|
|
|
|
|
|
|
|
|
model.Id = Guid.NewGuid().ToString();
|
|
|
|
|
model.UnitOrMajor = item.ProfessionalName;
|
|
|
|
|
model.Quantity1 = monethCount.Count();
|
|
|
|
|
model.Quantity2 = AllList.Count();
|
|
|
|
|
|
|
|
|
|
model.ReportId = ReportId;
|
|
|
|
|
//如果是修改,查询表中数据
|
|
|
|
|
if (objType == "1")
|
|
|
|
|
{
|
|
|
|
|
var NewModel = db.Report_Construction_Plan.FirstOrDefault(x => x.ReportId == ReportId && x.UnitOrMajor == item.ProfessionalName && x.ReType == "3");
|
|
|
|
|
if (NewModel != null)
|
|
|
|
|
{
|
|
|
|
|
model.Remarks = NewModel.Remarks;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
list.Add(model);
|
|
|
|
|
|
|
|
|
|
Quantity1Sum += monethCount.Count();
|
|
|
|
|
Quantity2Sum += AllList.Count();
|
|
|
|
|
|
|
|
|
|
i++;
|
|
|
|
|
}
|
|
|
|
|
Grid5.DataSource = list;
|
|
|
|
|
Grid5.DataBind();
|
|
|
|
|
|
|
|
|
|
//合计
|
|
|
|
|
JObject summary = new JObject();
|
|
|
|
|
summary.Add("UnitOrMajor", "合计");
|
|
|
|
|
summary.Add("Quantity1", Quantity1Sum.ToString());
|
|
|
|
|
summary.Add("Quantity2", Quantity2Sum.ToString());
|
|
|
|
|
Grid5.SummaryData = summary;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 5 图纸会审管理情况 Grid6方法
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 加载一图纸会审管理情况
|
|
|
|
|
/// </summary>
|
|
|
|
|
void loadReviewDrawings(string objType)
|
|
|
|
|
{
|
|
|
|
|
var db = Funs.DB;
|
|
|
|
|
DateTime startDate = Convert.ToDateTime(this.txtStartDate.Text.Trim());
|
|
|
|
|
DateTime endDate = Convert.ToDateTime(this.txtEndDate.Text.Trim());
|
|
|
|
|
var list = new List<Model.Report_Construction_Plan>();
|
|
|
|
|
int i = 1;
|
|
|
|
|
|
|
|
|
|
int Quantity1Sum = 0;
|
|
|
|
|
int Quantity2Sum = 0;
|
|
|
|
|
//加载所有专业
|
|
|
|
|
var CNProfessionals = from x in Funs.DB.Base_CNProfessional
|
|
|
|
|
where x.CNProfessionalId != BLL.Const.CNProfessionalConstructId
|
|
|
|
|
orderby x.SortIndex
|
|
|
|
|
select new
|
|
|
|
|
{
|
|
|
|
|
x.CNProfessionalId,
|
|
|
|
|
x.ProfessionalName
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var item in CNProfessionals)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var query = from c in db.Comprehensive_ReviewDrawings
|
|
|
|
|
|
|
|
|
|
where c.ProjectId == this.CurrUser.LoginProjectId && c.CNProfessionalId == item.CNProfessionalId
|
|
|
|
|
&& c.Status == "3"
|
|
|
|
|
select new
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
c.Status,
|
|
|
|
|
c.ReviewDate,
|
|
|
|
|
c.ProjectId,
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var AllList = query.ToList();
|
|
|
|
|
var monethCount = query
|
|
|
|
|
.Where(x => (x.ReviewDate >= Convert.ToDateTime(startDate) && x.ReviewDate <= Convert.ToDateTime(endDate)));
|
|
|
|
|
|
|
|
|
|
Model.Report_Construction_Plan model = new Model.Report_Construction_Plan();
|
|
|
|
|
|
|
|
|
|
model.Id = Guid.NewGuid().ToString();
|
|
|
|
|
model.UnitOrMajor = item.ProfessionalName;
|
|
|
|
|
model.Quantity1 = monethCount.Count();
|
|
|
|
|
model.Quantity2 = AllList.Count();
|
|
|
|
|
|
|
|
|
|
model.ReportId = ReportId;
|
|
|
|
|
//如果是修改,查询表中数据
|
|
|
|
|
if (objType == "1")
|
|
|
|
|
{
|
|
|
|
|
var NewModel = db.Report_Construction_Plan.FirstOrDefault(x => x.ReportId == ReportId && x.UnitOrMajor == item.ProfessionalName && x.ReType == "4");
|
|
|
|
|
if (NewModel != null)
|
|
|
|
|
{
|
|
|
|
|
model.Remarks = NewModel.Remarks;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
list.Add(model);
|
|
|
|
|
|
|
|
|
|
Quantity1Sum += monethCount.Count();
|
|
|
|
|
Quantity2Sum += AllList.Count();
|
|
|
|
|
|
|
|
|
|
i++;
|
|
|
|
|
}
|
|
|
|
|
Grid6.DataSource = list;
|
|
|
|
|
Grid6.DataBind();
|
|
|
|
|
|
|
|
|
|
//合计
|
|
|
|
|
JObject summary = new JObject();
|
|
|
|
|
summary.Add("UnitOrMajor", "合计");
|
|
|
|
|
summary.Add("Quantity1", Quantity1Sum.ToString());
|
|
|
|
|
summary.Add("Quantity2", Quantity2Sum.ToString());
|
|
|
|
|
Grid6.SummaryData = summary;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 6 设计变更管理情况 Grid7方法
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 加载设计变更管理情况
|
|
|
|
|
/// </summary>
|
|
|
|
|
void loadDesignChangeOrder()
|
|
|
|
|
{
|
2024-03-20 10:59:25 +08:00
|
|
|
|
int Quantity1Sum = 0, Quantity2Sum = 0, Quantity3Sum = 0, Quantity4Sum = 0, Quantity5Sum = 0, Quantity6Sum = 0;
|
|
|
|
|
|
2024-03-19 10:46:55 +08:00
|
|
|
|
DateTime startDate = Convert.ToDateTime(this.txtStartDate.Text.Trim());
|
|
|
|
|
DateTime endDate = Convert.ToDateTime(this.txtEndDate.Text.Trim());
|
|
|
|
|
DateTime projectStartDate = Convert.ToDateTime("2015-01-01");
|
|
|
|
|
List<Model.CheckStatisc> StatisticsList = new List<Model.CheckStatisc>();
|
|
|
|
|
Model.Base_Project project = BLL.ProjectService.GetProjectByProjectId(this.CurrUser.LoginProjectId);
|
|
|
|
|
if (project != null)
|
|
|
|
|
{
|
|
|
|
|
if (project.StartDate != null)
|
|
|
|
|
{
|
|
|
|
|
projectStartDate = Convert.ToDateTime(project.StartDate);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
int i = 1;
|
|
|
|
|
var cNProfessionals = from x in Funs.DB.Base_CNProfessional orderby x.SortIndex select x;
|
|
|
|
|
foreach (var item in cNProfessionals)
|
|
|
|
|
{
|
|
|
|
|
//专业下所有集合
|
|
|
|
|
List<Model.Comprehensive_DesignChangeOrder> totalManagementList = BLL.DesignChangeOrderService.GetDesignChangeOrderListByCNProfessionalIdAndDate(this.CurrUser.LoginProjectId, item.CNProfessionalId, projectStartDate, DateTime.Now);
|
|
|
|
|
//专业下当期集合
|
|
|
|
|
List<Model.Comprehensive_DesignChangeOrder> managementList = BLL.DesignChangeOrderService.GetDesignChangeOrderListByCNProfessionalIdAndDate(this.CurrUser.LoginProjectId, item.CNProfessionalId, startDate, endDate);
|
|
|
|
|
Model.CheckStatisc checkStatisc = new Model.CheckStatisc();
|
|
|
|
|
checkStatisc.Num = i;
|
|
|
|
|
checkStatisc.WorkName = item.ProfessionalName;
|
|
|
|
|
checkStatisc.CheckNum = managementList.Count();
|
|
|
|
|
checkStatisc.TotalCheckNum = totalManagementList.Count();
|
|
|
|
|
checkStatisc.OKNum = managementList.Count(x => x.ApprovalDate != null);
|
|
|
|
|
checkStatisc.TotalOKNum = totalManagementList.Count(x => x.ApprovalDate != null);
|
|
|
|
|
checkStatisc.OneOKRate = managementList.Count(x => x.Status == "3").ToString(); //当期完成数
|
|
|
|
|
checkStatisc.TotalOneOKRate = totalManagementList.Count(x => x.Status == "3").ToString(); //累计完成数
|
2024-03-20 10:59:25 +08:00
|
|
|
|
|
2024-03-19 10:46:55 +08:00
|
|
|
|
StatisticsList.Add(checkStatisc);
|
|
|
|
|
Quantity1Sum += checkStatisc.CheckNum;
|
|
|
|
|
Quantity2Sum += checkStatisc.TotalCheckNum;
|
2024-03-20 10:59:25 +08:00
|
|
|
|
Quantity3Sum += checkStatisc.OKNum;
|
2024-03-19 10:46:55 +08:00
|
|
|
|
Quantity4Sum += checkStatisc.TotalOKNum;
|
|
|
|
|
Quantity5Sum += Convert.ToInt32(checkStatisc.OneOKRate);
|
|
|
|
|
Quantity6Sum += Convert.ToInt32(checkStatisc.TotalOneOKRate);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Grid7.DataSource = StatisticsList;
|
|
|
|
|
Grid7.DataBind();
|
|
|
|
|
|
|
|
|
|
//合计
|
|
|
|
|
JObject summary = new JObject();
|
|
|
|
|
summary.Add("WorkName", "合计");
|
|
|
|
|
summary.Add("CheckNum", Quantity1Sum.ToString());
|
|
|
|
|
summary.Add("TotalCheckNum", Quantity2Sum.ToString());
|
|
|
|
|
summary.Add("OKNum", Quantity3Sum.ToString());
|
|
|
|
|
summary.Add("TotalOKNum", Quantity4Sum.ToString());
|
|
|
|
|
summary.Add("OneOKRate", Quantity5Sum.ToString());
|
|
|
|
|
summary.Add("TotalOneOKRate", Quantity6Sum.ToString());
|
|
|
|
|
Grid7.SummaryData = summary;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
2024-03-20 10:59:25 +08:00
|
|
|
|
#region 7.1 合格焊工管理情况 Grid8方法
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 加载合格焊工管理情况
|
|
|
|
|
/// </summary>
|
|
|
|
|
void loadPassWelder()
|
|
|
|
|
{
|
|
|
|
|
int Quantity1Sum = 0, Quantity2Sum = 0, Quantity3Sum = 0, Quantity4Sum = 0, Quantity5Sum = 0, Quantity6Sum = 0, Quantity7Sum = 0, Quantity8Sum = 0;
|
|
|
|
|
DateTime startDate = Convert.ToDateTime(this.txtStartDate.Text.Trim());
|
|
|
|
|
DateTime endDate = Convert.ToDateTime(this.txtEndDate.Text.Trim());
|
|
|
|
|
DateTime projectStartDate = Convert.ToDateTime("2015-01-01");
|
|
|
|
|
List<Model.PassWelderStatisc> StatisticsList = new List<Model.PassWelderStatisc>();
|
|
|
|
|
Model.Base_Project project = BLL.ProjectService.GetProjectByProjectId(this.CurrUser.LoginProjectId);
|
|
|
|
|
if (project != null)
|
|
|
|
|
{
|
|
|
|
|
if (project.StartDate != null)
|
|
|
|
|
{
|
|
|
|
|
projectStartDate = Convert.ToDateTime(project.StartDate);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
int i = 1;
|
|
|
|
|
var units = from x in Funs.DB.Project_ProjectUnit
|
|
|
|
|
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
|
|
|
|
|
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)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var query = from c in db.Comprehensive_InspectionPerson
|
|
|
|
|
|
|
|
|
|
join u in db.Base_Unit on c.UnitId equals u.UnitId into unitJoin
|
|
|
|
|
|
|
|
|
|
from u in unitJoin.DefaultIfEmpty()
|
|
|
|
|
join cn in db.Base_CNProfessional on c.CNProfessionalId equals cn.CNProfessionalId into cnJoin
|
|
|
|
|
|
|
|
|
|
from cn in cnJoin.DefaultIfEmpty()
|
|
|
|
|
join p in db.Base_Post on c.PostId equals p.PostId into postJoin
|
|
|
|
|
|
|
|
|
|
from p in postJoin.DefaultIfEmpty()
|
|
|
|
|
where c.ProjectId == this.CurrUser.LoginProjectId && c.UnitId == item.UnitId
|
|
|
|
|
select new
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
c.InspectionPersonId,
|
|
|
|
|
c.ProjectId,
|
|
|
|
|
u.UnitId,
|
|
|
|
|
u.UnitName,
|
|
|
|
|
c.PersonName,
|
|
|
|
|
c.ApprovalTime,
|
|
|
|
|
cn.ProfessionalName,
|
|
|
|
|
p.PostName
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//单位下所有集合
|
|
|
|
|
// List<Model.BS_Welder> totalWelderList = BLL.PersonManageService.GetWelderListByUnitId(this.CurrUser.LoginProjectId, item.UnitId);
|
|
|
|
|
//List<Model.BS_Welder> welderList = BLL.PersonManageService.GetWelderListByUnitIdAndDate(this.CurrUser.LoginProjectId, item.UnitId, startDate, endDate);
|
|
|
|
|
var totalWelderList = query.ToList();
|
|
|
|
|
var welderList = query
|
|
|
|
|
.Where(x => (x.ApprovalTime >= Convert.ToDateTime(startDate) && x.ApprovalTime <= Convert.ToDateTime(endDate)));
|
|
|
|
|
Model.PassWelderStatisc passWelderStatisc = new Model.PassWelderStatisc();
|
|
|
|
|
passWelderStatisc.Num = i;
|
|
|
|
|
passWelderStatisc.UnitName = item.UnitName;
|
|
|
|
|
passWelderStatisc.PipeMountGuard = welderList.Count(x => x.ProfessionalName == "管道" && x.PostName == "焊工");
|
|
|
|
|
passWelderStatisc.PipeTotal = totalWelderList.Count(x => x.ProfessionalName == "管道" && x.PostName == "焊工");
|
|
|
|
|
passWelderStatisc.SteelStructureMountGuard = welderList.Count(x => x.ProfessionalName == "土建" && x.PostName == "焊工");
|
|
|
|
|
passWelderStatisc.SteelStructureTotal = totalWelderList.Count(x => x.ProfessionalName == "土建" && x.PostName == "焊工");
|
|
|
|
|
passWelderStatisc.EquipmentMountGuard = welderList.Count(x => x.ProfessionalName == "设备" && x.PostName == "焊工");
|
|
|
|
|
passWelderStatisc.EquipmentTotal = totalWelderList.Count(x => x.ProfessionalName == "设备" && x.PostName == "焊工");
|
|
|
|
|
passWelderStatisc.OtherMountGuard = welderList.Count(x => x.ProfessionalName != "管道" && x.ProfessionalName != "土建" && x.ProfessionalName != "设备" && x.PostName == "焊工");
|
|
|
|
|
passWelderStatisc.OtherTotal = totalWelderList.Count(x => x.ProfessionalName != "管道" && x.ProfessionalName != "土建" && x.ProfessionalName != "设备" && x.PostName == "焊工");
|
|
|
|
|
StatisticsList.Add(passWelderStatisc);
|
|
|
|
|
i++;
|
|
|
|
|
Quantity1Sum += passWelderStatisc.PipeMountGuard;
|
|
|
|
|
Quantity2Sum += passWelderStatisc.PipeTotal;
|
|
|
|
|
Quantity3Sum += passWelderStatisc.SteelStructureMountGuard;
|
|
|
|
|
Quantity4Sum += passWelderStatisc.SteelStructureTotal;
|
|
|
|
|
Quantity5Sum += passWelderStatisc.EquipmentMountGuard;
|
|
|
|
|
Quantity6Sum += passWelderStatisc.EquipmentTotal;
|
|
|
|
|
Quantity7Sum += passWelderStatisc.OtherMountGuard;
|
|
|
|
|
Quantity8Sum += passWelderStatisc.OtherTotal;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Grid8.DataSource = StatisticsList;
|
|
|
|
|
Grid8.DataBind();
|
|
|
|
|
|
|
|
|
|
//合计
|
|
|
|
|
JObject summary = new JObject();
|
|
|
|
|
summary.Add("UnitName", "合计");
|
|
|
|
|
summary.Add("PipeMountGuard", Quantity1Sum.ToString());
|
|
|
|
|
summary.Add("PipeTotal", Quantity2Sum.ToString());
|
|
|
|
|
summary.Add("SteelStructureMountGuard", Quantity3Sum.ToString());
|
|
|
|
|
summary.Add("SteelStructureTotal", Quantity4Sum.ToString());
|
|
|
|
|
summary.Add("EquipmentMountGuard", Quantity5Sum.ToString());
|
|
|
|
|
summary.Add("EquipmentTotal", Quantity6Sum.ToString());
|
|
|
|
|
summary.Add("OtherMountGuard", Quantity7Sum.ToString());
|
|
|
|
|
summary.Add("OtherTotal", Quantity8Sum.ToString());
|
|
|
|
|
Grid8.SummaryData = summary;
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 7.2 PQR/WPS报验情况 Grid9方法
|
|
|
|
|
protected void btnAddGrid9_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
Grid9.Hidden = false;
|
|
|
|
|
|
|
|
|
|
JArray teamGroupData = Grid9.GetMergedData();
|
|
|
|
|
List<JObject> list = new List<JObject>();
|
|
|
|
|
foreach (JObject teamGroupRow in teamGroupData)
|
|
|
|
|
{
|
|
|
|
|
JObject values = teamGroupRow.Value<JObject>("values");
|
|
|
|
|
values.Add("Id", teamGroupRow.Value<string>("id"));
|
|
|
|
|
list.Add(values);
|
|
|
|
|
}
|
|
|
|
|
JObject defaultObj = new JObject
|
|
|
|
|
{ { "Id",Guid.NewGuid() },
|
|
|
|
|
{ "ReportId", ReportId },
|
|
|
|
|
{ "ReType", "2" },
|
|
|
|
|
{ "UnitOrMajor",""},
|
|
|
|
|
{ "Quantity1", "" },
|
|
|
|
|
{ "Quantity2","" },
|
|
|
|
|
{ "Remarks", "" },
|
|
|
|
|
{ "Delete9", String.Format("<a href=\"javascript:;\" onclick=\"{0}\"><img src=\"{1}\"/></a>", GetDeleteScriptGrid9(), IconHelper.GetResolvedIconUrl(Icon.Delete)) }
|
|
|
|
|
};
|
|
|
|
|
list.Add(defaultObj);
|
|
|
|
|
Grid9.DataSource = list;
|
|
|
|
|
Grid9.DataBind();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected void Grid9_PreDataBound(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
// 设置LinkButtonField的点击客户端事件
|
|
|
|
|
LinkButtonField deleteField = Grid9.FindColumn("Delete9") as LinkButtonField;
|
|
|
|
|
deleteField.OnClientClick = GetDeleteScriptGrid9();
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 删除提示
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
private string GetDeleteScriptGrid9()
|
|
|
|
|
{
|
|
|
|
|
return Confirm.GetShowReference("删除选中行?", String.Empty, MessageBoxIcon.Question, Grid9.GetDeleteSelectedRowsReference(), String.Empty);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 为grid9合计行
|
|
|
|
|
/// </summary>
|
|
|
|
|
void OutPutSummaryGrid9()
|
|
|
|
|
{
|
|
|
|
|
DataTable source = ObjectToTable(Grid9.DataSource);
|
|
|
|
|
int Quantity1Total = 0, Quantity2Total = 0;
|
|
|
|
|
foreach (DataRow row in source.Rows)
|
|
|
|
|
{
|
|
|
|
|
Quantity1Total += Convert.ToInt32(row["Quantity1"]);
|
|
|
|
|
Quantity2Total += Convert.ToInt32(row["Quantity2"]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
JObject summary = new JObject();
|
|
|
|
|
summary.Add("UnitOrMajor", "合计");
|
|
|
|
|
summary.Add("Quantity1", Quantity1Total.ToString());
|
|
|
|
|
summary.Add("Quantity2", Quantity2Total.ToString());
|
|
|
|
|
Grid9.SummaryData = summary;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static DataTable ObjectToTable(object obj)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
Type t;
|
|
|
|
|
if (obj.GetType().IsGenericType)
|
|
|
|
|
{
|
|
|
|
|
t = obj.GetType().GetGenericTypeDefinition();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
t = obj.GetType();
|
|
|
|
|
}
|
|
|
|
|
if (t == typeof(List<>) ||
|
|
|
|
|
t == typeof(IEnumerable<>))
|
|
|
|
|
{
|
|
|
|
|
DataTable dt = new DataTable();
|
|
|
|
|
IEnumerable<object> lstenum = obj as IEnumerable<object>;
|
|
|
|
|
if (lstenum.Count() > 0)
|
|
|
|
|
{
|
|
|
|
|
var ob1 = lstenum.GetEnumerator();
|
|
|
|
|
ob1.MoveNext();
|
|
|
|
|
foreach (var item in ob1.Current.GetType().GetProperties())
|
|
|
|
|
{
|
|
|
|
|
dt.Columns.Add(new DataColumn() { ColumnName = item.Name });
|
|
|
|
|
}
|
|
|
|
|
//数据
|
|
|
|
|
foreach (var item in lstenum)
|
|
|
|
|
{
|
|
|
|
|
DataRow row = dt.NewRow();
|
|
|
|
|
foreach (var sub in item.GetType().GetProperties())
|
|
|
|
|
{
|
|
|
|
|
row[sub.Name] = sub.GetValue(item, null);
|
|
|
|
|
}
|
|
|
|
|
dt.Rows.Add(row);
|
|
|
|
|
}
|
|
|
|
|
return dt;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (t == typeof(DataTable))
|
|
|
|
|
{
|
|
|
|
|
return (DataTable)obj;
|
|
|
|
|
}
|
|
|
|
|
else //(t==typeof(Object))
|
|
|
|
|
{
|
|
|
|
|
DataTable dt = new DataTable();
|
|
|
|
|
foreach (var item in obj.GetType().GetProperties())
|
|
|
|
|
{
|
|
|
|
|
dt.Columns.Add(new DataColumn() { ColumnName = item.Name });
|
|
|
|
|
}
|
|
|
|
|
DataRow row = dt.NewRow();
|
|
|
|
|
foreach (var item in obj.GetType().GetProperties())
|
|
|
|
|
{
|
|
|
|
|
row[item.Name] = item.GetValue(obj, null);
|
|
|
|
|
}
|
|
|
|
|
dt.Rows.Add(row);
|
|
|
|
|
return dt;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 7.3 无损检测管理 Grid10方法
|
|
|
|
|
void loadProcessControl_NondestructiveTest_New()
|
|
|
|
|
{
|
|
|
|
|
var db = Funs.DB;
|
|
|
|
|
|
|
|
|
|
DateTime startDate = Convert.ToDateTime(this.txtStartDate.Text.Trim());
|
|
|
|
|
DateTime endDate = Convert.ToDateTime(this.txtEndDate.Text.Trim());
|
|
|
|
|
var list = new List<Model.ProcessControl_NondestructiveTest_New>();
|
|
|
|
|
//加载所有施工分包单位
|
|
|
|
|
var units = from x in Funs.DB.Project_ProjectUnit
|
|
|
|
|
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
|
|
|
|
|
where x.ProjectId == this.CurrUser.LoginProjectId && (x.UnitType == BLL.Const.ProjectUnitType_2)
|
|
|
|
|
orderby y.UnitCode
|
|
|
|
|
select new { x.UnitId, y.UnitName };
|
|
|
|
|
|
|
|
|
|
int? totalNum0 = 0, totalNum1 = 0;//拍片数量合计
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var item in units)
|
|
|
|
|
{
|
|
|
|
|
int? num0 = 0, num1 = 0;//拍片数量小计
|
|
|
|
|
|
|
|
|
|
var query = from c in db.ProcessControl_NondestructiveTest_New
|
|
|
|
|
|
|
|
|
|
join u in db.Base_Unit on c.UnitId equals u.UnitId into unitJoin
|
|
|
|
|
|
|
|
|
|
from u in unitJoin.DefaultIfEmpty()
|
|
|
|
|
|
|
|
|
|
where c.ProjectId == this.CurrUser.LoginProjectId && c.UnitId == item.UnitId
|
|
|
|
|
&& c.CreateDate >= Convert.ToDateTime(startDate) && c.CreateDate <= Convert.ToDateTime(endDate)
|
|
|
|
|
|
|
|
|
|
orderby c.CreateDate descending
|
|
|
|
|
|
|
|
|
|
select new
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
c.CreateDate,
|
|
|
|
|
c.ProjectId,
|
|
|
|
|
u.UnitId,
|
|
|
|
|
u.UnitName,
|
|
|
|
|
c.ProfessionalName,
|
|
|
|
|
c.MonthQuantity,
|
|
|
|
|
c.TotalQuantity,
|
|
|
|
|
c.MonthRate,
|
|
|
|
|
c.TotalRate
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//加载工艺管道
|
|
|
|
|
var gygdModel = query.FirstOrDefault(x => x.ProfessionalName == "工艺管道");
|
|
|
|
|
var model = new Model.ProcessControl_NondestructiveTest_New();
|
|
|
|
|
model.Id = Guid.NewGuid().ToString();
|
|
|
|
|
model.CreateMan = item.UnitName;//用作存储施工单位名称
|
|
|
|
|
model.ProfessionalName = "工艺管道";
|
|
|
|
|
|
|
|
|
|
if (gygdModel != null)
|
|
|
|
|
{
|
|
|
|
|
model.MonthQuantity = gygdModel.MonthQuantity;
|
|
|
|
|
model.TotalQuantity = gygdModel.TotalQuantity;
|
|
|
|
|
model.MonthRate = gygdModel.MonthRate + "%";
|
|
|
|
|
model.TotalRate = gygdModel.TotalRate + "%";
|
|
|
|
|
#region 小计和合计
|
|
|
|
|
//小计
|
|
|
|
|
num0 += gygdModel.MonthQuantity;
|
|
|
|
|
num1 += gygdModel.TotalQuantity;
|
|
|
|
|
|
|
|
|
|
//合计
|
|
|
|
|
totalNum0 += gygdModel.MonthQuantity;
|
|
|
|
|
totalNum1 += gygdModel.TotalQuantity;
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
list.Add(model);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
model.MonthQuantity = 0;
|
|
|
|
|
model.TotalQuantity = 0;
|
|
|
|
|
model.MonthRate = "0%";
|
|
|
|
|
model.TotalRate = "0%";
|
|
|
|
|
list.Add(model);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//地管
|
|
|
|
|
gygdModel = query.FirstOrDefault(x => x.ProfessionalName == "地管");
|
|
|
|
|
model = new Model.ProcessControl_NondestructiveTest_New();
|
|
|
|
|
model.Id = Guid.NewGuid().ToString();
|
|
|
|
|
model.CreateMan = item.UnitName;//用作存储施工单位名称
|
|
|
|
|
model.ProfessionalName = "地管";
|
|
|
|
|
|
|
|
|
|
if (gygdModel != null)
|
|
|
|
|
{
|
|
|
|
|
model.MonthQuantity = gygdModel.MonthQuantity;
|
|
|
|
|
model.TotalQuantity = gygdModel.TotalQuantity;
|
|
|
|
|
model.MonthRate = gygdModel.MonthRate + "%";
|
|
|
|
|
model.TotalRate = gygdModel.TotalRate + "%";
|
|
|
|
|
#region 小计和合计
|
|
|
|
|
//小计
|
|
|
|
|
num0 += gygdModel.MonthQuantity;
|
|
|
|
|
num1 += gygdModel.TotalQuantity;
|
|
|
|
|
|
|
|
|
|
//合计
|
|
|
|
|
totalNum0 += gygdModel.MonthQuantity;
|
|
|
|
|
totalNum1 += gygdModel.TotalQuantity;
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
list.Add(model);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
model.MonthQuantity = 0;
|
|
|
|
|
model.TotalQuantity = 0;
|
|
|
|
|
model.MonthRate = "0%";
|
|
|
|
|
model.TotalRate = "0%";
|
|
|
|
|
list.Add(model);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//非标
|
|
|
|
|
gygdModel = query.FirstOrDefault(x => x.ProfessionalName == "非标");
|
|
|
|
|
model = new Model.ProcessControl_NondestructiveTest_New();
|
|
|
|
|
model.Id = Guid.NewGuid().ToString();
|
|
|
|
|
model.CreateMan = item.UnitName;//用作存储施工单位名称
|
|
|
|
|
model.ProfessionalName = "非标";
|
|
|
|
|
|
|
|
|
|
if (gygdModel != null)
|
|
|
|
|
{
|
|
|
|
|
model.MonthQuantity = gygdModel.MonthQuantity;
|
|
|
|
|
model.TotalQuantity = gygdModel.TotalQuantity;
|
|
|
|
|
model.MonthRate = gygdModel.MonthRate + "%";
|
|
|
|
|
model.TotalRate = gygdModel.TotalRate + "%";
|
|
|
|
|
#region 小计和合计
|
|
|
|
|
//小计
|
|
|
|
|
num0 += gygdModel.MonthQuantity;
|
|
|
|
|
num1 += gygdModel.TotalQuantity;
|
|
|
|
|
|
|
|
|
|
//合计
|
|
|
|
|
totalNum0 += gygdModel.MonthQuantity;
|
|
|
|
|
totalNum1 += gygdModel.TotalQuantity;
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
list.Add(model);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
model.MonthQuantity = 0;
|
|
|
|
|
model.TotalQuantity = 0;
|
|
|
|
|
model.MonthRate = "0%";
|
|
|
|
|
model.TotalRate = "0%";
|
|
|
|
|
list.Add(model);
|
|
|
|
|
}
|
|
|
|
|
//小计
|
|
|
|
|
model = new Model.ProcessControl_NondestructiveTest_New();
|
|
|
|
|
model.Id = Guid.NewGuid().ToString();
|
|
|
|
|
model.CreateMan = item.UnitName;//用作存储施工单位名称
|
|
|
|
|
model.ProfessionalName = "小计";
|
|
|
|
|
model.MonthQuantity = num0;
|
|
|
|
|
model.TotalQuantity = num1;
|
|
|
|
|
model.MonthRate = "";
|
|
|
|
|
model.TotalRate = "";
|
|
|
|
|
list.Add(model);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Grid10.DataSource = list;
|
|
|
|
|
Grid10.DataBind();
|
|
|
|
|
|
|
|
|
|
//合计
|
|
|
|
|
//合计
|
|
|
|
|
JObject summary = new JObject();
|
|
|
|
|
summary.Add("CreateMan", "合计");
|
|
|
|
|
summary.Add("MonthQuantity", totalNum0.ToString());
|
|
|
|
|
summary.Add("TotalQuantity", totalNum1.ToString());
|
|
|
|
|
|
|
|
|
|
Grid10.SummaryData = summary;
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 8 设备报验管理情况 Grid11方法
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 加载一般施工审批情况
|
|
|
|
|
/// </summary>
|
|
|
|
|
void LoadInspectionEquipment(string objType)
|
|
|
|
|
{
|
|
|
|
|
var db = Funs.DB;
|
|
|
|
|
DateTime startDate = Convert.ToDateTime(this.txtStartDate.Text.Trim());
|
|
|
|
|
DateTime endDate = Convert.ToDateTime(this.txtEndDate.Text.Trim());
|
|
|
|
|
var list = new List<Model.Report_Construction_Plan>();
|
|
|
|
|
int i = 1;
|
|
|
|
|
|
|
|
|
|
int Quantity1Sum = 0;
|
|
|
|
|
int Quantity2Sum = 0;
|
|
|
|
|
//加载所有单位
|
|
|
|
|
var units = from x in Funs.DB.Project_ProjectUnit
|
|
|
|
|
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
|
|
|
|
|
where x.ProjectId == this.CurrUser.LoginProjectId && (x.UnitType == BLL.Const.ProjectUnitType_2 || x.UnitType == BLL.Const.ProjectUnitType_1)
|
|
|
|
|
orderby y.UnitCode
|
|
|
|
|
select new { x.UnitId, y.UnitName };
|
|
|
|
|
foreach (var item in units)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var query = from c in db.Comprehensive_InspectionEquipment
|
|
|
|
|
|
|
|
|
|
join u in db.Base_Unit on c.UnitId equals u.UnitId into unitJoin
|
|
|
|
|
|
|
|
|
|
from u in unitJoin.DefaultIfEmpty()
|
|
|
|
|
|
|
|
|
|
where c.ProjectId == this.CurrUser.LoginProjectId && c.UnitId == item.UnitId
|
|
|
|
|
|
|
|
|
|
&& c.Status == "3"
|
|
|
|
|
|
|
|
|
|
select new
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
c.SamplingResult,//1合格 2不合格
|
|
|
|
|
c.ProjectId,
|
|
|
|
|
u.UnitId,
|
|
|
|
|
u.UnitName,
|
|
|
|
|
c.CompileDate
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var AllList = query.ToList();
|
|
|
|
|
var monethCount = query
|
|
|
|
|
.Where(x => (x.CompileDate >= Convert.ToDateTime(startDate) && x.CompileDate <= Convert.ToDateTime(endDate)));
|
|
|
|
|
|
|
|
|
|
Model.Report_Construction_Plan model = new Model.Report_Construction_Plan();
|
|
|
|
|
|
|
|
|
|
model.Id = Guid.NewGuid().ToString();
|
|
|
|
|
model.UnitOrMajor = item.UnitName;
|
|
|
|
|
model.Quantity1 = monethCount.Count();
|
|
|
|
|
model.Quantity2 = AllList.Count();
|
|
|
|
|
//验收合格率
|
|
|
|
|
var UnqualifiedCount = AllList.Where(x => x.SamplingResult == "1").ToList().Count;//合格的数量
|
|
|
|
|
if (UnqualifiedCount == AllList.Count() && AllList.Count() != 0)
|
|
|
|
|
{
|
|
|
|
|
model.QuaRate = "100%";
|
|
|
|
|
}
|
|
|
|
|
else if (UnqualifiedCount == 0 && AllList.Count() == 0)
|
|
|
|
|
{
|
|
|
|
|
model.QuaRate = "0%";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
var Qualificationrate = (Convert.ToDouble(UnqualifiedCount) / Convert.ToDouble(AllList.Count)) * 100;
|
|
|
|
|
model.QuaRate = Qualificationrate.ToString("0.00") + "%";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
model.ReportId = ReportId;
|
|
|
|
|
//如果是修改,查询表中数据
|
|
|
|
|
if (objType == "1")
|
|
|
|
|
{
|
|
|
|
|
var NewModel = db.Report_Construction_Plan.FirstOrDefault(x => x.ReportId == ReportId && x.UnitOrMajor == item.UnitName && x.ReType == "6");
|
|
|
|
|
if (NewModel != null)
|
|
|
|
|
{
|
|
|
|
|
model.Remarks = NewModel.Remarks;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
list.Add(model);
|
|
|
|
|
|
|
|
|
|
Quantity1Sum += monethCount.Count();
|
|
|
|
|
Quantity2Sum += AllList.Count();
|
|
|
|
|
|
|
|
|
|
i++;
|
|
|
|
|
}
|
|
|
|
|
Grid11.DataSource = list;
|
|
|
|
|
Grid11.DataBind();
|
|
|
|
|
|
|
|
|
|
//合计
|
|
|
|
|
JObject summary = new JObject();
|
|
|
|
|
summary.Add("UnitOrMajor", "合计");
|
|
|
|
|
summary.Add("Quantity1", Quantity1Sum.ToString());
|
|
|
|
|
summary.Add("Quantity2", Quantity2Sum.ToString());
|
|
|
|
|
|
|
|
|
|
Grid11.SummaryData = summary;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 新增按钮显示文本框
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
protected void btnAddGrid11_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
Form19.Hidden = false;
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
2024-03-22 16:38:14 +08:00
|
|
|
|
#region 15.质量巡检情况 gvQualityInspection方法
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 加载质量巡检情况
|
|
|
|
|
/// </summary>
|
|
|
|
|
void loadQualityInspection(string objType)
|
|
|
|
|
{
|
|
|
|
|
var db = Funs.DB;
|
|
|
|
|
DateTime startDate = Convert.ToDateTime(this.txtStartDate.Text.Trim());
|
|
|
|
|
DateTime endDate = Convert.ToDateTime(this.txtEndDate.Text.Trim());
|
|
|
|
|
var list = new List<Model.Report_CQMS_MonthReportItem>();
|
|
|
|
|
int i = 1;
|
|
|
|
|
|
|
|
|
|
int Quantity1Sum = 0;
|
|
|
|
|
int Quantity2Sum = 0;
|
|
|
|
|
//加载所有单位
|
|
|
|
|
var units = from x in Funs.DB.Project_ProjectUnit
|
|
|
|
|
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
|
|
|
|
|
where x.ProjectId == this.CurrUser.LoginProjectId && (x.UnitType == BLL.Const.ProjectUnitType_2 || x.UnitType == BLL.Const.ProjectUnitType_1)
|
|
|
|
|
orderby y.UnitCode
|
|
|
|
|
select new { x.UnitId, y.UnitName };
|
|
|
|
|
foreach (var item in units)
|
|
|
|
|
{
|
|
|
|
|
var query = from c in db.Check_CheckControl
|
|
|
|
|
join u in db.Base_Unit on c.UnitId equals u.UnitId into unitJoin
|
|
|
|
|
from u in unitJoin.DefaultIfEmpty()
|
|
|
|
|
where c.ProjectId == this.CurrUser.LoginProjectId && c.UnitId == item.UnitId
|
|
|
|
|
select new
|
|
|
|
|
{
|
|
|
|
|
c.CheckDate,
|
|
|
|
|
c.ProjectId,
|
|
|
|
|
u.UnitId,
|
|
|
|
|
u.UnitName
|
|
|
|
|
};
|
|
|
|
|
var AllList = query.ToList();
|
|
|
|
|
var monethCount = query
|
|
|
|
|
.Where(x => (x.CheckDate >= Convert.ToDateTime(startDate) && x.CheckDate <= Convert.ToDateTime(endDate)));
|
|
|
|
|
|
|
|
|
|
Model.Report_CQMS_MonthReportItem model = new Model.Report_CQMS_MonthReportItem();
|
|
|
|
|
model.Id = Guid.NewGuid().ToString();
|
|
|
|
|
model.ContentName = item.UnitName;
|
|
|
|
|
model.MonthsCount = monethCount.Count();
|
|
|
|
|
model.ProjectCount = AllList.Count();
|
|
|
|
|
model.ReportId = ReportId;
|
|
|
|
|
//如果是修改,查询表中数据
|
|
|
|
|
if (objType == "1")
|
|
|
|
|
{
|
|
|
|
|
var NewModel = db.Report_CQMS_MonthReportItem.FirstOrDefault(x => x.ReportId == ReportId && x.ContentName == item.UnitName && x.ReType == "1");
|
|
|
|
|
if (NewModel != null)
|
|
|
|
|
{
|
|
|
|
|
model.RectificationRate = NewModel.RectificationRate;
|
|
|
|
|
model.Remarks = NewModel.Remarks;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
list.Add(model);
|
|
|
|
|
|
|
|
|
|
Quantity1Sum += monethCount.Count();
|
|
|
|
|
Quantity2Sum += AllList.Count();
|
|
|
|
|
i++;
|
|
|
|
|
}
|
|
|
|
|
gvQualityInspection.DataSource = list;
|
|
|
|
|
gvQualityInspection.DataBind();
|
|
|
|
|
|
|
|
|
|
//合计
|
|
|
|
|
JObject summary = new JObject();
|
|
|
|
|
summary.Add("ContentName", "合计");
|
|
|
|
|
summary.Add("MonthsCount", Quantity1Sum.ToString());
|
|
|
|
|
summary.Add("ProjectCount", Quantity2Sum.ToString());
|
|
|
|
|
|
|
|
|
|
gvQualityInspection.SummaryData = summary;
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 16.质量专项检查情况 gvSpecialCheck方法
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 加载质量专项检查情况
|
|
|
|
|
/// </summary>
|
|
|
|
|
void loadSpecialCheck(string objType)
|
|
|
|
|
{
|
|
|
|
|
var db = Funs.DB;
|
|
|
|
|
DateTime startDate = Convert.ToDateTime(this.txtStartDate.Text.Trim());
|
|
|
|
|
DateTime endDate = Convert.ToDateTime(this.txtEndDate.Text.Trim());
|
|
|
|
|
var list = new List<Model.Report_CQMS_MonthReportItem>();
|
|
|
|
|
int i = 1;
|
|
|
|
|
|
|
|
|
|
int Quantity1Sum = 0;
|
|
|
|
|
int Quantity2Sum = 0;
|
|
|
|
|
|
|
|
|
|
//加载检查类别
|
|
|
|
|
var lists = BLL.JointCheckService.GetCheckTypeList();
|
|
|
|
|
foreach (var item in lists)
|
|
|
|
|
{
|
|
|
|
|
var query = from c in db.Check_JointCheck
|
|
|
|
|
where c.ProjectId == this.CurrUser.LoginProjectId && c.CheckType == item.Key.ToString()
|
|
|
|
|
select new
|
|
|
|
|
{
|
|
|
|
|
c.CheckDate,
|
|
|
|
|
c.ProjectId,
|
|
|
|
|
c.CheckType
|
|
|
|
|
};
|
|
|
|
|
var AllList = query.ToList();
|
|
|
|
|
var monethCount = query
|
|
|
|
|
.Where(x => (x.CheckDate >= Convert.ToDateTime(startDate) && x.CheckDate <= Convert.ToDateTime(endDate)));
|
|
|
|
|
|
|
|
|
|
Model.Report_CQMS_MonthReportItem model = new Model.Report_CQMS_MonthReportItem();
|
|
|
|
|
model.Id = Guid.NewGuid().ToString();
|
|
|
|
|
model.ContentName = item.Value;
|
|
|
|
|
model.MonthsCount = monethCount.Count();
|
|
|
|
|
model.ProjectCount = AllList.Count();
|
|
|
|
|
model.ReportId = ReportId;
|
|
|
|
|
//如果是修改,查询表中数据
|
|
|
|
|
if (objType == "1")
|
|
|
|
|
{
|
|
|
|
|
var NewModel = db.Report_CQMS_MonthReportItem.FirstOrDefault(x => x.ReportId == ReportId && x.ContentName == item.Value && x.ReType == "2");
|
|
|
|
|
if (NewModel != null)
|
|
|
|
|
{
|
|
|
|
|
model.Remarks = NewModel.Remarks;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
list.Add(model);
|
|
|
|
|
|
|
|
|
|
Quantity1Sum += monethCount.Count();
|
|
|
|
|
Quantity2Sum += AllList.Count();
|
|
|
|
|
i++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gvSpecialCheck.DataSource = list;
|
|
|
|
|
gvSpecialCheck.DataBind();
|
|
|
|
|
|
|
|
|
|
//合计
|
|
|
|
|
JObject summary = new JObject();
|
|
|
|
|
summary.Add("ContentName", "合计");
|
|
|
|
|
summary.Add("MonthsCount", Quantity1Sum.ToString());
|
|
|
|
|
summary.Add("ProjectCount", Quantity2Sum.ToString());
|
|
|
|
|
|
|
|
|
|
gvSpecialCheck.SummaryData = summary;
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 17.质量文件上报情况 gvFileReport方法
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 加载质量文件上报情况
|
|
|
|
|
/// </summary>
|
|
|
|
|
void loadFileReport(string objType)
|
|
|
|
|
{
|
|
|
|
|
var db = Funs.DB;
|
|
|
|
|
DateTime startDate = Convert.ToDateTime(this.txtStartDate.Text.Trim());
|
|
|
|
|
DateTime endDate = Convert.ToDateTime(this.txtEndDate.Text.Trim());
|
|
|
|
|
var list = new List<Model.Report_CQMS_MonthReportItem>();
|
|
|
|
|
int i = 1;
|
|
|
|
|
|
|
|
|
|
int Quantity1Sum = 0;
|
|
|
|
|
int Quantity2Sum = 0;
|
|
|
|
|
int Quantity3Sum = 0;
|
|
|
|
|
int Quantity4Sum = 0;
|
|
|
|
|
//加载所有单位
|
|
|
|
|
var units = from x in Funs.DB.Project_ProjectUnit
|
|
|
|
|
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
|
|
|
|
|
where x.ProjectId == this.CurrUser.LoginProjectId && (x.UnitType == BLL.Const.ProjectUnitType_2 || x.UnitType == BLL.Const.ProjectUnitType_1)
|
|
|
|
|
orderby y.UnitCode
|
|
|
|
|
select new { x.UnitId, y.UnitName };
|
|
|
|
|
foreach (var item in units)
|
|
|
|
|
{
|
|
|
|
|
//var query = from c in db.Check_CheckControl
|
|
|
|
|
// join u in db.Base_Unit on c.UnitId equals u.UnitId into unitJoin
|
|
|
|
|
// from u in unitJoin.DefaultIfEmpty()
|
|
|
|
|
// where c.ProjectId == this.CurrUser.LoginProjectId && c.UnitId == item.UnitId
|
|
|
|
|
// select new
|
|
|
|
|
// {
|
|
|
|
|
// c.CheckDate,
|
|
|
|
|
// c.ProjectId,
|
|
|
|
|
// u.UnitId,
|
|
|
|
|
// u.UnitName
|
|
|
|
|
// };
|
|
|
|
|
//var AllList = query.ToList();//项目数
|
|
|
|
|
//本月数
|
|
|
|
|
//var monethCount = query.Where(x => (x.CheckDate >= Convert.ToDateTime(startDate) && x.CheckDate <= Convert.ToDateTime(endDate)));
|
|
|
|
|
//var yzCount = 0;//本月业主/ 监理返回数量
|
|
|
|
|
//var NoBackCount = 0;//累计未返回数量
|
|
|
|
|
Model.Report_CQMS_MonthReportItem model = new Model.Report_CQMS_MonthReportItem();
|
|
|
|
|
model.Id = Guid.NewGuid().ToString();
|
|
|
|
|
model.ContentName = item.UnitName;
|
|
|
|
|
//model.MonthsCount = monethCount.Count();
|
|
|
|
|
//model.ProjectCount = AllList.Count();
|
|
|
|
|
//model.MonthsBackCount =;
|
|
|
|
|
//model.TotalNoBackCount =;
|
|
|
|
|
model.ReportId = ReportId;
|
|
|
|
|
//如果是修改,查询表中数据
|
|
|
|
|
if (objType == "1")
|
|
|
|
|
{
|
|
|
|
|
var NewModel = db.Report_CQMS_MonthReportItem.FirstOrDefault(x => x.ReportId == ReportId && x.ContentName == item.UnitName && x.ReType == "3");
|
|
|
|
|
if (NewModel != null)
|
|
|
|
|
{
|
|
|
|
|
model.Remarks = NewModel.Remarks;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
list.Add(model);
|
|
|
|
|
|
|
|
|
|
//Quantity1Sum += monethCount.Count();
|
|
|
|
|
//Quantity2Sum += AllList.Count();
|
|
|
|
|
//Quantity3Sum += yzCount.Count();
|
|
|
|
|
//Quantity4Sum += NoBackCount.Count();
|
|
|
|
|
i++;
|
|
|
|
|
}
|
|
|
|
|
gvFileReport.DataSource = list;
|
|
|
|
|
gvFileReport.DataBind();
|
|
|
|
|
|
|
|
|
|
//合计
|
|
|
|
|
JObject summary = new JObject();
|
|
|
|
|
summary.Add("ContentName", "合计");
|
|
|
|
|
summary.Add("MonthsCount", Quantity1Sum.ToString());
|
|
|
|
|
summary.Add("ProjectCount", Quantity2Sum.ToString());
|
|
|
|
|
summary.Add("MonthsBackCount", Quantity3Sum.ToString());
|
|
|
|
|
summary.Add("TotalNoBackCount", Quantity4Sum.ToString());
|
|
|
|
|
|
|
|
|
|
gvFileReport.SummaryData = summary;
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 18.本月质量问题处理情况
|
|
|
|
|
#region gvRowMaterialProblem 事件
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 增加原材料问题
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
protected void btnRowMaterialProblem_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
gvRowMaterialProblem.Hidden = false;
|
|
|
|
|
|
|
|
|
|
JArray teamGroupData = gvRowMaterialProblem.GetMergedData();
|
|
|
|
|
List<JObject> list = new List<JObject>();
|
|
|
|
|
foreach (JObject teamGroupRow in teamGroupData)
|
|
|
|
|
{
|
|
|
|
|
JObject values = teamGroupRow.Value<JObject>("values");
|
|
|
|
|
values.Add("Id", teamGroupRow.Value<string>("id"));
|
|
|
|
|
list.Add(values);
|
|
|
|
|
}
|
|
|
|
|
JObject defaultObj = new JObject
|
|
|
|
|
{ { "RowMaterialProblemId",Guid.NewGuid().ToString() },
|
|
|
|
|
{ "ReportId", ReportId },
|
|
|
|
|
{ "UnitId", "" },
|
|
|
|
|
{ "ProblemDesrioption",""},
|
|
|
|
|
{ "TreatmentMeasures", "" },
|
|
|
|
|
{ "ProcessingResults","" },
|
|
|
|
|
{ "Remark", "" },
|
|
|
|
|
{ "delRowMaterialProblem", String.Format("<a href=\"javascript:;\" onclick=\"{0}\"><img src=\"{1}\"/></a>", GetDeleteRowMaterialProblem(), IconHelper.GetResolvedIconUrl(Icon.Delete)) }
|
|
|
|
|
};
|
|
|
|
|
list.Add(defaultObj);
|
|
|
|
|
gvRowMaterialProblem.DataSource = list;
|
|
|
|
|
gvRowMaterialProblem.DataBind();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 绑定数据前事件
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
protected void gvRowMaterialProblem_PreDataBound(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
// 设置LinkButtonField的点击客户端事件
|
|
|
|
|
LinkButtonField deleteField = gvRowMaterialProblem.FindColumn("delRowMaterialProblem") as LinkButtonField;
|
|
|
|
|
deleteField.OnClientClick = GetDeleteRowMaterialProblem();
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 删除提示
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
private string GetDeleteRowMaterialProblem()
|
|
|
|
|
{
|
|
|
|
|
return Confirm.GetShowReference("删除选中行?", String.Empty, MessageBoxIcon.Question, gvRowMaterialProblem.GetDeleteSelectedRowsReference(), String.Empty);
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region gvConstructionProblems 事件
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 增加施工过程问题
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
protected void btnAddConstructionProblems_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
gvConstructionProblems.Hidden = false;
|
|
|
|
|
|
|
|
|
|
JArray teamGroupData = gvConstructionProblems.GetMergedData();
|
|
|
|
|
List<JObject> list = new List<JObject>();
|
|
|
|
|
foreach (JObject teamGroupRow in teamGroupData)
|
|
|
|
|
{
|
|
|
|
|
JObject values = teamGroupRow.Value<JObject>("values");
|
|
|
|
|
values.Add("Id", teamGroupRow.Value<string>("id"));
|
|
|
|
|
list.Add(values);
|
|
|
|
|
}
|
|
|
|
|
JObject defaultObj = new JObject
|
|
|
|
|
{ { "ConstructionProblemsId",Guid.NewGuid() },
|
|
|
|
|
{ "ReportId", ReportId },
|
|
|
|
|
{ "UnitId", "" },
|
|
|
|
|
{ "ProblemDesrioption",""},
|
|
|
|
|
{ "TreatmentMeasures", "" },
|
|
|
|
|
{ "ProcessingResults","" },
|
|
|
|
|
{ "Remark", "" },
|
|
|
|
|
{ "delConstructionProblems", String.Format("<a href=\"javascript:;\" onclick=\"{0}\"><img src=\"{1}\"/></a>", GetDeleteConstructionProblems(), IconHelper.GetResolvedIconUrl(Icon.Delete)) }
|
|
|
|
|
};
|
|
|
|
|
list.Add(defaultObj);
|
|
|
|
|
gvConstructionProblems.DataSource = list;
|
|
|
|
|
gvConstructionProblems.DataBind();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 绑定数据前事件
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
protected void gvConstructionProblems_PreDataBound(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
// 设置LinkButtonField的点击客户端事件
|
|
|
|
|
LinkButtonField deleteField = gvConstructionProblems.FindColumn("delConstructionProblems") as LinkButtonField;
|
|
|
|
|
deleteField.OnClientClick = GetDeleteConstructionProblems();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 删除提示
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
private string GetDeleteConstructionProblems()
|
|
|
|
|
{
|
|
|
|
|
return Confirm.GetShowReference("删除选中行?", String.Empty, MessageBoxIcon.Question, gvConstructionProblems.GetDeleteSelectedRowsReference(), String.Empty);
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 19.下月质量控制重点
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// gvNextQualityControl加载前事件
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
protected void gvNextQualityControl_PreDataBound(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
// 设置LinkButtonField的点击客户端事件
|
|
|
|
|
LinkButtonField deleteField = gvNextQualityControl.FindColumn("delNextQualityControl") as LinkButtonField;
|
|
|
|
|
deleteField.OnClientClick = GetDeleteNextQualityControl();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 增加
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
protected void btnAddNextControl_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
gvNextQualityControl.Hidden = false;
|
|
|
|
|
|
|
|
|
|
JArray teamGroupData = gvNextQualityControl.GetMergedData();
|
|
|
|
|
List<JObject> list = new List<JObject>();
|
|
|
|
|
foreach (JObject teamGroupRow in teamGroupData)
|
|
|
|
|
{
|
|
|
|
|
JObject values = teamGroupRow.Value<JObject>("values");
|
|
|
|
|
values.Add("Id", teamGroupRow.Value<string>("id"));
|
|
|
|
|
list.Add(values);
|
|
|
|
|
}
|
|
|
|
|
JObject defaultObj = new JObject
|
|
|
|
|
{ { "NextQualityControlId",Guid.NewGuid().ToString() },
|
|
|
|
|
{ "ReportId", ReportId },
|
|
|
|
|
{ "NextQualityControlContent", "" },
|
|
|
|
|
{ "delNextQualityControl", String.Format("<a href=\"javascript:;\" onclick=\"{0}\"><img src=\"{1}\"/></a>", GetDeleteNextQualityControl(), IconHelper.GetResolvedIconUrl(Icon.Delete)) }
|
|
|
|
|
};
|
|
|
|
|
list.Add(defaultObj);
|
|
|
|
|
gvNextQualityControl.DataSource = list;
|
|
|
|
|
gvNextQualityControl.DataBind();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 删除提示
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
private string GetDeleteNextQualityControl()
|
|
|
|
|
{
|
|
|
|
|
return Confirm.GetShowReference("删除选中行?", String.Empty, MessageBoxIcon.Question, gvNextQualityControl.GetDeleteSelectedRowsReference(), String.Empty);
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
2024-03-18 09:04:53 +08:00
|
|
|
|
#region 保存
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 保存按钮
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
protected void btnSave_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
Model.Report_WeekAndMonthReport_New report = new Model.Report_WeekAndMonthReport_New();
|
|
|
|
|
report.Id = ReportId;
|
|
|
|
|
report.ProjectId = this.CurrUser.LoginProjectId;
|
|
|
|
|
if (!string.IsNullOrEmpty(this.txtPeriod.Text.Trim()))
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
report.SortId = this.txtPeriod.Text.Trim();
|
|
|
|
|
}
|
|
|
|
|
catch (Exception)
|
|
|
|
|
{
|
|
|
|
|
ScriptManager.RegisterStartupScript(this, typeof(string), "_alert", "alert('周期输入格式不正确,请重新输入!')", true);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(this.txtStartDate.Text))
|
|
|
|
|
{
|
|
|
|
|
report.StartDate = Convert.ToDateTime(this.txtStartDate.Text);
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(this.txtEndDate.Text))
|
|
|
|
|
{
|
|
|
|
|
report.EndDate = Convert.ToDateTime(this.txtEndDate.Text);
|
|
|
|
|
}
|
|
|
|
|
report.CreateDate = DateTime.Now;
|
|
|
|
|
report.CreateMan = CurrUser.UserId;
|
|
|
|
|
|
|
|
|
|
#region 删除所有子表
|
|
|
|
|
//本月质量目标管理情况
|
|
|
|
|
CqmsTargetService.Delete(ReportId);
|
|
|
|
|
|
|
|
|
|
//所有文本框表
|
|
|
|
|
TextBoxContentService.Delete(ReportId);
|
2024-03-19 10:46:55 +08:00
|
|
|
|
|
|
|
|
|
//删除施工方案及检验试验计划审批情况
|
|
|
|
|
BLL.CQMS.ManageReport.ReportNew.ConstructionPlanService.Delete(ReportId);
|
2024-03-22 16:38:14 +08:00
|
|
|
|
|
|
|
|
|
// 15.质量巡检情况 16.质量专项检查情况 17.质量文件上报情况
|
|
|
|
|
BLL.Report_CQMS_MonthReportItemService.DeleteReportItemByReportId(ReportId);
|
|
|
|
|
//18.本月质量问题处理情况(1)原材料问题
|
|
|
|
|
BLL.RowMaterialProblemService.DeleteRowMaterialProbleByReportId(ReportId);
|
|
|
|
|
//18.本月质量问题处理情况(2)施工过程问题
|
|
|
|
|
BLL.ConstructionProblemsService.DeleteConstructionProblemsByReportId(ReportId);
|
|
|
|
|
//19.下月质量控制重点
|
|
|
|
|
BLL.NextQualityControlService.DeleteNextQualityControlByReportId(ReportId);
|
|
|
|
|
|
2024-03-18 09:04:53 +08:00
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 保存所有子表
|
|
|
|
|
//保存本月质量目标管理情况
|
|
|
|
|
saveTarget();
|
|
|
|
|
|
2024-03-19 10:46:55 +08:00
|
|
|
|
//保存3.1一般施工方案审批情况
|
|
|
|
|
saveYbsgfa();
|
|
|
|
|
|
|
|
|
|
//保存3.2危大工程方案审批情况
|
|
|
|
|
saveWdgcfa();
|
|
|
|
|
|
|
|
|
|
//保存3.2质量控制点或检验试验计划(ITP)情况
|
|
|
|
|
saveJysyjh();
|
|
|
|
|
|
|
|
|
|
//保存4 设计交底管理情况
|
|
|
|
|
saveSjjd();
|
|
|
|
|
|
|
|
|
|
//保存4图纸会审管理情况
|
|
|
|
|
saveTzhs();
|
|
|
|
|
|
2024-03-20 10:59:25 +08:00
|
|
|
|
//保存7.2PQR/WPS报验情况
|
|
|
|
|
savePqrWps();
|
|
|
|
|
|
|
|
|
|
//保存8 设备材料报验管理情况
|
|
|
|
|
saveSbclBy();
|
|
|
|
|
|
2024-03-22 16:38:14 +08:00
|
|
|
|
//保存15.质量巡检情况
|
|
|
|
|
saveQualityInspection();
|
|
|
|
|
//保存16.质量专项检查情况
|
|
|
|
|
saveSpecialCheck();
|
|
|
|
|
//保存17.质量文件上报情况
|
|
|
|
|
saveFileReport();
|
|
|
|
|
//保存18.(1)原材料问题
|
|
|
|
|
saveRowMaterialProblem();
|
|
|
|
|
//保存18.(2)施工过程问题
|
|
|
|
|
saveConstructionProblems();
|
|
|
|
|
//保存19.下月质量控制重点
|
|
|
|
|
saveNextQualityControl();
|
|
|
|
|
|
2024-03-18 09:04:53 +08:00
|
|
|
|
//保存文本框
|
|
|
|
|
saveTxtContent();
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
if (AddOrUpdate == "add")
|
|
|
|
|
{
|
|
|
|
|
WeekAndMonthReportNewService.Insert(report);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
WeekAndMonthReportNewService.Update(report);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ShowNotify("编辑成功!", MessageBoxIcon.Success);
|
|
|
|
|
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#region 保存本月质量目标管理情况
|
2024-03-20 10:59:25 +08:00
|
|
|
|
void saveTarget()
|
|
|
|
|
{
|
2024-03-18 09:04:53 +08:00
|
|
|
|
List<Model.Report_CqmsTarget> detailLists = new List<Model.Report_CqmsTarget>();
|
|
|
|
|
JArray teamGroupData = Grid1.GetMergedData();
|
2024-03-20 10:59:25 +08:00
|
|
|
|
foreach (JObject teamGroupRow in teamGroupData)
|
|
|
|
|
{
|
2024-03-18 09:04:53 +08:00
|
|
|
|
JObject values = teamGroupRow.Value<JObject>("values");
|
|
|
|
|
int rowIndex = teamGroupRow.Value<int>("index");
|
|
|
|
|
Model.Report_CqmsTarget newDetail = new Model.Report_CqmsTarget
|
|
|
|
|
{
|
|
|
|
|
//Id = values.Value<string>("Id"),
|
|
|
|
|
ReportId = ReportId,
|
|
|
|
|
ProStage = values.Value<string>("ProStage"),
|
|
|
|
|
ProDescribe = values.Value<string>("ProDescribe"),
|
|
|
|
|
TargetValue = values.Value<string>("TargetValue"),
|
|
|
|
|
MonthPer = values.Value<string>("MonthPer"),
|
|
|
|
|
Remarks = values.Value<string>("Remarks"),
|
|
|
|
|
SortId = rowIndex + 1
|
|
|
|
|
};
|
|
|
|
|
if (Grid1.Rows[rowIndex].DataKeys.Length > 0)
|
|
|
|
|
{
|
|
|
|
|
newDetail.Id = Grid1.Rows[rowIndex].DataKeys[0].ToString();
|
|
|
|
|
}
|
|
|
|
|
detailLists.Add(newDetail);
|
|
|
|
|
}
|
2024-03-20 10:59:25 +08:00
|
|
|
|
if (detailLists.Count > 0)
|
2024-03-18 09:04:53 +08:00
|
|
|
|
{
|
|
|
|
|
Funs.DB.Report_CqmsTarget.InsertAllOnSubmit(detailLists);
|
|
|
|
|
Funs.DB.SubmitChanges();
|
|
|
|
|
}
|
2024-03-20 10:59:25 +08:00
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 保存PQR/WPS报验情况
|
|
|
|
|
void savePqrWps()
|
|
|
|
|
{
|
|
|
|
|
List<Model.Report_Construction_Plan> detailLists = new List<Model.Report_Construction_Plan>();
|
|
|
|
|
JArray teamGroupData = Grid9.GetMergedData();
|
|
|
|
|
foreach (JObject teamGroupRow in teamGroupData)
|
|
|
|
|
{
|
|
|
|
|
JObject values = teamGroupRow.Value<JObject>("values");
|
|
|
|
|
int rowIndex = teamGroupRow.Value<int>("index");
|
|
|
|
|
Model.Report_Construction_Plan newDetail = new Model.Report_Construction_Plan
|
|
|
|
|
{
|
|
|
|
|
//Id = values.Value<string>("Id"),
|
|
|
|
|
ReportId = ReportId,
|
|
|
|
|
ReType = "5",
|
|
|
|
|
UnitOrMajor = values.Value<string>("UnitOrMajor"),
|
|
|
|
|
Quantity1 = values.Value<int>("Quantity1"),
|
|
|
|
|
Quantity2 = values.Value<int>("Quantity2"),
|
|
|
|
|
Remarks = values.Value<string>("Remarks"),
|
|
|
|
|
};
|
|
|
|
|
if (Grid9.Rows[rowIndex].DataKeys.Length > 0)
|
|
|
|
|
{
|
|
|
|
|
newDetail.Id = Grid9.Rows[rowIndex].DataKeys[0].ToString();
|
|
|
|
|
}
|
|
|
|
|
detailLists.Add(newDetail);
|
|
|
|
|
}
|
|
|
|
|
if (detailLists.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
Funs.DB.Report_Construction_Plan.InsertAllOnSubmit(detailLists);
|
|
|
|
|
Funs.DB.SubmitChanges();
|
|
|
|
|
}
|
2024-03-18 09:04:53 +08:00
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
2024-03-19 10:46:55 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// 3.1保存一般施工方案审批情况
|
|
|
|
|
/// </summary>
|
2024-03-20 10:59:25 +08:00
|
|
|
|
void saveYbsgfa()
|
|
|
|
|
{
|
2024-03-19 10:46:55 +08:00
|
|
|
|
List<Model.Report_Construction_Plan> detailLists = new List<Model.Report_Construction_Plan>();
|
|
|
|
|
JArray teamGroupData = Grid2.GetMergedData();
|
|
|
|
|
foreach (JObject teamGroupRow in teamGroupData)
|
|
|
|
|
{
|
|
|
|
|
JObject values = teamGroupRow.Value<JObject>("values");
|
|
|
|
|
int rowIndex = teamGroupRow.Value<int>("index");
|
|
|
|
|
Model.Report_Construction_Plan newDetail = new Model.Report_Construction_Plan
|
|
|
|
|
{
|
|
|
|
|
//Id = values.Value<string>("Id"),
|
|
|
|
|
ReportId = ReportId,
|
|
|
|
|
ReType = "0",
|
|
|
|
|
UnitOrMajor = values.Value<string>("UnitOrMajor"),
|
|
|
|
|
Quantity1 = values.Value<int>("Quantity1"),
|
|
|
|
|
Quantity2 = values.Value<int>("Quantity2"),
|
|
|
|
|
Remarks = values.Value<string>("Remarks")
|
|
|
|
|
};
|
|
|
|
|
if (Grid2.Rows[rowIndex].DataKeys.Length > 0)
|
|
|
|
|
{
|
|
|
|
|
newDetail.Id = Grid2.Rows[rowIndex].DataKeys[0].ToString();
|
|
|
|
|
}
|
|
|
|
|
detailLists.Add(newDetail);
|
|
|
|
|
}
|
|
|
|
|
if (detailLists.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
Funs.DB.Report_Construction_Plan.InsertAllOnSubmit(detailLists);
|
|
|
|
|
Funs.DB.SubmitChanges();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 3.2保存危大工程方案审批情况
|
|
|
|
|
/// </summary>
|
2024-03-20 10:59:25 +08:00
|
|
|
|
void saveWdgcfa()
|
|
|
|
|
{
|
2024-03-19 10:46:55 +08:00
|
|
|
|
List<Model.Report_Construction_Plan> detailLists = new List<Model.Report_Construction_Plan>();
|
|
|
|
|
JArray teamGroupData = Grid3.GetMergedData();
|
|
|
|
|
foreach (JObject teamGroupRow in teamGroupData)
|
|
|
|
|
{
|
|
|
|
|
JObject values = teamGroupRow.Value<JObject>("values");
|
|
|
|
|
int rowIndex = teamGroupRow.Value<int>("index");
|
|
|
|
|
Model.Report_Construction_Plan newDetail = new Model.Report_Construction_Plan
|
|
|
|
|
{
|
|
|
|
|
//Id = values.Value<string>("Id"),
|
|
|
|
|
ReportId = ReportId,
|
|
|
|
|
ReType = "1",
|
|
|
|
|
UnitOrMajor = values.Value<string>("UnitOrMajor"),
|
|
|
|
|
Quantity1 = values.Value<int>("Quantity1"),
|
|
|
|
|
Quantity2 = values.Value<int>("Quantity2"),
|
|
|
|
|
Quantity3 = values.Value<int>("Quantity3"),
|
|
|
|
|
Remarks = values.Value<string>("Remarks")
|
|
|
|
|
};
|
|
|
|
|
if (Grid3.Rows[rowIndex].DataKeys.Length > 0)
|
|
|
|
|
{
|
|
|
|
|
newDetail.Id = Grid3.Rows[rowIndex].DataKeys[0].ToString();
|
|
|
|
|
}
|
|
|
|
|
detailLists.Add(newDetail);
|
|
|
|
|
}
|
|
|
|
|
if (detailLists.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
Funs.DB.Report_Construction_Plan.InsertAllOnSubmit(detailLists);
|
|
|
|
|
Funs.DB.SubmitChanges();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 3.3 质量控制点或检验试验计划(ITP)情况
|
|
|
|
|
/// </summary>
|
2024-03-20 10:59:25 +08:00
|
|
|
|
void saveJysyjh()
|
|
|
|
|
{
|
2024-03-19 10:46:55 +08:00
|
|
|
|
List<Model.Report_Construction_Plan> detailLists = new List<Model.Report_Construction_Plan>();
|
|
|
|
|
JArray teamGroupData = Grid4.GetMergedData();
|
|
|
|
|
foreach (JObject teamGroupRow in teamGroupData)
|
|
|
|
|
{
|
|
|
|
|
JObject values = teamGroupRow.Value<JObject>("values");
|
|
|
|
|
int rowIndex = teamGroupRow.Value<int>("index");
|
|
|
|
|
Model.Report_Construction_Plan newDetail = new Model.Report_Construction_Plan
|
|
|
|
|
{
|
|
|
|
|
//Id = values.Value<string>("Id"),
|
|
|
|
|
ReportId = ReportId,
|
|
|
|
|
ReType = "2",
|
|
|
|
|
UnitOrMajor = values.Value<string>("UnitOrMajor"),
|
|
|
|
|
Quantity1 = values.Value<int>("Quantity1"),
|
|
|
|
|
Quantity2 = values.Value<int>("Quantity2"),
|
|
|
|
|
Remarks = values.Value<string>("Remarks")
|
|
|
|
|
};
|
|
|
|
|
if (Grid4.Rows[rowIndex].DataKeys.Length > 0)
|
|
|
|
|
{
|
|
|
|
|
newDetail.Id = Grid4.Rows[rowIndex].DataKeys[0].ToString();
|
|
|
|
|
}
|
|
|
|
|
detailLists.Add(newDetail);
|
|
|
|
|
}
|
|
|
|
|
if (detailLists.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
Funs.DB.Report_Construction_Plan.InsertAllOnSubmit(detailLists);
|
|
|
|
|
Funs.DB.SubmitChanges();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 保存设计交底管理情况
|
|
|
|
|
/// </summary>
|
2024-03-20 10:59:25 +08:00
|
|
|
|
void saveSjjd()
|
|
|
|
|
{
|
2024-03-19 10:46:55 +08:00
|
|
|
|
List<Model.Report_Construction_Plan> detailLists = new List<Model.Report_Construction_Plan>();
|
|
|
|
|
JArray teamGroupData = Grid5.GetMergedData();
|
|
|
|
|
foreach (JObject teamGroupRow in teamGroupData)
|
|
|
|
|
{
|
|
|
|
|
JObject values = teamGroupRow.Value<JObject>("values");
|
|
|
|
|
int rowIndex = teamGroupRow.Value<int>("index");
|
|
|
|
|
Model.Report_Construction_Plan newDetail = new Model.Report_Construction_Plan
|
|
|
|
|
{
|
|
|
|
|
//Id = values.Value<string>("Id"),
|
|
|
|
|
ReportId = ReportId,
|
|
|
|
|
ReType = "3",
|
|
|
|
|
UnitOrMajor = values.Value<string>("UnitOrMajor"),
|
|
|
|
|
Quantity1 = values.Value<int>("Quantity1"),
|
|
|
|
|
Quantity2 = values.Value<int>("Quantity2"),
|
|
|
|
|
Remarks = values.Value<string>("Remarks")
|
|
|
|
|
};
|
|
|
|
|
if (Grid5.Rows[rowIndex].DataKeys.Length > 0)
|
|
|
|
|
{
|
|
|
|
|
newDetail.Id = Grid5.Rows[rowIndex].DataKeys[0].ToString();
|
|
|
|
|
}
|
|
|
|
|
detailLists.Add(newDetail);
|
|
|
|
|
}
|
|
|
|
|
if (detailLists.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
Funs.DB.Report_Construction_Plan.InsertAllOnSubmit(detailLists);
|
|
|
|
|
Funs.DB.SubmitChanges();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 保存图纸会审
|
|
|
|
|
/// </summary>
|
2024-03-20 10:59:25 +08:00
|
|
|
|
void saveTzhs()
|
|
|
|
|
{
|
2024-03-19 10:46:55 +08:00
|
|
|
|
List<Model.Report_Construction_Plan> detailLists = new List<Model.Report_Construction_Plan>();
|
|
|
|
|
JArray teamGroupData = Grid6.GetMergedData();
|
|
|
|
|
foreach (JObject teamGroupRow in teamGroupData)
|
|
|
|
|
{
|
|
|
|
|
JObject values = teamGroupRow.Value<JObject>("values");
|
|
|
|
|
int rowIndex = teamGroupRow.Value<int>("index");
|
|
|
|
|
Model.Report_Construction_Plan newDetail = new Model.Report_Construction_Plan
|
|
|
|
|
{
|
|
|
|
|
//Id = values.Value<string>("Id"),
|
|
|
|
|
ReportId = ReportId,
|
|
|
|
|
ReType = "4",
|
|
|
|
|
UnitOrMajor = values.Value<string>("UnitOrMajor"),
|
|
|
|
|
Quantity1 = values.Value<int>("Quantity1"),
|
|
|
|
|
Quantity2 = values.Value<int>("Quantity2"),
|
|
|
|
|
Remarks = values.Value<string>("Remarks")
|
|
|
|
|
};
|
|
|
|
|
if (Grid6.Rows[rowIndex].DataKeys.Length > 0)
|
|
|
|
|
{
|
|
|
|
|
newDetail.Id = Grid6.Rows[rowIndex].DataKeys[0].ToString();
|
|
|
|
|
}
|
|
|
|
|
detailLists.Add(newDetail);
|
|
|
|
|
}
|
|
|
|
|
if (detailLists.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
Funs.DB.Report_Construction_Plan.InsertAllOnSubmit(detailLists);
|
|
|
|
|
Funs.DB.SubmitChanges();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-03-20 10:59:25 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// 保存设备材料报验管理情况
|
|
|
|
|
/// </summary>
|
|
|
|
|
void saveSbclBy()
|
|
|
|
|
{
|
|
|
|
|
List<Model.Report_Construction_Plan> detailLists = new List<Model.Report_Construction_Plan>();
|
|
|
|
|
JArray teamGroupData = Grid11.GetMergedData();
|
|
|
|
|
foreach (JObject teamGroupRow in teamGroupData)
|
|
|
|
|
{
|
|
|
|
|
JObject values = teamGroupRow.Value<JObject>("values");
|
|
|
|
|
int rowIndex = teamGroupRow.Value<int>("index");
|
|
|
|
|
Model.Report_Construction_Plan newDetail = new Model.Report_Construction_Plan
|
|
|
|
|
{
|
|
|
|
|
//Id = values.Value<string>("Id"),
|
|
|
|
|
ReportId = ReportId,
|
|
|
|
|
ReType = "6",
|
|
|
|
|
UnitOrMajor = values.Value<string>("UnitOrMajor"),
|
|
|
|
|
Quantity1 = values.Value<int>("Quantity1"),
|
|
|
|
|
Quantity2 = values.Value<int>("Quantity2"),
|
|
|
|
|
QuaRate = values.Value<string>("QuaRate"),
|
|
|
|
|
Remarks = values.Value<string>("Remarks")
|
|
|
|
|
};
|
|
|
|
|
if (Grid11.Rows[rowIndex].DataKeys.Length > 0)
|
|
|
|
|
{
|
|
|
|
|
newDetail.Id = Grid11.Rows[rowIndex].DataKeys[0].ToString();
|
|
|
|
|
}
|
|
|
|
|
detailLists.Add(newDetail);
|
|
|
|
|
}
|
|
|
|
|
if (detailLists.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
Funs.DB.Report_Construction_Plan.InsertAllOnSubmit(detailLists);
|
|
|
|
|
Funs.DB.SubmitChanges();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-03-18 09:04:53 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// 保存文本框内容
|
|
|
|
|
/// </summary>
|
2024-03-20 10:59:25 +08:00
|
|
|
|
void saveTxtContent()
|
|
|
|
|
{
|
2024-03-18 09:04:53 +08:00
|
|
|
|
var txtContentList = new List<Model.Report_TextBoxContent>();
|
|
|
|
|
#region 给实体赋值
|
|
|
|
|
var model0 = new Model.Report_TextBoxContent();
|
|
|
|
|
model0.Id = Guid.NewGuid().ToString();
|
|
|
|
|
model0.ReportId = ReportId;
|
|
|
|
|
model0.ContentType = "0";
|
|
|
|
|
model0.ContentText = txtAre0.Text;
|
|
|
|
|
txtContentList.Add(model0);
|
|
|
|
|
|
|
|
|
|
var model1 = new Model.Report_TextBoxContent();
|
|
|
|
|
model1.Id = Guid.NewGuid().ToString();
|
|
|
|
|
model1.ReportId = ReportId;
|
|
|
|
|
model1.ContentType = "1";
|
|
|
|
|
model1.ContentText = txtAre1.Text;
|
|
|
|
|
txtContentList.Add(model1);
|
|
|
|
|
|
|
|
|
|
var model2 = new Model.Report_TextBoxContent();
|
|
|
|
|
model2.Id = Guid.NewGuid().ToString();
|
|
|
|
|
model2.ReportId = ReportId;
|
|
|
|
|
model2.ContentType = "2";
|
|
|
|
|
model2.ContentText = txtAre2.Text;
|
|
|
|
|
txtContentList.Add(model2);
|
|
|
|
|
|
|
|
|
|
var model20 = new Model.Report_TextBoxContent();
|
|
|
|
|
model20.Id = Guid.NewGuid().ToString();
|
|
|
|
|
model20.ReportId = ReportId;
|
|
|
|
|
model20.ContentType = "20";
|
|
|
|
|
model20.ContentText = txtAre20.Text;
|
|
|
|
|
txtContentList.Add(model20);
|
|
|
|
|
|
|
|
|
|
var model21 = new Model.Report_TextBoxContent();
|
|
|
|
|
model21.Id = Guid.NewGuid().ToString();
|
|
|
|
|
model21.ReportId = ReportId;
|
|
|
|
|
model21.ContentType = "21";
|
|
|
|
|
model21.ContentText = txtAre21.Text;
|
|
|
|
|
txtContentList.Add(model21);
|
|
|
|
|
|
|
|
|
|
var model22 = new Model.Report_TextBoxContent();
|
|
|
|
|
model22.Id = Guid.NewGuid().ToString();
|
|
|
|
|
model22.ReportId = ReportId;
|
|
|
|
|
model22.ContentType = "22";
|
|
|
|
|
model22.ContentText = txtAre22.Text;
|
|
|
|
|
txtContentList.Add(model22);
|
2024-03-20 10:59:25 +08:00
|
|
|
|
|
|
|
|
|
//如果8设备材料报验管理情况点击了增加按钮,则添加文本框内容
|
|
|
|
|
var model8 = new Model.Report_TextBoxContent();
|
|
|
|
|
model8.Id = Guid.NewGuid().ToString();
|
|
|
|
|
model8.ReportId = ReportId;
|
|
|
|
|
model8.ContentType = "8";
|
|
|
|
|
model8.ContentText = txtAre8.Text;
|
|
|
|
|
txtContentList.Add(model8);
|
2024-03-18 09:04:53 +08:00
|
|
|
|
#endregion
|
|
|
|
|
Funs.DB.Report_TextBoxContent.InsertAllOnSubmit(txtContentList);
|
|
|
|
|
Funs.DB.SubmitChanges();
|
|
|
|
|
}
|
|
|
|
|
|
2024-03-22 16:38:14 +08:00
|
|
|
|
#region 15.质量巡检情况
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 15.质量巡检情况
|
|
|
|
|
/// </summary>
|
|
|
|
|
void saveQualityInspection()
|
|
|
|
|
{
|
|
|
|
|
List<Model.Report_CQMS_MonthReportItem> detailLists = new List<Model.Report_CQMS_MonthReportItem>();
|
|
|
|
|
JArray teamGroupData = gvQualityInspection.GetMergedData();
|
|
|
|
|
foreach (JObject teamGroupRow in teamGroupData)
|
|
|
|
|
{
|
|
|
|
|
JObject values = teamGroupRow.Value<JObject>("values");
|
|
|
|
|
int rowIndex = teamGroupRow.Value<int>("index");
|
|
|
|
|
Model.Report_CQMS_MonthReportItem newDetail = new Model.Report_CQMS_MonthReportItem
|
|
|
|
|
{
|
|
|
|
|
ReportId = ReportId,
|
|
|
|
|
ReType = "1",
|
|
|
|
|
ContentName = values.Value<string>("ContentName"),
|
|
|
|
|
MonthsCount = values.Value<int>("MonthsCount"),
|
|
|
|
|
ProjectCount = values.Value<int>("ProjectCount"),
|
|
|
|
|
RectificationRate = values.Value<string>("RectificationRate"),
|
|
|
|
|
Remarks = values.Value<string>("Remarks")
|
|
|
|
|
};
|
|
|
|
|
if (gvQualityInspection.Rows[rowIndex].DataKeys.Length > 0)
|
|
|
|
|
{
|
|
|
|
|
newDetail.Id = gvQualityInspection.Rows[rowIndex].DataKeys[0].ToString();
|
|
|
|
|
}
|
|
|
|
|
detailLists.Add(newDetail);
|
|
|
|
|
}
|
|
|
|
|
if (detailLists.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
Funs.DB.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists);
|
|
|
|
|
Funs.DB.SubmitChanges();
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-03-18 09:04:53 +08:00
|
|
|
|
#endregion
|
|
|
|
|
|
2024-03-22 16:38:14 +08:00
|
|
|
|
#region 16.质量专项检查情况
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 16.质量专项检查情况
|
|
|
|
|
/// </summary>
|
|
|
|
|
void saveSpecialCheck()
|
|
|
|
|
{
|
|
|
|
|
List<Model.Report_CQMS_MonthReportItem> detailLists = new List<Model.Report_CQMS_MonthReportItem>();
|
|
|
|
|
JArray teamGroupData = gvSpecialCheck.GetMergedData();
|
|
|
|
|
foreach (JObject teamGroupRow in teamGroupData)
|
|
|
|
|
{
|
|
|
|
|
JObject values = teamGroupRow.Value<JObject>("values");
|
|
|
|
|
int rowIndex = teamGroupRow.Value<int>("index");
|
|
|
|
|
Model.Report_CQMS_MonthReportItem newDetail = new Model.Report_CQMS_MonthReportItem
|
|
|
|
|
{
|
|
|
|
|
ReportId = ReportId,
|
|
|
|
|
ReType = "2",
|
|
|
|
|
ContentName = values.Value<string>("ContentName"),
|
|
|
|
|
MonthsCount = values.Value<int>("MonthsCount"),
|
|
|
|
|
ProjectCount = values.Value<int>("ProjectCount"),
|
|
|
|
|
Remarks = values.Value<string>("Remarks")
|
|
|
|
|
};
|
|
|
|
|
if (gvSpecialCheck.Rows[rowIndex].DataKeys.Length > 0)
|
|
|
|
|
{
|
|
|
|
|
newDetail.Id = gvSpecialCheck.Rows[rowIndex].DataKeys[0].ToString();
|
|
|
|
|
}
|
|
|
|
|
detailLists.Add(newDetail);
|
|
|
|
|
}
|
|
|
|
|
if (detailLists.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
Funs.DB.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists);
|
|
|
|
|
Funs.DB.SubmitChanges();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 17.质量文件上报情况
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 17.质量文件上报情况
|
|
|
|
|
/// </summary>
|
|
|
|
|
void saveFileReport()
|
|
|
|
|
{
|
|
|
|
|
List<Model.Report_CQMS_MonthReportItem> detailLists = new List<Model.Report_CQMS_MonthReportItem>();
|
|
|
|
|
JArray teamGroupData = gvFileReport.GetMergedData();
|
|
|
|
|
foreach (JObject teamGroupRow in teamGroupData)
|
|
|
|
|
{
|
|
|
|
|
JObject values = teamGroupRow.Value<JObject>("values");
|
|
|
|
|
int rowIndex = teamGroupRow.Value<int>("index");
|
|
|
|
|
Model.Report_CQMS_MonthReportItem newDetail = new Model.Report_CQMS_MonthReportItem
|
|
|
|
|
{
|
|
|
|
|
ReportId = ReportId,
|
|
|
|
|
ReType = "3",
|
|
|
|
|
ContentName = values.Value<string>("ContentName"),
|
|
|
|
|
//MonthsCount = Funs.GetNewInt(values.Value<int>("MonthsCount").ToString()),
|
|
|
|
|
//ProjectCount = Funs.GetNewInt(values.Value<int>("ProjectCount").ToString()),
|
|
|
|
|
//MonthsBackCount = Funs.GetNewInt(values.Value<int>("MonthsBackCount").ToString()),
|
|
|
|
|
//TotalNoBackCount = Funs.GetNewInt(values.Value<int>("TotalNoBackCount").ToString())
|
|
|
|
|
};
|
|
|
|
|
if (gvFileReport.Rows[rowIndex].DataKeys.Length > 0)
|
|
|
|
|
{
|
|
|
|
|
newDetail.Id = gvFileReport.Rows[rowIndex].DataKeys[0].ToString();
|
|
|
|
|
}
|
|
|
|
|
detailLists.Add(newDetail);
|
|
|
|
|
}
|
|
|
|
|
if (detailLists.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
Funs.DB.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists);
|
|
|
|
|
Funs.DB.SubmitChanges();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 18.本月质量问题处理情况
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// (1)原材料问题
|
|
|
|
|
/// </summary>
|
|
|
|
|
void saveRowMaterialProblem()
|
|
|
|
|
{
|
|
|
|
|
List<Model.Report_RowMaterialProblem> detailLists = new List<Model.Report_RowMaterialProblem>();
|
|
|
|
|
JArray teamGroupData = gvRowMaterialProblem.GetMergedData();
|
|
|
|
|
foreach (JObject teamGroupRow in teamGroupData)
|
|
|
|
|
{
|
|
|
|
|
JObject values = teamGroupRow.Value<JObject>("values");
|
|
|
|
|
int rowIndex = teamGroupRow.Value<int>("index");
|
|
|
|
|
Model.Report_RowMaterialProblem newDetail = new Model.Report_RowMaterialProblem
|
|
|
|
|
{
|
|
|
|
|
ReportId = ReportId,
|
|
|
|
|
UnitId = values.Value<string>("UnitId"),
|
|
|
|
|
ProblemDesrioption = values.Value<string>("ProblemDesrioption"),
|
|
|
|
|
TreatmentMeasures = values.Value<string>("TreatmentMeasures"),
|
|
|
|
|
ProcessingResults = values.Value<string>("ProcessingResults"),
|
|
|
|
|
Remark = values.Value<string>("Remark")
|
|
|
|
|
};
|
|
|
|
|
if (gvRowMaterialProblem.Rows[rowIndex].DataKeys.Length > 0)
|
|
|
|
|
{
|
|
|
|
|
newDetail.RowMaterialProblemId = gvRowMaterialProblem.Rows[rowIndex].DataKeys[0].ToString();
|
|
|
|
|
}
|
|
|
|
|
detailLists.Add(newDetail);
|
|
|
|
|
}
|
|
|
|
|
if (detailLists.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
Funs.DB.Report_RowMaterialProblem.InsertAllOnSubmit(detailLists);
|
|
|
|
|
Funs.DB.SubmitChanges();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// (2)施工过程问题
|
|
|
|
|
/// </summary>
|
|
|
|
|
void saveConstructionProblems()
|
|
|
|
|
{
|
|
|
|
|
List<Model.Report_ConstructionProblems> detailLists = new List<Model.Report_ConstructionProblems>();
|
|
|
|
|
JArray teamGroupData = gvConstructionProblems.GetMergedData();
|
|
|
|
|
foreach (JObject teamGroupRow in teamGroupData)
|
|
|
|
|
{
|
|
|
|
|
JObject values = teamGroupRow.Value<JObject>("values");
|
|
|
|
|
int rowIndex = teamGroupRow.Value<int>("index");
|
|
|
|
|
Model.Report_ConstructionProblems newDetail = new Model.Report_ConstructionProblems
|
|
|
|
|
{
|
|
|
|
|
ReportId = ReportId,
|
|
|
|
|
UnitId = values.Value<string>("UnitId"),
|
|
|
|
|
ProblemDesrioption = values.Value<string>("ProblemDesrioption"),
|
|
|
|
|
TreatmentMeasures = values.Value<string>("TreatmentMeasures"),
|
|
|
|
|
ProcessingResults = values.Value<string>("ProcessingResults"),
|
|
|
|
|
Remark = values.Value<string>("Remark")
|
|
|
|
|
};
|
|
|
|
|
if (gvConstructionProblems.Rows[rowIndex].DataKeys.Length > 0)
|
|
|
|
|
{
|
|
|
|
|
newDetail.ConstructionProblemsId = gvConstructionProblems.Rows[rowIndex].DataKeys[0].ToString();
|
|
|
|
|
}
|
|
|
|
|
detailLists.Add(newDetail);
|
|
|
|
|
}
|
|
|
|
|
if (detailLists.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
Funs.DB.Report_ConstructionProblems.InsertAllOnSubmit(detailLists);
|
|
|
|
|
Funs.DB.SubmitChanges();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 19.下月质量控制重点
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 下月质量控制重点
|
|
|
|
|
/// </summary>
|
|
|
|
|
void saveNextQualityControl()
|
|
|
|
|
{
|
|
|
|
|
List<Model.Report_NextQualityControl> detailLists = new List<Model.Report_NextQualityControl>();
|
|
|
|
|
JArray teamGroupData = gvNextQualityControl.GetMergedData();
|
|
|
|
|
foreach (JObject teamGroupRow in teamGroupData)
|
|
|
|
|
{
|
|
|
|
|
JObject values = teamGroupRow.Value<JObject>("values");
|
|
|
|
|
int rowIndex = teamGroupRow.Value<int>("index");
|
|
|
|
|
Model.Report_NextQualityControl newDetail = new Model.Report_NextQualityControl
|
|
|
|
|
{
|
|
|
|
|
ReportId = ReportId,
|
|
|
|
|
NextQualityControlContent = values.Value<string>("NextQualityControlContent")
|
|
|
|
|
};
|
|
|
|
|
if (gvNextQualityControl.Rows[rowIndex].DataKeys.Length > 0)
|
|
|
|
|
{
|
|
|
|
|
newDetail.NextQualityControlId = gvNextQualityControl.Rows[rowIndex].DataKeys[0].ToString();
|
|
|
|
|
}
|
|
|
|
|
detailLists.Add(newDetail);
|
|
|
|
|
}
|
|
|
|
|
if (detailLists.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
Funs.DB.Report_NextQualityControl.InsertAllOnSubmit(detailLists);
|
|
|
|
|
Funs.DB.SubmitChanges();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-03-18 09:04:53 +08:00
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|