| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908 |
-
- using Core.Mes.Client.Comm.Control;
- using Core.Mes.Client.Comm.Server;
- using Core.Mes.Client.Comm.Tool;
- using Core.StlMes.Client.Mcp.Control.Base;
- using Core.StlMes.Client.Mcp.VRP.Entity;
- using CoreFS.CA06;
- using Infragistics.Win;
- using Infragistics.Win.UltraWinGrid;
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- namespace Core.StlMes.Client.Mcp.VRP.Report
- {
- public partial class FrmStatisticalPub : FrmBase
- {
- private string _bc = "";
- private int days = 0;
- /// <summary>
- /// 720线
- /// </summary>
- private string effic720 = "";
- private string effic1720 = "";
- private string effic2720 = "";
- /// <summary>
- /// 冷轧
- /// </summary>
- private string efficlz = "";
- private string effic1lz = "";
- private string effic2lz = "";
- /// <summary>
- /// 冷拔
- /// </summary>
- private string efficlb = "";
- private string effic1lb = "";
- private string effic2lb = "";
- /// <summary>
- /// 镦粗
- /// </summary>
- private string efficdc = "";
- private string effic1dc = "";
- private string effic2dc = "";
- private string efficrk = "";
- private string effic1rk = "";
- private string effic2rk = "";
- public FrmStatisticalPub()
- {
- InitializeComponent();
- }
- protected override void OnLoad(EventArgs e)
- {
- base.OnLoad(e);
- this.statisticalControl1.Grid.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
- this.statisticalControl2.Grid.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
- this.statisticalControl3.Grid.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
- this.statisticalControl4.Grid.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
- this.statisticalControl5.Grid.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
- this.statisticalControl6.Grid.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
- this.statisticalControl7.Grid.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
- this.statisticalControl8.Grid.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
- this.statisticalControl9.Grid.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
- this.statisticalControl10.Grid.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
- this.statisticalControl11.Grid.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
- this.statisticalControl12.Grid.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
- this.statisticalControl13.Grid.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
- this.statisticalControl14.Grid.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
- this.statisticalControl15.Grid.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
- }
- private void FrmStatisticalPub_Load(object sender, EventArgs e)
- {
- cmbBc.Value = this.UserInfo.GetUserOrder();
- //cmbBz.Value = this.UserInfo.GetUserGroup();
- dateDayTime.Value = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd"));
- days = System.Threading.Thread.CurrentThread.CurrentUICulture.Calendar.GetDaysInMonth(DateTime.Now.Year, DateTime.Now.Month);
- DataTable dt = dataTable1;
- dt.Columns.Add(new DataColumn("Month") { Caption = "停机汇总" });
- TubeRoll.GridColumnSum(ultraGrid3, new string[] { "Month" });
- for (int i = 0; i < days; i++)
- {
- string key = "DAY" + (i + 1);
- string name = (i + 1).ToString();
- dt.Columns.Add(new DataColumn(key) { Caption = name });
- TubeRoll.GridColumnSum(ultraGrid3, new string[] { key });
- }
- doOutlibrary();
- doMinutesQuery();
- }
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Outlibrary"://查询
- doOutlibrary();
- break;
- case "ClassPint"://班报打印
- doClassPint();
- break;
- case "DayPrint"://日报打印
- doDayPrint();
- break;
- case "MonthPrint"://月报打印
- doMonthPrint();
- break;
- case "Close":
- this.Close();
- break;
- default:
- break;
- }
- }
- private void doOutlibrary()
- {
- //月
- string fistMonthD = "";
- //日
- string fistday = "";
- fistMonthD = dateDayTime.Value.ToString("yyyyMM");
- fistday = dateDayTime.Value.ToString("yyyyMMdd");
- _bc = cmbBc.Value.ToString();
- //_bz = cmbBz.Value.ToString();
- #region 720旋扩
- //查询当班生产实绩
- DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.Report.FrmVrpControlLog.doQueryActual", new object[] { fistday, _bc, "C018" }, this.ob);
- if (dt != null && dt.Rows.Count > 0)
- {
- //if (!dt.Rows[0]["JUDGE_STOVE_NO"].ToString().Equals("0"))
- //{
- DataRow row = dt.Rows[0];
- this.statisticalControl6.Value.JudgeStoveNo = row["JUDGE_STOVE_NO"].ToString();
- this.statisticalControl6.Value.QualifiedNum = row["QUALIFIED_NUM"].ToString();
- this.statisticalControl6.Value.QualifiedWt = row["QUALIFIED_WT"].ToString();
- this.statisticalControl6.Value.Minutes = row["MINUTES"].ToString();
- this.statisticalControl6.Value.AbaMinutes = row["ABSMINUTES"].ToString();
- this.statisticalControl6.Value.SumMinutes = row["SUMMINUTES"].ToString();
- double feizi = double.Parse(row["YOUMINUTES"].ToString()) - double.Parse(row["SUMMINUTES"].ToString());
- double feimu = double.Parse(row["YOUMINUTES"].ToString());
- if (feizi <= 0 || dt.Rows[0]["JUDGE_STOVE_NO"].ToString().Equals("0"))
- {
- effic720 = "0";
- }
- else
- {
- effic720 = ((feizi / feimu) * 100).ToString("f2");
- }
- this.statisticalControl6.Value.Effic = effic720 + "%";
- this.statisticalControl6.UpdateData();
- }
- else
- {
- StatisticalClass result = new StatisticalClass();
- this.statisticalControl6.Value = result;
- }
- //查询当天生产实绩
- DataTable dt1 = ServerHelper.GetData("com.steering.mes.mcp.Report.FrmVrpControlLog.doQueryDayActual",
- new object[] { fistday, "C018" }, this.ob);
- if (dt1 != null && dt1.Rows.Count > 0)
- {
- //if (!dt1.Rows[0]["JUDGE_STOVE_NO"].ToString().Equals("0"))
- //{
- DataRow row1 = dt1.Rows[0];
- this.statisticalControl4.Value.JudgeStoveNo = row1["JUDGE_STOVE_NO"].ToString();
- this.statisticalControl4.Value.QualifiedNum = row1["QUALIFIED_NUM"].ToString();
- this.statisticalControl4.Value.QualifiedWt = row1["QUALIFIED_WT"].ToString();
- this.statisticalControl4.Value.Minutes = row1["MINUTES"].ToString();
- this.statisticalControl4.Value.AbaMinutes = row1["ABSMINUTES"].ToString();
- this.statisticalControl4.Value.SumMinutes = row1["SUMMINUTES"].ToString();
- double feizi = double.Parse(row1["YOUMINUTES"].ToString()) - double.Parse(row1["SUMMINUTES"].ToString());
- double feimu = double.Parse(row1["YOUMINUTES"].ToString());
- if (feizi <= 0 || dt1.Rows[0]["JUDGE_STOVE_NO"].ToString().Equals("0"))
- {
- effic1720 = "0";
- }
- else
- {
- effic1720 = ((feizi / feimu) * 100).ToString("f2");
- }
- this.statisticalControl4.Value.Effic = effic1720 + "%";
- this.statisticalControl4.UpdateData();
- }
- else
- {
- StatisticalClass result = new StatisticalClass();
- this.statisticalControl4.Value = result;
- }
- //查询当月生产实绩
- DataTable dt2 = ServerHelper.GetData("com.steering.mes.mcp.Report.FrmVrpControlLog.doQueryMonthActual", new object[] { fistMonthD, "C018" }, this.ob);
- if (dt2 != null && dt2.Rows.Count > 0)
- {
- //if (!dt2.Rows[0]["JUDGE_STOVE_NO"].ToString().Equals("0"))
- //{
- DataRow row2 = dt2.Rows[0];
- this.statisticalControl5.Value.JudgeStoveNo = row2["JUDGE_STOVE_NO"].ToString();
- this.statisticalControl5.Value.QualifiedNum = row2["QUALIFIED_NUM"].ToString();
- this.statisticalControl5.Value.QualifiedWt = row2["QUALIFIED_WT"].ToString();
- this.statisticalControl5.Value.Minutes = row2["MINUTES"].ToString();
- this.statisticalControl5.Value.AbaMinutes = row2["ABSMINUTES"].ToString();
- this.statisticalControl5.Value.SumMinutes = row2["SUMMINUTES"].ToString();
- double feizi = double.Parse(row2["YOUMINUTES"].ToString()) - double.Parse(row2["SUMMINUTES"].ToString());
- double feimu = double.Parse(row2["YOUMINUTES"].ToString());
- if (feizi <= 0 || dt2.Rows[0]["JUDGE_STOVE_NO"].ToString().Equals("0"))
- {
- effic2720 = "0";
- }
- else
- {
- effic2720 = ((feizi / feimu) * 100).ToString("f2");
- }
- this.statisticalControl5.Value.Effic = effic2720 + "%";
- this.statisticalControl5.UpdateData();
- }
- else
- {
- StatisticalClass result = new StatisticalClass();
- this.statisticalControl5.Value = result;
- }
- #endregion
- #region 冷轧机组
- //查询当班生产实绩
- DataTable dtlz = ServerHelper.GetData("com.steering.mes.mcp.Report.FrmVrpControlLog.doQueryActual", new object[] { fistday, _bc, "C013" }, this.ob);
- if (dtlz != null && dtlz.Rows.Count > 0)
- {
- //if (!dtlz.Rows[0]["JUDGE_STOVE_NO"].ToString().Equals("0"))
- //{
- DataRow row = dtlz.Rows[0];
- this.statisticalControl9.Value.JudgeStoveNo = row["JUDGE_STOVE_NO"].ToString();
- this.statisticalControl9.Value.QualifiedNum = row["QUALIFIED_NUM"].ToString();
- this.statisticalControl9.Value.QualifiedWt = row["QUALIFIED_WT"].ToString();
- this.statisticalControl9.Value.Minutes = row["MINUTES"].ToString();
- this.statisticalControl9.Value.AbaMinutes = row["ABSMINUTES"].ToString();
- this.statisticalControl9.Value.SumMinutes = row["SUMMINUTES"].ToString();
- double feizi = double.Parse(row["YOUMINUTES"].ToString()) - double.Parse(row["SUMMINUTES"].ToString());
- double feimu = double.Parse(row["YOUMINUTES"].ToString());
- if (feizi <= 0 || dt.Rows[0]["JUDGE_STOVE_NO"].ToString().Equals("0"))
- {
- efficlz = "0";
- }
- else
- {
- efficlz = ((feizi / feimu) * 100).ToString("f2");
- }
- this.statisticalControl9.Value.Effic = efficlz + "%";
- this.statisticalControl9.UpdateData();
- }
- else
- {
- StatisticalClass result = new StatisticalClass();
- this.statisticalControl9.Value = result;
- }
- //查询当天生产实绩
- DataTable dt1lz = ServerHelper.GetData("com.steering.mes.mcp.Report.FrmVrpControlLog.doQueryDayActual",
- new object[] { fistday, "C013" }, this.ob);
- if (dt1lz != null && dt1lz.Rows.Count > 0)
- {
- //if (!dt1lz.Rows[0]["JUDGE_STOVE_NO"].ToString().Equals("0"))
- //{
- DataRow row1 = dt1lz.Rows[0];
- this.statisticalControl7.Value.JudgeStoveNo = row1["JUDGE_STOVE_NO"].ToString();
- this.statisticalControl7.Value.QualifiedNum = row1["QUALIFIED_NUM"].ToString();
- this.statisticalControl7.Value.QualifiedWt = row1["QUALIFIED_WT"].ToString();
- this.statisticalControl7.Value.Minutes = row1["MINUTES"].ToString();
- this.statisticalControl7.Value.AbaMinutes = row1["ABSMINUTES"].ToString();
- this.statisticalControl7.Value.SumMinutes = row1["SUMMINUTES"].ToString();
- double feizi = double.Parse(row1["YOUMINUTES"].ToString()) - double.Parse(row1["SUMMINUTES"].ToString());
- double feimu = double.Parse(row1["YOUMINUTES"].ToString());
- if (feizi <= 0 || dt1lz.Rows[0]["JUDGE_STOVE_NO"].ToString().Equals("0"))
- {
- effic1lz = "0";
- }
- else
- {
- effic1lz = ((feizi / feimu) * 100).ToString("f2");
- }
- this.statisticalControl7.Value.Effic = effic1lz + "%";
- this.statisticalControl7.UpdateData();
- //}
- //else
- //{
- // StatisticalClass result = new StatisticalClass();
- // this.statisticalControl7.Value = result;
- //}
- }
- else
- {
- StatisticalClass result = new StatisticalClass();
- this.statisticalControl7.Value = result;
- }
- //查询当月生产实绩
- DataTable dt2lz = ServerHelper.GetData("com.steering.mes.mcp.Report.FrmVrpControlLog.doQueryMonthActual", new object[] { fistMonthD, "C013" }, this.ob);
- if (dt2lz != null && dt2lz.Rows.Count > 0)
- {
- //if (!dt2lz.Rows[0]["JUDGE_STOVE_NO"].ToString().Equals("0"))
- //{
- DataRow row2 = dt2lz.Rows[0];
- this.statisticalControl8.Value.JudgeStoveNo = row2["JUDGE_STOVE_NO"].ToString();
- this.statisticalControl8.Value.QualifiedNum = row2["QUALIFIED_NUM"].ToString();
- this.statisticalControl8.Value.QualifiedWt = row2["QUALIFIED_WT"].ToString();
- this.statisticalControl8.Value.Minutes = row2["MINUTES"].ToString();
- this.statisticalControl8.Value.AbaMinutes = row2["ABSMINUTES"].ToString();
- this.statisticalControl8.Value.SumMinutes = row2["SUMMINUTES"].ToString();
- double feizi = double.Parse(row2["YOUMINUTES"].ToString()) - double.Parse(row2["SUMMINUTES"].ToString());
- double feimu = double.Parse(row2["YOUMINUTES"].ToString());
- if (feizi <= 0 || dt2lz.Rows[0]["JUDGE_STOVE_NO"].ToString().Equals("0"))
- {
- effic2lz = "0";
- }
- else
- {
- effic2lz = ((feizi / feimu) * 100).ToString("f2");
- }
- this.statisticalControl8.Value.Effic = effic2lz + "%";
- this.statisticalControl8.UpdateData();
- }
- else
- {
- StatisticalClass result = new StatisticalClass();
- this.statisticalControl8.Value = result;
- }
- #endregion
- #region 冷拔机组
- //查询当班生产实绩
- DataTable dtlb = ServerHelper.GetData("com.steering.mes.mcp.Report.FrmVrpControlLog.doQueryActual", new object[] { fistday, _bc, "C014" }, this.ob);
- if (dtlb != null && dtlb.Rows.Count > 0)
- {
- //if (!dtlb.Rows[0]["JUDGE_STOVE_NO"].ToString().Equals("0"))
- //{
- DataRow row = dtlb.Rows[0];
- this.statisticalControl1.Value.JudgeStoveNo = row["JUDGE_STOVE_NO"].ToString();
- this.statisticalControl1.Value.QualifiedNum = row["QUALIFIED_NUM"].ToString();
- this.statisticalControl1.Value.QualifiedWt = row["QUALIFIED_WT"].ToString();
- this.statisticalControl1.Value.Minutes = row["MINUTES"].ToString();
- this.statisticalControl1.Value.AbaMinutes = row["ABSMINUTES"].ToString();
- this.statisticalControl1.Value.SumMinutes = row["SUMMINUTES"].ToString();
- double feizi = double.Parse(row["YOUMINUTES"].ToString()) - double.Parse(row["SUMMINUTES"].ToString());
- double feimu = double.Parse(row["YOUMINUTES"].ToString());
- if (feizi <= 0 || dtlb.Rows[0]["JUDGE_STOVE_NO"].ToString().Equals("0"))
- {
- efficlb = "0";
- }
- else
- {
- efficlb = ((feizi / feimu) * 100).ToString("f2");
- }
- this.statisticalControl1.Value.Effic = efficlb + "%";
- this.statisticalControl1.UpdateData();
- }
- else
- {
- StatisticalClass result = new StatisticalClass();
- this.statisticalControl1.Value = result;
- }
- //查询当天生产实绩
- DataTable dt1lb = ServerHelper.GetData("com.steering.mes.mcp.Report.FrmVrpControlLog.doQueryDayActual",
- new object[] { fistday, "C014" }, this.ob);
- if (dt1lb != null && dt1lb.Rows.Count > 0)
- {
- //if (!dt1lb.Rows[0]["JUDGE_STOVE_NO"].ToString().Equals("0"))
- //{
- DataRow row1 = dt1lb.Rows[0];
- this.statisticalControl3.Value.JudgeStoveNo = row1["JUDGE_STOVE_NO"].ToString();
- this.statisticalControl3.Value.QualifiedNum = row1["QUALIFIED_NUM"].ToString();
- this.statisticalControl3.Value.QualifiedWt = row1["QUALIFIED_WT"].ToString();
- this.statisticalControl3.Value.Minutes = row1["MINUTES"].ToString();
- this.statisticalControl3.Value.AbaMinutes = row1["ABSMINUTES"].ToString();
- this.statisticalControl3.Value.SumMinutes = row1["SUMMINUTES"].ToString();
- double feizi = double.Parse(row1["YOUMINUTES"].ToString()) - double.Parse(row1["SUMMINUTES"].ToString());
- double feimu = double.Parse(row1["YOUMINUTES"].ToString());
- if (feizi <= 0 || dt1lb.Rows[0]["JUDGE_STOVE_NO"].ToString().Equals("0"))
- {
- effic1lb = "0";
- }
- else
- {
- effic1lb = ((feizi / feimu) * 100).ToString("f2");
- }
- this.statisticalControl3.Value.Effic = effic1lb + "%";
- this.statisticalControl3.UpdateData();
- }
- else
- {
- StatisticalClass result = new StatisticalClass();
- this.statisticalControl3.Value = result;
- }
- //查询当月生产实绩
- DataTable dt2lb = ServerHelper.GetData("com.steering.mes.mcp.Report.FrmVrpControlLog.doQueryMonthActual", new object[] { fistMonthD, "C014" }, this.ob);
- if (dt2lb != null && dt2lb.Rows.Count > 0)
- {
- //if (!dt2lb.Rows[0]["JUDGE_STOVE_NO"].ToString().Equals("0"))
- //{
- DataRow row2 = dt2lb.Rows[0];
- this.statisticalControl2.Value.JudgeStoveNo = row2["JUDGE_STOVE_NO"].ToString();
- this.statisticalControl2.Value.QualifiedNum = row2["QUALIFIED_NUM"].ToString();
- this.statisticalControl2.Value.QualifiedWt = row2["QUALIFIED_WT"].ToString();
- this.statisticalControl2.Value.Minutes = row2["MINUTES"].ToString();
- this.statisticalControl2.Value.AbaMinutes = row2["ABSMINUTES"].ToString();
- this.statisticalControl2.Value.SumMinutes = row2["SUMMINUTES"].ToString();
- double feizi = double.Parse(row2["YOUMINUTES"].ToString()) - double.Parse(row2["SUMMINUTES"].ToString());
- double feimu = double.Parse(row2["YOUMINUTES"].ToString());
- if (feizi <= 0 || dt2lb.Rows[0]["JUDGE_STOVE_NO"].ToString().Equals("0"))
- {
- effic2lb = "0";
- }
- else
- {
- effic2lb = ((feizi / feimu) * 100).ToString("f2");
- }
- this.statisticalControl2.Value.Effic = effic2lb + "%";
- this.statisticalControl2.UpdateData();
- }
- else
- {
- StatisticalClass result = new StatisticalClass();
- this.statisticalControl2.Value = result;
- }
- #endregion
- #region 镦粗
- //查询当班生产实绩
- DataTable dtdc = ServerHelper.GetData("com.steering.mes.mcp.Report.FrmVrpControlLog.doQueryActual", new object[] { fistday, _bc, "C021" }, this.ob);
- if (dtdc != null && dtdc.Rows.Count > 0)
- {
- //if (!dtdc.Rows[0]["JUDGE_STOVE_NO"].ToString().Equals("0"))
- //{
- DataRow row = dtdc.Rows[0];
- this.statisticalControl12.Value.JudgeStoveNo = row["JUDGE_STOVE_NO"].ToString();
- this.statisticalControl12.Value.QualifiedNum = row["QUALIFIED_NUM"].ToString();
- this.statisticalControl12.Value.QualifiedWt = row["QUALIFIED_WT"].ToString();
- this.statisticalControl12.Value.Minutes = row["MINUTES"].ToString();
- this.statisticalControl12.Value.AbaMinutes = row["ABSMINUTES"].ToString();
- this.statisticalControl12.Value.SumMinutes = row["SUMMINUTES"].ToString();
- double feizi = double.Parse(row["YOUMINUTES"].ToString()) - double.Parse(row["SUMMINUTES"].ToString());
- double feimu = double.Parse(row["YOUMINUTES"].ToString());
- if (feizi <= 0 || dtdc.Rows[0]["JUDGE_STOVE_NO"].ToString().Equals("0"))
- {
- efficdc = "0";
- }
- else
- {
- efficdc = ((feizi / feimu) * 100).ToString("f2");
- }
- this.statisticalControl12.Value.Effic = efficdc + "%";
- this.statisticalControl12.UpdateData();
- }
- else
- {
- StatisticalClass result = new StatisticalClass();
- this.statisticalControl12.Value = result;
- }
- //查询当天生产实绩
- DataTable dt1dc = ServerHelper.GetData("com.steering.mes.mcp.Report.FrmVrpControlLog.doQueryDayActual",
- new object[] { fistday, "C021" }, this.ob);
- if (dt1dc != null && dt1dc.Rows.Count > 0)
- {
- //if (!dt1dc.Rows[0]["JUDGE_STOVE_NO"].ToString().Equals("0"))
- //{
- DataRow row1 = dt1dc.Rows[0];
- this.statisticalControl10.Value.JudgeStoveNo = row1["JUDGE_STOVE_NO"].ToString();
- this.statisticalControl10.Value.QualifiedNum = row1["QUALIFIED_NUM"].ToString();
- this.statisticalControl10.Value.QualifiedWt = row1["QUALIFIED_WT"].ToString();
- this.statisticalControl10.Value.Minutes = row1["MINUTES"].ToString();
- this.statisticalControl10.Value.AbaMinutes = row1["ABSMINUTES"].ToString();
- this.statisticalControl10.Value.SumMinutes = row1["SUMMINUTES"].ToString();
- double feizi = double.Parse(row1["YOUMINUTES"].ToString()) - double.Parse(row1["SUMMINUTES"].ToString());
- double feimu = double.Parse(row1["YOUMINUTES"].ToString());
- if (feizi <= 0 || dt1dc.Rows[0]["JUDGE_STOVE_NO"].ToString().Equals("0"))
- {
- effic1dc = "0";
- }
- else
- {
- effic1dc = ((feizi / feimu) * 100).ToString("f2");
- }
- this.statisticalControl10.Value.Effic = effic1dc + "%";
- this.statisticalControl10.UpdateData();
- }
- else
- {
- StatisticalClass result = new StatisticalClass();
- this.statisticalControl10.Value = result;
- }
- //查询当月生产实绩
- DataTable dt2dc = ServerHelper.GetData("com.steering.mes.mcp.Report.FrmVrpControlLog.doQueryMonthActual", new object[] { fistMonthD, "C021" }, this.ob);
- if (dt2dc != null && dt2dc.Rows.Count > 0)
- {
- //if (!dt2dc.Rows[0]["JUDGE_STOVE_NO"].ToString().Equals("0"))
- //{
- DataRow row2 = dt2dc.Rows[0];
- this.statisticalControl11.Value.JudgeStoveNo = row2["JUDGE_STOVE_NO"].ToString();
- this.statisticalControl11.Value.QualifiedNum = row2["QUALIFIED_NUM"].ToString();
- this.statisticalControl11.Value.QualifiedWt = row2["QUALIFIED_WT"].ToString();
- this.statisticalControl11.Value.Minutes = row2["MINUTES"].ToString();
- this.statisticalControl11.Value.AbaMinutes = row2["ABSMINUTES"].ToString();
- this.statisticalControl11.Value.SumMinutes = row2["SUMMINUTES"].ToString();
- double feizi = double.Parse(row2["YOUMINUTES"].ToString()) - double.Parse(row2["SUMMINUTES"].ToString());
- double feimu = double.Parse(row2["YOUMINUTES"].ToString());
- if (feizi <= 0 || dt2dc.Rows[0]["JUDGE_STOVE_NO"].ToString().Equals("0"))
- {
- effic2dc = "0";
- }
- else
- {
- effic2dc = ((feizi / feimu) * 100).ToString("f2");
- }
- this.statisticalControl11.Value.Effic = effic2dc + "%";
- this.statisticalControl11.UpdateData();
- }
- else
- {
- StatisticalClass result = new StatisticalClass();
- this.statisticalControl11.Value = result;
- }
- #endregion
- #region 热扩
- //查询当班生产实绩
- DataTable dtrk = ServerHelper.GetData("com.steering.mes.mcp.Report.FrmVrpControlLog.doQueryActual", new object[] { fistday, _bc, "C070" }, this.ob);
- if (dtrk != null && dtrk.Rows.Count > 0)
- {
- //if (!dtrk.Rows[0]["JUDGE_STOVE_NO"].ToString().Equals("0"))
- //{
- DataRow row = dtrk.Rows[0];
- this.statisticalControl15.Value.JudgeStoveNo = row["JUDGE_STOVE_NO"].ToString();
- this.statisticalControl15.Value.QualifiedNum = row["QUALIFIED_NUM"].ToString();
- this.statisticalControl15.Value.QualifiedWt = row["QUALIFIED_WT"].ToString();
- this.statisticalControl15.Value.Minutes = row["MINUTES"].ToString();
- this.statisticalControl15.Value.AbaMinutes = row["ABSMINUTES"].ToString();
- this.statisticalControl15.Value.SumMinutes = row["SUMMINUTES"].ToString();
- double feizi = double.Parse(row["YOUMINUTES"].ToString()) - double.Parse(row["SUMMINUTES"].ToString());
- double feimu = double.Parse(row["YOUMINUTES"].ToString());
- if (feizi <= 0 || dtrk.Rows[0]["JUDGE_STOVE_NO"].ToString().Equals("0"))
- {
- efficrk = "0";
- }
- else
- {
- efficrk = ((feizi / feimu) * 100).ToString("f2");
- }
- this.statisticalControl15.Value.Effic = efficrk + "%";
- this.statisticalControl15.UpdateData();
- }
- else
- {
- StatisticalClass result = new StatisticalClass();
- this.statisticalControl15.Value = result;
- }
- //查询当天生产实绩
- DataTable dt1rk = ServerHelper.GetData("com.steering.mes.mcp.Report.FrmVrpControlLog.doQueryDayActual",
- new object[] { fistday, "C070" }, this.ob);
- if (dt1rk != null && dt1rk.Rows.Count > 0)
- {
- //if (!dt1rk.Rows[0]["JUDGE_STOVE_NO"].ToString().Equals("0"))
- //{
- DataRow row1 = dt1rk.Rows[0];
- this.statisticalControl13.Value.JudgeStoveNo = row1["JUDGE_STOVE_NO"].ToString();
- this.statisticalControl13.Value.QualifiedNum = row1["QUALIFIED_NUM"].ToString();
- this.statisticalControl13.Value.QualifiedWt = row1["QUALIFIED_WT"].ToString();
- this.statisticalControl13.Value.Minutes = row1["MINUTES"].ToString();
- this.statisticalControl13.Value.AbaMinutes = row1["ABSMINUTES"].ToString();
- this.statisticalControl13.Value.SumMinutes = row1["SUMMINUTES"].ToString();
- double feizi = double.Parse(row1["YOUMINUTES"].ToString()) - double.Parse(row1["SUMMINUTES"].ToString());
- double feimu = double.Parse(row1["YOUMINUTES"].ToString());
- if (feizi <= 0 || dt1rk.Rows[0]["JUDGE_STOVE_NO"].ToString().Equals("0"))
- {
- effic1rk = "0";
- }
- else
- {
- effic1rk = ((feizi / feimu) * 100).ToString("f2");
- }
- this.statisticalControl13.Value.Effic = effic1rk + "%";
- this.statisticalControl13.UpdateData();
- }
- else
- {
- StatisticalClass result = new StatisticalClass();
- this.statisticalControl13.Value = result;
- }
- //查询当月生产实绩
- DataTable dt2rk = ServerHelper.GetData("com.steering.mes.mcp.Report.FrmVrpControlLog.doQueryMonthActual", new object[] { fistMonthD, "C070" }, this.ob);
- if (dt2rk != null && dt2rk.Rows.Count > 0)
- {
- //if (!dt2rk.Rows[0]["JUDGE_STOVE_NO"].ToString().Equals("0"))
- //{
- DataRow row2 = dt2rk.Rows[0];
- this.statisticalControl14.Value.JudgeStoveNo = row2["JUDGE_STOVE_NO"].ToString();
- this.statisticalControl14.Value.QualifiedNum = row2["QUALIFIED_NUM"].ToString();
- this.statisticalControl14.Value.QualifiedWt = row2["QUALIFIED_WT"].ToString();
- this.statisticalControl14.Value.Minutes = row2["MINUTES"].ToString();
- this.statisticalControl14.Value.AbaMinutes = row2["ABSMINUTES"].ToString();
- this.statisticalControl14.Value.SumMinutes = row2["SUMMINUTES"].ToString();
- double feizi = double.Parse(row2["YOUMINUTES"].ToString()) - double.Parse(row2["SUMMINUTES"].ToString());
- double feimu = double.Parse(row2["YOUMINUTES"].ToString());
- if (feizi <= 0 || dt2rk.Rows[0]["JUDGE_STOVE_NO"].ToString().Equals("0"))
- {
- effic2rk = "0";
- }
- else
- {
- effic2rk = ((feizi / feimu) * 100).ToString("f2");
- }
- this.statisticalControl14.Value.Effic = effic2rk + "%";
- this.statisticalControl14.UpdateData();
- }
- else
- {
- StatisticalClass result = new StatisticalClass();
- this.statisticalControl14.Value = result;
- }
- #endregion
- doMinutesQuery();
- }
- /// <summary>
- /// 班报打印
- /// </summary>
- private void doClassPint()
- {
- doOutlibrary();
- //日
- string fistday = "";
- //string lastday = "";
- fistday = dateDayTime.Value.ToString("yyyyMMdd");
- //lastday = dateDayTime.Value.ToString("yyyyMMdd");
- //if (_bc.Equals("3"))
- //{
- // fistday = fistday + "18";
- // lastday = lastday + "10";
- //}
- //if (_bc.Equals("1"))
- //{
- // fistday = lastday + "00";
- // lastday = lastday + "18";
- //}
- //if (_bc.Equals("2"))
- //{
- // fistday = lastday + "12";
- // lastday = lastday + "23";
- //}
- string url = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepVRPScheduClassAll.cpt&__bypagesize__=false&PROBC=" + _bc
- + "&startTim=" + fistday
- + "&C018=" + effic720
- + "&C013=" + efficlz
- + "&C014=" + efficlb
- + "&C021=" + efficdc
- + "&C070=" + efficrk
- + "";
- FrmRepExcel fre = new FrmRepExcel(this.ob, url);
- fre.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
- fre.Text = "调度班报统计";
- fre.ShowDialog();
- }
- /// <summary>
- /// 日报打印
- /// </summary>
- private void doDayPrint()
- {
- doOutlibrary();
- //日
- string fistday = "";
- //string lastday = "";
- fistday = dateDayTime.Value.ToString("yyyyMMdd");
- //lastday = dateDayTime.Value.ToString("yyyyMMdd");
- string url = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepVRPScheduDayAll.cpt&__bypagesize__=false&startTim=" + fistday
- + "&C018=" + effic1720
- + "&C013=" + effic1lz
- + "&C014=" + effic1lb
- + "&C021=" + effic1dc
- + "&C070=" + effic1rk
- + "";
- FrmRepExcel fre = new FrmRepExcel(this.ob, url);
- fre.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
- fre.Text = "调度日报统计";
- fre.ShowDialog();
- }
- /// <summary>
- /// 月报打印
- /// </summary>
- private void doMonthPrint()
- {
- doOutlibrary();
- //月
- string fistMonthD = "";
- //string lrktMonthD = "";
- //DateTime t = DateTime.Parse(dateDayTime.Value.ToString());
- //DateTime t1 = new DateTime(t.Year, t.Month, 1);
- //lastMonthD = DateTime.Parse(t.ToString("yyyy-MM-dd 21:06")).ToString("yyyyMMdd");
- fistMonthD = dateDayTime.Value.ToString("yyyyMM");
- string url = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepScheduMonthAll.cpt&__bypagesize__=false&startTim=" + fistMonthD
- + "&C018=" + effic2720
- + "&C013=" + effic2lz
- + "&C014=" + effic2lb
- + "&C021=" + effic2dc
- + "&C070=" + effic2rk
- + "";
- FrmRepExcel fre = new FrmRepExcel(this.ob, url);
- fre.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
- fre.Text = "调度月报统计";
- fre.ShowDialog();
- }
- private void doStopQuery(string date, string plinCode)
- {
- DataTable dt=ServerHelper.GetData
- ("com.steering.mes.mcp.Report.FrmVrpControlLog.doStopQuery", new object[] { date, plinCode }, this.ob);
- GridHelper.CopyDataToDatatable(ref dt, ref dataTable2, true);
- doAnalysis();
- }
- private void doMinutesQuery()
- {
- string time = dateDayTime.Value.ToString("yyyyMM");
- DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.Report.FrmVrpControlLog.doMinutesQuery", new object[] { time, days.ToString() }, this.ob);
- GridHelper.CopyDataToDatatable(ref dt, ref dataTable1, true);
- //foreach (UltraGridColumn column in ultraGrid3.DisplayLayout.Bands[0].Columns)
- // column.Width = 50;
- foreach (UltraGridRow urg in ultraGrid3.Rows)
- {
- double MonthCount = 0;
- foreach (UltraGridColumn column in ultraGrid3.DisplayLayout.Bands[0].Columns)
- {
- column.Width = 50;
- column.CellActivation = Infragistics.Win.UltraWinGrid.Activation.ActivateOnly;
- column.CellAppearance.TextHAlign = Infragistics.Win.HAlign.Right;
- if (column.Key.Contains("DAY"))
- {
- urg.Cells[column.Key].Value = (double.Parse(urg.Cells[column.Key].Value.ToString()) / 60).ToString("f2");
- if (double.Parse(urg.Cells[column.Key].Value.ToString()) >= 4.0 && double.Parse(urg.Cells[column.Key].Value.ToString()) < 12.0)
- {
- urg.Cells[column.Key].Appearance.BackColor = Color.Yellow;
- }
- else if (double.Parse(urg.Cells[column.Key].Value.ToString()) >= 12.0 && double.Parse(urg.Cells[column.Key].Value.ToString()) < 24.0)
- {
- urg.Cells[column.Key].Appearance.BackColor = Color.Orange;
- }
- else if (double.Parse(urg.Cells[column.Key].Value.ToString()) >= 24.0)
- {
- urg.Cells[column.Key].Appearance.BackColor = Color.Red;
- }
- MonthCount += double.Parse(urg.Cells[column.Key].Value.ToString());
- }
- }
- urg.Cells["Month"].Value = MonthCount;
- }
- }
- #region 冷拔
- /// <summary>
- /// 冷拔
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ultraButton1_Click(object sender, EventArgs e)
- {
- doStopQuery(dateDayTime.Value.ToString("yyyyMMdd"), "C014");
- }
- private void ultraButton6_Click(object sender, EventArgs e)
- {
- FrmProductionDetails pro = new FrmProductionDetails(dateDayTime.Value.ToString("yyyyMMdd"), "C014", this.ob);
- pro.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
- pro.Text = "生产详细";
- pro.ShowDialog();
- }
- #endregion
- #region 720
- /// <summary>
- /// 720
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ultraButton2_Click(object sender, EventArgs e)
- {
- doStopQuery(dateDayTime.Value.ToString("yyyyMMdd"), "C018");
- }
- private void ultraButton7_Click(object sender, EventArgs e)
- {
- FrmProductionDetails pro = new FrmProductionDetails(dateDayTime.Value.ToString("yyyyMMdd"), "C018", this.ob);
- pro.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
- pro.Text = "生产详细";
- pro.ShowDialog();
- }
- #endregion
- #region 冷轧
- /// <summary>
- /// lz
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ultraButton3_Click(object sender, EventArgs e)
- {
- doStopQuery(dateDayTime.Value.ToString("yyyyMMdd"), "C013");
- }
- private void ultraButton8_Click(object sender, EventArgs e)
- {
- FrmProductionDetails pro = new FrmProductionDetails(dateDayTime.Value.ToString("yyyyMMdd"), "C013", this.ob);
- pro.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
- pro.Text = "生产详细";
- pro.ShowDialog();
- }
- #endregion
- #region 镦粗
- /// <summary>
- /// dc
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ultraButton4_Click(object sender, EventArgs e)
- {
- doStopQuery(dateDayTime.Value.ToString("yyyyMMdd"), "C021");
- }
- private void ultraButton9_Click(object sender, EventArgs e)
- {
- FrmProductionDetails pro = new FrmProductionDetails(dateDayTime.Value.ToString("yyyyMMdd"), "C021", this.ob);
- pro.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
- pro.Text = "生产详细";
- pro.ShowDialog();
- }
- #endregion
- #region 热扩
- /// <summary>
- ///热扩
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ultraButton5_Click(object sender, EventArgs e)
- {
- doStopQuery(dateDayTime.Value.ToString("yyyyMMdd2054"), "C070");
- }
- private void ultraButton10_Click(object sender, EventArgs e)
- {
- FrmProductionDetails pro = new FrmProductionDetails(dateDayTime.Value.ToString("yyyyMMdd"), "C070", this.ob);
- pro.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
- pro.Text = "生产详细";
- pro.ShowDialog();
- }
- #endregion
- /// <summary>
- ///停机时间差
- /// </summary>
- private void doAnalysis()
- {
- foreach (UltraGridRow ugr in ultraGrid1.Rows)
- {
- string loagEnd = ugr.Cells["LOGS_END"].Value.ToString();
- string loagBeg = ugr.Cells["LOGS_BEG"].Value.ToString();
- TimeSpan timeSpan = DateTime.Parse(loagEnd) - DateTime.Parse(loagBeg);
- ugr.Cells["TimeDiff"].Value = timeSpan.TotalMinutes.ToString();
- }
- }
- private string DateDiff(DateTime DateTime1, DateTime DateTime2)
- {
- string dateDiff = null;
- try
- {
- TimeSpan ts1 = new TimeSpan(DateTime1.Ticks);
- TimeSpan ts2 = new TimeSpan(DateTime2.Ticks);
- TimeSpan ts = ts1.Subtract(ts2).Duration();
- dateDiff = ts.Minutes.ToString();
- }
- catch
- {
- }
- return dateDiff;
- }
- }
- }
|