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.Control;
using com.steering.mes.zgmil.entity;
using Infragistics.Win.UltraWinGrid;
using Core.Mes.Client.Comm.Server;
using Core.StlMes.Client.ZGMil.Entity;
using Core.StlMes.Client.ZGMil.ResultConrtrol;
using Core.Mes.Client.Comm.Tool;
using Core.StlMes.Client.ZGMil.NodeResultQuery;
using System.Net;
using Infragistics.Win;
using Core.StlMes.Client.ZGMil.Popup;
using System.Collections;
using CoreFS.SA06;
using Core.Mes.Client.Comm.Format;
using Core.StlMes.Client.ZGMil.Common;
namespace Core.StlMes.Client.ZGMil.Result
{
public partial class FrmTestingResult : FrmBase
{
private Infragistics.Win.UltraWinGrid.UltraGrid _grid = null;
private RollingInfomation rl = new RollingInfomation();//计划卡
MilPlan QueryMainPlan = new MilPlan();//查询方法实体类
MilTestingRackEntity TestingRackEntity = new MilTestingRackEntity();//探伤跟踪表
MilPlan MainPlan = new MilPlan();//单击Cell方法实体类
MilPlan InsertMainPlan = new MilPlan();//双击方法修改Status实体类
//private CrackDetectionResult cr = new CrackDetectionResult();//探伤实绩卡
private MilEtResultEntity milet = new MilEtResultEntity();//ET探伤实绩卡赋值类
private MilEtResultEntity InsertMilet = new MilEtResultEntity();//插入探伤实绩表类
private MilEtResultEntity tempmilet = new MilEtResultEntity();//保存当前探伤实绩卡数据
private MilMtResultEntity tempmilmt = new MilMtResultEntity();
private MilUlResulEntity tempmilut = new MilUlResulEntity();
private MilMtResultEntity milmt = new MilMtResultEntity();//MT探伤实绩
private MilTestingResultDetailEntity milmtDetai = new MilTestingResultDetailEntity();//探伤实绩子表
private MilUlResulEntity milul = new MilUlResulEntity();//UL探伤实绩
private string ActiveJUDGE_STOVE_NO = null;//主计划活动行的判定炉号
private string ActiveStatus = null;//主计划活动行的状态
private string proPlanId = null;//轧管订单编号
private string gxPlanNo = null;//工序排产序号
private string lotNo = null;//生产批号
private string ActiveOFFLINE_FLAG = null;
private string ActiveResultNo = null;
private string TestMethod = "";//探伤方式
private string Departm = "";//部门
private string PlineCode = "";//产线
private string Colno = "";//台号
private string stoveno = "";
private string lotno = "";
string PlanStatusQuery = "89";
string PlanStartStatusQuery = "00"; //查询结炉实绩起始状态
private string Shift = "";
private string Group = "";
private string _User = "";
private string _UserName = ""; //签名 姓名
private string _Url = ""; //签名 Url
private string _UserID = ""; //签名 签名ID
private string ChangeUserID = "";
private string beforeQualifiedNum = "";//上道工序合格支数
private string qualifiedNum = "";//该工序合格支数
private string scrapNum = "";//该工序废品支数
private string offineHas = "";//已下线支数
private string offineHead = "";//返线支数
private string specName = "";//规格
private string length = "";//长度
private bool alarmFlag = false;
///
/// 工序状态:01-矫直1#,02-矫直2#,03-矫直3#,11-ET探伤,12-MT探伤,13-UT探伤
///
private string offlinenode = "";//下线注释
public Infragistics.Win.UltraWinGrid.UltraGrid Grid
{
get { return _grid; }
}
public FrmTestingResult()
{
InitializeComponent();
//各产线的保存方法
//this.testingResultDetailComm1.UltraGridDetail.ClickCellButton += new CellEventHandler(DetailComm1GridBtnClick);
//this.testingResultDetailComm21.UltraGridDetail.ClickCellButton += new CellEventHandler(DetailComm21GridBtnClick);
//this.testingResultDetail1681.UltraGridDetail.ClickCellButton += new CellEventHandler(Detail1681GridBtnClick);
//this.testingResultDetail16821.UltraGridDetail.ClickCellButton += new CellEventHandler(Detail16821GridBtnClick);
//this.testingResultDetail16831.UltraGridDetail.ClickCellButton += new CellEventHandler(Detail16831GridBtnClick);
}
public bool checkGrid(UltraGrid grid)
{
bool result = false;
for (int i = 0; i < grid.Rows.Count; i++)
{
UltraGridRow ugr = grid.Rows[i];
for (int j = 0; j < ugr.Cells.Count; j++)
{
if (string.IsNullOrEmpty(ugr.Cells[j].Value.ToString2()))
{
result = true;
}
}
}
return result;
}
///
/// 控件数据验证
///
///
///
public bool checkGridData(UltraGrid UltraGridDetail, UltraGrid UltraGridDetailDes1, UltraGrid UltraGridDetailDes2, int flag)
{
bool result = false;
int qunum = 0;//合格
int scrapnum = 0;//剔除
int detecnum = 0;//检测
int suspectnum = 0;//可疑
int reinqunum = 0;//复探合格
int suspectnumSUM = 0;
int scrapnumSUM = 0;
if (flag.Equals(1))
{
qunum = int.Parse(UltraGridDetail.Rows[0].Cells["qualifiedNum1"].Value.ToString3());
scrapnum = int.Parse(UltraGridDetail.Rows[0].Cells["scrapNum1"].Value.ToString3());
detecnum = int.Parse(UltraGridDetail.Rows[0].Cells["detectionNum1"].Value.ToString3());
suspectnum = int.Parse(UltraGridDetail.Rows[0].Cells["suspectProductNum1"].Value.ToString3());
reinqunum = int.Parse(UltraGridDetail.Rows[0].Cells["reinspectionQualifiedNum1"].Value.ToString3());
}
if (flag.Equals(2))
{
qunum = int.Parse(UltraGridDetail.Rows[0].Cells["qualifiedNum2"].Value.ToString3());
scrapnum = int.Parse(UltraGridDetail.Rows[0].Cells["scrapNum2"].Value.ToString3());
detecnum = int.Parse(UltraGridDetail.Rows[0].Cells["detectionNum2"].Value.ToString3());
suspectnum = int.Parse(UltraGridDetail.Rows[0].Cells["suspectProductNum2"].Value.ToString3());
reinqunum = int.Parse(UltraGridDetail.Rows[0].Cells["reinspectionQualifiedNum2"].Value.ToString3());
}
if (flag.Equals(3))
{
qunum = int.Parse(UltraGridDetail.Rows[0].Cells["qualifiedNum3"].Value.ToString3());
scrapnum = int.Parse(UltraGridDetail.Rows[0].Cells["scrapNum3"].Value.ToString3());
detecnum = int.Parse(UltraGridDetail.Rows[0].Cells["detectionNum3"].Value.ToString3());
suspectnum = int.Parse(UltraGridDetail.Rows[0].Cells["suspectProductNum3"].Value.ToString3());
reinqunum = int.Parse(UltraGridDetail.Rows[0].Cells["reinspectionQualifiedNum3"].Value.ToString3());
}
foreach (UltraGridRow ugr1 in UltraGridDetailDes1.Rows)
{
if (ugr1.Cells["Check"].Value.ToString() == "True")
{
suspectnumSUM += int.Parse(ugr1.Cells["reasonNumber"].Value.ToString3());
}
}
foreach (UltraGridRow ugr2 in UltraGridDetailDes2.Rows)
{
if (ugr2.Cells["Check"].Value.ToString() == "True")
{
scrapnumSUM += int.Parse(ugr2.Cells["reasonNumber"].Value.ToString3());
}
}
if (suspectnum - scrapnum < 0)
{
MessageUtil.ShowTips("剔除支数是基于可疑品之下,剔除支数不能大于可疑支数!");
return true;
}
if (detecnum - qunum != scrapnum)
{
MessageBox.Show("您输入的合格支数,剔除支数,检测支数不匹配", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return true;
}
if ((suspectnumSUM != suspectnum))
{
MessageBox.Show("您输入的可疑支数和可疑支数统计累加支数不匹配", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return true;
}
if ((scrapnumSUM != scrapnum))
{
MessageBox.Show("您输入的剔除支数和剔除统计的累加支数不匹配", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return true;
}
return false;
}
public void DetailComm1GridBtnClick(object sender, CellEventArgs e)
{
string hratno = "";
//UltraGrid UltraGridDetail = this.testingResultDetailComm1.UltraGridDetail;
//UltraGrid UltraGridDetailDes1 = this.testingResultDetailComm1.UltraGridDetailDes1;
//UltraGrid UltraGridDetailDes2 = this.testingResultDetailComm1.UltraGridDetailDes2;
//UltraGridDetail.Rows[0].Cells["offlineNum1"].Value = "0";
//UltraGridDetail.Rows[0].Cells["backlineNum1"].Value = "0";
//UltraGridDetail.UpdateData();
//UltraGridDetailDes1.UpdateData();
//UltraGridDetailDes2.UpdateData();
if (this.ultraGridPlan.ActiveRow == null && ActiveJUDGE_STOVE_NO == null)
{
MessageBox.Show("未选择任何炉号,请选择炉号后进行保存操作。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
if (this.ultraGridPlan.ActiveRow == null)
{
hratno = ActiveJUDGE_STOVE_NO;
}
else
{
hratno = this.ultraGridPlan.ActiveRow.Cells["JUDGE_STOVE_NO"].Value.ToString();
}
if (ActiveStatus == "未开始探伤")
{
MessageBox.Show("炉号:【" + BaseMethod.getJudgeStoveNo(hratno) + "】未开始进行探伤,不允许进行保存或提交操作!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
//if (checkGrid(UltraGridDetail))
//{
// MessageBox.Show("1#线实绩统计有值未输入,请输入后再保存或提交", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
// return;
//}
//if (this.testingResultDetailComm1.UltraGridDetail.ActiveCell.Column.Key == "Bnt2")
//{
// if (checkGrid(this.ulTestingResult1.UltraGrid3))
// {
// MessageBox.Show("该班组无1#线实绩,不能进行回退!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
// return;
// }
//}
//if (this.testingResultDetailComm1.UltraGridDetail.ActiveCell.Column.Key == "Btn1")
//{
// if (checkGrid(this.testingResultDetailComm1.UltraGridDetail))
// {
// MessageBox.Show("1#线实绩统计判废品统计有值未输入,请输入后再保存或提交", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
// return;
// }
//}
//if (checkGridData(UltraGridDetail, UltraGridDetailDes1, UltraGridDetailDes2, 1))
//{
// return;
//}
//foreach(UltraGridRow uRow in this.testingResultDetailComm1.UltraGridDetailDes1.Rows)
//{
// if (uRow.Cells["Check"].Value.ToString() == "True")
// {
// if (uRow.Cells["reason"].Value.ToString() == "")
// {
// MessageUtil.ShowTips("可疑品原因不能为空,请选择!");
// return;
// }
// if (uRow.Cells["reasonNumber"].Value.ToString() == "" || uRow.Cells["reasonNumber"].Value.ToString() == "0")
// {
// MessageUtil.ShowTips("可疑品支数不能为空或者为零支,请输入!");
// return;
// }
// }
//}
//foreach (UltraGridRow uRow in this.testingResultDetailComm1.UltraGridDetailDes2.Rows)
//{
// if (uRow.Cells["Check"].Value.ToString() == "True")
// {
// if (uRow.Cells["reason"].Value.ToString() == "")
// {
// MessageUtil.ShowTips("剔除品原因不能为空,请选择!");
// return;
// }
// if (uRow.Cells["reasonNumber"].Value.ToString() == "" || uRow.Cells["reasonNumber"].Value.ToString() == "0")
// {
// MessageUtil.ShowTips("剔除品支数不能为空或者为零支,请输入!");
// return;
// }
// }
//}
string plincode = this.PlineCode;
string resultno = this.ActiveResultNo;
string ColGroup = this.UserInfo.GetUserGroup();
string ColUser = this.UserInfo.GetUserName();
string ColShift = this.UserInfo.GetUserOrder();
MilTestingResultDetailEntity detail = new MilTestingResultDetailEntity();
List listdes1 = new List();
List listdes2 = new List();
MilTestingResultDetailDesEntity detaildes = new MilTestingResultDetailDesEntity();
//detail = NativeMethod.GetUltraGridToEntity(UltraGridDetail, detail);
//listdes1 = NativeMethod.GetGridToList1(UltraGridDetailDes1, detaildes);
//listdes2 = NativeMethod.GetGridToList1(UltraGridDetailDes2, detaildes);
ArrayList arr = new ArrayList();
ArrayList insertArr = new ArrayList();
detail.JudgeStoveNo = hratno;
detail.ResultNo = resultno;
detail.PlineCode = plincode;
detail.ColGroup = ColGroup;
detail.ColShift = ColShift;
detail.ColUser = ColUser;
detail.ColNo = "1";
arr.Add(detail);
foreach (MilTestingResultDetailDesEntity des in listdes1)
{
des.JudgeStoveNo = hratno;
des.PlineCode = plincode;
des.ResultNo = resultno;
des.ColGroup = ColGroup;
des.ColShift = ColShift;
des.ColUser = ColUser;
des.ColNo = "1";
des.ReasonFlag = "可疑";
//arr.Add(des);
}
foreach (MilTestingResultDetailDesEntity des in listdes2)
{
des.JudgeStoveNo = hratno;
des.PlineCode = plincode;
des.ResultNo = resultno;
des.ColGroup = ColGroup;
des.ColShift = ColShift;
des.ColUser = ColUser;
des.ColNo = "1";
des.ReasonFlag = "剔除";
//arr.Add(des);
}
arr.Add(listdes1);
arr.Add(listdes2);
insertArr.Add(listdes2);
if (this.ultraGridPlan.ActiveRow.Cells["NODE_STATUS"].Text == "探伤完成")
{
MessageUtil.ShowTips("此炉已结炉,不允许进行实绩操作!");
return;
}
if (e.Cell.Column.Key == "Btn1")//保存(直接提交)
{
//保存明细
int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.InsetTestResultdetail", new object[] { arr, this.TestMethod }, this.ob);
if (count > 0)
{
//insertSlabScrapSeq(insertArr);
PlanQuery();
MessageBox.Show("1#实绩保存成功", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
else
{
MessageBox.Show("1#实绩保存失败", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
}
if (e.Cell.Column.Key == "Btn2")//回退
{
int count1 = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.InsetTestResultdetailBack", new object[] { hratno, plincode, TestMethod, resultno, ColGroup, ColShift, "1", "1", "1", proPlanId, gxPlanNo, lotNo }, this.ob);
PlanQuery();
}
}
public void DetailComm21GridBtnClick(object sender, CellEventArgs e)
{
string hratno = "";
//UltraGrid UltraGridDetail = this.testingResultDetailComm21.UltraGridDetail;
//UltraGrid UltraGridDetailDes1 = this.testingResultDetailComm21.UltraGridDetailDes1;
//UltraGrid UltraGridDetailDes2 = this.testingResultDetailComm21.UltraGridDetailDes2;
//UltraGridDetail.Rows[0].Cells["offlineNum2"].Value = "0";
//UltraGridDetail.Rows[0].Cells["backlineNum2"].Value = "0";
//UltraGridDetail.UpdateData();
//UltraGridDetailDes1.UpdateData();
//UltraGridDetailDes2.UpdateData();
if (this.ultraGridPlan.ActiveRow == null && ActiveJUDGE_STOVE_NO == null)
{
MessageBox.Show("未选择任何炉号,请选择炉号后进行保存操作。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
if (this.ultraGridPlan.ActiveRow == null)
{
hratno = ActiveJUDGE_STOVE_NO;
}
else
{
hratno = this.ultraGridPlan.ActiveRow.Cells["JUDGE_STOVE_NO"].Value.ToString();
}
if (ActiveStatus == "未开始探伤")
{
MessageBox.Show("炉号:【" + BaseMethod.getJudgeStoveNo(hratno) + "】未开始进行探伤,不允许进行保存或提交操作!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
//if (checkGrid(UltraGridDetail))
//{
// MessageBox.Show("2#线实绩统计有值未输入,请输入后再保存或提交", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
// return;
//}
//if (checkGrid(UltraGridDetailDes1))
//{
// MessageBox.Show("2#线实绩统计可疑品统计有值未输入,请输入后再保存或提交", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
// return;
//}
//if (checkGrid(UltraGridDetailDes2))
//{
// MessageBox.Show("2#线实绩统计判废品统计有值未输入,请输入后再保存或提交", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
// return;
//}
//if (checkGridData(UltraGridDetail, UltraGridDetailDes1, UltraGridDetailDes2, 2))
//{
// return;
//}
//foreach (UltraGridRow uRow in this.testingResultDetailComm21.UltraGridDetailDes1.Rows)
//{
// if (uRow.Cells["Check"].Value.ToString() == "True")
// {
// if (uRow.Cells["reason"].Value.ToString() == "")
// {
// MessageUtil.ShowTips("可疑品原因不能为空,请选择!");
// return;
// }
// if (uRow.Cells["reasonNumber"].Value.ToString() == ""||uRow.Cells["reasonNumber"].Value.ToString() =="0")
// {
// MessageUtil.ShowTips("可疑品支数不能为空或者零支,请输入!");
// return;
// }
// }
//}
//foreach (UltraGridRow uRow in this.testingResultDetailComm1.UltraGridDetailDes2.Rows)
//{
// if (uRow.Cells["Check"].Value.ToString() == "True")
// {
// if (uRow.Cells["reason"].Value.ToString() == "")
// {
// MessageUtil.ShowTips("剔除品原因不能为空,请选择!");
// return;
// }
// if (uRow.Cells["reasonNumber"].Value.ToString() == "" || uRow.Cells["reasonNumber"].Value.ToString() == "0")
// {
// MessageUtil.ShowTips("剔除品支数不能为空或者为零支,请输入!");
// return;
// }
// }
//}
string plincode = this.PlineCode;
string resultno = this.ActiveResultNo;
string ColGroup = this.UserInfo.GetUserGroup();
string ColUser = this.UserInfo.GetUserName();
string ColShift = this.UserInfo.GetUserOrder();
MilTestingResultDetailEntity detail = new MilTestingResultDetailEntity();
List listdes1 = new List();
List listdes2 = new List();
MilTestingResultDetailDesEntity detaildes = new MilTestingResultDetailDesEntity();
//detail = NativeMethod.GetUltraGridToEntity(UltraGridDetail, detail);
//listdes1 = NativeMethod.GetGridToList1(UltraGridDetailDes1, detaildes);
//listdes2 = NativeMethod.GetGridToList1(UltraGridDetailDes2, detaildes);
ArrayList arr = new ArrayList();
detail.JudgeStoveNo = hratno;
detail.ResultNo = resultno;
detail.PlineCode = plincode;
detail.ColGroup = ColGroup;
detail.ColShift = ColShift;
detail.ColUser = ColUser;
detail.ColNo = "2";
arr.Add(detail);
foreach (MilTestingResultDetailDesEntity des in listdes1)
{
des.JudgeStoveNo = hratno;
des.PlineCode = plincode;
des.ResultNo = resultno;
des.ColGroup = ColGroup;
des.ColShift = ColShift;
des.ColUser = ColUser;
des.ColNo = "2";
des.ReasonFlag = "可疑";
//arr.Add(des);
}
foreach (MilTestingResultDetailDesEntity des in listdes2)
{
des.JudgeStoveNo = hratno;
des.PlineCode = plincode;
des.ResultNo = resultno;
des.ColGroup = ColGroup;
des.ColShift = ColShift;
des.ColUser = ColUser;
des.ColNo = "2";
des.ReasonFlag = "剔除";
//arr.Add(des);
}
arr.Add(listdes1);
arr.Add(listdes2);
if (this.ultraGridPlan.ActiveRow.Cells["NODE_STATUS"].Text == "探伤完成")
{
MessageUtil.ShowTips("此炉已结炉,不允许进行实绩操作!");
return;
}
if (e.Cell.Column.Key == "Btn1")//保存(直接提交)
{
//保存明细
int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.InsetTestResultdetail", new object[] { arr, this.TestMethod }, this.ob);
if (count > 0)
{
PlanQuery();
//MessageBox.Show("1#线实绩保存成功", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
else
{
MessageBox.Show("2#线实绩保存失败", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
}
if (e.Cell.Column.Key == "Btn2")//提交(交班)
{
int count1 = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.InsetTestResultdetailBack", new object[] { hratno, plincode, TestMethod, resultno, ColGroup, ColShift, "2", "1", "1", proPlanId, gxPlanNo, lotNo }, this.ob);
PlanQuery();
}
}
public void Detail16831GridBtnClick(object sender, CellEventArgs e)
{
string hratno = "";
//UltraGrid UltraGridDetail = this.testingResultDetail16831.UltraGridDetail;
//UltraGrid UltraGridDetailDes1 = this.testingResultDetail16831.UltraGridDetailDes1;
//UltraGrid UltraGridDetailDes2 = this.testingResultDetail16831.UltraGridDetailDes2;
//UltraGridDetail.Rows[0].Cells["offlineNum3"].Value = "0";
//UltraGridDetail.Rows[0].Cells["backlineNum3"].Value = "0";
//UltraGridDetail.UpdateData();
//UltraGridDetailDes1.UpdateData();
//UltraGridDetailDes2.UpdateData();
if (this.ultraGridPlan.ActiveRow == null && ActiveJUDGE_STOVE_NO == null)
{
MessageBox.Show("未选择任何炉号,请选择炉号后进行保存操作。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
if (this.ultraGridPlan.ActiveRow == null)
{
hratno = ActiveJUDGE_STOVE_NO;
}
else
{
hratno = this.ultraGridPlan.ActiveRow.Cells["JUDGE_STOVE_NO"].Value.ToString();
}
if (ActiveStatus == "未开始探伤")
{
MessageBox.Show("炉号:【" + BaseMethod.getJudgeStoveNo(hratno) + "】未开始进行探伤,不允许进行保存或提交操作!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
//if (checkGrid(UltraGridDetail))
//{
// MessageBox.Show("3#线实绩统计有值未输入,请输入后再保存或提交", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
// return;
//}
//if (checkGrid(UltraGridDetailDes1))
//{
// MessageBox.Show("3#线实绩统计可疑品统计有值未输入,请输入后再保存或提交", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
// return;
//}
//if (checkGrid(UltraGridDetailDes2))
//{
// MessageBox.Show("3#线实绩统计判废品统计有值未输入,请输入后再保存或提交", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
// return;
//}
//if (checkGridData(UltraGridDetail, UltraGridDetailDes1, UltraGridDetailDes2, 3))
//{
// return;
//}
//foreach (UltraGridRow uRow in this.testingResultDetailComm21.UltraGridDetailDes1.Rows)
//{
// if (uRow.Cells["Check"].Value.ToString() == "True")
// {
// if (uRow.Cells["reason"].Value.ToString() == "")
// {
// MessageUtil.ShowTips("可疑品原因不能为空,请选择!");
// return;
// }
// if (uRow.Cells["reasonNumber"].Value.ToString() == "" || uRow.Cells["reasonNumber"].Value.ToString() == "0")
// {
// MessageUtil.ShowTips("可疑品支数不能为空或者零支,请输入!");
// return;
// }
// }
//}
//foreach (UltraGridRow uRow in this.testingResultDetailComm1.UltraGridDetailDes2.Rows)
//{
// if (uRow.Cells["Check"].Value.ToString() == "True")
// {
// if (uRow.Cells["reason"].Value.ToString() == "")
// {
// MessageUtil.ShowTips("剔除品原因不能为空,请选择!");
// return;
// }
// if (uRow.Cells["reasonNumber"].Value.ToString() == "" || uRow.Cells["reasonNumber"].Value.ToString() == "0")
// {
// MessageUtil.ShowTips("剔除品支数不能为空或者零支,请输入!");
// return;
// }
// }
//}
string plincode = this.PlineCode;
string resultno = this.ActiveResultNo;
string ColGroup = this.UserInfo.GetUserGroup();
string ColUser = this.UserInfo.GetUserName();
string ColShift = this.UserInfo.GetUserOrder();
MilTestingResultDetailEntity detail = new MilTestingResultDetailEntity();
List listdes1 = new List();
List listdes2 = new List();
MilTestingResultDetailDesEntity detaildes = new MilTestingResultDetailDesEntity();
//detail = NativeMethod.GetUltraGridToEntity(UltraGridDetail, detail);
//listdes1 = NativeMethod.GetGridToList1(UltraGridDetailDes1, detaildes);
//listdes2 = NativeMethod.GetGridToList1(UltraGridDetailDes2, detaildes);
ArrayList arr = new ArrayList();
detail.JudgeStoveNo = hratno;
detail.ResultNo = resultno;
detail.PlineCode = plincode;
detail.ColGroup = ColGroup;
detail.ColShift = ColShift;
detail.ColUser = ColUser;
detail.ColNo = "3";
arr.Add(detail);
foreach (MilTestingResultDetailDesEntity des in listdes1)
{
des.JudgeStoveNo = hratno;
des.PlineCode = plincode;
des.ResultNo = resultno;
des.ColGroup = ColGroup;
des.ColShift = ColShift;
des.ColUser = ColUser;
des.ColNo = "3";
des.ReasonFlag = "可疑";
//arr.Add(des);
}
foreach (MilTestingResultDetailDesEntity des in listdes2)
{
des.JudgeStoveNo = hratno;
des.PlineCode = plincode;
des.ResultNo = resultno;
des.ColGroup = ColGroup;
des.ColShift = ColShift;
des.ColUser = ColUser;
des.ColNo = "3";
des.ReasonFlag = "剔除";
//arr.Add(des);
}
arr.Add(listdes1);
arr.Add(listdes2);
if (this.ultraGridPlan.ActiveRow.Cells["NODE_STATUS"].Text == "探伤完成")
{
MessageUtil.ShowTips("此炉已结炉,不允许进行实绩操作!");
return;
}
if (e.Cell.Column.Key == "Btn1")//保存(直接提交)
{
//保存明细
int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.InsetTestResultdetail", new object[] { arr, this.TestMethod }, this.ob);
if (count > 0)
{
PlanQuery();
//MessageBox.Show("1#线实绩保存成功", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
else
{
MessageBox.Show("3#线实绩保存失败", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
}
if (e.Cell.Column.Key == "Btn2")//提交(交班)
{
int count1 = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.InsetTestResultdetailBack", new object[] { hratno, plincode, TestMethod, resultno, ColGroup, ColShift, "3", "1", "1", proPlanId, gxPlanNo, lotNo }, this.ob);
PlanQuery();
}
}
///
/// 界面初始化事件
///
///
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
NativeMethodNew na = new NativeMethodNew(this.ob);
//testingResultDetailComm1.Init(na.GetPCode(UserInfo.GetDepartment()));
//testingResultDetailComm21.Init(na.GetPCode(UserInfo.GetDepartment()));
// this.heatTreatmentControl1.Grid.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
//this.ultraGrid2.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
rollingInfomation1.UltraGrid4.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
rollingCard1.UltraGrid4.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
crackDetectionResult1.UltraGrid3.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
ultraGridPlan.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
ultraTestRack1.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
//ultraTestRack2.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
//ultraTestRack3.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
mtTestingResult1.UltraGrid3.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
ulTestingResult1.UltraGrid3.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
mtTestingResult1.ob = this.ob;
crackDetectionResult1.ob = this.ob;
//mtTestingResult1.LoadData();
//this.testingResultDetailComm1.UltraGridDetail.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
//this.testingResultDetailComm1.UltraGridDetailDes1.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
//this.testingResultDetailComm1.UltraGridDetailDes2.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
//this.testingResultDetailComm21.UltraGridDetail.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
//this.testingResultDetailComm21.UltraGridDetailDes1.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
//this.testingResultDetailComm21.UltraGridDetailDes2.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
//this.testingResultDetail1681.UltraGridDetail.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
//this.testingResultDetail1681.UltraGridDetailDes1.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
//this.testingResultDetail1681.UltraGridDetailDes2.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
//this.testingResultDetail16821.UltraGridDetail.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
//this.testingResultDetail16821.UltraGridDetailDes1.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
//this.testingResultDetail16821.UltraGridDetailDes2.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
//this.testingResultDetail16831.UltraGridDetail.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
//this.testingResultDetail16831.UltraGridDetailDes1.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
//this.testingResultDetail16831.UltraGridDetailDes2.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
txtLOT_NO.Enabled = false;
txtJudgeStoveNo.Enabled = false;
this.crackDetectionResult1.Using1();
this.crackDetectionResult1.Using2();
this.crackDetectionResult1.Using3();
mtTestingResult1.Using1();
mtTestingResult1.Using2();
foreach (UltraGridColumn ugc in ultraGridPlan.DisplayLayout.Bands[0].Columns)
{
ugc.SortIndicator = SortIndicator.Disabled;
}
}
///
/// 按钮触发
///
///
///
public override void ToolBar_Click(object sender, string ToolbarKey)
{
//base.ToolBar_Click(sender, ToolbarKey);
switch (ToolbarKey)
{
case "Query": //查询
PlanQuery();
break;
case "Save": //保存
ETResultSave();
break;
case "Node": //结炉
ETTestingResultNode();
break;
case "DoNodeBack":
NodeBack();
break;
case "NodeQuery": //结炉实绩查询
NodeQuery();
break;
case "Doofflinre":
Offline();
break;
case "ReLine":
BackLine();
break;
case "DoStart":
DoStart();
break;
case "DoStartBack":
StartBack();
break;
case "colchang":
// colchang();
break;
case "DoChangeCancel":
// ChangeShiftBack();
break;
case "sign":
Sign();
break;
case "DoPrint":
PrintResult();
break;
case "PrintReport":
PrintReport();
break;
case "PrintReportRZ":
PrintReportRZ();
break;
case "changColGroup":
CancelchangColGroup();
break;
case "UpFile":
UpFile();
break;
case "UpFileRZ":
UpFileRZ();
break;
//case "SelectFile":
// SelectFile();
// break;
case "Close":
this.Dispose();
this.Close();
break;
}
}
///
/// 查询上传的PDF文件
///
private void SelectFile(string filePathNew)
{
dlgOrderAskDown down = new dlgOrderAskDown(this.ob, filePathNew);
down.DeleteButton.Visible = false;
down.ShowDialog();
}
///
/// 上传探伤报告
///
private void UpFile()
{
WebClient webClient = new WebClient();
List listPdf = new List();
string date = DateTime.Now.ToString("yyyyMMdd");
string heatno = this.ActiveJUDGE_STOVE_NO;
string judge = BaseMethod.getJudgeStoveNo(this.ActiveJUDGE_STOVE_NO);
string Shift = UserInfo.GetUserOrder();
string Group = UserInfo.GetUserGroup();
string url = "";
string filePathNew = ""; //探伤报告目录
string reportNo = ""; //报告编号
DataTable dt = new DataTable();
dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FileUpdate.getReportNo", new object[] { judge, PlineCode, Shift, Group }, this.ob);
if (dt.Rows.Count > 0)
{
reportNo = dt.Rows[0][0].ToString();
}
//craftOrdDesign.CraftPath = filePathNew + craftOrdDesign.CraftNo + ".pdf";
switch (PlineCode)
{
case "C008": //250
url = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilInspectionTestReport250.cpt&format=pdf&JUDGE_STOVE_NO=" + heatno + "&COL_GROUP=" + Group + "&COL_SHIFT=" + Shift;
filePathNew = "DicReport/250/" + judge + "/";
break;
case "C009": //258
url = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilInspectionTestReport258.cpt&format=pdf&JUDGE_STOVE_NO=" + heatno + "&COL_GROUP=" + Group + "&COL_SHIFT=" + Shift;
filePathNew = "DicReport/258/" + judge + "/";
break;
case "C010": //168
url = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilInspectionTestReport168.cpt&format=pdf&JUDGE_STOVE_NO=" + heatno + "&COL_GROUP=" + Group + "&COL_SHIFT=" + Shift;
filePathNew = "DicReport/168/" + judge + "/";
break;
case "C012": //Arssel
break;
case "C017": //460
url = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilInspectionTestReport460.cpt&format=pdf&JUDGE_STOVE_NO=" + heatno + "&COL_GROUP=" + Group + "&COL_SHIFT=" + Shift;
filePathNew = "DicReport/460/" + judge + "/";
break;
case "C072": //508
url = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilInspectionTestReport508.cpt&format=pdf&JUDGE_STOVE_NO=" + heatno + "&COL_GROUP=" + Group + "&COL_SHIFT=" + Shift;
filePathNew = "DicReport/508/" + judge + "/";
break;
}
byte[] pdf = webClient.DownloadData(url);
FileBean fileBean = new FileBean();
fileBean.setFile(pdf);
fileBean.setFileName(reportNo + ".pdf");
fileBean.setPathName(filePathNew);
listPdf.Add(fileBean);
webClient.Dispose();
bool a = FileHelper.Upload(listPdf);
if (a)
{
CoreClientParam ccp = new CoreClientParam();
ccp.ServerName = "com.steering.mes.zgmil.coup.FileUpdate";
ccp.MethodName = "updateInspectionReport";
ccp.ServerParams = new object[] { judge, Shift, Group, PlineCode, _UserName, filePathNew, proPlanId, gxPlanNo };
ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
if (ccp.ReturnCode != -1)
{
if (ccp.ReturnInfo.Equals("上传成功!"))
{
MessageUtil.ShowTips(ccp.ReturnInfo);
SelectFile(filePathNew + reportNo + ".pdf");
}
else
{
MessageUtil.ShowTips(ccp.ReturnInfo);
}
}
}
else
{
MessageUtil.ShowError("系统生成PDF失败,请稍后再试!");
return;
}
}
///
/// 上传探伤报告(认证)
///
private void UpFileRZ()
{
WebClient webClient = new WebClient();
List listPdf = new List();
string date = DateTime.Now.ToString("yyyyMMdd");
string heatno = this.ActiveJUDGE_STOVE_NO;
string judge = BaseMethod.getJudgeStoveNo(this.ActiveJUDGE_STOVE_NO);
string Shift = UserInfo.GetUserOrder();
string Group = UserInfo.GetUserGroup();
string url = "";
string filePathNew = ""; //探伤报告目录
string reportNo = ""; //报告编号
DataTable dt = new DataTable();
dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FileUpdate.getReportNo", new object[] { judge, PlineCode, Shift, Group }, this.ob);
if (dt.Rows.Count > 0)
{
reportNo = dt.Rows[0][0].ToString();
}
//craftOrdDesign.CraftPath = filePathNew + craftOrdDesign.CraftNo + ".pdf";
switch (PlineCode)
{
case "C072": //508
url = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilInspectionTestReport508TH.cpt&format=pdf&JUDGE_STOVE_NO=" + heatno + "&COL_GROUP=" + Group + "&COL_SHIFT=" + Shift;
filePathNew = "DicReport/508/" + judge + "/";
break;
}
byte[] pdf = webClient.DownloadData(url);
FileBean fileBean = new FileBean();
fileBean.setFile(pdf);
fileBean.setFileName(reportNo + ".pdf");
fileBean.setPathName(filePathNew);
listPdf.Add(fileBean);
webClient.Dispose();
bool a = FileHelper.Upload(listPdf);
if (a)
{
CoreClientParam ccp = new CoreClientParam();
ccp.ServerName = "com.steering.mes.zgmil.coup.FileUpdate";
ccp.MethodName = "updateInspectionReport";
ccp.ServerParams = new object[] { judge, Shift, Group, PlineCode, _UserName, filePathNew, proPlanId, gxPlanNo };
ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
if (ccp.ReturnCode != -1)
{
if (ccp.ReturnInfo.Equals("上传成功!"))
{
MessageUtil.ShowTips(ccp.ReturnInfo);
SelectFile(filePathNew + reportNo + ".pdf");
}
else
{
MessageUtil.ShowTips(ccp.ReturnInfo);
}
}
}
else
{
MessageUtil.ShowError("系统生成PDF失败,请稍后再试!");
return;
}
}
///
/// 自动上传PDF文件
///
private void AutoUpFile()
{
WebClient webClient = new WebClient();
List listPdf = new List();
string date = DateTime.Now.ToString("yyyyMMdd");
string heatno = this.ActiveJUDGE_STOVE_NO;
string judge = BaseMethod.getJudgeStoveNo(this.ActiveJUDGE_STOVE_NO);
string Shift = UserInfo.GetUserOrder();
string Group = UserInfo.GetUserGroup();
string url = "";
string filePathNew = ""; //探伤报告目录
string reportNo = ""; //报告编号
DataTable dt = new DataTable();
dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FileUpdate.getReportNo", new object[] { judge, PlineCode, Shift, Group }, this.ob);
if (dt.Rows.Count > 0)
{
reportNo = dt.Rows[0][0].ToString();
}
//craftOrdDesign.CraftPath = filePathNew + craftOrdDesign.CraftNo + ".pdf";
switch (PlineCode)
{
case "C008": //250
url = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilInspectionTestReport250.cpt&format=pdf&JUDGE_STOVE_NO=" + heatno + "&COL_GROUP=" + Group + "&COL_SHIFT=" + Shift;
filePathNew = "DicReport/250/" + judge + "/";
break;
case "C009": //258
url = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilInspectionTestReport258.cpt&format=pdf&JUDGE_STOVE_NO=" + heatno + "&COL_GROUP=" + Group + "&COL_SHIFT=" + Shift;
filePathNew = "DicReport/258/" + judge + "/";
break;
case "C010": //168
url = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilInspectionTestReport168.cpt&format=pdf&JUDGE_STOVE_NO=" + heatno + "&COL_GROUP=" + Group + "&COL_SHIFT=" + Shift;
filePathNew = "DicReport/168/" + judge + "/";
break;
case "C012": //Arssel
break;
case "C017": //460
url = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilInspectionTestReport460.cpt&format=pdf&JUDGE_STOVE_NO=" + heatno + "&COL_GROUP=" + Group + "&COL_SHIFT=" + Shift;
filePathNew = "DicReport/460/" + judge + "/";
break;
case "C072": //508
url = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilInspectionTestReport508.cpt&format=pdf&JUDGE_STOVE_NO=" + heatno + "&COL_GROUP=" + Group + "&COL_SHIFT=" + Shift;
filePathNew = "DicReport/508/" + judge + "/";
break;
}
byte[] pdf = webClient.DownloadData(url);
FileBean fileBean = new FileBean();
fileBean.setFile(pdf);
fileBean.setFileName(reportNo + ".pdf");
fileBean.setPathName(filePathNew);
listPdf.Add(fileBean);
webClient.Dispose();
bool a = FileHelper.Upload(listPdf);
if (a)
{
CoreClientParam ccp = new CoreClientParam();
ccp.ServerName = "com.steering.mes.zgmil.coup.FileUpdate";
ccp.MethodName = "updateInspectionReport";
ccp.ServerParams = new object[] { judge, Shift, Group, PlineCode, _UserName, filePathNew, proPlanId, gxPlanNo };
ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
if (ccp.ReturnCode != -1)
{
if (ccp.ReturnInfo.Equals("上传成功!"))
{
}
else
{
MessageUtil.ShowTips(ccp.ReturnInfo);
}
}
}
else
{
MessageUtil.ShowError("系统生成PDF失败,请手动上传报告!");
return;
}
}
///
/// 取消交接班
///
private void CancelchangColGroup()
{
UltraGridRow ugr_plan = this.ultraGridPlan.ActiveRow;
if (ugr_plan == null) return;
//string Status = ugr_plan.Cells["IS_START"].Value.ToString();
string ActiveJUDGE_STOVE_NO = ugr_plan.Cells["JUDGE_STOVE_NO"].Value.ToString();
string ActiveResultNo = ugr_plan.Cells["ID"].Value.ToString();
string Status = doQueryJugeNoStaus(ActiveResultNo, ActiveJUDGE_STOVE_NO, PlineCode);
if (Status == "1")
{
MessageBox.Show("炉号:【" + ActiveJUDGE_STOVE_NO + "】已完成探伤操作,不允许进行交班取消!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
if (Status == "3")
{
MessageBox.Show("炉号:【" + ActiveJUDGE_STOVE_NO + "】未开始探伤操作,不允许进行交班取消!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
string Shift = UserInfo.GetUserOrder();
string Group = UserInfo.GetUserGroup();
NativeMethodNew na = new NativeMethodNew(this.ob);
na.ChangeShiftBack(ActiveJUDGE_STOVE_NO, ActiveResultNo, proPlanId, gxPlanNo, PlineCode, Shift, Group, 8);
PlanQuery();
ChangeGridColor();
}
public string DoCheck(CoreUserInfo User)
{
return "";
}
private void ShowShift()
{
colShowShiftGroup1.Ob = this.ob;
colShowShiftGroup1.Group = this.UserInfo.GetUserGroup();
colShowShiftGroup1.Shift = this.UserInfo.GetUserOrder();
colShowShiftGroup1.ShowShift();
colShowShiftGroup1.Timer1.Enabled = true;
}
private void chkLotNo_CheckedChanged(object sender, EventArgs e)
{
this.txtLOT_NO.Enabled = this.chkLotNo.Checked;
}
private void chkHeatNo_CheckedChanged(object sender, EventArgs e)
{
if (this.chkHeatNo.Checked)
{
this.txtJudgeStoveNo.Enabled = true;
}
else
{
this.txtJudgeStoveNo.Enabled = false;
}
if (chkStatusQuery.Checked)
{
PlanStatusQuery = "99";
PlanStartStatusQuery = "90";
}
else
{
PlanStatusQuery = "89";
PlanStartStatusQuery = "00";
}
}
///
/// 页面开启事件
///
///
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);
//TestMethod = na.GetOperateResult(ip.ToString(), "1");
//if (!TestMethod.Contains("探伤"))
//{
// MessageBox.Show("提示:该电脑不是探伤操作台电脑,不允许操作改界面。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
// this.Dispose();
// this.Close();
// return;
//}
Departm = UserInfo.GetDepartment();
PlineCode = na.GetPCode(Departm);//获取 用户 对应的产线
//string plcode = na.GetOperateResult(ip.ToString(), "0");
//plcode = plcode.ToString().Trim();
//if (!PlineCode.Equals(plcode.Trim()))
//{
// MessageBox.Show("提示:您的账号所属产线与配置不符。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
// this.Dispose();
// this.Close();
// return;
//}
if (PlineCode.Equals("C009") || PlineCode.Equals("C017") || PlineCode.Equals("C008"))
{
offlinenode = "12";
ValueList va = new ValueList();
va.ValueListItems.Add("ISO10893-3");
va.ValueListItems.Add("ASTM E570");
va.ValueListItems.Add("GB/T12606");
//va.ValueListItems.Add("ISO10893-1");
va.ValueListItems.Add("GB/T 40080");
this.mtTestingResult1.UltraGrid3.Rows[0].Cells["InspectionStandard"].ValueList = va;
}
else if (PlineCode.Equals("C072"))
{
offlinenode = "12";
ValueList va = new ValueList();
va.ValueListItems.Add("ISO10893-3");
va.ValueListItems.Add("ASTM E570");
va.ValueListItems.Add("GB/T12606");
va.ValueListItems.Add("EN 10246-1");
va.ValueListItems.Add("GB/T 40080");
va.ValueListItems.Add("ISO 10893-1");
this.mtTestingResult1.UltraGrid3.Rows[0].Cells["InspectionStandard"].ValueList = va;
}
else if (PlineCode.Equals("C010"))
{
offlinenode = "11";
}
else
{
offlinenode = "13";
}
//if (TestMethod.Contains("涡流"))
//{
// offlinenode = "11";
//}
//if (TestMethod.Contains("漏磁"))
//{
// offlinenode = "12";
// ValueList va = new ValueList();
// va.ValueListItems.Add("ISO10893-3");
// va.ValueListItems.Add("ASTM E570");
// va.ValueListItems.Add("GB/T12606");
// this.mtTestingResult1.UltraGrid3.Rows[0].Cells["InspectionStandard"].ValueList = va;
//}
//if (TestMethod.Contains("超声波"))
//{
// offlinenode = "13";
//}
if (PlineCode.Equals("C009") || PlineCode.Equals("C012") || PlineCode.Equals("C017") || PlineCode.Equals("C072"))
{
this.rollingCard1.ChangCard();
}
//Colno = TestMethod.Substring(TestMethod.Length - 2, 1);
if (PlineCode.Equals("C008") || PlineCode.Equals("C009") || PlineCode.Equals("C012") || PlineCode.Equals("C072"))
{
ultraTabControl1.Tabs[0].Visible = false;
ultraTabControl1.Tabs[1].Visible = true;
ultraTabControl1.Tabs[2].Visible = false;
}
else if (PlineCode.Equals("C010"))
{
ultraTabControl1.Tabs[0].Visible = true;
ultraTabControl1.Tabs[1].Visible = false;
ultraTabControl1.Tabs[2].Visible = false;
}
else
{
ultraTabControl1.Tabs[0].Visible = false;
ultraTabControl1.Tabs[1].Visible = false;
ultraTabControl1.Tabs[2].Visible = true;
}
if (PlineCode.Equals("C010"))
{
//ultraTabControl3.Tabs[0].Visible = false;
//ultraTabControl3.Tabs[1].Visible = true;
// ultraExpandableGroupBox2.Visible = true;
}
else
{
//ultraTabControl3.Tabs[0].Visible = true;
//ultraTabControl3.Tabs[1].Visible = false;
//ultraExpandableGroupBox2.Visible = false;
}
//this.testingResultDetailComm21.PlineCode = plcode;
this.ultraGridPlan.Focus();
PlanQuery();
//foreach (UltraGridRow ugr in ultraGridPlan.Rows)
//{
// ugr.Cells["JUDGE_NO"].Value = BaseMethod.getJudgeStoveNo(ugr.Cells["JUDGE_STOVE_NO"].Value.ToString());
//}
Shift = UserInfo.GetUserOrder();
Group = UserInfo.GetUserGroup();
mtTestingResult1.ColGroup = Group;
mtTestingResult1.PlineCode = PlineCode;
crackDetectionResult1.ColGroup = Group;
crackDetectionResult1.PlineCode = PlineCode;
mtTestingResult1.LoadData();
crackDetectionResult1.LoadData();
Sign();
ShowShift();
}
///
/// 签名
///
private void Sign()
{
ColUserName col = new ColUserName();
col.StationId = "8";
col.PlineCode = PlineCode;
col.ColGroup = Group;
col.Ob = this.ob;
col.ShowDialog();
_UserID = col.getUserId();
_UserName = col.getUserName();
}
///
/// 修改IS_START名称
///
public void ChangeCellName()
{
if (ultraGridPlan.Rows.Count > 0)
{
NativeMethodNew na = new NativeMethodNew(this.ob);
foreach (UltraGridRow ugr in ultraGridPlan.Rows)
{
//String Judge_Stove_No = ugr.Cells["JUDGE_DTOVE_NO"].Value.ToString();
//if (na.isBegineNode(Judge_Stove_No, 0))
//{
// ugr.Appearance.BackColor = Color.YellowGreen;
//}
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;
}
}
}
}
}
///
/// 判断是否能开始当前炉次
///
///
private void IsStart()
{
foreach (UltraGridRow ugr in ultraGridPlan.Rows)
{
if (ugr.Cells["IS_START"].Value.ToString() == "已开始探伤")
{
MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(ugr.Cells["JUDGE_STOVE_NO"].Value.ToString()) + "】正在探伤,不能两炉同时开始探伤。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
}
}
///
/// 更改Grid颜色
///
public void ChangeGridColor()
{
foreach (UltraGridRow ugr in ultraGridPlan.Rows)
{
if (ugr.Cells["IS_START"].Value.ToString() == "已完成探伤")
{
ugr.Appearance.BackColor = Color.YellowGreen;
}
}
if (ultraTestRack1.Rows.Count > 0)
{
foreach (UltraGridRow ugr in ultraTestRack1.Rows)
{
if (ugr != null)
{
if (ugr.Cells["SUSPECT_FLAG"].Value.Equals("可疑"))
{
ugr.Appearance.BackColor = Color.LightYellow;
}
switch (ugr.Cells["STATUS"].Value.ToString())
{
case "判废":
ugr.Appearance.BackColor = Color.Yellow;
break;
case "报警":
ugr.Appearance.BackColor = Color.YellowGreen;
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 (PlineCode.Equals("C009") || PlineCode.Equals("C012") || PlineCode.Equals("C017") || PlineCode.Equals("C072"))
{
if (this.ultraGridPlan.ActiveRow.Cells["BACK_PLAN_FLAG"].Text.Trim().ToString2() == "8" || this.ultraGridPlan.ActiveRow.Cells["BACK_PLAN_FLAG"].Text.Trim().ToString2() == "7")
{
dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getRollingCard1BackLine", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, ob);
}
else
{
dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getRollingCard1", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, this.ob);
}
}
else if (PlineCode.Equals("C010"))
{
if (this.ultraGridPlan.ActiveRow.Cells["BACK_PLAN_FLAG"].Text.Trim().ToString2() == "8" || this.ultraGridPlan.ActiveRow.Cells["BACK_PLAN_FLAG"].Text.Trim().ToString2() == "7")
{
dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.getRollCard168BackLine", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, ob);
}
else
{
dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.getRollCard168", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, this.ob);
}
}
else
{
if (this.ultraGridPlan.ActiveRow.Cells["BACK_PLAN_FLAG"].Text.Trim().ToString2() == "8" || this.ultraGridPlan.ActiveRow.Cells["BACK_PLAN_FLAG"].Text.Trim().ToString2() == "7")
{
dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getRollingCardBackLine", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, ob);
}
else
{
dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getRollingCard", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, this.ob);
}
}
RollingCardEditGrid(dt, JudgeStoveNo);
}
}
///
/// 流通卡赋值
///
///
public void RollingCardEditGrid(DataTable dt, string heatno)
{
clearRollCard();
if (dt.Rows.Count > 0)
{
if (this.ultraGridPlan.ActiveRow.Cells["BACK_PLAN_FLAG"].Text.Trim().ToString2() == "8" || this.ultraGridPlan.ActiveRow.Cells["BACK_PLAN_FLAG"].Text.Trim().ToString2() == "7")
{
//上料切前判废支数
this.rollingCard1.Value.FeedScrapNum = "0";
//上料切前合格支数
this.rollingCard1.Value.FeedQualifiedNum = "0";
//上料判废支数
this.rollingCard1.Value.FeedScrapDBNum = "0";
//上料合格支数
this.rollingCard1.Value.FeedQualifiedDBNum = "0";
//加热炉判废支数
this.rollingCard1.Value.FurScrapNum = "0";
//加热炉合格支数
this.rollingCard1.Value.FurQualifiedNum = "0";
//穿孔判废支数
this.rollingCard1.Value.PerScrapNum = "0";
//穿孔合格支数
this.rollingCard1.Value.PerQualifiedNum = "0";
//连轧判废支数
this.rollingCard1.Value.RollingScrapNum = "0";
//连轧合格支数
this.rollingCard1.Value.RollingQualifiedNum = "0";
//再加热炉判废支数
this.rollingCard1.Value.RefurScrapNum = "0";
//再加热炉合格支数
this.rollingCard1.Value.RefurQualifiedNum = "0";
//定径判废支数
this.rollingCard1.Value.SizingScrapNum = "0";
//定径合格支数
this.rollingCard1.Value.SizingQualifiedNum = "0";
//分切前判废支数
this.rollingCard1.Value.SawScrapNumBE = "0";
//分切前合格支数
this.rollingCard1.Value.SawQualifiedNumBE = "0";
//分切判废支数
this.rollingCard1.Value.SawScrapNum = "0";
//分切合格支数
this.rollingCard1.Value.SawQualifiedNum = "0";
//矫直判废支数
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.BacklineStraight = dt.Rows[0]["BACKLINE_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();
this.rollingCard1.Value.BacklineTesting = dt.Rows[0]["BACKLINE_TESTING"].ToString();
}
else
{
if (dt.Rows[0]["OFFLINE_TESTING"].ToString() == "0")
{
this.rollingCard1.Value.OfflineTesting = "";
this.rollingCard1.Value.BacklineTesting = "";
}
else
{
//探伤下线支数
this.rollingCard1.Value.OfflineTesting = dt.Rows[0]["OFFLINE_TESTING"].ToString();
this.rollingCard1.Value.BacklineTesting = dt.Rows[0]["BACKLINE_TESTING"].ToString();
}
}
//表检剔除支数
this.rollingCard1.Value.SurfaceScrapNum = dt.Rows[0]["WASTE_QUANTITY"].ToString();
//表检合格支数
this.rollingCard1.Value.SurfaceQualifiedNum = dt.Rows[0]["QUALIFIED_BRANCH"].ToString();
//表检下线支数
this.rollingCard1.Value.OfflineSurface = dt.Rows[0]["OFFLINE_QUANTITY"].ToString();
}
else
{
//上料切前判废支数
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.BacklineStraight = dt.Rows[0]["BACKLINE_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();
this.rollingCard1.Value.BacklineTesting = dt.Rows[0]["BACKLINE_TESTING"].ToString();
}
else
{
if (dt.Rows[0]["OFFLINE_TESTING"].ToString() == "0")
{
this.rollingCard1.Value.OfflineTesting = "";
this.rollingCard1.Value.BacklineTesting = "";
}
else
{
//探伤下线支数
this.rollingCard1.Value.OfflineTesting = dt.Rows[0]["OFFLINE_TESTING"].ToString();
this.rollingCard1.Value.BacklineTesting = dt.Rows[0]["BACKLINE_TESTING"].ToString();
}
}
//表检剔除支数
this.rollingCard1.Value.SurfaceScrapNum = dt.Rows[0]["WASTE_QUANTITY"].ToString();
//表检合格支数
this.rollingCard1.Value.SurfaceQualifiedNum = dt.Rows[0]["QUALIFIED_BRANCH"].ToString();
//表检下线支数
this.rollingCard1.Value.OfflineSurface = dt.Rows[0]["OFFLINE_QUANTITY"].ToString();
}
this.rollingCard1.UpdateData();
}
//else
//{
// this.rollingCard1.ClearData();
//}
}
public void clearRollCard()
{
//上料切前判废支数
this.rollingCard1.Value.FeedScrapNum = "0";
//上料切前合格支数
this.rollingCard1.Value.FeedQualifiedNum = "0";
//上料判废支数
this.rollingCard1.Value.FeedScrapDBNum = "0";
//上料合格支数
this.rollingCard1.Value.FeedQualifiedDBNum = "0";
//加热炉判废支数
this.rollingCard1.Value.FurScrapNum = "0";
//加热炉合格支数
this.rollingCard1.Value.FurQualifiedNum = "0";
//穿孔判废支数
this.rollingCard1.Value.PerScrapNum = "0";
//穿孔合格支数
this.rollingCard1.Value.PerQualifiedNum = "0";
//连轧判废支数
this.rollingCard1.Value.RollingScrapNum = "0";
//连轧合格支数
this.rollingCard1.Value.RollingQualifiedNum = "0";
//再加热炉判废支数
this.rollingCard1.Value.RefurScrapNum = "0";
//再加热炉合格支数
this.rollingCard1.Value.RefurQualifiedNum = "0";
//定径判废支数
this.rollingCard1.Value.SizingScrapNum = "0";
//定径合格支数
this.rollingCard1.Value.SizingQualifiedNum = "0";
//分切前判废支数
this.rollingCard1.Value.SawScrapNumBE = "0";
//分切前合格支数
this.rollingCard1.Value.SawQualifiedNumBE = "0";
//分切判废支数
this.rollingCard1.Value.SawScrapNum = "0";
//分切合格支数
this.rollingCard1.Value.SawQualifiedNum = "0";
//矫直判废支数
this.rollingCard1.Value.StraightScrapNum = "0";
//矫直合格支数
this.rollingCard1.Value.StraightQualifiedNum = "0";
//矫直下线支数
this.rollingCard1.Value.OfflineStraight = "0";
//矫直返线支数
this.rollingCard1.Value.BacklineStraight = "0";
//探伤判废支数
this.rollingCard1.Value.TestingScrapNum = "0";
//探伤合格支数
this.rollingCard1.Value.TestingQualifiedNum = "0";
//探伤下线支数
this.rollingCard1.Value.OfflineTesting = "0";
this.rollingCard1.Value.BacklineTesting = "0";
//表检剔除支数
this.rollingCard1.Value.SurfaceScrapNum = "0";
//表检合格支数
this.rollingCard1.Value.SurfaceQualifiedNum = "0";
//表检下线支数
this.rollingCard1.Value.OfflineSurface = "0";
this.rollingCard1.UpdateData();
}
///
/// 轧制信息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();
}
}
///
/// 查询探伤跟踪
///
/// 判定炉号JUDGE_STOVE_NO
public void GetMILTestingRack(string str)
{
this.dtTestRack1.Clear();
this.dtTestRack2.Clear();
this.dtTestRack3.Clear();
string flagstatus = "0";
if (this.ActiveStatus.Equals("已完成探伤"))
{
flagstatus = "1";
}
if (PlineCode.Equals("C010"))
{
ultraTestRack1.DisplayLayout.Bands[0].Columns["RECUT_LENGTH"].Hidden = true;
ultraTestRack1.DisplayLayout.Bands[0].Columns["RECUT_FLAG"].Hidden = true;
}
DataTable dtTR = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.GetTestingRack", new Object[] { str, flagstatus, proPlanId, gxPlanNo }, this.ob);
GridHelper.CopyDataToDatatable(ref dtTR, ref dtTestRack1, true);
ChangeGridColor();
//if (dtTR.Rows.Count > 0)
//{
//Infragistics.Win.ValueList valulist = new Infragistics.Win.ValueList();//复探原因
//valulist.ValueListItems.Add("LOD");
//valulist.ValueListItems.Add("LID");
//valulist.ValueListItems.Add("TOD");
//valulist.ValueListItems.Add("TID");
//Infragistics.Win.ValueList valulistre = new Infragistics.Win.ValueList();//剔除原因
//valulistre.ValueListItems.Add("内折");
//valulistre.ValueListItems.Add("内结疤");
//valulistre.ValueListItems.Add("内划伤");
//valulistre.ValueListItems.Add("拉凹");
//valulistre.ValueListItems.Add("内棱");
//valulistre.ValueListItems.Add("内壁伤");
//valulistre.ValueListItems.Add("内鼓包");
//valulistre.ValueListItems.Add("外折");
//valulistre.ValueListItems.Add("外结疤");
//valulistre.ValueListItems.Add("外划伤");
//valulistre.ValueListItems.Add("裂纹");
//valulistre.ValueListItems.Add("靑线");
//valulistre.ValueListItems.Add("轧折");
//valulistre.ValueListItems.Add("孔洞");
//if (Colno.Equals("1"))
//{
// //this.ultraTabControl2.Tabs[0].Visible = true;
// //this.ultraTabControl2.Tabs[1].Visible = false;
// //this.ultraTabControl2.Tabs[2].Visible = false;
// GridHelper.CopyDataToDatatable(ref dtTR, ref dtTestRack1, true);
// //ultraTestRack1.DisplayLayout.Bands[0].PerformAutoResizeColumns(true, PerformAutoSizeType.AllRowsInBand);
// foreach (UltraGridRow ugr in ultraTestRack1.Rows)
// {
// ugr.Cells["SCRAP_SLAB"].Value = "判废";
// //ugr.Cells["SCRAP_REASON"].ValueList = valulistre;
// ugr.Cells["ReInspection"].Value = "复探";
// ugr.Cells["ReInspectionBACK"].Value = "复探回退";
// ugr.Cells["DELBACK"].Value = "判废回退";
// ugr.Cells["ChangShift"].Value = "交班操作";
// //ugr.Cells["ALARM_REASON"].ValueList = valulist;
// ugr.Cells["ChangShift"].Value = "交班操作";
// ugr.Cells["BTNCHANGECOM"].Value = "接班操作";
// if (ugr.Cells["SUSPECT_FLAG"].Value.Equals("正常轧制"))
// {
// ugr.Cells["SUSPECT"].Value = "可疑";
// }
// if (ugr.Cells["SUSPECT_FLAG"].Value.Equals("可疑"))
// {
// ugr.Cells["SUSPECT"].Value = "可疑回退";
// }
// if (ugr.Cells["RECUT_FLAG"].Value.Equals("再切"))
// {
// ugr.Cells["RECUT"].Value = "再切回退";
// }
// if (ugr.Cells["RECUT_FLAG"].Value.Equals("不再切"))
// {
// ugr.Cells["RECUT"].Value = "子管再切";
// }
// if (ugr.Cells["PLINE_CODE"].Value.ToString() == "C008")
// {
// ugr.Cells["PLINE_CODE"].Value = "250机组";
// }
// if (ugr.Cells["PLINE_CODE"].Value.ToString() == "C009")
// {
// ugr.Cells["PLINE_CODE"].Value = "258机组";
// }
// if (ugr.Cells["PLINE_CODE"].Value.ToString() == "C010")
// {
// ugr.Cells["PLINE_CODE"].Value = "168机组";
// }
// if (ugr.Cells["PLINE_CODE"].Value.ToString() == "C012")
// {
// ugr.Cells["PLINE_CODE"].Value = "ASSEL机组";
// }
// if (ugr.Cells["PLINE_CODE"].Value.ToString() == "C017")
// {
// ugr.Cells["PLINE_CODE"].Value = "460机组";
// }
// }
//}
//}
}
///
/// 更新探伤实绩卡
///
/// 判定炉号JUDGE_STOVE_NO
public void GetMILETResult(string str)
{
DataTable dsDetail = new DataTable();
//if (TestMethod.Contains("涡流"))//涡流ET
if (PlineCode.Equals("C010"))
{
offlinenode = "11";
ultraTabControl1.Tabs[0].Visible = true;
ultraTabControl1.Tabs[1].Visible = false;
ultraTabControl1.Tabs[2].Visible = false;
DataTable dtETR = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.GetETResult", new object[] { str, proPlanId, gxPlanNo }, this.ob);
if (dtETR.Rows.Count > 0)
{
//查询实绩子表数据
dsDetail = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.getMtDetail", new object[] { str, this.UserInfo.GetUserOrder(), this.UserInfo.GetUserGroup(), proPlanId, gxPlanNo }, ob);
milet.Clear();
//探伤卡赋值
milet = NativeMethod.GetTableToEntity(dtETR, milet);
this.crackDetectionResult1.Value = milet;
crackDetectionResult1.ColOrder = this.UserInfo.GetUserOrder();
crackDetectionResult1.ColGroup = this.UserInfo.GetUserGroup();
crackDetectionResult1.PlineCode = PlineCode;
//crackDetectionResult1.ColNo = Colno;
crackDetectionResult1.ResultNo = this.ultraGridPlan.ActiveRow.Cells["ID"].Value.ToString();
if (dsDetail.Rows.Count > 0)
{
milmtDetai.Clear();
milmtDetai = NativeMethod.GetTableToEntity(dsDetail, milmtDetai);
crackDetectionResult1.Value1 = milmtDetai;
}
else
{
milmtDetai.Clear();
crackDetectionResult1.Value1 = milmtDetai;
}
if (this.ultraGridPlan.ActiveRow.Cells["NODE_STATUS"].Text == "探伤完成" || this.ultraGridPlan.ActiveRow.Cells["NODE_STATUS"].Text == "人工质检完成" || this.ultraGridPlan.ActiveRow.Cells["NODE_STATUS"].Text == "交库完成")
{
this.crackDetectionResult1.Using1();
this.crackDetectionResult1.Using2();
this.crackDetectionResult1.Using3();
}
else
{
milmtDetai.Clear();
if (Colno.Equals("1"))
{
this.crackDetectionResult1.Using1();
this.crackDetectionResult1.Using4();
}
if (Colno.Equals("2"))
{
this.crackDetectionResult1.Using2();
this.crackDetectionResult1.Using5();
}
if (Colno.Equals("3"))
{
this.crackDetectionResult1.Using3();
this.crackDetectionResult1.Using6();
}
}
}
else
{
milet.Clear();
milmtDetai.Clear();
this.crackDetectionResult1.Value = milet;
crackDetectionResult1.Value1 = milmtDetai;
this.crackDetectionResult1.Using1();
this.crackDetectionResult1.Using2();
this.crackDetectionResult1.Using3();
}
}
//if (TestMethod.Contains("漏磁"))//磁粉MT
if (PlineCode.Equals("C009") || PlineCode.Equals("C008") || PlineCode.Equals("C017") || PlineCode.Equals("C072"))
{
offlinenode = "12";
ultraTabControl1.Tabs[0].Visible = false;
ultraTabControl1.Tabs[1].Visible = true;
ultraTabControl1.Tabs[2].Visible = false;
DataTable dtMTR = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.GetMTResult", new object[] { str, proPlanId, gxPlanNo }, this.ob);
if (dtMTR.Rows.Count > 0)
{
//查询实绩子表数据
dsDetail = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.getMtDetail", new object[] { str, this.UserInfo.GetUserOrder(), this.UserInfo.GetUserGroup(), proPlanId, gxPlanNo }, ob);
milmt.Clear();
milmt = NativeMethod.GetTableToEntity(dtMTR, milmt);
mtTestingResult1.Value = milmt;
mtTestingResult1.ColOrder = this.UserInfo.GetUserOrder();
mtTestingResult1.ColGroup = this.UserInfo.GetUserGroup();
mtTestingResult1.PlineCode = PlineCode;
mtTestingResult1.ColNo = Colno;
mtTestingResult1.ResultNo = this.ultraGridPlan.ActiveRow.Cells["ID"].Value.ToString();
if (dsDetail.Rows.Count > 0)
{
milmtDetai.Clear();
milmtDetai = NativeMethod.GetTableToEntity(dsDetail, milmtDetai);
mtTestingResult1.Value1 = milmtDetai;
}
else
{
milmtDetai.Clear();
mtTestingResult1.Value1 = milmtDetai;
}
if (this.ultraGridPlan.ActiveRow.Cells["NODE_STATUS"].Text == "探伤完成" || this.ultraGridPlan.ActiveRow.Cells["NODE_STATUS"].Text == "人工质检完成" || this.ultraGridPlan.ActiveRow.Cells["NODE_STATUS"].Text == "交库完成")
{
this.mtTestingResult1.Using1();
this.mtTestingResult1.Using2();
}
else
{
milmtDetai.Clear();
if (Colno.Equals("1"))
{
this.mtTestingResult1.Using1();
this.mtTestingResult1.Using4();
}
if (Colno.Equals("2"))
{
this.mtTestingResult1.Using2();
this.mtTestingResult1.Using3();
}
}
}
else
{
milmt.Clear();
milmtDetai.Clear();
mtTestingResult1.Value = milmt;
mtTestingResult1.Value1 = milmtDetai;
this.mtTestingResult1.Using1();
this.mtTestingResult1.Using2();
}
}
//if (TestMethod.Contains("超声波"))//超声波UT
if (PlineCode.Equals("C012"))
{
offlinenode = "13";
ultraTabControl1.Tabs[0].Visible = false;
ultraTabControl1.Tabs[1].Visible = false;
ultraTabControl1.Tabs[2].Visible = true;
DataTable dtUTR = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.GetUTResult", new object[] { str, proPlanId, gxPlanNo }, this.ob);
if (dtUTR.Rows.Count > 0)
{
milul.Clear();
milul = NativeMethod.GetTableToEntity(dtUTR, milul);
ulTestingResult1.Value = milul;
if (Colno.Equals("1"))
{
this.ulTestingResult1.Using1();
}
if (Colno.Equals("2"))
{
this.ulTestingResult1.Using2();
}
}
else
{
milul.Clear();
ulTestingResult1.Value = milul;
}
}
string plincode = this.PlineCode;
string ColGroup = this.UserInfo.GetUserGroup();
string ColUser = this.UserInfo.GetUserName();
string ColShift = this.UserInfo.GetUserOrder();
MilTestingResultDetailEntity detail = new MilTestingResultDetailEntity();
DataTable dttetail = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.GetResultDetail", new object[] { str, plincode, ColGroup, ColUser, ColShift, proPlanId, gxPlanNo }, this.ob);
if (dttetail.Rows.Count > 0)
{
detail = NativeMethod.GetTableToEntity(dttetail, detail);
}
//if (!PlineCode.Equals("C010"))
//{
//this.testingResultDetailComm1.Detail = detail;
//this.testingResultDetailComm21.Detail = detail;
//}
//else
//{
//this.testingResultDetailComm1.Detail = detail;
//this.testingResultDetailComm21.Detail = detail;
////this.testingResultDetail1681.Detail = detail;
////this.testingResultDetail16821.Detail = detail;
//this.testingResultDetail16831.Detail = detail;
//}
NativeMethodNew na = new NativeMethodNew(this.ob);
List Listdes11 = new List();
List Listdes21 = new List();
List Listdes12 = new List();
List Listdes22 = new List();
List Listdes13 = new List();
List Listdes23 = new List();
DataTable dtdes = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.GetResultDetaildes", new object[] { str, plincode, ColGroup, ColShift, proPlanId, gxPlanNo }, this.ob);
if (dtdes.Rows.Count > 0)
{
foreach (DataRow dr in dtdes.Rows)
{
if (dr["REASON_FLAG"].ToString().Equals("可疑"))
{
if (dr["COL_NO"].ToString().Equals("1"))
{
MilTestingResultDetailDesEntity des = new MilTestingResultDetailDesEntity();
des = NativeMethod.GetTableRowToEntity(dr, dtdes, des);
Listdes11.Add(des);
}
if (dr["COL_NO"].ToString().Equals("2"))
{
MilTestingResultDetailDesEntity des = new MilTestingResultDetailDesEntity();
des = NativeMethod.GetTableRowToEntity(dr, dtdes, des);
Listdes12.Add(des);
}
if (dr["COL_NO"].ToString().Equals("3"))
{
MilTestingResultDetailDesEntity des = new MilTestingResultDetailDesEntity();
des = NativeMethod.GetTableRowToEntity(dr, dtdes, des);
Listdes13.Add(des);
}
}
if (dr["REASON_FLAG"].ToString().Equals("剔除"))
{
if (dr["COL_NO"].ToString().Equals("1"))
{
MilTestingResultDetailDesEntity des = new MilTestingResultDetailDesEntity();
des = NativeMethod.GetTableRowToEntity(dr, dtdes, des);
Listdes21.Add(des);
}
if (dr["COL_NO"].ToString().Equals("2"))
{
MilTestingResultDetailDesEntity des = new MilTestingResultDetailDesEntity();
des = NativeMethod.GetTableRowToEntity(dr, dtdes, des);
Listdes22.Add(des);
}
if (dr["COL_NO"].ToString().Equals("3"))
{
MilTestingResultDetailDesEntity des = new MilTestingResultDetailDesEntity();
des = NativeMethod.GetTableRowToEntity(dr, dtdes, des);
Listdes23.Add(des);
}
}
}
}
if (!PlineCode.Equals("C010"))
{
//this.testingResultDetailComm1.Listdes1 = Listdes11;
//this.testingResultDetailComm1.Listdes2 = Listdes21;
//this.testingResultDetailComm21.Listdes1 = Listdes12;
//this.testingResultDetailComm21.Listdes2 = Listdes22;
}
else
{
//this.testingResultDetail1681.Listdes1 = Listdes11;
//this.testingResultDetail1681.Listdes2 = Listdes21;
//this.testingResultDetail16821.Listdes1 = Listdes12;
//this.testingResultDetail16821.Listdes2 = Listdes22;
//this.testingResultDetail16831.Listdes1 = Listdes13;
//this.testingResultDetail16831.Listdes1 = Listdes23;
}
}
///
/// 查询按钮
///
public void PlanQuery()
{
string PrimaKey = "";
string SencodKey = "";
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 = "";
}
dtTestRack1.Clear();
QueryMainPlan.PlineCode = PlineCode;
dtPlan.Clear();
QueryMainPlan.PlineCode = PlineCode;
QueryMainPlan.Status = PlanStatusQuery;
QueryMainPlan.StartStatus = PlanStartStatusQuery;
QueryMainPlan.ProPlanId = proPlanId;
QueryMainPlan.GxPlanNo = gxPlanNo;
DataTable dt = new DataTable();
if (PlineCode.Equals("C009") || PlineCode.Equals("C008") || PlineCode.Equals("C017") || PlineCode.Equals("C072"))
{
dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getSingleMainPlan", new object[] { QueryMainPlan, 11 }, this.ob);
}
else if (PlineCode.Equals("C010"))
{
dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getSingleMainPlan", new object[] { QueryMainPlan, 9 }, this.ob);
}
else
{
dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getSingleMainPlan", new object[] { QueryMainPlan, 12 }, this.ob);
}
//if (TestMethod.Contains("涡流"))
//{
// dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getSingleMainPlan", new object[] { QueryMainPlan, 9 }, this.ob);
//}
//if (TestMethod.Contains("漏磁"))
//{
// dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getSingleMainPlan", new object[] { QueryMainPlan, 11 }, this.ob);
//}
//if (TestMethod.Contains("超声波"))
//{
// dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getSingleMainPlan", new object[] { QueryMainPlan, 12 }, this.ob);
//}
//查询主表记录
if (dt.Rows.Count == 0)
{
MessageBox.Show("未查询到匹配的数据,请重新查询!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
else
{
GridHelper.CopyDataToDatatable(ref dt, ref dtPlan, true);
//ultraGridPlan.DisplayLayout.Bands[0].PerformAutoResizeColumns(true, PerformAutoSizeType.AllRowsInBand);
ChangeGridColor();
ChangeCellName();
if (ugr != null)
{
foreach (UltraGridRow ugr1 in ultraGridPlan.Rows)
{
if (ugr1.Cells["JUDGE_STOVE_NO"].Value.ToString() == PrimaKey)
{
ugr1.Activated = true;
}
}
}
}
}
///
/// 单击计划行
///
///
///
private void ultraGridPlan_AfterRowActivate(object sender, EventArgs e)
{
//if(this.crackDetectionResult1.UltraGrid3.ce)
//if (PlineCode.Equals("C010"))
//{
// crackDetectionResult1.initGrade();
// crackDetectionResult1.initGrade1();
//}
//else
//{
// mtTestingResult1.initGrade();
// mtTestingResult1.initGrade1();
//}
if (this.dtPlan.Rows.Count > 0)
{
//this.ultraExpandableGroupBox2.Expanded = true;
UltraGridRow ugr = ultraGridPlan.ActiveRow;
//UltraGridRow ugr = e.Row;
if (ugr != null)
{
// this.feedSaw1.DataClear();
//查询主计划信息
string HeatNo = ugr.Cells["JUDGE_STOVE_NO"].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();
ActiveJUDGE_STOVE_NO = HeatNo;
MainPlan.JudgeStoveNo = HeatNo;
MainPlan.ProPlanId = proPlanId;
MainPlan.GxPlanNo = gxPlanNo;
DataTable dtMP = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getSingleMainPlanForHeatNo", new object[] { MainPlan }, this.ob);
string Status = ugr.Cells["IS_START"].Value.ToString();
ActiveStatus = Status;
if (dtMP.Rows.Count > 0)
{
ActiveOFFLINE_FLAG = dtMP.Rows[0]["OFFLINE_FLAG"].ToString();
this.stoveno = dtMP.Rows[0]["STOVE_NO"].ToString();
this.lotno = dtMP.Rows[0]["LOT_NO"].ToString();
this.ActiveResultNo = dtMP.Rows[0]["ID"].ToString();
GridEdit(dtMP); //轧制计划信息卡赋值
string JudgeStoveNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
//探伤实绩卡赋值
GetMILETResult(HeatNo);
specName = dtMP.Rows[0]["PIPE_SIZE"].ToString();
length = dtMP.Rows[0]["TARGET_LENGTH"].ToString();
}
if (Status != "未开始探伤")
{
//查询探伤跟踪
GetMILTestingRack(HeatNo);
if (Status == "已完成探伤")
{
mtTestingResult1.Using5();
crackDetectionResult1.Using7();
}
else
{
mtTestingResult1.Using6();
crackDetectionResult1.Using8();
if (PlineCode.Equals("C009") || PlineCode.Equals("C008") || PlineCode.Equals("C017") || PlineCode.Equals("C072"))
{
if (mtTestingResult1.UltraGrid3.ActiveRow != null)
{
if (mtTestingResult1.UltraGrid3.ActiveRow.Cells["colNo"].Value.ToString2() == "1")
{
mtTestingResult1.Using1();
mtTestingResult1.Using4();
}
else if (mtTestingResult1.UltraGrid3.ActiveRow.Cells["colNo"].Value.ToString2() == "2")
{
mtTestingResult1.Using2();
mtTestingResult1.Using3();
}
else
{
mtTestingResult1.Using1();
mtTestingResult1.Using2();
}
}
}
else if (PlineCode.Equals("C010"))
{
if (this.crackDetectionResult1.UltraGrid3.ActiveRow != null)
{
if (this.crackDetectionResult1.UltraGrid3.ActiveRow.Cells["colNo"].Value.ToString2() == "1")
{
crackDetectionResult1.Using1();
crackDetectionResult1.Using4();
}
else if (this.crackDetectionResult1.UltraGrid3.ActiveRow.Cells["colNo"].Value.ToString2() == "2")
{
crackDetectionResult1.Using2();
crackDetectionResult1.Using5();
}
else if (this.crackDetectionResult1.UltraGrid3.ActiveRow.Cells["colNo"].Value.ToString2() == "3")
{
crackDetectionResult1.Using3();
crackDetectionResult1.Using6();
}
else
{
crackDetectionResult1.Using1();
crackDetectionResult1.Using2();
crackDetectionResult1.Using3();
}
}
}
}
}
else
{
this.dtTestRack1.Rows.Clear();
this.dtTestRack2.Rows.Clear();
this.dtTestRack3.Rows.Clear();
mtTestingResult1.Using5();
crackDetectionResult1.Using7();
}
// GetFeedRack();
// GetGridButtonName();
ChangeGridColor();
GetRollingCard();
}
}
crackDetectionResult1.UltraGrid3.UpdateData();
}
///
/// 双击上料事件
///
///
///
//private void ultraGridPlan_DoubleClickRow(object sender, DoubleClickRowEventArgs e)
private void DoStart()
{
//if (this.PlineCode.Equals("C009"))
//{
// if (this.TestMethod.Contains("2"))
// {
// MessageBox.Show("您的操作台不允许进行探伤开始操作。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
// return;
// }
//}
if (ultraGridPlan.Rows.Count > 0)
{
// IsStart();//判断是否还有其他炉次正在探伤
UltraGridRow ugr = ultraGridPlan.ActiveRow;
string JudgeStoveNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
InsertMainPlan.JudgeStoveNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
InsertMainPlan.ProPlanId = proPlanId;
InsertMainPlan.GxPlanNo = gxPlanNo;
string ResultNo = ugr.Cells["ID"].Value.ToString();
ActiveJUDGE_STOVE_NO = InsertMainPlan.JudgeStoveNo;
string Status = doQueryJugeNoStaus(ResultNo, JudgeStoveNo, PlineCode);
//string ResultNo = ugr.Cells["ID"].Value.ToString();
ActiveStatus = Status;
DataTable dtMP = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getSingleMainPlanForHeatNo", new object[] { InsertMainPlan }, this.ob);
ActiveOFFLINE_FLAG = dtMP.Rows[0]["OFFLINE_FLAG"].ToString();
GridEdit(dtMP); //轧制计划信息卡赋值
this.stoveno = dtMP.Rows[0]["STOVE_NO"].ToString();
this.lotno = dtMP.Rows[0]["LOT_NO"].ToString();
this.ActiveResultNo = dtMP.Rows[0]["ID"].ToString();
string ROLL_STANDRAD = dtMP.Rows[0]["ROLL_STANDRAD"].ToString();
if (Status == "0")
{
MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(InsertMainPlan.JudgeStoveNo.ToString()) + "】已开始探伤,不能再次开始探伤!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
if (Status == "1")
{
MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(InsertMainPlan.JudgeStoveNo.ToString()) + "】已完成探伤操作,不能再次开始探伤!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
//if (MessageUtil.ShowYesNoAndQuestion("确认炉号【" + InsertMainPlan.JudgeStoveNo + "】开始探伤?") == DialogResult.No)
//{
// return;
//}
//if (TestMethod.Contains("涡流"))
//{
if (PlineCode.Equals("C010"))
{
offlinenode = "11";
ultraTabControl1.Tabs[0].Visible = true;
ultraTabControl1.Tabs[1].Visible = false;
ultraTabControl1.Tabs[2].Visible = false;
if (tempmilet != null)
{
InsertMilet.ProductStandards = ROLL_STANDRAD;
InsertMilet.InspectionStandard = tempmilet.InspectionStandard;
//InsertMilet.TestingMethod = tempmilet.TestingMethod;
InsertMilet.CalibrationMethod = tempmilet.CalibrationMethod;
InsertMilet.ArtificialDefectShape = tempmilet.ArtificialDefectShape;
InsertMilet.Signid = tempmilet.Signid;
InsertMilet.Userid = tempmilet.Userid;
InsertMilet.ExcitationFrequency1 = tempmilet.ExcitationFrequency1;
InsertMilet.ExcitationFrequency2 = tempmilet.ExcitationFrequency2;
InsertMilet.ExcitationFrequency3 = tempmilet.ExcitationFrequency3;
InsertMilet.TestingSpeed1 = tempmilet.TestingSpeed1;
InsertMilet.TestingSpeed2 = tempmilet.TestingSpeed2;
InsertMilet.TestingSpeed3 = tempmilet.TestingSpeed3;
InsertMilet.AcceptanceGrade = tempmilet.AcceptanceGrade;
}
InsertMilet.ResultNo = ResultNo;
InsertMilet.JudgeStoveNo = dtMP.Rows[0]["JUDGE_STOVE_NO"].ToString();//判定炉号
InsertMilet.PlineCode = dtMP.Rows[0]["PLINE_CODE"].ToString();//厂线代码
InsertMilet.StoveNo = dtMP.Rows[0]["STOVE_NO"].ToString();//熔炼炉号
InsertMilet.LotNo = dtMP.Rows[0]["LOT_NO"].ToString();//生产批号
InsertMilet.Status = "85";
InsertMilet.StartTime = DateTime.Now.ToString();
InsertMilet.ColGroup = UserInfo.GetUserGroup();
InsertMilet.ColShift = UserInfo.GetUserOrder();
InsertMilet.ColUser = UserInfo.GetUserName();
InsertMilet.ColMode = "0";
InsertMilet.ProPlanId = proPlanId;
InsertMilet.GxPlanNo = gxPlanNo;
//添加实绩
int result = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.AddETResult", new object[] { InsertMilet }, this.ob);
}
//if (TestMethod.Contains("漏磁"))
//{
if (PlineCode.Equals("C009") || PlineCode.Equals("C008") || PlineCode.Equals("C017") || PlineCode.Equals("C072"))
{
offlinenode = "12";
milmt.Clear();
ultraTabControl1.Tabs[0].Visible = false;
ultraTabControl1.Tabs[1].Visible = true;
ultraTabControl1.Tabs[2].Visible = false;
if (tempmilmt != null)
{
//产品标准
milmt.ProductStandards = ROLL_STANDRAD;
//纵向外表面
milmt.LoSurface = tempmilmt.LoSurface;
//纵向内表面
milmt.LiSurface = tempmilmt.LiSurface;
//横向外表面
milmt.ToSurface = tempmilmt.ToSurface;
//横向内表面
milmt.TiSurface = tempmilmt.TiSurface;
//人工槽形状
milmt.GrooveShape = tempmilmt.GrooveShape;
//探伤标准
milmt.InspectionStandard = tempmilmt.InspectionStandard;
//1#纵向电流
milmt.LongitudinalCurrent1 = tempmilmt.LongitudinalCurrent1;
//1#横向电流
milmt.TransverseCurrent1 = tempmilmt.TransverseCurrent1;
//2#纵向电流
milmt.LongitudinalCurrent2 = tempmilmt.LongitudinalCurrent2;
//2#横向电流
milmt.TransverseCurrent2 = tempmilmt.TransverseCurrent2;
//1#转速
milmt.Speed1 = tempmilmt.Speed1;
//2#转速
milmt.Speed2 = tempmilmt.Speed2;
//1#检测速度
milmt.DetectionSpeed1 = tempmilmt.DetectionSpeed1;
//2#检测速度
milmt.DetectionSpeed2 = tempmilmt.DetectionSpeed2;
//签发人ID
milmt.Signid = tempmilmt.Signid;
//监制人
milmt.ExecutiveProducer = tempmilmt.ExecutiveProducer;
}
if (this.PlineCode.Equals("C009") || this.PlineCode.Equals("C008") || this.PlineCode.Equals("C017") || PlineCode.Equals("C072"))
{
milmt.GrooveShape = "N型槽";
;
}
milmt.ResultNo = ResultNo;
milmt.JudgeStoveNo = dtMP.Rows[0]["JUDGE_STOVE_NO"].ToString();//判定炉号
milmt.PlineCode = dtMP.Rows[0]["PLINE_CODE"].ToString();//厂线代码
milmt.StoveNo = dtMP.Rows[0]["STOVE_NO"].ToString();//熔炼炉号
milmt.LotNo = dtMP.Rows[0]["LOT_NO"].ToString();//生产批号
milmt.Status = "85";
milmt.StartTime = DateTime.Now.ToString();
milmt.ColGroup = UserInfo.GetUserGroup();
milmt.ColShift = UserInfo.GetUserOrder();
milmt.ColUser = UserInfo.GetUserName();
milmt.ColMode = "0";
milmt.ProPlanId = proPlanId;
milmt.GxPlanNo = gxPlanNo;
//添加实绩
int count1 = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.AddMTResult", new object[] { milmt }, this.ob);
}
//if (TestMethod.Contains("超声波"))//UT
//{
if (PlineCode.Equals("C012"))
{
offlinenode = "13";
milul.Clear();
ultraTabControl1.Tabs[0].Visible = false;
ultraTabControl1.Tabs[1].Visible = false;
ultraTabControl1.Tabs[2].Visible = true;
if (tempmilut != null)
{
//签发人ID
milul.Signid = tempmilut.Signid;
//监制人
milul.ExecutiveProducer = tempmilut.ExecutiveProducer;
//产品标准
milul.ProductStandards = ROLL_STANDRAD;
//仪器型号
milul.InstrumentType = tempmilut.InstrumentType;
// 探头类型
milul.ProbeType = tempmilut.ProbeType;
//灵敏度
milul.Senstivity = tempmilut.Senstivity;
// 抑制
milul.Inhibition = tempmilut.Inhibition;
//耦合剂
milul.CouplingAgent = tempmilut.CouplingAgent;
//表面状况
milul.SurfaceAppearance = tempmilut.SurfaceAppearance;
//纵向外表面
milul.LoSurface = tempmilut.LoSurface;
//纵向内表面
milul.LiSurface = tempmilut.LiSurface;
//横向外表面
milul.ToSurface = tempmilut.ToSurface;
//横向内表面
milul.TiSurface = tempmilut.TiSurface;
}
milul.ResultNo = ResultNo;
milul.JudgeStoveNo = dtMP.Rows[0]["JUDGE_STOVE_NO"].ToString();//判定炉号
milul.ResultNo = ResultNo;
milul.PlineCode = dtMP.Rows[0]["PLINE_CODE"].ToString();//厂线代码
milul.StoveNo = dtMP.Rows[0]["STOVE_NO"].ToString();//熔炼炉号
milul.LotNo = dtMP.Rows[0]["LOT_NO"].ToString();//生产批号
milul.Status = "85";
milul.StartTime = DateTime.Now.ToString();
milul.ColGroup = UserInfo.GetUserGroup();
milul.ColShift = UserInfo.GetUserOrder();
milul.ColUser = UserInfo.GetUserName();
milul.ColMode = "0";
milul.ProPlanId = proPlanId;
milul.GxPlanNo = gxPlanNo;
//添加实绩
int count2 = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.AddUTResult", new object[] { milul }, this.ob);
}
//往跟踪记录表插入探伤开始时间
NativeMethodNew na = new NativeMethodNew(this.ob);
na.InsertSTAferDoubleClick(JudgeStoveNo, 8, "0", proPlanId, gxPlanNo);
// 初始化管号队列(取消分台)
int countss = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.RemoveRackColno", new object[] { dtMP.Rows[0]["JUDGE_STOVE_NO"].ToString(), ResultNo, proPlanId, gxPlanNo }, this.ob);
//刷新主表
DataTable dt = new DataTable();
//if (TestMethod.Contains("涡流"))
if (PlineCode.Equals("C010"))
{
dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getSingleMainPlan", new object[] { QueryMainPlan, 9 }, this.ob);
}
//if (TestMethod.Contains("漏磁"))
if (PlineCode.Equals("C009") || PlineCode.Equals("C008") || PlineCode.Equals("C017") || PlineCode.Equals("C072"))
{
dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getSingleMainPlan", new object[] { QueryMainPlan, 11 }, this.ob);
}
//if (TestMethod.Contains("超声波"))
if (PlineCode.Equals("C012"))
{
dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getSingleMainPlan", new object[] { QueryMainPlan, 12 }, this.ob);
}
GridHelper.CopyDataToDatatable(ref dt, ref dtPlan, true);
//ultraGridPlan.DisplayLayout.Bands[0].PerformAutoResizeColumns(true, PerformAutoSizeType.AllRowsInBand);
ChangeCellName();
PlanQuery();
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() == JudgeStoveNo)
{
ultraGridPlan.ActiveRow = ugr1;
}
}
}
}
///
/// 开始回退
///
private void StartBack()
{
if (ultraGridPlan.Rows.Count > 0)
{
if (alarmFlag == true)
{
MessageUtil.ShowTips("登记了缺陷项,请先保存实绩!");
return;
}
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 = doQueryJugeNoStaus(ResultNo, JudgeStoveNo, PlineCode);
if (StartStatus == "1")
{
MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】已结炉,不能开始回退!!!!");
return;
}
if (StartStatus == "3")
{
MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】未开始探伤,不能开始回退!!!!");
return;
}
string plincode = this.PlineCode;
string ColGroup = this.UserInfo.GetUserGroup();
string ColUser = this.UserInfo.GetUserName();
string ColShift = this.UserInfo.GetUserOrder();
DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.startbackcheck", new object[] { JudgeStoveNo, plincode, ColGroup, ColShift, proPlanId, gxPlanNo }, this.ob);
if (dt.Rows.Count > 0)
{
if (MessageUtil.ShowYesNoAndQuestion("已有班次操作过该炉,是否继续回退?") == DialogResult.No)
{
return;
}
}
DataTable ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.doQueryOffine", new object[] { JudgeStoveNo, plincode, proPlanId, gxPlanNo }, ob);
if (ds.Rows.Count > 0)
{
MessageUtil.ShowTips("存在下线支数,请先下线回退再开始回退!");
return;
}
int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.TeststartBack", new object[] { JudgeStoveNo, ResultNo, plincode, ColGroup, ColShift, proPlanId, gxPlanNo }, this.ob);
GetMILTestingRack(JudgeStoveNo);
ChangeGridColor();
ChangeCellName();
PlanQuery();
}
}
///
/// 保存跟踪记录表备注
///
private void ultraGridMatSeq_AfterCellUpdate(object sender, CellEventArgs e)
{
UltraGridRow ugr = null;
string heatno = "";
int seq = 0;
string remark = "";
if (Colno.Equals("1"))
{
ugr = this.ultraTestRack1.ActiveRow;
}
if (Colno.Equals("2"))
{
//ugr = this.ultraTestRack2.ActiveRow;
}
if (Colno.Equals("3"))
{
//ugr = this.ultraTestRack3.ActiveRow;
}
//if (e.Cell.Column.Key == "REMARK")
//{
// if (ugr == null)
// {
// //MessageBox.Show("您未选择任何管号队列数据,请重新选择后再进行保存操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
// return;
// }
// heatno = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
// seq = Convert.ToInt16(ugr.Cells["SEQ"].Value.ToString());
// if (!string.IsNullOrEmpty(ugr.Cells["REMARK"].Value.ToString()))
// {
// remark = ugr.Cells["REMARK"].Value.ToString();
// }
// else
// {
// remark = "";
// }
// NativeMethodNew na = new NativeMethodNew(this.ob);
// na.SaveRackRemark(2, seq, heatno, remark);
//}
}
///
/// 保存探伤实绩
///
public void ETResultSave()//saveflag=1 只保存参数,
{
string hratno = "";
int count = 0;
string testOfflineNum = "";//已探下线支数
milet.Clear();
milmt.Clear();
milul.Clear();
UltraGridRow ugr_roll = this.rollingCard1.UltraGrid4.Rows[0];
UltraGridRow ugr_ET = this.crackDetectionResult1.UltraGrid3.Rows[0];
UltraGridRow ugr_MT = this.mtTestingResult1.UltraGrid3.Rows[0];
UltraGridRow ugr_UT = this.ulTestingResult1.UltraGrid3.Rows[0];
string saveflage = "0";
alarmFlag = false;
if (this.ultraGridPlan.ActiveRow == null && ActiveJUDGE_STOVE_NO == null)
{
MessageBox.Show("未选择任何炉号,请选择炉号后进行保存操作。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
if (this.ultraGridPlan.ActiveRow == null)
{
hratno = ActiveJUDGE_STOVE_NO;
}
else
{
hratno = this.ultraGridPlan.ActiveRow.Cells["JUDGE_STOVE_NO"].Value.ToString();
}
if (ActiveStatus == "未开始探伤")
{
MessageBox.Show("炉号:【" + BaseMethod.getJudgeStoveNo(hratno) + "】未开始进行探伤,不允许进行保存操作!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
if (ActiveStatus == "已完成探伤")
{
saveflage = "1";
//MessageBox.Show("炉号:【" + hratno + "】已完成探伤操作,不允许进行保存操作!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
//return;
}
//if (ActiveStatus == "已完成探伤")
//{
// MessageBox.Show("炉号:【" + hratno + "】已完成探伤操作,不允许进行保存操作!", "提示:", MessageBoxButtons.OK,MessageBoxIcon.Warning);
// return;
//}
//if (MessageUtil.ShowYesNoAndQuestion("确认炉号【" + hratno + "】保存实绩?") == DialogResult.No)
//{
// return;
//}
DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.GetMIL_STRAIGHTENING_RESULT", new object[] { hratno, proPlanId, gxPlanNo }, this.ob);
//if (TestMethod.Contains("涡流"))
if (PlineCode.Equals("C010"))
{
this.crackDetectionResult1.UltraGrid3.UpdateData();
string[] arr = specName.Split('*');
milet = NativeMethod.GetUltraGridToEntityNEW(this.crackDetectionResult1.UltraGrid3, milet);
milet.JudgeStoveNo = hratno;
milet.ProPlanId = proPlanId;
milet.GxPlanNo = gxPlanNo;
if (this.ultraGridPlan.ActiveRow != null)
{
milet.LotNo = this.ultraGridPlan.ActiveRow.Cells["LOT_NO"].Text.Trim();
milet.ResultNo = this.ultraGridPlan.ActiveRow.Cells["ID"].Text.Trim();
}
Colno = this.crackDetectionResult1.TestingDataSource1.Rows[0]["colNo"].ToString();
milet.ColNo = Colno;
milet.ColShift = this.UserInfo.GetUserOrder();
milet.ColGroup = this.UserInfo.GetUserGroup();
milet.PlineCode = PlineCode;
milet.ColUser = _UserName;
DataTable df = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.doQueryTestedNum", new object[] { milmt.ResultNo, this.UserInfo.GetUserOrder(), this.UserInfo.GetUserGroup(), Colno }, ob);//查询改台下线支数
if (df.Rows.Count > 0)
{
testOfflineNum = df.Rows[0]["REASON_NUMBER"].ToString();
}
#region 监督者管控
if (milet.UseridGrade1.ToString().Trim().Length == 0)
{
if (!(milet.UseridGrade2.ToString().Trim().Length == 0 || milet.Userid2.ToString().Trim().Length == 0))
{
MessageUtil.ShowTips("操作者1信息为空,监督者1不能有相关信息");
return;
}
}
if (milet.UseridGrade1.ToString().Trim().Length > 0)
{
if (milet.UseridGrade1.ToString().Contains("1"))
{
if (milet.UseridGrade2.ToString().Trim().Length == 0 || milet.Userid2.ToString().Trim().Length == 0)
{
MessageUtil.ShowTips("操作者1操作等级为1,需要填写监督者1相关信息!");
return;
}
else
{
if (milet.UseridGrade2.ToString().Trim().Contains("1"))
{
MessageUtil.ShowTips("操作者1操作等级为1,监督者1不能为等级1!");
return;
}
}
}
else
{
if (milet.UseridGrade2.ToString().Trim().Length > 0 || milet.Userid2.ToString().Trim().Length > 0)
{
MessageUtil.ShowTips("操作者1操作等级不为等级1,监督者1信息为空!");
return;
}
}
}
#endregion
if (Colno.Equals("1"))
{
milet.SuspectProductNum = this.crackDetectionResult1.TestingDataSource1.Rows[0]["suspectProductNum1"].ToString();
milet.QaTon = Math.Round((0.02466 * double.Parse(arr[1].ToString()) * (double.Parse(arr[0].ToString()) - double.Parse(arr[1].ToString())) * double.Parse(length) * double.Parse(milet.QualifiedNum1.ToString()) / 1000), 3).ToString();
if (int.Parse(milet.SuspectProductNum.ToString3()) > int.Parse(milet.DetectionNum1.ToString3()))
{
MessageUtil.ShowTips("报警支数不能大于检测支数!");
return;
}
if (int.Parse(milet.ReinspectionNum1.ToString3()) > int.Parse(milet.SuspectProductNum.ToString3()))
{
MessageUtil.ShowTips("复探支数是在报警之下,复探支数不能大于报警支数");
return;
}
if (int.Parse(milet.ReinspectionQualifiedNum1.ToString3()) > int.Parse(milet.ReinspectionNum1.ToString3()))
{
MessageUtil.ShowTips("复探合格支数不能大于复探支数!");
return;
}
if (int.Parse(testOfflineNum.ToString3()) + int.Parse(milet.ScrapNum1.ToString3()) > int.Parse(milet.SuspectProductNum.ToString3()))
{
MessageUtil.ShowTips("已探下线支数加废品支数不能大于报警支数");
return;
}
}
if (Colno.Equals("2"))
{
milet.SuspectProductNum = this.crackDetectionResult1.TestingDataSource1.Rows[0]["suspectProductNum2"].ToString();
milet.QaTon = Math.Round((0.02466 * double.Parse(arr[1].ToString()) * (double.Parse(arr[0].ToString()) - double.Parse(arr[1].ToString())) * double.Parse(length) * double.Parse(milet.QualifiedNum2.ToString()) / 1000), 3).ToString();
if (int.Parse(milet.SuspectProductNum.ToString3()) > int.Parse(milet.DetectionNum2.ToString3()))
{
MessageUtil.ShowTips("报警支数不能大于检测支数!");
return;
}
if (int.Parse(milet.ReinspectionNum2.ToString3()) > int.Parse(milet.SuspectProductNum.ToString3()))
{
MessageUtil.ShowTips("复探支数是在报警之下,复探支数不能大于报警支数");
return;
}
if (int.Parse(milet.ReinspectionQualifiedNum2.ToString3()) > int.Parse(milet.ReinspectionNum2.ToString3()))
{
MessageUtil.ShowTips("复探合格支数不能大于复探支数!");
return;
}
if (int.Parse(testOfflineNum.ToString3()) + int.Parse(milet.ScrapNum2.ToString3()) > int.Parse(milet.SuspectProductNum.ToString3()))
{
MessageUtil.ShowTips("已探下线支数加废品支数不能大于报警支数");
return;
}
}
if (Colno.Equals("3"))
{
milet.SuspectProductNum = this.crackDetectionResult1.TestingDataSource1.Rows[0]["suspectProductNum3"].ToString();
milet.QaTon = Math.Round((0.02466 * double.Parse(arr[1].ToString()) * (double.Parse(arr[0].ToString()) - double.Parse(arr[1].ToString())) * double.Parse(length) * double.Parse(milet.QualifiedNum3.ToString()) / 1000), 3).ToString();
if (int.Parse(milet.SuspectProductNum.ToString3()) > int.Parse(milet.DetectionNum3.ToString3()))
{
MessageUtil.ShowTips("报警支数不能大于检测支数!");
return;
}
if (int.Parse(milet.ReinspectionNum3.ToString3()) > int.Parse(milet.SuspectProductNum.ToString3()))
{
MessageUtil.ShowTips("复探支数是在报警之下,复探支数不能大于报警支数");
return;
}
if (int.Parse(milet.ReinspectionQualifiedNum3.ToString3()) > int.Parse(milet.ReinspectionNum3.ToString3()))
{
MessageUtil.ShowTips("复探合格支数不能大于复探支数!");
return;
}
if (int.Parse(testOfflineNum.ToString3()) + int.Parse(milet.ScrapNum3.ToString3()) > int.Parse(milet.SuspectProductNum.ToString3()))
{
MessageUtil.ShowTips("已探下线支数加废品支数不能大于报警支数");
return;
}
}
string detiaEtTity = JSONFormat.Format(milet);
////插入ET探伤实绩表
//saveflage = "1";
//count = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.UpdateETResult", new object[] { milet, Colno, saveflage }, this.ob);
CoreClientParam ccp = new CoreClientParam();
ccp.ServerName = "com.steering.mes.zgmil.coup.EddyCurrentTestingResult";
ccp.MethodName = "saveEtResult";
ccp.ServerParams = new object[] { detiaEtTity, Colno };
ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
if (ccp.ReturnCode != -1)
{
if (ccp.ReturnInfo.Equals("保存成功!"))
{
PlanQuery();
MessageUtil.ShowTips(ccp.ReturnInfo);
}
else
{
MessageUtil.ShowTips(ccp.ReturnInfo);
}
}
}
//if (TestMethod.Contains("漏磁"))
if (PlineCode.Equals("C009") || PlineCode.Equals("C008") || PlineCode.Equals("C017") || PlineCode.Equals("C072"))
{
this.mtTestingResult1.UltraGrid3.UpdateData();
//milmt = NativeMethod.GetUltraGridToEntityNEW(this.mtTestingResult1.UltraGrid3, milmt);
//milmt.JudgeStoveNo = hratno;
string[] arr = specName.Split('*');
milmt = NativeMethod.GetUltraGridToEntityNEW(this.mtTestingResult1.UltraGrid3, milmt);
milmt.JudgeStoveNo = hratno;
if (this.ultraGridPlan.ActiveRow != null)
{
milmt.LotNo = this.ultraGridPlan.ActiveRow.Cells["LOT_NO"].Text.Trim();
milmt.ResultNo = this.ultraGridPlan.ActiveRow.Cells["ID"].Text.Trim();
}
Colno = this.mtTestingResult1.UltraDataSource1.Rows[0]["colNo"].ToString();
milmt.ColNo = Colno;
milmt.ColShift = this.UserInfo.GetUserOrder();
milmt.ColGroup = this.UserInfo.GetUserGroup();
milmt.PlineCode = PlineCode;
milmt.ColUser = _UserName;
milmt.ProPlanId = proPlanId;
milmt.GxPlanNo = gxPlanNo;
#region //监督者判定
if (PlineCode.Equals("C009") || PlineCode.Equals("C008") || PlineCode.Equals("C017"))
{
if (milmt.UseridGrade1.ToString().Trim().Length == 0)
{
if (!(milmt.UseridGrade1jd.ToString().Trim().Length == 0 || milmt.Userid1jd.ToString().Trim().Length == 0))
{
MessageUtil.ShowTips("操作者1信息为空,监督者1不能有相关信息");
return;
}
}
if (milmt.UseridGrade1.ToString().Trim().Length > 0)
{
if (milmt.UseridGrade1.ToString().Contains("1"))
{
if (milmt.UseridGrade1jd.ToString().Trim().Length == 0 || milmt.Userid1jd.ToString().Trim().Length == 0)
{
MessageUtil.ShowTips("操作者1操作等级为1,需要填写监督者1相关信息!");
return;
}
else
{
if (milmt.UseridGrade1jd.ToString().Trim().Contains("1"))
{
MessageUtil.ShowTips("操作者1操作等级为1,监督者1不能为等级1!");
return;
}
}
}
else
{
if (milmt.UseridGrade1jd.ToString().Trim().Length > 0 || milmt.Userid1jd.ToString().Trim().Length > 0)
{
MessageUtil.ShowTips("操作者1操作等级不为等级1,监督者1信息为空!");
return;
}
}
}
if (milmt.UseridGrade2.ToString().Trim().Length == 0)
{
if (milmt.UseridGrade2jd.ToString().Trim().Length > 0 || milmt.Userid2jd.ToString().Trim().Length > 0)
{
MessageUtil.ShowTips("操作者2信息为空,监督者2不能有相关信息!");
return;
}
}
if (milmt.UseridGrade2.ToString().Trim().Length > 0)
{
if (milmt.UseridGrade2.ToString().Contains("1"))
{
if (milmt.UseridGrade2jd.ToString().Trim().Length == 0 || milmt.Userid2jd.ToString().Trim().Length == 0)
{
MessageUtil.ShowTips("操作者2操作等级为1,监督者2信息不能为空!");
return;
}
else
{
if (milmt.UseridGrade2jd.ToString().Trim().Contains("1"))
{
MessageUtil.ShowTips("操作者等级为1,监督者不能为1!");
return;
}
}
}
else
{
if (milmt.UseridGrade2jd.ToString().Trim().Length > 0 || milmt.Userid2jd.ToString().Trim().Length > 0)
{
MessageUtil.ShowTips("操作者2操作等级不为等级1,监督者2信息要为空!");
return;
}
}
}
}
#endregion
DataTable df = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.doQueryTestedNum", new object[] { milmt.ResultNo, this.UserInfo.GetUserOrder(), this.UserInfo.GetUserGroup(), Colno }, ob);//查询改台下线支数
if (df.Rows.Count > 0)
{
testOfflineNum = df.Rows[0]["REASON_NUMBER"].ToString();
}
if (Colno == "1")
{
milmt.AlarmNum = this.mtTestingResult1.UltraDataSource1.Rows[0]["suspectProductNum1"].ToString();
milmt.QaTon = Math.Round((0.02466 * double.Parse(arr[1].ToString()) * (double.Parse(arr[0].ToString()) - double.Parse(arr[1].ToString())) * double.Parse(length) * double.Parse(milmt.QualifiedNum1.ToString()) / 1000), 3).ToString();
if (int.Parse(milmt.AlarmNum.ToString3()) > int.Parse(milmt.DetectionNum1.ToString3()))
{
MessageUtil.ShowTips("报警支数不能大于检测支数!");
return;
}
if (int.Parse(milmt.RecutNum1.ToString3()) > int.Parse(milmt.AlarmNum.ToString3()))
{
MessageUtil.ShowTips("子管再切支数是在报警支数之下,子管再切支数不能大于报警支数!");
return;
}
if (int.Parse(milmt.ReinspectionNum1.ToString3()) > int.Parse(milmt.AlarmNum.ToString3()))
{
MessageUtil.ShowTips("复探支数是在报警之下,复探支数不能大于报警支数");
return;
}
if (int.Parse(milmt.ReinspectionQualifiedNum1.ToString3()) > int.Parse(milmt.ReinspectionNum1.ToString3()))
{
MessageUtil.ShowTips("复探合格支数不能大于复探支数!");
return;
}
if (int.Parse(testOfflineNum.ToString3()) + int.Parse(milmt.RecutNum1.ToString3()) + int.Parse(milmt.ScrapNum1.ToString3()) > int.Parse(milmt.AlarmNum.ToString3()))
{
MessageUtil.ShowTips("已探下线支数加废品支数加子管再切支数不能大于报警支数");
return;
}
//if (int.Parse(testOfflineNum.ToString3()) + int.Parse(milmt.ScrapNum1.ToString3()) + int.Parse(milmt.ReinspectionNum1.ToString3()) > int.Parse(milmt.AlarmNum.ToString3()))
//{
// MessageUtil.ShowTips("复探支数加废品支数加已探伤下线支数应与报警支数一致!");
// return;
//}
}
else
{
milmt.AlarmNum = this.mtTestingResult1.UltraDataSource1.Rows[0]["suspectProductNum2"].ToString();
milmt.QaTon = Math.Round((0.02466 * double.Parse(arr[1].ToString()) * (double.Parse(arr[0].ToString()) - double.Parse(arr[1].ToString())) * double.Parse(length) * double.Parse(milmt.QualifiedNum2.ToString()) / 1000), 3).ToString();
if (int.Parse(milmt.AlarmNum.ToString3()) > int.Parse(milmt.DetectionNum2.ToString3()))
{
MessageUtil.ShowTips("报警支数不能大于检测支数!");
return;
}
if (int.Parse(milmt.RecutNum2.ToString3()) > int.Parse(milmt.AlarmNum.ToString3()))
{
MessageUtil.ShowTips("子管再切支数是在报警支数之下,子管再切支数不能大于报警支数!");
return;
}
if (int.Parse(milmt.ReinspectionNum2.ToString3()) > int.Parse(milmt.AlarmNum.ToString3()))
{
MessageUtil.ShowTips("复探支数是在报警支数之下,复探支数不能大于报警支数");
return;
}
if (int.Parse(milmt.ReinspectionQualifiedNum2.ToString3()) > int.Parse(milmt.ReinspectionNum2.ToString3()))
{
MessageUtil.ShowTips("复探合格支数不能大于复探支数!");
return;
}
if (int.Parse(testOfflineNum.ToString3()) + int.Parse(milmt.RecutNum2.ToString3()) + int.Parse(milmt.ScrapNum2.ToString3()) > int.Parse(milmt.AlarmNum.ToString3()))
{
MessageUtil.ShowTips("已探下线支数加废品支数加子管再切支数不能大于报警支数");
return;
}
//if (int.Parse(this.mtTestingResult1.testOfflineNum.ToString3()) + int.Parse(milmt.ScrapNum2.ToString3()) + int.Parse(milmt.ReinspectionNum2.ToString3()) > int.Parse(milmt.AlarmNum.ToString3()))
//{
// MessageUtil.ShowTips("复探支数加废品支数加已探伤下线支数应与报警支数一致!");
// return;
//}
//if (int.Parse(testOfflineNum.ToString3()) + int.Parse(milmt.ScrapNum2.ToString3()) + int.Parse(milmt.ReinspectionNum2.ToString3()) > int.Parse(milmt.AlarmNum.ToString3()))
//{
// MessageUtil.ShowTips("复探支数加废品支数加已探伤下线支数应与报警支数一致!");
// return;
//}
}
string detiaTity = JSONFormat.Format(milmt);
//插入MT探伤实绩表
//saveflage = "1";
// count = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.UpdateMTResult", new object[] { milmtDetai, Colno, saveflage }, this.ob);
CoreClientParam ccp = new CoreClientParam();
ccp.ServerName = "com.steering.mes.zgmil.coup.EddyCurrentTestingResult";
ccp.MethodName = "saveMtResult";
ccp.ServerParams = new object[] { detiaTity, Colno };
ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
if (ccp.ReturnCode != -1)
{
if (ccp.ReturnInfo.Equals("保存成功!"))
{
PlanQuery();
MessageUtil.ShowTips(ccp.ReturnInfo);
}
else
{
MessageUtil.ShowTips(ccp.ReturnInfo);
}
}
}
//if (TestMethod.Contains("超声波"))
if (PlineCode.Equals("C012"))
{
this.ulTestingResult1.UltraGrid3.UpdateData();
milul = NativeMethod.GetUltraGridToEntityNEW(this.ulTestingResult1.UltraGrid3, milul);
milul.JudgeStoveNo = hratno;
if (Colno.Equals("1"))
{
//milul.DetectionNum1 = this.ultraTestRack1.Rows.Count.ToString();
// milul.QualifiedNum1 = (this.ultraTestRack1.Rows.Count - int.Parse(milul.ScrapNum1.ToString())).ToString();
milul.DetectionNum1 = "0";
milul.QualifiedNum1 = "0";
int i = 0;
int j = 0;
foreach (UltraGridRow ugr in ultraTestRack1.Rows)
{
if (ugr.Cells["STATUS"].Value.ToString().Equals("报警"))
{
i = i + 1;
}
if (ugr.Cells["SUSPECT_FLAG"].Value.ToString().Equals("可疑"))
{
j = j + 1;
}
}
milul.ReinspectionQualifiedNum1 = i.ToString();
milul.SuspectProductNum1 = j.ToString();
milul.NodeFurFlag1 = "0";
}
if (Colno.Equals("2"))
{
//milul.DetectionNum2 = this.ultraTestRack2.Rows.Count.ToString();
//milul.QualifiedNum2 = (this.ultraTestRack2.Rows.Count - int.Parse(milul.ScrapNum2.ToString())).ToString();
milul.DetectionNum2 = "0";
milul.QualifiedNum2 = "0";
int i = 0;
int j = 0;
foreach (UltraGridRow ugr in ultraTestRack1.Rows)
{
if (ugr.Cells["STATUS"].Value.ToString().Equals("报警"))
{
i = i + 1;
}
if (ugr.Cells["SUSPECT_FLAG"].Value.ToString().Equals("可疑"))
{
j = j + 1;
}
}
milul.ReinspectionQualifiedNum2 = i.ToString();
milul.SuspectProductNum2 = j.ToString();
milul.NodeFurFlag2 = "0";
milul.ProPlanId = proPlanId;
milul.GxPlanNo = gxPlanNo;
}
//插入ET探伤实绩表
saveflage = "1";
count = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.UpdateUTResult", new object[] { milul, Colno, saveflage }, this.ob);
}
if (count == 1)
{
MessageBox.Show("保存操作完成!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
this.crackDetectionResult1.IsCellSelect = false;
this.mtTestingResult1.IsCellSelect = false;
this.ulTestingResult1.IsCellSelect = false;
}
tempmilet = NativeMethod.GetEntityToEntity(tempmilet, milet);//将当前探伤实绩保存备份
tempmilmt = NativeMethod.GetEntityToEntity(tempmilmt, milmt);
//tempmilut = NativeMethod.GetEntityToEntity(tempmilut, milul);
}
private String doQueryJugeNoStaus(string resultNo, string jugeNo, string plineCode)
{
string staus = "3";
DataTable ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.doQueryResultStaus", new object[] { resultNo, jugeNo, plineCode, "7", proPlanId, gxPlanNo }, ob);
if (ds.Rows.Count > 0)
{
staus = ds.Rows[0]["NODE_FUR_FLAG"].ToString();
}
return staus;
}
///
/// 结炉操作
/// 1、判断上一道工序结炉状态,2、更新实绩表(包括结炉时间,结炉状态),3.更新主表NODE_STATUS
///
public void ETTestingResultNode()//数据验证,保存参数,设置状态
{
ETResultSave();
//if (this.PlineCode.Equals("C009"))
//{
// if (this.TestMethod.Contains("2"))
// {
// MessageBox.Show("您的操作台不允许进行探伤结炉操作。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
// return;
// }
//}
string Status = "";
if (this.ultraGridPlan.ActiveRow == null)
{
MessageBox.Show("未选择任何炉号,不允许结炉。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
UltraGridRow ugr_plan = this.ultraGridPlan.ActiveRow;
UltraGridRow ugr_roll = this.rollingCard1.UltraGrid4.Rows[0];
UltraGridRow ugr_ET = this.crackDetectionResult1.UltraGrid3.Rows[0];
UltraGridRow ugr_MT = this.mtTestingResult1.UltraGrid3.Rows[0];
UltraGridRow ugr_UT = this.ulTestingResult1.UltraGrid3.Rows[0];
if (ugr_plan != null)
{
string JudgeStoveNo = ugr_plan.Cells["JUDGE_STOVE_NO"].Value.ToString();
string resultNo = ugr_plan.Cells["ID"].Value.ToString();
//Status = ugr_plan.Cells["IS_START"].Value.ToString();
Status = doQueryJugeNoStaus(resultNo, JudgeStoveNo, PlineCode);
int count = 0;
if (Status != "0")
{
MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】未开始探伤或已完成探伤,不允许结炉!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
//if (Status == "已完成探伤")
//{
// MessageBox.Show("炉号【" + JudgeStoveNo + "】已完成探伤操作,不允许结炉!", "提示:", MessageBoxButtons.OK,MessageBoxIcon.Warning);
// return;
//}
//查询矫直结炉是否完成
DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.GetMIL_STRAIGHTENING_RESULT", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, this.ob);
if (dt.Rows.Count == 0)
{
MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】还未开始矫直,不能结炉!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
if (string.IsNullOrEmpty(dt.Rows[0]["NODE_FUR_FLAG"].ToString()))
{
MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】还未开始矫直,不能结炉!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
if (dt.Rows[0]["NODE_FUR_FLAG"].ToString() != "1")//
{
MessageBox.Show("炉号【" + JudgeStoveNo + "】还未矫直完成,不能结炉!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
//验证可疑、废品支数
DataTable ds = new DataTable();
DataTable dd = new DataTable();
DataTable dy = new DataTable();
//if (PlineCode.Equals("C009")||PlineCode.Equals("C008")||PlineCode.Equals("C017")||PlineCode.Equals("C010"))
//{
ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.doQueryAlarm", new object[] { JudgeStoveNo, PlineCode, proPlanId, gxPlanNo }, ob);
if (ds.Rows.Count > 0)
{
if (!ds.Rows[0]["ALARM_NUM"].ToString().Equals(ds.Rows[0]["REASON_NUMBER"].ToString()))
{
MessageUtil.ShowTips("报警支数的登记与实绩保存的报警支数不一致,不允许结炉!");
return;
}
}
dy = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.getMtResultNum", new object[] { JudgeStoveNo, PlineCode, proPlanId, gxPlanNo }, ob);
if (!dy.Rows[0]["TOTALCOUNT"].ToString().Equals(dt.Rows[0]["QUALIFIED_NUM"].ToString()))
{
MessageUtil.ShowTips("结炉总支数与矫直合格支数不一致,不允许结炉!");
return;
}
//}
//if (!NodeTotale(JudgeStoveNo))
//{
// return;
//}
if (MessageUtil.ShowYesNoAndQuestion("确认炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】结炉?") == DialogResult.No)
{
return;
}
string[] arr = specName.Split('*');
double DBHeight = 0;
double BurnningRate = 0;
double BurnningRate1 = 0;
double DBNum = 1;
NativeMethodNew na1 = new NativeMethodNew(this.ob);
string JudgeStoveNotemp = BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "-01";
double percent = na1.GetLengthPercent(JudgeStoveNotemp, this.ob, 0);
//if (percent == 100.0)
//{
// MessageBox.Show("炉号:【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】尚未开始分切,不允许结炉", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
// return;
//}
DataTable dtDBH = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getDbHeight", new object[] { JudgeStoveNo, ActiveResultNo, 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());
}
}
Double temp = 0.0;
if (this.PlineCode == "C009" || PlineCode == "C012" || PlineCode == "C017" || this.PlineCode == "C008" || PlineCode == "C072")
{
temp = DBHeight * (1 - (BurnningRate / 100));
}
else
{
temp = DBHeight * (1 - (BurnningRate / 100)) * (1 - (BurnningRate1 / 100));
}
temp = temp * percent / 100;
//if (TestMethod.Contains("涡流"))
DataTable sd = getStoreNo(PlineCode);
if (sd == null)
{
MessageUtil.ShowTips("无轧管在线库基础信息,请维护!");
return;
}
ArrayList list = new ArrayList();
list.Add(sd.Rows[0]["STORAGE_NO"].ToString());
list.Add(sd.Rows[0]["STORAGE_NO"].ToString() + "10101");
list.Add(sd.Rows[0]["STORAGE_TYPE_NO"].ToString());
list.Add(sd.Rows[0]["STORAGE_TYPE_NAME"].ToString());
list.Add(this.UserInfo.GetDeptid());
list.Add(this.UserInfo.GetDepartment());
list.Add(this.UserInfo.GetDeptid());
list.Add(this.UserInfo.GetDepartment());
//list.Add(PipeManageClass.GetDepartIdBySectionId(this.UserInfo.GetDeptid(), this.ob));
//list.Add(PipeManageClass.GetDepartBySectionId(this.UserInfo.GetDeptid(), this.ob));
list.Add(UserInfo.GetUserName());
CoreClientParam ccp = new CoreClientParam();
ccp.ServerName = "com.steering.mes.zgmil.coup.FrmStraighteningResult";
ccp.MethodName = "updateMilSlab";
ccp.ServerParams = new object[] { JudgeStoveNo, "10", proPlanId, gxPlanNo };
ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
if (ccp.ReturnCode != -1)
{
if (ccp.ReturnInfo.Equals("修改成功!"))
{
AutoUpFile();
//更新进程表,废品入库存
ccp.ServerName = "com.steering.mes.zgmil.coup.EddyCurrentTestingResult";
ccp.MethodName = "updateProcessTest";
ccp.ServerParams = new object[] { JudgeStoveNo, "10", "10", list, proPlanId, gxPlanNo, lotNo, PlineCode };
ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
if (ccp.ReturnCode != -1)
{
if (ccp.ReturnInfo.Equals("修改成功!"))
{
dd = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.doQuerySCRAPNUM", new object[] { JudgeStoveNo, PlineCode, proPlanId, gxPlanNo }, ob);
if (dd.Rows.Count > 0)
{
if (!dd.Rows[0]["SCRAP_NUM"].ToString().Equals(dd.Rows[0]["REASON_NUMBER"].ToString()))
{
MessageUtil.ShowTips("废品支数的登记与实绩保存的废品支数不一致,不允许结炉!");
return;
}
if (!dd.Rows[0]["SCRAP_NUM"].ToString().Equals(dd.Rows[0]["ACT_COUNT"].ToString()))
{
MessageUtil.ShowTips("废品支数的登记与实绩保存的废品支数不一致,不允许结炉!");
return;
}
}
if (PlineCode.Equals("C010"))
{
this.crackDetectionResult1.UltraGrid3.UpdateData();
milet = NativeMethod.GetUltraGridToEntityNEW(this.crackDetectionResult1.UltraGrid3, milet);
milet.JudgeStoveNo = JudgeStoveNo;
milet.QaTon = Math.Round(((0.02466 * double.Parse(arr[1].ToString()) * (double.Parse(arr[0].ToString()) - double.Parse(arr[1].ToString())) * double.Parse(length) * int.Parse(milet.QualifiedNum.ToString())) / 1000), 3).ToString();
milet.ColUser = _UserName;
milet.ColGroup = UserInfo.GetUserGroup();
milet.ColShift = UserInfo.GetUserOrder();
milet.Userid = _UserID;
milet.ProPlanId = proPlanId;
milet.GxPlanNo = gxPlanNo;
milet.JudgeStoveNo = JudgeStoveNo;
milet.LotNo = lotNo;
milet.PlineCode = PlineCode;
count = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.UpdateETResultNodeNEW", new object[] { milet, Colno }, this.ob);
}
//if (TestMethod.Contains("漏磁"))
if (PlineCode.Equals("C009") || PlineCode.Equals("C008") || PlineCode.Equals("C017") || PlineCode.Equals("C072"))
{
milmt.Clear();
this.mtTestingResult1.UltraGrid3.UpdateData();
milmt = NativeMethod.GetUltraGridToEntityNEW(this.mtTestingResult1.UltraGrid3, milmt);
milmt.JudgeStoveNo = JudgeStoveNo;
//milmt.QaTon = (temp * int.Parse(milmt.QualifiedNum.ToString())).ToString();
milmt.QaTon = Math.Round(((0.02466 * double.Parse(arr[1].ToString()) * (double.Parse(arr[0].ToString()) - double.Parse(arr[1].ToString())) * double.Parse(length) * int.Parse(milmt.QualifiedNum.ToString())) / 1000), 3).ToString();
milmt.ColUser = _UserName;
milmt.ColGroup = UserInfo.GetUserGroup();
milmt.ColShift = UserInfo.GetUserOrder();
milmt.Userid = _UserID;
milmt.ProPlanId = proPlanId;
milmt.GxPlanNo = gxPlanNo;
milmt.JudgeStoveNo = JudgeStoveNo;
milmt.LotNo = lotNo;
milmt.PlineCode = PlineCode;
count = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.UpdateMTResultNodeNEW", new object[] { milmt, Colno }, this.ob);
}
//if (TestMethod.Contains("超声波"))
if (PlineCode.Equals("C012"))
{
milul.Clear();
this.ulTestingResult1.UltraGrid3.UpdateData();
milul = NativeMethod.GetUltraGridToEntityNEW(this.ulTestingResult1.UltraGrid3, milul);
milul.JudgeStoveNo = JudgeStoveNo;
milul.QaTon = (temp * int.Parse(milul.QualifiedNum.ToString())).ToString();
milul.ColUser = _UserName;
milul.ColGroup = UserInfo.GetUserGroup();
milul.ColShift = UserInfo.GetUserOrder();
milul.ProPlanId = proPlanId;
milul.GxPlanNo = gxPlanNo;
milul.JudgeStoveNo = JudgeStoveNo;
milul.LotNo = lotNo;
milul.PlineCode = PlineCode;
count = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.UpdateUTResultNodeNEW", new object[] { milul, Colno }, this.ob);
}
if (count == 1)
{
//往跟踪记录表插入探伤开始时间
NativeMethodNew na = new NativeMethodNew(this.ob);
na.InsertSTAferDoubleClick(JudgeStoveNo, 8, "1", proPlanId, gxPlanNo);
NativeMethod.CheckNodeMatStatus(JudgeStoveNo, proPlanId, gxPlanNo, 8, this.ob);
//插入MIL_SLAB_SCRAP表
//int count1 = ServerHelper.SetData("com.steering.mes.zgmil.coup.FeedSawResult.scrapNodeMat", new object[] { JudgeStoveNo, 9, 0 }, this.ob);
ccp.ServerName = "com.steering.mes.zgmil.coup.EddyCurrentTestingResult";
ccp.MethodName = "assignmentMatNo";
ccp.ServerParams = new object[] { JudgeStoveNo, "9", PlineCode, proPlanId, gxPlanNo };
ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
if (ccp.ReturnCode != -1)
{
if (ccp.ReturnInfo.Equals("修改成功!"))
{
this.crackDetectionResult1.IsCellSelect = false;
this.mtTestingResult1.IsCellSelect = false;
this.ulTestingResult1.IsCellSelect = false;
string flag = "0";
//if (TestMethod.Contains("涡流"))
if (PlineCode.Equals("C010"))
{
flag = "1";
}
//if (TestMethod.Contains("漏磁"))
if (PlineCode.Equals("C009") || PlineCode.Equals("C008") || PlineCode.Equals("C017") || PlineCode.Equals("C072"))
{
flag = "2";
}
//if (TestMethod.Contains("超声波"))
if (PlineCode.Equals("C012"))
{
flag = "3";
}
//int ss = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.UpdateToTalNode", new object[] { JudgeStoveNo, flag }, this.ob);
//刷新主表
DataTable dt1 = new DataTable();
//if (TestMethod.Contains("涡流"))
if (PlineCode.Equals("C010"))
{
dt1 = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getSingleMainPlan", new object[] { QueryMainPlan, 9 }, this.ob);
}
//if (TestMethod.Contains("漏磁"))
if (PlineCode.Equals("C009") || PlineCode.Equals("C008") || PlineCode.Equals("C017") || PlineCode.Equals("C072"))
{
dt1 = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getSingleMainPlan", new object[] { QueryMainPlan, 11 }, this.ob);
}
//if (TestMethod.Contains("超声波"))
if (PlineCode.Equals("C012"))
{
dt1 = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getSingleMainPlan", new object[] { QueryMainPlan, 12 }, this.ob);
}
GridHelper.CopyDataToDatatable(ref dt1, ref dtPlan, true);
//ultraGridPlan.DisplayLayout.Bands[0].PerformAutoResizeColumns(true, PerformAutoSizeType.AllRowsInBand);
ChangeCellName();
ChangeGridColor();
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() == JudgeStoveNo)
{
ultraGridPlan.ActiveRow = ugr1;
}
}
MessageBox.Show("炉号【" + JudgeStoveNo + "】结炉完成。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
milet.Clear();
milmt.Clear();
milul.Clear();
this.dataSet2.Clear();
}
else
{
MessageUtil.ShowTips(ccp.ReturnInfo);
}
}
else
{
MessageUtil.ShowTips(ccp.ReturnInfo);
}
}
}
else
{
MessageUtil.ShowTips(ccp.ReturnInfo);
}
}
else
{
MessageUtil.ShowTips(ccp.ReturnInfo);
}
}
}
}
}
///
/// 查询仓库信息
///
///
///
private DataTable getStoreNo(string plineCode)
{
DataTable ds = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryStoreNo", new object[] { plineCode }, ob);
if (ds.Rows.Count > 0)
{
return ds;
}
else
{
return null;
}
}
///
/// 结炉回退
///
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 = doQueryJugeNoStaus(ResultNo, JudgeStoveNo, PlineCode);
#region
if (NodeFlag != "1")
{
MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】未结炉,不能结炉回退!!!!");
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 (int.Parse(NodeStatus) >= 96)
{
MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】后序工序已结炉,当前工序不能结炉回退");
return;
}
}
DataTable ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.selectBackLineNum", new object[] { ResultNo, JudgeStoveNo, proPlanId, gxPlanNo }, ob);
if (ds.Rows.Count > 0)
{
MessageUtil.ShowTips("存在返线支数,不能结炉回退!");
return;
}
DataTable dd = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.selectMilOfflineGroup", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, ob);
if (dd.Rows.Count > 0)
{
if (int.Parse(dd.Rows[0][0].ToString()) > 0)
{
MessageUtil.ShowTips("存在已组炉支数,不能结炉回退");
return;
}
}
////判断当前炉次下道工序是否结炉 下道工序结炉 - 不允许回退
//int Seq = 0;
//DataTable dt2 = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.changeFlagQuery", new object[] { JudgeStoveNo, ResultNo, 8 }, this.ob);
//if (dt2.Rows.Count > 0)
//{
// Seq = int.Parse(dt2.Rows[0][0].ToString());
//}
//int count2 = ServerHelper.SetData("com.steering.mes.zgmil.coup.FeedSawResult.nodeBack", new object[] { JudgeStoveNo, ResultNo, 8, PlineCode, Seq, 0 }, this.ob);
#endregion
string Group = UserInfo.GetUserGroup();
string Shift = UserInfo.GetUserOrder();
DataTable dtMat = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmOffLine.doQueryMatScrap", new object[] { JudgeStoveNo, PlineCode, proPlanId, gxPlanNo }, this.ob);
if (dtMat.Rows.Count > 0)
{
if (int.Parse(dtMat.Rows[0][0].ToString()) > 0)
{
MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】的废品已发运,不能结炉回退!!!!");
return;
}
}
//查询结炉班次班组
DataTable dtNodeGroup = new DataTable();
//if (TestMethod.Contains("涡流"))
DataTable dW = ServerHelper.GetData("com.steering.mes.signature.FrmDownlineManage.doQueryEntust", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, ob);
if (dW.Rows.Count > 0)
{
MessageUtil.ShowTips("已进行外委加工,不允许结炉回退!");
return;
}
if (PlineCode.Equals("C010"))
{
dtNodeGroup = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.doNodeBackCheck", new object[] { JudgeStoveNo, ResultNo, 8, proPlanId, gxPlanNo }, this.ob);
}
//if (TestMethod.Contains("漏磁"))
if (PlineCode.Equals("C009") || PlineCode.Equals("C008") || PlineCode.Equals("C017") || PlineCode.Equals("C072"))
{
dtNodeGroup = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.doNodeBackCheck", new object[] { JudgeStoveNo, ResultNo, 9, proPlanId, gxPlanNo }, this.ob);
}
//if (TestMethod.Contains("超声波"))
if (PlineCode.Equals("C012"))
{
dtNodeGroup = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.doNodeBackCheck", new object[] { JudgeStoveNo, ResultNo, 10, 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)
{
string plincode = this.PlineCode;
string resultno = this.ActiveResultNo;
string ColGroup = this.UserInfo.GetUserGroup();
string ColUser = this.UserInfo.GetUserName();
string ColShift = this.UserInfo.GetUserOrder();
CoreClientParam ccp = new CoreClientParam();
ccp.ServerName = "com.steering.mes.zgmil.coup.EddyCurrentTestingResult";
ccp.MethodName = "doDeleteMatData";
ccp.ServerParams = new object[] { JudgeStoveNo, proPlanId, gxPlanNo, plincode };
ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
if (ccp.ReturnCode != -1)
{
if (ccp.ReturnInfo.Equals("删除成功!"))
{
int count1 = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.InsetTestResultdetailBack", new object[] { JudgeStoveNo, plincode, TestMethod, ResultNo, Group, Shift, "0", "0", "0", "10", proPlanId, gxPlanNo, lotNo }, this.ob);
ChangeGridColor();
PlanQuery();
}
else
{
MessageUtil.ShowTips(ccp.ReturnInfo);
}
}
}
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;
}
}
}
///
/// 操作台结炉后自动判断并整炉结炉
///
/// 炉号
public bool NodeTotale(string heatno)
{
//-----数据验证(矫直过来的支数 等于探伤的支数)
DataTable dtcheck = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.NodeCheckNum", new object[] { ActiveJUDGE_STOVE_NO, ActiveResultNo, TestMethod }, this.ob);
UltraGridRow ugr1 = this.rollingCard1.UltraGrid4.Rows[0];
//int straightnum = int.Parse(string.IsNullOrEmpty(ugr1.Cells["QualifiedNum11"].Value.ToString()) ? "0" : ugr1.Cells["QualifiedNum11"].Value.ToString());
DataTable dtStenth = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.selectStraith", new object[] { heatno }, this.ob);
int straightnum = int.Parse(dtStenth.Rows[0]["QUALIFIED_NUM"].ToString3());
int testnum = 0;
int testnum1 = 0;
int testnum2 = 0;
int testnum3 = 0;
testnum = int.Parse(dtcheck.Rows[0]["QUALIFIED_NUM"].ToString3()) + int.Parse(dtcheck.Rows[0]["OFFLINE_NUM"].ToString3()) + int.Parse(dtcheck.Rows[0]["SCRAP_NUM"].ToString3());
testnum1 = int.Parse(dtcheck.Rows[0]["DETECTION_NUM1"].ToString3());
testnum2 = int.Parse(dtcheck.Rows[0]["DETECTION_NUM2"].ToString3());
if (this.PlineCode.Equals("C010"))
{
testnum3 = int.Parse(dtcheck.Rows[0]["DETECTION_NUM3"].ToString3());
}
if (straightnum != testnum)
{
MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(ActiveJUDGE_STOVE_NO) + "】在您结炉后与矫直合格支数不匹配,请确认", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return false;
}
//----------
int result = 0;
int rack = 0;
//if (TestMethod.Contains("涡流"))
if (PlineCode.Equals("C010"))
{
DataTable dtETR = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.GetETResult", new object[] { heatno, proPlanId, gxPlanNo }, this.ob);
//if (testnum1 > 0)
//{
// if (!dtETR.Rows[0]["NODE_FUR_FLAG1"].ToString().Equals("1"))
// {
// MessageBox.Show("1#台未结炉结炉", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Information);
// return false;
// }
//}
//if (testnum2 > 0)
//{
// if (!dtETR.Rows[0]["NODE_FUR_FLAG2"].ToString().Equals("1"))
// {
// MessageBox.Show("2#台未结炉结炉", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Information);
// return false;
// }
//}
//if (testnum3 > 0)
//{
// if (!dtETR.Rows[0]["NODE_FUR_FLAG3"].ToString().Equals("1"))
// {
// MessageBox.Show("3#台未结炉结炉", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Information);
// return false;
// }
//}
//MessageBox.Show("所有操作台均已结炉", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Information);
int ss = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.UpdateToTalNode", new object[] { heatno, "1" }, this.ob);
}
//if (TestMethod.Contains("漏磁"))
if (PlineCode.Equals("C009") || PlineCode.Equals("C008") || PlineCode.Equals("C017") || PlineCode.Equals("C072"))
{
DataTable dtMTR = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.GetMTResult", new object[] { heatno, proPlanId, gxPlanNo }, this.ob);
//if (testnum1 > 0)
//{
// if (!dtMTR.Rows[0]["NODE_FUR_FLAG1"].ToString().Equals("1"))
// {
// MessageBox.Show("1#台未结炉结炉", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Information);
// return false;
// }
//}
//if (testnum2 > 0)
//{
// if (!dtMTR.Rows[0]["NODE_FUR_FLAG2"].ToString().Equals("1"))
// {
// MessageBox.Show("2#台未结炉结炉", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Information);
// return false;
// }
//}
//MessageBox.Show("所有操作台均已结炉", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Information);
int ss = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.UpdateToTalNode", new object[] { heatno, "2" }, this.ob);
}
//if (TestMethod.Contains("超声波"))
if (PlineCode.Equals("C012"))
{
DataTable dtUTR = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.GetUTResult", new object[] { heatno, proPlanId, gxPlanNo }, this.ob);
if (testnum1 > 0)
{
if (!dtUTR.Rows[0]["NODE_FUR_FLAG1"].ToString().Equals("1"))
{
MessageBox.Show("1#台未结炉结炉", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Information);
return false;
}
}
if (testnum2 > 0)
{
if (!dtUTR.Rows[0]["NODE_FUR_FLAG2"].ToString().Equals("1"))
{
MessageBox.Show("2#台未结炉结炉", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Information);
return false;
}
}
//MessageBox.Show("所有操作台均已结炉", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Information);
int ss = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.UpdateToTalNode", new object[] { heatno, "3" }, this.ob);
}
foreach (UltraGridRow ugr in ultraGridPlan.Rows)
{
ugr.Cells["JUDGE_NO"].Value = BaseMethod.getJudgeStoveNo(ugr.Cells["JUDGE_STOVE_NO"].Value.ToString());
}
return true;
}
///
/// 获取每个台探伤的来料支数
///
///
///
public int GetDETECTION_NUM(string heat)
{
int result = 0;
string flag = "";
if (TestMethod.Contains("1"))
{
flag = "1";
}
if (TestMethod.Contains("2"))
{
flag = "2";
}
if (TestMethod.Contains("3"))
{
flag = "3";
}
DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.GetDETECTION_NUM", new object[] { heat, flag }, this.ob);
if (dt.Rows.Count > 0)
{
result = int.Parse(dt.Rows[0]["counts"].ToString());
}
return result;
}
///
/// 判断主表点击前是否保存实绩
///
///
///
///
/// 计划表ROW点击变换判断
///
private void ultraGridPlan_BeforeRowActivate(object sender, RowEventArgs e)
{
if (this.crackDetectionResult1.IsCellSelect == true)
{
if (ActiveStatus != "已开始探伤")
{
this.crackDetectionResult1.IsCellSelect = false;
// MessageBox.Show("警告:炉号:" + ActiveJUDGE_STOVE_NO + "未开始探伤,不允许保存探伤实绩", "提示", MessageBoxButtons.OK);
return;
}
//if (MessageBox.Show("提示:探伤实绩可能已修改,是否保存", "提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
//{
this.crackDetectionResult1.IsCellSelect = false;
//保存探伤实绩
//ETResultSave();
//}
//else
//{
this.crackDetectionResult1.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.mtTestingResult1.IsCellSelect == true)
{
if (ActiveStatus != "已开始探伤")
{
this.mtTestingResult1.IsCellSelect = false;
// MessageBox.Show("警告:炉号:" + ActiveJUDGE_STOVE_NO + "未开始探伤,不允许保存探伤实绩", "提示", MessageBoxButtons.OK);
return;
}
//if (MessageBox.Show("提示:探伤实绩可能已修改,是否保存", "提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
//{
this.mtTestingResult1.IsCellSelect = false;
//保存探伤实绩
// ETResultSave();
//}
//else
//{
this.mtTestingResult1.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.ulTestingResult1.IsCellSelect == true)
{
if (ActiveStatus != "已开始探伤")
{
this.ulTestingResult1.IsCellSelect = false;
// MessageBox.Show("警告:炉号:" + ActiveJUDGE_STOVE_NO + "未开始探伤,不允许保存探伤实绩", "提示", MessageBoxButtons.OK);
return;
}
//if (MessageBox.Show("提示:探伤实绩可能已修改,是否保存", "提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
//{
this.ulTestingResult1.IsCellSelect = false;
//保存探伤实绩
//ETResultSave();
//}
//else
//{
this.ulTestingResult1.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();
string PliceCode = PlineCode;
string StartTime = DateTime.Now.ToString("yyyy-MM-dd");
string EndTime = DateTime.Now.AddDays(1).ToString("yyyy-MM-dd");
string Date = StartTime;
StartTime = StartTime + " 00:00:00";
EndTime = EndTime + " 00:00:00";
//if (TestMethod.Contains("涡流"))
if (PlineCode.Equals("C010"))
{
DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.GetETResultNodeQuery", new object[] { PliceCode, Shift, Group, StartTime, EndTime }, this.ob);
FrmNodeResultQuery frm = new FrmNodeResultQuery(dt, 7, Date, Shift, Group, this.ob);
frm.ShowDialog();
}
//if (TestMethod.Contains("漏磁"))
if (PlineCode.Equals("C009") || PlineCode.Equals("C008") || PlineCode.Equals("C017") || PlineCode.Equals("C072"))
{
DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.GetMTResultNodeQuery", new object[] { PliceCode, Shift, Group, StartTime, EndTime }, this.ob);
FrmNodeResultQuery frm = new FrmNodeResultQuery(dt, 11, Date, Shift, Group, this.ob);
frm.ShowDialog();
}
//if (TestMethod.Contains("超声波"))
if (PlineCode.Equals("C012"))
{
DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.GetUTResultNodeQuery", new object[] { PliceCode, Shift, Group, StartTime, EndTime }, this.ob);
FrmNodeResultQuery frm = new FrmNodeResultQuery(dt, 12, Date, Shift, Group, this.ob);
frm.ShowDialog();
}
}
///
/// 未探离线
///
public void Offline()
{
if (alarmFlag == true)
{
MessageUtil.ShowTips("登记了缺陷项,请先保存实绩!");
return;
}
DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.GetMIL_STRAIGHTENING_RESULT", new object[] { ActiveJUDGE_STOVE_NO, proPlanId, gxPlanNo }, this.ob);
if (dt.Rows.Count == 0)
{
MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(ActiveJUDGE_STOVE_NO) + "】还未开始矫直,不能下线!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
if (string.IsNullOrEmpty(dt.Rows[0]["NODE_FUR_FLAG"].ToString()))
{
MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(ActiveJUDGE_STOVE_NO) + "】还未开始矫直,不能下线!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
if (dt.Rows[0]["NODE_FUR_FLAG"].ToString() != "1")//
{
MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(ActiveJUDGE_STOVE_NO) + "】还未矫直完成,不能下线!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
//工序状态:01-矫直1#,02-矫直2#,03-矫直3#,11-ET探伤,12-MT探伤,13-UT探伤
string Node = offlinenode;
//Node = Node + Colno;
beforeQualifiedNum = this.rollingCard1.Value.StraightQualifiedNum;
qualifiedNum = string.IsNullOrEmpty(this.rollingCard1.Value.TestingQualifiedNum) ? "0" : this.rollingCard1.Value.TestingQualifiedNum;
scrapNum = string.IsNullOrEmpty(this.rollingCard1.Value.TestingScrapNum) ? "0" : this.rollingCard1.Value.TestingScrapNum;
offineHas = string.IsNullOrEmpty(this.rollingCard1.Value.OfflineTesting) ? "0" : this.rollingCard1.Value.OfflineTesting;
offineHead = string.IsNullOrEmpty(this.rollingCard1.Value.BacklineTesting) ? "0" : this.rollingCard1.Value.BacklineTesting;
string numb = (int.Parse(beforeQualifiedNum.ToString3()) - int.Parse(qualifiedNum.ToString3()) - int.Parse(scrapNum.ToString3()) - int.Parse(offineHas.ToString3()) + int.Parse(offineHead.ToString3())).ToString();
FrmOffLineOperation frm = new FrmOffLineOperation("TS", this.ob, PlineCode, this.ActiveJUDGE_STOVE_NO, this.lotno, numb, proPlanId, gxPlanNo);
frm.ShowDialog();
PlanQuery();
}
public void BackLine()
{
//工序状态:01-矫直1#,02-矫直2#,03-矫直3#,11-ET探伤,12-MT探伤,13-UT探伤
string Node = offlinenode;
Node = Node + Colno;
DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmBackLine.GetOfflineResult", new object[] { "1" }, this.ob);
if (dt.Rows.Count > 0)
{
BackLineOperate frm = new BackLineOperate(Node, this.ob, PlineCode, stoveno, lotno);
frm.ShowDialog();
PlanQuery();
}
else
{
MessageBox.Show("未查询到可返线实绩", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
}
public void colchang()
{
if (string.IsNullOrEmpty(ActiveJUDGE_STOVE_NO))
{
MessageBox.Show("您未选择任何住计划,不允许执行子管换台操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
DataTable dtFlag = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.GetQueryNodefurresult", new object[] { ActiveJUDGE_STOVE_NO }, this.ob);
if (dtFlag.Rows.Count == 0)
{
MessageBox.Show("炉号:【" + BaseMethod.getJudgeStoveNo(ActiveJUDGE_STOVE_NO) + "】尚开始矫直,不允许进行子管换台操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
if (string.IsNullOrEmpty(dtFlag.Rows[0]["NODE_FUR_FLAG"].ToString()))
{
MessageBox.Show("炉号:【" + BaseMethod.getJudgeStoveNo(ActiveJUDGE_STOVE_NO) + "】尚开始矫直,不允许进行子管换台操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
if (!dtFlag.Rows[0]["NODE_FUR_FLAG"].ToString().Equals("1"))
{
MessageBox.Show("炉号:【" + BaseMethod.getJudgeStoveNo(ActiveJUDGE_STOVE_NO) + "】在矫直工序尚未结炉,不允许进行子管换台操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
DataTable dt = new DataTable();
if (this.offlinenode.Equals("11"))
{
dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.GetETResult", new object[] { ActiveJUDGE_STOVE_NO, proPlanId, gxPlanNo }, this.ob);
}
if (this.offlinenode.Equals("12"))
{
dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.GetMTResult", new object[] { ActiveJUDGE_STOVE_NO, proPlanId, gxPlanNo }, this.ob);
}
if (this.offlinenode.Equals("13"))
{
dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.GetUTResult", new object[] { ActiveJUDGE_STOVE_NO, proPlanId, gxPlanNo }, this.ob);
}
if (dt.Rows.Count == 0)
{
MessageBox.Show("炉号:【" + BaseMethod.getJudgeStoveNo(ActiveJUDGE_STOVE_NO) + "】尚开始探伤,不允许进行子管换台操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
if (string.IsNullOrEmpty(dt.Rows[0]["NODE_FUR_FLAG"].ToString()))
{
MessageBox.Show("炉号:【" + BaseMethod.getJudgeStoveNo(ActiveJUDGE_STOVE_NO) + "】尚开始探伤,不允许进行子管换台操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
if (dt.Rows[0]["NODE_FUR_FLAG"].ToString().Equals("1"))
{
MessageBox.Show("炉号:【" + BaseMethod.getJudgeStoveNo(ActiveJUDGE_STOVE_NO) + "】在已完成探伤,不允许进行子管换台操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
ColNoChanges col = new ColNoChanges(this.ob, "10", ActiveJUDGE_STOVE_NO, PlineCode, proPlanId, gxPlanNo);
col.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
if (col.ShowDialog() == DialogResult.OK)
{
GetMILTestingRack(ActiveJUDGE_STOVE_NO);
ChangeGridColor();
}
}
private void ChangeShiftBack()
{
if (string.IsNullOrEmpty(this.ActiveJUDGE_STOVE_NO))
{
MessageBox.Show("您未选择任何计划,不允许进行交班回退操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
UltraGridRow ugr_plan = this.ultraGridPlan.ActiveRow;
string Status = ugr_plan.Cells["IS_START"].Value.ToString();
if (Status == "已完成探伤")
{
MessageBox.Show("炉号:【" + ActiveJUDGE_STOVE_NO + "】已完成探伤操作,不允许进行交班取消!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
if (Status == "未开始探伤")
{
MessageBox.Show("炉号:【" + ActiveJUDGE_STOVE_NO + "】未开始探伤操作,不允许进行交班取消!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
string Shift = UserInfo.GetUserOrder();
string Group = UserInfo.GetUserGroup();
NativeMethodNew na = new NativeMethodNew(this.ob);
if (na.ChangeShiftBackCheck(this.ActiveJUDGE_STOVE_NO, this.ActiveResultNo, this.PlineCode, Shift, Group, 8, this.Colno) || na.ChangeShiftBackCheckelse(this.ActiveJUDGE_STOVE_NO, this.ActiveResultNo, this.PlineCode, Shift, Group, 8, this.Colno, proPlanId, gxPlanNo))
{
int count = na.ChangeShiftBack(this.ActiveJUDGE_STOVE_NO, this.ActiveResultNo, this.PlineCode, Shift, Group, 8, this.Colno, proPlanId, gxPlanNo);
if (this.Colno.Equals("1"))
{
this.ultraTestRack1.DisplayLayout.Bands[0].Columns["SEQ"].SortIndicator = SortIndicator.None;
}
if (this.Colno.Equals("2"))
{
this.ultraTestRack1.DisplayLayout.Bands[0].Columns["SEQ"].SortIndicator = SortIndicator.None;
}
if (this.Colno.Equals("3"))
{
this.ultraTestRack1.DisplayLayout.Bands[0].Columns["SEQ"].SortIndicator = SortIndicator.None;
}
//na.ChangeShiftBack(this.ActiveJUDGE_STOVE_NO, this.ActiveResultNo, this.PlineCode, Shift, Group, 8, "2");
//if (this.PlineCode.Equals("C010"))
//{
// na.ChangeShiftBack(this.ActiveJUDGE_STOVE_NO, this.ActiveResultNo, this.PlineCode, Shift, Group, 8, "3");
//}
if (count < 1)
{
//MessageBox.Show("交班回退失败, 请确认后重新操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
}
else
{
switch (Shift)
{
case "1":
Shift = "早班";
break;
case "2":
Shift = "中班";
break;
case "3":
Shift = "夜班";
break;
}
switch (Group)
{
case "1":
Group = "甲班";
break;
case "2":
Group = "乙班";
break;
case "3":
Group = "丙班";
break;
case "4":
Group = "丁班";
break;
}
MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(ActiveJUDGE_STOVE_NO) + "】未在" + Group + "," + Shift + "进行交班操作,不允许进行交班取消操作");
return;
}
GetMILETResult(ActiveJUDGE_STOVE_NO);
GetMILTestingRack(ActiveJUDGE_STOVE_NO);
ChangeGridColor();
}
private void PrintResult()
{
DateTime SeverTime = NativeMethod.GetSeverTime(this.ob);
string Time = SeverTime.ToLongTimeString();
string StartTime = "";
string EndTime = "";
string strurl = "";
switch (PlineCode)
{
case "C008": //250
//晚班
Time = Time.Replace(":", "");
if (int.Parse(Time) < 070000)
{
StartTime = SeverTime.AddDays(-1).ToShortDateString() + " 07:00:00";
EndTime = SeverTime.ToShortDateString() + " 07:00:00";
string Date2 = SeverTime.ToString("yyyy-MM-dd");
strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilMTResult250.cpt&format=pdf&SHIFT=" + Shift + "&GROUP=" + Group + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + _UserID;
}
else
{
StartTime = SeverTime.ToShortDateString() + " 07:00:00";
EndTime = SeverTime.AddDays(1).ToShortDateString() + " 07:00:00";
strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilMTResult250.cpt&format=pdf&SHIFT=" + Shift + "&GROUP=" + Group + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + _UserID;
}
break;
case "C009": //258
//晚班
Time = Time.Replace(":", "");
if (int.Parse(Time) < 070000)
{
StartTime = SeverTime.AddDays(-1).ToShortDateString() + " 07:00:00";
EndTime = SeverTime.ToShortDateString() + " 07:00:00";
string Date2 = SeverTime.ToString("yyyy-MM-dd");
strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilMTResult258.cpt&format=pdf&SHIFT=" + Shift + "&GROUP=" + Group + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + _UserID;
}
else
{
StartTime = SeverTime.ToShortDateString() + " 07:00:00";
EndTime = SeverTime.AddDays(1).ToShortDateString() + " 07:00:00";
strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilMTResult258.cpt&format=pdf&SHIFT=" + Shift + "&GROUP=" + Group + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + _UserID;
}
break;
case "C010": //168
//晚班
Time = Time.Replace(":", "");
if (int.Parse(Time) < 070000)
{
StartTime = SeverTime.AddDays(-1).ToShortDateString() + " 07:00:00";
EndTime = SeverTime.ToShortDateString() + " 07:00:00";
string Date2 = SeverTime.ToString("yyyy-MM-dd");
strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilMTResult168.cpt&format=pdf&SHIFT=" + Shift + "&GROUP=" + Group + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + _UserID;
}
else
{
StartTime = SeverTime.ToShortDateString() + " 07:00:00";
EndTime = SeverTime.AddDays(1).ToShortDateString() + " 07:00:00";
strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilMTResult168.cpt&format=pdf&SHIFT=" + Shift + "&GROUP=" + Group + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + _UserID;
}
break;
case "C012": //Arssel
break;
case "C017": //460
//晚班
Time = Time.Replace(":", "");
if (int.Parse(Time) < 070000)
{
StartTime = SeverTime.AddDays(-1).ToShortDateString() + " 07:00:00";
EndTime = SeverTime.ToShortDateString() + " 07:00:00";
string Date2 = SeverTime.ToString("yyyy-MM-dd");
strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilMTResult460.cpt&format=pdf&SHIFT=" + Shift + "&GROUP=" + Group + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + _UserID;
}
else
{
StartTime = SeverTime.ToShortDateString() + " 07:00:00";
EndTime = SeverTime.AddDays(1).ToShortDateString() + " 07:00:00";
strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilMTResult460.cpt&format=pdf&SHIFT=" + Shift + "&GROUP=" + Group + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + _UserID;
}
break;
case "C072": //508
//晚班
Time = Time.Replace(":", "");
if (int.Parse(Time) < 070000)
{
StartTime = SeverTime.AddDays(-1).ToShortDateString() + " 07:00:00";
EndTime = SeverTime.ToShortDateString() + " 07:00:00";
string Date2 = SeverTime.ToString("yyyy-MM-dd");
strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilMTResult508.cpt&SHIFT=" + Shift + "&GROUP=" + Group + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + _UserID;
}
else
{
StartTime = SeverTime.ToShortDateString() + " 07:00:00";
EndTime = SeverTime.AddDays(1).ToShortDateString() + " 07:00:00";
strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilMTResult508.cpt&SHIFT=" + Shift + "&GROUP=" + Group + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + _UserID;
}
break;
}
FrmExcel fre = new FrmExcel(this.ob, strurl);
//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 PrintReport()
{
if (this.ultraGridPlan.ActiveRow == null)
{
MessageBox.Show("您未选择任何计划,不允许进行报表打印", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
string heatno = this.ActiveJUDGE_STOVE_NO;
string Shift = UserInfo.GetUserOrder();
string Group = UserInfo.GetUserGroup();
string url = "";
switch (PlineCode)
{
case "C008": //250
// url = "http://localhost:8075/WebReport/ReportServer?reportlet=RepMilInspectionTestReport250New1.cpt&format=pdf&JUDGE_STOVE_NO=" + heatno + "&COL_GROUP=" + Group + "&COL_SHIFT=" + Shift;
url = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilInspectionTestReport250.cpt&format=pdf&JUDGE_STOVE_NO=" + heatno + "&COL_GROUP=" + Group + "&COL_SHIFT=" + Shift;
break;
case "C009": //258
url = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilInspectionTestReport258.cpt&format=pdf&JUDGE_STOVE_NO=" + heatno + "&COL_GROUP=" + Group + "&COL_SHIFT=" + Shift;
break;
case "C010": //168
url = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilInspectionTestReport168.cpt&format=pdf&JUDGE_STOVE_NO=" + heatno + "&COL_GROUP=" + Group + "&COL_SHIFT=" + Shift;
break;
case "C012": //Arssel
break;
case "C017": //460
url = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilInspectionTestReport460.cpt&format=pdf&JUDGE_STOVE_NO=" + heatno + "&COL_GROUP=" + Group + "&COL_SHIFT=" + Shift;
break;
case "C072": //508
url = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilInspectionTestReport508.cpt&JUDGE_STOVE_NO=" + heatno + "&COL_GROUP=" + Group + "&COL_SHIFT=" + Shift;
break;
}
FrmExcel fre = new FrmExcel(this.ob, url);
//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 PrintReportRZ()
{
if (this.ultraGridPlan.ActiveRow == null)
{
MessageBox.Show("您未选择任何计划,不允许进行报表打印", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
string heatno = this.ActiveJUDGE_STOVE_NO;
string Shift = UserInfo.GetUserOrder();
string Group = UserInfo.GetUserGroup();
string url = "";
switch (PlineCode)
{
case "C072": //508
url = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilInspectionTestReport508TH.cpt&JUDGE_STOVE_NO=" + heatno + "&COL_GROUP=" + Group + "&COL_SHIFT=" + Shift;
break;
}
FrmExcel fre = new FrmExcel(this.ob, url);
fre.AutoSize = true;
fre.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
fre.WindowState = FormWindowState.Maximized;
fre.Show();
}
private void FrmEddyCurrentTestingResult_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
PlanQuery();
}
}
private void ultraTestRack1_ClickCellButton(object sender, CellEventArgs e)
{
UltraGridRow ugr_pian = ultraGridPlan.ActiveRow;
string HeatNo = ugr_pian.Cells["JUDGE_STOVE_NO"].Value.ToString();
UltraGridRow ugr_testingrack = ultraTestRack1.ActiveRow;
string offline = ugr_testingrack.Cells["OFFLINE_FLAG"].Value.ToString();
MilPlan milpian = new MilPlan();
string SEQ = ugr_testingrack.Cells["SEQ"].Value.ToString();
int sql1 = int.Parse(SEQ);
string MatStatus = ugr_testingrack.Cells["STATUS"].Value.ToString();
// UltraGridRow ugr = this.ultraTestRack1.ActiveRow;
HOTMethod hm = new HOTMethod(this.ob);
NativeMethodNew na = new NativeMethodNew(this.ob);
string plinCode = na.GetPCode(this.UserInfo.GetDepartment());
int Seq = int.Parse(ugr_testingrack.Cells["SEQ"].Value.ToString());
string JudgeStoveNo = ugr_testingrack.Cells["JUDGE_STOVE_NO"].Value.ToString();
string ResultNo = ugr_pian.Cells["ID"].Value.ToString();
string shif = ugr_testingrack.Cells["COL_SHIFT"].Value.ToString2();
string group = ugr_testingrack.Cells["COL_GROUP"].Value.ToString2();
//判废管坯序号类
//MilSlabScrapSeqEntity ScrapSlab = new MilSlabScrapSeqEntity();
//string reflag = "0";
//int countss = 0;
//string flag = "0";
//if (TestMethod.Contains("涡流"))
//{
// flag = "1";
//}
//if (TestMethod.Contains("漏磁"))
//{
// flag = "2";
//}
//if (TestMethod.Contains("超声波"))
//{
// flag = "3";
//}
//DataTable dtnodeflag = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.GetTSNodeFlagColno", new object[] { HeatNo, int.Parse(flag), int.Parse(Colno) }, this.ob);
//if (dtnodeflag.Rows.Count > 0)
//{
// if (dtnodeflag.Rows[0]["NODEFLAG"].ToString().Equals("1"))
// {
// MessageBox.Show("探伤操作台【" + this.Colno + "】#台已完成探伤操作,不允许进行管号队列操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
// return;
// }
//}
//else
//{
// MessageBox.Show("炉号【" + HeatNo + "】未开始探伤,不允许进行管号队列操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
// return;
//}
//if (ActiveStatus == "已完成探伤")
//{
// MessageBox.Show("炉号:【" + BaseMethod.getJudgeStoveNo(HeatNo) + "】已完成探伤操作,不允许进行判废操作!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
// return;
//}
//if (ActiveOFFLINE_FLAG.Equals("2"))
//{
// if (!offline.Equals("返线"))
// {
// MessageBox.Show("当前为矫直返线,只允许对下线状态为返线的子管进行操作,", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
// return;
// }
//}
////Shift = UserInfo.GetUserOrder();
////Group = UserInfo.GetUserGroup();
//NativeMethodNew nasssss = new NativeMethodNew(this.ob);
//if (nasssss.IsRackOperate(shif, group))
//{
// MessageBox.Show("序号:【" + SEQ + "】子管已由" + shif + "," + group + "操作,不允许再进行操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
// return;
//}
////判废
//if (e.Cell.Column.Key == "SCRAP_SLAB")
//{
// if (ugr_testingrack.Cells["STATUS"].Value.ToString() == "判废")
// {
// MessageBox.Show("坯料已被判废不能再次判废!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
// return;
// }
// if (ugr_pian.Cells["IS_START"].Value.ToString() != "已开始探伤")
// {
// MessageBox.Show("炉号:【" + ugr_pian.Cells["JUDGE_STOVE_NO"].Value.ToString().Replace("-.*", "") + "】的坯料未开始探伤,请检查确认后再判废", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
// return;
// }
// int ScrapNumBefore = 0;
// DataTable dtcountaftersaw = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.scrapMatCheckAfterSaw", new object[] { HeatNo, 10, "1" }, this.ob);
// ScrapNumBefore = int.Parse(dtcountaftersaw.Rows[0]["Countss"].ToString());
// DataTable dtcount = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.GetRackCounts", new object[] { HeatNo, sql1, "1" }, this.ob);
// if (dtcount.Rows.Count > 0)
// {
// countss = int.Parse(dtcount.Rows[0]["COUNTSS"].ToString());
// }
// if (this.ultraTestRack1.Rows.Count - (countss + 1) < ScrapNumBefore)
// {
// MessageBox.Show("不存在序号为【" + sql1 + "】的管号,可能是被前道工序判废,不能再次判废!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
// return;
// }
// //if (MessageUtil.ShowYesNoAndQuestion("是否判废该子管") == DialogResult.No)
// //{
// // return;
// //}
// if (string.IsNullOrEmpty(ugr_testingrack.Cells["SCRAP_REASON"].Value.ToString2()))
// {
// MessageBox.Show("请选择判废原因后再进行判废操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
// return;
// }
// ScrapSlab.JudgeStoveNo = ugr_pian.Cells["JUDGE_STOVE_NO"].Value.ToString();
// ScrapSlab.Seq = ugr_testingrack.Cells["SEQ"].Value.ToString();
// ScrapSlab.ScrapReason = ugr_testingrack.Cells["SCRAP_REASON"].Value.ToString();
// ScrapSlab.ProcessNo = "10";
// ScrapSlab.Flag = "0";
// ScrapSlab.ColMode = "1";
// ScrapSlab.ColUser = UserInfo.GetUserName();
// ScrapSlab.ColGroup = UserInfo.GetUserGroup();
// ScrapSlab.ColShift = UserInfo.GetUserOrder();
// ScrapSlab.ColNo = "1";
// if (ugr_testingrack.Cells["STATUS"].Value.ToString() == "报警")
// {
// //报警的话则修改复探合格支数
// int re = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.scrapREINSPECTION", new object[] { HeatNo, flag, Colno }, this.ob);
// }
// //剔管操作,:1、插入MIL_SLAB_SCRAP_SEQ表,2、探伤跟踪记录表状态,3、修改加探伤实绩表判废支数
// int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.scrapInspectionMat", new Object[] { ScrapSlab, flag, Colno }, this.ob);
// //int ScrapNum = 0;
// //if (string.IsNullOrEmpty(this.crackDetectionResult1.TestingDataSource1.Rows[0]["ScrapNum"].ToString()) || this.crackDetectionResult1.TestingDataSource1.Rows[0]["ScrapNum"].ToString() == "0")
// //{
// // ScrapNum = 1;
// //}
// //else
// //{
// // ScrapNum = int.Parse(this.crackDetectionResult1.TestingDataSource1.Rows[0]["ScrapNum"].ToString()) + count;
// //}
// //crackDetectionResult1.milet.ScrapNum = ScrapNum.ToString();
// //crackDetectionResult1.UpdateData();//探伤实绩卡重新赋值,
// //this.GetMILTestingRack(this.ultraGridPlan.ActiveRow.Cells["JUDGE_STOVE_NO"].Value.ToString());
// //MessageBox.Show("管序号【" + SEQ + "】判废成功!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
//}
////复探
//if (e.Cell.Column.Key == "ReInspection")
//{
// int ScrapNumBefore = 0;
// DataTable dtcountaftersaw = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.scrapMatCheckAfterSaw", new object[] { HeatNo, 10, "1" }, this.ob);
// ScrapNumBefore = int.Parse(dtcountaftersaw.Rows[0]["Countss"].ToString());
// DataTable dtcount = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.GetRackCounts", new object[] { HeatNo, sql1, "1" }, this.ob);
// if (dtcount.Rows.Count > 0)
// {
// countss = int.Parse(dtcount.Rows[0]["COUNTSS"].ToString());
// }
// if (this.ultraTestRack1.Rows.Count - (countss + 1) < ScrapNumBefore)
// {
// MessageBox.Show("不存在序号为【" + sql1 + "】的管号,可能是被前道工序判废,不能再次判废!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
// return;
// }
// if (this.ultraTestRack1.ActiveRow.Cells["STATUS"].Value.ToString() != "判废")
// {
// MilTestingRackEntity testrack = new MilTestingRackEntity();
// testrack.JudgeStoveNo = this.ultraTestRack1.ActiveRow.Cells["JUDGE_STOVE_NO"].Value.ToString();//判定炉号
// testrack.Seq = this.ultraTestRack1.ActiveRow.Cells["SEQ"].Value.ToString();//序号
// if (ugr_testingrack.Cells["STATUS"].Value.ToString() != "报警")
// {
// reflag = "1";
// }
// else
// {
// reflag = "0";
// }
// //复探操作:1、更新复探跟踪表(插入复探原因,更新复探支数),2、探伤实绩表复探支数+1
// int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.ReInspection", new object[] { testrack, flag, Colno, reflag }, this.ob);
// if (count == 1)
// {
// //MessageBox.Show("管序号【" + ugr_testingrack.Cells["SEQ"].Value.ToString() + "】复探成功。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
// //GetMILTestingRack(this.ultraGridPlan.ActiveRow.Cells["JUDGE_STOVE_NO"].Value.ToString());
// }
// }
// else
// {
// MessageBox.Show("管序号【" + ugr_testingrack.Cells["SEQ"].Value.ToString() + "】已判废,不允许复探!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
// return;
// }
//}
//if (e.Cell.Column.Key == "ReInspectionBACK")//复探回退
//{
// if (this.ultraTestRack1.ActiveRow.Cells["STATUS"].Value.ToString() != "判废")
// {
// MilTestingRackEntity testrack = new MilTestingRackEntity();
// testrack.JudgeStoveNo = this.ultraTestRack1.ActiveRow.Cells["JUDGE_STOVE_NO"].Value.ToString();//判定炉号
// testrack.Seq = this.ultraTestRack1.ActiveRow.Cells["SEQ"].Value.ToString();//序号
// int retestnum = int.Parse(this.ultraTestRack1.ActiveRow.Cells["RETEST_NUM"].Value.ToString());
// testrack.RetestNum = retestnum.ToString();//序号
// if (ugr_testingrack.Cells["STATUS"].Value.ToString() == "报警")
// {
// int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.ReInspectionBACK", new object[] { testrack, flag, Colno }, this.ob);
// }
// else
// {
// MessageBox.Show("管序号【" + ugr_testingrack.Cells["SEQ"].Value.ToString() + "】未进行复探,不允许复探回退。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
// return;
// }
// }
// else
// {
// MessageBox.Show("管序号【" + ugr_testingrack.Cells["SEQ"].Value.ToString() + "】已判废!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
// return;
// }
//}
//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 = 0;
// if (flag == "1")
// {
// counts = na.DeleteSlabSeq(HeatNo, SEQ, 12, 1, 0, Colno);
// }
// if (flag == "2")
// {
// counts = na.DeleteSlabSeq(HeatNo, SEQ, 13, 1, 0, Colno);
// }
// if (flag == "3")
// {
// counts = na.DeleteSlabSeq(HeatNo, SEQ, 14, 1, 0, Colno);
// }
// if (counts > 0)
// {
// //MessageBox.Show("判废回退成功。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
// }
// else
// {
// MessageBox.Show("判废回退失败。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
// return;
// }
//}
//if (e.Cell.Column.Key == "SUSPECT")//可疑或可疑回退
//{
// int ScrapNumBefore = 0;
// DataTable dtcountaftersaw = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.scrapMatCheckAfterSaw", new object[] { HeatNo, 10, "1" }, this.ob);
// ScrapNumBefore = int.Parse(dtcountaftersaw.Rows[0]["Countss"].ToString());
// DataTable dtcount = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.GetRackCounts", new object[] { HeatNo, sql1, "1" }, this.ob);
// if (dtcount.Rows.Count > 0)
// {
// countss = int.Parse(dtcount.Rows[0]["COUNTSS"].ToString());
// }
// if (this.ultraTestRack1.Rows.Count - (countss + 1) < ScrapNumBefore)
// {
// MessageBox.Show("不存在序号为【" + sql1 + "】的管号,可能是被前道工序判废,不能再次判废!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
// return;
// }
// if (this.ultraTestRack1.ActiveRow.Cells["STATUS"].Value.ToString() == "判废")
// {
// MessageBox.Show("管号:【" + SEQ + "】已判废,不允许定为可疑品", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
// return;
// }
// int AlarmReason = 0;
// if (String.IsNullOrEmpty(this.ultraTestRack1.ActiveRow.Cells["ALARM_REASON"].Value.ToString()) != true)
// {
// switch (this.ultraTestRack1.ActiveRow.Cells["ALARM_REASON"].Value.ToString())
// {
// case "LOD": AlarmReason = 1;//复探原因
// break;
// case "LID": AlarmReason = 2;
// break;
// case "TOD": AlarmReason = 3;
// break;
// case "TID": AlarmReason = 4;
// break;
// }
// }
// else
// {
// MessageBox.Show("提示:请选择复探(报警)原因后重新进行可以操作!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
// return;
// }
// string suspectflag = ugr_testingrack.Cells["SUSPECT_FLAG"].Value.ToString();
// if (suspectflag.Equals("正常轧制"))
// {
// int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.Suspect", new object[] { HeatNo, flag, Colno, SEQ, AlarmReason }, this.ob);
// if (count > 0)
// {
// //MessageBox.Show("设定成功。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
// }
// }
// if (suspectflag.Equals("可疑"))
// {
// int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.SuspectBack", new object[] { HeatNo, flag, Colno, SEQ }, this.ob);
// if (count > 0)
// {
// //MessageBox.Show("回退成功。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
// }
// }
//}
//if (e.Cell.Column.Key == "RECUT")
//{
// int ScrapNumBefore = 0;
// DataTable dtcountaftersaw = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.scrapMatCheckAfterSaw", new object[] { HeatNo, 10, "1" }, this.ob);
// ScrapNumBefore = int.Parse(dtcountaftersaw.Rows[0]["Countss"].ToString());
// DataTable dtcount = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.GetRackCounts", new object[] { HeatNo, sql1, "1" }, this.ob);
// if (dtcount.Rows.Count > 0)
// {
// countss = int.Parse(dtcount.Rows[0]["COUNTSS"].ToString());
// }
// if (this.ultraTestRack1.Rows.Count - (countss + 1) < ScrapNumBefore)
// {
// MessageBox.Show("不存在序号为【" + sql1 + "】的管号,可能是被前道工序判废,不能再次判废!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
// return;
// }
// if (this.ultraTestRack1.ActiveRow.Cells["STATUS"].Value.ToString() == "判废")
// {
// MessageBox.Show("管号:【" + SEQ + "】已判废,不允许进行子管再切", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
// return;
// }
// string recutflag = ugr_testingrack.Cells["RECUT_FLAG"].Value.ToString();
// if (recutflag.Equals("再切"))//再切回退
// {
// int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.RecutBack", new object[] { HeatNo, flag, Colno, SEQ }, this.ob);
// }
// if (recutflag.Equals("不再切"))//子管再切
// {
// if (ugr_testingrack.Cells["RECUT_LENGTH"].Value.ToString2().Equals(""))
// {
// MessageBox.Show("请输入子管再切长度后再进行子管再切操作。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
// return;
// }
// if (Convert.ToDouble(ugr_testingrack.Cells["RECUT_LENGTH"].Value.ToString2()) == 0)
// {
// MessageBox.Show("您输入的子管再切长度错误。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
// return;
// }
// double recutlength = Convert.ToDouble(ugr_testingrack.Cells["RECUT_LENGTH"].Value.ToString2());
// double legth = Convert.ToDouble(this.rollingInfomation1.Value.TargetLength);
// if (recutlength > legth)
// {
// MessageBox.Show("您输入的子管再切长度大于计划目标长度,不允许进行子管再切", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
// return;
// }
// int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.Recut", new object[] { HeatNo, flag, Colno, SEQ, recutlength.ToString() }, this.ob);
// }
//}
//if (e.Cell.Column.Key == "RECUT_FLAG")
//{
// string recutFlag = ugr_testingrack.Cells["RECUT_FLAG"].Text.Trim();
// string seq = ugr_testingrack.Cells["SEQ"].Text.Trim();
// string recutLen = ugr_testingrack.Cells["RECUT_LENGTH"].Text.Trim();
// if (ActiveStatus == "已完成探伤")
// {
// MessageBox.Show("炉号:【" + BaseMethod.getJudgeStoveNo(HeatNo) + "】已完成探伤操作,不允许进行切后长度修改操作!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
// return;
// }
// if (recutFlag != "再切")
// {
// MessageUtil.ShowTips("所操作的管号为不可再切管,不允许进行切后长度修改!");
// return;
// }
// int updateLen = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.updateRecutLen", new object[] { HeatNo, seq, recutLen }, ob);
//}
//交班
if (e.Cell.Column.Key == "CHANGE_GROUP")
{
if (ActiveStatus == "已完成探伤")
{
MessageBox.Show("炉号:【" + BaseMethod.getJudgeStoveNo(HeatNo) + "】已完成探伤操作,不允许进行交班操作!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
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, 8, plinCode, 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;
}
hm.UpdateChangeFlag(JudgeStoveNo, ResultNo, "", 8, Seq, 0);
AutoUpFile();
}
//接班
if (e.Cell.Column.Key == "TAKE_OVER")
{
if (ActiveStatus == "已完成探伤")
{
MessageBox.Show("炉号:【" + BaseMethod.getJudgeStoveNo(HeatNo) + "】已完成探伤操作,不允许进行接班操作!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
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, 8, plinCode, 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(JudgeStoveNo, ResultNo, "", 8, 0, proPlanId, gxPlanNo);
if (WaitChangeSeq == 0)
{
MessageBox.Show("没有待交班确认的管号。");
return;
}
if (WaitChangeSeq != Seq)
{
MessageBox.Show("交班管序号与接班管序号不符,请确认后接班。");
return;
}
if (MessageUtil.ShowYesNoAndQuestion("确认炉号:【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】序号:【" + 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 (this.DoRelogin(DoCheck))
{
//插入接班确认履历表
hm.InsertChangeRemuse(Shift, Group, _UserName, "8", plinCode);
int Seq2 = Seq;
int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.FeedSawResult.changeNum", new object[] { JudgeStoveNo, ResultNo, Seq2, BeforeChangeNum, 0, plinCode, Shift, Group, _UserName, 8, 0, proPlanId, gxPlanNo }, this.ob);
// ChangeFlag = 1;
}
}
if (this.ultraGridPlan.Rows == null)
{
return;
}
//探伤实绩卡赋值
GetMILETResult(HeatNo);
//探伤跟踪重新赋值
GetMILTestingRack(HeatNo);
ChangeGridColor();
GetRollingCard();
foreach (UltraGridRow ugr_1 in ultraTestRack1.Rows)
{
if (ugr_1.Cells["SEQ"].Value.ToString() == SEQ)
{
ultraTestRack1.ActiveRow = ugr_1;
}
}
}
private void ultraTestRack2_ClickCellButton(object sender, CellEventArgs e)
{
UltraGridRow ugr_pian = ultraGridPlan.ActiveRow;
string HeatNo = ugr_pian.Cells["JUDGE_STOVE_NO"].Value.ToString();
UltraGridRow ugr_testingrack = ultraTestRack1.ActiveRow;
string offline = ugr_testingrack.Cells["OFFLINE_FLAG"].Value.ToString();
MilPlan milpian = new MilPlan();
string SEQ = ugr_testingrack.Cells["SEQ"].Value.ToString();
int sql1 = int.Parse(SEQ);
string MatStatus = ugr_testingrack.Cells["STATUS"].Value.ToString();
//判废管坯序号类
MilSlabScrapSeqEntity ScrapSlab = new MilSlabScrapSeqEntity();
string reflag = "0";
int countss = 0;
string flag = "0";
//if (TestMethod.Contains("涡流"))
if (PlineCode.Equals("C010"))
{
flag = "1";
}
//if (TestMethod.Contains("漏磁"))
if (PlineCode.Equals("C009") || PlineCode.Equals("C008") || PlineCode.Equals("C017") || PlineCode.Equals("C072"))
{
flag = "2";
}
//if (TestMethod.Contains("超声波"))
if (PlineCode.Equals("C012"))
{
flag = "3";
}
DataTable dtnodeflag = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.GetTSNodeFlagColno", new object[] { HeatNo, int.Parse(flag), int.Parse(Colno) }, this.ob);
if (dtnodeflag.Rows.Count > 0)
{
if (dtnodeflag.Rows[0]["NODEFLAG"].ToString().Equals("1"))
{
MessageBox.Show("探伤操作台【" + this.Colno + "】#台已完成探伤操作,不允许进行管号队列操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
}
else
{
MessageBox.Show("炉号【" + HeatNo + "】未开始探伤,不允许进行管号队列操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
if (ActiveStatus == "已完成探伤")
{
MessageBox.Show("炉号:【" + BaseMethod.getJudgeStoveNo(HeatNo) + "】已完成探伤操作,不允许进行判废操作!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
if (ActiveOFFLINE_FLAG.Equals("2"))
{
if (!offline.Equals("返线"))
{
MessageBox.Show("当前为矫直返线,只允许对下线状态为返线的子管进行操作,", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
}
string shif = ugr_testingrack.Cells["COL_SHIFT"].Value.ToString();
string group = ugr_testingrack.Cells["COL_GROUP"].Value.ToString();
Shift = UserInfo.GetUserOrder();
Group = UserInfo.GetUserGroup();
NativeMethodNew nasssss = new NativeMethodNew(this.ob);
if (nasssss.IsRackOperate(shif, group))
{
MessageBox.Show("序号:【" + SEQ + "】子管已由" + shif + "," + group + "操作,不允许再进行操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
//复探
if (e.Cell.Column.Key == "ReInspection")
{
int ScrapNumBefore = 0;
DataTable dtcountaftersaw = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.scrapMatCheckAfterSaw", new object[] { HeatNo, 10, "2", proPlanId, gxPlanNo }, this.ob);
ScrapNumBefore = int.Parse(dtcountaftersaw.Rows[0]["Countss"].ToString());
DataTable dtcount = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.GetRackCounts", new object[] { HeatNo, sql1, "2", proPlanId, gxPlanNo }, this.ob);
if (dtcount.Rows.Count > 0)
{
countss = int.Parse(dtcount.Rows[0]["COUNTSS"].ToString());
}
if (this.ultraTestRack1.Rows.Count - (countss + 1) < ScrapNumBefore)
{
MessageBox.Show("不存在序号为【" + sql1 + "】的管号,可能是被前道工序判废,不能再次判废!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
if (this.ultraTestRack1.ActiveRow.Cells["STATUS"].Value.ToString() != "判废")
{
MilTestingRackEntity testrack = new MilTestingRackEntity();
testrack.JudgeStoveNo = this.ultraTestRack1.ActiveRow.Cells["JUDGE_STOVE_NO"].Value.ToString();//判定炉号
testrack.Seq = this.ultraTestRack1.ActiveRow.Cells["SEQ"].Value.ToString();//序号
if (ugr_testingrack.Cells["STATUS"].Value.ToString() != "报警")
{
reflag = "1";
}
else
{
reflag = "0";
}
//复探操作:1、更新复探跟踪表(插入复探原因,更新复探支数),2、探伤实绩表复探支数+1
int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.ReInspection", new object[] { testrack, flag, Colno, reflag }, this.ob);
if (count == 1)
{
MessageBox.Show("管序号【" + ugr_testingrack.Cells["SEQ"].Value.ToString() + "】复探成功。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
//GetMILTestingRack(this.ultraGridPlan.ActiveRow.Cells["JUDGE_STOVE_NO"].Value.ToString());
}
}
else
{
MessageBox.Show("管序号【" + ugr_testingrack.Cells["SEQ"].Value.ToString() + "】已判废,不允许复探!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
}
if (e.Cell.Column.Key == "ReInspectionBACK")//复探回退
{
if (this.ultraTestRack1.ActiveRow.Cells["STATUS"].Value.ToString() != "判废")
{
MilTestingRackEntity testrack = new MilTestingRackEntity();
testrack.JudgeStoveNo = this.ultraTestRack1.ActiveRow.Cells["JUDGE_STOVE_NO"].Value.ToString();//判定炉号
testrack.Seq = this.ultraTestRack1.ActiveRow.Cells["SEQ"].Value.ToString();//序号
int retestnum = int.Parse(this.ultraTestRack1.ActiveRow.Cells["RETEST_NUM"].Value.ToString());
testrack.RetestNum = retestnum.ToString();//序号
if (ugr_testingrack.Cells["STATUS"].Value.ToString() == "报警")
{
int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.ReInspectionBACK", new object[] { testrack, flag, Colno }, this.ob);
}
else
{
MessageBox.Show("管序号【" + ugr_testingrack.Cells["SEQ"].Value.ToString() + "】未进行复探,不允许复探回退。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
}
else
{
MessageBox.Show("管序号【" + ugr_testingrack.Cells["SEQ"].Value.ToString() + "】已判废!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
}
if (e.Cell.Column.Key == "RECUT")
{
int ScrapNumBefore = 0;
DataTable dtcountaftersaw = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.scrapMatCheckAfterSaw", new object[] { HeatNo, 10, "2", proPlanId, gxPlanNo }, this.ob);
ScrapNumBefore = int.Parse(dtcountaftersaw.Rows[0]["Countss"].ToString());
DataTable dtcount = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.GetRackCounts", new object[] { HeatNo, sql1, "2", proPlanId, gxPlanNo }, this.ob);
if (dtcount.Rows.Count > 0)
{
countss = int.Parse(dtcount.Rows[0]["COUNTSS"].ToString());
}
if (this.ultraTestRack1.Rows.Count - (countss + 1) < ScrapNumBefore)
{
MessageBox.Show("不存在序号为【" + sql1 + "】的管号,可能是被前道工序判废,不能再次判废!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
if (this.ultraTestRack1.ActiveRow.Cells["STATUS"].Value.ToString() == "判废")
{
MessageBox.Show("管号:【" + SEQ + "】已判废,不允许进行子管再切", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
string recutflag = ugr_testingrack.Cells["RECUT_FLAG"].Value.ToString();
if (recutflag.Equals("再切"))//再切回退
{
int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.RecutBack", new object[] { HeatNo, flag, Colno, SEQ }, this.ob);
}
if (recutflag.Equals("不再切"))//子管再切
{
if (ugr_testingrack.Cells["RECUT_LENGTH"].Value.ToString2().Equals(""))
{
MessageBox.Show("请输入子管再切长度后再进行子管再切操作。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
if (Convert.ToDouble(ugr_testingrack.Cells["RECUT_LENGTH"].Value.ToString2()) == 0)
{
MessageBox.Show("您输入的子管再切长度错误。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
double recutlength = Convert.ToDouble(ugr_testingrack.Cells["RECUT_LENGTH"].Value.ToString2());
double legth = Convert.ToDouble(this.rollingInfomation1.Value.TargetLength);
if (recutlength > legth)
{
MessageBox.Show("您输入的子管再切长度大于计划目标长度,不允许进行子管再切", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.Recut", new object[] { HeatNo, flag, Colno, SEQ, recutlength.ToString() }, this.ob);
}
}
//探伤实绩卡赋值
GetMILETResult(HeatNo);
//探伤跟踪重新赋值
GetMILTestingRack(HeatNo);
ChangeGridColor();
GetRollingCard();
}
private void ultraTestRack1_KeyDown(object sender, KeyEventArgs e)
{
if (recutFlag != "再切") return;
if (!recutLen.TryParseDouble())
{
MessageUtil.ShowTips("输入的切后长度不是有效数字!");
return;
}
if (e.KeyCode == Keys.Enter)
{
int updateLen = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.updateRecutLen", new object[] { jugeNo, seq, recutLen }, ob);
GetMILTestingRack(jugeNo);
ChangeGridColor();
}
}
private string jugeNo = "";//炉号
private string seq = "";//序号
private string recutLen = "";//切后长度
private string recutFlag = "";
private void ultraTestRack1_CellChange(object sender, CellEventArgs e)
{
if (e.Cell.Column.Key == "RECUT_LENGTH")
{
jugeNo = this.ultraTestRack1.ActiveRow.Cells["JUDGE_STOVE_NO"].Text.Trim();
seq = this.ultraTestRack1.ActiveRow.Cells["SEQ"].Text.Trim();
recutLen = this.ultraTestRack1.ActiveRow.Cells["RECUT_LENGTH"].Text.Trim().Replace("_", "");
recutFlag = this.ultraTestRack1.ActiveRow.Cells["RECUT_FLAG"].Text.Trim();
if (ActiveStatus == "已完成探伤")
{
MessageBox.Show("炉号:【" + jugeNo + "】已完成探伤操作,不允许进行切后长度修改操作!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
if (recutFlag != "再切")
{
MessageUtil.ShowTips("所操作的管号为不可再切管,不允许进行切后长度修改!");
return;
}
}
}
private void mtTestingResult1_cellChange(object sender, CellEventArgs e)
{
//e.Cell.Column.Key == "detectionNum1" || e.Cell.Column.Key == "detectionNum2" || e.Cell.Column.Key == "sampleNum1" || e.Cell.Column.Key == "sampleNum2" ||
if (e.Cell.Column.Key == "scrapNum1" || e.Cell.Column.Key == "scrapNum2" || e.Cell.Column.Key == "suspectProductNum1" || e.Cell.Column.Key == "suspectProductNum2" || e.Cell.Column.Key == "detectionNum1" || e.Cell.Column.Key == "detectionNum2" || e.Cell.Column.Key == "sampleNum1" || e.Cell.Column.Key == "sampleNum2")
{
string Status = doQueryJugeNoStaus(ActiveResultNo, ActiveJUDGE_STOVE_NO, PlineCode);
//if (Status == "1")
//{
GetMILTestingRack(ActiveJUDGE_STOVE_NO);
//}
alarmFlag = true;
}
}
private void ultraGridPlan_BeforeRowDeactivate(object sender, CancelEventArgs e)
{
if (alarmFlag == true)
{
e.Cancel = true;
MessageUtil.ShowTips("登记了缺陷项,请先保存实绩!");
return;
}
}
private void FrmTestingResult_FormClosing(object sender, FormClosingEventArgs e)
{
if (alarmFlag == true)
{
e.Cancel = true;
MessageUtil.ShowTips("登记了缺陷项,请先保存实绩!");
return;
}
}
private void crackDetectionResult1_cellChange(object sender, CellEventArgs e)
{
if (e.Cell.Column.Key == "scrapNum1" || e.Cell.Column.Key == "scrapNum2" || e.Cell.Column.Key == "scrapNum3" || e.Cell.Column.Key == "suspectProductNum1" || e.Cell.Column.Key == "suspectProductNum2" || e.Cell.Column.Key == "suspectProductNum3" || e.Cell.Column.Key == "detectionNum1" || e.Cell.Column.Key == "detectionNum2" || e.Cell.Column.Key == "detectionNum3" || e.Cell.Column.Key == "sampleNum1" || e.Cell.Column.Key == "sampleNum2" || e.Cell.Column.Key == "sampleNum3")
{
string Status = doQueryJugeNoStaus(ActiveResultNo, ActiveJUDGE_STOVE_NO, PlineCode);
//if (Status == "1")
//{
GetMILTestingRack(ActiveJUDGE_STOVE_NO);
//}
alarmFlag = true;
}
}
}
}