| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014 |
- using Core.Mes.Client.Comm.Control;
- using Core.Mes.Client.Comm.Format;
- using Core.Mes.Client.Comm.Tool;
- using Core.StlMes.Client.PlnSaleOrd.BaseMethod;
- using Core.StlMes.Client.PlnSaleOrd.工序排产;
- using Core.StlMes.Client.PlnSaleOrd.炼钢计划;
- using Core.StlMes.Client.PlnSaleOrd.炉计划.Entity;
- using Core.StlMes.Client.PlnSaleOrd.炉计划.Tool;
- using CoreFS.CA06;
- using Infragistics.Win;
- using Infragistics.Win.UltraWinGrid;
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- namespace Core.StlMes.Client.PlnSaleOrd.炉计划
- {
- public partial class FrmPlanStoveD : FrmBase
- {
- /// <summary>
- /// 调整行集合
- /// </summary>
- private ArrayList _EntityList = null;
- private string[] plineCode = null;//获取产线代码
- /// <summary>
- /// 虚拟炉计划id
- /// </summary>
- private string _heatPlanNo = "";
- /// <summary>
- /// 行首背景色
- /// </summary>
- private Color _backColor = new Color();
- public FrmPlanStoveD()
- {
- this.IsLoadUserView = true;
- InitializeComponent();
- }
- private void FrmPlanStoveD_Load(object sender, EventArgs e)
- {
- //订单排产
- EntityHelper.ShowGridCaption<PlnZyZgMEntity>(ultraGridZyD.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<PlnZyZgMCEntity>(ultraGrid1.DisplayLayout.Bands[0]);
- BaseHelper.setUltraGridColumnMaxInput(ultraGridZyD, new string[] { "WtGpSingle", "PlnInsingleWt", "PlnOutsingleW", "ReducedWt" });
- BaseHelper.setUltraGridColumnBits(ultraGridZyD, new string[] { "PlnInsingleNum", "PlnOutsingleNum" });
- BaseHelper.InitCellPosition(ultraGridZyD, new string[] { "GxProSeq", "GxPlanNo","OrderSeq", "DeliveryNo", "LenRollMax", "LenRollMin", "Aimoutdiameter","Aimwallthick","CcmGxPlanNo","Aimlength" ,"Diameter","LenGpSingle","WtGpSingle","PlnInsingleNum","PlnInsingleWt","PlnOutsingleNum",
- "PlnOutsingleW","Outdiameter", "Wallthick","OutdiameterZg","WallthickZg","RollLength","OutnumCut","LenCutend","LenCuthead","DiameterMandrel","CraftSeq", "ReducedWt"});
- //BaseHelper.InitCellPositionC(ultraGridZyD, new string[] { "Diameter", "LenGpSingle", "WtGpSingle", "CutNumGp", "LengthM", "WeightM", "PlanIndoubleNum", "PlanIndoubleWt", "RealIndoubleNum", "RealIndoubleWt", "GxPlanNo" });
- BaseHelper.GridColumnSum(ultraGridZyD, new string[] { "PlnInsingleWt", "PlnOutsingleW", "ReducedWt" });
- BaseHelper.GridColumnCount(ultraGridZyD, new string[] { "PlnInsingleNum", "PlnOutsingleNum" });
- //BaseHelper.InitCellPositionMiddle(ultraGridZyD, new string[] { "Isendgx", "IfWlMatched", "IfMonitorZg" });
- plineCode = PlanHelper.InitDropPlinePower("D", txtLine, this.ValidDataPurviewIds, this.ob);
- StoveHelper.ForbidSort(ultraGridZyD);
- BaseHelper.setUltraGridColumnMaxInput(ultraGrid1, new string[] { "WtGpSingle", "PlnInsingleWt", "PlnOutsingleW", "ActuaWt", "TotWeightM", "CutWeight", "ReducedWt", "RealIndoubleWt" });
- BaseHelper.setUltraGridColumnBits(ultraGrid1, new string[] { "PlnInsingleNum", "PlnOutsingleNum", "ActuaNum", "TotMumM" });
- BaseHelper.InitCellPosition(ultraGrid1, new string[] { "GxProSeq", "GxPlanNo","OrderSeq", "DeliveryNo", "LenRollMax", "LenRollMin", "Aimoutdiameter","Aimwallthick","CcmGxPlanNo","Aimlength" ,"Diameter","LenGpSingle","WtGpSingle","PlnInsingleNum","PlnInsingleWt","PlnOutsingleNum",
- "PlnOutsingleW","Outdiameter", "Wallthick","OutdiameterZg","WallthickZg","RollLength","OutnumCut","LenCutend","LenCuthead","DiameterMandrel","CraftSeq","LenGpSingleD","LengthM","CutNumGp","ActuaWt","ActuaNum","TotMumM","TotWeightM","CutWeight","CutLength", "ReducedWt","RealIndoubleNum","RealIndoubleWt"});
- //BaseHelper.InitCellPositionC(ultraGridZyD, new string[] { "Diameter", "LenGpSingle", "WtGpSingle", "CutNumGp", "LengthM", "WeightM", "PlanIndoubleNum", "PlanIndoubleWt", "RealIndoubleNum", "RealIndoubleWt", "GxPlanNo" });
- BaseHelper.GridColumnSum(ultraGrid1, new string[] { "ActuaWt", "CutWeight", "RealIndoubleWt" });
- BaseHelper.GridColumnCount(ultraGrid1, new string[] { "ActuaNum", "RealIndoubleNum" });
- StoveHelper.ForbidSort(ultraGrid1);
- InitDate();
- BaseHelper.SetGroupBySum(ultraGrid1, new string[] { "PlnOutsingleNum", "PlnOutsingleW", "ReducedWt" }, "HeatPlanNo");
- BaseHelper.InitComboEditor(ultraComboEditor1, "com.steering.pss.plnsaleord.planStove.FrmPlanStoveD.doQueryStorageNo", "STORAGE_NO", ob, true);
- }
- private void chcLine_CheckedChanged(object sender, EventArgs e)
- {
- if (chcLine.Checked) { txtLine.Enabled = true; } else { txtLine.Enabled = false; }
- if (chcProPlanId.Checked) { txtProPlanId.Enabled = true; } else { txtProPlanId.Enabled = false; }
- if (chcOrderNo.Checked) { txtOrderNo.Enabled = true; } else { txtOrderNo.Enabled = false; }
- if (chcId.Checked) { txtId.Enabled = true; } else { txtId.Enabled = false; }
- if (chcTime.Checked) { dateBegin.Enabled = true; dateEnd.Enabled = true; } else { dateBegin.Enabled = false; dateEnd.Enabled = false; }
- if (chcJudgeNo.Checked) { txtJudgeNo.Enabled = true; } else { txtJudgeNo.Enabled = false; }
- if (ultraCheckEditor1.Checked) { txtFeedHeatNo.Enabled = true; } else { txtFeedHeatNo.Enabled = false; }
- if (ultraCheckEditor3.Checked) { ultraTextEditor3.Enabled = true; } else { ultraTextEditor3.Enabled = false; }
- }
- /// <summary>
- /// 初始时间
- /// </summary>
- private void InitDate()
- {
- DateTime datetime = DateTime.Now;
- dateBegin.Value = datetime.AddDays(1 - datetime.Day);
- dateEnd.Value = datetime.AddDays(1 - datetime.Day).AddMonths(1).AddDays(-1);
- }
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- base.ToolBar_Click(sender, ToolbarKey);
- switch (ToolbarKey)
- {
- case "Query"://查询
- QueryM();
- break;
- case "Issued"://下发
- Issued("0");
- break;
- case "IssuedU"://撤销
- Issued("1");
- break;
- case "UpdateMemo"://修改备注
- UpdateMemo();
- break;
- case"UpdateGoWhere":
- updateGoWhere();
- break;
- case "UpdateFlagHeatNo":
- updateFlagHeatNo();
- break;
- case "CancleFlagHeatNo":
- cancleFlagHeatNo();
- break;
- case "Print"://打印
- doPrint();
- break;
- case "PrintTH"://打印
- doPrintTH();
- break;
- case "PrintTH2"://打印
- doPrintTH2();
- break;
- case "AddFeedLien"://获取上料行
- doAddFeedLien();
- break;
- case "UpdateHeat"://修改轧管判定炉号
- UpdateFeedHeattNo();
- break;
- case "Import"://导出
- doImport();
- break;
- case "Close": //关闭
- this.Close();
- break;
- default:
- break;
- }
- }
- /// <summary>
- /// 打印(天淮)
- /// </summary>
- private void doPrintTH()
- {
- UltraGridRow row = ultraGridZyD.ActiveRow;
- if (row == null) return;
- int countM = 0;
- string judgeStoveNo = "";
- string plineCode = "";
- foreach (UltraGridRow item in ultraGridZyD.Rows)
- {
- if (Convert.ToBoolean(item.Cells["CHC"].Text) == true)
- {
- countM++;
- if (item.Cells["Planstatus"].Text.ToString().Trim().Equals("计划"))
- {
- MessageUtil.ShowTips("选中该轧管炉计划状态是计划状态,不能打印!");
- return;
- }
- plineCode = item.Cells["PlineCode"].Text.ToString().Trim();
- judgeStoveNo += "'" + item.Cells["FeedHeatNo"].Text.ToString().Trim() + "',";
- }
- }
- if (countM == 0)
- {
- MessageUtil.ShowTips("请勾选需要打印的轧管炉计划主信息!");
- return;
- }
- if (judgeStoveNo.Equals("")) return;
- judgeStoveNo = judgeStoveNo.Substring(1, judgeStoveNo.Length - 3);
- string strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilZgPlanTH.cpt&op=view" + "&JUDGE_STOVE_NO=" + judgeStoveNo + "&PLINE_CODE=" + plineCode;
- FrmRepExcel fBug = new FrmRepExcel(ob, strurl);
- fBug.AutoSize = true;
- fBug.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
- fBug.Text = "轧管炉计划打印";
- fBug.ShowDialog();
- }
- /// <summary>
- /// 打印(天淮)
- /// </summary>
- private void doPrintTH2()
- {
- UltraGridRow row = ultraGridZyD.ActiveRow;
- if (row == null) return;
- int countM = 0;
- string judgeStoveNo = "";
- string plineCode = "";
- foreach (UltraGridRow item in ultraGridZyD.Rows)
- {
- if (Convert.ToBoolean(item.Cells["CHC"].Text) == true)
- {
- countM++;
- if (item.Cells["Planstatus"].Text.ToString().Trim().Equals("计划"))
- {
- MessageUtil.ShowTips("选中该轧管炉计划状态是计划状态,不能打印!");
- return;
- }
- plineCode = item.Cells["PlineCode"].Text.ToString().Trim();
- judgeStoveNo += "'" + item.Cells["FeedHeatNo"].Text.ToString().Trim() + "',";
- }
- }
- if (countM == 0)
- {
- MessageUtil.ShowTips("请勾选需要打印的轧管炉计划主信息!");
- return;
- }
- if (judgeStoveNo.Equals("")) return;
- judgeStoveNo = judgeStoveNo.Substring(1, judgeStoveNo.Length - 3);
- string strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilZgPlanTH.cpt&op=view" + "&JUDGE_STOVE_NO=" + judgeStoveNo + "&PLINE_CODE=" + plineCode;
- System.Diagnostics.Process.Start(strurl);
- //FrmRepExcel fBug = new FrmRepExcel(ob, strurl);
- //fBug.AutoSize = true;
- //fBug.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
- //fBug.Text = "轧管炉计划打印";
- //fBug.ShowDialog();
- }
- /// <summary>
- /// 修改物流去向
- /// </summary>
- private void updateGoWhere()
- {
- this.ultraGridZyD.UpdateData();
- IQueryable<UltraGridRow> checkMagRows = this.ultraGridZyD.Rows.AsQueryable().Where(" CHC = 'True'");
- if (checkMagRows.Count() == 0)
- {
- MessageUtil.ShowTips("请选择需要修改物流去向的数据信息!");
- return;
- }
- ArrayList parmList = new ArrayList();
- foreach (UltraGridRow row in checkMagRows)
- {
- PlnZyZgMEntity plnZgTity = (PlnZyZgMEntity)row.ListObject;
- plnZgTity.GowhereCode = row.Cells["GowhereCode"].Value.ToString();
- plnZgTity.GowhereName = row.Cells["GowhereCode"].Text.ToString();
- string plnZgEntity = JSONFormat.Format(plnZgTity);
- parmList.Add(plnZgEntity);
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.plnsaleord.planStove.FrmPlanStoveD";
- ccp.MethodName = "updateGoWhere";
- ccp.ServerParams = new object[] { parmList };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("修改成功!"))
- {
- QueryM();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 获取天津喷印炉号
- /// </summary>
- private void updateFlagHeatNo()
- {
- this.ultraGridZyD.UpdateData();
- IQueryable<UltraGridRow> checkMagRows = this.ultraGridZyD.Rows.AsQueryable().Where(" CHC = 'True'");
- if (checkMagRows.Count() == 0)
- {
- MessageUtil.ShowTips("请选择需要获取天津喷印炉号的数据信息!");
- return;
- }
- ArrayList parmList = new ArrayList();
- foreach (UltraGridRow row in checkMagRows)
- {
- PlnZyZgMEntity plnZgTity = (PlnZyZgMEntity)row.ListObject;
- if (!plnZgTity.FlagHeatNo.Equals(""))
- {
- MessageUtil.ShowTips("已有喷印炉号,不能获取喷印炉号!");
- return;
- }
- string plnZgEntity = JSONFormat.Format(plnZgTity);
- parmList.Add(plnZgEntity);
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.plnsaleord.planStove.FrmPlanStoveD";
- ccp.MethodName = "updateFlagHeatNo";
- ccp.ServerParams = new object[] { parmList };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("获取成功!"))
- {
- QueryM();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 撤销喷印炉号
- /// </summary>
- private void cancleFlagHeatNo()
- {
- this.ultraGridZyD.UpdateData();
- IQueryable<UltraGridRow> checkMagRows = this.ultraGridZyD.Rows.AsQueryable().Where(" CHC = 'True'");
- if (checkMagRows.Count() == 0)
- {
- MessageUtil.ShowTips("请选择需要撤销喷印炉号的数据信息!");
- return;
- }
- ArrayList parmList = new ArrayList();
- foreach (UltraGridRow row in checkMagRows)
- {
- PlnZyZgMEntity plnZgTity = (PlnZyZgMEntity)row.ListObject;
- string plnZgEntity = JSONFormat.Format(plnZgTity);
- parmList.Add(plnZgEntity);
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.plnsaleord.planStove.FrmPlanStoveD";
- ccp.MethodName = "cancleFlagHeatNo";
- ccp.ServerParams = new object[] { parmList };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("撤销成功!"))
- {
- QueryM();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- private int activation= 0;
- /// <summary>
- /// 导出
- /// </summary>
- private void doImport()
- {
- if (activation < 2)
- {
- GridHelper.ulGridToExcel(ultraGridZyD, "轧管炉计划主信息");
- }
- else
- {
- GridHelper.ulGridToExcel(ultraGrid1, "轧管炉计划详情");
- }
- }
- private void QueryM()
- {
- if (ultraExpandableGroupBox1.Expanded == false)
- {
- QueryC();
- }
- else
- {
- Query();
- }
- }
- private void Query()
- {
- //产线
- string plineCode = "";
- if (chcLine.Checked)
- {
- plineCode = txtLine.Value == null ? "" : txtLine.Value.ToString();
- }
- //if (txtLine.Text.Equals(""))
- //{
- // MessageUtil.ShowTips("请选择产线!");
- // return;
- //}
- string timeBegin = "";
- string timeEnd = "";
- if (chcTime.Checked && dateBegin.Value != null && dateEnd.Value != null)
- {
- timeBegin = DateTime.Parse(dateBegin.Value.ToString()).ToString("yyyy-MM-dd");
- timeEnd = DateTime.Parse(dateEnd.Value.ToString()).ToString("yyyy-MM-dd");
- }
- //string plineCode = "";
- //if(chcLine.Checked&& txtLine.Value != null){plineCode=txtLine.Value.ToString();}
- string orderNo = "";
- if (chcOrderNo.Checked) { orderNo = txtOrderNo.Text.Trim(); }
- string proPlanId = "";
- if (chcProPlanId.Checked) { proPlanId = txtProPlanId.Text.Trim(); }
- string heatId = "";
- if (chcId.Checked) { heatId = txtId.Text.Trim(); }
- string judgeNo = "";
- if (chcJudgeNo.Checked) { judgeNo = txtJudgeNo.Text.Trim(); }
- string feedHeatNo = "";
- if (ultraCheckEditor1.Checked) { feedHeatNo = txtFeedHeatNo.Text.Trim(); }
- string feedHeatNo2 = "";
- if (ultraCheckEditor3.Checked) { feedHeatNo2 = ultraTextEditor3.Text.Trim(); }
- string lotNo = "";
- if (chkLotNo.Checked) {
- lotNo = txtLotNo.Text.Trim();
- }
- string lotNo1 = "";
- string lotNo2 = "";
- if (this.ultraCheckEditor2.Checked)
- {
- lotNo1 = this.ultraTextEditor1.Text.Trim();
- lotNo2 = this.ultraTextEditor2.Text.Trim();
- }
- //执行状态
- string[] statusArr = contorlPlanStatusZy1.statusArr;
- List<PlnZyZgMEntity> listSourceM = EntityHelper.GetData<PlnZyZgMEntity>
- ("com.steering.pss.plnsaleord.planStove.FrmPlanStoveD.queryPlanStoveD", new object[] { timeBegin, timeEnd, plineCode, orderNo, proPlanId, heatId, statusArr, judgeNo, feedHeatNo, lotNo, lotNo1, lotNo2, feedHeatNo2 }, ob);
- plnZyZgMEntityBindingSource.DataSource = listSourceM;
- //GridHelper.RefreshAndAutoSize(ultraGridZyD);
- foreach (UltraGridRow ugr in ultraGridZyD.Rows)
- {
- int countMess = 0;
- if (!_heatPlanNo.Equals(""))
- {
- if (ugr.Cells["HeatPlanNo"].Text.Trim().Equals(_heatPlanNo))
- {
- ugr.Activate();
- break;
- }
- }
- if (_EntityList != null)
- {
- for (int i = 0; i < _EntityList.Count; i++)
- {
- PlnZyZgMEntity entity = (PlnZyZgMEntity)_EntityList[i];
- if (ugr.Cells["HeatPlanNo"].Text.Trim().Equals(entity.HeatPlanNo))
- {
- ugr.Appearance.BackColor = Color.Wheat;
- ugr.Activate();
- }
- }
- }
- //没有实际炉计划,主炉计划变颜色
- ////foreach (UltraGridRow itemc in ugr.ChildBands[0].Rows)
- ////{
- //// countMess++;
- ////}
- ////if (countMess == 0)
- ////{
- //// ugr.RowSelectorAppearance.BackColor = Color.GreenYellow;
- ////}
- //if (countMess > 0)
- //{
- // ugr.Cells["PlnInsingleNum"].Appearance.BackColor = Color.Red;
- // ugr.Cells["PlnInsingleWt"].Appearance.BackColor = Color.Red;
- //}
- }
- _EntityList = null;
- _heatPlanNo = "";
- }
- private void QueryC()
- {
- //产线
- string plineCode = "";
- if (chcLine.Checked)
- {
- plineCode = txtLine.Value == null ? "" : txtLine.Value.ToString();
- }
- //if (txtLine.Text.Equals(""))
- //{
- // MessageUtil.ShowTips("请选择产线!");
- // return;
- //}
- string timeBegin = "";
- string timeEnd = "";
- if (chcTime.Checked && dateBegin.Value != null && dateEnd.Value != null)
- {
- timeBegin = DateTime.Parse(dateBegin.Value.ToString()).ToString("yyyy-MM-dd");
- timeEnd = DateTime.Parse(dateEnd.Value.ToString()).ToString("yyyy-MM-dd");
- }
- //string plineCode = "";
- //if(chcLine.Checked&& txtLine.Value != null){plineCode=txtLine.Value.ToString();}
- string orderNo = "";
- if (chcOrderNo.Checked) { orderNo = txtOrderNo.Text.Trim(); }
- string proPlanId = "";
- if (chcProPlanId.Checked) { proPlanId = txtProPlanId.Text.Trim(); }
- string heatId = "";
- if (chcId.Checked) { heatId = txtId.Text.Trim(); }
- string judgeNo = "";
- if (chcJudgeNo.Checked) { judgeNo = txtJudgeNo.Text.Trim(); }
- string feedHeatNo = "";
- if (ultraCheckEditor1.Checked) { feedHeatNo = txtFeedHeatNo.Text.Trim(); }
- string lotNo = "";
- if(chkLotNo.Checked)
- {
- lotNo = txtLotNo.Text.Trim();
- }
- //执行状态
- string[] statusArr = contorlPlanStatusZy1.statusArr;
- List<PlnZyZgMCEntity> listSourceC = EntityHelper.GetData<PlnZyZgMCEntity>
- ("com.steering.pss.plnsaleord.planStove.FrmPlanStoveD.queryPlanStoveM", new object[] { timeBegin, timeEnd, plineCode, orderNo, proPlanId, heatId, statusArr, judgeNo, feedHeatNo, lotNo }, ob);
- plnZyZgMCEntityBindingSource.DataSource = listSourceC;
- //GridHelper.RefreshAndAutoSize(ultraGridZyD);
- foreach (UltraGridRow ugr in ultraGrid1.Rows)
- {
- //没有实际炉计划,主炉计划变颜色
- if (ugr.Cells["HeatPlanSqe"].Value.ToString().Equals(""))
- {
- //ugr.RowSelectorAppearance.BackColor = Color.GreenYellow;
- ugr.Appearance.BackColor = Color.Orange;
- }
- }
- }
- /// <summary>
- /// 顺序调整
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ultraGridZyD_MouseDown(object sender, MouseEventArgs e)
- {
- try
- { ultraGridZyD.UpdateData(); }
- catch (Exception)
- {
- MessageUtil.ShowWarning("数据异常,请刷新数据!"); return;
- }
- if (e.Button == MouseButtons.Right)
- {
- string plineCodeB = "";
- int count = 0;
- foreach (UltraGridRow ugrca in ultraGridZyD.Rows)
- {
- if (plineCodeB.Equals(""))
- {
- plineCodeB = ugrca.Cells["PlineCode"].Text.ToString();
- }
- if (!plineCodeB.Equals(ugrca.Cells["PlineCode"].Text.ToString()))
- {
- count++;
- }
- }
- if (count > 1)
- {
- MessageUtil.ShowTips("调整顺序时只允许界面存在相同产线,请重新查询!");
- return;
- }
- //移动行
- ArrayList entityList = ProducHelper.GetChcRows<PlnZyZgMEntity>(ultraGridZyD);
- if (entityList == null || entityList.Count == 0)
- {
- return;
- }
- //定位行
- UIElement myUIElement = ultraGridZyD.DisplayLayout.UIElement.ElementFromPoint(new Point(e.X, e.Y));
- UltraGridCell myCell = (UltraGridCell)myUIElement.GetContext(typeof(UltraGridCell));
- if (myCell == null) { return; }
- UltraGridRow ugr = myCell.Row;
- if (ugr == null) { return; }
- PlnZyZgMEntity entityD = (PlnZyZgMEntity)ugr.ListObject;
- bool flag = StoveHelper.SortPlanOrder(entityList, entityD, "D", "", this.ob);
- if (flag)
- {
- _EntityList = entityList;
- Query();
- }
- }
- }
- /// <summary>
- /// 修改备注
- /// </summary>
- private void UpdateMemo()
- {
- ultraGridZyD.UpdateData();
- UltraGridRow row = ultraGridZyD.ActiveRow;
- if (row == null) return;
- int countM = 0;
- ArrayList list = new ArrayList();
- foreach (UltraGridRow item in ultraGridZyD.Rows)
- {
- if (Convert.ToBoolean(item.Cells["CHC"].Text) == true)
- {
- countM++;
- ArrayList list1 = new ArrayList();
- //if (!item.Cells["Planstatus"].Text.ToString().Equals("计划"))
- //{
- // MessageUtil.ShowTips("选中该炉计划已下发,不能修改备注!");
- // return;
- //}
- list1.Add(item.Cells["Memo"].Text.ToString().Trim());
- list1.Add(item.Cells["HeatPlanNo"].Text.ToString().Trim());
- list1.Add(item.Cells["FeedHeatNo"].Text.ToString().Trim());
- list.Add(list1);
- }
- }
- if (countM == 0)
- {
- MessageUtil.ShowTips("请勾选需要修改的轧管炉计划主信息!");
- return;
- }
- if (MessageUtil.ShowYesNoAndQuestion("是否确认修改备注?") ==
- DialogResult.No)
- return;
- PlanComm.WaitFromOpen(this.Cursor);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.plnsaleord.planStove.FrmPlanStoveD";
- ccp.MethodName = "doUpdateMemo";
- ccp.ServerParams = new object[] { list, this.UserInfo.GetUserName() };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- PlanComm.WaitFromColse(this.Cursor);
- if (ccp.ReturnCode == -1) ;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("修改成功!"))
- {
- Query();
- }
- }
- /// <summary>
- /// 修改轧批号,炉号
- /// </summary>
- private void UpdateFeedHeattNo()
- {
- ultraGridZyD.UpdateData();
- UltraGridRow row = ultraGridZyD.ActiveRow;
- if (row == null) return;
- int countM = 0;
- ArrayList list = new ArrayList();
- foreach (UltraGridRow item in ultraGridZyD.Rows)
- {
- if (Convert.ToBoolean(item.Cells["CHC"].Text) == true)
- {
- countM++;
- ArrayList list1 = new ArrayList();
- if (!item.Cells["Planstatus"].Text.ToString().Equals("计划"))
- {
- MessageUtil.ShowTips("选中的炉计划已不是计划状态,不能修改!");
- return;
- }
- //list1.Add(item.Cells["ZyBatchId"].Text.ToString().Trim());
- list1.Add(item.Cells["HeatPlanNo"].Text.ToString().Trim());
- list1.Add(item.Cells["FeedHeatNo"].Text.ToString().Trim());
- list.Add(list1);
- }
- }
- if (countM == 0)
- {
- MessageUtil.ShowTips("请勾选需要修改的轧管炉计划主信息!");
- return;
- }
- if (MessageUtil.ShowYesNoAndQuestion("是否确认修改轧批号或判定炉号?") ==
- DialogResult.No)
- return;
- PlanComm.WaitFromOpen(this.Cursor);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.plnsaleord.planStove.FrmPlanStoveD";
- ccp.MethodName = "doUpdateFeedHeattNo";
- ccp.ServerParams = new object[] { list, this.UserInfo.GetUserName() };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- PlanComm.WaitFromColse(this.Cursor);
- if (ccp.ReturnCode == -1) ;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("修改成功!"))
- {
- Query();
- }
- }
- /// <summary>
- /// 获取上料行
- /// </summary>
- private void doAddFeedLien()
- {
- UltraGridRow row = ultraGridZyD.ActiveRow;
- if (row == null) return;
- int countM = 0;
- ArrayList list = new ArrayList();
- foreach (UltraGridRow item in ultraGridZyD.Rows)
- {
- if (!item.HasParent() && Convert.ToBoolean(item.Cells["CHC"].Text) == true)
- {
- countM++;
- ArrayList list1 = new ArrayList();
- if (!item.Cells["Planstatus"].Text.ToString().Equals("下发"))
- {
- MessageUtil.ShowTips("选中该炉计划不是下发状态,不能获取上料行!");
- return;
- }
- if (!item.Cells["FeedRowNo"].Text.ToString().Equals("未生成上料行"))
- {
- MessageUtil.ShowTips("选中该炉计划已生成上料行,不能重复获取上料行!");
- return;
- }
- list1.Add(item.Cells["HeatPlanNo"].Text.ToString().Trim());
- list.Add(list1);
- }
- }
- if (countM == 0)
- {
- MessageUtil.ShowTips("请勾选需要获取上料行并且是下发状态的轧管炉计划!");
- return;
- }
- PlanComm.WaitFromOpen(this.Cursor);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.plnsaleord.planStove.FrmPlanStoveD";
- ccp.MethodName = "doAddFeedLien";
- ccp.ServerParams = new object[] { list, this.UserInfo.GetUserName() };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- PlanComm.WaitFromColse(this.Cursor);
- if (ccp.ReturnCode == -1) ;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("获取成功!"))
- {
- Query();
- }
- }
- /// <summary>
- /// 打印
- /// </summary>
- private void doPrint()
- {
- UltraGridRow row = ultraGridZyD.ActiveRow;
- if (row == null) return;
- int countM = 0;
- string judgeStoveNo = "";
- string plineCode="";
- foreach (UltraGridRow item in ultraGridZyD.Rows)
- {
- if (Convert.ToBoolean(item.Cells["CHC"].Text) == true)
- {
- countM++;
- if (item.Cells["Planstatus"].Text.ToString().Trim().Equals("计划"))
- {
- MessageUtil.ShowTips("选中该轧管炉计划状态是计划状态,不能打印!");
- return;
- }
- //if (!item.Cells["Planstatus"].Text.ToString().Equals("计划"))
- //{
- // MessageUtil.ShowTips("选中该炉计划已下发,不能修改备注!");
- // return;
- //}
- plineCode= item.Cells["PlineCode"].Text.ToString().Trim();
- judgeStoveNo += "'" + item.Cells["FeedHeatNo"].Text.ToString().Trim() + "',";
- }
- }
- if (countM == 0)
- {
- MessageUtil.ShowTips("请勾选需要打印的轧管炉计划主信息!");
- return;
- }
- //if (MessageUtil.ShowYesNoAndQuestion("是否确认打印炉计划?") ==
- //DialogResult.No)
- // return;
- if (judgeStoveNo.Equals("")) return;
- judgeStoveNo = judgeStoveNo.Substring(1, judgeStoveNo.Length - 3);
- string strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilZgPlan.cpt&op=view" + "&JUDGE_STOVE_NO=" + judgeStoveNo + "&PLINE_CODE=" + plineCode;
- FrmRepExcel fBug = new FrmRepExcel(ob, strurl);
- fBug.AutoSize = true;
- fBug.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
- fBug.Text = "轧管炉计划打印";
- fBug.ShowDialog();
- }
- /// <summary>
- /// 下发炉计划
- /// </summary>
- /// <param name="flag"></param>
- private void Issued(string flag)
- {
- UltraGridRow row = ultraGridZyD.ActiveRow;
- if (row == null) return;
- int countM = 0;
- int countC = 0;
- ArrayList list = new ArrayList();
- foreach (UltraGridRow item in ultraGridZyD.Rows)
- {
- if (Convert.ToBoolean(item.Cells["CHC"].Text) == true)
- {
- countM++;
- ArrayList list1 = new ArrayList();
- if (flag.Equals("0") && !item.Cells["Planstatus"].Text.ToString().Equals("计划"))
- {
- MessageUtil.ShowTips("选中该炉计划已下发,不能重复下发!");
- return;
- }
- //if (flag.Equals("0") && item.Cells["SteelFalg"].Text.ToString().Trim().Equals("未结炉"))
- //{
- // MessageUtil.ShowTips("选中该炉计划未炼钢切割结炉,不能下发!");
- // return;
- //}
- if (flag.Equals("1") && item.Cells["Planstatus"].Text.ToString().Equals("计划"))
- {
- MessageUtil.ShowTips("选中该炉计划不处于下发状态,不能撤销!");
- return;
- }
- list1.Add(item.Cells["HeatPlanNo"].Text.ToString().Trim());
- list1.Add(item.Cells["JudgeStoveNo"].Text.ToString().Trim());
- list1.Add(item.Cells["StoveNo"].Text.ToString().Trim());
- list1.Add(item.Cells["ZyBatchId"].Text.ToString().Trim());
- list.Add(list1);
- //if (flag.Equals("0"))
- //{
- // foreach (UltraGridRow itemc in item.ChildBands[0].Rows)
- // {
- // countC++;
- // }
- // if (countC == 0)
- // {
- // MessageUtil.ShowTips("该炉未生成实际炉计划,不能下发!");
- // return;
- // }
- //}
- }
- }
- if (countM == 0)
- {
- MessageUtil.ShowTips("请勾选轧管炉计划主信息!");
- return;
- }
- if (MessageUtil.ShowYesNoAndQuestion((flag.Equals("0") ? "是否下发?" : "是否撤销下发?")) ==
- DialogResult.No)
- return;
- PlanComm.WaitFromOpen(this.Cursor);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.plnsaleord.planStove.FrmPlanStoveD";
- ccp.MethodName = "doFurnacePlan";
- ccp.ServerParams = new object[] { list, this.UserInfo.GetUserName(), flag };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- PlanComm.WaitFromColse(this.Cursor);
- if (ccp.ReturnCode == -1) ;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals(flag.Equals("0") ? "下发成功!" : "撤销成功!"))
- {
- Query();
- }
- }
- /// <summary>
- /// 托选
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ultraGridZyD_AfterSelectChange(object sender, AfterSelectChangeEventArgs e)
- {
- foreach (UltraGridRow uRow in ultraGridZyD.Selected.Rows)
- {
- if (uRow.GetType() != typeof(Infragistics.Win.UltraWinGrid.UltraGridGroupByRow))
- {
- uRow.Cells["CHC"].Value = true;
- }
- }
- }
- private int splitterDistance = 0;
- int count1 =0;
- int count2= 0;
- private void ultraExpandableGroupBox1_ExpandedStateChanged(object sender, EventArgs e)
- {
- if (ultraExpandableGroupBox1.Expanded == false)
- {
- this.splitContainer1.SplitterDistance =26;
- count1 = 26;
- }
- else
- {
- if (ultraExpandableGroupBox2.Expanded == false)
- {
- this.splitContainer1.SplitterDistance = splitContainer1.Size.Height - 26;
- }
- else
- {
- this.splitContainer1.SplitterDistance = splitterDistance == 0 ? splitContainer1.Size.Height / 2 : splitterDistance;
- }
- count1 = splitContainer1.Size.Height - 26;
- }
- }
- private void ultraExpandableGroupBox2_ExpandedStateChanged(object sender, EventArgs e)
- {
- if (ultraExpandableGroupBox2.Expanded == false)
- {
- if (count1 == 0) { count1 = splitContainer1.Size.Height - 26; }
- this.splitContainer1.SplitterDistance = count1;
- }
- else
- {
- if (ultraExpandableGroupBox1.Expanded==false) {
- this.splitContainer1.SplitterDistance = 26;
- }
- else
- {
- //this.splitContainer1.SplitterDistance = count1;
- this.splitContainer1.SplitterDistance = splitterDistance == 0 ? splitContainer1.Size.Height / 2 : splitterDistance;
- }
- }
- }
- private void ultraGridZyD_AfterRowActivate(object sender, EventArgs e)
- {
- UltraGridRow row = ultraGridZyD.ActiveRow;
- if (row == null) return;
- QueryMRow(row.Cells["HeatPlanNo"].Text.ToString().Trim());
- }
- private void QueryMRow(string heatPlanNo)
- {
- List<PlnZyZgMCEntity> listSourceM = EntityHelper.GetData<PlnZyZgMCEntity>
- ("com.steering.pss.plnsaleord.planStove.FrmPlanStoveD.queryPlanStoveRow", new object[] { heatPlanNo }, ob);
- plnZyZgMCEntityBindingSource.DataSource = listSourceM;
- foreach (UltraGridRow ugr in ultraGrid1.Rows)
- {
- //没有实际炉计划,主炉计划变颜色
- if (ugr.Cells["HeatPlanSqe"].Value.ToString().Equals(""))
- {
- //ugr.RowSelectorAppearance.BackColor = Color.GreenYellow;
- ugr.Appearance.BackColor = Color.Orange;
- }
- }
- }
- private void ultraGrid1_InitializeLayout(object sender,InitializeLayoutEventArgs e)
- {
- StoveHelper.CustomMergedCellEvaluator merge = new StoveHelper.CustomMergedCellEvaluator("HeatPlanNo");
- e.Layout.Bands[0].Columns["HeatPlanNo"].MergedCellStyle = MergedCellStyle.Always;
- e.Layout.Bands[0].Columns["HeatPlanNo"].MergedCellEvaluator = merge;
- e.Layout.Bands[0].Columns["JudgeStoveNo"].MergedCellStyle = MergedCellStyle.Always;
- e.Layout.Bands[0].Columns["JudgeStoveNo"].MergedCellEvaluator = merge;
- e.Layout.Bands[0].Columns["FlagStoveNo"].MergedCellStyle = MergedCellStyle.Always;
- e.Layout.Bands[0].Columns["FlagStoveNo"].MergedCellEvaluator = merge;
- e.Layout.Bands[0].Columns["Memo"].MergedCellStyle = MergedCellStyle.Always;
- e.Layout.Bands[0].Columns["Memo"].MergedCellEvaluator = merge;
- e.Layout.Bands[0].Columns["StoveNo"].MergedCellStyle = MergedCellStyle.Always;
- e.Layout.Bands[0].Columns["StoveNo"].MergedCellEvaluator = merge;
- e.Layout.Bands[0].Columns["PlnInsingleNum"].MergedCellStyle = MergedCellStyle.Always;
- e.Layout.Bands[0].Columns["PlnInsingleNum"].MergedCellEvaluator = merge;
- e.Layout.Bands[0].Columns["PlnInsingleWt"].MergedCellStyle = MergedCellStyle.Always;
- e.Layout.Bands[0].Columns["PlnInsingleWt"].MergedCellEvaluator = merge;
- e.Layout.Bands[0].Columns["ZyBatchId"].MergedCellStyle = MergedCellStyle.Always;
- e.Layout.Bands[0].Columns["ZyBatchId"].MergedCellEvaluator = merge;
- e.Layout.Bands[0].Columns["GxProSeq"].MergedCellStyle = MergedCellStyle.Always;
- e.Layout.Bands[0].Columns["GxProSeq"].MergedCellEvaluator = merge;
- e.Layout.Bands[0].Columns["TotMumM"].MergedCellStyle = MergedCellStyle.Always;
- e.Layout.Bands[0].Columns["TotMumM"].MergedCellEvaluator = merge;
- e.Layout.Bands[0].Columns["totWeightM"].MergedCellStyle = MergedCellStyle.Always;
- e.Layout.Bands[0].Columns["totWeightM"].MergedCellEvaluator = merge;
- e.Layout.Bands[0].Columns["FeedHeatNo"].MergedCellStyle = MergedCellStyle.Always;
- e.Layout.Bands[0].Columns["FeedHeatNo"].MergedCellEvaluator = merge;
- e.Layout.Bands[0].Columns["LenGpSingle"].MergedCellStyle = MergedCellStyle.Always;
- e.Layout.Bands[0].Columns["LenGpSingle"].MergedCellEvaluator = merge;
- e.Layout.Bands[0].Columns["Planstatus"].MergedCellStyle = MergedCellStyle.Always;
- e.Layout.Bands[0].Columns["Planstatus"].MergedCellEvaluator = merge;
- e.Layout.Bands[0].Columns["PlnOutsingleNum"].MergedCellStyle = MergedCellStyle.Always;
- e.Layout.Bands[0].Columns["PlnOutsingleNum"].MergedCellEvaluator = merge;
- e.Layout.Bands[0].Columns["PlnOutsingleW"].MergedCellStyle = MergedCellStyle.Always;
- e.Layout.Bands[0].Columns["PlnOutsingleW"].MergedCellEvaluator = merge;
- e.Layout.Bands[0].Columns["ReducedWt"].MergedCellStyle = MergedCellStyle.Always;
- e.Layout.Bands[0].Columns["ReducedWt"].MergedCellEvaluator = merge;
- }
- private void ultraGridZyD_Click(object sender, EventArgs e)
- {
- activation = 1;
- }
- private void ultraGrid1_Click(object sender, EventArgs e)
- {
- activation = 2;
- }
- private void ultraGridZyD_ClickCell(object sender, ClickCellEventArgs e)
- {
- activation = 1;
- }
- private void ultraGrid1_ClickCell(object sender, ClickCellEventArgs e)
- {
- activation = 2;
- }
- private void chkLotNo_CheckedChanged(object sender, EventArgs e)
- {
- this.txtLotNo.Enabled = this.chkLotNo.Checked;
- }
- private void ultraCheckEditor2_CheckedChanged(object sender, EventArgs e)
- {
- this.ultraTextEditor1.Enabled = this.ultraTextEditor2.Enabled = this.ultraCheckEditor2.Checked;
- }
- private void ultraCheckEditor3_CheckedChanged(object sender, EventArgs e)
- {
- if (ultraCheckEditor3.Checked) { ultraTextEditor3.Enabled = true; } else { ultraTextEditor3.Enabled = false; }
- }
- }
-
- }
|