| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876 |
- using com.steering.mes.zgmil.entity;
- using Core.Mes.Client.Comm.Control;
- using Core.Mes.Client.Comm.Server;
- using Core.Mes.Client.Comm.Tool;
- using Core.StlMes.Client.ZGMil.Signature;
- 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.ZGMil.Entity
- {
- public partial class FrmStatisticalPub : FrmBase
- {
- private string _bc = "";
- private int days = 0;
- private string effic250 = "";
- private string effic1250 = "";
- private string effic2250 = "";
- private string effic258 = "";
- private string effic1258 = "";
- private string effic2258 = "";
- private string effic168 = "";
- private string effic1168 = "";
- private string effic2168 = "";
- private string effic460 = "";
- private string effic1460 = "";
- private string effic2460 = "";
- private string efficAs = "";
- private string effic1As = "";
- private string effic2As = "";
- 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)
- {
- EntityHelper.ShowGridCaption<MilControlLogEntity>(ultraGrid1.DisplayLayout.Bands[0]);
- 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 250机组
- //查询当班生产实绩
- DataTable dt = ServerHelper.GetData("com.steering.mes.signature.FrmMilControlLog.doQueryActual", new object[] { fistday, _bc, "C008" }, 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"))
- {
- effic250 = "0";
- }
- else
- {
- effic250 = ((feizi / feimu) * 100).ToString("f2");
- }
- this.statisticalControl6.Value.Effic = effic250 + "%";
- this.statisticalControl6.UpdateData();
- }
- else
- {
- StatisticalClass result = new StatisticalClass();
- this.statisticalControl6.Value = result;
- }
- //查询当天生产实绩
- DataTable dt1 = ServerHelper.GetData("com.steering.mes.signature.FrmMilControlLog.doQueryDayActual",
- new object[] { fistday, "C008" }, 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"))
- {
- effic1250 = "0";
- }
- else
- {
- effic1250 = ((feizi / feimu) * 100).ToString("f2");
- }
- this.statisticalControl4.Value.Effic = effic1250 + "%";
- this.statisticalControl4.UpdateData();
- }
- else
- {
- StatisticalClass result = new StatisticalClass();
- this.statisticalControl4.Value = result;
- }
- //查询当月生产实绩
- DataTable dt2 = ServerHelper.GetData("com.steering.mes.signature.FrmMilControlLog.doQueryMonthActual", new object[] { fistMonthD, "C008" }, 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"))
- {
- effic2250 = "0";
- }
- else
- {
- effic2250 = ((feizi / feimu) * 100).ToString("f2");
- }
- this.statisticalControl5.Value.Effic = effic2250 + "%";
- this.statisticalControl5.UpdateData();
- }
- else
- {
- StatisticalClass result = new StatisticalClass();
- this.statisticalControl5.Value = result;
- }
- #endregion
- #region 258机组
- //查询当班生产实绩
- DataTable dt258 = ServerHelper.GetData("com.steering.mes.signature.FrmMilControlLog.doQueryActual", new object[] { fistday, _bc, "C009" }, this.ob);
- if (dt258 != null && dt258.Rows.Count > 0)
- {
- //if (!dt258.Rows[0]["JUDGE_STOVE_NO"].ToString().Equals("0"))
- //{
- DataRow row = dt258.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"))
- {
- effic258 = "0";
- }
- else
- {
- effic258 = ((feizi / feimu) * 100).ToString("f2");
- }
- this.statisticalControl9.Value.Effic = effic258 + "%";
- this.statisticalControl9.UpdateData();
- }
- else
- {
- StatisticalClass result = new StatisticalClass();
- this.statisticalControl9.Value = result;
- }
- //查询当天生产实绩
- DataTable dt1258 = ServerHelper.GetData("com.steering.mes.signature.FrmMilControlLog.doQueryDayActual",
- new object[] { fistday, "C009" }, this.ob);
- if (dt1258 != null && dt1258.Rows.Count > 0)
- {
- //if (!dt1258.Rows[0]["JUDGE_STOVE_NO"].ToString().Equals("0"))
- //{
- DataRow row1 = dt1258.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 || dt1258.Rows[0]["JUDGE_STOVE_NO"].ToString().Equals("0"))
- {
- effic1258 = "0";
- }
- else
- {
- effic1258 = ((feizi / feimu) * 100).ToString("f2");
- }
- this.statisticalControl7.Value.Effic = effic1258 + "%";
- this.statisticalControl7.UpdateData();
- //}
- //else
- //{
- // StatisticalClass result = new StatisticalClass();
- // this.statisticalControl7.Value = result;
- //}
- }
- else
- {
- StatisticalClass result = new StatisticalClass();
- this.statisticalControl7.Value = result;
- }
- //查询当月生产实绩
- DataTable dt2258 = ServerHelper.GetData("com.steering.mes.signature.FrmMilControlLog.doQueryMonthActual", new object[] { fistMonthD, "C009" }, this.ob);
- if (dt2258 != null && dt2258.Rows.Count > 0)
- {
- //if (!dt2258.Rows[0]["JUDGE_STOVE_NO"].ToString().Equals("0"))
- //{
- DataRow row2 = dt2258.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 || dt2258.Rows[0]["JUDGE_STOVE_NO"].ToString().Equals("0"))
- {
- effic2258 = "0";
- }
- else
- {
- effic2258 = ((feizi / feimu) * 100).ToString("f2");
- }
- this.statisticalControl8.Value.Effic = effic2258 + "%";
- this.statisticalControl8.UpdateData();
- }
- else
- {
- StatisticalClass result = new StatisticalClass();
- this.statisticalControl8.Value = result;
- }
- #endregion
- #region 168机组
- //查询当班生产实绩
- DataTable dt168 = ServerHelper.GetData("com.steering.mes.signature.FrmMilControlLog.doQueryActual", new object[] { fistday, _bc, "C010" }, this.ob);
- if (dt168 != null && dt168.Rows.Count > 0)
- {
- //if (!dt168.Rows[0]["JUDGE_STOVE_NO"].ToString().Equals("0"))
- //{
- DataRow row = dt168.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 || dt168.Rows[0]["JUDGE_STOVE_NO"].ToString().Equals("0"))
- {
- effic168 = "0";
- }
- else
- {
- effic168 = ((feizi / feimu) * 100).ToString("f2");
- }
- this.statisticalControl1.Value.Effic = effic168 + "%";
- this.statisticalControl1.UpdateData();
- }
- else
- {
- StatisticalClass result = new StatisticalClass();
- this.statisticalControl1.Value = result;
- }
- //查询当天生产实绩
- DataTable dt1168 = ServerHelper.GetData("com.steering.mes.signature.FrmMilControlLog.doQueryDayActual",
- new object[] { fistday, "C010" }, this.ob);
- if (dt1168 != null && dt1168.Rows.Count > 0)
- {
- //if (!dt1168.Rows[0]["JUDGE_STOVE_NO"].ToString().Equals("0"))
- //{
- DataRow row1 = dt1168.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 || dt1168.Rows[0]["JUDGE_STOVE_NO"].ToString().Equals("0"))
- {
- effic1168 = "0";
- }
- else
- {
- effic1168 = ((feizi / feimu) * 100).ToString("f2");
- }
- this.statisticalControl3.Value.Effic = effic1168 + "%";
- this.statisticalControl3.UpdateData();
- }
- else
- {
- StatisticalClass result = new StatisticalClass();
- this.statisticalControl3.Value = result;
- }
- //查询当月生产实绩
- DataTable dt2168 = ServerHelper.GetData("com.steering.mes.signature.FrmMilControlLog.doQueryMonthActual", new object[] { fistMonthD, "C010" }, this.ob);
- if (dt2168 != null && dt2168.Rows.Count > 0)
- {
- //if (!dt2168.Rows[0]["JUDGE_STOVE_NO"].ToString().Equals("0"))
- //{
- DataRow row2 = dt2168.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 || dt2168.Rows[0]["JUDGE_STOVE_NO"].ToString().Equals("0"))
- {
- effic2168 = "0";
- }
- else
- {
- effic2168 = ((feizi / feimu) * 100).ToString("f2");
- }
- this.statisticalControl2.Value.Effic = effic2168 + "%";
- this.statisticalControl2.UpdateData();
- }
- else
- {
- StatisticalClass result = new StatisticalClass();
- this.statisticalControl2.Value = result;
- }
- #endregion
- #region 460机组
- //查询当班生产实绩
- DataTable dt460 = ServerHelper.GetData("com.steering.mes.signature.FrmMilControlLog.doQueryActual", new object[] { fistday, _bc, "C017" }, this.ob);
- if (dt460 != null && dt460.Rows.Count > 0)
- {
- //if (!dt460.Rows[0]["JUDGE_STOVE_NO"].ToString().Equals("0"))
- //{
- DataRow row = dt460.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 || dt460.Rows[0]["JUDGE_STOVE_NO"].ToString().Equals("0"))
- {
- effic460 = "0";
- }
- else
- {
- effic460 = ((feizi / feimu) * 100).ToString("f2");
- }
- this.statisticalControl12.Value.Effic = effic460 + "%";
- this.statisticalControl12.UpdateData();
- }
- else
- {
- StatisticalClass result = new StatisticalClass();
- this.statisticalControl12.Value = result;
- }
- //查询当天生产实绩
- DataTable dt1460 = ServerHelper.GetData("com.steering.mes.signature.FrmMilControlLog.doQueryDayActual",
- new object[] { fistday, "C017" }, this.ob);
- if (dt1460 != null && dt1460.Rows.Count > 0)
- {
- //if (!dt1460.Rows[0]["JUDGE_STOVE_NO"].ToString().Equals("0"))
- //{
- DataRow row1 = dt1460.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 || dt1460.Rows[0]["JUDGE_STOVE_NO"].ToString().Equals("0"))
- {
- effic1460 = "0";
- }
- else
- {
- effic1460 = ((feizi / feimu) * 100).ToString("f2");
- }
- this.statisticalControl10.Value.Effic = effic1460 + "%";
- this.statisticalControl10.UpdateData();
- }
- else
- {
- StatisticalClass result = new StatisticalClass();
- this.statisticalControl10.Value = result;
- }
- //查询当月生产实绩
- DataTable dt2460 = ServerHelper.GetData("com.steering.mes.signature.FrmMilControlLog.doQueryMonthActual", new object[] { fistMonthD, "C017" }, this.ob);
- if (dt2460 != null && dt2460.Rows.Count > 0)
- {
- //if (!dt2460.Rows[0]["JUDGE_STOVE_NO"].ToString().Equals("0"))
- //{
- DataRow row2 = dt2460.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 || dt2460.Rows[0]["JUDGE_STOVE_NO"].ToString().Equals("0"))
- {
- effic2460 = "0";
- }
- else
- {
- effic2460 = ((feizi / feimu) * 100).ToString("f2");
- }
- this.statisticalControl11.Value.Effic = effic2460 + "%";
- this.statisticalControl11.UpdateData();
- }
- else
- {
- StatisticalClass result = new StatisticalClass();
- this.statisticalControl11.Value = result;
- }
- #endregion
- #region ASSEL机组
- //查询当班生产实绩
- DataTable dtas = ServerHelper.GetData("com.steering.mes.signature.FrmMilControlLog.doQueryActual", new object[] { fistday, _bc, "C072" }, this.ob);
- if (dtas != null && dtas.Rows.Count > 0)
- {
- //if (!dtas.Rows[0]["JUDGE_STOVE_NO"].ToString().Equals("0"))
- //{
- DataRow row = dtas.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 || dtas.Rows[0]["JUDGE_STOVE_NO"].ToString().Equals("0"))
- {
- efficAs = "0";
- }
- else
- {
- efficAs = ((feizi / feimu) * 100).ToString("f2");
- }
- this.statisticalControl15.Value.Effic = efficAs + "%";
- this.statisticalControl15.UpdateData();
- }
- else
- {
- StatisticalClass result = new StatisticalClass();
- this.statisticalControl15.Value = result;
- }
- //查询当天生产实绩
- DataTable dt1as = ServerHelper.GetData("com.steering.mes.signature.FrmMilControlLog.doQueryDayActual",
- new object[] { fistday, "C072" }, this.ob);
- if (dt1as != null && dt1as.Rows.Count > 0)
- {
- //if (!dt1as.Rows[0]["JUDGE_STOVE_NO"].ToString().Equals("0"))
- //{
- DataRow row1 = dt1as.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 || dt1as.Rows[0]["JUDGE_STOVE_NO"].ToString().Equals("0"))
- {
- effic1As = "0";
- }
- else
- {
- effic1As = ((feizi / feimu) * 100).ToString("f2");
- }
- this.statisticalControl13.Value.Effic = effic1As + "%";
- this.statisticalControl13.UpdateData();
- }
- else
- {
- StatisticalClass result = new StatisticalClass();
- this.statisticalControl13.Value = result;
- }
- //查询当月生产实绩
- DataTable dt2as = ServerHelper.GetData("com.steering.mes.signature.FrmMilControlLog.doQueryMonthActual", new object[] { fistMonthD, "C072" }, this.ob);
- if (dt2as != null && dt2as.Rows.Count > 0)
- {
- //if (!dt2as.Rows[0]["JUDGE_STOVE_NO"].ToString().Equals("0"))
- //{
- DataRow row2 = dt2as.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 || dt2as.Rows[0]["JUDGE_STOVE_NO"].ToString().Equals("0"))
- {
- effic2As = "0";
- }
- else
- {
- effic2As = ((feizi / feimu) * 100).ToString("f2");
- }
- this.statisticalControl14.Value.Effic = effic2As + "%";
- 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=RepScheduClassAll.cpt&__bypagesize__=false&PROBC=" + _bc + "&p250=" + effic250 + "&startTim=" + fistday + "&p258=" + effic258 + "&p168=" + effic168 + "&p460=" + effic460 + "&pASSEL=" + efficAs + "";
- 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=RepScheduDayAll.cpt&__bypagesize__=false&startTim=" + fistday + "&p250=" + effic1250 + "&p258=" + effic1258 + "&p168=" + effic1168 + "&p460=" + effic1460 + "&pASSEL=" + effic1As + "";
- 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 lastMonthD = "";
- //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 + "&p250=" + effic2250 + "&p258=" + effic2258 + "&p168=" + effic2168 + "&p460=" + effic2460 + "&pASSEL=" + effic2As + "";
- 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)
- {
- List<MilControlLogEntity> listSource = EntityHelper.GetData<MilControlLogEntity>
- ("com.steering.mes.signature.FrmMilControlLog.doStopQuery", new object[] { date, plinCode }, this.ob);
- MilControlLogEntity.DataSource = listSource;
- GridHelper.RefreshAndAutoSize(ultraGrid1);
- doAnalysis();
- }
- private void doMinutesQuery()
- {
- string time = dateDayTime.Value.ToString("yyyyMM");
- DataTable dt = ServerHelper.GetData("com.steering.mes.signature.FrmMilControlLog.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 168
- /// <summary>
- /// 168
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ultraButton1_Click(object sender, EventArgs e)
- {
- doStopQuery(dateDayTime.Value.ToString("yyyyMMdd"), "C010");
- }
- private void ultraButton6_Click(object sender, EventArgs e)
- {
- FrmProductionDetails pro = new FrmProductionDetails(dateDayTime.Value.ToString("yyyyMMdd"), "C010", this.ob);
- pro.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
- pro.Text = "生产详细";
- pro.ShowDialog();
- }
- #endregion
- #region 250
- /// <summary>
- /// 250
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ultraButton2_Click(object sender, EventArgs e)
- {
- doStopQuery(dateDayTime.Value.ToString("yyyyMMdd"), "C008");
- }
- private void ultraButton7_Click(object sender, EventArgs e)
- {
- FrmProductionDetails pro = new FrmProductionDetails(dateDayTime.Value.ToString("yyyyMMdd"), "C008", this.ob);
- pro.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
- pro.Text = "生产详细";
- pro.ShowDialog();
- }
- #endregion
- #region 258
- /// <summary>
- /// 258
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ultraButton3_Click(object sender, EventArgs e)
- {
- doStopQuery(dateDayTime.Value.ToString("yyyyMMdd"), "C009");
- }
- private void ultraButton8_Click(object sender, EventArgs e)
- {
- FrmProductionDetails pro = new FrmProductionDetails(dateDayTime.Value.ToString("yyyyMMdd"), "C009", this.ob);
- pro.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
- pro.Text = "生产详细";
- pro.ShowDialog();
- }
- #endregion
- #region 460
- /// <summary>
- /// 460
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ultraButton4_Click(object sender, EventArgs e)
- {
- doStopQuery(dateDayTime.Value.ToString("yyyyMMdd"), "C017");
- }
- private void ultraButton9_Click(object sender, EventArgs e)
- {
- FrmProductionDetails pro = new FrmProductionDetails(dateDayTime.Value.ToString("yyyyMMdd"), "C017", this.ob);
- pro.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
- pro.Text = "生产详细";
- pro.ShowDialog();
- }
- #endregion
- #region ASSEL
- /// <summary>
- /// ASSEL
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ultraButton5_Click(object sender, EventArgs e)
- {
- doStopQuery(dateDayTime.Value.ToString("yyyyMMdd2054"), "C072");
- }
- private void ultraButton10_Click(object sender, EventArgs e)
- {
- FrmProductionDetails pro = new FrmProductionDetails(dateDayTime.Value.ToString("yyyyMMdd"), "C072", 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["LogsEnd"].Value.ToString();
- string loagBeg = ugr.Cells["LogsBeg"].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;
- }
- }
- }
|