| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288 |
- 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;
- using CoreFS.CA06;
- using Core.StlMes.Client.ZGMil.Entity;
- using Core.Mes.Client.Comm.Tool;
- using System.Collections;
- using Core.Mes.Client.Comm.Server;
- using Core.Mes.Client.Comm.Control;
- using Core.StlMes.Client.ZGMil.ResultConrtrol;
- using Infragistics.Win.UltraWinGrid;
- using com.steering.mes.zgmil.entity;
- using Core.Mes.Client.Comm.Format;
- namespace Core.StlMes.Client.ZGMil.Report
- {
- public partial class FrmRollingReport : FrmBase
- {
- public FrmRollingReport()
- {
- InitializeComponent();
- this.IsLoadUserView = true;
- }
- private void FrmRollingReport_Load(object sender, EventArgs e)
- {
- RegStartTime.Value = DateTime.Parse(DateTime.Today.AddDays(-1).ToString("yyyy-MM-dd 21:00:00"));
- RegEndTime.Value = DateTime.Parse(DateTime.Today.ToString("yyyy-MM-dd 20:59:59"));
- EntityHelper.ShowGridCaption<MilRollingResultEntity1>(ultraGrid1.DisplayLayout.Bands[0]);
- ClsBaseInfo.SetComboItemHeight(cmbOrder);
- ClsBaseInfo.SetComboItemHeight(cmbGroup);
- }
- /// <summary>
- /// 重写基类方法
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="ToolbarKey"></param>
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Query":
- doQueryData();
- break;
- case "Save":
- doSave();
- break;
- case "Print":
- PrintData();
- break;
- case "ExportData":
- GridHelper.ulGridToExcel(ultraGrid1, "连轧台账");
- break;
- case "Close":
- this.Close();
- break;
- }
- }
- /// <summary>
- /// 打印
- /// </summary>
- private void PrintData()
- {
- string bc = "";
- string bz = "";
- string date = this.RegStartTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
- string date1 = this.RegEndTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
- string plineCode = "";
- string departm = "";
- string judgeStoveNo = "";
- if (chkOrder.Checked && this.cmbOrder.Text != "")
- {
- bc = cmbOrder.Value.ToString();
- }
- else
- {
- MessageUtil.ShowTips("班次需勾选并且不能为空!");
- return;
- }
- if (chkGroup.Checked && this.cmbGroup.Text != "")
- {
- bz = cmbGroup.Value.ToString();
- }
- else
- {
- MessageUtil.ShowTips("班组需勾选并且不能为空!");
- return;
- }
- if (chkJudgeStoveNo.Checked && uteJudgeStoveNo.Text != "")
- {
- judgeStoveNo = uteJudgeStoveNo.Text;
- }
- doQueryData();
- NativeMethodNew na = new NativeMethodNew(this.ob);
- departm = UserInfo.GetDepartment();
- plineCode = na.GetPCode(departm);//获取 用户 对应的产线
-
- ColUserName colU = new ColUserName();
- colU.Ob = this.ob;
- colU.PlineCode = plineCode;
- colU.ColGroup = cmbGroup.Value.ToString2();
- colU.ColOrder = cmbOrder.Value.ToString2();
- colU.JudgeStoveNo = judgeStoveNo;
- colU.StationId = "3";
- if (plineCode.Equals("C017"))
- {
- colU.Url = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilRollingResult460.cpt&format=pdf&__bypagesize__=false";
- }
- else if(plineCode.Equals("C010"))
- {
- colU.Url = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilRollingResult168.cpt&format=pdf&__bypagesize__=false";
- }
- else if (plineCode.Equals("C009"))
- {
- colU.Url = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilRollingResult258.cpt&format=pdf&__bypagesize__=false";
- }
- else if (plineCode.Equals("C008"))
- {
- colU.Url = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilRollingResult250.cpt&format=pdf&__bypagesize__=false";
- }
- else if (plineCode.Equals("C072"))
- {
- colU.Url = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilRollingResult508.cpt&__bypagesize__=false";
- }
- colU.StartTim = date;
- colU.EndTim = date1;
- colU.StrText = "连轧实绩报表";
- colU.Flag = "0";
- colU.ShowDialog();
- }
- /// <summary>
- /// 查询
- /// </summary>
- private void doQueryData()
- {
- string strRegStart = this.RegStartTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
- string strEndtim = this.RegEndTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
- string strOrder = "";
- string strGroup = "";
- string JudgeStoveNo = "";
-
- string[] plineCode = null;
- if (chkOrder.Checked && this.cmbOrder.Text != "")
- {
- strOrder = this.cmbOrder.Value.ToString();
- }
- if (chkGroup.Checked && this.cmbGroup.Text != "")
- {
- strGroup = this.cmbGroup.Value.ToString();
- }
- if (chkJudgeStoveNo.Checked)
- {
- if (uteJudgeStoveNo.Text.Trim() == "")
- {
- JudgeStoveNo = "";
- }
- else
- {
- JudgeStoveNo = uteJudgeStoveNo.Value.ToString();
- }
- }
- NativeMethodNew na = new NativeMethodNew(this.ob);
- plineCode = na.GetPCodePline(this.ValidDataPurviewIds);//获取 用户 对应的产线
- ArrayList parm = new ArrayList();
- parm.Add(strRegStart);
- parm.Add(strEndtim);
- parm.Add(strOrder);
- parm.Add(strGroup);
- parm.Add(JudgeStoveNo);
- //parm.Add(plineCode);
- List<MilRollingResultEntity1> listSource = EntityHelper.GetData<MilRollingResultEntity1>(
- "com.steering.mes.zgmil.report.FrmRollingReport.doQueryData", new object[] { parm,plineCode }, this.ob);
- MilRollingResultEntity1bindingSource.DataSource = listSource;
- GridHelper.RefreshAndAutoSize(this.ultraGrid1);
- }
- /// <summary>
- /// 修改
- /// </summary>
- private void doSave()
- {
- this.ultraGrid1.UpdateData();
- IQueryable<UltraGridRow> checkMagRows = this.ultraGrid1.Rows.AsQueryable().Where(" CHK = 'True'");
- if (checkMagRows.Count() == 0)
- {
- MessageUtil.ShowTips("请选择需要修改的信息!");
- return;
- }
- ArrayList parm = new ArrayList();
- foreach (UltraGridRow uRow in checkMagRows)
- {
- MilRollingResultEntity1 Entity1 = (MilRollingResultEntity1)uRow.ListObject;
- FeedSawResultEntity matZcTity = new FeedSawResultEntity();
- matZcTity.JudgeStoveNo = Entity1.JudgeStoveNo.ToString();
- matZcTity.PlineCode = Entity1.PlineCode.ToString();
- if (Entity1.ColShift.ToString().Equals("早班"))
- {
- matZcTity.ColShift = "1";
- }
- else if (Entity1.ColShift.ToString().Equals("中班"))
- {
- matZcTity.ColShift = "2";
- }
- else if (Entity1.ColShift.ToString().Equals("夜班"))
- {
- matZcTity.ColShift = "3";
- }
- else if (Entity1.ColShift.ToString().Equals("常白班"))
- {
- matZcTity.ColShift = "0";
- }
- else
- {
- matZcTity.ColShift = Entity1.ColShift.ToString();
- }
- if (Entity1.ColGroup.ToString().Equals("甲"))
- {
- matZcTity.ColGroup = "1";
- }
- else if (Entity1.ColGroup.ToString().Equals("乙"))
- {
- matZcTity.ColGroup = "2";
- }
- else if (Entity1.ColGroup.ToString().Equals("丙"))
- {
- matZcTity.ColGroup = "3";
- }
- else if (Entity1.ColGroup.ToString().Equals("丁"))
- {
- matZcTity.ColGroup = "4";
- }
- else
- {
- matZcTity.ColGroup = Entity1.ColGroup.ToString();
- }
- matZcTity.StartTime = Entity1.EndTime.ToString();
- matZcTity.ColUser = Entity1.ColUser.ToString();
- matZcTity.Remark = "连轧";
- string matTity = JSONFormat.Format(matZcTity);
- parm.Add(matTity);
- }
- if (MessageUtil.ShowYesNoAndQuestion("是否确认修改?") == DialogResult.No) return;
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.zgmil.report.FrmFeedSaw";
- ccp.MethodName = "doSave";
- ccp.ServerParams = new object[] { parm };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("修改成功!"))
- {
- doQueryData();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- private void chkOrder_CheckedChanged(object sender, EventArgs e)
- {
- this.cmbOrder.Enabled = this.chkOrder.Checked;
- }
- private void chkGroup_CheckedChanged(object sender, EventArgs e)
- {
- this.cmbGroup.Enabled = this.chkGroup.Checked;
- }
- private void chkJudgeStoveNo_CheckedChanged(object sender, EventArgs e)
- {
- this.uteJudgeStoveNo.Enabled = this.chkJudgeStoveNo.Checked;
- }
- }
- }
|