提交代码
This commit is contained in:
@@ -45,6 +45,7 @@
|
||||
</f:Label>
|
||||
<f:ToolbarFill ID="ToolbarFill1" runat="server">
|
||||
</f:ToolbarFill>
|
||||
<f:Button ID="BtnAnalyse2" Text="按焊工统计" Icon="ChartPie" runat="server" Hidden="true" OnClick="BtnAnalyse2_Click"></f:Button>
|
||||
<f:Button ID="BtnAnalyse" Text="统计" Icon="ChartPie" runat="server" OnClick="BtnAnalyse_Click"></f:Button>
|
||||
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" Text="导出" Icon="TableGo"
|
||||
EnableAjax="false" DisableControlBeforePostBack="false">
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
using System.Text;
|
||||
using BLL;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Linq;
|
||||
using AspNet = System.Web.UI.WebControls;
|
||||
|
||||
public partial class WelderPerformance : PageBase
|
||||
@@ -74,50 +75,119 @@
|
||||
string filmPassRate = "";
|
||||
string jointPassRate = "";
|
||||
|
||||
foreach (DataRow row in tb.Rows)
|
||||
{
|
||||
totalSize += Convert.ToDouble(row["totalSize"]);
|
||||
totalJoint += Convert.ToInt32(row["totalJoint"]);
|
||||
JointNum1 += Convert.ToInt32(row["JointNum1"]);
|
||||
totalfilm += Convert.ToInt32(row["totalfilm"]);
|
||||
JointPassNum1 += Convert.ToInt32(row["JointPassNum1"]);
|
||||
totalPassfilm += Convert.ToInt32(row["totalPassfilm"]);
|
||||
//foreach (DataRow row in tb.Rows)
|
||||
//{
|
||||
// totalSize += Convert.ToDouble(row["totalSize"]);
|
||||
// totalJoint += Convert.ToInt32(row["totalJoint"]);
|
||||
// JointNum1 += Convert.ToInt32(row["JointNum1"]);
|
||||
// totalfilm += Convert.ToInt32(row["totalfilm"]);
|
||||
// JointPassNum1 += Convert.ToInt32(row["JointPassNum1"]);
|
||||
// totalPassfilm += Convert.ToInt32(row["totalPassfilm"]);
|
||||
|
||||
RepairJoint1 += Convert.ToInt32(row["RepairJoint1"]);
|
||||
repairFilm1 += Convert.ToInt32(row["repairFilm1"]);
|
||||
RepairJoint2 += Convert.ToInt32(row["RepairJoint2"]);
|
||||
repairFilm2 += Convert.ToInt32(row["repairFilm2"]);
|
||||
RepairJoint3 += Convert.ToInt32(row["RepairJoint3"]);
|
||||
repairFilm3 += Convert.ToInt32(row["repairFilm3"]);
|
||||
}
|
||||
if (totalfilm != 0)
|
||||
// RepairJoint1 += Convert.ToInt32(row["RepairJoint1"]);
|
||||
// repairFilm1 += Convert.ToInt32(row["repairFilm1"]);
|
||||
// RepairJoint2 += Convert.ToInt32(row["RepairJoint2"]);
|
||||
// repairFilm2 += Convert.ToInt32(row["repairFilm2"]);
|
||||
// RepairJoint3 += Convert.ToInt32(row["RepairJoint3"]);
|
||||
// repairFilm3 += Convert.ToInt32(row["repairFilm3"]);
|
||||
//}
|
||||
//if (totalfilm != 0)
|
||||
//{
|
||||
// filmPassRate = (totalPassfilm * 100.0 / totalfilm * 1.0).ToString("0.00") + "%";
|
||||
//}
|
||||
//if (JointNum1 != 0)
|
||||
//{
|
||||
// jointPassRate = (JointPassNum1 * 100.0 / JointNum1 * 1.0).ToString("0.00") + "%";
|
||||
//}
|
||||
string projectIds = String.Join(",", drpProject.SelectedValueArray);
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
|
||||
if (this.drpIns.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
filmPassRate = (totalPassfilm * 100.0 / totalfilm * 1.0).ToString("0.00") + "%";
|
||||
listStr.Add(new SqlParameter("@installationId", this.drpIns.SelectedValue));
|
||||
}
|
||||
if (JointNum1 != 0)
|
||||
else
|
||||
{
|
||||
jointPassRate = (JointPassNum1 * 100.0 / JointNum1 * 1.0).ToString("0.00") + "%";
|
||||
listStr.Add(new SqlParameter("@installationId", null));
|
||||
}
|
||||
|
||||
JObject summary = new JObject();
|
||||
summary.Add("tfNumber", "合计");
|
||||
summary.Add("totalJoint", totalJoint.ToString());
|
||||
summary.Add("totalSize", totalSize.ToString("F2"));
|
||||
summary.Add("JointNum1", JointNum1.ToString());
|
||||
summary.Add("totalfilm", totalfilm.ToString());
|
||||
summary.Add("JointPassNum1", JointPassNum1.ToString());
|
||||
summary.Add("totalPassfilm", totalPassfilm.ToString());
|
||||
if (this.drpUnit.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
listStr.Add(new SqlParameter("@unitcode", this.drpUnit.SelectedValue));
|
||||
}
|
||||
else
|
||||
{
|
||||
listStr.Add(new SqlParameter("@unitcode", null));
|
||||
}
|
||||
|
||||
summary.Add("RepairJoint1", RepairJoint1.ToString());
|
||||
summary.Add("repairFilm1", repairFilm1.ToString());
|
||||
summary.Add("RepairJoint2", RepairJoint2.ToString());
|
||||
summary.Add("repairFilm2", repairFilm2.ToString());
|
||||
summary.Add("RepairJoint3", RepairJoint3.ToString());
|
||||
summary.Add("repairFilm3", repairFilm3.ToString());
|
||||
summary.Add("JointPassRate", jointPassRate.ToString());
|
||||
summary.Add("JointFilmPassRate", filmPassRate.ToString());
|
||||
if (this.drpSteel.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
listStr.Add(new SqlParameter("@steel", this.drpSteel.SelectedValue));
|
||||
}
|
||||
else
|
||||
{
|
||||
listStr.Add(new SqlParameter("@steel", null));
|
||||
}
|
||||
if (this.drpWloName.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
listStr.Add(new SqlParameter("@WED_ID", this.drpWloName.SelectedValue));
|
||||
}
|
||||
else
|
||||
{
|
||||
listStr.Add(new SqlParameter("@WED_ID", null));
|
||||
}
|
||||
|
||||
Grid1.SummaryData = summary;
|
||||
if (!string.IsNullOrEmpty(this.txtStarTime.Text))
|
||||
{
|
||||
listStr.Add(new SqlParameter("@date1", Convert.ToDateTime(this.txtStarTime.Text)));
|
||||
}
|
||||
else
|
||||
{
|
||||
listStr.Add(new SqlParameter("@date1", null));
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(this.txtEndTime.Text))
|
||||
{
|
||||
listStr.Add(new SqlParameter("@date2", Convert.ToDateTime(this.txtEndTime.Text).AddDays(1)));
|
||||
}
|
||||
else
|
||||
{
|
||||
listStr.Add(new SqlParameter("@date2", null));
|
||||
}
|
||||
|
||||
if (this.drpProject.SelectedValueArray.Length > 0 && this.drpProject.SelectedValueArray[0] != BLL.Const._Null)
|
||||
{
|
||||
listStr.Add(new SqlParameter("@projectId", projectIds));
|
||||
}
|
||||
else
|
||||
{
|
||||
listStr.Add(new SqlParameter("@projectId", null));
|
||||
}
|
||||
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tbSum = SQLHelper.GetDataTableRunProc("HJGL_sp_rpt_welderPerformanceSum", parameter);
|
||||
if (tbSum.Rows.Count > 0)
|
||||
{
|
||||
JObject summary = new JObject();
|
||||
summary.Add("tfNumber", "合计");
|
||||
summary.Add("totalJoint", tbSum.Rows[0]["totalJoint"].ToString());
|
||||
summary.Add("totalSize", tbSum.Rows[0]["totalSize"].ToString());
|
||||
summary.Add("JointNum1", tbSum.Rows[0]["JointNum1"].ToString());
|
||||
summary.Add("totalfilm", tbSum.Rows[0]["totalfilm"].ToString());
|
||||
summary.Add("JointPassNum1", tbSum.Rows[0]["JointPassNum1"].ToString());
|
||||
summary.Add("totalPassfilm", tbSum.Rows[0]["totalPassfilm"].ToString());
|
||||
|
||||
summary.Add("RepairJoint1", tbSum.Rows[0]["RepairJoint1"].ToString());
|
||||
summary.Add("repairFilm1", tbSum.Rows[0]["repairFilm1"].ToString());
|
||||
summary.Add("RepairJoint2", tbSum.Rows[0]["RepairJoint2"].ToString());
|
||||
summary.Add("repairFilm2", tbSum.Rows[0]["repairFilm2"].ToString());
|
||||
summary.Add("RepairJoint3", tbSum.Rows[0]["RepairJoint3"].ToString());
|
||||
summary.Add("repairFilm3", tbSum.Rows[0]["repairFilm3"].ToString());
|
||||
summary.Add("JointPassRate", (Funs.GetNewDecimalOrZero(tbSum.Rows[0]["JointPassRate"].ToString()) * 100).ToString("0.00") + "%");
|
||||
summary.Add("JointFilmPassRate", (Funs.GetNewDecimalOrZero(tbSum.Rows[0]["JointFilmPassRate"].ToString()) * 100).ToString("0.00") + "%");
|
||||
|
||||
Grid1.SummaryData = summary;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -207,6 +277,84 @@
|
||||
Grid1.DataBind();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 绑定数据
|
||||
/// </summary>
|
||||
private void BindGrid2()
|
||||
{
|
||||
string projectIds = String.Join(",", drpProject.SelectedValueArray);
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
|
||||
if (this.drpIns.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
listStr.Add(new SqlParameter("@installationId", this.drpIns.SelectedValue));
|
||||
}
|
||||
else
|
||||
{
|
||||
listStr.Add(new SqlParameter("@installationId", null));
|
||||
}
|
||||
|
||||
if (this.drpUnit.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
listStr.Add(new SqlParameter("@unitcode", this.drpUnit.SelectedValue));
|
||||
}
|
||||
else
|
||||
{
|
||||
listStr.Add(new SqlParameter("@unitcode", null));
|
||||
}
|
||||
|
||||
if (this.drpSteel.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
listStr.Add(new SqlParameter("@steel", this.drpSteel.SelectedValue));
|
||||
}
|
||||
else
|
||||
{
|
||||
listStr.Add(new SqlParameter("@steel", null));
|
||||
}
|
||||
if (this.drpWloName.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
listStr.Add(new SqlParameter("@WED_ID", this.drpWloName.SelectedValue));
|
||||
}
|
||||
else
|
||||
{
|
||||
listStr.Add(new SqlParameter("@WED_ID", null));
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(this.txtStarTime.Text))
|
||||
{
|
||||
listStr.Add(new SqlParameter("@date1", Convert.ToDateTime(this.txtStarTime.Text)));
|
||||
}
|
||||
else
|
||||
{
|
||||
listStr.Add(new SqlParameter("@date1", null));
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(this.txtEndTime.Text))
|
||||
{
|
||||
listStr.Add(new SqlParameter("@date2", Convert.ToDateTime(this.txtEndTime.Text).AddDays(1)));
|
||||
}
|
||||
else
|
||||
{
|
||||
listStr.Add(new SqlParameter("@date2", null));
|
||||
}
|
||||
|
||||
if (this.drpProject.SelectedValueArray.Length > 0 && this.drpProject.SelectedValueArray[0] != BLL.Const._Null)
|
||||
{
|
||||
listStr.Add(new SqlParameter("@projectId", projectIds));
|
||||
}
|
||||
else
|
||||
{
|
||||
listStr.Add(new SqlParameter("@projectId", null));
|
||||
}
|
||||
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
tb = SQLHelper.GetDataTableRunProc("HJGL_sp_rpt_welderPerformance2", parameter);
|
||||
this.Grid1.RecordCount = tb.Rows.Count;
|
||||
tb = GetFilteredTable(Grid1.FilteredData, tb);
|
||||
var table = this.GetPagedDataTable(Grid1, tb);
|
||||
Grid1.DataSource = table;
|
||||
Grid1.DataBind();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 分页
|
||||
@@ -253,6 +401,17 @@
|
||||
BindGrid();
|
||||
OutputSummaryData();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 统计
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void BtnAnalyse2_Click(object sender, EventArgs e)
|
||||
{
|
||||
BindGrid2();
|
||||
OutputSummaryData();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 导出按钮
|
||||
|
||||
@@ -147,6 +147,15 @@ namespace FineUIPro.Web.HJGL.WeldingReport {
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarFill ToolbarFill1;
|
||||
|
||||
/// <summary>
|
||||
/// BtnAnalyse2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button BtnAnalyse2;
|
||||
|
||||
/// <summary>
|
||||
/// BtnAnalyse 控件。
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user