| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441 |
- using Core.Mes.Client.Comm.Control;
- using Core.Mes.Client.Comm.Format;
- using Core.Mes.Client.Comm.Server;
- using Core.Mes.Client.Comm.Tool;
- using Core.StlMes.Client.ZGMil.Entity;
- using Core.StlMes.Client.ZGMil.ResultConrtrol;
- using Core.StlMes.Client.ZGMil.Signature;
- using CoreFS.CA06;
- using Infragistics.Win.UltraWinGrid;
- using System;
- using System.Collections;
- 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.Result
- {
- public partial class FrmMeasureResultZG : FrmBase
- {
- private string departm = "";
- private string plineCode = "";
- private string userName = "";
- private string proPlanId = null;//轧管订单编号
- private string gxPlanNo = null;//工序排产序号
- private string[] arrId;//数据权限
- string HeatPlanNo = "";
- string JudgeStoveNo = "";
- string PlineCode = "";
- public FrmMeasureResultZG()
- {
- InitializeComponent();
- this.IsLoadUserView = true;
- }
- private void FrmMeasureResultZG_Load(object sender, EventArgs e)
- {
- cmbDate.Value = DateTime.Parse(DateTime.Today.ToString());
- NativeMethodNew na = new NativeMethodNew(this.ob);
- userName = UserInfo.GetUserName();
- departm = UserInfo.GetDepartment();
- arrId = this.ValidDataPurviewIds;//获取数据权限
- EntityHelper.ShowGridCaption<MilPlanEntity6>(ultraGrid1.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<MilMeasureResultEntity>(ultraGrid2.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<PortMilBatchSampleResultEntity2>(ultraGrid3.DisplayLayout.Bands[0]);
- DateTime now = DateTime.Now;
- DateTime date = new DateTime(now.Year, now.Month, 1);
- cmbDate.Value = DateTime.Parse(date.ToString("yyyy-MM-dd"));
- cmbEndDate.Value = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
- }
- /// <summary>
- /// 重写基类方法
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="ToolbarKey"></param>
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Query":
- doQuery();
- break;
- case "DoAdd":
- DoAdd();
- break;
- case "DoDelete":
- DoDelete();
- break;
- case "SetGroup":
- SetGroup();
- break;
- case "SetMesureData":
- SetMesureData();
- break;
- //case "insertProssWt":
- // insertProssWt();
- // break;
- //case "Print":
- // PrintData();
- // break;
- case "Close":
- this.Close();
- break;
- }
- }
-
-
- /// <summary>
- /// 查询
- /// </summary>
- private void doQuery()
- {
- string date = "";
- string endDate = "";
- string JudgeStoveNo = "";
- if (chkDate.Checked)
- {
- if (DataTimeUtil.JudgeTime(DateTime.Parse(cmbDate.Value.ToString()), DateTime.Parse(cmbEndDate.Value.ToString())) == 0)
- {
- MessageUtil.ShowTips("您所选择的日期区域不对,请重新选择!");
- return;
- }
- else
- {
- date = cmbDate.Value.ToString();
- endDate = cmbEndDate.Value.ToString();
- }
- }
- if (chkJudgeStoveNo.Checked)
- {
- if (uteJudgeStoveNo.Text.Trim() == "")
- {
- JudgeStoveNo = "";
- }
- else
- {
- JudgeStoveNo = uteJudgeStoveNo.Value.ToString();
- }
- }
- List<MilPlanEntity6> listSource = EntityHelper.GetData<MilPlanEntity6>(
- "com.steering.mes.zgmil.coup.FrmMeasureResultZG.doQuery", new object[] { date, endDate, JudgeStoveNo ,arrId}, this.ob);
- bindingSource1.DataSource = listSource;
- GridHelper.RefreshAndAutoSize(this.ultraGrid1);
- }
- /// <summary>
- /// 打印
- /// </summary>
- private void PrintData()
- {
- string HeatPlanNo = this.ultraGrid1.ActiveRow.Cells["HeatPlanNo"].Value.ToString();
- string strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMchMeasurePrint.cpt&op=view" + "&HEAT_PLAN_NO=" + HeatPlanNo;
- FrmRepExcel fre = new FrmRepExcel(this.ob, strurl);
- fre.AutoSize = true;
- fre.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
- fre.WindowState = FormWindowState.Maximized;
- fre.Show();
- }
- /// <summary>
- /// 查询条件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void chkDate_CheckedChanged(object sender, EventArgs e)
- {
- if (chkDate.Checked) { cmbDate.Enabled = true; } else { cmbDate.Enabled = false; }
- if (chkDate.Checked) { cmbEndDate.Enabled = true; } else { cmbEndDate.Enabled = false; }
- if (chkJudgeStoveNo.Checked) { uteJudgeStoveNo.Enabled = true; } else { uteJudgeStoveNo.Enabled = false; }
- }
- private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
- {
- this.measureControl2.Value.BatchNo = "";
- this.measureControl2.Value.ProUser = this.UserInfo.GetUserName();
- this.measureControl2.Value.ProShift = this.UserInfo.GetUserOrderText();
- this.measureControl2.Value.ProGroup = this.UserInfo.GetUserGroupText();
- this.measureControl2.Value.ProTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
- this.measureControl2.Value.ProEndTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
- this.measureControl2.UpdateDate();
- string HeatPlanNo = this.ultraGrid1.ActiveRow.Cells["Id"].Value.ToString();
- string JudgeStoveNo = this.ultraGrid1.ActiveRow.Cells["JudgeStoveNo"].Value.ToString();
- string PlineCode = this.ultraGrid1.ActiveRow.Cells["PlineCode"].Value.ToString();
- doQueryMilMeasureResult();
- doQueryPortMilBatchSampleResult();
-
- }
- /// <summary>
- /// 查询测量实绩
- /// </summary>
- private void doQueryMilMeasureResult()
- {
- HeatPlanNo = this.ultraGrid1.ActiveRow.Cells["Id"].Value.ToString();
- JudgeStoveNo = this.ultraGrid1.ActiveRow.Cells["JudgeStoveNo"].Value.ToString();
- PlineCode = this.ultraGrid1.ActiveRow.Cells["PlineCode"].Value.ToString();
- List<MilMeasureResultEntity> listSource2 = EntityHelper.GetData<MilMeasureResultEntity>(
- "com.steering.mes.zgmil.coup.FrmMeasureResultZG.doQueryMilMeasureResult", new object[] { HeatPlanNo, JudgeStoveNo, PlineCode }, this.ob);
- MilMeasureResultEntitybindingSource2.DataSource = listSource2;
- GridHelper.RefreshAndAutoSize(this.ultraGrid2);
- }
- /// <summary>
- /// 查询进程表
- /// </summary>
- private void doQueryPortMilBatchSampleResult()
- {
- HeatPlanNo = this.ultraGrid1.ActiveRow.Cells["Id"].Value.ToString();
- JudgeStoveNo = this.ultraGrid1.ActiveRow.Cells["JudgeStoveNo"].Value.ToString();
- PlineCode = this.ultraGrid1.ActiveRow.Cells["PlineCode"].Value.ToString();
- List<PortMilBatchSampleResultEntity2> listSource = EntityHelper.GetData<PortMilBatchSampleResultEntity2>(
- "com.steering.mes.zgmil.coup.FrmMeasureResultZG.doQueryPortMilBatchSampleResult", new object[] { HeatPlanNo, JudgeStoveNo, PlineCode }, this.ob);
- PortMilBatchSampleResultEntity2bindingSource3.DataSource = listSource;
- GridHelper.RefreshAndAutoSize(this.ultraGrid3);
- }
- /// <summary>
- /// 新增
- /// </summary>
- protected virtual void DoAdd()
- {
- this.ultraGrid1.UpdateData();
- measureControl2.UltraGrid3.UpdateData();
- MilMeasureResultEntity milMeasureResult = new MilMeasureResultEntity();
- milMeasureResult.HeatPlanNo = this.ultraGrid1.ActiveRow.Cells["Id"].Value.ToString();
- milMeasureResult.JudgeStoveNo = this.ultraGrid1.ActiveRow.Cells["JudgeStoveNo"].Value.ToString();
- milMeasureResult.PlineCode = this.ultraGrid1.ActiveRow.Cells["PlineCode"].Value.ToString();
- milMeasureResult.BatchNo = this.measureControl2.FurResultDateSource1.Rows[0]["BatchNo"].ToString();
- milMeasureResult.ProNum = int.Parse(this.measureControl2.FurResultDateSource1.Rows[0]["ProNum"].ToString3());
- milMeasureResult.ProUser = this.UserInfo.GetUserName();
- milMeasureResult.ProShift = this.UserInfo.GetUserOrder();
- milMeasureResult.ProGroup = this.UserInfo.GetUserGroup();
- milMeasureResult.ProTime = this.measureControl2.FurResultDateSource1.Rows[0]["ProTime"].ToString();
- milMeasureResult.ProEndTime = this.measureControl2.FurResultDateSource1.Rows[0]["ProEndTime"].ToString();
- string milMeasureResultStr = JSONFormat.Format(milMeasureResult);
- if (milMeasureResult.ProNum == 0)
- {
- MessageUtil.ShowWarning("请输入正确的支数!");
- return;
- }
- HeatPlanNo = this.ultraGrid1.ActiveRow.Cells["Id"].Value.ToString();
- JudgeStoveNo = this.ultraGrid1.ActiveRow.Cells["JudgeStoveNo"].Value.ToString();
- PlineCode = this.ultraGrid1.ActiveRow.Cells["PlineCode"].Value.ToString();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.zgmil.coup.FrmMeasureResultZG";
- ccp.MethodName = "DoAdd";
- ccp.ServerParams = new object[] { milMeasureResultStr,HeatPlanNo, JudgeStoveNo, PlineCode };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("新增成功!"))
- {
- this.ultraGrid1.UpdateData();
- doQueryMilMeasureResult();
- doQueryPortMilBatchSampleResult();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 删除
- /// </summary>
- protected virtual void DoDelete()
- {
- this.ultraGrid2.UpdateData();
- string resultNo = this.ultraGrid2.ActiveRow.Cells["ResultNo"].Value.ToString();
- HeatPlanNo = this.ultraGrid1.ActiveRow.Cells["Id"].Value.ToString();
- JudgeStoveNo = this.ultraGrid1.ActiveRow.Cells["JudgeStoveNo"].Value.ToString();
- PlineCode = this.ultraGrid1.ActiveRow.Cells["PlineCode"].Value.ToString();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.zgmil.coup.FrmMeasureResultZG";
- ccp.MethodName = "DoDelete";
- ccp.ServerParams = new object[] { resultNo, HeatPlanNo, JudgeStoveNo, PlineCode };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("删除成功!"))
- {
- this.ultraGrid1.UpdateData();
- doQueryMilMeasureResult();
- doQueryPortMilBatchSampleResult();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 组号长度范围规则
- /// </summary>
- private void SetGroup()
- {
- //if (ActiveRow == null)
- //{
- // MessageUtil.ShowTips("请选择需要炉计划!");
- // return;
- //}
- //FrmGroupSetting fgs = new FrmGroupSetting(ActiveRow.OrderNoSeq, ActiveRow.HeatPlanNo, ob);
- //fgs.ShowDialog();
- }
- /// <summary>
- /// 维护测量点数据
- /// </summary>
- private void SetMesureData()
- {
- PlnZyJgxCEntity JgxPlan = new PlnZyJgxCEntity();
- JgxPlan.HeatPlanNo = this.ultraGrid1.ActiveRow.Cells["Id"].Value.ToString();
- JgxPlan.JudgeStoveNo = this.ultraGrid1.ActiveRow.Cells["JudgeStoveNo"].Value.ToString();
- JgxPlan.BatchNo = this.ultraGrid1.ActiveRow.Cells["BatchNo"].Value.ToString();
- JgxPlan.PlineCode = this.ultraGrid1.ActiveRow.Cells["PlineCode"].Value.ToString();
- MesureData MesureData = new MesureData(JgxPlan, ob, this.UserInfo.GetUserName(), true);
- MesureData.ShowDialog();
- }
- /// <summary>
- /// 保存喷印管号
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ultraButton1_Click(object sender, EventArgs e)
- {
- ArrayList parm = new ArrayList();
- HeatPlanNo = this.ultraGrid1.ActiveRow.Cells["Id"].Value.ToString();
- JudgeStoveNo = this.ultraGrid1.ActiveRow.Cells["JudgeStoveNo"].Value.ToString();
- PlineCode = this.ultraGrid1.ActiveRow.Cells["PlineCode"].Value.ToString();
- parm.Add(HeatPlanNo);
- parm.Add(JudgeStoveNo);
- parm.Add(PlineCode);
- parm.Add(this.ultraMeasuringSeqStart.Text.ToString());
- parm.Add(this.ultraMeasuringSeqLen.Text.ToString());
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.zgmil.coup.FrmMeasureResultZG";
- ccp.MethodName = "doSaveMeasuringSeq";
- ccp.ServerParams = new object[] { parm };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("保存喷印管号成功!"))
- {
- //doQueryOffLine();
- doQueryPortMilBatchSampleResult();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 发送喷印信息
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ultraButton2_Click(object sender, EventArgs e)
- {
- ArrayList parm = new ArrayList();
- HeatPlanNo = this.ultraGrid1.ActiveRow.Cells["Id"].Value.ToString();
- JudgeStoveNo = this.ultraGrid1.ActiveRow.Cells["JudgeStoveNo"].Value.ToString();
- PlineCode = this.ultraGrid1.ActiveRow.Cells["PlineCode"].Value.ToString();
- parm.Add(HeatPlanNo);
- parm.Add(JudgeStoveNo);
- parm.Add(PlineCode);
- parm.Add(this.ultraMatInfoStart.Text.ToString());
- parm.Add(this.ultraMatInfoEnd.Text.ToString());
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.zgmil.coup.FrmMeasureResultZG";
- ccp.MethodName = "doSaveMatInfo";
- ccp.ServerParams = new object[] { parm };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("发送喷印信息成功!"))
- {
- doQueryPortMilBatchSampleResult();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 回填过磅重量
- /// </summary>
- //private void insertProssWt()
- //{
- // this.ultraGrid2.UpdateData();
- // UltraGridRow uRow = this.ultraGrid2.ActiveRow;
- // if (uRow == null)
- // {
- // MessageUtil.ShowTips("请选择需要回报过磅重量的炉信息!");
- // return;
- // }
- // if (Double.Parse(uRow.Cells["ProWt"].Value.ToString3()) <= 0)
- // {
- // MessageUtil.ShowTips("请输入正确的重量!");
- // return;
- // }
- // MilMeasureResultEntity milMeasureResult = (MilMeasureResultEntity)this.ultraGrid2.ActiveRow.ListObject;
- // string milMeasureStr = JSONFormat.Format(milMeasureResult);
- // CoreClientParam ccp = new CoreClientParam();
- // ccp.ServerName = "com.steering.mes.zgmil.coup.FrmMeasureResultZG";
- // ccp.MethodName = "insertProssWt";
- // ccp.ServerParams = new object[] { milMeasureStr };
- // ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- // if (ccp.ReturnCode != -1)
- // {
- // if (ccp.ReturnInfo.Equals("回报成功!"))
- // {
- // doQueryMilMeasureResult();
- // doQueryPortMilBatchSampleResult();
- // MessageUtil.ShowTips(ccp.ReturnInfo);
- // }
- // else
- // {
- // MessageUtil.ShowTips(ccp.ReturnInfo);
- // }
- // }
- //}
- private void uteMeasureData_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
- {
- PlnZyJgxCEntity JgxPlan = new PlnZyJgxCEntity();
- JgxPlan.HeatPlanNo = this.ultraGrid1.ActiveRow.Cells["Id"].Value.ToString();
- JgxPlan.JudgeStoveNo = this.ultraGrid1.ActiveRow.Cells["JudgeStoveNo"].Value.ToString();
- JgxPlan.BatchNo = this.ultraGrid1.ActiveRow.Cells["BatchNo"].Value.ToString();
- JgxPlan.PlineCode = this.ultraGrid1.ActiveRow.Cells["PlineCode"].Value.ToString();
- MesureData MesureData = new MesureData(JgxPlan, ob, this.UserInfo.GetUserName(), false);
- MesureData.ShowDialog();
- }
-
- }
- }
|