| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259 |
- 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 CoreFS.CA06;
- 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.Treatment.Report
- {
- public partial class FrmStatistical : FrmBase
- {
- private string _plineCode = "";
- //private string _startime = "";
- //private string _endtime = "";
- private string bc = "";
- private string bz = "";
- private int days = 0;
- private string effic = "";
- private string effic1 = "";
- private string effic2 = "";
- public FrmStatistical(string plineCode, OpeBase _ob)
- {
-
- InitializeComponent();
- _plineCode = plineCode;
- //_startime = startime;
- //_endtime = endtime;
- this.ob = _ob;
- }
- 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;
- }
- private void FrmStatistical_Load(object sender, EventArgs e)
- {
- dateDayTime.Value = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd"));
- bc = this.UserInfo.GetUserOrder();
- bz = this.UserInfo.GetUserGroup();
- txtBc.Text = this.UserInfo.GetUserOrderText();
- txtBz.Text = this.UserInfo.GetUserGroupText();
- days = System.Threading.Thread.CurrentThread.CurrentUICulture.Calendar.GetDaysInMonth(DateTime.Now.Year, DateTime.Now.Month);
- doOutlibrary();
- }
- private void ultraToolbarsManager1_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
- {
- switch (e.Tool.Key)
- {
- 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 lastMonthD = "";
- //日
- string fistday = "";
- //string lastday = "";
- //DateTime t = DateTime.Parse(dateDayTime.Value.ToString());
- //DateTime t1 = new DateTime(t.Year, t.Month, 1);
-
- fistMonthD =dateDayTime.Value.ToString("yyyyMM");
- fistday = dateDayTime.Value.ToString("yyyyMMdd");
- //lastday = dateDayTime.Value.ToString("yyyyMMdd");
- //查询当班生产实绩
- DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.Report.FrmHttControlLog.doQueryActual", new object[] { fistday, bc, _plineCode }, this.ob);
- if (dt != null && dt.Rows.Count > 0)
- {
- DataRow row = dt.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 || row["JUDGE_STOVE_NO"].ToString().Equals("0"))
- {
- effic = "0";
- }
- else
- {
- effic = ((feizi / feimu) * 100).ToString("f2");
- }
- this.statisticalControl1.Value.Effic = effic+"%";
- this.statisticalControl1.UpdateData();
- }
- else
- {
- StatisticalClass result = new StatisticalClass();
- this.statisticalControl1.Value = result;
- }
- //查询当天生产实绩
- DataTable dt1 = ServerHelper.GetData("com.steering.mes.mcp.Report.FrmHttControlLog.doQueryDayActual",
- new object[] {fistday, _plineCode }, 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.statisticalControl2.Value.JudgeStoveNo = row1["JUDGE_STOVE_NO"].ToString();
- this.statisticalControl2.Value.QualifiedNum = row1["QUALIFIED_NUM"].ToString();
- this.statisticalControl2.Value.QualifiedWt = row1["QUALIFIED_WT"].ToString();
- this.statisticalControl2.Value.Minutes = row1["MINUTES"].ToString();
- this.statisticalControl2.Value.AbaMinutes = row1["ABSMINUTES"].ToString();
- this.statisticalControl2.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 || row1["JUDGE_STOVE_NO"].ToString().Equals("0"))
- {
- effic1 = "0";
- }
- else
- {
- effic1 = ((feizi / feimu) * 100).ToString("f2");
- }
-
- this.statisticalControl2.Value.Effic = effic1 + "%";
- this.statisticalControl2.UpdateData();
- //}
- //else
- //{
- // StatisticalClass result = new StatisticalClass();
- // this.statisticalControl2.Value = result;
- //}
- }
- else
- {
- StatisticalClass result = new StatisticalClass();
- this.statisticalControl2.Value = result;
- }
- //查询当月生产实绩
- DataTable dt2 = ServerHelper.GetData("com.steering.mes.mcp.Report.FrmHttControlLog.doQueryMonthActual", new object[] { fistMonthD, _plineCode }, 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.statisticalControl3.Value.JudgeStoveNo = row2["JUDGE_STOVE_NO"].ToString();
- this.statisticalControl3.Value.QualifiedNum = row2["QUALIFIED_NUM"].ToString();
- this.statisticalControl3.Value.QualifiedWt = row2["QUALIFIED_WT"].ToString();
- this.statisticalControl3.Value.Minutes = row2["MINUTES"].ToString();
- this.statisticalControl3.Value.AbaMinutes = row2["ABSMINUTES"].ToString();
- this.statisticalControl3.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 || row2["JUDGE_STOVE_NO"].ToString().Equals("0"))
- {
- effic2 = "0";
- }
- else
- {
- effic2 = ((feizi / feimu) * 100).ToString("f2");
- }
- this.statisticalControl3.Value.Effic = effic2 + "%";
- this.statisticalControl3.UpdateData();
- //}
- //else
- //{
- // StatisticalClass result = new StatisticalClass();
- // this.statisticalControl3.Value = result;
- //}
- }
- else
- {
- StatisticalClass result = new StatisticalClass();
- this.statisticalControl3.Value = result;
- }
- }
- /// <summary>
- /// 班报打印
- /// </summary>
- private void doClassPint()
- {
- 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=RepScheduClass.cpt&__bypagesize__=false&PROBC=" + bc + "&PLINECODE=" + _plineCode + "&p1=" + effic + "&startTim=" + fistday + "";
- 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=RepScheduDay.cpt&__bypagesize__=false&PLINECODE=" + _plineCode + "&startTim=" + fistday + "&p1=" + effic1 + "";
- 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=RepScheduMonth.cpt&__bypagesize__=false&PLINECODE=" + _plineCode + "&startTim=" + fistMonthD + "&p1=" + effic2 + "";
- FrmRepExcel fre = new FrmRepExcel(this.ob, url);
- fre.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
- fre.Text = "调度月报统计";
- fre.ShowDialog();
- }
- }
- }
|