| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064 |
- 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 Core.Mes.Client.Comm.Server;
- using Infragistics.Win.UltraWinGrid;
- using Core.Mes.Client.Comm.Tool;
- using Core.StlMes.Client.ZGMil.Entity;
- using com.steering.mes.zgmil.entity;
- using Core.StlMes.Client.ZGMil.NodeResultQuery;
- using System.Net;
- using Core.StlMes.Client.ZGMil.ResultConrtrol;
- using Core.StlMes.Client.ZGMil.Common;
- using CoreFS.SA06;
- namespace Core.StlMes.Client.ZGMil.Result
- {
- public partial class FrmReFurResult : FrmBase
- {
- #region 初始化
- private Infragistics.Win.UltraWinGrid.UltraGrid _grid = null;
- int PanelSizeFlag = 0;
- RollingInfomation rf = new RollingInfomation();
- FeedRowPlan QuertFeedplan = new FeedRowPlan();
- MilPlan QueryMainPlan = new MilPlan();
- FeedRowPlan Feedplan = new FeedRowPlan();
- MilPlan MainPlan = new MilPlan();
- MilRollingResultEntity RollingRs = new MilRollingResultEntity();
- FeedSawResultEntity FeedSawResult = new FeedSawResultEntity();
- MilRefurResultEntity RefurRs = new MilRefurResultEntity();
- MilRefurRackEntity RefurRack = new MilRefurRackEntity();
- MilSlabScrapSeqEntity ScrapSeq = new MilSlabScrapSeqEntity();
- private UltraGridRow ActiveUgr = null;
- private string ActiveJUDGE_STOVE_NO = null;//主计划活动行的判定炉号
- private string ActiveStatus = null;////主计划活动行的状态
- private string ActiveResultNo = ""; //主计划活动行ResultNo
- private string proPlanId = null;//轧管订单编号
- private string gxPlanNo = null;//工序排产序号
- private string lotNo = null;//生产批号
- int ShowMessageFlag = 0;
- MilRefurResultEntity temprefur = new MilRefurResultEntity();//保存当前实绩类
- string PlanStatusQuery = "50";
- string Shift = "";
- string Group = "";
- private string Departm = "";//部门
- private string PlineCode = "";//产线
- private string _UserName = "";
- private string _UserID = "";
- // private string _Url = "";
- private int _MouseLocX = 0; //鼠标横坐标
- private int _MouseLocY = 0; //鼠标纵坐标
- public Infragistics.Win.UltraWinGrid.UltraGrid Grid
- {
- get { return _grid; }
- }
- public FrmReFurResult()
- {
- Shift = UserInfo.GetUserOrder();
- Group = UserInfo.GetUserGroup();
- InitializeComponent();
- PanelSizeFlag = 0;
- this.reFurResult1.UltraGrid2.ClickCellButton += new CellEventHandler(UltraGrid2_ClickCellButton);
- //获取鼠标坐标
- Point formPoint = this.PointToClient(Control.MousePosition);
- _MouseLocX = Convert.ToInt32(formPoint.X);
- _MouseLocY = Convert.ToInt32(formPoint.Y);
- }
- protected override void OnLoad(EventArgs e)
- {
- base.OnLoad(e);
- //屏蔽Grid筛选条件
- foreach (UltraGridColumn ugc in ultraGridPlan.DisplayLayout.Bands[0].Columns)
- {
- ugc.SortIndicator = SortIndicator.Disabled;
- }
- rollingInfomation1.UltraGrid4.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
- rollingCard1.UltraGrid4.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
- ultraGridPlan.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
- reFurResult1.UltraGrid2.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
- ultraGrid1.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
- InitControl();
- foreach (UltraGridColumn ugc in ultraGridPlan.DisplayLayout.Bands[0].Columns)
- {
- ugc.SortIndicator = SortIndicator.Disabled;
- }
- foreach (UltraGridColumn ugc in this.ultraGridINFurInfor.DisplayLayout.Bands[0].Columns)
- {
- ugc.SortIndicator = SortIndicator.Disabled;
- }
- foreach (UltraGridColumn ugc in this.ultraGridOUTFurInfor.DisplayLayout.Bands[0].Columns)
- {
- ugc.SortIndicator = SortIndicator.Disabled;
- }
- timer1.Tick += new EventHandler(timer1_Tick);
- ShowShift();
- }
- private void ShowShift()
- {
- colShowShiftGroup1.Ob = this.ob;
- colShowShiftGroup1.Group = this.UserInfo.GetUserGroup();
- colShowShiftGroup1.Shift = this.UserInfo.GetUserOrder();
- colShowShiftGroup1.ShowShift();
- colShowShiftGroup1.Timer1.Enabled = true;
- }
- /// <summary>
- /// 页面开启事件
- /// </summary>
- /// <param name="e"></param>
- protected override void OnShown(EventArgs e)
- {
- base.OnShown(e);
- string hostname = Dns.GetHostName();
- IPAddress ip = Dns.GetHostByName(hostname).AddressList[0];
- NativeMethodNew na = new NativeMethodNew(this.ob);
- Departm = UserInfo.GetDepartment();
- PlineCode = na.GetPCode(Departm);//获取 用户 对应的产线
- PlanQuery();
- foreach (UltraGridRow ugr in ultraGridPlan.Rows)
- {
- ugr.Cells["JUDGE_NO"].Value = BaseMethod.getJudgeStoveNo(ugr.Cells["JUDGE_STOVE_NO"].Value.ToString());
- }
- Sign();
- frmTechnological1.InitMilSet(PlineCode, "40030", this.ob);
- PlanQuery();
- }
- /// <summary>
- /// 签名
- /// </summary>
- private void Sign()
- {
- ColUserName col = new ColUserName();
- col.StationId = "4";
- col.PlineCode = PlineCode;
- col.ColGroup = Group;
- col.Ob = this.ob;
- col.ShowDialog();
- _UserID = col.getUserId();
- _UserName = col.getUserName();
- }
- /// <summary>
- /// 初始化控件
- /// </summary>
- public void InitControl()
- {
- //if (chkDate.Checked)
- //{
- // dtStartDate.Enabled = true;
- // dtEndDate.Enabled = true;
- //}
- //else
- //{
- // dtStartDate.Enabled = false;
- // dtEndDate.Enabled = false;
- //}
- if (chkLotNo.Checked)
- {
- txtLOT_NO.Enabled = true;
- }
- else
- {
- txtLOT_NO.Enabled = false;
- }
- if (chkHeatNo.Checked)
- {
- txtJudgeStoveNo.Enabled = true;
- }
- else
- {
- txtJudgeStoveNo.Enabled = false;
- }
- Shift = UserInfo.GetUserOrder();
- Group = UserInfo.GetUserGroup();
- }
- #endregion
- #region 按钮操作
- /// <summary>
- /// ToolBar按钮
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="ToolbarKey"></param>
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Query":
- PlanQuery();
- break;
- case "Save":
- FeedRowSave();
- break;
- case "Node":
- FeedSawResultNode();
- break;
- case "DoNodeBack":
- NodeBack();
- break;
- case "DoSign":
- Sign();
- break;
- case "NodeQuery":
- NodeQuery();
- break;
- case "DoChangeCancel":
- ChangeCancel();
- break;
- case "DoQueryBefore":
- QueryBefore();
- break;
- case "DoPrint":
- PrintResult();
- break;
- case "DoStart":
- DoStart();
- break;
- case "DoStartBack":
- StartBack();
- break;
- case "Close":
- this.Dispose();
- this.Close();
- break;
- }
- }
- /// <summary>
- /// 查询主计划
- /// </summary>
- private void PlanQuery()
- {
- string PrimaKey = "";
- string PrimaKey1 = "";
- string PrimaKey2 = "";
- UltraGridRow ugr = this.ultraGridPlan.ActiveRow;
- if (ugr != null)
- {
- PrimaKey = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
- }
- UltraGridRow ugrIN = this.ultraGridINFurInfor.ActiveRow;
- if (ugrIN != null)
- {
- PrimaKey1 = ugrIN.Cells["JUDGE_STOVE_NO"].Value.ToString();
- }
- UltraGridRow ugrOUT = this.ultraGridOUTFurInfor.ActiveRow;
- if (ugrOUT != null)
- {
- PrimaKey2 = ugrOUT.Cells["JUDGE_STOVE_NO"].Value.ToString();
- }
- if (chkHeatNo.Checked)
- {
- if (this.txtJudgeStoveNo.Text == "")
- {
- MessageBox.Show("请输入炉号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- else
- {
- QueryMainPlan.JudgeStoveNo = this.txtJudgeStoveNo.Text;
- }
- }
- else
- {
- QueryMainPlan.JudgeStoveNo = "";
- }
- if (chkLotNo.Checked)
- {
- if (this.txtLOT_NO.Text == "")
- {
- MessageBox.Show("请输入生产批号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- else
- {
- QueryMainPlan.LotNo = this.txtLOT_NO.Text;
- }
- }
- else
- {
- QueryMainPlan.LotNo = "";
- }
- dtPlan.Clear();
- tbRollDate.Clear();
- dtINFurInfor.Clear();
- dtOUTFurInfor.Clear();
- QueryMainPlan.PlineCode = PlineCode;
- QueryMainPlan.Status = PlanStatusQuery;
- if (ultraTabControl3.Tabs[0].Active)
- {
- //查询待装炉计划
- DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmReFurResult.getINFurPlan", new object[] { QueryMainPlan.PlineCode, QueryMainPlan.LotNo, QueryMainPlan.JudgeStoveNo }, this.ob);
- if (dt.Rows.Count > 0)
- {
- GridHelper.CopyDataToDatatable(ref dt, ref dtPlan, true);
- foreach (UltraGridRow ugr1 in ultraGridPlan.Rows)
- {
- if (ugr1.Cells["JUDGE_STOVE_NO"].Value.ToString() == PrimaKey)
- {
- ugr1.Activated = true;
- }
- }
- }
- }
- else if (ultraTabControl3.Tabs[1].Active)
- {
- //查询待出炉炉次计划
- DataTable dtINFur = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmReFurResult.getINFurOUTPlan", new object[] { QueryMainPlan.PlineCode, QueryMainPlan.LotNo, QueryMainPlan.JudgeStoveNo }, this.ob);
- {
- if (dtINFur.Rows.Count > 0)
- {
- GridHelper.CopyDataToDatatable(ref dtINFur, ref dtINFurInfor, true);
- foreach (UltraGridRow ugrINFur in ultraGridINFurInfor.Rows)
- {
- if (ugrINFur.Cells["JUDGE_STOVE_NO"].Value.ToString() == PrimaKey1)
- {
- ugrINFur.Activated = true;
- }
- }
- }
- }
- }
- else if (ultraTabControl3.Tabs[2].Active)
- {
- //查询已出炉炉次计划
- DataTable dtOUTFur = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmReFurResult.getOUTFurPlan", new object[] { QueryMainPlan.PlineCode, QueryMainPlan.LotNo, QueryMainPlan.JudgeStoveNo }, this.ob);
- {
- if (dtOUTFur.Rows.Count > 0)
- {
- GridHelper.CopyDataToDatatable(ref dtOUTFur, ref dtOUTFurInfor, true);
- foreach (UltraGridRow ugrOUTFur in ultraGridOUTFurInfor.Rows)
- {
- if (ugrOUTFur.Cells["JUDGE_STOVE_NO"].Value.ToString() == PrimaKey2)
- {
- ugrOUTFur.Activated = true;
- }
- }
- }
- }
- }
-
- ChangeGridColor();
- }
- /// <summary>
- /// 单击主计划
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ultraGridPlan_AfterRowActivate(object sender, EventArgs e)
- {
- tbRollDate.Clear();
- switch (ultraTabControl3.SelectedTab.Index)
- {
- case 0:
- if (this.dtPlan.Rows.Count > 0)
- {
- ActiveUgr = ultraGridPlan.ActiveRow;
- AfterRowActive(ActiveUgr);
- }
- else
- {
- ActiveUgr = null;
- }
- break;
- case 1:
- if (this.dtINFurInfor.Rows.Count > 0)
- {
- ActiveUgr = ultraGridINFurInfor.ActiveRow;
- AfterRowActive(ActiveUgr);
- }
- else
- {
- ActiveUgr = null;
- }
- break;
- case 2:
- if (this.dtOUTFurInfor.Rows.Count > 0)
- {
- ActiveUgr = ultraGridOUTFurInfor.ActiveRow;
- AfterRowActive(ActiveUgr);
- }
- else
- {
- ActiveUgr = null;
- }
- break;
- }
- }
- /// <summary>
- /// 单击行激活方法
- /// </summary>
- /// <param name="ugr"></param>
- private void AfterRowActive(UltraGridRow ugr)
- {
- if (ugr == null)
- {
- return;
- }
- //查询主计划信息
- tbRollDate.Clear();
- string JudgeStoveNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
- string Status = ugr.Cells["IS_START"].Value.ToString();
- proPlanId = ugr.Cells["PRO_PLAN_ID"].Value.ToString();
- gxPlanNo = ugr.Cells["GX_PLAN_NO"].Value.ToString();
- lotNo = ugr.Cells["LOT_NO"].Value.ToString();
- MainPlan.JudgeStoveNo = JudgeStoveNo;
- MainPlan.ProPlanId = proPlanId;
- MainPlan.GxPlanNo = gxPlanNo;
- ActiveJUDGE_STOVE_NO = JudgeStoveNo;
- ActiveStatus = ugr.Cells["IS_START"].Value.ToString();
- ActiveResultNo = ugr.Cells["ID"].Value.ToString();
- DataTable dtMP = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getSingleMainPlanForHeatNo", new object[] { MainPlan }, this.ob);
- if (dtMP.Rows.Count > 0)
- {
- GridEdit(dtMP); //轧制计划信息
- //查询流通卡信息
- DataTable dtRollingCard = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getRollingCard", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, this.ob);
- if (dtRollingCard.Rows.Count > 0)
- {
- RollingCardEditGrid(dtRollingCard, JudgeStoveNo);
- }
- else
- {
- //清空流通卡值
- rollingCard1.ClearData();
- //GridHelper.InitCardGrid(rollingCard1.RollCardDataSource1, rollingCard1.UltraGrid4);
- }
- //查询加热炉实绩信息
- DataTable dtFurResult = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmReFurResult.getRefurResult", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, this.ob);
- if (dtFurResult.Rows.Count > 0)
- {
- GridEditResult(dtFurResult);
- }
- else
- {
- MilRefurResultEntity fr = new com.steering.mes.zgmil.entity.MilRefurResultEntity();
- reFurResult1.Value = fr;
- ////清空加热炉实绩
- //// GridHelper.InitCardGrid(furResult1.FurResultDateSource1, furResult1.UltraGrid3);
- ////加一段温度
- //txtTemp1.Text = "0.00";
- ////加二段温度
- //txtTemp2.Text = "0.00";
- ////加三段温度
- //txtTemp3.Text = "0.00";
- ////加四段温度
- //txtTemp4.Text = "0.00";
- ////加五段温度
- //txtTemp5.Text = "0.00";
- ////加六段温度
- //txtTemp6.Text = "0.00";
- ////加七段温度
- //txtTemp7.Text = "0.00";
- ////加八段温度
- //txtTemp8.Text = "0.00";
- ////炉压
- //txtFurTemp1.Text = "0.00";
- ////风压
- //txtPress1.Text = "0.00";
- ////天然气压力
- //txtGasPress1.Text = "0.00";
- }
- }
- if (Status != "未开始入炉")
- {
- RackQuery(JudgeStoveNo);
- }
- else
- {
- tbRollDate.Rows.Clear();
- }
- GetRollingCard();//流通卡赋值
- refurResultQuery();
- //ChangeGridColor();
- }
- /// <summary>
- /// 双击入炉
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void DoStart()
- // private void ultraGridPlan_DoubleClickRow(object sender, DoubleClickRowEventArgs e)
- {
- HOTMethod hm = new HOTMethod(this.ob);
- DataTable dt = new DataTable();
- if (ActiveUgr == null)
- {
- return;
- }
- else
- {
- //if (!IsStart())
- //{
- // return;
- //}
- UltraGridRow ugr = ActiveUgr;
- string HeatNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();//判定炉号
- string ResultNo = ugr.Cells["ID"].Value.ToString();//实绩编号
- ActiveStatus = ugr.Cells["IS_START"].Value.ToString();
- NativeMethodNew Nvw = new NativeMethodNew(this.ob);
- //if (!Nvw.isBegineNode(HeatNo, 3))
- //{
- // MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(heatNo) + "】未连轧,不能入再加热炉。");
- // return;
- //}
- if (ActiveStatus == "已完成出炉")
- {
- MessageBox.Show("炉号:【" + BaseMethod.getJudgeStoveNo(HeatNo) + "】已完成入炉,不允许再次入炉!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- if (ActiveStatus == "已开始入炉")
- {
- MessageBox.Show("炉号:【" + BaseMethod.getJudgeStoveNo(HeatNo) + "】已开始入炉,不允许再次入炉!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- if (hm.InFurIsEnd("0", PlineCode, 1).Rows.Count > 0)
- {
- MessageBox.Show("炉号:【" + BaseMethod.getJudgeStoveNo(hm.InFurIsEnd("0", PlineCode, 1).Rows[0][0].ToString()) + "】正在入炉,当前炉号:【" + BaseMethod.getJudgeStoveNo(HeatNo) + "】不能开始入炉");
- return;
- }
- RefurRs.Clear();
- if (ugr.Cells["IS_START"].Text.ToString().Trim() == "已开始再加热")
- {
- MessageBox.Show("已入再加热炉,无法进行再次入炉!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- else
- {
- MainPlan.JudgeStoveNo = HeatNo;
- DataTable dtMP = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getSingleMainPlanForHeatNo", new object[] { MainPlan }, this.ob);
- GridEdit(dtMP); //轧制计划信息
- if (temprefur != null)
- {
- RefurRs.FirstInTemp = temprefur.FirstInTemp;
- RefurRs.FirstOutTemp = temprefur.FirstOutTemp;
- RefurRs.LastInTemp = temprefur.LastInTemp;
- RefurRs.LastOutTemp = temprefur.LastOutTemp;
- RefurRs.ProcessRoute = temprefur.ProcessRoute;
- RefurRs.SetFurTemp = temprefur.SetFurTemp;
- RefurRs.TransferRhythm = temprefur.TransferRhythm;
- RefurRs.SteppingRhythm = temprefur.SteppingRhythm;
- RefurRs.BeginRollingTemp = temprefur.BeginRollingTemp;
- //加一段温度
- RefurRs.LheatCruve1 = temprefur.LheatCruve1;
- //加二段温度
- RefurRs.LheatCruve2 = temprefur.LheatCruve2;
- //加三段温度
- RefurRs.LheatCruve3 = temprefur.LheatCruve3;
- //加四段温度
- RefurRs.LheatCruve4 = temprefur.LheatCruve4;
- //加五段温度
- RefurRs.LheatCruve5 = temprefur.LheatCruve5;
- //加六段温度
- RefurRs.LheatCruve6 = temprefur.LheatCruve6;
- //加七段温度
- RefurRs.LheatCruve7 = temprefur.LheatCruve7;
- //加八段温度
- RefurRs.LheatCruve8 = temprefur.LheatCruve8;
- //炉温
- RefurRs.FurPress = temprefur.FurPress;
- //风压
- RefurRs.WindPress = temprefur.WindPress;
- //天然气压力
- RefurRs.GasPress = temprefur.GasPress;
- }
- //DataTable dtBR = ServerHelper.GetData("com.steering.mes.zgmil.coup.FurResult.getBurnningRate", new object[] { PlineCode }, this.ob);
- //if (dtBR.Rows.Count > 0)
- //{
- // RefurRs.Burningrate = dtBR.Rows[0][0].ToString();
- //}
- string stoveNo = dtMP.Rows[0]["STOVE_NO"].ToString();//熔炼炉号
- string lotNo = dtMP.Rows[0]["LOT_NO"].ToString();//生产批号
- string factoryId = dtMP.Rows[0]["PLINE_CODE"].ToString();//产线
- RefurRs.JudgeStoveNo = HeatNo;
- RefurRs.StoveNo = stoveNo;
- RefurRs.LotNo = lotNo;
- RefurRs.PlineCode = factoryId;
- RefurRs.ColUser = this.UserInfo.GetUserName();
- RefurRs.ColShift = this.UserInfo.GetUserOrder();
- RefurRs.ColGroup = this.UserInfo.GetUserGroup();
- DateTime SeverTime = NativeMethod.GetSeverTime(this.ob);
- string Time = SeverTime.AddMinutes(1).ToString("yyyy-MM-dd HH:mm:ss");
- RefurRs.StartTime = Time;
- RefurRs.FirstInTime = Time;
- RefurRs.ResultNo = ResultNo;
- RefurRs.NodeFurFlag = "0";
- RefurRs.ProPlanId = proPlanId;
- RefurRs.GxPlanNo = gxPlanNo;
- //if (MessageUtil.ShowYesNoAndQuestion("确认炉号【" + HeatNo + "】开始入炉?") == DialogResult.No)
- //{
- // return;
- //}
- //修改主计划状态、新增再加热实绩
- int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.FrmReFurResult.insertResultForMainPlan", new object[] { RefurRs }, this.ob);
- //往跟踪记录表插入开始时间
- NativeMethodNew na = new NativeMethodNew(this.ob);
- na.InsertSTAferDoubleClick(RefurRs.JudgeStoveNo.ToString(), 4, "0", proPlanId, gxPlanNo);
- //查询主表记录
- DataTable dt1 = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getSingleMainPlan", new object[] { QueryMainPlan, 5 }, this.ob);
- GridHelper.CopyDataToDatatable(ref dt1, ref dtPlan, true);
- ChangeCellName();
- // ultraGridPlan.DisplayLayout.Bands[0].PerformAutoResizeColumns(true, PerformAutoSizeType.AllRowsInBand);
- foreach (UltraGridRow ugr1 in this.ultraGridPlan.Rows)
- {
- ugr1.Cells["JUDGE_NO"].Value = BaseMethod.getJudgeStoveNo(ugr1.Cells["JUDGE_STOVE_NO"].Value.ToString());
- //if (ugr1.Cells["JUDGE_STOVE_NO"].Value.ToString() == HeatNo)
- //{
- // ultraGridPlan.ActiveRow = ugr1;
- //}
- }
- }
- ChangeGridColor();
- PlanQuery();
- RackQuery(HeatNo);
- }
- }
- /// <summary>
- /// 开始回退
- /// </summary>
- private void StartBack()
- {
- if (ActiveUgr == null)
- {
- return;
- }
- else
- {
- UltraGridRow ugr = ActiveUgr;
- string JudgeStoveNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
- string ResultNo = ugr.Cells["ID"].Value.ToString();
- string StartStatus = ugr.Cells["IS_START"].Value.ToString();
- if (StartStatus == "已完成出炉")
- {
- MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】已结炉,不能入炉回退!!!!");
- return;
- }
- if (StartStatus == "未开始入炉")
- {
- MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】未开始入炉,不能入炉回退!!!!");
- return;
- }
- //NativeMethodNew nvw = new NativeMethodNew(this.ob);
- //if (nvw.isBegineNode(JudgeStoveNo, 5))
- //{
- // MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】已开始定径,不能开始回退!!!!");
- // return;
- //}
- int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.FeedSawResult.startBack", new object[] { JudgeStoveNo, ResultNo, 4, PlineCode, proPlanId, gxPlanNo }, this.ob);
- ChangeGridColor();
- PlanQuery();
-
- }
- }
- /// <summary>
- /// 保存
- /// </summary>
- private void FeedRowSave()
- {
- if (ActiveUgr == null)
- {
- return;
- }
- int count = 0;
- try
- {
- reFurResult1.UltraGrid2.UpdateData();
- }
- catch (Exception e)
- {
- MessageBox.Show("请输入正确的时间。");
- return;
- }
- UltraGridRow ugrg = this.reFurResult1.UltraGrid2.Rows[0];
- string heatNo = null;
- this.reFurResult1.UltraGrid2.UpdateData();
- RefurRs.Clear();//清空公共类
- if (this.ActiveUgr == null && ActiveJUDGE_STOVE_NO == null)
- {
- MessageBox.Show("未选择任何炉号,请选择炉号后进行保存操作。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- if (this.ActiveUgr == null)
- {
- RefurRs.JudgeStoveNo = ActiveJUDGE_STOVE_NO;
- }
- else
- {
- heatNo = ActiveUgr.Cells["JUDGE_STOVE_NO"].Text.ToString().Trim();
- RefurRs.JudgeStoveNo = heatNo;
- }
- if (ActiveStatus == "未开始入炉")
- {
- MessageBox.Show("炉号:【" + BaseMethod.getJudgeStoveNo(RefurRs.JudgeStoveNo.ToString()) + "】未开始进行入炉或,不允许进行保存操作!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- //if (ActiveStatus == "已完成再加热")
- //{
- // MessageBox.Show("炉号:【" + RefurRs.JudgeStoveNo + "】已完成再加热,不允许进行保存操作!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- // return;
- //}
- //if (MessageUtil.ShowYesNoAndQuestion("确认炉号【" + RefurRs.JudgeStoveNo + "】保存实绩?") == DialogResult.No)
- //{
- // return;
- //}
- DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmRollingRPipeResult.resultQuery", new object[] { heatNo, proPlanId, gxPlanNo }, this.ob);
- if (dt.Rows.Count > 0)//如果上一工序结炉则计算出来料支数等数据
- {
- if (dt.Rows[0]["NODE_FUR_FLAG"].ToString() == "1")
- {
- if (!string.IsNullOrEmpty(this.rollingCard1.UltraGrid4.Rows[0].Cells["QualifiedNum5"].Text.ToString().Trim()))//来料支数
- {
- //来料支数
- this.RefurRs.InFurNum = this.rollingCard1.UltraGrid4.Rows[0].Cells["QualifiedNum5"].Text.ToString().Trim();
- if (!string.IsNullOrEmpty(this.reFurResult1.UltraGrid2.ActiveRow.Cells["ScrapNum"].Text.ToString()))
- {
- //剔废支数
- RefurRs.ScrapNum = this.reFurResult1.UltraGrid2.ActiveRow.Cells["ScrapNum"].Text.ToString();
- //出炉支数
- this.RefurRs.OutFurNum = int.Parse(RefurRs.InFurNum.ToString()) - int.Parse(RefurRs.ScrapNum.ToString());
- }
- else
- {
- RefurRs.ScrapNum = "0";
- RefurRs.OutFurNum = RefurRs.InFurNum.ToString();
- }
- }
- }
- }
- //RefurRs.InFurNum = ugrg.Cells["InRefurNum"].Value.ToString().Trim();
- //RefurRs.ScrapNum = ugrg.Cells["ScrapNum"].Value.ToString().Trim();
- //RefurRs.OutFurNum =( int.Parse(RefurRs.InFurNum.ToString()) - int.Parse(RefurRs.ScrapNum.ToString())).ToString();
- RefurRs.Changeclassnum = ugrg.Cells["ChangeClassNum"].Value.ToString().Trim().Trim('_');//交接班支数限制问题?
- RefurRs.Remark = ugrg.Cells["Remark"].Text.ToString().Trim().Trim('_');
- RefurRs.ProcessRoute = ugrg.Cells["ProcessRoute"].Value.ToString().Trim().Trim('_');
- RefurRs.SetFurTemp = ugrg.Cells["SetFURTemp"].Value.ToString().Trim().Trim('_');
- RefurRs.SteppingRhythm = ugrg.Cells["SteppingRhythm"].Text.ToString().Trim().Trim('_');
- if (RefurRs.SteppingRhythm.ToString() == ".")
- {
- RefurRs.SteppingRhythm = "";
- }
- RefurRs.TransferRhythm = ugrg.Cells["TransferRhythm"].Value.ToString().Trim().Trim('_');
- if (RefurRs.TransferRhythm.ToString() == ".")
- {
- RefurRs.TransferRhythm = "";
- }
- RefurRs.ActualLengthOfWastePipe = ugrg.Cells["PipeSize"].Value.ToString().Trim().Trim('_');
- RefurRs.FirstInTemp = ugrg.Cells["FirstInTemp"].Value.ToString().Trim().Trim('_');
- RefurRs.FirstOutTemp = ugrg.Cells["FirstOutTemp"].Value.ToString().Trim().Trim('_');
- RefurRs.FirstInTime = ugrg.Cells["FirstInTime"].Value.ToString().Trim().Trim('_');
- RefurRs.LastInTime = ugrg.Cells["LastInTime"].Value.ToString().Trim().Trim('_');
- RefurRs.Burningrate = ugrg.Cells["BurningRate"].Value.ToString().Trim().Trim('_');
- RefurRs.LastInTemp = ugrg.Cells["LastInTemp"].Value.ToString().Trim().Trim('_');
- RefurRs.LastOutTemp = ugrg.Cells["LastOutTemp"].Value.ToString().Trim().Trim('_');
- RefurRs.StartTime = ugrg.Cells["FirstInTime"].Value.ToString().Trim().Trim('_');
- RefurRs.OutChangeNum = ugrg.Cells["OUT_CHANGE_NUM"].Value.ToString().Trim().Trim('_');
- RefurRs.LastOutTime = ugrg.Cells["LastOutTime"].Value.ToString().Trim().Trim('_');
- RefurRs.FirstOutTime = ugrg.Cells["FirstOutTime"].Value.ToString().Trim().Trim('_');
- RefurRs.StartTime = ugrg.Cells["FirstInTime"].Value.ToString().Trim().Trim('_');
- RefurRs.EndTime = ugrg.Cells["LastOutTime"].Value.ToString().Trim().Trim('_');
- //RefurRs.LastOutTime = ugrg.Cells["LastOutTime"].Value.ToString().Trim();
- //RefurRs.ColUser = this.UserInfo.GetUserName();
- //RefurRs.ColShift = this.UserInfo.GetUserOrder();
- //RefurRs.ColGroup = this.UserInfo.GetUserGroup();
- // RefurRs.JudgeStoveNo = heatNo;
- //加一段温度
- RefurRs.LheatCruve1 = getstring(ultraTextEditor16.Text.Trim('_'));
- //加二段温度
- RefurRs.LheatCruve2 = getstring(ultraTextEditor1.Text.Trim('_'));
- //加三段温度
- RefurRs.LheatCruve3 = getstring(ultraTextEditor10.Text.Trim('_'));
- //加四段温度
- RefurRs.LheatCruve4 = getstring(ultraTextEditor11.Text.Trim('_'));
- //加五段温度
- RefurRs.LheatCruve5 = getstring(ultraTextEditor12.Text.Trim('_'));
- //加六段温度
- RefurRs.LheatCruve6 = getstring(ultraTextEditor13.Text.Trim('_'));
- //加七段温度
- RefurRs.LheatCruve7 = getstring(ultraTextEditor14.Text.Trim('_'));
- //加八段温度
- RefurRs.LheatCruve8 = getstring(ultraTextEditor15.Text.Trim('_'));
- //炉温
- RefurRs.FurPress = getstring(ultraTextEditor19.Text.Trim('_'));
- //风压
- RefurRs.WindPress = getstring(ultraTextEditor18.Text.Trim('_'));
- //天然气压力
- RefurRs.GasPress = getstring(ultraTextEditor17.Text.Trim('_'));
- //残氧量
- RefurRs.ResidualOxygen = "0";
- RefurRs.ProPlanId = proPlanId;
- RefurRs.GxPlanNo = gxPlanNo;
- //if (RefurRs.Changeclassnum.ToString() == "")
- //{
- // RefurRs.Changeclassnum = "0";
- //}
- //if (int.Parse(RefurRs.Changeclassnum.ToString()) - int.Parse(RefurRs.InFurNum.ToString()) > 0)
- //{
- // MessageBox.Show("交接班支数不允许大于入炉支数!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- // return;
- //}
- if (string.IsNullOrEmpty(RefurRs.FirstInTime.ToString()))
- {
- MessageBox.Show("第一支入炉时间不能为空,请输入正确的第一支入炉时间");
- return;
- }
- //查询结炉状态,已结炉的计划 结炉时间不能为空
- DataTable dt1 = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getNodeStatus", new object[] { ActiveJUDGE_STOVE_NO, ActiveResultNo, proPlanId, gxPlanNo }, this.ob);
- if (int.Parse(dt1.Rows[0][0].ToString()) > 49)
- {
- if (string.IsNullOrEmpty(RefurRs.LastOutTime.ToString()))
- {
- MessageBox.Show("最后一支出炉时间不能为空,请输入正确的最后一支出炉时间时间");
- return;
- }
- }
- count = ServerHelper.SetData("com.steering.mes.zgmil.coup.FrmReFurResult.resultSave", new object[] { RefurRs }, this.ob);
- if (count > 0)
- {
- MessageBox.Show("再入炉实绩保存完成!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
- }
- this.reFurResult1.IsCellSelect = false;
- temprefur = NativeMethod.GetEntityToEntity(temprefur, RefurRs);//当前实绩备份
- ChangeGridColor();
- PlanQuery();
- RackQuery(ActiveJUDGE_STOVE_NO);
- }
- /// <summary>
- /// 结炉
- /// </summary>
- private void FeedSawResultNode()
- {
- FeedRowSave();
- try
- {
- reFurResult1.UltraGrid2.UpdateData();
- }
- catch (Exception e)
- {
- MessageBox.Show("请输入正确的时间。");
- return;
- }
- HOTMethod hm = new HOTMethod(this.ob);
- if (ActiveUgr == null)
- {
- return;
- }
- int count = 0;
- RefurRs.Clear();
- UltraGridRow ugrg = this.reFurResult1.UltraGrid2.Rows[0];
- this.reFurResult1.UltraGrid2.UpdateData();
- string heatNo = ActiveUgr.Cells["JUDGE_STOVE_NO"].Text.ToString().Trim();
- this.RefurRs.JudgeStoveNo = heatNo;
- this.RollingRs.JudgeStoveNo = heatNo;
- string Status = ActiveUgr.Cells["IS_START"].Value.ToString2();
- string ResultNo = ActiveUgr.Cells["ID"].Value.ToString2();
- string proPlanId = ActiveUgr.Cells["PRO_PLAN_ID"].Value.ToString();
- string gxPlanNo = ActiveUgr.Cells["GX_PLAN_NO"].Value.ToString();
- //判断是否有重复剔除的坯子
- foreach (UltraGridRow ugr4 in ultraGrid1.Rows)
- {
- if (ugr4.Cells["MAT_NO"].Value.ToString().Equals("") && ugr4.Cells["STATUS"].Value.ToString().Equals("剔除"))
- {
- MessageBox.Show("不存在序号第【" + ugr4.Cells["SEQ"].Value.ToString() + "】的坯子,它已被其它工序剔除,不能再次剔除", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- }
- if (ActiveStatus == "未开始入炉")
- {
- MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(heatNo) + "】未开始入炉,不允许结炉!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- if (ActiveStatus == "已完成出炉")
- {
- MessageBox.Show("炉号:【" + BaseMethod.getJudgeStoveNo(heatNo) + "】已出炉,不允许进行结炉操作!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- if (MessageUtil.ShowYesNoAndQuestion("确认炉号【" + BaseMethod.getJudgeStoveNo(heatNo) + "】结炉?") == DialogResult.No)
- {
- return;
- }
- DataTable dtFurResult1 = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmReFurResult.getRefurResult", new object[] { heatNo, proPlanId, gxPlanNo }, this.ob);
- if (dtFurResult1.Rows.Count > 0)
- {
- if (string.IsNullOrEmpty(dtFurResult1.Rows[0]["FIRST_OUT_TIME"].ToString()))
- {
- MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(ActiveJUDGE_STOVE_NO) + "】未出炉,不能结炉。");
- return;
- }
- if (string.IsNullOrEmpty(dtFurResult1.Rows[0]["LAST_IN_TIME"].ToString()))
- {
- MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(ActiveJUDGE_STOVE_NO) + "】最后一支未入炉,不能结炉。");
- return;
- }
- }
- else
- {
- MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(ActiveJUDGE_STOVE_NO) + "】未入炉,不能结炉。");
- return;
- }
- string BackPlanFlag = ""; //返线计划标识(5--荒管组炉的炉号)
- DataTable dtBackPlanFlag = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmReFurResult.getMilPlanFalg", new object[] { heatNo, PlineCode, proPlanId, gxPlanNo }, this.ob);
- if (dtBackPlanFlag.Rows.Count > 0)
- {
- BackPlanFlag = dtBackPlanFlag.Rows[0]["BACK_PLAN_FLAG"].ToString();
- }
- if (BackPlanFlag != "5")
- {
- //查询上一炉的实绩
- DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmRollingRPipeResult.resultQuery", new object[] { heatNo, proPlanId, gxPlanNo }, this.ob);
- if (dt.Rows.Count == 0)
- {
- MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(heatNo) + "】上个工序未开始,不允许结炉!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- if (dt.Rows[0]["NODE_FUR_FLAG"].ToString() != "1")
- {
- MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(heatNo) + "】上个工序未结炉,不允许结炉!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- }
-
- if (hm.NodeGetWaitChangeMat(heatNo, ResultNo, 4) > 0)
- {
- MessageBox.Show("管号【" + hm.NodeGetWaitChangeMat(heatNo, ResultNo, 4) + "】未接班确认,不能结炉");
- return;
- }
- RefurRs.ScrapNum = "0";
- //查询本道工序剔除支数
- DataTable dtScrapNum = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getScrapNum", new object[] { heatNo, ResultNo, 4, PlineCode, proPlanId, gxPlanNo }, this.ob);
- if (dtScrapNum.Rows.Count > 0)
- {
- if (!string.IsNullOrEmpty(dtScrapNum.Rows[0][0].ToString()))
- {
- RefurRs.ScrapNum = dtScrapNum.Rows[0][0].ToString();
- }
- }
- //查询上个工序合格支数
- DataTable dtQANum = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getQANumBefore", new object[] { heatNo, ResultNo, 4, PlineCode, proPlanId, gxPlanNo }, this.ob);
- //入炉支数
- if (dtQANum.Rows.Count > 0)
- {
- RefurRs.InFurNum = dtQANum.Rows[0][0];
- NativeMethodNew na = new NativeMethodNew(this.ob);
- if (int.Parse(RefurRs.InFurNum.ToString()) - na.GetSlabNum(heatNo, proPlanId, gxPlanNo, 4, this.ob) < 0)
- {
- //MessageBox.Show("存在上一道工序已经剔除的管坯在本道工序也剔除了,请回退后再进行结炉操作", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- //return;
- }
- }
- else
- {
- RefurRs.InFurNum = "0";
- }
- //出炉支数
- int InNum = int.Parse(RefurRs.InFurNum.ToString());
- int ScrapNum = int.Parse(RefurRs.ScrapNum.ToString());
- RefurRs.OutFurNum = (InNum - ScrapNum).ToString();
- RefurRs.Changeclassnum = ugrg.Cells["ChangeClassNum"].Value.ToString().Trim().Trim('_');//交接班支数限制问题?
- RefurRs.Remark = ugrg.Cells["Remark"].Text.ToString().Trim().Trim('_');
- RefurRs.ProcessRoute = ugrg.Cells["ProcessRoute"].Value.ToString().Trim().Trim('_');
- RefurRs.SetFurTemp = ugrg.Cells["SetFURTemp"].Value.ToString().Trim().Trim('_');
- RefurRs.SteppingRhythm = ugrg.Cells["SteppingRhythm"].Text.ToString().Trim().Trim('_');
- if (RefurRs.SteppingRhythm.ToString() == ".")
- {
- RefurRs.SteppingRhythm = "";
- }
- RefurRs.TransferRhythm = ugrg.Cells["TransferRhythm"].Value.ToString().Trim().Trim('_');
- if (RefurRs.TransferRhythm.ToString() == ".")
- {
- RefurRs.TransferRhythm = "";
- }
- RefurRs.ActualLengthOfWastePipe = ugrg.Cells["PipeSize"].Value.ToString().Trim().Trim('_');
- RefurRs.FirstInTemp = ugrg.Cells["FirstInTemp"].Value.ToString().Trim().Trim('_');
- RefurRs.FirstOutTemp = ugrg.Cells["FirstOutTemp"].Value.ToString().Trim().Trim('_');
- RefurRs.FirstInTime = ugrg.Cells["FirstInTime"].Value.ToString().Trim().Trim('_');
- RefurRs.LastInTime = ugrg.Cells["LastInTime"].Value.ToString().Trim().Trim('_');
- RefurRs.Burningrate = ugrg.Cells["BurningRate"].Value.ToString().Trim().Trim('_');
- RefurRs.LastInTemp = ugrg.Cells["LastInTemp"].Value.ToString().Trim().Trim('_');
- RefurRs.LastOutTemp = ugrg.Cells["LastOutTemp"].Value.ToString().Trim().Trim('_');
- RefurRs.StartTime = ugrg.Cells["FirstInTime"].Value.ToString().Trim().Trim('_');
- RefurRs.EndTime = ugrg.Cells["LastOutTime"].Value.ToString().Trim().Trim('_');
- RefurRs.OutChangeNum = ugrg.Cells["OUT_CHANGE_NUM"].Value.ToString().Trim().Trim('_');
- RefurRs.LastOutTime = ugrg.Cells["LastOutTime"].Value.ToString().Trim().Trim('_');
- RefurRs.FirstOutTime = ugrg.Cells["FirstOutTime"].Value.ToString().Trim().Trim('_');
- //RefurRs.LastOutTime = ugrg.Cells["LastOutTime"].Value.ToString().Trim().Trim('_');
- RefurRs.ColUser = _UserName;
- RefurRs.UserId = _UserID;
- RefurRs.ColShift = this.UserInfo.GetUserOrder();
- RefurRs.ColGroup = this.UserInfo.GetUserGroup();
- RefurRs.JudgeStoveNo = heatNo;
- RefurRs.UserId = _UserID;
- //加一段温度
- RefurRs.LheatCruve1 = getstring(ultraTextEditor16.Text.Trim('_'));
- //加二段温度
- RefurRs.LheatCruve2 = getstring(ultraTextEditor1.Text.Trim('_'));
- //加三段温度
- RefurRs.LheatCruve3 = getstring(ultraTextEditor10.Text.Trim('_'));
- //加四段温度
- RefurRs.LheatCruve4 = getstring(ultraTextEditor11.Text.Trim('_'));
- //加五段温度
- RefurRs.LheatCruve5 = getstring(ultraTextEditor12.Text.Trim('_'));
- //加六段温度
- RefurRs.LheatCruve6 = getstring(ultraTextEditor13.Text.Trim('_'));
- //加七段温度
- RefurRs.LheatCruve7 = getstring(ultraTextEditor14.Text.Trim('_'));
- //加八段温度
- RefurRs.LheatCruve8 = getstring(ultraTextEditor15.Text.Trim('_'));
- //炉温
- RefurRs.FurPress = getstring(ultraTextEditor19.Text.Trim('_'));
- //风压
- RefurRs.WindPress = getstring(ultraTextEditor18.Text.Trim('_'));
- //天然气压力
- RefurRs.GasPress = getstring(ultraTextEditor17.Text.Trim('_'));
- //合格吨
- double DBHeight = 0;
- double BurnningRate = 0;
- double DBNum = 1;
- //烧损率
- if (string.IsNullOrEmpty(ugrg.Cells["BurningRate"].Value.ToString()))
- {
- RefurRs.Burningrate = "2.0";
- }
- else
- {
- RefurRs.Burningrate = ugrg.Cells["BurningRate"].Value.ToString();
- }
- DataTable dtDBH = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getDbHeight", new object[] { heatNo, ResultNo, proPlanId, gxPlanNo }, this.ob);
- if (dtDBH.Rows.Count > 0)
- {
- if (!string.IsNullOrEmpty(dtDBH.Rows[0]["DB_HEIGHT"].ToString()))
- {
- DBHeight = double.Parse(dtDBH.Rows[0]["DB_HEIGHT"].ToString());
- }
- if (!string.IsNullOrEmpty(dtDBH.Rows[0]["BURNNING_RATE"].ToString()))
- {
- BurnningRate = double.Parse(dtDBH.Rows[0]["BURNNING_RATE"].ToString());
- }
- if (!string.IsNullOrEmpty(dtDBH.Rows[0]["DB_NUM"].ToString()))
- {
- DBNum = double.Parse(dtDBH.Rows[0]["DB_NUM"].ToString());
- }
- }
- RefurRs.QaTon = DBHeight * (1 - (BurnningRate / 100)) * (1 - (double.Parse(BurnningRate.ToString()) / 100)) * double.Parse(RefurRs.OutFurNum.ToString());
- //残氧量
- RefurRs.ResidualOxygen = "";
- RefurRs.NodeFurFlag = "1";//结炉标识
- RefurRs.ProPlanId = proPlanId;
- RefurRs.GxPlanNo = gxPlanNo;
- RefurRs.JudgeStoveNo = ActiveJUDGE_STOVE_NO;
- RefurRs.LotNo = lotNo;
- RefurRs.PlineCode = PlineCode;
- //写进程表
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.zgmil.coup.FurResult";
- ccp.MethodName = "updateMilSlab";
- ccp.ServerParams = new object[] { heatNo, "5", proPlanId, gxPlanNo };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("修改成功!"))
- {
- ccp.ServerName = "com.steering.mes.zgmil.coup.FurResult";
- ccp.MethodName = "updateProcess";
- ccp.ServerParams = new object[] { heatNo, "5", "5", proPlanId, gxPlanNo, lotNo, PlineCode };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("修改成功!"))
- {
- if (count == 0)
- {
- count = ServerHelper.SetData("com.steering.mes.zgmil.coup.FrmReFurResult.endStoveForMainPlan", new object[] { RefurRs, heatNo, PlineCode, _UserName, Shift, Group }, this.ob);
- if (count > 0)
- {
- count = ServerHelper.SetData("com.steering.mes.zgmil.coup.FeedSawResult.scrapNodeMat", new object[] { heatNo, 5, 0, PlineCode, proPlanId, gxPlanNo }, this.ob);
- if (count > 0)
- {
- //count = ServerHelper.SetData("com.steering.mes.zgmil.coup.FrmReFurResult.insertFurnacesReslut", new object[] { heatNo, PlineCode, _UserName, Shift, Group }, this.ob);
- //if (count == 0)
- //{
- MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(heatNo) + "】结炉完成!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
- NativeMethodNew na = new NativeMethodNew(this.ob);
- //na.InsertSTAferDoubleClick(heatNo, 4, "1", proPlanId, gxPlanNo);
- NativeMethod.CheckNodeMatStatus(heatNo, proPlanId, gxPlanNo, 4, this.ob);
- PlanQuery();
- GetRollingCard(heatNo);
- this.reFurResult1.IsCellSelect = false;
- //}
- }
- }
- }
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- }
-
- ChangeGridColor();
- PlanQuery();
- RackQuery(heatNo);
- }
- /// <summary>
- /// 结炉回退
- /// </summary>
- private void NodeBack()
- {
- if (ActiveUgr == null)
- {
- return;
- }
- UltraGridRow ugr = ActiveUgr;
- string JudgeStoveNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
- string ResultNo = ugr.Cells["ID"].Value.ToString();
- string NodeFlag = ugr.Cells["IS_START"].Value.ToString();
- if (NodeFlag != "已完成出炉")
- {
- MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】未结炉,不能结炉回退!!!!");
- return;
- }
- //查询结炉班次班组
- DataTable dtNodeGroup = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.doNodeBackCheck", new object[] { JudgeStoveNo, ResultNo, 4, proPlanId, gxPlanNo }, this.ob);
- if (dtNodeGroup.Rows.Count > 0)
- {
- string NodeShift = dtNodeGroup.Rows[0][0].ToString();
- string NodeGroup = dtNodeGroup.Rows[0][1].ToString();
- if (Shift == NodeShift && Group == NodeGroup)
- {
- }
- else
- {
- switch (NodeShift)
- {
- case "0":
- NodeShift = "白班";
- break;
- case "1":
- NodeShift = "早班";
- break;
- case "2":
- NodeShift = "中班";
- break;
- case "3":
- NodeShift = "夜班";
- break;
- }
- switch (NodeGroup)
- {
- case "1":
- NodeGroup = "甲班";
- break;
- case "2":
- NodeGroup = "乙班";
- break;
- case "3":
- NodeGroup = "丙班";
- break;
- case "4":
- NodeGroup = "丁班";
- break;
- }
- switch (this.UserInfo.GetUserOrder())
- {
- case "0":
- Shift = "白班";
- break;
- case "1":
- Shift = "早班";
- break;
- case "2":
- Shift = "中班";
- break;
- case "3":
- Shift = "夜班";
- break;
- }
- switch (this.UserInfo.GetUserGroup())
- {
- case "1":
- Group = "甲班";
- break;
- case "2":
- Group = "乙班";
- break;
- case "3":
- Group = "丙班";
- break;
- case "4":
- Group = "丁班";
- break;
- }
- // MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】已由" + NodeGroup + "," + NodeShift + "结炉,当班不能结炉回退");
- }
- }
- DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.doNodeBackCheck", new object[] { JudgeStoveNo, ResultNo, proPlanId, gxPlanNo }, this.ob);
- if (dt.Rows.Count > 0)
- {
- string NodeProcess = ""; //当前炉次结炉工序
- string NodeStatus = dt.Rows[0][0].ToString();
- switch (NodeStatus)
- {
- case "30":
- NodeProcess = "穿孔";
- break;
- case "40":
- NodeProcess = "连轧";
- break;
- case "50":
- NodeProcess = "再加热炉";
- break;
- case "60":
- NodeProcess = "定径";
- break;
- case "70":
- NodeProcess = "分切";
- break;
- case "80":
- NodeProcess = "矫直";
- break;
- case "90":
- NodeProcess = "探伤";
- break;
- case "96":
- NodeProcess = "质检";
- break;
- }
- if (NodeStatus != "50")
- {
- MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】 " + NodeProcess + "工序已结炉,当前工序不能结炉回退");
- return;
- }
- }
- //判断当前炉次下道工序是否结炉 下道工序结炉 - 不允许回退
- //查询当前炉次是否有交班点
- int Seq = 0; //入炉交班序号
- int OutSeq = 0; //出炉交班序号
- DataTable dt1 = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.changeFlagQuery", new object[] { JudgeStoveNo, ResultNo, 4, proPlanId, gxPlanNo }, this.ob);
- if (dt1.Rows.Count > 0)
- {
- for (int i = 0; i < dt1.Rows.Count; i++)
- {
- if (dt1.Rows[i]["IN_CHANGE_FLAG"].ToString() == "1")
- {
- Seq = int.Parse(dt1.Rows[i][0].ToString());
- }
- if (dt1.Rows[i]["OUT_CHANGE_FLAG"].ToString() == "1")
- {
- OutSeq = int.Parse(dt1.Rows[i][0].ToString());
- }
- }
- }
- //查询当前炉次最后一支是否入炉
- DataTable dtFurResult1 = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmReFurResult.getRefurResult", new object[] { ActiveJUDGE_STOVE_NO, proPlanId, gxPlanNo }, this.ob);
- if (dtFurResult1.Rows.Count > 0)
- {
- if (!string.IsNullOrEmpty(dtFurResult1.Rows[0]["LAST_IN_TIME"].ToString()))
- {
- Seq = ultraGrid1.Rows.Count;
- }
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.zgmil.coup.FrmReFurResult";
- ccp.MethodName = "deleteFurnacesReslut";
- ccp.ServerParams = new object[] { JudgeStoveNo, PlineCode, proPlanId, gxPlanNo };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- //int count1 = ServerHelper.SetData("com.steering.mes.zgmil.coup.FrmReFurResult.deleteFurnacesReslut", new object[] { JudgeStoveNo, PlineCode }, this.ob);
- if (ccp.ReturnInfo.Equals("荒管剔除成功!"))
- {
- int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.FeedSawResult.nodeBack", new object[] { JudgeStoveNo, ResultNo, 4, PlineCode, Seq, OutSeq, 5, proPlanId, gxPlanNo, lotNo }, this.ob);
- }
- else {
- //MessageUtil.ShowTips(ccp.ReturnInfo);
- MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】已经荒管组炉,不可以结炉回退!");
- }
-
- ChangeGridColor();
- PlanQuery();
- RackQuery(JudgeStoveNo);
- }
- /// <summary>
- /// 毛管剔除
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ultraGrid1_ClickCellButton(object sender, CellEventArgs e)
- {
- if (ActiveUgr == null)
- {
- return;
- }
- HOTMethod hm = new HOTMethod(this.ob);
- DataTable dt = new DataTable();
- int scrapNum = 0;
- int count = 0;
- string heatNo = ultraGrid1.ActiveRow.Cells["JUDGE_STOVE_NO"].Text.ToString().Trim();
- string seq = ultraGrid1.ActiveRow.Cells["SEQ"].Text.ToString().Trim();
- string MAT_NO = ultraGrid1.ActiveRow.Cells["MAT_NO"].Text.ToString().Trim();
- int Seq = int.Parse(seq);
- string Shift = UserInfo.GetUserOrder();
- string Group = UserInfo.GetUserGroup();
- string User = UserInfo.GetUserName();
- string PlanStatus = ActiveUgr.Cells["IS_START"].Value.ToString();
- if (PlanStatus == "已完成出炉") // -- 修改结炉回退操作时放开
- {
- if (e.Cell.Column.Key == "IN_CHANGE_NUM" || e.Cell.Column.Key == "OUT_CHANGE_NUM")
- {
- MessageBox.Show("炉号:【" + BaseMethod.getJudgeStoveNo(heatNo) + "】已出炉,不允许交班!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- }
- else if (e.Cell.Column.Key == "BTNOUTCHANGECOM" || e.Cell.Column.Key == "BTNINCHANGECOM")
- {
- MessageBox.Show("炉号:【" + BaseMethod.getJudgeStoveNo(heatNo) + "】已出炉,不允许接班!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- }
- else
- {
- MessageBox.Show("炉号:【" + BaseMethod.getJudgeStoveNo(heatNo) + "】已出炉,不允许剔除!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- }
- return;
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.zgmil.coup.FeedSawResult";
- ccp.MethodName = "scrapMatCheck";
- ccp.ServerParams = new object[] { heatNo, 5, proPlanId, gxPlanNo };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- int ScrapNumBefore = Convert.ToInt32(ccp.ReturnInfo);
- if (e.Cell.Column.Key == "DELETE")
- {
- if (this.ultraGrid1.ActiveRow.Cells["STATUS"].Text.ToString().Trim() == "剔除")
- {
- MessageBox.Show("此毛管已被剔除,不可重复剔除!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- if (ultraGrid1.Rows.Count - ScrapNumBefore < int.Parse(seq))
- {
- MessageBox.Show("不存在序号为【" + seq + "】的管号,被其他工序剔除,不能再次剔除!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- DataTable ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.FurResult.selectPortBacthSlample", new object[] { MAT_NO }, ob);
- if (ds.Rows.Count > 0)
- {
- if (MessageUtil.ShowYesNoAndQuestion("此管坯已有被取为样管,是否继续剔除?") == DialogResult.No)
- {
- return;
- }
- }
-
- int i = 0;
- foreach (UltraGridRow uRow in ultraGrid1.Rows)
- {
- if (uRow.Cells["STATUS"].Value.ToString().Equals("正常轧制") && int.Parse(uRow.Cells["SEQ"].Value.ToString3()) > 2)
- {
- i = i + 1;
- }
- }
- if (int.Parse(seq) < 3 && i > 0)
- {
- if (MessageUtil.ShowYesNoAndQuestion("该管坯可能是样管,是否确认剔除。") == DialogResult.No)
- {
- return;
- }
- }
- //管排锯切前判断当前管坯序号是否已剔除
- //DataTable dtSeq = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getScrapSeq", new object[] { heatNo, seq }, this.ob);
- //if (dtSeq.Rows.Count > 0)
- //{
- // MessageBox.Show("不存在序号为【" + seq + "】的管号,已在【" + dtSeq.Rows[0][0].ToString() + "】剔除,不能再次剔除!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- // return;
- //}
- RefurRs.JudgeStoveNo = heatNo;
- RefurRs.ProPlanId = proPlanId;
- RefurRs.GxPlanNo = gxPlanNo;
- dt.Clear();
-
- ScrapSeq.Seq = seq;
- ScrapSeq.JudgeStoveNo = heatNo;
- ScrapSeq.ColUser = this.UserInfo.GetUserName();
- ScrapSeq.ColShift = this.UserInfo.GetUserOrder();
- ScrapSeq.ColGroup = this.UserInfo.GetUserGroup();
- ScrapSeq.ProPlanId = proPlanId;
- ScrapSeq.GxPlanNo = gxPlanNo;
- //新增管列序号表
- count = ServerHelper.SetData("com.steering.mes.zgmil.coup.FrmReFurResult.insertScrapSlabSeq", new object[] { ScrapSeq }, this.ob);
- if (count > 0)
- {
- dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmReFurResult.scrapNumQuery", new object[] { RefurRs }, this.ob);
- if (dt.Rows.Count > 0)
- {
- scrapNum = int.Parse(dt.Rows[0]["SCRAP_NUM"].ToString());
- }
- RefurRack.ScrapNum = scrapNum.ToString();
- RefurRack.ColUser = UserInfo.GetUserName();
- RefurRack.ColGroup = UserInfo.GetUserGroup();
- RefurRack.ColShift = UserInfo.GetUserOrder();
- RefurRack.Status = "1";
- RefurRack.JudgeStoveNo = heatNo;
- RefurRack.Seq = seq;
- RefurRack.ProPlanId = proPlanId;
- RefurRack.GxPlanNo = gxPlanNo;
- count = ServerHelper.SetData("com.steering.mes.zgmil.coup.FrmReFurResult.rackDelete", new object[] { RefurRack }, this.ob);
- if (count > 0)
- {
- RackQuery(ActiveJUDGE_STOVE_NO);
- refurResultQuery();
- GetRollingCard();
- }
- }
-
-
-
- }
- if (e.Cell.Column.Key == "DELBACK")
- {
- //if (MessageUtil.ShowYesNoAndQuestion("是否回退该剔除的坯料") == DialogResult.No)
- //{
- // return;
- //}
- if (!this.ultraGrid1.ActiveRow.Cells["STATUS"].Text.ToString().Trim().Equals("剔除"))
- {
- MessageBox.Show("该坯料未被剔除,请确认后重新选择!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- NativeMethodNew na = new NativeMethodNew(this.ob);
- int counts = na.DeleteSlabSeq(heatNo, seq.ToString(), 5, 1, 0, proPlanId, gxPlanNo);
- if (counts > 0)
- {
- // MessageBox.Show("剔料回退成功", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- RackQuery(ActiveJUDGE_STOVE_NO);
- refurResultQuery();
- GetRollingCard();
- }
- else
- {
- MessageBox.Show("剔料回退失败", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- }
- //入炉交班
- if (e.Cell.Column.Key == "IN_CHANGE_NUM")
- {
- //查询是否有最后一只入炉时间
- DataTable dtFurResult1 = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmReFurResult.getRefurResult", new object[] { ActiveJUDGE_STOVE_NO, proPlanId, gxPlanNo }, this.ob);
- if (dtFurResult1.Rows.Count > 0)
- {
- if (!string.IsNullOrEmpty(dtFurResult1.Rows[0]["LAST_IN_TIME"].ToString()))
- {
- MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(ActiveJUDGE_STOVE_NO) + "】已完成入炉,不能入炉交班。");
- return;
- }
- }
- int BeforeChangeNum = 0;
- //查询上个班入炉交班支数
- DataTable dtChangeNum = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getChangeSeq", new object[] { ActiveJUDGE_STOVE_NO, ActiveResultNo, 4, PlineCode, Shift, Group, proPlanId, gxPlanNo }, this.ob);
- if (dtChangeNum.Rows.Count > 0)
- {
- if (!string.IsNullOrEmpty(dtChangeNum.Rows[0][0].ToString()))
- {
- BeforeChangeNum = int.Parse(dtChangeNum.Rows[0][0].ToString());
- }
- }
- if (Seq <= BeforeChangeNum)
- {
- MessageBox.Show("前道班次已交班,该支不能再次交班。");
- return;
- }
- if (Seq > ultraGrid1.Rows.Count - ScrapNumBefore)
- {
- MessageBox.Show("该支已被前道工序剔除,不能在该支交班");
- return;
- }
- int count1 = ServerHelper.SetData("com.steering.mes.zgmil.coup.FeedSawResult.changeNum", new object[] { ActiveJUDGE_STOVE_NO, ActiveResultNo, Seq, BeforeChangeNum, 0, PlineCode, Shift, Group, _UserName, 5, 1, proPlanId, gxPlanNo }, this.ob);
- //hm.UpdateChangeFlag(ActiveJUDGE_STOVE_NO, ActiveResultNo, "", 4, Seq, 0);
- }
- //入炉交班确认
- if (e.Cell.Column.Key == "BTNINCHANGECOM")
- {
- int WaitChangeSeq = hm.GetWaitChangeSeq(ActiveJUDGE_STOVE_NO, ActiveResultNo, "", 4, 0, proPlanId, gxPlanNo);
- if (WaitChangeSeq == 0)
- {
- MessageBox.Show("没有待交班确认的管号。");
- return;
- }
- if (WaitChangeSeq != Seq)
- {
- MessageBox.Show("交班管序号与接班管序号不符,请确认后接班。");
- return;
- }
- if (MessageUtil.ShowYesNoAndQuestion("确认炉号:【" + BaseMethod.getJudgeStoveNo(ActiveJUDGE_STOVE_NO) + "】序号:【" + Seq + "】交班?") == DialogResult.No)
- {
- return;
- }
- // //查询是否有该班接班记录
- DateTime SeverTime = NativeMethod.GetSeverTime(this.ob);
- string Time = SeverTime.ToLongTimeString();
- string StartTime = SeverTime.ToShortDateString() + " 00:00:00";
- string EndTime = SeverTime.AddDays(1).ToShortDateString() + " 00:00:00";
- int BeforeChangeNum = 0;
- //查询上个班入炉交班支数
- DataTable dtChangeNum = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getChangeSeq", new object[] { ActiveJUDGE_STOVE_NO, ActiveResultNo, 4, PlineCode, Shift, Group, proPlanId, gxPlanNo }, this.ob);
- if (dtChangeNum.Rows.Count > 0)
- {
- if (!string.IsNullOrEmpty(dtChangeNum.Rows[0][0].ToString()))
- {
- BeforeChangeNum = int.Parse(dtChangeNum.Rows[0][0].ToString());
- }
- }
- if (Seq <= BeforeChangeNum)
- {
- MessageBox.Show("前道班次已交班,该支不能再次交班。");
- return;
- }
- if (Seq > ultraGrid1.Rows.Count - ScrapNumBefore)
- {
- MessageBox.Show("该支已被前道工序剔除,不能在该支交班");
- return;
- }
- //未登录
- if (!hm.IsChanged(StartTime, EndTime, Shift, Group, "4", PlineCode))
- {
- if (this.DoRelogin(DoCheck))
- {
- //查询上个班入炉交班支数
- DataTable dtChangeNum1 = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getChangeSeq", new object[] { ActiveJUDGE_STOVE_NO, ActiveResultNo, 4, PlineCode, Shift, Group, proPlanId, gxPlanNo }, this.ob);
- if (dtChangeNum1.Rows.Count > 0)
- {
- if (!string.IsNullOrEmpty(dtChangeNum1.Rows[0][0].ToString()))
- {
- BeforeChangeNum = int.Parse(dtChangeNum1.Rows[0][0].ToString());
- }
- }
- // hm.InsertChangeRemuse(Shift, Group, _UserName, "4", PlineCode);
- // string User = UserInfo.GetUserName();
- int count1 = ServerHelper.SetData("com.steering.mes.zgmil.coup.FeedSawResult.changeNum", new object[] { ActiveJUDGE_STOVE_NO, ActiveResultNo, Seq, BeforeChangeNum, 0, PlineCode, Shift, Group, _UserName, 5, 1, proPlanId, gxPlanNo }, this.ob);
- //查询是否有出炉交班但未确认接班的炉号
- DataTable dtOutChange = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.ChangeQueryReFur", new object[] { ActiveJUDGE_STOVE_NO, ActiveResultNo, 1, proPlanId, gxPlanNo }, this.ob);
- {
- if (dtOutChange.Rows.Count > 0)
- {
- string WaitOutFur = dtOutChange.Rows[0][0].ToString();
- MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(WaitOutFur) + "】需要出炉交班确认。");
- }
- }
- }
- }
- else
- {
- //string User = UserInfo.GetUserName();
- DataTable dtChangeNum1 = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getChangeSeq", new object[] { ActiveJUDGE_STOVE_NO, ActiveResultNo, 4, PlineCode, Shift, Group, proPlanId, gxPlanNo }, this.ob);
- if (dtChangeNum1.Rows.Count > 0)
- {
- if (!string.IsNullOrEmpty(dtChangeNum1.Rows[0][0].ToString()))
- {
- BeforeChangeNum = int.Parse(dtChangeNum1.Rows[0][0].ToString());
- }
- }
- int count1 = ServerHelper.SetData("com.steering.mes.zgmil.coup.FeedSawResult.changeNum", new object[] { ActiveJUDGE_STOVE_NO, ActiveResultNo, Seq, BeforeChangeNum, 0, PlineCode, Shift, Group, _UserName, 5, 1, proPlanId, gxPlanNo }, this.ob);
- //查询是否有出炉交班但未确认接班的炉号
- DataTable dtOutChange = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.ChangeQueryReFur", new object[] { ActiveJUDGE_STOVE_NO, ActiveResultNo, 1, proPlanId, gxPlanNo }, this.ob);
- {
- if (dtOutChange.Rows.Count > 0)
- {
- string WaitOutFur = dtOutChange.Rows[0][0].ToString();
- MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(WaitOutFur) + "】需要出炉交班确认。");
- }
- }
- }
- }
- //出炉交班
- if (e.Cell.Column.Key == "OUT_CHANGE_NUM")
- {
- //string Shift = UserInfo.GetUserOrder();
- //string Group = UserInfo.GetUserGroup();
- //string User = UserInfo.GetUserName();
- int BeforeChangeNum = 0;
- //查询上个班出炉交班支数
- DataTable dtChangeNum = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getChangeSeq", new object[] { ActiveJUDGE_STOVE_NO, ActiveResultNo, 4, PlineCode, Shift, Group, proPlanId, gxPlanNo }, this.ob);
- if (dtChangeNum.Rows.Count > 0)
- {
- if (!string.IsNullOrEmpty(dtChangeNum.Rows[1][0].ToString()))
- {
- BeforeChangeNum = int.Parse(dtChangeNum.Rows[1][0].ToString());
- }
- }
- DataTable dtFurResult1 = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmReFurResult.getRefurResult", new object[] { heatNo, proPlanId, gxPlanNo }, this.ob);
- if (dtFurResult1.Rows.Count > 0)
- {
- if (string.IsNullOrEmpty(dtFurResult1.Rows[0]["FIRST_OUT_TIME"].ToString()))
- {
- MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(ActiveJUDGE_STOVE_NO) + "】第一支未出炉,不能交班。");
- return;
- }
- }
- if (Seq <= BeforeChangeNum)
- {
- MessageBox.Show("前道班次已交班,该支不能再次交班。");
- return;
- }
- if (Seq > ultraGrid1.Rows.Count - ScrapNumBefore)
- {
- MessageBox.Show("该支已被前道工序剔除,不能在该支交班");
- return;
- }
- //int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.FeedSawResult.changeNum", new object[] { JudgeStoveNo, ResultNo, Seq, 0, BeforeChangeNum, PlineCode, Shift, Group, _UserName, 2, 2 }, this.ob);
- //ChangeFlag = 1;
- hm.UpdateChangeFlag(ActiveJUDGE_STOVE_NO, ActiveResultNo, "", 4, Seq, 1);
- }
- //出炉交班确认
- if (e.Cell.Column.Key == "BTNOUTCHANGECOM")
- {
- int WaitChangeSeq = hm.GetWaitChangeSeq(ActiveJUDGE_STOVE_NO, ActiveResultNo, "", 4, 1, proPlanId, gxPlanNo);
- if (WaitChangeSeq == 0)
- {
- MessageBox.Show("没有待交班确认的管号。");
- return;
- }
- if (WaitChangeSeq != Seq)
- {
- MessageBox.Show("交班管序号与接班管序号不符,请确认后接班。");
- return;
- }
- if (MessageUtil.ShowYesNoAndQuestion("确认炉号:【" + BaseMethod.getJudgeStoveNo(ActiveJUDGE_STOVE_NO) + "】序号:【" + Seq + "】交班?") == DialogResult.No)
- {
- return;
- }
- int BeforeChangeNum = 0;
- //查询上个班出炉交班支数
- DataTable dtChangeNum = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getChangeSeq", new object[] { ActiveJUDGE_STOVE_NO, ActiveResultNo, 4, PlineCode, Shift, Group, proPlanId, gxPlanNo }, this.ob);
- if (dtChangeNum.Rows.Count > 0)
- {
- if (!string.IsNullOrEmpty(dtChangeNum.Rows[1][0].ToString()))
- {
- BeforeChangeNum = int.Parse(dtChangeNum.Rows[1][0].ToString());
- }
- }
- if (Seq <= BeforeChangeNum)
- {
- MessageBox.Show("前道班次已交班,该支不能再次交班。");
- return;
- }
- if (Seq > ultraGrid1.Rows.Count - ScrapNumBefore)
- {
- MessageBox.Show("该支已被前道工序剔除,不能在该支交班");
- return;
- }
- if (this.DoRelogin(DoCheck))
- {
- //string User = UserInfo.GetUserName();
- //hm.InsertChangeRemuse(Shift, Group, _UserName, "4", PlineCode);
- //查询上个班出炉交班支数
- DataTable dtChangeNum1 = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getChangeSeq", new object[] { ActiveJUDGE_STOVE_NO, ActiveResultNo, 4, PlineCode, Shift, Group, proPlanId, gxPlanNo }, this.ob);
- if (dtChangeNum1.Rows.Count > 0)
- {
- if (!string.IsNullOrEmpty(dtChangeNum1.Rows[1][0].ToString()))
- {
- BeforeChangeNum = int.Parse(dtChangeNum1.Rows[1][0].ToString());
- }
- }
- int count1 = ServerHelper.SetData("com.steering.mes.zgmil.coup.FeedSawResult.changeNum", new object[] { ActiveJUDGE_STOVE_NO, ActiveResultNo, Seq, 0, BeforeChangeNum, PlineCode, Shift, Group, _UserName, 5, 2, proPlanId, gxPlanNo }, this.ob);
- }
- }
- //过渡方法,接班后重登陆初始化导致Grid.Row为null
- if (ultraGridPlan.Rows == null)
- {
- return;
- }
- DataTable dtFurResult2 = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmReFurResult.getRefurResult", new object[] { ActiveJUDGE_STOVE_NO, proPlanId, gxPlanNo }, this.ob);
- GridEditResult(dtFurResult2);
- ChangeGridColor();
- GetRollingCard();//流通卡赋值
- RackQuery(heatNo);
- }
- public string DoCheck(CoreUserInfo User)
- {
- return "";
- }
- /// <summary>
- /// 交班取消
- /// </summary>
- private void ChangeCancel()
- {
- int Flag = 0;
- string JudgeStoveNo = "";
- string Status = "";
- string ResultNo = "";
- UltraGridRow ugr = this.ActiveUgr;
- string Shift = UserInfo.GetUserOrder();
- string Group = UserInfo.GetUserGroup();
- if (ugr != null)
- {
- JudgeStoveNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
- Status = ugr.Cells["IS_START"].Value.ToString();
- ResultNo = ugr.Cells["ID"].Value.ToString();
- if (Status == "未开始入炉")
- {
- MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】还未开始入炉,不能交班取消!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- if (Status == "已完成出炉")
- {
- MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】已完成出炉,不能交班取消!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- //查询最后一支是否入炉
- DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmReFurResult.getRefurResult", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, this.ob);
- if (dt.Rows.Count > 0)
- {
- if (!string.IsNullOrEmpty(dt.Rows[0]["LAST_IN_TIME"].ToString()))
- {
- Flag = 1;
- }
- }
- NativeMethodNew nass = new NativeMethodNew(this.ob);
- nass.ChangeShiftBack(JudgeStoveNo, ResultNo, proPlanId, gxPlanNo, PlineCode, Shift, Group, 4, Flag);
- //查询加热炉实绩信息
- DataTable dtFurResult = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmReFurResult.getRefurResult", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, this.ob);
- if (dtFurResult.Rows.Count > 0)
- {
- GridEditResult(dtFurResult);
- }
- PlanQuery();
- }
- }
- /// <summary>
- /// 点击保存单支出入炉时间
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- public void UltraGrid2_ClickCellButton(object sender, CellEventArgs e)
- {
- DateTime SeverTime = NativeMethod.GetSeverTime(this.ob);
- string Time = SeverTime.ToLongTimeString();
- HOTMethod hm = new HOTMethod(this.ob);
- string temp = "";
- string Shift = UserInfo.GetUserOrder();
- string Group = UserInfo.GetUserGroup();
- if (ActiveUgr == null)
- {
- return;
- }
- string JudgeStoveNo = "";
- string ResultNo = "";
- UltraGridRow ugr = ActiveUgr;
- if (ugr != null)
- {
- JudgeStoveNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
- ResultNo = ugr.Cells["ID"].Value.ToString();
- }
- int count = 0;
- int Flag = 0;
- string Status = ugr.Cells["IS_START"].Value.ToString();
- if (e.Cell.Column.Key != "btnFirstIn")
- {
- if (Status == "未开始入炉")
- {
- MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】还未开始入炉,不能!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- }
- if (Status == "已完成出炉")
- {
- MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】已完成出炉,不能进行操作!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- switch (e.Cell.Column.Key)
- {
- case "btnFirstIn":
- this.reFurResult1.UltraGrid2.Rows[0].Cells["FirstInTime"].Value = Time;
- DoStart();
- Flag = 0;
- temp = temprefur.FirstInTemp.ToString();
- count = ServerHelper.SetData("com.steering.mes.zgmil.coup.FrmReFurResult.updateFurTime", new object[] { JudgeStoveNo, Shift, Group, temp, Flag }, this.ob);
- break;
- case "btnLastIn":
- string BackPlanFlag = ""; //返线计划标识(5--荒管组炉的炉号)
- DataTable dtBackPlanFlag = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmReFurResult.getMilPlanFalg", new object[] { JudgeStoveNo, PlineCode, proPlanId, gxPlanNo }, this.ob);
- if (dtBackPlanFlag.Rows.Count > 0)
- {
- BackPlanFlag = dtBackPlanFlag.Rows[0]["BACK_PLAN_FLAG"].ToString();
- }
- if (BackPlanFlag != "5")
- {
- string NodeFlag = "";
- DataTable dtFlag = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmRollingRPipeResult.resultQuery", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, this.ob);
- if (dtFlag.Rows.Count > 0)
- {
- NodeFlag = dtFlag.Rows[0]["NODE_FUR_FLAG"].ToString();
- }
- else
- {
- MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】还未开始连轧,不能入炉完成!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- if (NodeFlag != "1")
- {
- MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】还未连轧完成,不能入炉完成!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- }
-
- Flag = 1;
- temp = temprefur.LastInTemp.ToString();
- this.reFurResult1.UltraGrid2.Rows[0].Cells["LastInTime"].Value = Time;
- count = ServerHelper.SetData("com.steering.mes.zgmil.coup.FrmReFurResult.updateFurTime", new object[] { JudgeStoveNo, Shift, Group, temp, Flag }, this.ob);
- count = ServerHelper.SetData("com.steering.mes.zgmil.coup.FrmReFurResult.SetInFur", new object[] { JudgeStoveNo, ResultNo, Shift, Group, _UserName }, this.ob);
- break;
- case "btnFirstOut":
- Flag = 2;
- temp = temprefur.FirstOutTemp.ToString();
- DataTable dtIsOut = hm.InFurIsEnd("2", PlineCode, 1);
- if (dtIsOut.Rows.Count > 0)
- {
- MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(dtIsOut.Rows[0][0].ToString()) + "】正在出炉。");
- return;
- }
- this.reFurResult1.UltraGrid2.Rows[0].Cells["FirstOutTime"].Value = Time;
- count = ServerHelper.SetData("com.steering.mes.zgmil.coup.FrmReFurResult.updateFurTime", new object[] { JudgeStoveNo, Shift, Group, temp, Flag }, this.ob);
- break;
- case "btnLastOut":
- Flag = 3;
- FeedSawResultNode();
- temp = temprefur.LastOutTemp.ToString();
- this.reFurResult1.UltraGrid2.Rows[0].Cells["LastOutTime"].Value = Time;
- //count = ServerHelper.SetData("com.steering.mes.zgmil.coup.FrmReFurResult.updateFurTime", new object[] { JudgeStoveNo, Shift, Group, temp, Flag }, this.ob);
- break;
- }
- PlanQuery();
- //刷新实绩界面
- //this.reFurResult1.UpdateData();
- }
- public string getstring(string str)
- {
- string result = "0";
- if (!string.IsNullOrEmpty(str))
- {
- if (str.Contains("_"))
- {
- str = str.Replace("_", "");
- if (str.Equals("."))
- {
- str = "0";
- }
- }
- if (str.Equals("."))
- {
- str = "0";
- }
- result = str;
- }
- return result;
- }
- /// <summary>
- /// 修改IS_START名称
- /// </summary>
- 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;
- // }
- // }
- // }
- //}
- }
- /// <summary>
- /// 变色
- /// </summary>
- private void ChangeGridColor()
- {
- foreach (UltraGridRow ugr in ultraGridPlan.Rows)
- {
- if (ugr.Cells["IS_START"].Value.ToString() == "已完成出炉")
- {
- ugr.Appearance.BackColor = Color.YellowGreen;
- }
- if (ugr.Cells["IS_START"].Value.ToString() == "已开始出炉")
- {
- ugr.Appearance.BackColor = Color.LightGray;
- }
- if (ugr.Cells["IS_START"].Value.ToString() == "已完成入炉")
- {
- ugr.Appearance.BackColor = Color.LightGreen;
- }
- if (ugr.Cells["IS_START"].Value.ToString() == "已开始入炉")
- {
- ugr.Appearance.BackColor = Color.LightGreen;
- }
- }
- foreach (UltraGridRow ugr in ultraGridINFurInfor.Rows)
- {
- if (ugr.Cells["IS_START"].Value.ToString() == "已完成出炉")
- {
- ugr.Appearance.BackColor = Color.YellowGreen;
- }
- if (ugr.Cells["IS_START"].Value.ToString() == "已开始出炉")
- {
- ugr.Appearance.BackColor = Color.LightGray;
- }
- if (ugr.Cells["IS_START"].Value.ToString() == "已完成入炉")
- {
- ugr.Appearance.BackColor = Color.LightGreen;
- }
- if (ugr.Cells["IS_START"].Value.ToString() == "已开始入炉")
- {
- ugr.Appearance.BackColor = Color.LightGreen;
- }
- }
- foreach (UltraGridRow ugr in ultraGridOUTFurInfor.Rows)
- {
- if (ugr.Cells["IS_START"].Value.ToString() == "已完成出炉")
- {
- ugr.Appearance.BackColor = Color.YellowGreen;
- }
- if (ugr.Cells["IS_START"].Value.ToString() == "已开始出炉")
- {
- ugr.Appearance.BackColor = Color.LightGray;
- }
- if (ugr.Cells["IS_START"].Value.ToString() == "已完成入炉")
- {
- ugr.Appearance.BackColor = Color.LightGreen;
- }
- if (ugr.Cells["IS_START"].Value.ToString() == "已开始入炉")
- {
- ugr.Appearance.BackColor = Color.LightGreen;
- }
- }
- foreach (UltraGridRow ugr in ultraGrid1.Rows)
- {
- if (ugr != null)
- {
- switch (ugr.Cells["STATUS"].Value.ToString())
- {
- case "剔除":
- ugr.Appearance.BackColor = Color.Yellow;
- break;
- }
- switch (ugr.Cells["OUT_CHANGE_FLAG"].Value.ToString())
- {
- case "出炉交班待确认":
- ugr.Appearance.BackColor = Color.LightGreen;
- break;
- }
- switch (ugr.Cells["IN_CHANGE_FLAG"].Value.ToString())
- {
- case "入炉交班待确认":
- ugr.Appearance.BackColor = Color.LightGreen;
- break;
- }
- }
- }
- }
- /// <summary>
- /// 判断是否能开始当前炉次
- /// </summary>
- /// <returns></returns>
- private bool IsStart()
- {
- bool Start = true;
- foreach (UltraGridRow ugr in ultraGridPlan.Rows)
- {
- UltraGridRow ugr1 = ultraGridPlan.ActiveRow;
- if (ugr.Cells["IS_START"].Value.ToString() == "已开始再加热")
- {
- string JudgeStoveNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
- DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmReFurResult.getInFurTime", new object[] { JudgeStoveNo }, this.ob);
- if (string.IsNullOrEmpty(dt.Rows[0]["LAST_IN_TIME"].ToString()))
- // if(!(dt.Rows.Count>0))
- {
- MessageBox.Show("炉号【" + JudgeStoveNo + "】入炉未完成,【" + ugr1.Cells["JUDGE_STOVE_NO"].Value.ToString() + "】不能入炉");
- Start = false;
- }
- }
- }
- return Start;
- }
- /// <summary>
- /// 查询流通卡信息
- /// </summary>
- private void GetRollingCard()
- {
- if (!string.IsNullOrEmpty(ActiveJUDGE_STOVE_NO))
- {
- DataTable dt = new DataTable();
- if (PlineCode.Equals("C009") || PlineCode.Equals("C012") || PlineCode.Equals("C017"))
- {
- dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getRollingCard1", new object[] { ActiveJUDGE_STOVE_NO, proPlanId, gxPlanNo }, this.ob);
- }
- else
- {
- dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getRollingCard", new object[] { ActiveJUDGE_STOVE_NO, proPlanId, gxPlanNo }, this.ob);
- }
- RollingCardEditGrid(dt, ActiveJUDGE_STOVE_NO);
- }
- }
- /// <summary>
- /// 流通卡赋值
- /// </summary>
- /// <param name="dt"></param>
- public void RollingCardEditGrid(DataTable dt, string heatno)
- {
- if (dt.Rows.Count > 0)
- {
- //上料切前剔除支数
- this.rollingCard1.Value.FeedScrapNum = dt.Rows[0]["SCRAP_FEED"].ToString();
- //上料切前合格支数
- this.rollingCard1.Value.FeedQualifiedNum = dt.Rows[0]["QUALIFIED_FEED"].ToString();
- //上料剔除支数
- this.rollingCard1.Value.FeedScrapDBNum = dt.Rows[0]["SCRAP_DBFEED"].ToString();
- //上料合格支数
- this.rollingCard1.Value.FeedQualifiedDBNum = dt.Rows[0]["QUALIFIED_DBFEED"].ToString();
- //加热炉剔除支数
- this.rollingCard1.Value.FurScrapNum = dt.Rows[0]["SCRAP_FUR"].ToString();
- //加热炉合格支数
- this.rollingCard1.Value.FurQualifiedNum = dt.Rows[0]["QUALIFIED_FUR"].ToString();
- //穿孔剔除支数
- this.rollingCard1.Value.PerScrapNum = dt.Rows[0]["SCRAP_PER"].ToString();
- //穿孔合格支数
- this.rollingCard1.Value.PerQualifiedNum = dt.Rows[0]["QUALIFIED_PER"].ToString();
- //连轧剔除支数
- this.rollingCard1.Value.RollingScrapNum = dt.Rows[0]["SCRAP_ROLLING"].ToString();
- //连轧合格支数
- this.rollingCard1.Value.RollingQualifiedNum = dt.Rows[0]["QUALIFIED_ROLLING"].ToString();
- //再加热炉剔除支数
- this.rollingCard1.Value.RefurScrapNum = dt.Rows[0]["SCRAP_REFUR"].ToString();
- //再加热炉合格支数
- this.rollingCard1.Value.RefurQualifiedNum = dt.Rows[0]["QUALIFIED_REFUR"].ToString();
- //定径剔除支数
- this.rollingCard1.Value.SizingScrapNum = dt.Rows[0]["SCRAP_SIZING"].ToString();
- //定径合格支数
- this.rollingCard1.Value.SizingQualifiedNum = dt.Rows[0]["QUALIFIED_SIZING"].ToString();
- //分切前剔除支数
- this.rollingCard1.Value.SawScrapNumBE = dt.Rows[0]["SCRAP_SAW_BE"].ToString();
- //分切前合格支数
- this.rollingCard1.Value.SawQualifiedNumBE = dt.Rows[0]["QUALIFIED_SAW_BE"].ToString();
- //分切剔除支数
- this.rollingCard1.Value.SawScrapNum = dt.Rows[0]["SCRAP_SAW"].ToString();
- //分切合格支数
- this.rollingCard1.Value.SawQualifiedNum = dt.Rows[0]["QUALIFIED_SAW"].ToString();
- //矫直剔除支数
- this.rollingCard1.Value.StraightScrapNum = dt.Rows[0]["SCRAP_STRAIGHT"].ToString();
- //矫直合格支数
- this.rollingCard1.Value.StraightQualifiedNum = dt.Rows[0]["QUALIFIED_STRAIGHT"].ToString();
- //矫直下线支数
- this.rollingCard1.Value.OfflineStraight = dt.Rows[0]["OFFLINE_STRAIGHT"].ToString();
- //矫直返线支数
- this.rollingCard1.Value.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.SurfaceQualifiedNum = dt.Rows[0]["QUALIFIED_BRANCH"].ToString();
- //表检废品支数
- this.rollingCard1.Value.SurfaceScrapNum = dt.Rows[0]["WASTE_QUANTITY"].ToString();
- //表检下线支数
- this.rollingCard1.Value.OfflineSurface = dt.Rows[0]["OFFLINE_QUANTITY"].ToString();
- //表检返线支数
- //this.rollingCard1.Value.SurfaceBackLineNum= dt.Rows[0]["OFFLINE_TESTING"].ToString();
- this.rollingCard1.UpdateData();
- }
- else
- {
- this.rollingCard1.ClearData();
- }
- }
- /// <summary>
- /// 查询流通卡信息
- /// </summary>
- private void GetRollingCard(string heatNo)
- {
- string JudgeStoveNo = heatNo;
- DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getRollingCard", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, this.ob);
- RollingCardEditGrid(dt, JudgeStoveNo);
- }
- #endregion
- #region 事件处理
- private void chkHeatNo_CheckedChanged(object sender, EventArgs e)
- {
- if (this.chkHeatNo.Checked)
- {
- this.txtJudgeStoveNo.Enabled = true;
- }
- else
- {
- this.txtJudgeStoveNo.Enabled = false;
- }
- if (this.chkLotNo.Checked)
- {
- this.txtLOT_NO.Enabled = true;
- }
- else
- {
- this.txtLOT_NO.Enabled = false;
- }
- if (chkStatusQuery.Checked)
- {
- PlanStatusQuery = "99";
- }
- else
- {
- PlanStatusQuery = "50";
- }
- }
- /// <summary>
- /// 再加热炉跟踪信息查询
- /// </summary>
- private void RackQuery(string heatNo)
- {
- tbRollDate.Clear();
- int TabIndex = ultraTabControl3.ActiveTab.Index;
- switch (TabIndex)
- {
- case 0:
- if (ultraGridPlan.Rows.Count == 0)
- {
- return;
- }
- break;
- case 1:
- if (ultraGridINFurInfor.Rows.Count == 0)
- {
- return;
- }
- break;
- case 2:
- if (ultraGridOUTFurInfor.Rows.Count == 0)
- {
- return;
- }
- break;
- }
- RefurRack.JudgeStoveNo = heatNo;
- RefurRack.ProPlanId = proPlanId;
- RefurRack.GxPlanNo = gxPlanNo;
- DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmReFurResult.rackQueryForHeatNo", new object[] { RefurRack }, this.ob);//再加热炉跟踪信息
- GridHelper.CopyDataToDatatable(ref dt, ref tbRollDate, true);
- ultraGrid1.DisplayLayout.Bands[0].PerformAutoResizeColumns(true, PerformAutoSizeType.AllRowsInBand);
- foreach (UltraGridRow ugr in ultraGrid1.Rows)
- {
- ugr.Cells["DELETE"].Value = "剔除";
- ugr.Cells["DELBACK"].Value = "剔料回退";
- }
- ChangeGridColor();
- }
- /// <summary>
- /// tab页切换事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ultraTabControl3_SelectedTabChanged(object sender, Infragistics.Win.UltraWinTabControl.SelectedTabChangedEventArgs e)
- {
- PlanQuery();
- UltraGridRow ugr = null;
- tbRollDate.Clear();
- this.reFurResult1.ClearData();
- switch (ultraTabControl3.SelectedTab.Index)
- {
- case 0:
- if (this.dtPlan.Rows.Count > 0)
- {
- ugr = ultraGridPlan.ActiveRow;
- AfterRowActive(ugr);
- ActiveUgr = ugr;
- }
- else
- {
- ActiveUgr = null;
- }
- break;
- case 1:
- if (this.dtINFurInfor.Rows.Count > 0)
- {
- ugr = ultraGridINFurInfor.ActiveRow;
- AfterRowActive(ugr);
- ActiveUgr = ugr;
- }
- else
- {
- ActiveUgr = null;
- }
- break;
- case 2:
- if (this.dtOUTFurInfor.Rows.Count > 0)
- {
- ugr = ultraGridOUTFurInfor.ActiveRow;
- AfterRowActive(ugr);
- ActiveUgr = ugr;
- }
- else
- {
- ActiveUgr = null;
- }
- break;
- }
- }
- /// <summary>
- /// 查询再入炉实绩
- /// </summary>
- private void refurResultQuery()
- {
- DataTable dt = new DataTable();
- dt.Clear();
- if (ActiveUgr == null)
- {
- return;
- }
- string heatNo = ActiveUgr.Cells["JUDGE_STOVE_NO"].Text.ToString().Trim();
- RefurRs.JudgeStoveNo = heatNo;
- dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmReFurResult.getRefurResult", new object[] { heatNo, proPlanId, gxPlanNo }, this.ob);
- GridEditResult(dt);
- }
- /// <summary>
- /// 再入炉实绩赋值给Grid
- /// </summary>
- /// <param name="dt"></param>
- private void GridEditResult(DataTable dt)
- {
- if (dt.Rows.Count > 0)
- {
- //入炉支数
- this.reFurResult1.Value.InFurNum = dt.Rows[0]["IN_FUR_NUM"].ToString();
- //剔除支数
- this.reFurResult1.Value.ScrapNum = dt.Rows[0]["SCRAP_NUM"].ToString();
- //入炉交接班支数
- this.reFurResult1.Value.Changeclassnum = dt.Rows[0]["CHANGECLASSNUM"].ToString();
- //出炉交接班支数
- this.reFurResult1.Value.OutChangeNum = dt.Rows[0]["OUT_CHANGE_NUM"].ToString();
- //出炉支数
- if (dt.Rows[0]["IN_FUR_NUM"].ToString() == "")
- {
- this.reFurResult1.Value.OutFurNum = dt.Rows[0]["OUT_FUR_NUM"].ToString();
- }
- else
- {
- if (dt.Rows[0]["OUT_FUR_NUM"].ToString() == "")
- {
- if (dt.Rows[0]["SCRAP_NUM"].ToString() == "")
- {
- this.reFurResult1.Value.OutFurNum = (int.Parse(this.reFurResult1.Value.InFurNum.ToString()) - 0).ToString();
- }
- else
- {
- this.reFurResult1.Value.OutFurNum = (int.Parse(this.reFurResult1.Value.InFurNum.ToString()) - int.Parse(dt.Rows[0]["SCRAP_NUM"].ToString())).ToString();
- }
- }
- else
- {
- this.reFurResult1.Value.OutFurNum = dt.Rows[0]["OUT_FUR_NUM"].ToString();
- }
- }
- //备注
- this.reFurResult1.Value.Remark = dt.Rows[0]["REMARK"].ToString();
- //工艺路线
- this.reFurResult1.Value.ProcessRoute = dt.Rows[0]["PROCESS_ROUTE"].ToString();
- //炉温设定
- this.reFurResult1.Value.SetFurTemp = dt.Rows[0]["SET_FUR_TEMP"].ToString();
- //步进梁节奏
- this.reFurResult1.Value.SteppingRhythm = dt.Rows[0]["STEPPING_RHYTHM"].ToString();
- //移送链节奏
- this.reFurResult1.Value.TransferRhythm = dt.Rows[0]["TRANSFER_RHYTHM"].ToString();
- //荒管实际尺寸
- //开始时间
- this.reFurResult1.Value.StartTime = dt.Rows[0]["START_TIME"].ToString();
- //结束时间
- this.reFurResult1.Value.EndTime = dt.Rows[0]["END_TIME"].ToString();
- //结束时间
- this.reFurResult1.Value.ActualLengthOfWastePipe = dt.Rows[0]["ACTUAL_LENGTH_OF_WASTE_PIPE"].ToString();
- //第一支入炉温度
- this.reFurResult1.Value.FirstInTemp = dt.Rows[0]["FIRST_IN_TEMP"].ToString();
- //第一支出炉温度
- this.reFurResult1.Value.FirstOutTemp = dt.Rows[0]["FIRST_OUT_TEMP"].ToString();
- //第一支入炉时间
- this.reFurResult1.Value.FirstInTime = dt.Rows[0]["FIRST_IN_TIME"].ToString();
- //最后一支入炉时间
- this.reFurResult1.Value.LastInTime = dt.Rows[0]["LAST_IN_TIME"].ToString();
- // 烧损率
- this.reFurResult1.Value.Burningrate = "2.0";//dt.Rows[0]["BURNINGRATE"].ToString();
- //最后一支入炉温度
- this.reFurResult1.Value.LastInTemp = dt.Rows[0]["LAST_IN_TEMP"].ToString();
- //最后一支出炉温度
- this.reFurResult1.Value.LastOutTemp = dt.Rows[0]["LAST_OUT_TEMP"].ToString();
- //第一支出炉时间
- this.reFurResult1.Value.FirstOutTime = dt.Rows[0]["FIRST_OUT_TIME"].ToString();
- //最后一支出炉时间
- this.reFurResult1.Value.LastOutTime = dt.Rows[0]["LAST_OUT_TIME"].ToString();
- this.reFurResult1.Value.BeginRollingTemp = dt.Rows[0]["BEGIN_ROLLING_TEMP"].ToString();
- this.reFurResult1.UpdateData();
- //加一段温度
- this.ultraTextEditor16.Text = getstring(dt.Rows[0]["LHEAT_CRUVE1"].ToString());
- //加二段温度
- this.ultraTextEditor1.Text = getstring(dt.Rows[0]["LHEAT_CRUVE2"].ToString());
- //加三段温度
- ultraTextEditor10.Text = getstring(dt.Rows[0]["LHEAT_CRUVE3"].ToString());
- //加四段温度
- ultraTextEditor11.Text = getstring(dt.Rows[0]["LHEAT_CRUVE4"].ToString());
- //加五段温度
- ultraTextEditor12.Text = getstring(dt.Rows[0]["LHEAT_CRUVE5"].ToString());
- //加六段温度
- ultraTextEditor13.Text = getstring(dt.Rows[0]["LHEAT_CRUVE6"].ToString());
- //加七段温度
- ultraTextEditor14.Text = getstring(dt.Rows[0]["LHEAT_CRUVE7"].ToString());
- //加八段温度
- ultraTextEditor15.Text = getstring(dt.Rows[0]["LHEAT_CRUVE8"].ToString());
- //炉温
- ultraTextEditor19.Text = getstring(dt.Rows[0]["FUR_PRESS"].ToString());
- //风压
- ultraTextEditor18.Text = getstring(dt.Rows[0]["WIND_PRESS"].ToString());
- //天然气压力
- ultraTextEditor17.Text = getstring(dt.Rows[0]["GAS_PRESS"].ToString());
- }
- else//再加热实绩为null 时清楚实绩卡里的记录
- {
- MilRefurResultEntity re = new MilRefurResultEntity();
- this.reFurResult1.Value = re;
- this.reFurResult1.UpdateData();
- //加一段温度
- this.ultraTextEditor16.Text = "0.00";
- //加二段温度
- this.ultraTextEditor1.Text = "0.00";
- //加三段温度
- ultraTextEditor10.Text = "0.00";
- //加四段温度
- ultraTextEditor11.Text = "0.00";
- //加五段温度
- ultraTextEditor12.Text = "0.00";
- //加六段温度
- ultraTextEditor13.Text = "0.00";
- //加七段温度
- ultraTextEditor14.Text = "0.00";
- //加八段温度
- ultraTextEditor15.Text = "0.00";
- //炉温
- ultraTextEditor19.Text = "0.00";
- //风压
- ultraTextEditor18.Text = "0.00";
- //天然气压力
- ultraTextEditor17.Text = "0.00";
- }
- this.reFurResult1.UpdateData();
- }
- /// <summary>
- /// Grid表头事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ultraGrid1_DoubleClickHeader(object sender, DoubleClickHeaderEventArgs e)
- {
- if (PanelSizeFlag == 0)
- {
- PanelSizeFlag = 1;
- splitContainer2.SplitterDistance = 180;
- }
- else
- {
- PanelSizeFlag = 0;
- splitContainer2.SplitterDistance = 90;
- }
- }
- #endregion
- /// <summary>
- /// 轧制信息Grid赋值
- /// </summary>
- /// <param name="dt">轧制计划信息datatable</param>
- 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();
- }
- }
- /// <summary>
- /// 计划表ROW点击变换判断
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ultraGridPlan_BeforeRowActivate(object sender, RowEventArgs e)
- {
- if (this.reFurResult1.IsCellSelect == true)
- {
- NativeMethodNew na = new NativeMethodNew(this.ob);
- if (!na.isBegineNode(ActiveJUDGE_STOVE_NO, 4))
- {
- this.reFurResult1.IsCellSelect = false;
- return;
- }
- //if (MessageBox.Show("提示:再加热炉实绩可能已修改,是否保存", "提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
- //{
- // this.reFurResult1.IsCellSelect = false;
- // //保存探伤实绩
- //}
- else
- {
- FeedRowSave();
- this.reFurResult1.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;
- }
- }
- }
- /// <summary>
- /// 查询结炉实绩
- /// </summary>
- public void NodeQuery()
- {
- string Group = UserInfo.GetUserGroup();
- string Shift = UserInfo.GetUserOrder();
- DateTime SeverTime = NativeMethod.GetSeverTime(this.ob);
- string StartTime = SeverTime.ToString("yyyy-MM-dd");
- string EndTime = SeverTime.AddDays(1).ToString("yyyy-MM-dd");
- string Date = StartTime;
- string Time = SeverTime.ToLongTimeString();
- //晚班
- if (Shift == "3")
- {
- Time = Time.Replace(":", "");
- if (int.Parse(Time) > 205900)
- {
- StartTime += " " + "21:00:00";
- EndTime += " " + "10:00:00";
- }
- else
- {
- StartTime = SeverTime.AddDays(-1).ToString("yyyy-MM-dd") + " " + "21:00:00";
- EndTime = SeverTime.ToString("yyyy-MM-dd") + " " + "10:00:00";
- }
- }
- else
- {
- StartTime = StartTime + " 00:00:00";
- EndTime = EndTime + " 00:00:00";
- }
- // DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmReFurResult.GetReFurResultNodeQuery", new object[] { PlineCode, Shift, Group, StartTime, EndTime }, this.ob);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.zgmil.coup.FrmReFurResult";
- ccp.MethodName = "GetReFurResultNodeQuery";
- ccp.ServerParams = new object[] { PlineCode, Shift, Group, StartTime, EndTime };
- ccp = this.ExecuteSortResultByQueryToDataTable(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnObject == null)
- {
- return;
- }
- DataTable dt = ccp.SourceDataTable;
- FrmNodeResultQuery frm = new FrmNodeResultQuery(dt, 5, Date, Shift, Group, this.ob);
- frm.ShowDialog();
- }
- /// <summary>
- /// 打印报表
- /// </summary>
- private void PrintResult()
- {
- Group = UserInfo.GetUserGroup();
- Shift = UserInfo.GetUserOrder();
- DateTime SeverTime = NativeMethod.GetSeverTime(this.ob);
- string Time = SeverTime.ToLongTimeString();
- string StartTime = ""; // 开始时间 用于报表查询
- string EndTime = ""; // 结束时间 用于报表查询
- string strurl = "";
- //晚班
- Time = Time.Replace(":", "");
- if (Shift == "3")
- {
- //查询晚班前一天20点40后到当天07点20前所有记录
- if (int.Parse(Time) < 072000)
- {
- StartTime = SeverTime.AddDays(-1).ToShortDateString() + " 20:40:00";
- EndTime = SeverTime.ToShortDateString() + " 07:20:00";
- //string Date2 = SeverTime.ToString("yyyy-MM-dd");
- }
- //查询当天晚班的所有数据
- else if (int.Parse(Time) > 204000)
- {
- StartTime = SeverTime.ToShortDateString() + " 20:40:00";
- EndTime = SeverTime.AddDays(1).ToShortDateString() + " 07:20:00";
- }
- }
- //白班 中班
- else
- {
- StartTime = SeverTime.ToShortDateString() + " 00:00:00";
- EndTime = SeverTime.AddDays(1).ToShortDateString() + " 00:00:00";
- }
- switch (PlineCode)
- {
- case "C008": //250
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilAgainiFurResult250.cpt&format=pdf&SHIFT=" + Shift + "&GROUP=" + Group + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + _UserID;
- break;
- case "C072": //508
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilAgainiFurResult250.cpt&format=pdf&SHIFT=" + Shift + "&GROUP=" + Group + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + _UserID;
- break;
- case "C009": //258
- break;
- case "C010": //168
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilAgainiFurResult168.cpt&format=pdf&SHIFT=" + Shift + "&GROUP=" + Group + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + _UserID;
- break;
- case "C012": //Arssel
- break;
- case "C017": //460
- break;
- }
- FrmRepExcel fre = new FrmRepExcel(ob, strurl);
- fre.AutoSize = true;
- fre.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
- fre.WindowState = FormWindowState.Maximized;
- fre.Show();
- }
- /// <summary>
- /// 查询上个班原始记录
- /// </summary>
- private void QueryBefore()
- {
- HOTMethod hm = new HOTMethod(this.ob);
- DateTime SeverTime = NativeMethod.GetSeverTime(this.ob);
- string Time = SeverTime.ToLongTimeString();
- string Date = "";
- if (Shift == "3")
- {
- Time = Time.Replace(":", "");
- if (int.Parse(Time) < 122000)
- {
- Date = SeverTime.AddDays(-1).ToString("yyyyMMdd");
- }
- else
- {
- Date = SeverTime.ToString("yyyyMMdd");
- }
- }
- if (Shift == "1" || Shift == "0")
- {
- Date = SeverTime.AddDays(-1).ToString("yyyyMMdd");
- }
- else
- {
- Date = SeverTime.ToString("yyyyMMdd");
- }
- string StartTime = ""; // 开始时间 用于报表查询
- string EndTime = ""; // 结束时间 用于报表查询
- string StartTimeU = ""; // 开始时间 用于得到上班UserID
- string EndTimeU = ""; // 结束时间 用于得到上班UserID
- string strurl = "";
- string ShitGroupBefore = HOTMethod.GetShiftBefore(Shift, Group, Date, PlineCode);
- //if (PlineCode.Equals("C072"))
- //{
- // ShitGroupBefore = HOTMethod.GetShiftBefore(Shift, Group, Date);
- //}
- //else
- //{
- // ShitGroupBefore = HOTMethod.GetShiftBefore(Shift, Group);
- //}
- string UserIDBefore = "";
- //晚班
- Time = Time.Replace(":", "");
- if (Shift == "3")
- {
- //查询晚班前一天中班所有记录
- if (int.Parse(Time) < 122000)
- {
- StartTime = SeverTime.AddDays(-1).ToShortDateString() + " 13:40:00";
- EndTime = SeverTime.ToShortDateString() + " 00:00:00";
- //string Date2 = SeverTime.ToString("yyyy-MM-dd");
- StartTimeU = SeverTime.AddDays(-1).ToShortDateString() + " 13:40:00";
- EndTimeU = SeverTime.ToShortDateString() + " 00:00:00";
- UserIDBefore = hm.GetUserIDBefore(StartTimeU, EndTimeU, ShitGroupBefore.Substring(0, 1), ShitGroupBefore.Substring(1, 1), 4, PlineCode);
- //strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilPerforation.cpt&SHIFT=" + ShitGroupBefore.Substring(0, 1) + "&GROUP=" + ShitGroupBefore.Substring(1, 1) + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + UserIDBefore;
- }
- //查询当天中班的所有数据
- else if (int.Parse(Time) > 204000)
- {
- StartTime = SeverTime.ToShortDateString() + " 13:40:00";
- EndTime = SeverTime.AddDays(1).ToShortDateString() + " 00:00:00";
- StartTimeU = SeverTime.ToShortDateString() + " 13:40:00";
- EndTimeU = SeverTime.AddDays(1).ToShortDateString() + " 00:00:00";
- UserIDBefore = hm.GetUserIDBefore(StartTimeU, EndTimeU, ShitGroupBefore.Substring(0, 1), ShitGroupBefore.Substring(1, 1), 4, PlineCode);
- //strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilPerforation.cpt&SHIFT=" + ShitGroupBefore.Substring(0, 1) + "&GROUP=" + ShitGroupBefore.Substring(1, 1) + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + UserIDBefore;
- }
- }
- //白班
- else if (Shift == "1")
- {
- StartTime = SeverTime.AddDays(-1).ToShortDateString() + " 12:00:00";
- EndTime = SeverTime.AddDays(0).ToShortDateString() + " 12:00:00";
- StartTimeU = SeverTime.AddDays(-1).ToShortDateString() + " 12:00:00";
- EndTimeU = SeverTime.AddDays(0).ToShortDateString() + " 12:00:00";
- UserIDBefore = hm.GetUserIDBefore(StartTimeU, EndTimeU, ShitGroupBefore.Substring(0, 1), ShitGroupBefore.Substring(1, 1), 4, PlineCode);
- }
- //中班
- else
- {
- StartTime = SeverTime.ToShortDateString() + " 00:00:00";
- EndTime = SeverTime.AddDays(1).ToShortDateString() + " 00:00:00";
- StartTimeU = SeverTime.ToShortDateString() + " 00:00:00";
- EndTimeU = SeverTime.AddDays(1).ToShortDateString() + " 00:00:00";
- UserIDBefore = hm.GetUserIDBefore(StartTimeU, EndTimeU, ShitGroupBefore.Substring(0, 1), ShitGroupBefore.Substring(1, 1), 4, PlineCode);
- //strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilPerforation.cpt&SHIFT=" + ShitGroupBefore.Substring(0, 1) + "&GROUP=" + ShitGroupBefore.Substring(1, 1) + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + UserIDBefore;
- }
- switch (PlineCode)
- {
- case "C008": //250
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilAgainiFurResult250.cpt&format=pdf&SHIFT=" + ShitGroupBefore.Substring(0, 1) + "&GROUP=" + ShitGroupBefore.Substring(1, 1) + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + UserIDBefore;
- break;
- case "C072": //508
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilAgainiFurResult250.cpt&format=pdf&SHIFT=" + ShitGroupBefore.Substring(0, 1) + "&GROUP=" + ShitGroupBefore.Substring(1, 1) + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + UserIDBefore;
- break;
- case "C009": //258
- //晚班
- break;
- case "C010": //168
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilAgainiFurResult168.cpt&format=pdf&SHIFT=" + ShitGroupBefore.Substring(0, 1) + "&GROUP=" + ShitGroupBefore.Substring(1, 1) + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + UserIDBefore;
- break;
- case "C012": //Arssel
- break;
- case "C017": //460
- break;
- }
- FrmRepExcel fre = new FrmRepExcel(ob, strurl);
- fre.AutoSize = true;
- fre.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
- fre.WindowState = FormWindowState.Maximized;
- fre.Show();
- }
- private void frmTechnological1_DoubleClickEvent(DataTable dt)
- {
- GridEditResult(dt);
- }
- /// <summary>
- /// 自动刷新
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void timer1_Tick(object sender, EventArgs e)
- {
- int MouseLocX = 0;
- int MouseLocY = 0;
- //获取当前鼠标坐标
- //获取鼠标坐标
- Point formPoint = this.PointToClient(Control.MousePosition);
- MouseLocX = Convert.ToInt32(formPoint.X);
- MouseLocY = Convert.ToInt32(formPoint.Y);
- if (MouseLocX == _MouseLocX && MouseLocY == _MouseLocY)
- {
- ShowMessageFlag = 1;
- PlanQuery();
- ShowMessageFlag = 0;
- }
- else
- {
- _MouseLocX = MouseLocX;
- _MouseLocY = MouseLocY;
- }
- }
- /// <summary>
- /// 管号队列修改剔除原因 备注
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ultraGridMatSeq_KeyPress(object sender, KeyPressEventArgs e)
- {
- if (e.KeyChar == (char)13)
- {
- e.Handled = true;
- UltraGridRow ugr = null;
- int Index = ultraGrid1.ActiveRow.Index;
- if (Index < ultraGrid1.Rows.Count - 1)
- {
- ugr = ultraGrid1.Rows[Index - 1];
- // ugr = ultraGrid1.ActiveRow;
- }
- else
- {
- ugr = ultraGrid1.ActiveRow;
- }
- ultraGrid1.UpdateData();
- ultraGrid1.Update();
- string ScrapReason = ugr.Cells["SCRAP_REASON"].Text.ToString().Trim();
- string Remark = ugr.Cells["REMARK"].Text.ToString();
- string Seq = ugr.Cells["SEQ"].Text.ToString();
- string Status = ugr.Cells["STATUS"].Text.ToString();
- if (Status == "剔除")
- {
- int dt = ServerHelper.SetData("com.steering.mes.zgmil.coup.FeedSawResult.UpdateMatNoPro", new object[] { ActiveJUDGE_STOVE_NO, ActiveResultNo, 1, Seq, ScrapReason, Remark }, this.ob);
- }
- ChangeGridColor();
- RackQuery(ActiveJUDGE_STOVE_NO);
- }
- }
- }
- }
|