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.Mes.Client.Comm.Server; using Core.Mes.Client.Comm.Control; using com.steering.mes.zgmil.entity; using Infragistics.Win.UltraWinGrid; using Core.Mes.Client.Comm.Tool; using Core.StlMes.Client.ZGMil.Entity; using Core.StlMes.Client.ZGMil.NodeResultQuery; using System.Net; using Core.StlMes.Client.ZGMil.Popup; using Core.StlMes.Client.ZGMil.ResultConrtrol; using Core.StlMes.Client.ZGMil.Common; using CoreFS.SA06; namespace Core.StlMes.Client.ZGMil.Result { public partial class FrmSizingResult : FrmBase { #region 初始化 MilPlan QueryMainPlan = new MilPlan(); MilPlan MainPlan = new MilPlan(); MilSizingResultEntity SizingResultSave = new MilSizingResultEntity(); MilSizingResultEntity SizingResultEntity = new MilSizingResultEntity(); private Infragistics.Win.UltraWinGrid.UltraGrid _grid = null; int PanelSizeFlag = 0; string PLineCode = "";//产线代码 string PlanStatusQuery = "59"; string PlanStartStatusQuery = "00"; //查询结炉实绩起始状态 string ActiveJUDGE_STOVE_NO = string.Empty;//主计划活动行的判定炉号 string ActiveResultNo = string.Empty;//主计划活动行的判定炉号 private string ActiveStatus = null;//主计划活动行的状态 private string proPlanId = null;//轧管订单编号 private string gxPlanNo = null;//工序排产序号 private string lotNo = null;//生产批号 //private string PlineCode = null;//产线代码 private string ChangeUserID = ""; //接班用户名 private string ChangePassWord = ""; //接班密码 MilSizingResultEntity tempsizingresult = new MilSizingResultEntity(); string Shift = ""; string Group = ""; private string Departm = "";//部门 private string PlineCod = "";//产线 private int _MouseLocX = 0; //鼠标横坐标 private int _MouseLocY = 0; //鼠标纵坐标 private int ShowMessageFlag = 0; //保存弹窗标识 0 弹出 1 不弹出 private int ChangeFlag = 0; //交班结炉提示 0弹出 1不弹出 private string _UserName = ""; private string _UserID = ""; private string _Url = ""; public Infragistics.Win.UltraWinGrid.UltraGrid Grid { get { return _grid; } } public FrmSizingResult() { InitializeComponent(); InitControl(); Shift = UserInfo.GetUserOrder(); Group = UserInfo.GetUserGroup(); this.sizingResult1.UltraGrid2.ClickCellButton += new CellEventHandler(UltraGrid2_ClickCellButton); this.sinzingResult_4601.UltraGrid2.ClickCellButton += new CellEventHandler(UltraGrid2_ClickCellButton); //获取鼠标坐标 Point formPoint = this.PointToClient(Control.MousePosition); _MouseLocX = Convert.ToInt32(formPoint.X); _MouseLocY = Convert.ToInt32(formPoint.Y); } /// /// 定时器事件 /// /// /// void timer1_Tick(object sender, EventArgs e) { int MouseLocX = 0; int MouseLocY = 0; //获取当前鼠标坐标 //获取鼠标坐标 Point formPoint = this.PointToClient(Control.MousePosition); MouseLocX = Convert.ToInt32(formPoint.X); MouseLocY = Convert.ToInt32(formPoint.Y); if (MouseLocX == _MouseLocX && MouseLocY == _MouseLocY) { ShowMessageFlag = 1; PlanQuery(); ShowMessageFlag = 0; } else { _MouseLocX = MouseLocX; _MouseLocY = MouseLocY; } } /// /// 交班取消 /// /// /// void UltraGrid2_ClickCellButton(object sender, CellEventArgs e) { string JudgeStoveNo = ""; string Status = ""; string ResultNo = ""; UltraGridRow ugr = this.ultraGridPlan.ActiveRow; if (ugr != null) { if (e.Cell.Column.Key == "CHANGENUMCANCEL") { JudgeStoveNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString(); Status = ugr.Cells["IS_START"].Value.ToString(); ResultNo = ugr.Cells["ID"].Value.ToString(); if (Status == "已完成定径") { MessageBox.Show("炉号:【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】已完成定径操作,不允许交班取消!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (Status == "未开始定径") { MessageBox.Show("炉号:【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】未开始定径,不允许交班取消!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } NativeMethodNew nass = new NativeMethodNew(this.ob); nass.ChangeShiftBack(JudgeStoveNo, ResultNo, proPlanId, gxPlanNo, PLineCode, Shift, Group, 5); MainPlan.JudgeStoveNo = JudgeStoveNo; MainPlan.ProPlanId = proPlanId; MainPlan.GxPlanNo = gxPlanNo; GetFurRack(); DataTable dtMP = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getSingleMainPlanForHeatNo", new object[] { MainPlan }, this.ob); //查询定径实绩信息 DataTable dtSizingResult = ServerHelper.GetData("com.steering.mes.zgmil.coup.SizingResult.getSizingResult", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, this.ob); if (dtSizingResult.Rows.Count > 0) { if (PLineCode != "C017" && PLineCode != "C072") { SizingResultEditForRack(dtSizingResult); } else { Sizing460ResultEidtForRack(dtSizingResult, dtMP.Rows[0]["PIPE_SIZE"].ToString()); } } else { this.sizingResult1.Value.Clear(); this.sinzingResult_4601.Value.Clear(); //清空定径实绩 GridHelper.InitCardGrid(sizingResult1.SizingDataSource1, sizingResult1.UltraGrid2); //清空定径实绩460 GridHelper.InitCardGrid(sinzingResult_4601.SizingDataSource1, sinzingResult_4601.UltraGrid2); } } } } private void ChangeCancel() { string JudgeStoveNo = ""; string Status = ""; string ResultNo = ""; UltraGridRow ugr = this.ultraGridPlan.ActiveRow; if (ugr != null) { JudgeStoveNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString(); Status = ugr.Cells["IS_START"].Value.ToString(); ResultNo = ugr.Cells["ID"].Value.ToString(); if (Status == "已完成定径") { MessageBox.Show("炉号:【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】已完成定径操作,不允许交班取消!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (Status == "未开始定径") { MessageBox.Show("炉号:【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】未开始定径,不允许交班取消!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } NativeMethodNew nass = new NativeMethodNew(this.ob); nass.ChangeShiftBack(JudgeStoveNo, ResultNo, proPlanId, gxPlanNo, PLineCode, Shift, Group, 5); MainPlan.JudgeStoveNo = JudgeStoveNo; MainPlan.ProPlanId = proPlanId; MainPlan.GxPlanNo = gxPlanNo; GetFurRack(); ChangeGridColor(); DataTable dtMP = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getSingleMainPlanForHeatNo", new object[] { MainPlan }, this.ob); //查询定径实绩信息 DataTable dtSizingResult = ServerHelper.GetData("com.steering.mes.zgmil.coup.SizingResult.getSizingResult", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, this.ob); if (dtSizingResult.Rows.Count > 0) { if (PLineCode != "C017" && PLineCode != "C072") { SizingResultEditForRack(dtSizingResult); } else { Sizing460ResultEidtForRack(dtSizingResult, dtMP.Rows[0]["PIPE_SIZE"].ToString()); } } else { this.sizingResult1.Value.Clear(); this.sinzingResult_4601.Value.Clear(); //清空定径实绩 GridHelper.InitCardGrid(sizingResult1.SizingDataSource1, sizingResult1.UltraGrid2); //清空定径实绩460 GridHelper.InitCardGrid(sinzingResult_4601.SizingDataSource1, sinzingResult_4601.UltraGrid2); } } } protected override void OnLoad(EventArgs e) { base.OnLoad(e); rollingInfomation1.UltraGrid4.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False; rollingCard1.UltraGrid4.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False; this.sizingResult1.UltraGrid2.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False; this.sinzingResult_4601.UltraGrid2.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False; ultraGridPlan.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False; splitContainer2.SplitterDistance = 180; foreach (UltraGridColumn ugc in ultraGridPlan.DisplayLayout.Bands[0].Columns) { ugc.SortIndicator = SortIndicator.Disabled; } PanelSizeFlag = 0; timer1.Tick += new EventHandler(timer1_Tick); ShowShift(); } private void ShowShift() { colShowShiftGroup1.Ob = this.ob; colShowShiftGroup1.Group = this.UserInfo.GetUserGroup(); colShowShiftGroup1.Shift = this.UserInfo.GetUserOrder(); colShowShiftGroup1.ShowShift(); colShowShiftGroup1.Timer1.Enabled = true; } /// /// 页面开启事件 /// /// protected override void OnShown(EventArgs e) { base.OnShown(e); string hostname = Dns.GetHostName(); IPAddress ip = Dns.GetHostByName(hostname).AddressList[0]; NativeMethodNew na = new NativeMethodNew(this.ob); Departm = UserInfo.GetDepartment(); PLineCode = na.GetPCode(Departm); PlineCod = na.GetPCode(Departm);//获取 用户 对应的产线 if (PlineCod.Equals("C008") || PlineCod.Equals("C009") || PlineCod.Equals("C012") || PlineCod.Equals("C017") || PlineCod.Equals("C072")) { this.rollingCard1.ChangCard(); } ultraTabControl1.Tabs[1].Visible = false; switch (PLineCode) { case "C009": sizingResult1.UltraGrid2.DisplayLayout.Bands[0].Columns["ELE2#"].Header.Appearance.ForeColor = Color.Gray; sizingResult1.UltraGrid2.DisplayLayout.Bands[0].Columns["ELE2#S"].Header.Appearance.ForeColor = Color.Gray; sizingResult1.UltraGrid2.DisplayLayout.Bands[0].Columns["MainELE2"].CellActivation = Activation.NoEdit; sizingResult1.UltraGrid2.DisplayLayout.Bands[0].Columns["SELESpeed2"].CellActivation = Activation.NoEdit; break; case "C008": break; case "C017": ultraTabControl1.Tabs[0].Visible = false; ultraTabControl1.Tabs[1].Visible = true; break; case "C072": ultraTabControl1.Tabs[0].Visible = false; ultraTabControl1.Tabs[1].Visible = true; break; } Sign(); frmTechnological1.InitMilSet(PLineCode, "40110", this.ob); PlanQuery(); foreach (UltraGridRow ugr in ultraGridPlan.Rows) { ugr.Cells["JUDGE_NO"].Value = BaseMethod.getJudgeStoveNo(ugr.Cells["JUDGE_STOVE_NO"].Value.ToString()); } } /// /// 签名 /// private void Sign() { ColUserName col = new ColUserName(); col.StationId = "5"; col.PlineCode = PLineCode; col.ColGroup = Group; col.Ob = this.ob; col.ShowDialog(); _UserID = col.getUserId(); _UserName = col.getUserName(); } /// /// 初始化控件 /// public void InitControl() { if (chkLotNo.Checked) { txtLOT_NO.Enabled = true; } else { txtLOT_NO.Enabled = false; } if (chkHeatNo.Checked) { txtJudgeStoveNo.Enabled = true; } else { txtJudgeStoveNo.Enabled = false; } } #endregion #region 控制赋值 方法 /// /// 刷新 /// public void ReFresh() { } /// /// 更改剔除坯料行颜色 /// public void ChangeGridColor() { if (ultraGridPlan.Rows.Count > 0) { foreach (UltraGridRow ugr in ultraGridPlan.Rows) { if (ugr.Cells["IS_START"].Value.ToString() != "未开始定径" && ugr.Cells["IS_START"].Value.ToString() != "已开始定径" && ugr.Cells["IS_START"].Value.ToString() != "已完成定径") { switch (Convert.ToInt32(ugr.Cells["IS_START"].Value)) { case 3: ugr.Cells["IS_START"].Value = "未开始定径"; break; case 0: ugr.Cells["IS_START"].Value = "已开始定径"; break; case 1: ugr.Cells["IS_START"].Value = "已完成定径"; break; } } } } foreach (UltraGridRow ugr in ultraGridPlan.Rows) { if (ugr.Cells["IS_START"].Value.ToString() == "已完成定径") { ugr.Appearance.BackColor = Color.YellowGreen; } } foreach (UltraGridRow ugr in ultraGridMatSeq.Rows) { if (ugr != null) { switch (ugr.Cells["STATUS"].Value.ToString()) { case "剔除": ugr.Appearance.BackColor = Color.Yellow; break; } switch (ugr.Cells["CHANGE_FLAG"].Value.ToString()) { case "待接班确认": ugr.Appearance.BackColor = Color.LightGreen; break; } } } } /// /// 查询流通卡信息 /// public void GetRollingCard() { UltraGridRow ugr = ultraGridPlan.ActiveRow; if (ugr != null) { string JudgeStoveNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString(); DataTable dt = new DataTable(); if (PlineCod.Equals("C008") || PlineCod.Equals("C009") || PlineCod.Equals("C012") || PlineCod.Equals("C017") || PlineCod.Equals("C072")) { dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getRollingCard1", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, this.ob); } else { dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getRollingCard", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, this.ob); } RollingCardEditGrid(dt, JudgeStoveNo); } } /// /// 查询管号队列 /// public void GetFurRack() { dtMatSeq.Clear(); UltraGridRow ugr = ultraGridPlan.ActiveRow; if (ugr != null) { string JudgeStoveNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString(); DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.SizingResult.getSizingRackSeq", new object[] { JudgeStoveNo }, this.ob); GridHelper.CopyDataToDatatable(ref dt, ref dtMatSeq, true); ultraGridMatSeq.DisplayLayout.Bands[0].PerformAutoResizeColumns(true, PerformAutoSizeType.AllRowsInBand); } ChangeGridColor(); } #endregion #region 事件 /// /// ToolBar按钮 /// /// /// public override void ToolBar_Click(object sender, string ToolbarKey) { switch (ToolbarKey) { case "DoQuery": PlanQuery(); break; case "DoSave": ResultSave(); break; case "DoNode": ResultNode(); break; case "DoNodeBack": NodeBack(); break; case "NodeQuery": NodeQuery(); break; case "DoStart": DoStart(); break; case "DoStartBack": StartBack(); break; case "DoSign": Sign(); break; case "DoPrint": PrintResult(); break; case "DoPrint2": PrintResult2(); break; case "DoToolChange": DoToolChange(); break; case "DoHotCheck": DoHotCheck(); break; case "DoChangeCancel": ChangeCancel(); break; case "DoQueryBefore": QueryBefore(); break; case "Close": this.Dispose(); this.Close(); break; } } /// /// 判断是否能开始当前炉次 /// /// private bool IsStart() { bool Start = true; foreach (UltraGridRow ugr in ultraGridPlan.Rows) { if (ugr.Cells["IS_START"].Value.ToString() == "已开始定径") { MessageBox.Show("炉号【" + ugr.Cells["JUDGE_STOVE_NO"].Value.ToString() + "】正在定径,不能两炉同时开始定径", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning); Start = false; } } return Start; } /// /// checkbox点击事件 /// /// /// private void chkDate_CheckedChanged(object sender, EventArgs e) { if (chkLotNo.Checked) { txtLOT_NO.Enabled = true; } else { txtLOT_NO.Enabled = false; } if (chkHeatNo.Checked) { txtJudgeStoveNo.Enabled = true; } else { txtJudgeStoveNo.Enabled = false; } if (chkStatusQuery.Checked) { PlanStatusQuery = "99"; PlanStartStatusQuery = "60"; } else { PlanStatusQuery = "59"; PlanStartStatusQuery = "00"; } if (chkAutoRefresh.Checked) { timer1.Enabled = true; } else { timer1.Enabled = false; } } /// /// 计划查询 /// public void PlanQuery() { string PrimaKey = ""; UltraGridRow ugr = this.ultraGridPlan.ActiveRow; if (ugr != null) { PrimaKey = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString(); } if (chkHeatNo.Checked == true) { if (string.IsNullOrEmpty(this.txtJudgeStoveNo.Text)) { MessageBox.Show("请输入判定炉号后再执行查询操作!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } QueryMainPlan.JudgeStoveNo = this.txtJudgeStoveNo.Text; } else { QueryMainPlan.JudgeStoveNo = ""; } if (chkLotNo.Checked == true) { if (string.IsNullOrEmpty(this.txtLOT_NO.Text)) { MessageBox.Show("请输入生产批号后再执行查询操作!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } QueryMainPlan.LotNo = this.txtLOT_NO.Text; } else { QueryMainPlan.LotNo = ""; } //dtMatSeq.Clear(); dtPlan.Clear(); QueryMainPlan.PlineCode = PlineCod; QueryMainPlan.Status = PlanStatusQuery; QueryMainPlan.StartStatus = PlanStartStatusQuery; QueryMainPlan.ProPlanId = proPlanId; QueryMainPlan.GxPlanNo = gxPlanNo; //查询计划记录 DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getSingleMainPlan", new object[] { QueryMainPlan, 6 }, this.ob); if (dt.Rows.Count == 0) { if (ShowMessageFlag == 0) { MessageBox.Show("未查询到匹配的数据,请重新查询!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning); } return; } GridHelper.CopyDataToDatatable(ref dt, ref dtPlan, true); ChangeGridColor(); //ultraGridPlan.DisplayLayout.Bands[0].PerformAutoResizeColumns(true, PerformAutoSizeType.AllRowsInBand); if (ugr != null) { foreach (UltraGridRow ugr1 in ultraGridPlan.Rows) { //ugr1.Cells["JUDGE_NO"].Value = BaseMethod.getJudgeStoveNo(ugr1.Cells["JUDGE_STOVE_NO"].Value.ToString()); if (ugr1.Cells["JUDGE_STOVE_NO"].Value.ToString() == PrimaKey) { ugr1.Activated = true; } } } ChangeGridColor(); } /// /// 查询结果Gird单击事件 /// /// /// private void ultraGridPlan_AfterRowActivate(object sender, EventArgs e) { dtMatSeq.Clear(); if (this.dtPlan.Rows.Count > 0) { UltraGridRow ugr = ultraGridPlan.ActiveRow; if (ugr != null) { //查询主计划信息 dtMatSeq.Clear(); string JudgeStoveNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString(); ActiveJUDGE_STOVE_NO = JudgeStoveNo; ActiveResultNo = ugr.Cells["ID"].Value.ToString(); proPlanId = ugr.Cells["PRO_PLAN_ID"].Value.ToString(); gxPlanNo = ugr.Cells["GX_PLAN_NO"].Value.ToString(); lotNo = ugr.Cells["LOT_NO"].Value.ToString(); MainPlan.JudgeStoveNo = JudgeStoveNo; MainPlan.ProPlanId = proPlanId; MainPlan.GxPlanNo = gxPlanNo; string Status = ugr.Cells["IS_START"].Value.ToString(); ActiveStatus = Status; // PLineCode = ugr.Cells["Pline_Code"].Value.ToString(); DataTable dtMP = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getSingleMainPlanForHeatNo", new object[] { MainPlan }, this.ob); if (dtMP.Rows.Count > 0) { if (dtMP.Rows[0]["PLINE_CODE"].ToString() == "C017" || dtMP.Rows[0]["PLINE_CODE"].ToString() == "C072") { ultraTabControl1.Tabs[0].Visible = false; ultraTabControl1.Tabs[1].Visible = true; } else { ultraTabControl1.Tabs[0].Visible = true; ultraTabControl1.Tabs[1].Visible = false; } PLineCode = dtMP.Rows[0]["PLINE_CODE"].ToString(); GridEdit(dtMP); //轧制计划信息 //查询流通卡信息 DataTable dtRollingCard = new DataTable(); if (PlineCod.Equals("C008") || PlineCod.Equals("C009") || PlineCod.Equals("C012") || PlineCod.Equals("C017") || PlineCod.Equals("C072")) { dtRollingCard = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getRollingCard1", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, this.ob); } else { dtRollingCard = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getRollingCard", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, this.ob); } if (dtRollingCard.Rows.Count > 0) { RollingCardEditGrid(dtRollingCard, JudgeStoveNo); } else { //清空流通卡值 rollingCard1.Value.Clear(); GridHelper.InitCardGrid(rollingCard1.RollCardDataSource1, rollingCard1.UltraGrid4); } //查询定径实绩信息 DataTable dtSizingResult = ServerHelper.GetData("com.steering.mes.zgmil.coup.SizingResult.getSizingResult", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, this.ob); if (dtSizingResult.Rows.Count > 0) { if (PLineCode != "C017" && PLineCode != "C072") { SizingResultEdit(dtSizingResult); } else { Sizing460ResultEidt(dtSizingResult, dtMP.Rows[0]["PIPE_SIZE"].ToString()); } } else { this.sizingResult1.Value.Clear(); this.sinzingResult_4601.Value.Clear(); sizingResult1.UpdateDate(); sinzingResult_4601.UpdateDate(); //清空定径实绩 //GridHelper.InitCardGrid(sizingResult1.SizingDataSource1, sizingResult1.UltraGrid2); //清空定径实绩460 //GridHelper.InitCardGrid(sinzingResult_4601.SizingDataSource1, sinzingResult_4601.UltraGrid2); } if (Status != "未开始定径") { GetFurRack(); } else { dtMatSeq.Rows.Clear(); } ChangeGridColor(); } } } } /// /// 双击计划开始定径 /// /// /// private void DoStart() //private void ultraGridPlan_DoubleClickRow(object sender, Infragistics.Win.UltraWinGrid.DoubleClickRowEventArgs e) { //if (!IsStart()) //{ // return; //} NativeMethodNew NaMethod = new NativeMethodNew(this.ob); if (ultraGridPlan.Rows.Count > 0) { UltraGridRow ugr = ultraGridPlan.ActiveRow; if (ugr != null) { string HeatNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString(); string Statue = ugr.Cells["IS_START"].Value.ToString(); string ResultNo = ugr.Cells["ID"].Value.ToString(); ActiveResultNo = ResultNo; MainPlan.JudgeStoveNo = HeatNo; MainPlan.ProPlanId = proPlanId; MainPlan.GxPlanNo = gxPlanNo; ActiveJUDGE_STOVE_NO = HeatNo; //NativeMethodNew Nvw = new NativeMethodNew(this.ob); //if (PLineCode == "C009" || PLineCode == "C012" || PLineCode == "C017") //{ // if (!Nvw.isBegineNode(HeatNo, 3)) // { // MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(HeatNo) + "】未连轧,不能定径。"); // return; // } //} //else //{ // if (!Nvw.isBegineNode(HeatNo, 4)) // { // MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(HeatNo) + "】未入再加热炉,不能定径。"); // return; // } //} if (Statue == "已完成定径") { MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(HeatNo) + "】已完成定径不能再次开始!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } DataTable dtMP = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getSingleMainPlanForHeatNo", new object[] { MainPlan }, this.ob); if (dtMP.Rows.Count > 0) { GridEdit(dtMP); //轧制计划信息 PLineCode = dtMP.Rows[0]["PLINE_CODE"].ToString(); } //if (!NaMethod.isBegineNode(HeatNo, 0)) //{ // MessageBox.Show("炉号【" + HeatNo + "】未开始锯切,不能定径!"); // return; //} if (Statue != "已开始定径") { //if (MessageUtil.ShowYesNoAndQuestion("确认炉号【" + MainPlan.JudgeStoveNo + "】开始定径?") == DialogResult.No) //{ // return; //} // string PLineCode = dtMP.Rows[0]["PLINE_CODE"].ToString(); string LotNo = dtMP.Rows[0]["LOT_NO"].ToString(); string StoveNo = dtMP.Rows[0]["STOVE_NO"].ToString(); //修改主计划状态为 55-开始定径,新增定径实绩信息 if (tempsizingresult != null) { //1 SizingResultEntity.PipeSize = tempsizingresult.PipeSize; SizingResultEntity.EntranceSpeed = tempsizingresult.EntranceSpeed; SizingResultEntity.PassSeries = tempsizingresult.PassSeries; SizingResultEntity.RackNo = tempsizingresult.RackNo; SizingResultEntity.EntranceTemp = tempsizingresult.EntranceTemp; SizingResultEntity.ExitTemp = tempsizingresult.ExitTemp; SizingResultEntity.ExitSpeed = tempsizingresult.ExitSpeed; SizingResultEntity.ProductSize = tempsizingresult.ProductSize; SizingResultEntity.HostEleSpeed1 = tempsizingresult.HostEleSpeed1; SizingResultEntity.HostEleSpeed2 = tempsizingresult.HostEleSpeed2; SizingResultEntity.HostEleSpeed3 = tempsizingresult.HostEleSpeed3; SizingResultEntity.FoldEleSpeed1 = tempsizingresult.FoldEleSpeed1; SizingResultEntity.FoldEleSpeed2 = tempsizingresult.FoldEleSpeed2; SizingResultEntity.FoldEleSpeed3 = tempsizingresult.FoldEleSpeed3; SizingResultEntity.BeginRollingTemp = tempsizingresult.BeginRollingTemp; SizingResultEntity.FinishRollNum = tempsizingresult.FinishRollNum; //460 SizingResultEntity.EntranceTemp = tempsizingresult.EntranceTemp; SizingResultEntity.ExitTemp = tempsizingresult.ExitTemp; SizingResultEntity.EntranceSpeed = tempsizingresult.EntranceSpeed; SizingResultEntity.ExitSpeed = tempsizingresult.ExitSpeed; SizingResultEntity.BedRhythm = tempsizingresult.BedRhythm; SizingResultEntity.ProductSize = tempsizingresult.ProductSize; SizingResultEntity.HostEleSpeed1 = tempsizingresult.HostEleSpeed1; SizingResultEntity.HostEleSpeed2 = tempsizingresult.HostEleSpeed2; SizingResultEntity.HostEleSpeed3 = tempsizingresult.HostEleSpeed3; SizingResultEntity.HostEleSpeed4 = tempsizingresult.HostEleSpeed4; SizingResultEntity.HostEleSpeed5 = tempsizingresult.HostEleSpeed5; SizingResultEntity.HostEleSpeed6 = tempsizingresult.HostEleSpeed6; SizingResultEntity.HostEleSpeed7 = tempsizingresult.HostEleSpeed7; SizingResultEntity.HostEleSpeed8 = tempsizingresult.HostEleSpeed8; SizingResultEntity.HostEleSpeed9 = tempsizingresult.HostEleSpeed9; SizingResultEntity.HostEleSpeed10 = tempsizingresult.HostEleSpeed10; } SizingResultEntity.JudgeStoveNo = HeatNo; SizingResultEntity.ResultNo = ResultNo; SizingResultEntity.LotNo = LotNo; SizingResultEntity.StoveNo = StoveNo; SizingResultEntity.PlineCode = PLineCode; SizingResultEntity.Status = "55"; SizingResultEntity.StartTime = DateTime.Now.ToString(); SizingResultEntity.ProPlanId = proPlanId; SizingResultEntity.GxPlanNo = gxPlanNo; int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.SizingResult.startSizing", new object[] { SizingResultEntity }, this.ob); //往跟踪记录表插入探伤开始时间 NativeMethodNew na = new NativeMethodNew(this.ob); na.InsertSTAferDoubleClick(HeatNo, 5, "0", proPlanId, gxPlanNo); DataTable dt1 = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getSingleMainPlan", new object[] { QueryMainPlan, 6 }, this.ob); GridHelper.CopyDataToDatatable(ref dt1, ref dtPlan, true); ChangeGridColor(); //ultraGridPlan.DisplayLayout.Bands[0].PerformAutoResizeColumns(true, PerformAutoSizeType.AllRowsInBand); foreach (UltraGridRow ugr1 in this.ultraGridPlan.Rows) { ugr1.Cells["JUDGE_NO"].Value = BaseMethod.getJudgeStoveNo(ugr1.Cells["JUDGE_STOVE_NO"].Value.ToString()); if (ugr1.Cells["JUDGE_STOVE_NO"].Value.ToString() == HeatNo) { ultraGridPlan.ActiveRow = ugr1; } } GetFurRack(); } else { MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(HeatNo) + "】已开始定径,不能再次开始定径!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } } } /// /// 保存 /// public void ResultSave() { try { sizingResult1.UltraGrid2.UpdateData(); sinzingResult_4601.UltraGrid2.UpdateData(); } catch (Exception e) { MessageBox.Show("请输入正确的时间。"); return; } if (this.ultraGridPlan.ActiveRow == null && ActiveJUDGE_STOVE_NO == null) { // MessageBox.Show("未选择任何炉号,请选择炉号后进行保存操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } UltraGridRow ugr = ultraGridPlan.ActiveRow; UltraGridRow ugr1 = this.sizingResult1.UltraGrid2.Rows[0]; //UltraGridRow ugr2 = this.sinzingResult_4601.UltraGrid2.Rows[0]; UltraGridRow ugr3 = this.rollingCard1.UltraGrid4.Rows[0]; //sizingResult1.UltraGrid2.UpdateData(); //sinzingResult_4601.UltraGrid2.UpdateData(); SizingResultSave.Clear(); if (ugr != null) { SizingResultSave.JudgeStoveNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString(); if (ugr.Cells["IS_START"].Value.ToString() == "未开始定径") { MessageBox.Show("炉号【" + SizingResultSave.JudgeStoveNo + "】未开始定径不能保存实绩!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } //if (ugr.Cells["IS_START"].Value.ToString() == "已完成定径") //{ // MessageBox.Show("炉号【" + SizingResultSave.JudgeStoveNo + "】已完成定径不能保存实绩!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning); // return; //} //if (MessageUtil.ShowYesNoAndQuestion("确认炉号【" + SizingResultSave.JudgeStoveNo + "】定径实绩信息保存?") == DialogResult.No) //{ // return; //} //460机组 if (PLineCode == "C017" || PLineCode == "C072") { this.sinzingResult_4601.UltraGrid2.UpdateData(); ////---从再加热取得剔除支数 //SizingResultSave.ScrapNum = this.sinzingResult_4601.SizingDataSource1.Rows[0]["SCRAP_NUM"].ToString(); //if (!string.IsNullOrEmpty(this.rollingCard1.UltraGrid4.Rows[0].Cells["QualifiedNum6"].Value.ToString())) //{ // if (int.Parse(this.rollingCard1.UltraGrid4.Rows[0].Cells["QualifiedNum6"].Value.ToString()) > int.Parse(SizingResultSave.ScrapNum.ToString())) // { // SizingResultSave.ProductNum = int.Parse(this.rollingCard1.UltraGrid4.Rows[0].Cells["QualifiedNum6"].Value.ToString()) - int.Parse(SizingResultSave.ScrapNum.ToString()); // } // else // { // MessageBox.Show("存在上一道工序已经剔除的管坯在本道工序也剔除了,请回退后再进行结炉操作。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); // return; // } //}//--------------------从再加热取得 SizingResultSave.ScrapNum = this.sinzingResult_4601.SizingDataSource1.Rows[0]["SCRAP_NUM"].ToString(); //if (!string.IsNullOrEmpty(this.rollingCard1.UltraGrid4.Rows[0].Cells["QualifiedNum5"].Value.ToString())) //{ // if (int.Parse(this.rollingCard1.UltraGrid4.Rows[0].Cells["QualifiedNum5"].Value.ToString()) > int.Parse(SizingResultSave.ScrapNum.ToString())) // { // SizingResultSave.ProductNum = int.Parse(this.rollingCard1.UltraGrid4.Rows[0].Cells["QualifiedNum5"].Value.ToString()) - int.Parse(SizingResultSave.ScrapNum.ToString()); // } // else // { // MessageBox.Show("存在上一道工序已经剔除的管坯在本道工序也剔除了,请回退后再进行结炉操作。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); // return; // } //} //合格支数 //SizingResultSave.ProductNum = this.sinzingResult_4601.SizingDataSource1.Rows[0]["PRODUCT_NUM"].ToString(); //荒管尺寸 //SizingResultSave.PipeSize = this.sinzingResult_4601.SizingDataSource1.Rows[0]["SIZE"].ToString(); //轧辊入口速度 SizingResultSave.EntranceSpeed = this.sinzingResult_4601.SizingDataSource1.Rows[0]["ENTRANCE_SPEED"].ToString(); //交接班支数 SizingResultSave.ChangeNum = this.sinzingResult_4601.SizingDataSource1.Rows[0]["CHANGE_NUM"].ToString(); //轧辊出口速度 SizingResultSave.ExitSpeed = this.sinzingResult_4601.SizingDataSource1.Rows[0]["EXIT_SPEED"].ToString(); //荒管尺寸 SizingResultSave.PipeSize = this.sinzingResult_4601.SizingDataSource1.Rows[0]["PIPE_SIZE"].ToString(); //成品规格 SizingResultSave.ProductSize = this.sinzingResult_4601.SizingDataSource1.Rows[0]["PRODUCT_SIZE"].ToString(); //终轧温度 SizingResultSave.ExitTemp = this.sinzingResult_4601.SizingDataSource1.Rows[0]["EXIT_TEMP"].ToString(); //入口温度 SizingResultSave.EntranceTemp = this.sinzingResult_4601.SizingDataSource1.Rows[0]["ENTRANCE_TEMP"].ToString(); //小冷床节奏 SizingResultSave.BedRhythm = this.sinzingResult_4601.SizingDataSource1.Rows[0]["BED_RHYTHM"].ToString(); //主电机转速1 SizingResultSave.HostEleSpeed1 = this.sinzingResult_4601.SizingDataSource1.Rows[0]["HOST_ELE_SPEED1"].ToString(); //主电机转速2 SizingResultSave.HostEleSpeed2 = this.sinzingResult_4601.SizingDataSource1.Rows[0]["HOST_ELE_SPEED2"].ToString(); //主电机转速3 SizingResultSave.HostEleSpeed3 = this.sinzingResult_4601.SizingDataSource1.Rows[0]["HOST_ELE_SPEED3"].ToString(); //主电机转速4 SizingResultSave.HostEleSpeed4 = this.sinzingResult_4601.SizingDataSource1.Rows[0]["HOST_ELE_SPEED4"].ToString(); //主电机转速5 SizingResultSave.HostEleSpeed5 = this.sinzingResult_4601.SizingDataSource1.Rows[0]["HOST_ELE_SPEED5"].ToString(); //主电机转速6 SizingResultSave.HostEleSpeed6 = this.sinzingResult_4601.SizingDataSource1.Rows[0]["HOST_ELE_SPEED6"].ToString(); //主电机转速7 SizingResultSave.HostEleSpeed7 = this.sinzingResult_4601.SizingDataSource1.Rows[0]["HOST_ELE_SPEED7"].ToString(); //主电机转速8 SizingResultSave.HostEleSpeed8 = this.sinzingResult_4601.SizingDataSource1.Rows[0]["HOST_ELE_SPEED8"].ToString(); //主电机转速9 SizingResultSave.HostEleSpeed9 = this.sinzingResult_4601.SizingDataSource1.Rows[0]["HOST_ELE_SPEED9"].ToString(); //主电机转速10 SizingResultSave.HostEleSpeed10 = this.sinzingResult_4601.SizingDataSource1.Rows[0]["HOST_ELE_SPEED10"].ToString(); //SizingResultSave.FinishRollNum = this.sinzingResult_4601.SizingDataSource1.Rows[0]["FINISH_ROLL_NUM"].ToString(); //主电机转速11 SizingResultSave.HostEleSpeed11 = this.sinzingResult_4601.SizingDataSource1.Rows[0]["HOST_ELE_SPEED11"].ToString(); //主电机转速12 SizingResultSave.HostEleSpeed12 = this.sinzingResult_4601.SizingDataSource1.Rows[0]["HOST_ELE_SPEED12"].ToString(); //备注 SizingResultSave.Remark = this.sinzingResult_4601.SizingDataSource1.Rows[0]["REMARK"].ToString(); //开始时间 SizingResultSave.StartTime = this.sinzingResult_4601.SizingDataSource1.Rows[0]["START_TIME"].ToString(); //结束时间 SizingResultSave.EndTime = this.sinzingResult_4601.SizingDataSource1.Rows[0]["END_TIME"].ToString(); //精轧机架 SizingResultSave.RackNo = this.sinzingResult_4601.SizingDataSource1.Rows[0]["RACK_NO"].ToString(); //终轧温度(中) SizingResultSave.ExitTemp3=this.sinzingResult_4601.SizingDataSource1.Rows[0]["EXIT_TEMP3"].ToString(); //终轧温度(前) SizingResultSave.ExitTemp2=this.sinzingResult_4601.SizingDataSource1.Rows[0]["EXIT_TEMP2"].ToString(); //int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.SizingResult.saveSizingResult", new object[] { SizingResultSave }, this.ob); //SizingResultSave = NativeMethod.GetEntityToEntity(SizingResultSave, this.sinzingResult_4601.Value); } else { sizingResult1.UltraGrid2.UpdateData(); if (PLineCode.Equals("C009") || PLineCode.Equals("C012"))//258和阿塞尔机组 { SizingResultSave.ScrapNum = this.sizingResult1.SizingDataSource1.Rows[0]["ScrapNum"].ToString(); if (!string.IsNullOrEmpty(this.rollingCard1.UltraGrid4.Rows[0].Cells["QualifiedNum5"].Value.ToString())) { if (int.Parse(this.rollingCard1.UltraGrid4.Rows[0].Cells["QualifiedNum5"].Value.ToString()) > int.Parse(SizingResultSave.ScrapNum.ToString())) { SizingResultSave.ProductNum = (int.Parse(this.rollingCard1.UltraGrid4.Rows[0].Cells["QualifiedNum5"].Value.ToString()) - int.Parse(SizingResultSave.ScrapNum.ToString())).ToString(); } else { //MessageBox.Show("存在上一道工序已经剔除的管坯在本道工序也剔除了,请回退后再进行结炉操作。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); //return; } } } else { //剔除支数 SizingResultSave.ScrapNum = this.sizingResult1.SizingDataSource1.Rows[0]["ScrapNum"].ToString(); if (!string.IsNullOrEmpty(this.rollingCard1.UltraGrid4.Rows[0].Cells["QualifiedNum6"].Value.ToString())) { if (int.Parse(this.rollingCard1.UltraGrid4.Rows[0].Cells["QualifiedNum6"].Value.ToString()) > int.Parse(SizingResultSave.ScrapNum.ToString())) { //合格支数 SizingResultSave.ProductNum = (int.Parse(this.rollingCard1.UltraGrid4.Rows[0].Cells["QualifiedNum6"].Value.ToString()) - int.Parse(SizingResultSave.ScrapNum.ToString())).ToString(); } else { //MessageBox.Show("存在上一道工序已经剔除的管坯在本道工序也剔除了,请回退后再进行结炉操作。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); //return; } } } //荒管尺寸 SizingResultSave.PipeSize = this.sizingResult1.SizingDataSource1.Rows[0]["PipeSize"].ToString(); //轧辊入口速度 SizingResultSave.EntranceSpeed = this.sizingResult1.SizingDataSource1.Rows[0]["EntranceSpeed"].ToString(); //轧辊出口速度 SizingResultSave.ExitSpeed = this.sizingResult1.SizingDataSource1.Rows[0]["ExitSpeed"].ToString(); //轧机入口温度 SizingResultSave.EntranceTemp = this.sizingResult1.SizingDataSource1.Rows[0]["RollEntranceTemp"].ToString(); //成品规格 SizingResultSave.ProductSize = this.sizingResult1.SizingDataSource1.Rows[0]["ProductSize"].ToString(); //终轧温度 SizingResultSave.ExitTemp = this.sizingResult1.SizingDataSource1.Rows[0]["EndRollingTemp"].ToString(); //孔型系列 SizingResultSave.PassSeries = this.sizingResult1.SizingDataSource1.Rows[0]["KXXL"].ToString(); //精轧系列机架数 SizingResultSave.FinishRollNum = this.sizingResult1.SizingDataSource1.Rows[0]["RackNum"].ToString(); //交接班支数 //SizingResultSave.ScrapNum = this.sizingResult1.SizingDataSource1.Rows[0]["ChangeClassNum"].ToString(); //主电机转速1 SizingResultSave.HostEleSpeed1 = this.sizingResult1.SizingDataSource1.Rows[0]["MainELE1"].ToString(); //主电机转速2 SizingResultSave.HostEleSpeed2 = this.sizingResult1.SizingDataSource1.Rows[0]["MainELE2"].ToString(); //主电机转速3 SizingResultSave.HostEleSpeed3 = this.sizingResult1.SizingDataSource1.Rows[0]["MainELE3"].ToString(); //叠加电机转速1 SizingResultSave.FoldEleSpeed1 = this.sizingResult1.SizingDataSource1.Rows[0]["SELESpeed1"].ToString(); //叠加电机转速2 SizingResultSave.FoldEleSpeed2 = this.sizingResult1.SizingDataSource1.Rows[0]["SELESpeed2"].ToString(); //叠加电机转速3 SizingResultSave.FoldEleSpeed3 = this.sizingResult1.SizingDataSource1.Rows[0]["SELESpeed3"].ToString(); //备注 SizingResultSave.Remark = this.sizingResult1.SizingDataSource1.Rows[0]["Remark"].ToString(); //开始时间 SizingResultSave.StartTime = this.sizingResult1.SizingDataSource1.Rows[0]["StartTime"].ToString(); //结束时间 SizingResultSave.EndTime = this.sizingResult1.SizingDataSource1.Rows[0]["EndTime"].ToString(); //开轧温度 SizingResultSave.BeginRollingTemp = this.sizingResult1.SizingDataSource1.Rows[0]["beginRollingTemp"].ToString(); //终轧温度(中) SizingResultSave.ExitTemp3=this.sizingResult1.SizingDataSource1.Rows[0]["ExitTemp3"].ToString(); //终轧温度(前) SizingResultSave.ExitTemp2=this.sizingResult1.SizingDataSource1.Rows[0]["ExitTemp2"].ToString(); //int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.SizingResult.saveSizingResult", new object[] { SizingResultSave }, this.ob); //SizingResultSave = NativeMethod.GetEntityToEntity(SizingResultSave, this.sizingResult1.Value); } if (string.IsNullOrEmpty(SizingResultSave.StartTime.ToString())) { MessageBox.Show("开始时间不能为空,请输入正确的开始时间"); return; } //查询结炉状态,已结炉的计划 结炉时间不能为空 DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getNodeStatus", new object[] { ActiveJUDGE_STOVE_NO, ActiveResultNo, proPlanId, gxPlanNo }, this.ob); if (int.Parse(dt.Rows[0][0].ToString()) > 59) { if (string.IsNullOrEmpty(SizingResultSave.EndTime.ToString())) { MessageBox.Show("结束时间不能为空,请输入正确的结束时间"); return; } //开始时间必须小于结束时间 if (DateTime.Parse(SizingResultSave.StartTime) > DateTime.Parse(SizingResultSave.EndTime)) { MessageBox.Show("结束时间不能小于开始时间。"); return; } } SizingResultSave.ProPlanId = proPlanId; SizingResultSave.GxPlanNo = gxPlanNo; int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.SizingResult.saveSizingResult", new object[] { SizingResultSave }, this.ob); tempsizingresult = NativeMethod.GetEntityToEntity(tempsizingresult, SizingResultSave); this.sinzingResult_4601.IsCellSelect = false; this.sizingResult1.IsCellSelect = false; if (ShowMessageFlag == 0) { MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(SizingResultSave.JudgeStoveNo.ToString()) + "】保存成功!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } GetFurRack(); PlanQuery(); } /// /// 结炉 /// public void ResultNode() { ResultSave(); try { sizingResult1.UltraGrid2.UpdateData(); sinzingResult_4601.UltraGrid2.UpdateData(); } catch (Exception e) { MessageBox.Show("请输入正确的时间。"); return; } HOTMethod hm = new HOTMethod(this.ob); if (this.ultraGridPlan.ActiveRow == null && ActiveJUDGE_STOVE_NO == null) { MessageBox.Show("未选择任何炉号,请选择炉号后进行保存操作。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } //判断是否有重复剔除的坯子 foreach (UltraGridRow ugr4 in ultraGridMatSeq.Rows) { if (ugr4.Cells["MAT_NO"].Value.ToString().Equals("") && ugr4.Cells["STATUS"].Value.ToString().Equals("剔除")) { MessageBox.Show("不存在序号第【" + ugr4.Cells["SEQ"].Value.ToString() + "】的坯子,它已被其它工序剔除,不能再次剔除", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } } UltraGridRow ugr = ultraGridPlan.ActiveRow; UltraGridRow ugr1 = this.sizingResult1.UltraGrid2.Rows[0]; //UltraGridRow ugr2 = this.sinzingResult_4601.UltraGrid2.Rows[0]; UltraGridRow ugr3 = this.rollingCard1.UltraGrid4.Rows[0]; //sizingResult1.UltraGrid2.UpdateData(); //sinzingResult_4601.UltraGrid2.Update(); SizingResultSave.Clear(); if (ugr != null) { string JudgeStoveNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString(); string Status = ugr.Cells["IS_START"].Value.ToString(); string ResultNo = ugr.Cells["ID"].Value.ToString(); string proPlanId = ugr.Cells["PRO_PLAN_ID"].Value.ToString(); string gxPlanNo = ugr.Cells["GX_PLAN_NO"].Value.ToString(); if (Status != "已开始定径") { MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】未开始定径,不允许结炉!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (Status == "已完成定径") { MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】已完成定径不能结炉!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } MainPlan.JudgeStoveNo = JudgeStoveNo; MainPlan.ProPlanId = proPlanId; MainPlan.GxPlanNo = gxPlanNo; DataTable dtPlan = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getSingleMainPlanForHeatNo", new object[] { MainPlan }, this.ob); if (dtPlan.Rows.Count > 0) { //if (string.IsNullOrEmpty(dtPlan.Rows[0]["CUT_HEAD_LENGTHA"].ToString()) || string.IsNullOrEmpty(dtPlan.Rows[0]["CUT_TRAIL_LENGTHA"].ToString())) //{ // MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】热取样工序分切参数未录入,不能结炉!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning); // return; //} } MilRefurResultEntity Refur = new MilRefurResultEntity(); Refur.JudgeStoveNo = JudgeStoveNo; //终轧温度 string EXIT_TEMP = ""; DataTable exitTemp = new DataTable(); exitTemp = ServerHelper.GetData("com.steering.mes.zgmil.coup.SizingResult.getSizingResult", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, this.ob); if (exitTemp.Rows.Count > 0) { EXIT_TEMP = exitTemp.Rows[0]["EXIT_TEMP"].ToString(); } if (EXIT_TEMP.Length <= 0) { MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】没有终轧温度,不允许结炉!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } //查看连轧结炉标识 string NodeFlag = ""; DataTable dtFlag = new DataTable(); if (PLineCode.Equals("C017") || PLineCode.Equals("C012") || PLineCode.Equals("C008") || PLineCode.Equals("C009") || PLineCode.Equals("C072")) { dtFlag = ServerHelper.GetData("com.steering.mes.zgmil.coup.SizingResult.getReFurResult1", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, this.ob); } else { dtFlag = ServerHelper.GetData("com.steering.mes.zgmil.coup.SizingResult.getReFurResult", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, this.ob); } // DataTable dtFlag = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmReFurResult.getRefurResult", new object[] { Refur }, this.ob); if (dtFlag.Rows.Count > 0) { NodeFlag = dtFlag.Rows[0]["NODE_FUR_FLAG"].ToString(); } else { MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】上一道工序未开始,不允许结炉!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (NodeFlag != "1") { MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】上一道工序未结炉,不能结炉!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (hm.NodeGetWaitChangeMat(JudgeStoveNo, ResultNo, 5) > 0) { MessageBox.Show("管号【" + hm.NodeGetWaitChangeMat(JudgeStoveNo, ResultNo, 5) + "】未接班确认,不能结炉"); return; } if (MessageUtil.ShowYesNoAndQuestion("确认炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】结炉?") == DialogResult.No) { return; } //460机组 if (PLineCode == "C017" || PLineCode == "C072") { this.sinzingResult_4601.UltraGrid2.UpdateData(); ////---从再加热取得剔除支数 //SizingResultSave.ScrapNum = this.sinzingResult_4601.SizingDataSource1.Rows[0]["SCRAP_NUM"].ToString(); //if (!string.IsNullOrEmpty(this.rollingCard1.UltraGrid4.Rows[0].Cells["QualifiedNum6"].Value.ToString())) //{ // if (int.Parse(this.rollingCard1.UltraGrid4.Rows[0].Cells["QualifiedNum6"].Value.ToString()) > int.Parse(SizingResultSave.ScrapNum.ToString())) // { // SizingResultSave.ProductNum = int.Parse(this.rollingCard1.UltraGrid4.Rows[0].Cells["QualifiedNum6"].Value.ToString()) - int.Parse(SizingResultSave.ScrapNum.ToString()); // } // else // { // MessageBox.Show("存在上一道工序已经剔除的管坯在本道工序也剔除了,请回退后再进行结炉操作。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); // return; // } //}//--------------------从再加热取得 //剔除支数 SizingResultSave.ScrapNum = "0"; DataTable dtScrapNum = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getScrapNum", new object[] { JudgeStoveNo, ResultNo, 5, PLineCode, proPlanId, gxPlanNo }, this.ob); if (dtScrapNum.Rows.Count > 0) { if (!string.IsNullOrEmpty(dtScrapNum.Rows[0][0].ToString())) { SizingResultSave.ScrapNum = dtScrapNum.Rows[0][0].ToString(); } } //合格支数 DataTable dtQANum = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getQANumBefore", new object[] { JudgeStoveNo, ResultNo, 4, PLineCode, proPlanId, gxPlanNo }, this.ob); if (dtQANum.Rows.Count > 0) { if (!string.IsNullOrEmpty(dtQANum.Rows[0][0].ToString())) { if (int.Parse(dtQANum.Rows[0][0].ToString()) > int.Parse(SizingResultSave.ScrapNum.ToString())) { //合格支数 SizingResultSave.ProductNum = (int.Parse(dtQANum.Rows[0][0].ToString()) - int.Parse(SizingResultSave.ScrapNum.ToString())).ToString(); } else { SizingResultSave.ProductNum = "0"; } } else { SizingResultSave.ProductNum = "0"; } } //SizingResultSave.ScrapNum = this.sinzingResult_4601.SizingDataSource1.Rows[0]["SCRAP_NUM"].ToString(); //if (!string.IsNullOrEmpty(this.rollingCard1.UltraGrid4.Rows[0].Cells["QualifiedNum5"].Value.ToString())) //{ // if (int.Parse(this.rollingCard1.UltraGrid4.Rows[0].Cells["QualifiedNum5"].Value.ToString()) > int.Parse(SizingResultSave.ScrapNum.ToString())) // { // SizingResultSave.ProductNum = int.Parse(this.rollingCard1.UltraGrid4.Rows[0].Cells["QualifiedNum5"].Value.ToString()) - int.Parse(SizingResultSave.ScrapNum.ToString()); // } // else // { // MessageBox.Show("存在上一道工序已经剔除的管坯在本道工序也剔除了,请回退后再进行结炉操作。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); // return; // } //} //荒管尺寸 //SizingResultSave.PipeSize = this.sinzingResult_4601.SizingDataSource1.Rows[0]["SIZE"].ToString(); //荒管尺寸 SizingResultSave.PipeSize = this.sinzingResult_4601.SizingDataSource1.Rows[0]["PIPE_SIZE"].ToString(); //交接班支数 SizingResultSave.ChangeNum = this.sinzingResult_4601.SizingDataSource1.Rows[0]["CHANGE_NUM"].ToString(); //轧辊入口速度 SizingResultSave.EntranceSpeed = this.sinzingResult_4601.SizingDataSource1.Rows[0]["ENTRANCE_SPEED"].ToString(); //轧辊出口速度 SizingResultSave.ExitSpeed = this.sinzingResult_4601.SizingDataSource1.Rows[0]["EXIT_SPEED"].ToString(); //精轧机架 SizingResultSave.RackNo = this.sinzingResult_4601.SizingDataSource1.Rows[0]["RACK_NO"].ToString(); //成品规格 SizingResultSave.ProductSize = this.sinzingResult_4601.SizingDataSource1.Rows[0]["PRODUCT_SIZE"].ToString(); //终轧温度 SizingResultSave.ExitTemp = this.sinzingResult_4601.SizingDataSource1.Rows[0]["EXIT_TEMP"].ToString(); //入口温度 SizingResultSave.EntranceTemp = this.sinzingResult_4601.SizingDataSource1.Rows[0]["ENTRANCE_TEMP"].ToString(); //小冷床节奏 SizingResultSave.BedRhythm = this.sinzingResult_4601.SizingDataSource1.Rows[0]["BED_RHYTHM"].ToString(); //主电机转速1 SizingResultSave.HostEleSpeed1 = this.sinzingResult_4601.SizingDataSource1.Rows[0]["HOST_ELE_SPEED1"].ToString(); //主电机转速2 SizingResultSave.HostEleSpeed2 = this.sinzingResult_4601.SizingDataSource1.Rows[0]["HOST_ELE_SPEED2"].ToString(); //主电机转速3 SizingResultSave.HostEleSpeed3 = this.sinzingResult_4601.SizingDataSource1.Rows[0]["HOST_ELE_SPEED3"].ToString(); //主电机转速4 SizingResultSave.HostEleSpeed4 = this.sinzingResult_4601.SizingDataSource1.Rows[0]["HOST_ELE_SPEED4"].ToString(); //主电机转速5 SizingResultSave.HostEleSpeed5 = this.sinzingResult_4601.SizingDataSource1.Rows[0]["HOST_ELE_SPEED5"].ToString(); //主电机转速6 SizingResultSave.HostEleSpeed6 = this.sinzingResult_4601.SizingDataSource1.Rows[0]["HOST_ELE_SPEED6"].ToString(); //主电机转速7 SizingResultSave.HostEleSpeed7 = this.sinzingResult_4601.SizingDataSource1.Rows[0]["HOST_ELE_SPEED7"].ToString(); //主电机转速8 SizingResultSave.HostEleSpeed8 = this.sinzingResult_4601.SizingDataSource1.Rows[0]["HOST_ELE_SPEED8"].ToString(); //主电机转速9 SizingResultSave.HostEleSpeed9 = this.sinzingResult_4601.SizingDataSource1.Rows[0]["HOST_ELE_SPEED9"].ToString(); //主电机转速10 SizingResultSave.HostEleSpeed10 = this.sinzingResult_4601.SizingDataSource1.Rows[0]["HOST_ELE_SPEED10"].ToString(); //SizingResultSave.FinishRollNum = this.sinzingResult_4601.SizingDataSource1.Rows[0]["FINISH_ROLL_NUM"].ToString(); //主电机转速11 SizingResultSave.HostEleSpeed11 = this.sinzingResult_4601.SizingDataSource1.Rows[0]["HOST_ELE_SPEED11"].ToString(); //主电机转速12 SizingResultSave.HostEleSpeed12 = this.sinzingResult_4601.SizingDataSource1.Rows[0]["HOST_ELE_SPEED12"].ToString(); //备注 SizingResultSave.Remark = this.sinzingResult_4601.SizingDataSource1.Rows[0]["REMARK"].ToString(); //开始时间 SizingResultSave.StartTime = this.sinzingResult_4601.SizingDataSource1.Rows[0]["START_TIME"].ToString(); //精轧机架 SizingResultSave.RackNo = this.sinzingResult_4601.SizingDataSource1.Rows[0]["RACK_NO"].ToString(); //int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.SizingResult.saveSizingResult", new object[] { SizingResultSave }, this.ob); //SizingResultSave = NativeMethod.GetEntityToEntity(SizingResultSave, this.sinzingResult_4601.Value); } else { sizingResult1.UltraGrid2.UpdateData(); if (PLineCode.Equals("C008") || PLineCode.Equals("C009") || PLineCode.Equals("C012"))//258和阿塞尔机组 { //剔除支数 SizingResultSave.ScrapNum = "0"; DataTable dtScrapNum = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getScrapNum", new object[] { JudgeStoveNo, ResultNo, 5, PLineCode, proPlanId, gxPlanNo }, this.ob); if (dtScrapNum.Rows.Count > 0) { if (!string.IsNullOrEmpty(dtScrapNum.Rows[0][0].ToString())) { SizingResultSave.ScrapNum = dtScrapNum.Rows[0][0].ToString(); } } //合格支数 DataTable dtQANum = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getQANumBefore", new object[] { JudgeStoveNo, ResultNo, 4, PLineCode, proPlanId, gxPlanNo }, this.ob); if (dtQANum.Rows.Count > 0) { if (!string.IsNullOrEmpty(dtQANum.Rows[0][0].ToString())) { if (int.Parse(dtQANum.Rows[0][0].ToString()) > int.Parse(SizingResultSave.ScrapNum.ToString())) { //合格支数 SizingResultSave.ProductNum = (int.Parse(dtQANum.Rows[0][0].ToString()) - int.Parse(SizingResultSave.ScrapNum.ToString())).ToString(); } else { SizingResultSave.ProductNum = "0"; } } else { SizingResultSave.ProductNum = "0"; } } } else { //剔除支数 SizingResultSave.ScrapNum = "0"; DataTable dtScrapNum = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getScrapNum", new object[] { JudgeStoveNo, ResultNo, 5, PLineCode, proPlanId, gxPlanNo }, this.ob); if (dtScrapNum.Rows.Count > 0) { if (!string.IsNullOrEmpty(dtScrapNum.Rows[0][0].ToString())) { SizingResultSave.ScrapNum = dtScrapNum.Rows[0][0].ToString(); } } //合格支数 DataTable dtQANum = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getQANumBefore", new object[] { JudgeStoveNo, ResultNo, 5, PLineCode, proPlanId, gxPlanNo }, this.ob); if (dtQANum.Rows.Count > 0) { if (!string.IsNullOrEmpty(dtQANum.Rows[0][0].ToString())) { if (int.Parse(dtQANum.Rows[0][0].ToString()) > int.Parse(SizingResultSave.ScrapNum.ToString())) { //合格支数 SizingResultSave.ProductNum = (int.Parse(dtQANum.Rows[0][0].ToString()) - int.Parse(SizingResultSave.ScrapNum.ToString())).ToString(); } else { SizingResultSave.ProductNum = "0"; } } else { SizingResultSave.ProductNum = "0"; } } } //荒管尺寸 SizingResultSave.PipeSize = this.sizingResult1.SizingDataSource1.Rows[0]["PipeSize"].ToString(); //轧辊入口速度 SizingResultSave.EntranceSpeed = this.sizingResult1.SizingDataSource1.Rows[0]["EntranceSpeed"].ToString(); //轧辊出口速度 SizingResultSave.ExitSpeed = this.sizingResult1.SizingDataSource1.Rows[0]["ExitSpeed"].ToString(); //轧机入口温度 SizingResultSave.EntranceTemp = this.sizingResult1.SizingDataSource1.Rows[0]["RollEntranceTemp"].ToString(); //成品规格 SizingResultSave.ProductSize = this.sizingResult1.SizingDataSource1.Rows[0]["ProductSize"].ToString(); //终轧温度 SizingResultSave.ExitTemp = this.sizingResult1.SizingDataSource1.Rows[0]["EndRollingTemp"].ToString(); //孔型系列 SizingResultSave.PassSeries = this.sizingResult1.SizingDataSource1.Rows[0]["KXXL"].ToString(); //精轧系列机架数 SizingResultSave.FinishRollNum = this.sizingResult1.SizingDataSource1.Rows[0]["RackNum"].ToString(); //交接班支数 //SizingResultSave.ScrapNum = this.sizingResult1.SizingDataSource1.Rows[0]["ChangeClassNum"].ToString(); //主电机转速1 SizingResultSave.HostEleSpeed1 = this.sizingResult1.SizingDataSource1.Rows[0]["MainELE1"].ToString(); //主电机转速2 SizingResultSave.HostEleSpeed2 = this.sizingResult1.SizingDataSource1.Rows[0]["MainELE2"].ToString(); //主电机转速3 SizingResultSave.HostEleSpeed3 = this.sizingResult1.SizingDataSource1.Rows[0]["MainELE3"].ToString(); //叠加电机转速1 SizingResultSave.FoldEleSpeed1 = this.sizingResult1.SizingDataSource1.Rows[0]["SELESpeed1"].ToString(); //叠加电机转速2 SizingResultSave.FoldEleSpeed2 = this.sizingResult1.SizingDataSource1.Rows[0]["SELESpeed2"].ToString(); //叠加电机转速3 SizingResultSave.FoldEleSpeed3 = this.sizingResult1.SizingDataSource1.Rows[0]["SELESpeed3"].ToString(); //备注 SizingResultSave.Remark = this.sizingResult1.SizingDataSource1.Rows[0]["Remark"].ToString(); //开始时间 SizingResultSave.StartTime = this.sizingResult1.SizingDataSource1.Rows[0]["StartTime"].ToString(); //开始时间 SizingResultSave.BeginRollingTemp = this.sizingResult1.SizingDataSource1.Rows[0]["beginRollingTemp"].ToString(); //int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.SizingResult.saveSizingResult", new object[] { SizingResultSave }, this.ob); //SizingResultSave = NativeMethod.GetEntityToEntity(SizingResultSave, this.sizingResult1.Value); } SizingResultSave.UserId = _UserID; SizingResultSave.ColUser = _UserName; SizingResultSave.ColGroup = UserInfo.GetUserGroup(); SizingResultSave.ColShift = UserInfo.GetUserOrder(); //合格吨 double DBHeight = 0; double BurnningRate = 0; double BurnningRate1 = 0; double DBNum = 1; DataTable dtDBH = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getDbHeight", new object[] { JudgeStoveNo, ResultNo, proPlanId, gxPlanNo }, this.ob); if (dtDBH.Rows.Count > 0) { if (!string.IsNullOrEmpty(dtDBH.Rows[0]["DB_HEIGHT"].ToString())) { DBHeight = double.Parse(dtDBH.Rows[0]["DB_HEIGHT"].ToString()); } if (!string.IsNullOrEmpty(dtDBH.Rows[0]["BURNNING_RATE"].ToString())) { BurnningRate = double.Parse(dtDBH.Rows[0]["BURNNING_RATE"].ToString()); } if (!string.IsNullOrEmpty(dtDBH.Rows[0]["BURNINGRATE"].ToString())) { BurnningRate1 = double.Parse(dtDBH.Rows[0]["BURNINGRATE"].ToString()); } if (!string.IsNullOrEmpty(dtDBH.Rows[0]["DB_NUM"].ToString())) { DBNum = double.Parse(dtDBH.Rows[0]["DB_NUM"].ToString()); } } //分产线 是否经过再加热炉 if (PLineCode == "C008" || PLineCode == "C009" || PLineCode == "C012" || PLineCode == "C017" || PLineCode == "C072") { SizingResultSave.QaTon = (DBHeight * (1 - (BurnningRate / 100)) * double.Parse(SizingResultSave.ProductNum.ToString3())).ToString(); } else { SizingResultSave.QaTon = (DBHeight * (1 - (BurnningRate / 100)) * (1 - (BurnningRate1 / 100)) * double.Parse(SizingResultSave.ProductNum.ToString())).ToString(); } SizingResultSave.JudgeStoveNo = JudgeStoveNo; SizingResultSave.Status = "60"; SizingResultSave.ProPlanId = proPlanId; SizingResultSave.GxPlanNo = gxPlanNo; SizingResultSave.LotNo = lotNo; SizingResultSave.PlineCode = PLineCode; //写进程表 CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "com.steering.mes.zgmil.coup.FurResult"; ccp.MethodName = "updateMilSlab"; ccp.ServerParams = new object[] { JudgeStoveNo, "6", proPlanId, gxPlanNo }; ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode != -1) { if (ccp.ReturnInfo.Equals("修改成功!")) { ccp.ServerName = "com.steering.mes.zgmil.coup.FurResult"; ccp.MethodName = "updateProcess"; ccp.ServerParams = new object[] { JudgeStoveNo, "6", "6", proPlanId, gxPlanNo, lotNo, PLineCode }; ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode != -1) { if (ccp.ReturnInfo.Equals("修改成功!")) { int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.SizingResult.nodeResult", new object[] { SizingResultSave }, this.ob); if (count > 0) { int count1 = ServerHelper.SetData("com.steering.mes.zgmil.coup.FeedSawResult.scrapNodeMat", new object[] { JudgeStoveNo, 6, 0, PLineCode, proPlanId, gxPlanNo }, this.ob); NativeMethodNew na = new NativeMethodNew(this.ob); //na.InsertSTAferDoubleClick(JudgeStoveNo, 5, "1", proPlanId, gxPlanNo); NativeMethod.CheckNodeMatStatus(JudgeStoveNo, proPlanId, gxPlanNo, 5, this.ob); } } else { MessageUtil.ShowTips(ccp.ReturnInfo); } } } } this.sinzingResult_4601.IsCellSelect = false; this.sizingResult1.IsCellSelect = false; MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】结炉成功!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning); //刷新主表 DataTable dt1 = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getSingleMainPlan", new object[] { QueryMainPlan, 6 }, this.ob); GridHelper.CopyDataToDatatable(ref dt1, ref dtPlan, true); //ultraGridPlan.DisplayLayout.Bands[0].PerformAutoResizeColumns(true, PerformAutoSizeType.AllRowsInBand); ChangeGridColor(); PlanQuery(); GetFurRack(); tempsizingresult = NativeMethod.GetEntityToEntity(tempsizingresult, SizingResultSave); } } /// /// 开始回退 /// private void StartBack() { if (ultraGridPlan.Rows.Count > 0) { if (this.ultraGridPlan.ActiveRow == null) { MessageBox.Show("请选择需要回退的炉号!!!"); return; } UltraGridRow ugr = ultraGridPlan.ActiveRow; string JudgeStoveNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString(); string ResultNo = ugr.Cells["ID"].Value.ToString(); string StartStatus = ugr.Cells["IS_START"].Value.ToString(); if (StartStatus == "已完成定径") { MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】已结炉,不能开始回退!!!!"); return; } if (StartStatus == "未开始定径") { MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】未开始定径,不能开始回退!!!!"); return; } //NativeMethodNew nvw = new NativeMethodNew(this.ob); //if (nvw.isBegineNode(JudgeStoveNo, 6)) //{ // MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】已开始分切,不能开始回退!!!!"); // return; //} int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.FeedSawResult.startBack", new object[] { JudgeStoveNo, ResultNo, 5, PLineCode, proPlanId, gxPlanNo }, this.ob); if (PLineCode == "C009" || PLineCode == "C012" || PLineCode == "C017") { //int count1 = ServerHelper.SetData("com.steering.mes.zgmil.coup.FeedSawResult.startBack", new object[] { JudgeStoveNo, ResultNo, 4, PLineCode, proPlanId, gxPlanNo }, this.ob); } ChangeGridColor(); GetFurRack(); PlanQuery(); } } /// /// 结炉回退 /// private void NodeBack() { if (this.ultraGridPlan.ActiveRow == null) { MessageBox.Show("请选择需要回退的炉号!!!"); return; } UltraGridRow ugr = ultraGridPlan.ActiveRow; string JudgeStoveNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString(); string ResultNo = ugr.Cells["ID"].Value.ToString(); string NodeFlag = ugr.Cells["IS_START"].Value.ToString(); if (NodeFlag != "已完成定径") { MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】未结炉,不能结炉回退!!!!"); return; } //查询结炉班次班组 DataTable dtNodeGroup = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.doNodeBackCheck", new object[] { JudgeStoveNo, ResultNo, 5, proPlanId, gxPlanNo }, this.ob); if (dtNodeGroup.Rows.Count > 0) { string NodeShift = dtNodeGroup.Rows[0][0].ToString(); string NodeGroup = dtNodeGroup.Rows[0][1].ToString(); if (Shift == NodeShift && Group == NodeGroup) { } else { switch (NodeShift) { case "0": NodeShift = "白班"; break; case "1": NodeShift = "早班"; break; case "2": NodeShift = "中班"; break; case "3": NodeShift = "夜班"; break; } switch (NodeGroup) { case "1": NodeGroup = "甲班"; break; case "2": NodeGroup = "乙班"; break; case "3": NodeGroup = "丙班"; break; case "4": NodeGroup = "丁班"; break; } switch (this.UserInfo.GetUserOrder()) { case "0": Shift = "白班"; break; case "1": Shift = "早班"; break; case "2": Shift = "中班"; break; case "3": Shift = "夜班"; break; } switch (this.UserInfo.GetUserGroup()) { case "1": Group = "甲班"; break; case "2": Group = "乙班"; break; case "3": Group = "丙班"; break; case "4": Group = "丁班"; break; } MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】已由" + NodeGroup + "," + NodeShift + "结炉,当班不能结炉回退"); return; } } DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.doNodeBackCheck", new object[] { JudgeStoveNo, ResultNo, proPlanId, gxPlanNo }, this.ob); if (dt.Rows.Count > 0) { string NodeProcess = ""; //当前炉次结炉工序 string NodeStatus = dt.Rows[0][0].ToString(); switch (NodeStatus) { case "30": NodeProcess = "穿孔"; break; case "40": NodeProcess = "连轧"; break; case "50": NodeProcess = "再加热炉"; break; case "60": NodeProcess = "定径"; break; case "70": NodeProcess = "分切"; break; case "80": NodeProcess = "矫直"; break; case "90": NodeProcess = "探伤"; break; case "96": NodeProcess = "质检"; break; } if (NodeStatus != "60") { MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】 " + NodeProcess + "工序已结炉,当前工序不能结炉回退"); return; } } //判断当前炉次下道工序是否结炉 下道工序结炉 - 不允许回退 int Seq = 0; DataTable dt2 = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.changeFlagQuery", new object[] { JudgeStoveNo, ResultNo, 5, proPlanId, gxPlanNo }, this.ob); if (dt2.Rows.Count > 0) { Seq = int.Parse(dt2.Rows[0][0].ToString()); } if (PLineCode == "C008" || PLineCode == "C009" || PLineCode == "C012" || PLineCode == "C017" || PLineCode == "C072") //无再加热炉 { //查询当前炉次是否有交班点 int InSeq = 0; //入炉交班序号 int OutSeq = 0; //出炉交班序号 DataTable dt1 = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.changeFlagQuery", new object[] { JudgeStoveNo, ResultNo, 4, proPlanId, gxPlanNo }, this.ob); if (dt1.Rows.Count > 0) { for (int i = 0; i < dt1.Rows.Count; i++) { if (dt1.Rows[i]["IN_CHANGE_FLAG"].ToString() == "1") { Seq = int.Parse(dt1.Rows[i][0].ToString()); } else { OutSeq = int.Parse(dt1.Rows[i][0].ToString()); } } } int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.FeedSawResult.nodeBack", new object[] { JudgeStoveNo, ResultNo, 5, PLineCode, Seq, 0, 6, proPlanId, gxPlanNo, lotNo }, this.ob); int count1 = ServerHelper.SetData("com.steering.mes.zgmil.coup.FeedSawResult.nodeBack", new object[] { JudgeStoveNo, ResultNo, 4, PLineCode, InSeq, OutSeq, 6, proPlanId, gxPlanNo, lotNo }, this.ob); } else { int count2 = ServerHelper.SetData("com.steering.mes.zgmil.coup.FeedSawResult.nodeBack", new object[] { JudgeStoveNo, ResultNo, 5, PLineCode, Seq, 0, 6, proPlanId, gxPlanNo, lotNo }, this.ob); } ChangeGridColor(); GetFurRack(); PlanQuery(); } /// /// 剔除 /// /// /// private void ultraGridMatSeq_ClickCellButton(object sender, CellEventArgs e) { MilSlabScrapSeqEntity ScrapSlab = new MilSlabScrapSeqEntity(); UltraGridRow ugr = ultraGridMatSeq.ActiveRow; UltraGridRow ugr1 = ultraGridPlan.ActiveRow; HOTMethod hm = new HOTMethod(this.ob); string PlanStatuss = ultraGridPlan.ActiveRow.Cells["IS_START"].Value.ToString(); string JudgeStoveNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString(); int Seq = int.Parse(ugr.Cells["SEQ"].Value.ToString()); string MAT_NO = ugr.Cells["MAT_NO"].Value.ToString(); string PlanStatus = ugr1.Cells["IS_START"].Value.ToString(); string MatStatus = ugr.Cells["STATUS"].Value.ToString(); string ResultNo = ugr1.Cells["ID"].Value.ToString(); string NodeStatus = ugr1.Cells["NODE_STATUS"].Value.ToString(); string shif = ugr.Cells["COL_SHIFT"].Value.ToString(); string group = ugr.Cells["COL_GROUP"].Value.ToString(); NativeMethodNew nasssss = new NativeMethodNew(this.ob); if (nasssss.IsRackOperate(shif, group)) { MessageBox.Show("序号:【" + Seq + "】子管已由" + shif + "," + group + "操作,不允许再进行操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (PlanStatus == "已完成定径") { if (e.Cell.Column.Key == "CHANGE_NUM") { MessageBox.Show("炉号:【" + BaseMethod.getJudgeStoveNo(ultraGridPlan.ActiveRow.Cells["JUDGE_STOVE_NO"].Value.ToString()) + "】已完成定径,不允许交班。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else if (e.Cell.Column.Key == "BTNCHANGECOM") { MessageBox.Show("炉号:【" + BaseMethod.getJudgeStoveNo(ultraGridPlan.ActiveRow.Cells["JUDGE_STOVE_NO"].Value.ToString()) + "】已完成定径,不允许接班!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(ultraGridPlan.ActiveRow.Cells["JUDGE_STOVE_NO"].Value.ToString()) + "】已完成定径,不能剔除。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning); } return; } CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "com.steering.mes.zgmil.coup.FeedSawResult"; ccp.MethodName = "scrapMatCheck"; ccp.ServerParams = new object[] { JudgeStoveNo, 6, proPlanId, gxPlanNo }; ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); int ScrapNumBefore = Convert.ToInt32(ccp.ReturnInfo); if (e.Cell.Column.Key == "SCRAP_DBNUM" || e.Cell.Column.Key == "SCRAP_AFTER") { if (MatStatus == "剔除") { MessageBox.Show("荒管已被剔除不能再次剔除!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (ultraGridMatSeq.Rows.Count - ScrapNumBefore < Seq) { MessageBox.Show("不存在序号为【" + Seq + "】的管号,已被其他工序剔除,不能再次剔除!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } int i = 0; foreach (UltraGridRow uRow in ultraGridMatSeq.Rows) { if (uRow.Cells["STATUS"].Value.ToString().Equals("正常轧制") && int.Parse(uRow.Cells["SEQ"].Value.ToString3()) > 2) { i = i + 1; } } if (Seq < 3 && i > 0) { if (MessageUtil.ShowYesNoAndQuestion("该管坯可能是样管,是否确认剔除。") == DialogResult.No) { return; } } //if (ugr.Cells["MAT_NO"].Text == "") //{ // MessageBox.Show("不存在序号为【" + Seq + "】的管号,已被其他工序剔除,不能再次剔除!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning); // return; //} DataTable ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.FurResult.selectPortBacthSlample", new object[] { MAT_NO }, ob); if (ds.Rows.Count > 0) { if (MessageUtil.ShowYesNoAndQuestion("此管坯已有被取为样管,是否继续剔除?") == DialogResult.No) { return; } } //管排锯切前判断当前管坯序号是否已剔除 //DataTable dtSeq = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getScrapSeq", new object[] { JudgeStoveNo, Seq.ToString() }, this.ob); //if (dtSeq.Rows.Count > 0) //{ // MessageBox.Show("不存在序号为【" + Seq + "】的管号,已在【" + dtSeq.Rows[0][0].ToString() + "】剔除,不能再次剔除!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning); // return; //} //if (MessageUtil.ShowYesNoAndQuestion("是否剔除该荒管") == DialogResult.No) //{ // return; //} ScrapSlab.JudgeStoveNo = JudgeStoveNo; ScrapSlab.Seq = Seq; ScrapSlab.ProcessNo = "6"; if (e.Cell.Column.Key == "SCRAP_DBNUM") { ScrapSlab.FeedRowNo = "1"; //定径前剔除 ScrapSlab.ScrapReason = "温降"; } else { ScrapSlab.FeedRowNo = "2"; //定径后剔除 ScrapSlab.ScrapReason = "弯曲"; } ScrapSlab.Flag = "0"; ScrapSlab.ColMode = "1"; ScrapSlab.ColUser = UserInfo.GetUserName(); ScrapSlab.ColGroup = UserInfo.GetUserGroup(); ScrapSlab.ColShift = UserInfo.GetUserOrder(); ScrapSlab.ProPlanId = proPlanId; ScrapSlab.GxPlanNo = gxPlanNo; int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.SizingResult.scrapMat", new object[] { ScrapSlab }, this.ob); int ScrapNum = 0; //460机组 if (PLineCode == "C017" || PLineCode == "C072") { //if (string.IsNullOrEmpty(this.sizingResult1.SizingDataSource1.Rows[0]["ScrapNum"].ToString()) || this.sizingResult1.SizingDataSource1.Rows[0]["ScrapNum"].ToString() == "0") //{ // ScrapNum = 1; //} //else //{ // ScrapNum = int.Parse(this.sizingResult1.SizingDataSource1.Rows[0]["ScrapNum"].ToString()) + count; //} //sizingResult1.Value.ScrapNum = ScrapNum; //sizingResult1.UpdateDateForRack(); if (!string.IsNullOrEmpty(this.sinzingResult_4601.SizingDataSource1.Rows[0]["SCRAP_NUM"].ToString()) || this.sinzingResult_4601.SizingDataSource1.Rows[0]["SCRAP_NUM"].ToString() == "0") { ScrapNum = 1; } else { ScrapNum = int.Parse(this.sinzingResult_4601.SizingDataSource1.Rows[0]["SCRAP_NUM"].ToString()) + count; } sinzingResult_4601.Value.ScrapNum = ScrapNum.ToString(); sinzingResult_4601.UpdateDateForRack(); } else { if (!string.IsNullOrEmpty(this.sizingResult1.SizingDataSource1.Rows[0]["ScrapNum"].ToString()) || this.sizingResult1.SizingDataSource1.Rows[0]["ScrapNum"].ToString() == "0") { ScrapNum = 1; } else { ScrapNum = int.Parse(this.sizingResult1.SizingDataSource1.Rows[0]["ScrapNum"].ToString()) + count; } sizingResult1.Value.ScrapNum = ScrapNum.ToString(); sizingResult1.UpdateDateForRack(); } } if (e.Cell.Column.Key == "DELBACK") { //if (MessageUtil.ShowYesNoAndQuestion("是否回退该剔除的坯料") == DialogResult.No) //{ // return; //} if (!MatStatus.Equals("剔除")) { MessageBox.Show("该坯料未被剔除,请确认后重新选择!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } NativeMethodNew na = new NativeMethodNew(this.ob); int counts = na.DeleteSlabSeq(JudgeStoveNo, Seq.ToString(), 6, 1, 0, proPlanId, gxPlanNo); if (counts > 0) { //MessageBox.Show("剔料回退成功", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { MessageBox.Show("剔料回退失败", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } } //交班 if (e.Cell.Column.Key == "CHANGE_NUM") { string Shift = UserInfo.GetUserOrder(); string Group = UserInfo.GetUserGroup(); string User = UserInfo.GetUserName(); int BeforeChangeNum = 0; //查询上个班交班支数 DataTable dtChangeNum = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getChangeSeq", new object[] { JudgeStoveNo, ResultNo, 5, PLineCode, Shift, Group, proPlanId, gxPlanNo }, this.ob); if (dtChangeNum.Rows.Count > 0) { if (!string.IsNullOrEmpty(dtChangeNum.Rows[0][0].ToString())) { BeforeChangeNum = int.Parse(dtChangeNum.Rows[0][0].ToString()); } } int Seq2 = Seq; if (Seq2 <= BeforeChangeNum) { MessageBox.Show("前道班次已交班,该支不能再次交班。"); return; } if (Seq2 > ultraGridMatSeq.Rows.Count - ScrapNumBefore) { MessageBox.Show("该支已被前道工序剔除,不能在该支交班"); return; } // int Seq = int.Parse(e.Cell.Row.Cells["SEQ"].Value.ToString()); //int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.FeedSawResult.changeNum", new object[] { JudgeStoveNo, ResultNo, Seq2, BeforeChangeNum, 0, PLineCode, Shift, Group, _UserName, 6, 0 }, this.ob); //ChangeFlag = 1; hm.UpdateChangeFlag(ActiveJUDGE_STOVE_NO, ActiveResultNo, "", 5, Seq, 0); } //接班 if (e.Cell.Column.Key == "BTNCHANGECOM") { string Shift = UserInfo.GetUserOrder(); string Group = UserInfo.GetUserGroup(); string User = UserInfo.GetUserName(); int BeforeChangeNum = 0; //查询上个班交班支数 DataTable dtChangeNum = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getChangeSeq", new object[] { JudgeStoveNo, ResultNo, 5, PLineCode, Shift, Group, proPlanId, gxPlanNo }, this.ob); if (dtChangeNum.Rows.Count > 0) { if (!string.IsNullOrEmpty(dtChangeNum.Rows[0][0].ToString())) { BeforeChangeNum = int.Parse(dtChangeNum.Rows[0][0].ToString()); } } int WaitChangeSeq = hm.GetWaitChangeSeq(ActiveJUDGE_STOVE_NO, ActiveResultNo, "", 5, 0, proPlanId, gxPlanNo); if (WaitChangeSeq == 0) { MessageBox.Show("没有待交班确认的管号。"); return; } if (WaitChangeSeq != Seq) { MessageBox.Show("交班管序号与接班管序号不符,请确认后接班。"); return; } if (MessageUtil.ShowYesNoAndQuestion("确认炉号:【" + BaseMethod.getJudgeStoveNo(ActiveJUDGE_STOVE_NO) + "】序号:【" + Seq + "】交班?") == DialogResult.No) { return; } //查询是否有该班接班记录 DateTime SeverTime = NativeMethod.GetSeverTime(this.ob); string Time = SeverTime.ToLongTimeString(); string StartTime = SeverTime.ToShortDateString() + " 00:00:00"; string EndTime = SeverTime.AddDays(1).ToShortDateString() + " 00:00:00"; //未登录 //if (!hm.IsChanged(StartTime, EndTime, Shift, Group, "5", PLineCode)) //{ //FrmChangeGroup frmCg = new FrmChangeGroup(this.ob); //frmCg.ShowDialog(); //if (frmCg.DialogResult == DialogResult.OK) if (this.DoRelogin(DoCheck)) { //插入接班确认履历表 hm.InsertChangeRemuse(Shift, Group, _UserName, "5", PLineCode); int Seq2 = Seq; int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.FeedSawResult.changeNum", new object[] { JudgeStoveNo, ResultNo, Seq2, BeforeChangeNum, 0, PLineCode, Shift, Group, _UserName, 6, 0, proPlanId, gxPlanNo }, this.ob); ChangeFlag = 1; } //} //else //{ // int Seq2 = Seq; // int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.FeedSawResult.changeNum", new object[] { JudgeStoveNo, ResultNo, Seq2, BeforeChangeNum, 0, PLineCode, Shift, Group, _UserName, 6, 0 }, this.ob); // ChangeFlag = 1; //} } //过渡方法,接班后重登陆初始化导致Grid.Row为null if (ultraGridPlan.Rows == null) { return; } GetRollingCard(); GetFurRack(); ChangeGridColor(); DataTable dtMP = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getSingleMainPlanForHeatNo", new object[] { MainPlan }, this.ob); //查询定径实绩信息 DataTable dtSizingResult = ServerHelper.GetData("com.steering.mes.zgmil.coup.SizingResult.getSizingResult", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, this.ob); if (dtSizingResult.Rows.Count > 0) { if (PLineCode != "C017" && PLineCode != "C072") { SizingResultEditForRack(dtSizingResult); } else { Sizing460ResultEidtForRack(dtSizingResult, dtMP.Rows[0]["PIPE_SIZE"].ToString()); } } else { this.sizingResult1.Value.Clear(); this.sinzingResult_4601.Value.Clear(); //清空定径实绩 GridHelper.InitCardGrid(sizingResult1.SizingDataSource1, sizingResult1.UltraGrid2); //清空定径实绩460 GridHelper.InitCardGrid(sinzingResult_4601.SizingDataSource1, sinzingResult_4601.UltraGrid2); } } public string DoCheck(CoreUserInfo User) { return ""; } /// /// 双击管号队列表头更改grid大小 /// /// /// private void ultraGridMatSeq_DoubleClickHeader(object sender, DoubleClickHeaderEventArgs e) { if (PanelSizeFlag == 0) { PanelSizeFlag = 1; splitContainer2.SplitterDistance = 180; } else { PanelSizeFlag = 0; splitContainer2.SplitterDistance = 90; } } #endregion #region 卡片赋值 /// /// 轧制信息Grid赋值 /// /// 轧制计划信息datatable public void GridEdit(DataTable dt) { if (dt.Rows.Count > 0) { DataRow row1 = dt.Rows[0]; //熔炼炉号 this.rollingInfomation1.Value.StoveNo = row1["stove_no"].ToString(); //炉号 this.rollingInfomation1.Value.JudgeStoveNo = BaseMethod.getJudgeStoveNo(row1["judge_stove_no"].ToString()); //生产批号 this.rollingInfomation1.Value.LotNo = row1["lot_no"].ToString(); //工序合同号 this.rollingInfomation1.Value.ContractNo = row1["contract_no"].ToString(); //执行工艺号 this.rollingInfomation1.Value.ImpProcess = row1["imp_process"].ToString(); //执行工艺号路径 this.rollingInfomation1.Value.ImpProcessPath = row1["imp_process_path"].ToString(); //产线代码 this.rollingInfomation1.Value.PlineCode = row1["pline_code"].ToString(); //状态 this.rollingInfomation1.Value.Status = row1["STATUS"].ToString(); //监制 this.rollingInfomation1.Value.Producer = row1["producer"].ToString(); //工艺状态 this.rollingInfomation1.Value.ProcessStatus = row1["process_status"].ToString(); //单倍长 this.rollingInfomation1.Value.DbLength = row1["db_length"].ToString(); //单倍重 this.rollingInfomation1.Value.DbHeight = row1["db_height"].ToString(); //轧制长度 this.rollingInfomation1.Value.RollLength = row1["roll_length"].ToString(); //分切数 this.rollingInfomation1.Value.SawNum = row1["saw_num"].ToString(); //目标长度 this.rollingInfomation1.Value.TargetLength = row1["target_length"].ToString(); //最终用户 this.rollingInfomation1.Value.FinishUser = row1["finish_user"].ToString(); //目标库 this.rollingInfomation1.Value.TargetLiabrary = row1["target_liabrary"].ToString(); //品种 this.rollingInfomation1.Value.Varieties = row1["varieties"].ToString(); //成品规格 this.rollingInfomation1.Value.PipeSize = row1["pipe_size"].ToString(); //扣型 this.rollingInfomation1.Value.BuckleType = row1["buckle_type"].ToString(); //长度范围 this.rollingInfomation1.Value.LengthRange = row1["length_range"].ToString(); //轧管判定标准 this.rollingInfomation1.Value.RollStandrad = row1["roll_standrad"].ToString(); //断面 this.rollingInfomation1.Value.PipeSection = row1["pipe_section"].ToString(); //钢种代码 this.rollingInfomation1.Value.SteelCode = row1["steelcode"].ToString(); //钢种名称 this.rollingInfomation1.Value.SteelName = row1["steelname"].ToString(); //钢级代码 this.rollingInfomation1.Value.GradeCode = row1["gradecode"].ToString(); //钢级名称 this.rollingInfomation1.Value.GradeName = row1["gradename"].ToString(); //炼钢判定标准 this.rollingInfomation1.Value.SteelStandrad = row1["steel_standrad"].ToString(); //去向 this.rollingInfomation1.Value.Target = row1["target"].ToString(); //支 this.rollingInfomation1.Value.PlanNum = row1["BRANCH"].ToString(); //吨 this.rollingInfomation1.Value.PlanTon = row1["TON"].ToString(); //切损去向 this.rollingInfomation1.Value.CutTarget = row1["cut_target"].ToString(); //切损长度 this.rollingInfomation1.Value.CutLength = row1["cut_length"].ToString(); //切损重量 this.rollingInfomation1.Value.CutHeight = row1["CUT_WEIGHT"].ToString(); //倍尺数 this.rollingInfomation1.Value.DbNum = row1["DB_NUM"].ToString(); //标准类别代码 this.rollingInfomation1.Value.StdStyle = row1["STD_STYLE"].ToString(); //标准类别描述 this.rollingInfomation1.Value.StdStyleDesc = row1["STD_STYLE_DESC"].ToString(); //成品备注 this.rollingInfomation1.Value.ReMark = row1["ReMark"].ToString(); this.rollingInfomation1.UpdateData(); } } /// /// 流通卡赋值 /// /// public void RollingCardEditGrid(DataTable dt, string heatno) { if (dt.Rows.Count > 0) { //上料切前剔除支数 this.rollingCard1.Value.FeedScrapNum = dt.Rows[0]["SCRAP_FEED"].ToString(); //上料切前合格支数 this.rollingCard1.Value.FeedQualifiedNum = dt.Rows[0]["QUALIFIED_FEED"].ToString(); //上料剔除支数 this.rollingCard1.Value.FeedScrapDBNum = dt.Rows[0]["SCRAP_DBFEED"].ToString(); //上料合格支数 this.rollingCard1.Value.FeedQualifiedDBNum = dt.Rows[0]["QUALIFIED_DBFEED"].ToString(); //加热炉剔除支数 this.rollingCard1.Value.FurScrapNum = dt.Rows[0]["SCRAP_FUR"].ToString(); //加热炉合格支数 this.rollingCard1.Value.FurQualifiedNum = dt.Rows[0]["QUALIFIED_FUR"].ToString(); //穿孔剔除支数 this.rollingCard1.Value.PerScrapNum = dt.Rows[0]["SCRAP_PER"].ToString(); //穿孔合格支数 this.rollingCard1.Value.PerQualifiedNum = dt.Rows[0]["QUALIFIED_PER"].ToString(); //连轧剔除支数 this.rollingCard1.Value.RollingScrapNum = dt.Rows[0]["SCRAP_ROLLING"].ToString(); //连轧合格支数 this.rollingCard1.Value.RollingQualifiedNum = dt.Rows[0]["QUALIFIED_ROLLING"].ToString(); //再加热炉剔除支数 this.rollingCard1.Value.RefurScrapNum = dt.Rows[0]["SCRAP_REFUR"].ToString(); //再加热炉合格支数 this.rollingCard1.Value.RefurQualifiedNum = dt.Rows[0]["QUALIFIED_REFUR"].ToString(); //定径剔除支数 this.rollingCard1.Value.SizingScrapNum = dt.Rows[0]["SCRAP_SIZING"].ToString(); //定径合格支数 this.rollingCard1.Value.SizingQualifiedNum = dt.Rows[0]["QUALIFIED_SIZING"].ToString(); //分切前剔除支数 this.rollingCard1.Value.SawScrapNumBE = dt.Rows[0]["SCRAP_SAW_BE"].ToString(); //分切前合格支数 this.rollingCard1.Value.SawQualifiedNumBE = dt.Rows[0]["QUALIFIED_SAW_BE"].ToString(); //分切剔除支数 this.rollingCard1.Value.SawScrapNum = dt.Rows[0]["SCRAP_SAW"].ToString(); //分切合格支数 this.rollingCard1.Value.SawQualifiedNum = dt.Rows[0]["QUALIFIED_SAW"].ToString(); //矫直剔除支数 this.rollingCard1.Value.StraightScrapNum = dt.Rows[0]["SCRAP_STRAIGHT"].ToString(); //矫直合格支数 this.rollingCard1.Value.StraightQualifiedNum = dt.Rows[0]["QUALIFIED_STRAIGHT"].ToString(); //矫直下线支数 this.rollingCard1.Value.OfflineStraight = dt.Rows[0]["OFFLINE_STRAIGHT"].ToString(); //探伤剔除支数 this.rollingCard1.Value.TestingScrapNum = dt.Rows[0]["SCRAP_TESTING"].ToString(); //探伤合格支数 this.rollingCard1.Value.TestingQualifiedNum = dt.Rows[0]["QUALIFIED_TESTING"].ToString(); NativeMethodNew na = new NativeMethodNew(this.ob); if (na.isBegineNode(heatno, 8) || na.isBegineNode(heatno, 9) || na.isBegineNode(heatno, 10)) { //探伤下线支数 this.rollingCard1.Value.OfflineTesting = dt.Rows[0]["OFFLINE_TESTING"].ToString(); } else { if (dt.Rows[0]["OFFLINE_TESTING"].ToString() == "0") { this.rollingCard1.Value.OfflineTesting = ""; } else { //探伤下线支数 this.rollingCard1.Value.OfflineTesting = dt.Rows[0]["OFFLINE_TESTING"].ToString(); } } //表检合格支数 this.rollingCard1.Value.SurfaceQualifiedNum = dt.Rows[0]["QUALIFIED_BRANCH"].ToString(); //表检废品支数 this.rollingCard1.Value.SurfaceScrapNum = dt.Rows[0]["WASTE_QUANTITY"].ToString(); //表检下线支数 this.rollingCard1.Value.OfflineSurface = dt.Rows[0]["OFFLINE_QUANTITY"].ToString(); //表检返线支数 //this.rollingCard1.Value.SurfaceBackLineNum= dt.Rows[0]["OFFLINE_TESTING"].ToString(); this.rollingCard1.UpdateData(); } else { this.rollingCard1.ClearData(); } } /// /// 定径实绩赋值 /// public void SizingResultEdit(DataTable dt) { ultraTabControl1.Tabs[0].Visible = true; ultraTabControl1.Tabs[1].Visible = false; UltraGridRow ugr = this.rollingCard1.UltraGrid4.Rows[0]; UltraGridRow ugr1 = ultraGridPlan.ActiveRow; string JudgeStoveNo = ugr1.Cells["JUDGE_STOVE_NO"].Value.ToString(); string ResultNo = ugr1.Cells["ID"].Value.ToString(); sizingResult1.Value.ScrapNum = "0"; //查询本道工序剔除支数 DataTable dtScrapNum = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getScrapNum", new object[] { JudgeStoveNo, ResultNo, 5, PLineCode, proPlanId, gxPlanNo }, this.ob); if (dtScrapNum.Rows.Count > 0) { if (!string.IsNullOrEmpty(dtScrapNum.Rows[0][0].ToString())) { sizingResult1.Value.ScrapNum = dtScrapNum.Rows[0][0].ToString(); } } DataTable dtQANum = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getQANumBefore", new object[] { JudgeStoveNo, ResultNo, 4, PLineCode, proPlanId, gxPlanNo }, this.ob); if (dtQANum.Rows.Count > 0) { if (!string.IsNullOrEmpty(dtQANum.Rows[0][0].ToString())) { if (int.Parse(dtQANum.Rows[0][0].ToString()) > int.Parse(sizingResult1.Value.ScrapNum.ToString())) { //合格支数 sizingResult1.Value.ProductNum = (int.Parse(dtQANum.Rows[0][0].ToString()) - int.Parse(sizingResult1.Value.ScrapNum.ToString())).ToString(); } else { sizingResult1.Value.ProductNum = "0"; } } else { sizingResult1.Value.ProductNum = "0"; } } //荒管尺寸 this.sizingResult1.Value.PipeSize = dt.Rows[0]["PIPE_SIZE"].ToString(); this.sizingResult1.Value.PipeDiameter = dt.Rows[0]["PIPE_DIAMETER"].ToString(); this.sizingResult1.Value.PipeThickness = dt.Rows[0]["PIPE_THICKNESS"].ToString(); //轧辊入口速度 this.sizingResult1.Value.EntranceSpeed = dt.Rows[0]["ENTRANCE_SPEED"].ToString(); //轧辊出口速度 this.sizingResult1.Value.ExitSpeed = dt.Rows[0]["EXIT_SPEED"].ToString(); //轧机入口温度 this.sizingResult1.Value.EntranceTemp = dt.Rows[0]["ENTRANCE_TEMP"].ToString(); //成品规格 this.sizingResult1.Value.ProductSize = dt.Rows[0]["PRODUCT_SIZE"].ToString(); //终轧温度 this.sizingResult1.Value.ExitTemp = dt.Rows[0]["EXIT_TEMP"].ToString(); //入口温度 this.sizingResult1.Value.EntranceTemp = dt.Rows[0]["ENTRANCE_TEMP"].ToString(); //孔型系列 this.sizingResult1.Value.PassSeries = dt.Rows[0]["PASS_SERIES"].ToString(); //精轧系列机架数 this.sizingResult1.Value.FinishRollNum = dt.Rows[0]["FINISH_ROLL_NUM"].ToString(); //交接班支数 this.sizingResult1.Value.ChangeNum = dt.Rows[0]["CHANGE_NUM"].ToString(); //主电机转速1 this.sizingResult1.Value.HostEleSpeed1 = dt.Rows[0]["HOST_ELE_SPEED1"].ToString(); //主电机转速2 this.sizingResult1.Value.HostEleSpeed2 = dt.Rows[0]["HOST_ELE_SPEED2"].ToString(); //主电机转速3 this.sizingResult1.Value.HostEleSpeed3 = dt.Rows[0]["HOST_ELE_SPEED3"].ToString(); //叠加电机转速1 this.sizingResult1.Value.FoldEleSpeed1 = dt.Rows[0]["FOLD_ELE_SPEED1"].ToString(); //叠加电机转速2 this.sizingResult1.Value.FoldEleSpeed2 = dt.Rows[0]["FOLD_ELE_SPEED2"].ToString(); //叠加电机转速3 this.sizingResult1.Value.FoldEleSpeed3 = dt.Rows[0]["FOLD_ELE_SPEED3"].ToString(); //备注 this.sizingResult1.Value.Remark = dt.Rows[0]["REMARK"].ToString(); //开始时间 this.sizingResult1.Value.StartTime = dt.Rows[0]["START_TIME"].ToString(); //结束时间 this.sizingResult1.Value.EndTime = dt.Rows[0]["END_TIME"].ToString(); //开轧温度 this.sizingResult1.Value.BeginRollingTemp = dt.Rows[0]["BEGIN_ROLLING_TEMP"].ToString(); //交接班支数 this.sizingResult1.Value.ChangeNum = dt.Rows[0]["CHANGE_NUM"].ToString(); this.sizingResult1.Value.ExitTemp2= dt.Rows[0]["EXIT_TEMP2"].ToString2(); this.sizingResult1.Value.ExitTemp3= dt.Rows[0]["EXIT_TEMP3"].ToString2(); this.sizingResult1.UpdateDate(); } /// /// 定径实绩赋值 /// public void SizingResultEditForRack(DataTable dt) { ultraTabControl1.Tabs[0].Visible = true; ultraTabControl1.Tabs[1].Visible = false; UltraGridRow ugr = this.rollingCard1.UltraGrid4.Rows[0]; UltraGridRow ugr1 = ultraGridPlan.ActiveRow; string JudgeStoveNo = ugr1.Cells["JUDGE_STOVE_NO"].Value.ToString(); string ResultNo = ugr1.Cells["ID"].Value.ToString(); sizingResult1.Value.ScrapNum = "0"; //查询本道工序剔除支数 DataTable dtScrapNum = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getScrapNum", new object[] { JudgeStoveNo, ResultNo, 5, PLineCode, proPlanId, gxPlanNo }, this.ob); if (dtScrapNum.Rows.Count > 0) { if (!string.IsNullOrEmpty(dtScrapNum.Rows[0][0].ToString())) { sizingResult1.Value.ScrapNum = dtScrapNum.Rows[0][0].ToString(); } } DataTable dtQANum = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getQANumBefore", new object[] { JudgeStoveNo, ResultNo, 4, PLineCode, proPlanId, gxPlanNo }, this.ob); if (dtQANum.Rows.Count > 0) { if (!string.IsNullOrEmpty(dtQANum.Rows[0][0].ToString())) { if (int.Parse(dtQANum.Rows[0][0].ToString()) > int.Parse(sizingResult1.Value.ScrapNum.ToString())) { //合格支数 sizingResult1.Value.ProductNum = (int.Parse(dtQANum.Rows[0][0].ToString()) - int.Parse(sizingResult1.Value.ScrapNum.ToString())).ToString(); } else { sizingResult1.Value.ProductNum = "0"; } } else { sizingResult1.Value.ProductNum = "0"; } } //交接班支数 this.sizingResult1.Value.ChangeNum = dt.Rows[0]["CHANGE_NUM"].ToString(); this.sizingResult1.UpdateDateForRack(); } /// /// 460定径实绩赋值 /// /// public void Sizing460ResultEidt(DataTable dt, string str) { ultraTabControl1.Tabs[0].Visible = false; ultraTabControl1.Tabs[1].Visible = true; UltraGridRow ugr1 = ultraGridPlan.ActiveRow; string JudgeStoveNo = ugr1.Cells["JUDGE_STOVE_NO"].Value.ToString(); string ResultNo = ugr1.Cells["ID"].Value.ToString(); sinzingResult_4601.Value.ScrapNum = "0"; //查询本道工序剔除支数 DataTable dtScrapNum = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getScrapNum", new object[] { JudgeStoveNo, ResultNo, 5, PLineCode, proPlanId, gxPlanNo }, this.ob); if (dtScrapNum.Rows.Count > 0) { if (!string.IsNullOrEmpty(dtScrapNum.Rows[0][0].ToString())) { sinzingResult_4601.Value.ScrapNum = dtScrapNum.Rows[0][0].ToString(); } } DataTable dtQANum = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getQANumBefore", new object[] { JudgeStoveNo, ResultNo, 4, PLineCode, proPlanId, gxPlanNo }, this.ob); if (dtQANum.Rows.Count > 0) { if (!string.IsNullOrEmpty(dtQANum.Rows[0][0].ToString())) { if (int.Parse(dtQANum.Rows[0][0].ToString()) > int.Parse(sinzingResult_4601.Value.ScrapNum.ToString())) { //合格支数 sinzingResult_4601.Value.ProductNum = (int.Parse(dtQANum.Rows[0][0].ToString()) - int.Parse(sinzingResult_4601.Value.ScrapNum.ToString())).ToString(); } else { sinzingResult_4601.Value.ProductNum = "0"; } } else { sinzingResult_4601.Value.ProductNum = "0"; } } //荒管尺寸 this.sinzingResult_4601.Value.PipeSize = dt.Rows[0]["PIPE_SIZE"].ToString(); //轧辊入口速度 this.sinzingResult_4601.Value.EntranceSpeed = dt.Rows[0]["ENTRANCE_SPEED"].ToString(); //交接班支数 this.sinzingResult_4601.Value.ChangeNum = dt.Rows[0]["CHANGE_NUM"].ToString(); //轧辊出口速度 this.sinzingResult_4601.Value.ExitSpeed = dt.Rows[0]["EXIT_SPEED"].ToString(); //轧机入口温度 this.sinzingResult_4601.Value.EntranceTemp = dt.Rows[0]["ENTRANCE_TEMP"].ToString(); //成品规格 this.sinzingResult_4601.Value.ProductSize = str; //终轧温度 this.sinzingResult_4601.Value.ExitTemp = dt.Rows[0]["EXIT_TEMP"].ToString(); //入口温度 this.sinzingResult_4601.Value.EntranceTemp = dt.Rows[0]["ENTRANCE_TEMP"].ToString(); //小冷床节奏 this.sinzingResult_4601.Value.BedRhythm = dt.Rows[0]["BED_RHYTHM"].ToString(); //精轧机架 this.sinzingResult_4601.Value.RackNo = dt.Rows[0]["RACK_NO"].ToString(); //主电机转速1 this.sinzingResult_4601.Value.HostEleSpeed1 = dt.Rows[0]["HOST_ELE_SPEED1"].ToString(); //主电机转速2 this.sinzingResult_4601.Value.HostEleSpeed2 = dt.Rows[0]["HOST_ELE_SPEED2"].ToString(); //主电机转速3 this.sinzingResult_4601.Value.HostEleSpeed3 = dt.Rows[0]["HOST_ELE_SPEED3"].ToString(); //主电机转速4 this.sinzingResult_4601.Value.HostEleSpeed4 = dt.Rows[0]["HOST_ELE_SPEED4"].ToString(); //主电机转速5 this.sinzingResult_4601.Value.HostEleSpeed5 = dt.Rows[0]["HOST_ELE_SPEED5"].ToString(); //主电机转速6 this.sinzingResult_4601.Value.HostEleSpeed6 = dt.Rows[0]["HOST_ELE_SPEED6"].ToString(); //主电机转速7 this.sinzingResult_4601.Value.HostEleSpeed7 = dt.Rows[0]["HOST_ELE_SPEED7"].ToString(); //主电机转速8 this.sinzingResult_4601.Value.HostEleSpeed8 = dt.Rows[0]["HOST_ELE_SPEED8"].ToString(); //主电机转速9 this.sinzingResult_4601.Value.HostEleSpeed9 = dt.Rows[0]["HOST_ELE_SPEED9"].ToString(); //主电机转速10 this.sinzingResult_4601.Value.HostEleSpeed10 = dt.Rows[0]["HOST_ELE_SPEED10"].ToString(); //主电机转速11 this.sinzingResult_4601.Value.HostEleSpeed11 = dt.Rows[0]["HOST_ELE_SPEED11"].ToString(); //主电机转速12 this.sinzingResult_4601.Value.HostEleSpeed12 = dt.Rows[0]["HOST_ELE_SPEED12"].ToString(); //备注 this.sinzingResult_4601.Value.Remark = dt.Rows[0]["REMARK"].ToString(); //开始时间 this.sinzingResult_4601.Value.StartTime = dt.Rows[0]["START_TIME"].ToString(); //结束时间 this.sinzingResult_4601.Value.EndTime = dt.Rows[0]["END_TIME"].ToString(); //开轧温度 this.sinzingResult_4601.Value.BeginRollingTemp = dt.Rows[0]["BEGIN_ROLLING_TEMP"].ToString(); this.sinzingResult_4601.Value.ExitTemp2 = dt.Rows[0]["EXIT_TEMP2"].ToString2(); this.sinzingResult_4601.Value.ExitTemp3 = dt.Rows[0]["EXIT_TEMP3"].ToString2(); this.sinzingResult_4601.UpdateDate(); } /// /// 460定径实绩赋值 /// /// public void Sizing460ResultEidtForRack(DataTable dt, string str) { ultraTabControl1.Tabs[0].Visible = false; ultraTabControl1.Tabs[1].Visible = true; UltraGridRow ugr1 = ultraGridPlan.ActiveRow; string JudgeStoveNo = ugr1.Cells["JUDGE_STOVE_NO"].Value.ToString(); string ResultNo = ugr1.Cells["ID"].Value.ToString(); sinzingResult_4601.Value.ScrapNum = "0"; //查询本道工序剔除支数 DataTable dtScrapNum = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getScrapNum", new object[] { JudgeStoveNo, ResultNo, 5, PLineCode, proPlanId, gxPlanNo }, this.ob); if (dtScrapNum.Rows.Count > 0) { if (!string.IsNullOrEmpty(dtScrapNum.Rows[0][0].ToString())) { sinzingResult_4601.Value.ScrapNum = dtScrapNum.Rows[0][0].ToString(); } } DataTable dtQANum = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getQANumBefore", new object[] { JudgeStoveNo, ResultNo, 5, PLineCode, proPlanId, gxPlanNo }, this.ob); if (dtQANum.Rows.Count > 0) { if (!string.IsNullOrEmpty(dtQANum.Rows[0][0].ToString())) { if (int.Parse(dtQANum.Rows[0][0].ToString()) > int.Parse(sinzingResult_4601.Value.ScrapNum.ToString())) { //合格支数 sinzingResult_4601.Value.ProductNum = (int.Parse(dtQANum.Rows[0][0].ToString()) - int.Parse(sinzingResult_4601.Value.ScrapNum.ToString())).ToString(); } else { sinzingResult_4601.Value.ProductNum = "0"; } } else { sinzingResult_4601.Value.ProductNum = "0"; } } //轧废支数 this.sinzingResult_4601.Value.ProductNum = dt.Rows[0]["PRODUCT_NUM"].ToString(); //轧制支数 this.sinzingResult_4601.Value.ScrapNum = dt.Rows[0]["SCRAP_NUM"].ToString(); this.sinzingResult_4601.UpdateDateForRack(); } #endregion /// /// 计划表ROW点击变换判断 /// /// /// private void ultraGridPlan_BeforeRowActivate(object sender, RowEventArgs e) { //if(PLineCode="") //{ if (this.sizingResult1.IsCellSelect == true) { NativeMethodNew na = new NativeMethodNew(this.ob); if (!na.isBegineNode(ActiveJUDGE_STOVE_NO, 5)) { this.sizingResult1.IsCellSelect = false; return; } //if (MessageBox.Show("提示:定径可能已修改,是否保存", "提示", MessageBoxButtons.YesNo) == DialogResult.Yes) //{ // this.sizingResult1.IsCellSelect = false; // //保存探伤实绩 //} else { ShowMessageFlag = 1; ResultSave(); ShowMessageFlag = 0; this.sizingResult1.IsCellSelect = false; foreach (UltraGridRow ugr in this.ultraGridPlan.Rows) { if (ugr.Cells["JUDGE_STOVE_NO"].Value.ToString() == ActiveJUDGE_STOVE_NO) { this.ultraGridPlan.ActiveRow = ugr; } } return; } } if (this.sinzingResult_4601.IsCellSelect == true) { NativeMethodNew na = new NativeMethodNew(this.ob); if (!na.isBegineNode(ActiveJUDGE_STOVE_NO, 5)) { this.sinzingResult_4601.IsCellSelect = false; return; } //if (MessageBox.Show("提示:定径可能已修改,是否保存", "提示", MessageBoxButtons.YesNo) == DialogResult.Yes) //{ // this.sinzingResult_4601.IsCellSelect = false; // //保存定径实绩 // ResultSave(); //} else { ShowMessageFlag = 1; ResultSave(); ShowMessageFlag = 0; this.sinzingResult_4601.IsCellSelect = false; foreach (UltraGridRow ugr in this.ultraGridPlan.Rows) { if (ugr.Cells["JUDGE_STOVE_NO"].Value.ToString() == ActiveJUDGE_STOVE_NO) { this.ultraGridPlan.ActiveRow = ugr; } } return; } } } /// /// 查询结炉实绩 /// public void NodeQuery() { string Shift = UserInfo.GetUserOrder(); string Group = UserInfo.GetUserGroup(); //DateTime SeverTime = DateTime.Now;// DateTime SeverTime = NativeMethod.GetSeverTime(this.ob); string StartTime = SeverTime.ToString("yyyy-MM-dd"); string EndTime = SeverTime.AddDays(1).ToString("yyyy-MM-dd"); string Date = StartTime; string Time = SeverTime.ToLongTimeString(); //晚班 if (Shift == "3") { Time = Time.Replace(":", ""); if (int.Parse(Time) > 205900) { StartTime += " " + "20:00:00"; EndTime += " " + "10:00:00"; } else { StartTime = SeverTime.AddDays(-1).ToString("yyyy-MM-dd") + " " + "21:00:00"; EndTime = SeverTime.ToString("yyyy-MM-dd") + " " + "10:00:00"; } } DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.SizingResult.GetSizingResultNodeQuery", new object[] { PLineCode, Shift, Group, StartTime, EndTime }, this.ob); FrmNodeResultQuery frm = new FrmNodeResultQuery(dt, 6, Date, Shift, Group, this.ob); frm.ShowDialog(); } /// /// 当班工具更换 /// private void DoToolChange() { string Shift = UserInfo.GetUserOrder(); string Group = UserInfo.GetUserGroup(); string User = UserInfo.GetUserName(); DateTime SeverTime = NativeMethod.GetSeverTime(this.ob); string StartTime = SeverTime.ToString("yyyy-MM-dd"); string EndTime = SeverTime.AddDays(1).ToString("yyyy-MM-dd"); string Date = StartTime; string Time = SeverTime.ToLongTimeString(); //晚班 if (Shift == "3") { Time = Time.Replace(":", ""); if (int.Parse(Time) > 205900) { StartTime += " " + "21:00:00"; EndTime += " " + "07:00:00"; } else { StartTime = SeverTime.AddDays(-1).ToString("yyyy-MM-dd") + " " + "21:00:00"; EndTime = SeverTime.ToString("yyyy-MM-dd") + " " + "07:00:00"; } } //DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.SizingResult.toolChangeQuery", new object[] { PLineCode, Shift, Group, StartTime, EndTime }, this.ob); txtQuery frm = new txtQuery(3, Date, Shift, Group, User, PLineCode, this.ob); frm.ShowDialog(); } public void DoHotCheck() { MainPlan.JudgeStoveNo = ActiveJUDGE_STOVE_NO; MainPlan.ProPlanId = proPlanId; MainPlan.GxPlanNo = gxPlanNo; DataTable dtMP = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getSingleMainPlanForHeatNo", new object[] { MainPlan }, this.ob); //FrmHotCheck frm = new FrmHotCheck(dtMP, this.ob); //frm.ShowDialog(); } /// /// 打印温度记录 /// private void PrintResult2() { Group = UserInfo.GetUserGroup(); Shift = UserInfo.GetUserOrder(); DateTime SeverTime = NativeMethod.GetSeverTime(this.ob); string Time = SeverTime.ToLongTimeString(); string StartTime = ""; // 开始时间 用于报表查询 string EndTime = ""; // 结束时间 用于报表查询 string strurl = ""; //晚班 Time = Time.Replace(":", ""); if (Shift == "3") { //查询晚班前一天20点40后到当天07点20前所有记录 if (int.Parse(Time) < 072000) { StartTime = SeverTime.AddDays(-1).ToShortDateString() + " 20:40:00"; EndTime = SeverTime.ToShortDateString() + " 07:20:00"; } //查询当天晚班的所有数据 else if (int.Parse(Time) > 204000) { StartTime = SeverTime.ToShortDateString() + " 20:40:00"; EndTime = SeverTime.AddDays(1).ToShortDateString() + " 07:20:00"; } } //白班 中班 else { StartTime = SeverTime.ToShortDateString() + " 00:00:00"; EndTime = SeverTime.AddDays(1).ToShortDateString() + " 00:00:00"; } strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilSizingResultAlltemp.cpt&format=pdf&SHIFT=" + Shift + "&GROUP=" + Group + "&DATE=" + StartTime + "&PLINECODE=" + PLineCode + "&DATE2=" + EndTime + "&USERID=" + _UserID; FrmRepExcel fre = new FrmRepExcel(ob, strurl); fre.AutoSize = true; fre.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height); fre.WindowState = FormWindowState.Maximized; fre.Show(); } /// /// 打印报表 /// private void PrintResult() { Group = UserInfo.GetUserGroup(); Shift = UserInfo.GetUserOrder(); DateTime SeverTime = NativeMethod.GetSeverTime(this.ob); string Time = SeverTime.ToLongTimeString(); string StartTime = ""; // 开始时间 用于报表查询 string EndTime = ""; // 结束时间 用于报表查询 string strurl = ""; //晚班 Time = Time.Replace(":", ""); if (Shift == "3") { //查询晚班前一天20点40后到当天07点20前所有记录 if (int.Parse(Time) < 072000) { StartTime = SeverTime.AddDays(-1).ToShortDateString() + " 20:40:00"; EndTime = SeverTime.ToShortDateString() + " 07:20:00"; } //查询当天晚班的所有数据 else if (int.Parse(Time) > 204000) { StartTime = SeverTime.ToShortDateString() + " 20:40:00"; EndTime = SeverTime.AddDays(1).ToShortDateString() + " 07:20:00"; } } //白班 中班 else { StartTime = SeverTime.ToShortDateString() + " 00:00:00"; EndTime = SeverTime.AddDays(1).ToShortDateString() + " 00:00:00"; } switch (PLineCode) { case "C008": //250 strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilSizingResult250.cpt&format=pdf&SHIFT=" + Shift + "&GROUP=" + Group + "&DATE=" + StartTime + "&PLINECODE=" + PLineCode + "&DATE2=" + EndTime + "&USERID=" + _UserID; break; case "C009": //258 strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilSizingResult258.cpt&format=pdf&SHIFT=" + Shift + "&GROUP=" + Group + "&DATE=" + StartTime + "&PLINECODE=" + PLineCode + "&DATE2=" + EndTime + "&USERID=" + _UserID; break; case "C010": //168 strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilSizingResult168.cpt&format=pdf&SHIFT=" + Shift + "&GROUP=" + Group + "&DATE=" + StartTime + "&PLINECODE=" + PLineCode + "&DATE2=" + EndTime + "&USERID=" + _UserID; break; case "C012": //Arssel break; case "C017": //460 strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilSizingResult460.cpt&format=pdf&SHIFT=" + Shift + "&GROUP=" + Group + "&DATE=" + StartTime + "&PLINECODE=" + PLineCode + "&DATE2=" + EndTime + "&USERID=" + _UserID; break; case "C072": //508 strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilSizingResult508.cpt&SHIFT=" + Shift + "&GROUP=" + Group + "&DATE=" + StartTime + "&PLINECODE=" + PLineCode + "&DATE2=" + EndTime + "&USERID=" + _UserID; break; } FrmRepExcel fre = new FrmRepExcel(ob, strurl); fre.AutoSize = true; fre.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height); fre.WindowState = FormWindowState.Maximized; fre.Show(); } /// /// 查询上个班原始记录 /// private void QueryBefore() { HOTMethod hm = new HOTMethod(this.ob); DateTime SeverTime = NativeMethod.GetSeverTime(this.ob); string Time = SeverTime.ToLongTimeString(); string Date = ""; if (Shift == "3") { Time = Time.Replace(":", ""); if (int.Parse(Time) < 122000) { Date = SeverTime.AddDays(-1).ToString("yyyyMMdd"); } else { Date = SeverTime.ToString("yyyyMMdd"); } } if (Shift == "1" || Shift == "0") { Date = SeverTime.AddDays(-1).ToString("yyyyMMdd"); } else { Date = SeverTime.ToString("yyyyMMdd"); } string StartTime = ""; // 开始时间 用于报表查询 string EndTime = ""; // 结束时间 用于报表查询 string StartTimeU = ""; // 开始时间 用于得到上班UserID string EndTimeU = ""; // 结束时间 用于得到上班UserID string strurl = ""; string ShitGroupBefore = HOTMethod.GetShiftBefore(Shift, Group, Date, PLineCode); //if (PLineCode.Equals("C072")) //{ // ShitGroupBefore = HOTMethod.GetShiftBefore(Shift, Group, Date); //} //else //{ // ShitGroupBefore = HOTMethod.GetShiftBefore(Shift, Group); //} string UserIDBefore = ""; //晚班 Time = Time.Replace(":", ""); if (Shift == "3") { //查询晚班前一天中班所有记录 if (int.Parse(Time) < 122000) { StartTime = SeverTime.AddDays(-1).ToShortDateString() + " 13:40:00"; EndTime = SeverTime.ToShortDateString() + " 00:00:00"; //string Date2 = SeverTime.ToString("yyyy-MM-dd"); StartTimeU = SeverTime.AddDays(-1).ToShortDateString() + " 13:40:00"; EndTimeU = SeverTime.ToShortDateString() + " 00:00:00"; UserIDBefore = hm.GetUserIDBefore(StartTimeU, EndTimeU, ShitGroupBefore.Substring(0, 1), ShitGroupBefore.Substring(1, 1), 5, PLineCode); //strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilPerforation.cpt&SHIFT=" + ShitGroupBefore.Substring(0, 1) + "&GROUP=" + ShitGroupBefore.Substring(1, 1) + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + UserIDBefore; } //查询当天中班的所有数据 else if (int.Parse(Time) > 204000) { StartTime = SeverTime.ToShortDateString() + " 13:40:00"; EndTime = SeverTime.AddDays(1).ToShortDateString() + " 00:00:00"; StartTimeU = SeverTime.ToShortDateString() + " 13:40:00"; EndTimeU = SeverTime.AddDays(1).ToShortDateString() + " 00:00:00"; UserIDBefore = hm.GetUserIDBefore(StartTimeU, EndTimeU, ShitGroupBefore.Substring(0, 1), ShitGroupBefore.Substring(1, 1), 5, PLineCode); //strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilPerforation.cpt&SHIFT=" + ShitGroupBefore.Substring(0, 1) + "&GROUP=" + ShitGroupBefore.Substring(1, 1) + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + UserIDBefore; } } //白班 else if (Shift == "1") { StartTime = SeverTime.AddDays(-1).ToShortDateString() + " 12:00:00"; EndTime = SeverTime.AddDays(0).ToShortDateString() + " 12:00:00"; StartTimeU = SeverTime.AddDays(-1).ToShortDateString() + " 12:00:00"; EndTimeU = SeverTime.AddDays(0).ToShortDateString() + " 12:00:00"; UserIDBefore = hm.GetUserIDBefore(StartTimeU, EndTimeU, ShitGroupBefore.Substring(0, 1), ShitGroupBefore.Substring(1, 1), 5, PLineCode); } //中班 else { StartTime = SeverTime.ToShortDateString() + " 00:00:00"; EndTime = SeverTime.AddDays(1).ToShortDateString() + " 00:00:00"; StartTimeU = SeverTime.ToShortDateString() + " 00:00:00"; EndTimeU = SeverTime.AddDays(1).ToShortDateString() + " 00:00:00"; UserIDBefore = hm.GetUserIDBefore(StartTimeU, EndTimeU, ShitGroupBefore.Substring(0, 1), ShitGroupBefore.Substring(1, 1), 5, PLineCode); //strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilPerforation.cpt&SHIFT=" + ShitGroupBefore.Substring(0, 1) + "&GROUP=" + ShitGroupBefore.Substring(1, 1) + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + UserIDBefore; } switch (PLineCode) { case "C008": //250 strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilSizingResult250.cpt&format=pdf&SHIFT=" + ShitGroupBefore.Substring(0, 1) + "&GROUP=" + ShitGroupBefore.Substring(1, 1) + "&DATE=" + StartTime + "&PLINECODE=" + PLineCode + "&DATE2=" + EndTime + "&USERID=" + UserIDBefore; break; case "C009": //258 strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilSizingResult258.cpt&format=pdf&SHIFT=" + ShitGroupBefore.Substring(0, 1) + "&GROUP=" + ShitGroupBefore.Substring(1, 1) + "&DATE=" + StartTime + "&PLINECODE=" + PLineCode + "&DATE2=" + EndTime + "&USERID=" + UserIDBefore; break; case "C010": //168 strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilSizingResult168.cpt&format=pdf&SHIFT=" + ShitGroupBefore.Substring(0, 1) + "&GROUP=" + ShitGroupBefore.Substring(1, 1) + "&DATE=" + StartTime + "&PLINECODE=" + PLineCode + "&DATE2=" + EndTime + "&USERID=" + UserIDBefore; break; case "C012": //Arssel break; case "C017": //460 strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilSizingResult460.cpt&format=pdf&SHIFT=" + ShitGroupBefore.Substring(0, 1) + "&GROUP=" + ShitGroupBefore.Substring(1, 1) + "&DATE=" + StartTime + "&PLINECODE=" + PLineCode + "&DATE2=" + EndTime + "&USERID=" + UserIDBefore; break; case "C072": //508 strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilSizingResult508.cpt&SHIFT=" + ShitGroupBefore.Substring(0, 1) + "&GROUP=" + ShitGroupBefore.Substring(1, 1) + "&DATE=" + StartTime + "&PLINECODE=" + PLineCode + "&DATE2=" + EndTime + "&USERID=" + UserIDBefore; break; } FrmRepExcel fre = new FrmRepExcel(ob, strurl); fre.AutoSize = true; fre.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height); fre.WindowState = FormWindowState.Maximized; fre.Show(); } /// /// 460 /// /// private void frmTechnological2_DoubleClickEvent(DataTable dt) { NativeMethodNew NmN = new NativeMethodNew(this.ob); HOTMethod HOTm = new HOTMethod(this.ob); if (!NmN.isBegineNode(ActiveJUDGE_STOVE_NO, 5)) { MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(ActiveJUDGE_STOVE_NO) + "】未开始定径,不能带入参数。"); return; } //if (HOTm.isNode(ActiveJUDGE_STOVE_NO, ActiveResultNo, 5, PLineCode)) //{ // MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(ActiveJUDGE_STOVE_NO) + "】已完成定径,不能带入参数。"); // return; //} MilSizingResultEntity SizingResult = new MilSizingResultEntity(); SizingResult = (MilSizingResultEntity)EntityTool.setObjectByDataTable(SizingResult, dt); this.sinzingResult_4601.UpdateDateForPrama(SizingResult); ShowMessageFlag = 1; ResultSave(); ShowMessageFlag = 0; } private void frmTechnological1_DoubleClickEvent(DataTable dt) { NativeMethodNew NmN = new NativeMethodNew(this.ob); HOTMethod HOTm = new HOTMethod(this.ob); if (!NmN.isBegineNode(ActiveJUDGE_STOVE_NO, 5)) { MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(ActiveJUDGE_STOVE_NO) + "】未开始定径,不能带入参数。"); return; } //if (HOTm.isNode(ActiveJUDGE_STOVE_NO, ActiveResultNo, 5, PLineCode)) //{ // MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(ActiveJUDGE_STOVE_NO) + "】已完成定径,不能带入参数。"); // return; //} MilSizingResultEntity SizingResult = new MilSizingResultEntity(); SizingResult = (MilSizingResultEntity)EntityTool.setObjectByDataTable(SizingResult, dt); this.sizingResult1.UpdateDateForPrama(SizingResult); ShowMessageFlag = 1; ResultSave(); ShowMessageFlag = 0; } private void timer2_Tick(object sender, EventArgs e) { if (!PlineCod.Equals("C072")) { DateTime SeverTime = NativeMethod.GetSeverTime(this.ob); string Time = SeverTime.ToLongTimeString(); Time = Time.Replace(":", ""); if (ChangeFlag == 0) { if (int.Parse(Time) > 065459 && int.Parse(Time) < 065600 || int.Parse(Time) > 070359 && int.Parse(Time) < 070500) { if (Shift == "3") { if (MessageUtil.ShowYesNoAndQuestion("确认最后一炉已交班或已结炉!") == DialogResult.Yes) { } ChangeFlag = 1; return; } } if (int.Parse(Time) > 135359 && int.Parse(Time) < 135500 || int.Parse(Time) > 140359 && int.Parse(Time) < 140500) { if (Shift == "1") { if (MessageUtil.ShowYesNoAndQuestion("确认最后一炉已交班或已结炉!") == DialogResult.Yes) { } ChangeFlag = 1; return; } } if (int.Parse(Time) > 205359 && int.Parse(Time) < 205500 || int.Parse(Time) > 210359 && int.Parse(Time) < 210500) { if (Shift == "2") { if (MessageUtil.ShowYesNoAndQuestion("确认最后一炉已交班或已结炉!") == DialogResult.Yes) { } ChangeFlag = 1; return; } } } } } /// /// 管号队列修改剔除原因 备注 /// /// /// private void ultraGridMatSeq_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == (char)13) { e.Handled = true; UltraGridRow ugr = null; int Index = ultraGridMatSeq.ActiveRow.Index; if (Index < ultraGridMatSeq.Rows.Count - 1) { ugr = ultraGridMatSeq.Rows[Index - 1]; // ugr = ultraGrid1.ActiveRow; } else { ugr = ultraGridMatSeq.ActiveRow; } ultraGridMatSeq.UpdateData(); ultraGridMatSeq.Update(); string ScrapReason = ugr.Cells["SCRAP_REASON"].Text.ToString(); string Remark = ugr.Cells["REMARK"].Text.ToString(); string Seq = ugr.Cells["SEQ"].Text.ToString(); string Status = ugr.Cells["STATUS"].Text.ToString(); if (Status == "剔除") { int dt = ServerHelper.SetData("com.steering.mes.zgmil.coup.FeedSawResult.UpdateMatNoPro", new object[] { ActiveJUDGE_STOVE_NO, ActiveResultNo, 5, Seq, ScrapReason, Remark }, this.ob); } GetFurRack(); ChangeGridColor(); } } } }