| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using CoreFS.CA06;
- using Core.Mes.Client.Comm.Control;
- using com.steering.mes.zgmil.entity;
- using Infragistics.Win.UltraWinGrid;
- using Core.Mes.Client.Comm.Server;
- using Core.Mes.Client.Comm.Tool;
- using Core.StlMes.Client.ZGMil.Entity;
- using Core.StlMes.Client.ZGMil.NodeResultQuery;
- using System.Net;
- using Core.StlMes.Client.ZGMil.ResultConrtrol;
- using Core.StlMes.Client.ZGMil.Popup;
- using Core.StlMes.Client.ZGMil.Common;
- using CoreFS.SA06;
- namespace Core.StlMes.Client.ZGMil.Result
- {
- public partial class FrmRollingRPipeResult : 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();
- FeedSawResultEntity FeedSawResult = new FeedSawResultEntity();
- MilRollingRackEntity RackRs = new MilRollingRackEntity();
- MilRollingResultEntity ResultRs = new MilRollingResultEntity();
- MilRollingHistoryEntity HistoryRs = new MilRollingHistoryEntity();
- MilSlabScrapSeqEntity ScrapSeq = new MilSlabScrapSeqEntity();
- string PlanStatusQuery = "39";
- string PlanStartStatusQuery = "00"; //查询结炉实绩起始状态
- MilRollingResultEntity temprollingresult = new MilRollingResultEntity();
- private string ActiveJUDGE_STOVE_NO = null;//主计划活动行的判定炉号
- private string ActiveStatus = null;//主计划活动行的状态
- private string ActiveResultNo = null;//主计划实绩编号
- private string ActiveLotNo = null;//主计划批号
- private string _UpdateFlag = "0"; //调度日志确认标识
- //private string PlineCode = null;//产线代码
- string Shift = "";
- string Group = "";
- private string Departm = "";//部门
- private string PlineCode = "";//产线
- private string lotNo = null;//生产批号
- private int _MouseLocX = 0; //鼠标横坐标
- private int _MouseLocY = 0; //鼠标纵坐标
- private string ChangeUserID = ""; //接班用户名
- private string ChangePassWord = ""; //接班密码
- private int ShowMessageFlag = 0; //保存弹窗标识 0 弹出 1 不弹出
- private string _UserName = "";
- private string _UserID = "";
- private string _Url = "";
- private int ChangeFlag = 0;
- string proPlanId = "";
- string gxPlanNo = "";
- public Infragistics.Win.UltraWinGrid.UltraGrid Grid
- {
- get { return _grid; }
- }
- public FrmRollingRPipeResult()
- {
- InitializeComponent();
- PanelSizeFlag = 0;
- this.rollResult1.UltraGrid2.ClickCellButton += new CellEventHandler(UltraGrid2_ClickCellButton);
- this.rollResult_Arssel1.UltraGrid2.ClickCellButton += new CellEventHandler(UltraGrid2_ClickCellButton);
- //获取鼠标坐标
- Point formPoint = this.PointToClient(Control.MousePosition);
- _MouseLocX = Convert.ToInt32(formPoint.X);
- _MouseLocY = Convert.ToInt32(formPoint.Y);
- }
- /// <summary>
- /// 定时器事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- 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>
- void UltraGrid2_ClickCellButton(object sender, CellEventArgs e)
- {
- string JudgeStoveNo = "";
- string Status = "";
- string ResultNo = "";
- UltraGridRow ugr = this.ultraGridPlan.ActiveRow;
- if (ugr != null)
- {
- if (e.Cell.Column.Key == "CHANGENUMCANCEL")
- {
- JudgeStoveNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
- Status = ugr.Cells["IS_START"].Value.ToString();
- ResultNo = ugr.Cells["ID"].Value.ToString();
- if (Status == "已完成连轧")
- {
- MessageBox.Show("炉号:【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】已完成连轧操作,不允许交班取消!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- if (Status == "未开始连轧")
- {
- MessageBox.Show("炉号:【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】未开始连轧操作,不允许交班取消!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- NativeMethodNew nass = new NativeMethodNew(this.ob);
- nass.ChangeShiftBack(JudgeStoveNo, ResultNo, proPlanId, gxPlanNo, PlineCode, Shift, Group, 3);
- //ChangeShiftBackRolling(JudgeStoveNo, ResultNo, PlineCode, Shift, Group);
- RackQuery(JudgeStoveNo);
- this.rollResult_Arssel1.UpdateData();
- this.rollResult1.UpdateData();
- PlanQuery();
- }
- }
- }
- /// <summary>
- /// 连轧回退
- /// </summary>
- /// <param name="JudgeStoveNo"></param>
- /// <param name="ResultNo"></param>
- /// <param name="PLineCode"></param>
- /// <param name="Shift"></param>
- /// <param name="Group"></param>
- /// <param name="Flag">加热炉/再加热炉最后一支入炉标识 0-未入炉 1-入炉 最后一支入炉时,交班取消不能取消入炉交班</param>
- /// <param name="process">0-开始锯切 1-入炉 2-开始穿孔 3-开始连轧 4-入再加热炉 5-开始定径 6-开始分切 7-开始矫直 8-开始探伤 9-开始质检</param>
- /// <returns></returns>
- public int ChangeShiftBackRolling(string JudgeStoveNo, string ResultNo, string PLineCode, string Shift, string Group)
- {
- int count = 0;
- int process = 3;
- DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmRollingRPipeResult.findRollingRack", new object[] { JudgeStoveNo, ResultNo, PLineCode, Shift, Group}, this.ob);
- DataTable dt1 = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.BeforeChangBack", new object[] { JudgeStoveNo, ResultNo, PLineCode, Shift, Group, process, "0", proPlanId, gxPlanNo }, this.ob);
- if (dt.Rows.Count > 0 )
- {
- count = ServerHelper.SetData("com.steering.mes.zgmil.coup.FrmRollingRPipeResult.ChangBackelse", new object[] { JudgeStoveNo, ResultNo, PLineCode, Shift, Group}, this.ob);
- }
- if (dt1.Rows.Count > 0)
- {
- count = ServerHelper.SetData("com.steering.mes.zgmil.coup.FrmRollingRPipeResult.ChangBackelse", new object[] { JudgeStoveNo, ResultNo, PLineCode, Shift, Group }, this.ob);
- }
- return count;
- }
- /// <summary>
- /// 交班取消
- /// </summary>
- private void ChangeCancel()
- {
- string JudgeStoveNo = "";
- string Status = "";
- string ResultNo = "";
- UltraGridRow ugr = this.ultraGridPlan.ActiveRow;
- if (ugr != null)
- {
- JudgeStoveNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
- Status = ugr.Cells["IS_START"].Value.ToString();
- ResultNo = ugr.Cells["ID"].Value.ToString();
- if (Status == "已完成连轧")
- {
- MessageBox.Show("炉号:【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】已完成连轧操作,不允许交班取消!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- if (Status == "未开始连轧")
- {
- MessageBox.Show("炉号:【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】未开始连轧操作,不允许交班取消!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- foreach (UltraGridRow ug in ultraGrid1.Rows)
- {
- if (ug.Cells["CHANGE_FLAG"].Text == "待接班确认")
- {
- //NativeMethodNew nass = new NativeMethodNew(this.ob);
- //nass.ChangeShiftBack(JudgeStoveNo, ResultNo, PlineCode, Shift, Group, 3);
- ChangeShiftBackRolling(JudgeStoveNo, ResultNo, PlineCode, "", "");
- }
- }
- DataTable ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmRollingRPipeResult.doQueryRackGroup", new object[] { JudgeStoveNo, ResultNo }, ob);
- if (ds.Rows.Count > 0)
- {
- if (ds.Rows[0]["COL_SHIFT"].ToString() == UserInfo.GetUserOrder() && ds.Rows[0]["COL_GROUP"].ToString() == UserInfo.GetUserGroup())
- {
- //NativeMethodNew nass = new NativeMethodNew(this.ob);
- //nass.ChangeShiftBack(JudgeStoveNo, ResultNo, PlineCode, Shift, Group, 3);
- ChangeShiftBackRolling(JudgeStoveNo, ResultNo, PlineCode, Shift, Group);
- //更新连轧调度日志
- 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";
- string Date = "";
- if (Shift == "3")
- {
- Time = Time.Replace(":", "");
- Date = SeverTime.AddDays(+1).ToString("yyyyMMdd");
- }
- else
- {
- Date = SeverTime.ToString("yyyyMMdd");
- }
- string ShiftA = this.UserInfo.GetUserOrder();//HOTMethod.GetShiftAfter(Shift, Group, Date).Substring(0, 1);
- string GroupA = this.UserInfo.GetUserGroup();//HOTMethod.GetShiftAfter(Shift, Group, Date).Substring(1, 1);
- if (_UpdateFlag == "0")
- {
- int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.FrmRollingRPipeResult.changeGroupCancelUpdateContralLog", new object[] { Shift, Group, ShiftA, GroupA, ActiveJUDGE_STOVE_NO, ActiveLotNo }, this.ob);
- }
- }
- }
- RackQuery(JudgeStoveNo);
- this.rollResult_Arssel1.UpdateData();
- this.rollResult1.UpdateData();
- PlanQuery();
- }
- }
- protected override void OnLoad(EventArgs e)
- {
- Shift = UserInfo.GetUserOrder();
- Group = UserInfo.GetUserGroup();
- base.OnLoad(e);
- //屏蔽Grid筛选条件
- chk.UltraGrid4.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
- rollingCard1.UltraGrid4.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
- rollResult1.UltraGrid2.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
- rollResult_Arssel1.UltraGrid2.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
- ultraGrid1.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
- ultraGridPlan.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
- foreach (UltraGridColumn ugc in ultraGridPlan.DisplayLayout.Bands[0].Columns)
- {
- ugc.SortIndicator = SortIndicator.Disabled;
- }
- timer1.Tick += new EventHandler(timer1_Tick);
- //ChangeGridColor();
- InitControl();
- 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);//获取 用户 对应的产线
- if (PlineCode.Equals("C009") || PlineCode.Equals("C012") || PlineCode.Equals("C017") || PlineCode.Equals("C072"))
- {
- this.rollingCard1.ChangCard();
- }
- ultraTabControl1.Tabs[1].Visible = false;
- //if (PlineCode == "C009")
- switch (PlineCode)
- {
- case "C008":
- rollResult1.UltraGrid2.DisplayLayout.Bands[0].Columns["EMSPEED"].Header.Appearance.ForeColor = Color.Gray;
- rollResult1.UltraGrid2.DisplayLayout.Bands[0].Columns["VXSSPEED"].Header.Appearance.ForeColor = Color.Gray;
- rollResult1.UltraGrid2.DisplayLayout.Bands[0].Columns["EMSPEED"].CellActivation = Activation.NoEdit;
- rollResult1.UltraGrid2.DisplayLayout.Bands[0].Columns["VXSSPEED"].CellActivation = Activation.NoEdit;
- break;
- case "C009":
- rollResult1.UltraGrid2.DisplayLayout.Bands[0].Columns["EMSPEED"].Header.Appearance.ForeColor = Color.Gray;
- rollResult1.UltraGrid2.DisplayLayout.Bands[0].Columns["Roller7"].Header.Appearance.ForeColor = Color.Gray;
- rollResult1.UltraGrid2.DisplayLayout.Bands[0].Columns["VXSSPEED"].Header.Appearance.ForeColor = Color.Gray;
- rollResult1.UltraGrid2.DisplayLayout.Bands[0].Columns["RollingForce"].CellActivation = Activation.NoEdit;
- rollResult1.UltraGrid2.DisplayLayout.Bands[0].Columns["EMSPEED"].CellActivation = Activation.NoEdit;
- rollResult1.UltraGrid2.DisplayLayout.Bands[0].Columns["VXSSPEED"].CellActivation = Activation.NoEdit;
- rollResult1.UltraGrid2.DisplayLayout.Bands[0].Columns["ROLLINGFORCE7"].CellActivation = Activation.NoEdit;
- rollResult1.UltraGrid2.DisplayLayout.Bands[0].Columns["ROLLSPEED7"].CellActivation = Activation.NoEdit;
- rollResult1.UltraGrid2.DisplayLayout.Bands[0].Columns["ROLLSPACE7"].CellActivation = Activation.NoEdit;
- break;
- case "C012":
- ultraTabControl1.Tabs[0].Visible = false;
- ultraTabControl1.Tabs[0].Visible = true;
- break;
- case "C072":
- rollResult1.UltraGrid2.DisplayLayout.Bands[0].Columns["startRollTemp"].Header.Caption = "入口温度(℃)";
- break;
- }
- Sign();
- frmTechnological1.InitMilSet(PlineCode, "40070", this.ob);
- PlanQuery();
- }
- /// <summary>
- /// 签名
- /// </summary>
- private void Sign()
- {
- ColUserName col = new ColUserName();
- col.StationId = "3";
- 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;
- }
- }
- #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 "NodeQuery":
- NodeQuery();
- break;
- case "DoNodeBack":
- NodeBack();
- break;
- case "DoStart":
- DoStart();
- break;
- case "DoQueryBefore":
- QueryBefore();
- break;
- case "DoStartBack":
- StartBack();
- break;
- case "DoToolChange":
- DoToolChange();
- break;
- case "DoSign":
- Sign();
- break;
- case "DoPrint":
- PrintResult();
- break;
- case "DoChangeCancel":
- ChangeCancel();
- break;
- case "Close":
- this.Dispose();
- this.Close();
- break;
- }
- }
- /// <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>
- /// <returns></returns>
- private bool IsStart()
- {
- bool Start = true;
- foreach (UltraGridRow ugr in ultraGridPlan.Rows)
- {
- if (ugr.Cells["IS_START"].Value.ToString() == "已开始连轧")
- {
- MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(ugr.Cells["JUDGE_STOVE_NO"].Value.ToString()) + "】正在连轧,不能两炉同时开始连轧", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- Start = false;
- }
- }
- return Start;
- }
- /// <summary>
- /// 查询主计划
- /// </summary>
- private void PlanQuery()
- {
- string PrimaKey = "";
- string SencodKey = "";
- UltraGridRow ugr = this.ultraGridPlan.ActiveRow;
- if (ugr != null)
- {
- PrimaKey = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
- if (ugr.HasParent())
- {
- SencodKey = ugr.Cells["FEED_ROW_NO"].Value.ToString();
- }
- }
- //if (dtStartDate.DateTime > dtEndDate.DateTime)
- //{
- // MessageBox.Show("开始时间不能大于结束时间。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- //}
- //if (chkDate.Checked == true)
- //{
- // QueryMainPlan.StartTime = this.dtStartDate.DateTime.ToString("yyyy-MM-dd HH:mm:ss");
- // QueryMainPlan.EndTime = this.dtEndDate.DateTime.ToString("yyyy-MM-dd HH:mm:ss");
- //}
- //else
- //{
- // QueryMainPlan.StartTime = DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd HH:mm:ss");
- // QueryMainPlan.EndTime = DateTime.Now.AddDays(+1).ToString("yyyy-MM-dd HH:mm:ss");
- //}
- 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();
- QueryMainPlan.PlineCode = PlineCode;
- QueryMainPlan.Status = PlanStatusQuery;
- QueryMainPlan.StartStatus = PlanStartStatusQuery;
- QueryMainPlan.ProPlanId = proPlanId;
- QueryMainPlan.GxPlanNo = gxPlanNo;
- //查询主表记录
- DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getSingleMainPlan", new object[] { QueryMainPlan, 4 }, this.ob);
- if (dt.Rows.Count == 0)
- {
- if (ShowMessageFlag == 0)
- {
- MessageBox.Show("未查询到匹配的数据,请重新查询!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- }
- return;
- }
- else
- {
- GridHelper.CopyDataToDatatable(ref dt, ref dtPlan, true);
- //ultraGridPlan.DisplayLayout.Bands[0].PerformAutoResizeColumns(true, PerformAutoSizeType.AllRowsInBand);
- ChangeCellName();
- ChangeGridColor();
- if (ugr != null)
- {
- foreach (UltraGridRow ugr1 in ultraGridPlan.Rows)
- {
- if (ugr1.Cells["JUDGE_STOVE_NO"].Value.ToString() == PrimaKey)
- {
- ugr1.Activated = true;
- }
- }
- }
- }
- }
- /// <summary>
- /// 单击主计划
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ultraGridPlan_AfterRowActivate(object sender, EventArgs e)
- {
- tbRollDate.Clear();
- if (dtPlan.Rows.Count > 0)
- {
- UltraGridRow ugr = ultraGridPlan.ActiveRow;
- if (ugr != null)
- {
- string HeatNo = this.ultraGridPlan.ActiveRow.Cells["JUDGE_STOVE_NO"].Text.ToString().Trim();
- ActiveJUDGE_STOVE_NO = HeatNo;
- string Status = ugr.Cells["IS_START"].Value.ToString();
- ActiveStatus = Status;
- ActiveResultNo = ugr.Cells["ID"].Value.ToString();
- ActiveLotNo = ugr.Cells["LOT_NO"].Value.ToString();
- MainPlan.JudgeStoveNo = HeatNo;
- PlineCode = ugr.Cells["Pline_Code"].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();
- //查询该炉 该班次调度日志是否确认
- DataTable dt1 = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmRollingRPipeResult.getControlStatus", new object[] { ActiveJUDGE_STOVE_NO, ActiveLotNo, Shift, Group, proPlanId, gxPlanNo }, this.ob);
- if (dt1.Rows.Count > 0)
- {
- _UpdateFlag = dt1.Rows[0][0].ToString();
- }
- DataTable dtMP = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getSingleMainPlanForHeatNo", new object[] { MainPlan }, this.ob);
- if (dtMP.Rows.Count > 0)
- {
- if (dtMP.Rows[0]["PLINE_CODE"].ToString() == "C012")
- {
- ultraTabControl1.Tabs[0].Visible = false;
- ultraTabControl1.Tabs[1].Visible = true;
- }
- else
- {
- ultraTabControl1.Tabs[0].Visible = true;
- ultraTabControl1.Tabs[1].Visible = false;
- }
- GridEdit(dtMP); //轧制计划信息
- PlineCode = dtMP.Rows[0]["PLINE_CODE"].ToString();
- resultQuery(HeatNo, PlineCode);//实绩查询
- }
- if (Status != "未开始连轧")
- {
- RackQuery(HeatNo);//查询跟踪记录信息
- }
- else
- {
- //tbRollDate.Rows.Clear();
- }
- GetRollingCard();
- }
- }
- }
- /// <summary>
- /// 双击开始连轧
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void DoStart()
- {
- ResultRs.Clear();
- DataTable dt = new DataTable();
- //if (this.UserInfo.GetUserOrder() == "0")
- //{
- // MessageBox.Show("常白班不能操作!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- // return;
- //}
- if (ultraGridPlan.Rows.Count > 0)
- {
- //if (!IsStart())
- //{
- // return;
- //}
- UltraGridRow ugr = ultraGridPlan.ActiveRow;
- string HeatNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();//判定炉号
- ActiveJUDGE_STOVE_NO = HeatNo;
- string Status = ugr.Cells["IS_START"].Value.ToString();
- string ResultNo = ugr.Cells["ID"].Value.ToString();
- NativeMethodNew Nvw = new NativeMethodNew(this.ob);
- //if (!Nvw.isBegineNode(HeatNo, 2))
- //{
- // MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(HeatNo) + "】未穿孔,不能连轧。");
- // return;
- //}
- ActiveStatus = Status;
- if (Status == "已完成连轧")
- {
- MessageBox.Show("炉号:【" + BaseMethod.getJudgeStoveNo(HeatNo) + "】已完成连轧,不允许重新开始!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- PlineCode = ugr.Cells["Pline_Code"].Value.ToString();
- if (ugr != null)
- {
- if (Status == "已开始连轧")
- {
- MessageBox.Show("连轧脱管正在进行,无法再次开始连轧!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- MainPlan.JudgeStoveNo = HeatNo;
- MainPlan.ProPlanId = proPlanId;
- MainPlan.GxPlanNo = gxPlanNo;
- DataTable dtMP = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getSingleMainPlanForHeatNo", new object[] { MainPlan }, this.ob);
- GridEdit(dtMP); //轧制计划信息
- if (temprollingresult != null)
- {
- //1
- ResultRs.VrsSpeed = temprollingresult.VrsSpeed;
- ResultRs.InsertLength = temprollingresult.InsertLength;
- ResultRs.Tubesize = temprollingresult.Tubesize;
- ResultRs.Emspeed = temprollingresult.Emspeed;
- ResultRs.LimitSpeed = temprollingresult.LimitSpeed;
- ResultRs.Ext1RackSpeed = temprollingresult.Ext1RackSpeed;
- ResultRs.RackSpace1 = temprollingresult.RackSpace1;
- ResultRs.RackSpace2 = temprollingresult.RackSpace2;
- ResultRs.RackSpace3 = temprollingresult.RackSpace3;
- ResultRs.RackSpace4 = temprollingresult.RackSpace4;
- ResultRs.RackSpace5 = temprollingresult.RackSpace5;
- ResultRs.RackSpace6 = temprollingresult.RackSpace6;
- ResultRs.RackSpace7 = temprollingresult.RackSpace7;
- ResultRs.RackSpeed1 = temprollingresult.RackSpeed1;
- ResultRs.RackSpeed2 = temprollingresult.RackSpeed2;
- ResultRs.RackSpeed3 = temprollingresult.RackSpeed3;
- ResultRs.RackSpeed4 = temprollingresult.RackSpeed4;
- ResultRs.RackSpeed5 = temprollingresult.RackSpeed5;
- ResultRs.RackSpeed6 = temprollingresult.RackSpeed6;
- ResultRs.RackSpeed7 = temprollingresult.RackSpeed7;
- ResultRs.RollingForce1 = temprollingresult.RollingForce1;
- ResultRs.RollingForce2 = temprollingresult.RollingForce2;
- ResultRs.RollingForce3 = temprollingresult.RollingForce3;
- ResultRs.RollingForce4 = temprollingresult.RollingForce4;
- ResultRs.RollingForce5 = temprollingresult.RollingForce5;
- ResultRs.RollingForce6 = temprollingresult.RollingForce6;
- ResultRs.RollingForce7 = temprollingresult.RollingForce7;
- ResultRs.StartRollTemp = temprollingresult.StartRollTemp;
- //阿塞尔线
- ResultRs.Tubesize = temprollingresult.Tubesize;
- ResultRs.QoRollerThroatDiameter = temprollingresult.QoRollerThroatDiameter;
- ResultRs.QcRollerThroatDiameter = temprollingresult.QcRollerThroatDiameter;
- ResultRs.RollingThroatDiameter = temprollingresult.RollingThroatDiameter;
- ResultRs.RollerBiteSpeed = temprollingresult.RollerBiteSpeed;//咬入
- ResultRs.Rollangle = temprollingresult.Rollangle;//轧辊角
- ResultRs.FeedAngle = temprollingresult.FeedAngle;//喂入角
- ResultRs.RollingSpeed = temprollingresult.RollingSpeed;//轧制速度
- }
- string stoveNo = dtMP.Rows[0]["STOVE_NO"].ToString();//熔炼炉号
- string lotNo = dtMP.Rows[0]["LOT_NO"].ToString();//生产批号
- string factoryId = dtMP.Rows[0]["PLINE_CODE"].ToString();//产线
- ResultRs.JudgeStoveNo = HeatNo;
- ResultRs.ResultNo = ResultNo;
- ResultRs.StoveNo = stoveNo;
- ResultRs.LotNo = lotNo;
- ResultRs.PlineCode = factoryId;
- ResultRs.ColUser = this.UserInfo.GetUserName();
- ResultRs.ColShift = this.UserInfo.GetUserOrder();
- ResultRs.ColGroup = this.UserInfo.GetUserGroup();
- ResultRs.ProPlanId = proPlanId;
- ResultRs.GxPlanNo = gxPlanNo;
- //if (MessageUtil.ShowYesNoAndQuestion("确认炉号【" + HeatNo + "】开始连轧?") == DialogResult.No)
- //{
- // return;
- //}
- //修改主计划状态、新增连轧实绩
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.zgmil.coup.FrmRollingRPipeResult";
- ccp.MethodName = "insertResultForMainPlan";
- ccp.ServerParams = new object[] { ResultRs };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnInfo == "开始成功!")
- {
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
-
- //int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.FrmRollingRPipeResult.insertResultForMainPlan", new object[] { ResultRs }, this.ob);
- //新增连轧调度日志
- int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.FrmRollingRPipeResult.insertContralLog", new object[] { HeatNo, lotNo, Shift, Group, _UserID, _UserName, "0", proPlanId, gxPlanNo }, this.ob);
- //往跟踪记录表插入连轧开始时间
- NativeMethodNew na = new NativeMethodNew(this.ob);
- na.InsertSTAferDoubleClick(HeatNo, 3, "0", proPlanId, gxPlanNo);
- //resultQuery();
- //刷新主表
- DataTable dt1 = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getSingleMainPlan", new object[] { QueryMainPlan, 4 }, this.ob);
- GridHelper.CopyDataToDatatable(ref dt1, ref dtPlan, true);
- //ultraGridPlan.DisplayLayout.Bands[0].PerformAutoResizeColumns(true, PerformAutoSizeType.AllRowsInBand);
- ChangeCellName();
- ChangeGridColor();
- foreach (UltraGridRow ugr1 in this.ultraGridPlan.Rows)
- {
- if (ugr1.Cells["JUDGE_STOVE_NO"].Value.ToString() == HeatNo)
- {
- ultraGridPlan.ActiveRow = ugr1;
- }
- }
- }
- }
- }
- /// <summary>
- /// 保存
- /// </summary>
- private void FeedRowSave()
- {
- ResultRs.Clear();
- int count = 0;
- string flag = "";
- try
- {
- rollResult1.UltraGrid2.UpdateData();
- rollResult_Arssel1.UltraGrid2.UpdateData();
- }
- catch (Exception e)
- {
- MessageBox.Show("请输入正确的时间。");
- return;
- }
- UltraGridRow ugrg = this.rollResult1.UltraGrid2.Rows[0];
- UltraGridRow uRow = this.rollResult_Arssel1.UltraGrid2.Rows[0];
- string factoryId = null;
- //string heatNo = this.ultraGridPlan.ActiveRow.Cells["JUDGE_STOVE_NO"].Text.ToString().Trim();
- if (this.ultraGridPlan.ActiveRow == null && ActiveJUDGE_STOVE_NO == null)
- {
- MessageBox.Show("未选择任何炉号,请选择炉号后进行保存操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- if (this.ultraGridPlan.ActiveRow == null)
- {
- factoryId = PlineCode;
- ResultRs.JudgeStoveNo = ActiveJUDGE_STOVE_NO;
- }
- else
- {
- ResultRs.JudgeStoveNo = this.ultraGridPlan.ActiveRow.Cells["JUDGE_STOVE_NO"].Value.ToString();
- factoryId = this.ultraGridPlan.ActiveRow.Cells["Pline_Code"].Value.ToString();
- }
- if (ActiveStatus == "未开始连轧")
- {
- MessageBox.Show("炉号:【" + BaseMethod.getJudgeStoveNo(ResultRs.JudgeStoveNo.ToString()) + "】未开始进行连轧,不允许进行保存操作!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- //if (ActiveStatus == "已完成连轧")
- //{
- // MessageBox.Show("炉号:【" + ResultRs.JudgeStoveNo + "】已完成连轧,不允许进行保存操作!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- // return;
- //}
- //if (MessageUtil.ShowYesNoAndQuestion("确认炉号【" + ResultRs.JudgeStoveNo.ToString().Substring(0, 6) + "】保存实绩?") == DialogResult.No)
- //{
- // return;
- //}
- if (factoryId != "C012")//其他线
- {
- //this.rollResult1.UltraGrid2.Update();
- this.rollResult1.UltraGrid2.UpdateData();
- MilRollingResultEntity rr = new MilRollingResultEntity();
- this.rollResult_Arssel1.Value = rr;
- flag = "0";
- if (string.IsNullOrEmpty(ugrg.Cells["SCRAPNUM"].Text.ToString().Trim()))
- {
- ResultRs.ScrapNum = 0;
- if (!string.IsNullOrEmpty(this.rollingCard1.UltraGrid4.ActiveRow.Cells["QualifiedNum4"].Text.ToString().Trim()))
- {
- ResultRs.QualifiedNum = (int.Parse(this.rollingCard1.UltraGrid4.ActiveRow.Cells["QualifiedNum4"].Text.ToString().Trim()) - 0).ToString();
- }
- else
- {
- ResultRs.QualifiedNum = 0;
- }
- }
- else
- {
- ResultRs.ScrapNum = ugrg.Cells["SCRAPNUM"].Value.ToString().Trim();
- if (!string.IsNullOrEmpty(this.rollingCard1.UltraGrid4.ActiveRow.Cells["QualifiedNum4"].Text.ToString().Trim()))
- {
- ResultRs.QualifiedNum = (int.Parse(this.rollingCard1.UltraGrid4.ActiveRow.Cells["QualifiedNum4"].Text.ToString().Trim()) - int.Parse(ugrg.Cells["SCRAPNUM"].Text.ToString().Trim())).ToString();
- }
- }
- ResultRs.Rollingnum = ugrg.Cells["ROLLINGNUM"].Value.ToString().Trim();
- //ResultRs.ScrapNum = ugrg.Cells["SCRAPNUM"].Value.ToString().Trim();
- ResultRs.Changeclassnum = ugrg.Cells["CHANGECLASSNUM"].Value.ToString().Trim();
- ResultRs.Remark = ugrg.Cells["Remark1"].Value.ToString().Trim();
- ResultRs.VrsSpeed = ugrg.Cells["VXSSPEED"].Value.ToString().Trim();
- ResultRs.Tubesize = ugrg.Cells["SIZE"].Text.ToString().Trim();
- ResultRs.InsertLength = ugrg.Cells["INSERTLENGTH"].Value.ToString().Trim();
- ResultRs.Emspeed = ugrg.Cells["EMSPEED"].Value.ToString().Trim();
- ResultRs.LimitSpeed = ugrg.Cells["SPEEDLIMIT"].Value.ToString().Trim();
- ResultRs.Ext1RackSpeed = ugrg.Cells["EXT1SPEED"].Value.ToString().Trim();
- ResultRs.RackSpeed1 = ugrg.Cells["ROLLSPEED1"].Value.ToString().Trim();
- ResultRs.RackSpeed2 = ugrg.Cells["ROLLSPEED2"].Value.ToString().Trim();
- ResultRs.RackSpeed3 = ugrg.Cells["ROLLSPEED3"].Value.ToString().Trim();
- ResultRs.RackSpeed4 = ugrg.Cells["ROLLSPEED4"].Value.ToString().Trim();
- ResultRs.RackSpeed5 = ugrg.Cells["ROLLSPEED5"].Value.ToString().Trim();
- ResultRs.RackSpeed6 = ugrg.Cells["ROLLSPEED6"].Value.ToString().Trim();
- ResultRs.RackSpeed7 = ugrg.Cells["ROLLSPEED7"].Value.ToString().Trim();
- ResultRs.RackSpace1 = ugrg.Cells["ROLLSPACE1"].Value.ToString().Trim();
- ResultRs.RackSpace2 = ugrg.Cells["ROLLSPACE2"].Value.ToString().Trim();
- ResultRs.RackSpace3 = ugrg.Cells["ROLLSPACE3"].Value.ToString().Trim();
- ResultRs.RackSpace4 = ugrg.Cells["ROLLSPACE4"].Value.ToString().Trim();
- ResultRs.RackSpace5 = ugrg.Cells["ROLLSPACE5"].Value.ToString().Trim();
- ResultRs.RackSpace6 = ugrg.Cells["ROLLSPACE6"].Value.ToString().Trim();
- ResultRs.RackSpace7 = ugrg.Cells["ROLLSPACE7"].Value.ToString().Trim();
- ResultRs.RollingForce1 = ugrg.Cells["ROLLINGFORCE1"].Value.ToString().Trim();
- ResultRs.RollingForce2 = ugrg.Cells["ROLLINGFORCE2"].Value.ToString().Trim();
- ResultRs.RollingForce3 = ugrg.Cells["ROLLINGFORCE3"].Value.ToString().Trim();
- ResultRs.RollingForce4 = ugrg.Cells["ROLLINGFORCE4"].Value.ToString().Trim();
- ResultRs.RollingForce5 = ugrg.Cells["ROLLINGFORCE5"].Value.ToString().Trim();
- ResultRs.RollingForce6 = ugrg.Cells["ROLLINGFORCE6"].Value.ToString().Trim();
- ResultRs.RollingForce7 = ugrg.Cells["ROLLINGFORCE7"].Value.ToString().Trim();
- ResultRs.StartTime = ugrg.Cells["StartTime"].Value.ToString().Trim();
- ResultRs.EndTime = ugrg.Cells["EndTime"].Value.ToString().Trim();//--
- ResultRs.StartRollTemp = ugrg.Cells["startRollTemp"].Value.ToString().Trim();
- ResultRs.ColUser = this.UserInfo.GetUserName();
- ResultRs.ColShift = this.UserInfo.GetUserOrder();
- ResultRs.ColGroup = this.UserInfo.GetUserGroup();
- ResultRs.ProPlanId = proPlanId;
- ResultRs.GxPlanNo = gxPlanNo;
- //ResultRs.JudgeStoveNo = heatNo;
- ResultRs.PlineCode = flag;
- if (ResultRs.Changeclassnum.ToString() == "")
- {
- ResultRs.Changeclassnum = "0";
- }
- //if (int.Parse(ResultRs.Changeclassnum.ToString()) - int.Parse(ResultRs.QualifiedNum.ToString()) > 0)
- //{
- // MessageBox.Show("交接班支数不允许大于轧制支数!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- // return;
- //}
- if (string.IsNullOrEmpty(ResultRs.StartTime.ToString()))
- {
- MessageBox.Show("开始时间不能为空,请输入正确的开始时间");
- return;
- }
- //查询结炉状态,已结炉的计划 结炉时间不能为空
- DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getNodeStatus", new object[] { ActiveJUDGE_STOVE_NO, ActiveResultNo, proPlanId, gxPlanNo }, this.ob);
- if (int.Parse(dt.Rows[0][0].ToString()) > 39)
- {
- if (string.IsNullOrEmpty(ResultRs.EndTime.ToString()))
- {
- MessageBox.Show("结束时间不能为空,请输入正确的结束时间");
- return;
- }
- //开始时间必须小于结束时间
- if (DateTime.Parse(ResultRs.StartTime.ToString()) > DateTime.Parse(ResultRs.EndTime.ToString()))
- {
- MessageBox.Show("结束时间不能小于开始时间。");
- return;
- }
- }
- count = ServerHelper.SetData("com.steering.mes.zgmil.coup.FrmRollingRPipeResult.resultSave", new object[] { ResultRs, _UpdateFlag }, this.ob);
- this.rollResult_Arssel1.IsCellSelect = false;
- this.rollResult1.IsCellSelect = false;
- if (count > 0)
- {
- if (ShowMessageFlag == 0)
- {
- MessageBox.Show("连轧实绩保存成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
- }
- }
- }
- else//阿塞尔线
- {
- ResultRs.Clear();
- this.rollResult_Arssel1.UltraGrid2.Update();
- MilRollingResultEntity rr = new MilRollingResultEntity();
- this.rollResult1.Value = rr;
- flag = "1";
- if (string.IsNullOrEmpty(uRow.Cells["SCRAPNUM"].Text.ToString().Trim()))
- {
- ResultRs.ScrapNum = 0;
- if (this.rollingCard1.UltraGrid4.ActiveRow.Cells["QualifiedNum4"].Text.ToString().Trim() == "")
- {
- ResultRs.QualifiedNum = "0";
- }
- else
- {
- ResultRs.QualifiedNum = (int.Parse(this.rollingCard1.UltraGrid4.ActiveRow.Cells["QualifiedNum4"].Text.ToString().Trim()) - 0).ToString();
- }
- }
- else
- {
- ResultRs.ScrapNum = uRow.Cells["SCRAPNUM"].Text.ToString().Trim();
- if (this.rollingCard1.UltraGrid4.ActiveRow.Cells["QualifiedNum4"].Text.ToString().Trim() == "")
- {
- //MessageBox.Show("轧制支数为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- }
- else
- {
- ResultRs.QualifiedNum = (int.Parse(this.rollingCard1.UltraGrid4.ActiveRow.Cells["QualifiedNum4"].Text.ToString().Trim()) - int.Parse(uRow.Cells["SCRAPNUM"].Text.ToString().Trim())).ToString();
- }
- }
- ResultRs.Rollingnum = ugrg.Cells["ROLLINGNUM"].Value.ToString().Trim();
- //ResultRs.ScrapNum = uRow.Cells["SCRAPNUM"].Value.ToString().Trim();
- ResultRs.Changeclassnum = uRow.Cells["CHANGECLASSNUM"].Value.ToString().Trim();
- ResultRs.Remark = uRow.Cells["REMARK"].Value.ToString().Trim();
- ResultRs.Tubesize = uRow.Cells["TUBESIZE"].Text.ToString().Trim();
- ResultRs.QoRollerThroatDiameter = uRow.Cells["QUICKOPEN"].Value.ToString().Trim();
- ResultRs.QcRollerThroatDiameter = uRow.Cells["QUICKCLOSE"].Value.ToString().Trim();
- ResultRs.RollingThroatDiameter = uRow.Cells["ROLLING"].Value.ToString().Trim();
- ResultRs.RollerBiteSpeed = uRow.Cells["BITE"].Value.ToString().Trim();
- ResultRs.RollingAngle = uRow.Cells["ROLLTAPER"].Text.ToString().Trim();
- ResultRs.FeedAngle = uRow.Cells["FEEDANGLE"].Value.ToString().Trim();
- ResultRs.RollingSpeed = uRow.Cells["ROLLINGSPEED"].Value.ToString().Trim();
- ResultRs.StartTime = uRow.Cells["START_TIME"].Value.ToString().Trim();
- ResultRs.EndTime = uRow.Cells["END_TIME"].Value.ToString().Trim();
- ResultRs.StartRollTemp = uRow.Cells["startRollTemp"].Value.ToString().Trim();
- ResultRs.ColUser = this.UserInfo.GetUserName();
- ResultRs.ColShift = this.UserInfo.GetUserOrder();
- ResultRs.ColGroup = this.UserInfo.GetUserGroup();
- ResultRs.ProPlanId = proPlanId;
- ResultRs.GxPlanNo = gxPlanNo;
- //ResultRs.JudgeStoveNo = heatNo;
- ResultRs.PlineCode = flag;
- if (ResultRs.Changeclassnum.ToString() == "")
- {
- ResultRs.Changeclassnum = "0";
- }
- //if (int.Parse(ResultRs.Changeclassnum.ToString()) - int.Parse(ResultRs.QualifiedNum.ToString()) > 0)
- //{
- // MessageBox.Show("交接班支数不允许大于轧制支数!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- // return;
- //}
- if (string.IsNullOrEmpty(ResultRs.StartTime.ToString()))
- {
- MessageBox.Show("开始时间不能为空,请输入正确的开始时间");
- return;
- }
- //查询结炉状态,已结炉的计划 结炉时间不能为空
- DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getNodeStatus", new object[] { ActiveJUDGE_STOVE_NO, ActiveResultNo, proPlanId, gxPlanNo }, this.ob);
- if (int.Parse(dt.Rows[0][0].ToString()) > 39)
- {
- if (string.IsNullOrEmpty(ResultRs.EndTime.ToString()))
- {
- MessageBox.Show("结束时间不能为空,请输入正确的结束时间");
- return;
- }
- //开始时间必须小于结束时间
- if (DateTime.Parse(ResultRs.StartTime.ToString()) > DateTime.Parse(ResultRs.EndTime.ToString()))
- {
- MessageBox.Show("结束时间不能小于开始时间。");
- return;
- }
- }
- count = ServerHelper.SetData("com.steering.mes.zgmil.coup.FrmRollingRPipeResult.resultSave", new object[] { ResultRs, _UpdateFlag }, this.ob);
- this.rollResult_Arssel1.IsCellSelect = false;
- this.rollResult1.IsCellSelect = false;
- if (count > 0)
- {
- if (ShowMessageFlag == 0)
- {
- MessageBox.Show("连轧实绩保存成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
- }
- }
- }
- // resultQuery();
- temprollingresult = NativeMethod.GetEntityToEntity(temprollingresult, ResultRs);
- // RackQuery(ActiveJUDGE_STOVE_NO);
- ChangeGridColor();
- PlanQuery();
- }
- /// <summary>
- /// 结炉
- /// </summary>
- private void FeedSawResultNode()
- {
- FeedRowSave();
- //if (this.UserInfo.GetUserOrder() == "0")
- //{
- // MessageBox.Show("常白班不能操作!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- // return;
- //}
- try
- {
- rollResult1.UltraGrid2.UpdateData();
- rollResult_Arssel1.UltraGrid2.UpdateData();
- }
- catch (Exception e)
- {
- MessageBox.Show("请输入正确的时间。");
- return;
- }
- HOTMethod hm = new HOTMethod(this.ob);
- int count = 0;
- string seq = "";
- UltraGridRow ugrg = this.rollResult1.UltraGrid2.Rows[0];
- UltraGridRow uRow = this.rollResult_Arssel1.UltraGrid2.Rows[0];
- //判断是否有重复剔除的坯子
- 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;
- }
- }
- string factoryId = null;
- string flag = "0";
- if (this.ultraGridPlan.ActiveRow == null)
- {
- MessageBox.Show("未选择任何炉号,不允许结炉", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- string heatNo = this.ultraGridPlan.ActiveRow.Cells["JUDGE_STOVE_NO"].Text.ToString().Trim();
- string ResultNo = this.ultraGridPlan.ActiveRow.Cells["ID"].Text.ToString().Trim();
- string LotNo = this.ultraGridPlan.ActiveRow.Cells["LOT_NO"].Text.ToString().Trim();
- string proPlanId = this.ultraGridPlan.ActiveRow.Cells["PRO_PLAN_ID"].Value.ToString();
- string gxPlanNo = this.ultraGridPlan.ActiveRow.Cells["GX_PLAN_NO"].Value.ToString();
- //if (ultraGridPlan.ActiveRow != ultraGridPlan.Rows[0])
- //{ MessageUtil.ShowTips("炉号:【" + BaseMethod.getJudgeStoveNo(HeatNo) + "】之前有未结的炉号,请按顺序结炉!"); return; }
- ResultRs.Clear();
- ResultRs.JudgeStoveNo = heatNo;
- string Status = ultraGridPlan.ActiveRow.Cells["IS_START"].Value.ToString();
- if (Status == "已完成连轧")
- {
- MessageBox.Show("炉号:【" + BaseMethod.getJudgeStoveNo(heatNo) + "】已完成连轧,不允许结炉!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- factoryId = this.ultraGridPlan.ActiveRow.Cells["Pline_Code"].Value.ToString();
- if (Status != "已开始连轧")
- {
- MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(heatNo) + "】未开始连轧,不允许结炉!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- if (hm.NodeGetWaitChangeMat(heatNo, ResultNo, 3) > 0)
- {
- MessageBox.Show("管号【" + hm.NodeGetWaitChangeMat(heatNo, ResultNo, 3) + "】未接班确认,不能结炉");
- return;
- }
- if (factoryId != "C012")//其他线
- {
- //this.rollResult1.UltraGrid2.Update();
- this.rollResult1.UltraGrid2.UpdateData();
- MilRollingResultEntity rr = new MilRollingResultEntity();
- this.rollResult_Arssel1.Value = rr;
- flag = "0";
- //剔除支数
- ResultRs.ScrapNum = "0";
- //查询本道工序剔除支数
- DataTable dtScrapNum = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getScrapNum", new object[] { heatNo, ResultNo, 3, PlineCode, proPlanId, gxPlanNo }, this.ob);
- if (dtScrapNum.Rows.Count > 0)
- {
- if (!string.IsNullOrEmpty(dtScrapNum.Rows[0][0].ToString()))
- {
- ResultRs.ScrapNum = dtScrapNum.Rows[0][0].ToString();
- }
- }
- //if (ugrg.Cells["SCRAPNUM"].Text.ToString().Trim() == "")
- //{
- // ResultRs.QualifiedNum = (int.Parse(this.rollingCard1.UltraGrid4.ActiveRow.Cells["QualifiedNum4"].Text.ToString().Trim()) - 0).ToString();
- //}
- //else
- //{
- // if (!string.IsNullOrEmpty(this.rollingCard1.UltraGrid4.ActiveRow.Cells["QualifiedNum4"].Text.ToString()))
- // {
- // if (int.Parse(this.rollingCard1.UltraGrid4.ActiveRow.Cells["QualifiedNum4"].Text.ToString().Trim()) > int.Parse(ugrg.Cells["SCRAPNUM"].Text.ToString().Trim()))
- // {
- // ResultRs.QualifiedNum = (int.Parse(this.rollingCard1.UltraGrid4.ActiveRow.Cells["QualifiedNum4"].Text.ToString().Trim()) - int.Parse(ugrg.Cells["SCRAPNUM"].Text.ToString().Trim())).ToString();
- // }
- // else
- // {
- // // MessageBox.Show("存在上一道工序已经剔除的管坯在本道工序也剔除了,请回退后再进行结炉操作", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- // // return;
- // }
- // }
- // else
- // {
- // MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(HeatNo) + "】上个工序未结炉,不允许结炉!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- // return;
- // }
- //}
- //合格支数
- DataTable dtQANum = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getQANumBefore", new object[] { heatNo, ResultNo, 3, PlineCode, proPlanId, gxPlanNo }, this.ob);
- if (dtQANum.Rows.Count > 0)
- {
- if (!string.IsNullOrEmpty(dtQANum.Rows[0][0].ToString()))
- {
- if (int.Parse(dtQANum.Rows[0][0].ToString()) > int.Parse(ResultRs.ScrapNum.ToString()))
- {
- //合格支数
- ResultRs.Rollingnum = int.Parse(dtQANum.Rows[0][0].ToString()) - int.Parse(ResultRs.ScrapNum.ToString());
- ResultRs.QualifiedNum = int.Parse(dtQANum.Rows[0][0].ToString()) - int.Parse(ResultRs.ScrapNum.ToString());
- }
- else
- {
- ResultRs.Rollingnum = 0;
- ResultRs.QualifiedNum = 0;
- }
- }
- else
- {
- ResultRs.Rollingnum = 0;
- ResultRs.QualifiedNum = 0;
- }
- }
- //ResultRs.Rollingnum = ugrg.Cells["ROLLINGNUM"].Value.ToString().Trim();
- //ResultRs.ScrapNum = ugrg.Cells["SCRAPNUM"].Value.ToString().Trim();
- ResultRs.Changeclassnum = ugrg.Cells["CHANGECLASSNUM"].Value.ToString().Trim();
- ResultRs.Remark = ugrg.Cells["Remark1"].Value.ToString().Trim();
- ResultRs.VrsSpeed = ugrg.Cells["VXSSPEED"].Value.ToString().Trim();
- ResultRs.Tubesize = ugrg.Cells["SIZE"].Text.ToString().Trim();
- ResultRs.InsertLength = ugrg.Cells["INSERTLENGTH"].Value.ToString().Trim();
- ResultRs.Emspeed = ugrg.Cells["EMSPEED"].Value.ToString().Trim();
- ResultRs.LimitSpeed = ugrg.Cells["SPEEDLIMIT"].Value.ToString().Trim();
- ResultRs.Ext1RackSpeed = ugrg.Cells["EXT1SPEED"].Value.ToString().Trim();
- ResultRs.RackSpeed1 = ugrg.Cells["ROLLSPEED1"].Value.ToString().Trim();
- ResultRs.RackSpeed2 = ugrg.Cells["ROLLSPEED2"].Value.ToString().Trim();
- ResultRs.RackSpeed3 = ugrg.Cells["ROLLSPEED3"].Value.ToString().Trim();
- ResultRs.RackSpeed4 = ugrg.Cells["ROLLSPEED4"].Value.ToString().Trim();
- ResultRs.RackSpeed5 = ugrg.Cells["ROLLSPEED5"].Value.ToString().Trim();
- ResultRs.RackSpeed6 = ugrg.Cells["ROLLSPEED6"].Value.ToString().Trim();
- ResultRs.RackSpeed7 = ugrg.Cells["ROLLSPEED7"].Value.ToString().Trim();
- ResultRs.RackSpace1 = ugrg.Cells["ROLLSPACE1"].Value.ToString().Trim();
- ResultRs.RackSpace2 = ugrg.Cells["ROLLSPACE2"].Value.ToString().Trim();
- ResultRs.RackSpace3 = ugrg.Cells["ROLLSPACE3"].Value.ToString().Trim();
- ResultRs.RackSpace4 = ugrg.Cells["ROLLSPACE4"].Value.ToString().Trim();
- ResultRs.RackSpace5 = ugrg.Cells["ROLLSPACE5"].Value.ToString().Trim();
- ResultRs.RackSpace6 = ugrg.Cells["ROLLSPACE6"].Value.ToString().Trim();
- ResultRs.RackSpace7 = ugrg.Cells["ROLLSPACE7"].Value.ToString().Trim();
- ResultRs.RollingForce1 = ugrg.Cells["ROLLINGFORCE1"].Value.ToString().Trim();
- ResultRs.RollingForce2 = ugrg.Cells["ROLLINGFORCE2"].Value.ToString().Trim();
- ResultRs.RollingForce3 = ugrg.Cells["ROLLINGFORCE3"].Value.ToString().Trim();
- ResultRs.RollingForce4 = ugrg.Cells["ROLLINGFORCE4"].Value.ToString().Trim();
- ResultRs.RollingForce5 = ugrg.Cells["ROLLINGFORCE5"].Value.ToString().Trim();
- ResultRs.RollingForce6 = ugrg.Cells["ROLLINGFORCE6"].Value.ToString().Trim();
- ResultRs.RollingForce7 = ugrg.Cells["ROLLINGFORCE7"].Value.ToString().Trim();
- ResultRs.StartTime = ugrg.Cells["StartTime"].Value.ToString().Trim();
- ResultRs.StartRollTemp = ugrg.Cells["startRollTemp"].Value.ToString().Trim();
- ResultRs.ColUser = _UserName;
- ResultRs.UserId = _UserID;
- ResultRs.ProPlanId = proPlanId;
- ResultRs.GxPlanNo = gxPlanNo;
- ResultRs.ColShift = this.UserInfo.GetUserOrder();
- ResultRs.ColGroup = this.UserInfo.GetUserGroup();
- //ResultRs.JudgeStoveNo = heatNo;
- ResultRs.PlineCode = flag;
- if (ResultRs.Changeclassnum.ToString() == "")
- {
- ResultRs.Changeclassnum = "0";
- }
- }
- else//阿塞尔线
- {
- ResultRs.Clear();
- this.rollResult_Arssel1.UltraGrid2.Update();
- MilRollingResultEntity rr = new MilRollingResultEntity();
- this.rollResult1.Value = rr;
- flag = "1";
- //剔除支数
- ResultRs.ScrapNum = "0";
- //查询本道工序剔除支数
- DataTable dtScrapNum = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getScrapNum", new object[] { heatNo, ResultNo, 3, PlineCode, proPlanId, gxPlanNo }, this.ob);
- if (dtScrapNum.Rows.Count > 0)
- {
- if (!string.IsNullOrEmpty(dtScrapNum.Rows[0][0].ToString()))
- {
- ResultRs.ScrapNum = dtScrapNum.Rows[0][0].ToString();
- }
- }
- //else
- //{
- // if (this.rollingCard1.UltraGrid4.ActiveRow.Cells["QualifiedNum4"].Text.ToString().Trim() == "")
- // {
- // MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(HeatNo) + "】上个工序未结炉,不允许结炉!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- // return;
- // }
- // else
- // {
- // if (int.Parse(this.rollingCard1.UltraGrid4.ActiveRow.Cells["QualifiedNum4"].Text.ToString().Trim()) > int.Parse(uRow.Cells["SCRAPNUM"].Text.ToString().Trim()))
- // {
- // ResultRs.QualifiedNum = (int.Parse(this.rollingCard1.UltraGrid4.ActiveRow.Cells["QualifiedNum4"].Text.ToString().Trim()) - int.Parse(uRow.Cells["SCRAPNUM"].Text.ToString().Trim())).ToString();
- // }
- // else
- // {
- // MessageBox.Show("存在上一道工序已经剔除的管坯在本道工序也剔除了,请回退后再进行结炉操作", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- // return;
- // }
- // }
- //}
- //ResultRs.Rollingnum = ugrg.Cells["ROLLINGNUM"].Value.ToString().Trim();
- //合格支数
- DataTable dtQANum = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getQANumBefore", new object[] { heatNo, ResultNo, 3, PlineCode, proPlanId, gxPlanNo }, this.ob);
- if (dtQANum.Rows.Count > 0)
- {
- if (!string.IsNullOrEmpty(dtQANum.Rows[0][0].ToString()))
- {
- if (int.Parse(dtQANum.Rows[0][0].ToString()) > int.Parse(ResultRs.ScrapNum.ToString()))
- {
- //合格支数
- ResultRs.Rollingnum = int.Parse(dtQANum.Rows[0][0].ToString()) - int.Parse(ResultRs.ScrapNum.ToString());
- ResultRs.QualifiedNum = int.Parse(dtQANum.Rows[0][0].ToString()) - int.Parse(ResultRs.ScrapNum.ToString());
- }
- else
- {
- ResultRs.Rollingnum = 0;
- ResultRs.QualifiedNum = 0;
- }
- }
- else
- {
- ResultRs.Rollingnum = 0;
- ResultRs.QualifiedNum = 0;
- }
- }
- // ResultRs.ScrapNum = uRow.Cells["SCRAPNUM"].Value.ToString().Trim();
- ResultRs.Changeclassnum = uRow.Cells["CHANGECLASSNUM"].Value.ToString().Trim();
- ResultRs.Remark = uRow.Cells["REMARK"].Value.ToString().Trim();
- ResultRs.Tubesize = uRow.Cells["TUBESIZE"].Text.ToString().Trim();
- ResultRs.QoRollerThroatDiameter = uRow.Cells["QUICKOPEN"].Value.ToString().Trim();
- ResultRs.QcRollerThroatDiameter = uRow.Cells["QUICKCLOSE"].Value.ToString().Trim();
- ResultRs.RollingThroatDiameter = uRow.Cells["ROLLING"].Value.ToString().Trim();
- ResultRs.RollerBiteSpeed = uRow.Cells["BITE"].Value.ToString().Trim();
- ResultRs.RollingAngle = uRow.Cells["ROLLTAPER"].Text.ToString().Trim();
- ResultRs.FeedAngle = uRow.Cells["FEEDANGLE"].Value.ToString().Trim();
- ResultRs.RollingSpeed = uRow.Cells["ROLLINGSPEED"].Value.ToString().Trim();
- ResultRs.StartTime = uRow.Cells["START_TIME"].Value.ToString().Trim();
- ResultRs.StartRollTemp = uRow.Cells["startRollTemp"].Value.ToString().Trim();
- ResultRs.ColUser = _UserName;
- ResultRs.UserId = _UserID;
- ResultRs.ProPlanId = proPlanId;
- ResultRs.GxPlanNo = gxPlanNo;
- ResultRs.JudgeStoveNo = ActiveJUDGE_STOVE_NO;
- ResultRs.LotNo = lotNo;
- ResultRs.PlineCode = PlineCode;
- ResultRs.ColShift = this.UserInfo.GetUserOrder();
- ResultRs.ColGroup = this.UserInfo.GetUserGroup();
- //ResultRs.JudgeStoveNo = heatNo;
- ResultRs.PlineCode = flag;
- if (ResultRs.Changeclassnum.ToString() == "")
- {
- ResultRs.Changeclassnum = "0";
- }
- //if (int.Parse(ResultRs.Changeclassnum.ToString()) - int.Parse(ResultRs.QualifiedNum.ToString()) > 0)
- //{
- // MessageBox.Show("交接班支数不允许大于轧制支数!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- // return;
- //}
- }
- double DBHeight = 0;
- double BurnningRate = 0;
- double DBNum = 1;
- 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());
- }
- }
- string QANum = "0";
- if (!string.IsNullOrEmpty(this.rollingCard1.UltraGrid4.ActiveRow.Cells["QualifiedNum4"].Text.ToString().Trim()))
- {
- QANum = (int.Parse(this.rollingCard1.UltraGrid4.ActiveRow.Cells["QualifiedNum4"].Text.ToString().Trim()) - int.Parse(ugrg.Cells["SCRAPNUM"].Text.ToString().Trim())).ToString();
- }
- ResultRs.QaTon = DBHeight * (1 - (BurnningRate / 100)) * double.Parse(QANum.ToString());
- DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmRollingRPipeResult.perForationResultQuery", new object[] { heatNo, proPlanId, gxPlanNo }, this.ob);
- if (dt.Rows.Count > 0)
- {
- if (dt.Rows[0]["NODE_FUR_FLAG"].ToString() == "1")
- {
- if (MessageUtil.ShowYesNoAndQuestion("确认炉号【" + BaseMethod.getJudgeStoveNo(heatNo) + "】结炉?") == DialogResult.No)
- {
- return;
- }
- if (count == 0)
- {
- //写进程表
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.zgmil.coup.FurResult";
- ccp.MethodName = "updateMilSlab";
- ccp.ServerParams = new object[] { heatNo, "4", 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, "4", "4", proPlanId, gxPlanNo, lotNo, PlineCode };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("修改成功!"))
- {
- #region 修改连轧调度日志
- //查询有效最大管序号
- int MaxSeq = 0;
- DataTable dtSeq = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmRollingRPipeResult.getMaxSeq", new object[] { ActiveJUDGE_STOVE_NO, ResultNo, proPlanId, gxPlanNo }, this.ob);
- if (dtSeq.Rows.Count > 0)
- {
- MaxSeq = int.Parse(dtSeq.Rows[0][0].ToString());
- }
- //查询上个班交班支数
- int BeforeChangeNum = 0;
- DataTable dtChangeNum = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getChangeSeq", new object[] { ActiveJUDGE_STOVE_NO, ResultNo, 3, 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());
- }
- }
- MilControlLogEntity ControlLogEntity = new MilControlLogEntity();
- //查询本班合格支数
- string[] Temp = GetDbHeightBruningRate(heatNo, ResultNo, BeforeChangeNum+1, MaxSeq).Split('-');
- string QaTon = Temp[0];
- string ScrapTon = Temp[1];
- string ScrapNum1 = Temp[2];
- ControlLogEntity.QualifiedNum = (MaxSeq - BeforeChangeNum - int.Parse(ScrapNum1.ToString3())).ToString3();
- ControlLogEntity.ScrapNum = ScrapNum1.ToString3();
- ControlLogEntity.QualifiedWt = QaTon.ToString3();
- ControlLogEntity.ScrapWt = ScrapTon.ToString3();
- ControlLogEntity.JudgeStoveNo = ActiveJUDGE_STOVE_NO;
- ControlLogEntity.LotNo = ActiveLotNo;
- ControlLogEntity.UserId = _UserID;
- ControlLogEntity.UserName = _UserName;
- ControlLogEntity.ProPlanId = proPlanId;
- ControlLogEntity.GxPlanNo = gxPlanNo;
- ControlLogEntity.ProBc = Shift;
- ControlLogEntity.ProBz = Group;
- ControlLogEntity.NodeFlag = "1";
- if (int.Parse(ControlLogEntity.QualifiedNum) < 1)
- {
- if (MessageUtil.ShowYesNoAndQuestion("合格支数为" +ControlLogEntity.QualifiedNum+"支,是否确认继续结炉?") == DialogResult.No)
- {
- return;
- }
- }
- DateTime SeverTime = NativeMethod.GetSeverTime(this.ob);
- ControlLogEntity.ProcDate = SeverTime.ToString("yyyyMMdd");
- ControlLogEntity.BalYearMonth = SeverTime.ToString("yyyyMM");
- string a = SeverTime.ToShortTimeString();
- string Time = SeverTime.ToLongTimeString();
- Time = Time.Replace(":", "");
- if (int.Parse(Time) > 120000 && int.Parse(Time) < 240000 && Shift == "3")
- {
- ControlLogEntity.ProcDate = SeverTime.AddDays(1).ToString("yyyyMMdd");
- ControlLogEntity.BalYearMonth = SeverTime.AddDays(5).ToString("yyyyMM");
- }
- //if (_UpdateFlag == "0")
- //{
- if (BeforeChangeNum == 0)
- {
- ControlLogEntity.ChangeShiftFlag = "0";
- //int count2 = ServerHelper.SetData("com.steering.mes.zgmil.coup.FrmRollingRPipeResult.changeShiftGroupUpdateContralLog", new object[] { ControlLogEntity }, this.ob);
- }
- else
- {
- ControlLogEntity.ChangeShiftFlag = "2";
- //int count1 = ServerHelper.SetData("com.steering.mes.zgmil.coup.FrmRollingRPipeResult.changeShiftGroupUpdateContralLog", new object[] { ControlLogEntity }, this.ob);
- }
- //}
- #endregion
- ResultRs.LotNo = lotNo;
- ResultRs.PlineCode = PlineCode;
- count = ServerHelper.SetData("com.steering.mes.zgmil.coup.FrmRollingRPipeResult.endStoveForMainPlan", new object[] { ResultRs, ControlLogEntity }, this.ob);
- //
- NativeMethodNew na = new NativeMethodNew(this.ob);
- // na.InsertSTAferDoubleClick(heatNo, 3, "1", proPlanId, gxPlanNo);
- NativeMethod.CheckNodeMatStatus(heatNo, proPlanId, gxPlanNo, 3, this.ob);
- if (count > 0)
- {
- if (PlineCode.Equals("C008") || PlineCode.Equals("C009") || PlineCode.Equals("C012") || PlineCode.Equals("C017") || PlineCode.Equals("C072"))
- {
- //插入MIL_SLAB_SCRAP表
- count = ServerHelper.SetData("com.steering.mes.zgmil.coup.FeedSawResult.scrapNodeMat", new object[] { heatNo, 4, 0, PlineCode, proPlanId, gxPlanNo }, this.ob);
- count = ServerHelper.SetData("com.steering.mes.zgmil.coup.FeedSawResult.scrapNodeMat", new object[] { heatNo, 5, 0, PlineCode, proPlanId, gxPlanNo }, this.ob);
- }
- else
- {
- //插入MIL_SLAB_SCRAP表
- count = ServerHelper.SetData("com.steering.mes.zgmil.coup.FeedSawResult.scrapNodeMat", new object[] { heatNo, 4, 0, PlineCode, proPlanId, gxPlanNo }, this.ob);
- }
- if (count > 0)
- {
- MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(heatNo) + "】结炉完成!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
-
-
- this.rollResult_Arssel1.IsCellSelect = false;
- this.rollResult1.IsCellSelect = false;
- temprollingresult = NativeMethod.GetEntityToEntity(temprollingresult, ResultRs);
- //刷新主表
- DataTable dt1 = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getSingleMainPlan", new object[] { QueryMainPlan, 4 }, this.ob);
- GridHelper.CopyDataToDatatable(ref dt1, ref dtPlan, true);
- //ultraGridPlan.DisplayLayout.Bands[0].PerformAutoResizeColumns(true, PerformAutoSizeType.AllRowsInBand);
- ChangeCellName();
- ChangeGridColor();
- RackQuery(heatNo);
- 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;
- }
- }
- }
- }
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- }
- else
- {
- MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(heatNo) + "】上个工序未结炉,不允许结炉!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- }
- }
- else
- {
- MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(heatNo) + "】上个工序未结炉,不允许结炉!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- }
- }
- }
- }
- /// <summary>
- /// 开始回退
- /// </summary>
- private void StartBack()
- {
- if (ultraGridPlan.Rows.Count > 0)
- {
- if (this.ultraGridPlan.ActiveRow == null)
- {
- MessageBox.Show("请选择需要回退的炉号!!!");
- return;
- }
- UltraGridRow ugr = ultraGridPlan.ActiveRow;
- string JudgeStoveNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
- string ResultNo = ugr.Cells["ID"].Value.ToString();
- string StartStatus = ugr.Cells["IS_START"].Value.ToString();
- if (StartStatus == "已完成连轧")
- {
- MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】已结炉,不能开始回退!!!!");
- return;
- }
- if (StartStatus == "未开始连轧")
- {
- MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】未开始连轧,不能开始回退!!!!");
- return;
- }
- //NativeMethodNew nvw = new NativeMethodNew(this.ob);
- //if (PlineCode.Equals("C009") || PlineCode.Equals("C012") || PlineCode.Equals("C017"))
- //{
- // if (nvw.isBegineNode(JudgeStoveNo, 5))
- // {
- // MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】已开始定径,不能开始回退!!!!");
- // return;
- // }
- //}
- //else
- //{
- // if (nvw.isBegineNode(JudgeStoveNo, 4))
- // {
- // MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】已入再加热炉,不能开始回退!!!!");
- // return;
- // }
- //}
- if (_UpdateFlag == "0")
- {
- // 0- 开始回退 1-结炉回退
- int count1 = ServerHelper.SetData("com.steering.mes.zgmil.coup.FrmRollingRPipeResult.DeleteControlLog", new object[] { JudgeStoveNo, ActiveLotNo, 0, proPlanId, gxPlanNo }, this.ob);
- }
- int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.FeedSawResult.startBack", new object[] { JudgeStoveNo, ResultNo, 3, PlineCode, proPlanId, gxPlanNo }, this.ob);
- RackQuery(JudgeStoveNo);
- ChangeGridColor();
- PlanQuery();
- }
- }
- /// <summary>
- /// 结炉回退
- /// </summary>
- private void NodeBack()
- {
- if (this.ultraGridPlan.ActiveRow == null)
- {
- MessageBox.Show("请选择需要回退的炉号!!!");
- return;
- }
- UltraGridRow ugr = ultraGridPlan.ActiveRow;
- string JudgeStoveNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
- string ResultNo = ugr.Cells["ID"].Value.ToString();
- string NodeFlag = ugr.Cells["IS_START"].Value.ToString();
- string LotNo = ugr.Cells["LOT_NO"].Value.ToString();
- if (NodeFlag != "已完成连轧")
- {
- MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】未结炉,不能结炉回退!!!!");
- return;
- }
- string SHIFTf = this.UserInfo.GetUserOrder();
- string GROUPf = this.UserInfo.GetUserGroup();
- DataTable dtFlag = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmRollingRPipeResult.getControlStatus", new object[] { JudgeStoveNo, LotNo, SHIFTf, GROUPf, proPlanId, gxPlanNo }, this.ob);
- _UpdateFlag = "0";
- if (dtFlag.Rows.Count > 0)
- {
- _UpdateFlag = dtFlag.Rows[0][0].ToString();
- }
- if (_UpdateFlag == "1")
- {
- MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】在调度室已确认,不能结炉回退!!!!");
- return;
- }
- //查询结炉班次班组
- DataTable dtNodeGroup = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.doNodeBackCheck", new object[] { JudgeStoveNo, ResultNo, 3, proPlanId, gxPlanNo }, this.ob);
- if (dtNodeGroup.Rows.Count > 0)
- {
- string NodeShift = dtNodeGroup.Rows[0][0].ToString();
- string NodeGroup = dtNodeGroup.Rows[0][1].ToString();
- if (Shift == NodeShift && Group == NodeGroup)
- {
- }
- else
- {
- switch (NodeShift)
- {
- case "0":
- NodeShift = "白班";
- break;
- case "1":
- NodeShift = "早班";
- break;
- case "2":
- NodeShift = "中班";
- break;
- case "3":
- NodeShift = "夜班";
- break;
- }
- switch (NodeGroup)
- {
- case "1":
- NodeGroup = "甲班";
- break;
- case "2":
- NodeGroup = "乙班";
- break;
- case "3":
- NodeGroup = "丙班";
- break;
- case "4":
- NodeGroup = "丁班";
- break;
- }
- switch (this.UserInfo.GetUserOrder())
- {
- case "0":
- Shift = "白班";
- break;
- case "1":
- Shift = "早班";
- break;
- case "2":
- Shift = "中班";
- break;
- case "3":
- Shift = "夜班";
- break;
- }
- switch (this.UserInfo.GetUserGroup())
- {
- case "1":
- Group = "甲班";
- break;
- case "2":
- Group = "乙班";
- break;
- case "3":
- Group = "丙班";
- break;
- case "4":
- Group = "丁班";
- break;
- }
- MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】已由" + NodeGroup + "," + NodeShift + "结炉,当班不能结炉回退");
- return;
- }
- }
- DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.doNodeBackCheck", new object[] { JudgeStoveNo, ResultNo, proPlanId, gxPlanNo }, this.ob);
- if (dt.Rows.Count > 0)
- {
- string NodeProcess = ""; //当前炉次结炉工序
- string NodeStatus = dt.Rows[0][0].ToString();
- switch (NodeStatus)
- {
- case "30":
- NodeProcess = "穿孔";
- break;
- case "40":
- NodeProcess = "连轧";
- break;
- case "50":
- NodeProcess = "再加热炉";
- break;
- case "60":
- NodeProcess = "定径";
- break;
- case "70":
- NodeProcess = "分切";
- break;
- case "80":
- NodeProcess = "矫直";
- break;
- case "90":
- NodeProcess = "探伤";
- break;
- case "96":
- NodeProcess = "质检";
- break;
- }
- if (NodeStatus != "40")
- {
- MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】 " + NodeProcess + "工序已结炉,当前工序不能结炉回退");
- return;
- }
- }
- //判断当前炉次下道工序是否结炉 下道工序结炉 - 不允许回退
- //查询当前炉次是否有交班点
- int Seq = 0;
- DataTable dt1 = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.changeFlagQuery", new object[] { JudgeStoveNo, ResultNo, 3, proPlanId, gxPlanNo }, this.ob);
- if (dt1.Rows.Count > 0)
- {
- Seq = int.Parse(dt1.Rows[dt1.Rows.Count - 1][0].ToString());
- }
- if (_UpdateFlag == "0")
- {
- // 0- 开始回退 1-结炉回退
- int count1 = ServerHelper.SetData("com.steering.mes.zgmil.coup.FrmRollingRPipeResult.DeleteControlLog", new object[] { JudgeStoveNo, ActiveLotNo, 1, proPlanId, gxPlanNo }, this.ob);
- }
- int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.FeedSawResult.nodeBack", new object[] { JudgeStoveNo, ResultNo, 3, PlineCode, Seq, 0, 4, proPlanId, gxPlanNo, lotNo }, this.ob);
- RackQuery(JudgeStoveNo);
- ChangeGridColor();
- PlanQuery();
- }
- /// <summary>
- /// 毛管剔除
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ultraGrid1_ClickCellButton(object sender, CellEventArgs e)
- {
- //if (this.UserInfo.GetUserOrder() == "0")
- //{
- // MessageBox.Show("常白班不能操作!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- // return;
- //}
- RackRs.Clear();
- UltraGridRow ugr_pian = ultraGridPlan.ActiveRow;
- string HeatNo = ugr_pian.Cells["JUDGE_STOVE_NO"].Value.ToString();
- UltraGridRow ugr_testingrack = ultraGrid1.ActiveRow;
- HOTMethod hm = new HOTMethod(this.ob);
- DataTable dt = new DataTable();
- int scrapNum = 0;
- int count = 0;
- string ResultNo = ugr_pian.Cells["ID"].Value.ToString();
- string heatNo = this.ultraGrid1.ActiveRow.Cells["JUDGE_STOVE_NO"].Text.ToString().Trim();
- string seq = this.ultraGrid1.ActiveRow.Cells["SEQ"].Text.ToString().Trim();
- string PlanStatuss = ultraGridPlan.ActiveRow.Cells["IS_START"].Value.ToString();
- string MAT_NO = ugr_testingrack.Cells["MAT_NO"].Value.ToString();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.zgmil.coup.EddyCurrentTestingResult";
- ccp.MethodName = "scrapMatCheck";
- ccp.ServerParams = new Object[] { ugr_pian.Cells["JUDGE_STOVE_NO"].Value.ToString(), 4, proPlanId, gxPlanNo };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- int ScrapNumBefore = Convert.ToInt32(ccp.ReturnInfo);
- string shif = ugr_testingrack.Cells["COL_SHIFT"].Value.ToString();
- string group = ugr_testingrack.Cells["COL_GROUP"].Value.ToString();
- //string shifSeq = ""; //待交班的班次
- //string groupSeq = ""; //待交班的班组
- //NativeMethodNew nasssss = new NativeMethodNew(this.ob);
- //if (nasssss.IsRackOperateRolling(shif, group))
- //{
- // MessageBox.Show("序号:【" + seq + "】子管已由" + shif + "," + group + "操作,不允许再进行操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- // return;
- //}
- if (PlanStatuss == "已完成连轧")
- {
- if (e.Cell.Column.Key == "CHANGE_NUM")
- {
- MessageBox.Show("炉号:【" + BaseMethod.getJudgeStoveNo(HeatNo) + "】已完成连轧,不允许交班!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- }
- else if (e.Cell.Column.Key == "BTNCHANGECOM")
- {
- MessageBox.Show("炉号:【" + BaseMethod.getJudgeStoveNo(HeatNo) + "】已完成连轧,不允许接班!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- }
- else
- {
- MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(HeatNo) + "】已完成连轧,不能剔除", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- }
- return;
- }
- if (e.Cell.Column.Key == "DELETE")
- {
- if (ultraGrid1.ActiveRow.Cells["STATUS"].Value.ToString() == "剔除")
- {
- MessageBox.Show("该毛管已被剔除不能再次剔除!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- 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)
- //{
- // MessageUtil.ShowYesNoAndQuestion("该管坯可能是样管,请先从正常管开始剔除。");
- // 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;
- //}
- if (ultraGridPlan.ActiveRow.Cells["IS_START"].Value.ToString() != "已开始连轧")
- {
- MessageBox.Show("炉号:【" + BaseMethod.getJudgeStoveNo(ultraGridPlan.ActiveRow.Cells["JUDGE_STOVE_NO"].Value.ToString()) + "】的毛管未开始连轧,请检查确认后再剔除", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- //查询前几道工序累计剔除多少半成品管(管坯等进行换算)
- if (ultraGrid1.Rows.Count - ScrapNumBefore < int.Parse(ugr_testingrack.Cells["SEQ"].Value.ToString()))
- {
- MessageBox.Show("不存在序号为【" + ugr_testingrack.Cells["SEQ"].Value.ToString() + "】的管号,被其他工序剔除,不能再次剔除!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- //if (ugr_testingrack.Cells["MAT_NO"].Text == "")
- //{
- // MessageBox.Show("不存在序号为【" + ugr_testingrack.Cells["SEQ"].Value.ToString() + "】的管号,被其他工序剔除,不能再次剔除!", "提示:", 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;
- }
- }
- // 有班次交班了,其它班次不能操作。
- foreach (UltraGridRow ugd in ultraGrid1.Rows)
- {
- if (ugd.Cells["CHANGE_FLAG"].Value.ToString().Equals("待接班确认"))
- {
- string shifSeq = ugd.Cells["COL_SHIFT"].Value.ToString();
- string groupSeq = ugd.Cells["COL_GROUP"].Value.ToString();
- NativeMethodNew nasssss = new NativeMethodNew(this.ob);
- if (nasssss.IsRackOperateRolling(shifSeq, groupSeq))
- {
- MessageBox.Show("管号对列已由" + shifSeq + "," + groupSeq + "操作,请先接班确认", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- }
- }
- ResultRs.JudgeStoveNo = heatNo;
- dt.Clear();
- dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmRollingRPipeResult.scrapNumQuery", new object[] { ResultRs }, this.ob);
- if (dt.Rows.Count > 0)
- {
- if (dt.Rows[0]["SCRAP_NUM"].ToString() == "")
- {
- scrapNum = 0;
- }
- else
- {
- scrapNum = int.Parse(dt.Rows[0]["SCRAP_NUM"].ToString());
- }
- }
- //if (MessageUtil.ShowYesNoAndQuestion("是否剔除该毛管") == DialogResult.No)
- //{
- // return;
- //}
- RackRs.ScrapNum = (scrapNum + 1).ToString();
- RackRs.ColUser = UserInfo.GetUserName();
- RackRs.ColGroup = UserInfo.GetUserGroup();
- RackRs.ColShift = UserInfo.GetUserOrder();
- RackRs.Status = "1";
- RackRs.JudgeStoveNo = heatNo;
- RackRs.Seq = seq;
- count = ServerHelper.SetData("com.steering.mes.zgmil.coup.FrmRollingRPipeResult.rackDelete", new object[] { RackRs }, this.ob);
- if (count > 0)
- {
- //新增管列序号表
- 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.FrmRollingRPipeResult.insertScrapSlabSeq", new object[] { ScrapSeq }, this.ob);
- }
- }
- if (e.Cell.Column.Key == "DELBACK")
- {
- //if (MessageUtil.ShowYesNoAndQuestion("是否回退该剔除的坯料") == DialogResult.No)
- //{
- // return;
- //}
- if (!ultraGrid1.ActiveRow.Cells["STATUS"].Value.ToString().Equals("剔除"))
- {
- MessageBox.Show("该坯料未被剔除,请确认后重新选择!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- // 有班次交班了,其它班次不能操作。
- foreach (UltraGridRow ugd in ultraGrid1.Rows)
- {
- if (ugd.Cells["CHANGE_FLAG"].Value.ToString().Equals("待接班确认"))
- {
- string shifSeq = ugd.Cells["COL_SHIFT"].Value.ToString();
- string groupSeq = ugd.Cells["COL_GROUP"].Value.ToString();
- NativeMethodNew nasssss = new NativeMethodNew(this.ob);
- if (nasssss.IsRackOperateRolling(shifSeq, groupSeq))
- {
- MessageBox.Show("管号对列已由" + shifSeq + "," + groupSeq + "操作,请先接班确认", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- }
- }
- NativeMethodNew na = new NativeMethodNew(this.ob);
- int counts = na.DeleteSlabSeq(HeatNo, seq.ToString(), 4, 1, 0, proPlanId, gxPlanNo);
- if (counts > 0)
- {
- // MessageBox.Show("剔料回退成功", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- RackQuery(HeatNo);
- foreach (UltraGridRow ugr_1 in ultraGrid1.Rows)
- {
- if (ugr_1.Cells["SEQ"].Value.ToString() == seq)
- {
- ultraGrid1.ActiveRow = ugr_1;
- }
- }
- }
- else
- {
- MessageBox.Show("剔料回退失败", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- }
- //交班
- if (e.Cell.Column.Key == "CHANGE_NUM")
- {
- string Shift = UserInfo.GetUserOrder();
- string Group = UserInfo.GetUserGroup();
- string User = UserInfo.GetUserName();
- int BeforeChangeNum = 0;
- //查询上个班交班支数
- DataTable dtChangeNum = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getChangeSeq", new object[] { HeatNo, ResultNo, 3, PlineCode, Shift, Group, proPlanId, gxPlanNo }, this.ob);
- if (dtChangeNum.Rows.Count > 0)
- {
- if (!string.IsNullOrEmpty(dtChangeNum.Rows[0][0].ToString()))
- {
- BeforeChangeNum = int.Parse(dtChangeNum.Rows[0][0].ToString());
- }
- }
- int Seq2 = int.Parse(seq);
- if (Seq2 <= BeforeChangeNum)
- {
- MessageBox.Show("前道班次已交班,该支不能再次交班。");
- return;
- }
- if (Seq2 > ultraGrid1.Rows.Count - ScrapNumBefore)
- {
- MessageBox.Show("该支已被前道工序剔除,不能在该支交班");
- return;
- }
- if (ultraGrid1.Rows.Count == Seq2)
- {
- MessageBox.Show("该支是本炉最后一支,请结炉!");
- return;
- }
-
- // 有班次交班了,其它班次不能操作。
- foreach (UltraGridRow ugd in ultraGrid1.Rows)
- {
- if (ugd.Cells["CHANGE_FLAG"].Value.ToString().Equals("待接班确认"))
- {
- string shifSeq = ugd.Cells["COL_SHIFT"].Value.ToString();
- string groupSeq = ugd.Cells["COL_GROUP"].Value.ToString();
- NativeMethodNew nasssss = new NativeMethodNew(this.ob);
- if (nasssss.IsRackOperateRolling(shifSeq, groupSeq))
- {
- MessageBox.Show("管号对列已由" + shifSeq + "," + groupSeq + "操作,请先接班确认", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- }
- }
- //int count1 = ServerHelper.SetData("com.steering.mes.zgmil.coup.FeedSawResult.changeNum", new object[] { heatNo, ResultNo, Seq2, BeforeChangeNum, 0, PlineCode, Shift, Group, _UserName, 4, 0 }, this.ob);
- // ChangeFlag = 1;
- hm.UpdateChangeFlag(ActiveJUDGE_STOVE_NO, ActiveResultNo, "", 3, int.Parse(seq), 0);
- ServerHelper.SetData("com.steering.mes.zgmil.coup.FrmRollingRPipeResult.doSetShiftGroup", new object[] { ActiveJUDGE_STOVE_NO, ActiveResultNo, Seq2, BeforeChangeNum, PlineCode, Shift, Group, User }, this.ob);
- }
- //接班确认
- if (e.Cell.Column.Key == "BTNCHANGECOM")
- {
- string Shift = UserInfo.GetUserOrder();
- string Group = UserInfo.GetUserGroup();
- string User = UserInfo.GetUserName();
- int BeforeChangeNum = 0;
- string shiftSeq = "";
- string groupSeq = "";
- foreach (UltraGridRow ugd in ultraGrid1.Rows)
- {
- if (ugd.Cells["CHANGE_FLAG"].Value.ToString().Equals("待接班确认"))
- {
- shiftSeq = ugd.Cells["COL_SHIFT"].Value.ToString();
- groupSeq = ugd.Cells["COL_GROUP"].Value.ToString();
-
- }
- }
-
- //查询上个班交班支数
- DataTable dtChangeNum = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getChangeSeq", new object[] { HeatNo, ResultNo, 3, PlineCode, Shift, Group, proPlanId, gxPlanNo }, this.ob);
- if (dtChangeNum.Rows.Count > 0)
- {
- if (!string.IsNullOrEmpty(dtChangeNum.Rows[0][0].ToString()))
- {
- BeforeChangeNum = int.Parse(dtChangeNum.Rows[0][0].ToString());
- }
- }
- int WaitChangeSeq = hm.GetWaitChangeSeq(ActiveJUDGE_STOVE_NO, ActiveResultNo, "", 3, 0, proPlanId, gxPlanNo);
- if (WaitChangeSeq == 0)
- {
- MessageBox.Show("没有待交班确认的管号。");
- return;
- }
- if (WaitChangeSeq != int.Parse(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";
- string Date = "";
- if (this.DoRelogin(DoCheck))
- {
- //插入接班确认履历表
- hm.InsertChangeRemuse(Shift, Group, _UserName, "3", PlineCode);
- int Seq2 = int.Parse(seq);
- //int count1 = ServerHelper.SetData("com.steering.mes.zgmil.coup.FeedSawResult.changeNum", new object[] { heatNo, ResultNo, Seq2, BeforeChangeNum, 0, PlineCode, Shift, Group, _UserName, 4, 0 }, this.ob);
- int count1 = ServerHelper.SetData("com.steering.mes.zgmil.coup.FrmRollingRPipeResult.changeNum", new object[] { heatNo, ResultNo, Seq2, BeforeChangeNum, PlineCode, Shift, Group, _UserName }, this.ob);
- ChangeFlag = 1;
- #region 修改连轧日志表
- string gridShift = Shift;
- string gridGroup = Group;
- if(!shiftSeq.Equals("") && !groupSeq.Equals(""))
- {
- switch (shiftSeq)
- {
- case "常白班":
- shiftSeq = "0";
- break;
- case "白班":
- shiftSeq = "0";
- break;
- case "早班":
- shiftSeq = "1";
- break;
- case "中班":
- shiftSeq = "2";
- break;
- case "夜班":
- shiftSeq = "3";
- break;
- }
- switch (groupSeq)
- {
- case "甲":
- groupSeq = "1";
- break;
- case "乙":
- groupSeq = "2";
- break;
- case "丙":
- groupSeq = "3";
- break;
- case "丁":
- groupSeq = "4";
- break;
- }
- gridShift = shiftSeq;
- gridGroup = groupSeq;
- }
-
- //foreach (UltraGridRow ugd in ultraGrid1.Rows)
- //{
- // if (ugd.Cells["CHANGE_FLAG"].Value.ToString().Equals("待接班确认"))
- // {
- // gridShift = ugd.Cells["COL_SHIFT"].Value.ToString();
- // gridGroup = ugd.Cells["COL_GROUP"].Value.ToString();
- // }
- //}
- string[] Temp = GetDbHeightBruningRate(heatNo, ResultNo, BeforeChangeNum, Seq2).Split('-');
- string QaTon = Temp[0];
- string ScrapTon = Temp[1];
- string ScrapNum1 = Temp[2];
- MilControlLogEntity ControlLogEntity = new MilControlLogEntity();
- ControlLogEntity.QualifiedNum = (Seq2 - BeforeChangeNum - int.Parse(ScrapNum1)).ToString();
- ControlLogEntity.ScrapNum = ScrapNum1.ToString();
- ControlLogEntity.QualifiedWt = QaTon.ToString();
- ControlLogEntity.ScrapWt = ScrapTon.ToString();
- ControlLogEntity.JudgeStoveNo = ActiveJUDGE_STOVE_NO;
- ControlLogEntity.ProBc = gridShift;
- ControlLogEntity.ProBz = gridGroup;
- ControlLogEntity.LotNo = ActiveLotNo;
- ControlLogEntity.UserId = _UserID;
- ControlLogEntity.UserName = _UserName;
- ControlLogEntity.ChangeShiftFlag = "1";
- ControlLogEntity.ProPlanId = proPlanId;
- ControlLogEntity.GxPlanNo = gxPlanNo;
- //CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.zgmil.coup.FrmRollingRPipeResult";
- ccp.MethodName = "changeGroupUpdateContralLog";
- ccp.ServerParams = new object[] { ControlLogEntity };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- //int count2 = ServerHelper.SetData("com.steering.mes.zgmil.coup.FrmRollingRPipeResult.changeGroupUpdateContralLog", new object[] { ControlLogEntity }, this.ob);
- //if (count2 > 0)
- //{
- if (Shift == "3")
- {
- Time = Time.Replace(":", "");
- Date = SeverTime.AddDays(+1).ToString("yyyyMMdd");
- }
- else
- {
- Date = SeverTime.ToString("yyyyMMdd");
- }
- string ShiftA = this.UserInfo.GetUserOrder();//HOTMethod.GetShiftAfter(Shift, Group, Date).Substring(0, 1);
- string GroupA = this.UserInfo.GetUserGroup();//HOTMethod.GetShiftAfter(Shift, Group, Date).Substring(1, 1);
- //if (_UpdateFlag == "0")
- //{
- //接班标识
- string ChangeShiftFlag = "2";
- int count3 = ServerHelper.SetData("com.steering.mes.zgmil.coup.FrmRollingRPipeResult.insertContralLog", new object[] { HeatNo, ActiveLotNo, ShiftA, GroupA, _UserID, _UserName, ChangeShiftFlag, proPlanId, gxPlanNo }, this.ob);
- //}
- //}
- #endregion
- }
- }
- DataTable dt1 = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmRollingRPipeResult.resultQuery", new object[] { HeatNo, proPlanId, gxPlanNo }, this.ob);
- //过渡方法,接班后重登陆初始化导致Grid.Row为null
- if (ultraGridPlan.Rows == null)
- {
- return;
- }
- if (dt1.Rows.Count > 0)
- {
- if (PlineCode != "C012")
- {
- GridEditHistoryForRack(dt1);
- }
- else
- {
- GridEditHistoryAressForRack(dt1);
- }
- }
- GetRollingCard();
- RackQuery(HeatNo);
- }
- /// <summary>
- /// 连轧跟踪信息查询
- /// </summary>
- private void RackQuery(string heatNo)
- {
- tbRollDate.Clear();
- if (ultraGridPlan.Rows.Count > 0)
- {
- DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmRollingRPipeResult.rackQueryForHeatNo", new object[] { heatNo,proPlanId,gxPlanNo }, this.ob);//连轧跟踪信息
- GridHelper.CopyDataToDatatable(ref dt, ref tbRollDate, true);
- ultraGrid1.DisplayLayout.Bands[0].PerformAutoResizeColumns(true, PerformAutoSizeType.AllRowsInBand);
- foreach (UltraGridRow dr in ultraGrid1.Rows)
- {
- dr.Cells["DELETE"].Value = "剔除";
- dr.Cells["DELBACK"].Value = "剔料回退";
- if (dr.Cells["STATUS"].Text == "剔除")
- {
- dr.Cells["SCRAP_REASON"].Activation = Activation.AllowEdit;
- }
- }
- }
- ChangeGridColor();
- }
- /// <summary>
- /// 变色
- /// </summary>
- private void ChangeGridColor()
- {
- 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["CHANGE_FLAG"].Value.ToString())
- {
- case "待接班确认":
- ugr.Appearance.BackColor = Color.LightGreen;
- break;
- }
- }
- }
- foreach (UltraGridRow uRow in ultraGridPlan.Rows)
- {
- if (uRow != null)
- {
- switch (uRow.Cells["IS_START"].Value.ToString())
- {
- case "已完成连轧":
- uRow.Appearance.BackColor = Color.YellowGreen;
- break;
- }
- }
- }
- }
- /// <summary>
- /// 查询连轧实绩
- /// </summary>
- private void resultQuery(string heatNo, string PliceCode)
- {
- string strheatno = heatNo;
- string factoryId = PliceCode;
- DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmRollingRPipeResult.resultQuery", new object[] { strheatno, proPlanId, gxPlanNo }, this.ob);
- if (dt.Rows.Count > 0)
- {
- if (factoryId != "C012")
- {
- GridEditHistory(dt);
- }
- else
- {
- GridEditHistoryAress(dt);
- }
- }
- if (dt.Rows.Count == 0)
- {
- MilRollingResultEntity rr = new MilRollingResultEntity();
- rollResult_Arssel1.Value = rr;
- rollResult1.Value = rr;
- }
- }
- #endregion
- #region 卡片赋值
- /// <summary>
- /// 连轧实绩Grid赋值Aress_1
- /// </summary>
- /// <param name="dt"></param>
- private void GridEditHistoryAress(DataTable dt)
- {
- ultraTabControl1.Tabs[0].Visible = false;
- ultraTabControl1.Tabs[1].Visible = true;
- if (dt.Rows.Count > 0)
- {
- UltraGridRow ugr1 = ultraGridPlan.ActiveRow;
- string JudgeStoveNo = ugr1.Cells["JUDGE_STOVE_NO"].Value.ToString();
- string ResultNo = ugr1.Cells["ID"].Value.ToString();
- rollResult_Arssel1.Value.ScrapNum = "0";
- //查询本道工序剔除支数
- DataTable dtScrapNum = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getScrapNum", new object[] { JudgeStoveNo, ResultNo, 3, PlineCode, proPlanId, gxPlanNo }, this.ob);
- if (dtScrapNum.Rows.Count > 0)
- {
- if (!string.IsNullOrEmpty(dtScrapNum.Rows[0][0].ToString()))
- {
- rollResult_Arssel1.Value.ScrapNum = dtScrapNum.Rows[0][0].ToString();
- }
- }
- DataTable dtQANum = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getQANumBefore", new object[] { JudgeStoveNo, ResultNo, 3, PlineCode, proPlanId, gxPlanNo }, this.ob);
- if (dtQANum.Rows.Count > 0)
- {
- if (!string.IsNullOrEmpty(dtQANum.Rows[0][0].ToString()))
- {
- if (int.Parse(dtQANum.Rows[0][0].ToString()) > int.Parse(rollResult_Arssel1.Value.ScrapNum.ToString()))
- {
- //合格支数
- rollResult_Arssel1.Value.Rollingnum = int.Parse(dtQANum.Rows[0][0].ToString()) - int.Parse(rollResult1.Value.ScrapNum.ToString());
- }
- else
- {
- rollResult_Arssel1.Value.Rollingnum = 0;
- }
- }
- else
- { rollResult_Arssel1.Value.Rollingnum = 0; }
- }
- //交接班支数
- this.rollResult_Arssel1.Value.Changeclassnum = dt.Rows[0]["CHANGECLASSNUM"].ToString();
- //备注
- this.rollResult_Arssel1.Value.Remark = dt.Rows[0]["REMARK"].ToString();
- //毛管名义尺寸
- this.rollResult_Arssel1.Value.Tubesize = dt.Rows[0]["TUBESIZE"].ToString();
- //连轧开始时间
- this.rollResult_Arssel1.Value.StartTime = dt.Rows[0]["START_TIME"].ToString();
- //连轧结束时间
- this.rollResult_Arssel1.Value.EndTime = dt.Rows[0]["END_TIME"].ToString();
- //快开
- this.rollResult_Arssel1.Value.QoRollerThroatDiameter = dt.Rows[0]["QO_ROLLER_THROAT_DIAMETER"].ToString();
- //轧制
- this.rollResult_Arssel1.Value.RollingThroatDiameter = dt.Rows[0]["ROLLING_THROAT_DIAMETER"].ToString();
- //快关
- this.rollResult_Arssel1.Value.QcRollerThroatDiameter = dt.Rows[0]["QC_ROLLER_THROAT_DIAMETER"].ToString();
- //咬入
- this.rollResult_Arssel1.Value.RollerBiteSpeed = dt.Rows[0]["ROLLER_BITE_SPEED"].ToString();
- //轧辊角
- this.rollResult_Arssel1.Value.RollingAngle = dt.Rows[0]["ROLLING_ANGLE"].ToString();
- //喂角转速
- this.rollResult_Arssel1.Value.FeedAngle = dt.Rows[0]["FEED_ANGLE"].ToString();
- //轧制转速
- this.rollResult_Arssel1.Value.RollingSpeed = dt.Rows[0]["ROLLING_SPEED"].ToString();
- this.rollResult_Arssel1.Value.StartRollTemp = dt.Rows[0]["START_ROLL_TEMP"].ToString();
- this.rollResult_Arssel1.UpdateData();
- }
- }
- /// <summary>
- /// 查询流通卡信息
- /// </summary>
- private void GetRollingCard()
- {
- UltraGridRow ugr = ultraGridPlan.ActiveRow;
- if (ugr != null)
- {
- string JudgeStoveNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
- DataTable dt = new DataTable();
- if (PlineCode.Equals("C008") || PlineCode.Equals("C009") || PlineCode.Equals("C012") || PlineCode.Equals("C017"))
- {
- dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getRollingCard1", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, this.ob);
- }
- else
- {
- dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getRollingCard", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, this.ob);
- }
- RollingCardEditGrid(dt, JudgeStoveNo);
- }
- }
- /// <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);
- }
- #region 事件处理
- private void chkLotNo_CheckedChanged(object sender, EventArgs e)
- {
- this.txtLOT_NO.Enabled = this.chkLotNo.Checked;
- }
- private void chkHeatNo_CheckedChanged(object sender, EventArgs e)
- {
- if (this.chkHeatNo.Checked)
- {
- this.txtJudgeStoveNo.Enabled = true;
- }
- else
- {
- this.txtJudgeStoveNo.Enabled = false;
- }
- if (chkStatusQuery.Checked)
- {
- PlanStatusQuery = "99";
- PlanStartStatusQuery = "40";
- }
- else
- {
- PlanStatusQuery = "39";
- PlanStartStatusQuery = "00";
- }
- if (chkAutoRefresh.Checked)
- {
- timer1.Enabled = true;
- }
- else
- {
- timer1.Enabled = false;
- }
- }
- public string DoCheck(CoreUserInfo User)
- {
- return "";
- }
- /// <summary>
- /// 查询合格支 合格吨
- /// </summary>
- /// <param name="JudgeStoveNo"></param>
- /// <param name="ResultNo"></param>
- /// <param name="StartSeq"></param>
- /// <param name="EndSeq"></param>
- /// <param name="Flag"> 0-交班合废支吨</param>
- /// <returns></returns>
- private string GetDbHeightBruningRate(string JudgeStoveNo, string ResultNo, int StartSeq, int EndSeq)
- {
- string DbHeightBrate = "";
- double DbHeight = 0;
- double BRate = 0;
- int ScrapNum = 0;
- double QaTon = 0;
- double ScrapTon = 0;
- DataTable dtDBH = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmRollingRPipeResult.getDBHeightBRate", new object[] { JudgeStoveNo, ResultNo, proPlanId, gxPlanNo }, this.ob);
- if (dtDBH.Rows.Count > 0)
- {
- DbHeight = double.Parse(dtDBH.Rows[0]["DB_HEIGHT"].ToString());
- BRate = double.Parse(dtDBH.Rows[0]["burnning_rate"].ToString());
- }
- DataTable dtScrapNum = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmRollingRPipeResult.getScrapNum", new object[] { JudgeStoveNo, ResultNo, StartSeq, EndSeq, proPlanId, gxPlanNo }, this.ob);
- if (dtScrapNum.Rows.Count > 0)
- {
- ScrapNum = int.Parse(dtScrapNum.Rows[0][0].ToString());
- }
- QaTon = (EndSeq - StartSeq+1 - ScrapNum) * DbHeight * (1 - (BRate / 100));
- ScrapTon = ScrapNum * DbHeight * (1 - (BRate / 100));
- DbHeightBrate = QaTon + "-" + ScrapTon + "-" + ScrapNum;
- return DbHeightBrate;
- }
- /// <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;
- }
- }
- /// <summary>
- /// 计划表ROW点击变换判断
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ultraGridPlan_BeforeRowActivate(object sender, RowEventArgs e)
- {
- if (this.rollResult1.IsCellSelect == true)
- {
- NativeMethodNew na = new NativeMethodNew(this.ob);
- if (!na.isBegineNode(ActiveJUDGE_STOVE_NO, 3))
- {
- this.rollResult1.IsCellSelect = false;
- return;
- }
- //if (MessageBox.Show("提示:连轧实绩可能已修改,是否保存", "提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
- //{
- // this.rollResult1.IsCellSelect = false;
- // //保存探伤实绩
- //}
- else
- {
- ShowMessageFlag = 1;
- FeedRowSave();
- ShowMessageFlag = 0;
- this.rollResult1.IsCellSelect = false;
- foreach (UltraGridRow ugr in this.ultraGridPlan.Rows)
- {
- if (ugr.Cells["JUDGE_STOVE_NO"].Value.ToString() == ActiveJUDGE_STOVE_NO)
- {
- this.ultraGridPlan.ActiveRow = ugr;
- }
- }
- return;
- }
- }
- if (this.rollResult_Arssel1.IsCellSelect == true)
- {
- NativeMethodNew na = new NativeMethodNew(this.ob);
- if (!na.isBegineNode(ActiveJUDGE_STOVE_NO, 3))
- {
- this.rollResult_Arssel1.IsCellSelect = false;
- return;
- }
- //if (MessageBox.Show("提示:探伤实绩可能已修改,是否保存", "提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
- //{
- // this.rollResult1.IsCellSelect = false;
- // //保存探伤实绩
- // FeedRowSave();
- //}
- else
- {
- this.rollResult_Arssel1.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 Shift = UserInfo.GetUserOrder();
- string Group = UserInfo.GetUserGroup();
- 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";
- }
- }
- DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmRollingRPipeResult.GetRollResultNodeQuery", new object[] { PlineCode, Shift, Group, StartTime, EndTime }, this.ob);
- FrmNodeResultQuery frm = new FrmNodeResultQuery(dt, 4, Date, Shift, Group, this.ob);
- frm.ShowDialog();
- }
- #endregion
- /// <summary>
- /// 当班工具更换
- /// </summary>
- private void DoToolChange()
- {
- string Shift = UserInfo.GetUserOrder();
- string Group = UserInfo.GetUserGroup();
- string User = UserInfo.GetUserName();
- DateTime SeverTime = NativeMethod.GetSeverTime(this.ob);
- string StartTime = SeverTime.ToString("yyyy-MM-dd");
- string EndTime = SeverTime.AddDays(1).ToString("yyyy-MM-dd");
- string Date = StartTime;
- string Time = SeverTime.ToLongTimeString();
- //晚班
- if (Shift == "3")
- {
- Time = Time.Replace(":", "");
- if (int.Parse(Time) > 205900)
- {
- StartTime += " " + "21:00:00";
- EndTime += " " + "07:00:00";
- }
- else
- {
- StartTime = SeverTime.AddDays(-1).ToString("yyyy-MM-dd") + " " + "21:00:00";
- EndTime = SeverTime.ToString("yyyy-MM-dd") + " " + "07:00:00";
- }
- }
- DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmRollingRPipeResult.toolChangeQuery", new object[] { PlineCode, Shift, Group, StartTime, EndTime }, this.ob);
- txtQuery frm = new txtQuery(2, Date, Shift, Group, User, PlineCode, this.ob);
- frm.ShowDialog();
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="dt"></param>
- private void frmTechnological1_DoubleClickEvent(DataTable dt)
- {
- NativeMethodNew NmN = new NativeMethodNew(this.ob);
- HOTMethod HOTm = new HOTMethod(this.ob);
- if (!NmN.isBegineNode(ActiveJUDGE_STOVE_NO, 3))
- {
- MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(ActiveJUDGE_STOVE_NO) + "】未开始连轧,不能带入参数。");
- return;
- }
- //if (HOTm.isNode(ActiveJUDGE_STOVE_NO, ActiveResultNo, 3, PlineCode))
- //{
- // MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(ActiveJUDGE_STOVE_NO) + "】已完成连轧,不能带入参数。");
- // return;
- //}
- MilRollingResultEntity RollingResult = new MilRollingResultEntity();
- RollingResult = (MilRollingResultEntity)EntityTool.setObjectByDataTable(RollingResult, dt);
- this.rollResult1.UpdateDateForPrama(RollingResult);
- ShowMessageFlag = 1;
- FeedRowSave();
- ShowMessageFlag = 0;
- }
- /// <summary>
- /// Arsel
- /// </summary>
- /// <param name="dt"></param>
- private void frmTechnological2_DoubleClickEvent(DataTable dt)
- {
- NativeMethodNew NmN = new NativeMethodNew(this.ob);
- HOTMethod HOTm = new HOTMethod(this.ob);
- if (!NmN.isBegineNode(ActiveJUDGE_STOVE_NO, 3))
- {
- MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(ActiveJUDGE_STOVE_NO) + "】未开始连轧,不能带入参数。");
- return;
- }
- //if (HOTm.isNode(ActiveJUDGE_STOVE_NO, ActiveResultNo, 3, PlineCode))
- //{
- // MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(ActiveJUDGE_STOVE_NO) + "】已完成连轧,不能带入参数。");
- // return;
- //}
- MilRollingResultEntity RollingResult = new MilRollingResultEntity();
- RollingResult = (MilRollingResultEntity)EntityTool.setObjectByDataTable(RollingResult, dt);
- this.rollResult_Arssel1.UpdateDateForPrama(RollingResult);
- ShowMessageFlag = 1;
- FeedRowSave();
- ShowMessageFlag = 0;
- }
- /// <summary>
- /// 到点提示交班
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void timer2_Tick(object sender, EventArgs e)
- {
- if (!PlineCode.Equals("C072"))
- {
- DateTime SeverTime = NativeMethod.GetSeverTime(this.ob);
- string Time = SeverTime.ToLongTimeString();
- Time = Time.Replace(":", "");
- if (ChangeFlag == 0)
- {
- if (int.Parse(Time) > 065459 && int.Parse(Time) < 065600 || int.Parse(Time) > 070359 && int.Parse(Time) < 070500)
- {
- if (Shift == "3")
- {
- if (MessageUtil.ShowYesNoAndQuestion("确认最后一炉已交班或已结炉!") == DialogResult.Yes)
- {
- }
- ChangeFlag = 1;
- return;
- }
- }
- if (int.Parse(Time) > 135359 && int.Parse(Time) < 135500 || int.Parse(Time) > 140359 && int.Parse(Time) < 140500)
- {
- if (Shift == "1")
- {
- if (MessageUtil.ShowYesNoAndQuestion("确认最后一炉已交班或已结炉!") == DialogResult.Yes)
- {
- }
- ChangeFlag = 1;
- return;
- }
- }
- if (int.Parse(Time) > 205359 && int.Parse(Time) < 205500 || int.Parse(Time) > 210359 && int.Parse(Time) < 210500)
- {
- if (Shift == "2")
- {
- if (MessageUtil.ShowYesNoAndQuestion("确认最后一炉已交班或已结炉!") == DialogResult.Yes)
- {
- }
- ChangeFlag = 1;
- return;
- }
- }
- }
- }
-
- }
- /// <summary>
- /// 管号队列修改剔除原因 备注
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ultraGrid1_KeyPress(object sender, KeyPressEventArgs e)
- {
- if (e.KeyChar != (char)13)
- {
- }
- 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];
- }
- 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, 3, Seq, ScrapReason, Remark }, this.ob);
- }
- RackQuery(ActiveJUDGE_STOVE_NO);
- }
- }
- #endregion
- #region 卡片赋值
- /// <summary>
- /// 连轧实绩Grid赋值Aress_1
- /// </summary>
- /// <param name="dt"></param>
- private void GridEditHistoryAressForRack(DataTable dt)
- {
- ultraTabControl1.Tabs[0].Visible = false;
- ultraTabControl1.Tabs[1].Visible = true;
- if (dt.Rows.Count > 0)
- {
- UltraGridRow ugr1 = ultraGridPlan.ActiveRow;
- string JudgeStoveNo = ugr1.Cells["JUDGE_STOVE_NO"].Value.ToString();
- string ResultNo = ugr1.Cells["ID"].Value.ToString();
- rollResult_Arssel1.Value.ScrapNum = "0";
- //查询本道工序剔除支数
- DataTable dtScrapNum = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getScrapNum", new object[] { JudgeStoveNo, ResultNo, 3, PlineCode, proPlanId, gxPlanNo }, this.ob);
- if (dtScrapNum.Rows.Count > 0)
- {
- if (!string.IsNullOrEmpty(dtScrapNum.Rows[0][0].ToString()))
- {
- rollResult_Arssel1.Value.ScrapNum = dtScrapNum.Rows[0][0].ToString();
- }
- }
- DataTable dtQANum = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getQANumBefore", new object[] { JudgeStoveNo, ResultNo, 3, PlineCode, proPlanId, gxPlanNo }, this.ob);
- if (dtQANum.Rows.Count > 0)
- {
- if (!string.IsNullOrEmpty(dtQANum.Rows[0][0].ToString()))
- {
- if (int.Parse(dtQANum.Rows[0][0].ToString()) > int.Parse(rollResult_Arssel1.Value.ScrapNum.ToString()))
- {
- //合格支数
- rollResult_Arssel1.Value.Rollingnum = int.Parse(dtQANum.Rows[0][0].ToString()) - int.Parse(rollResult1.Value.ScrapNum.ToString());
- }
- else
- {
- rollResult_Arssel1.Value.Rollingnum = 0;
- }
- }
- else
- { rollResult_Arssel1.Value.Rollingnum = 0; }
- }
- //交接班支数
- this.rollResult_Arssel1.Value.Changeclassnum = dt.Rows[0]["CHANGECLASSNUM"].ToString();
- this.rollResult_Arssel1.UpdateDataForRack();
- }
- }
- /// <summary>
- /// 连轧实绩Grid赋值
- /// </summary>
- /// <param name="dt"></param>
- private void GridEditHistory(DataTable dt)
- {
- ultraTabControl1.Tabs[0].Visible = true;
- ultraTabControl1.Tabs[1].Visible = false;
- if (dt.Rows.Count > 0)
- {
- UltraGridRow ugr1 = ultraGridPlan.ActiveRow;
- string JudgeStoveNo = ugr1.Cells["JUDGE_STOVE_NO"].Value.ToString();
- string ResultNo = ugr1.Cells["ID"].Value.ToString();
- rollResult1.Value.ScrapNum = "0";
- //查询本道工序剔除支数
- DataTable dtScrapNum = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getScrapNum", new object[] { JudgeStoveNo, ResultNo, 3, PlineCode, proPlanId, gxPlanNo }, this.ob);
- if (dtScrapNum.Rows.Count > 0)
- {
- if (!string.IsNullOrEmpty(dtScrapNum.Rows[0][0].ToString()))
- {
- rollResult1.Value.ScrapNum = dtScrapNum.Rows[0][0].ToString();
- }
- }
- DataTable dtQANum = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getQANumBefore", new object[] { JudgeStoveNo, ResultNo, 3, PlineCode, proPlanId, gxPlanNo }, this.ob);
- if (dtQANum.Rows.Count > 0)
- {
- if (!string.IsNullOrEmpty(dtQANum.Rows[0][0].ToString()))
- {
- if (int.Parse(dtQANum.Rows[0][0].ToString()) > int.Parse(rollResult1.Value.ScrapNum.ToString()))
- {
- //合格支数
- rollResult1.Value.Rollingnum = int.Parse(dtQANum.Rows[0][0].ToString()) - int.Parse(rollResult1.Value.ScrapNum.ToString());
- }
- else
- {
- rollResult1.Value.Rollingnum = 0;
- }
- }
- else
- { rollResult1.Value.Rollingnum = 0; }
- }
- //交接班支数
- this.rollResult1.Value.Changeclassnum = dt.Rows[0]["CHANGECLASSNUM"].ToString();
- //备注
- this.rollResult1.Value.Remark = dt.Rows[0]["REMARK"].ToString();
- //VRS转速
- this.rollResult1.Value.VrsSpeed = dt.Rows[0]["VRS_SPEED"].ToString();
- //预插入长度
- this.rollResult1.Value.InsertLength = dt.Rows[0]["INSERT_LENGTH"].ToString();
- //毛管名义尺寸
- this.rollResult1.Value.Tubesize = dt.Rows[0]["TUBESIZE"].ToString();
- //EM转速
- this.rollResult1.Value.Emspeed = dt.Rows[0]["EMSPEED"].ToString();
- //限动速度
- this.rollResult1.Value.LimitSpeed = dt.Rows[0]["LIMIT_SPEED"].ToString();
- //EX1脱管机架转速
- this.rollResult1.Value.Ext1RackSpeed = dt.Rows[0]["EXT1_RACK_SPEED"].ToString();
- //连轧开始时间
- this.rollResult1.Value.StartTime = dt.Rows[0]["START_TIME"].ToString();
- //连轧结束时间
- this.rollResult1.Value.EndTime = dt.Rows[0]["END_TIME"].ToString();
- //机架转速1
- this.rollResult1.Value.RackSpeed1 = dt.Rows[0]["RACK_SPEED1"].ToString();
- //机架转速2
- this.rollResult1.Value.RackSpeed2 = dt.Rows[0]["RACK_SPEED2"].ToString();
- //机架转速3
- this.rollResult1.Value.RackSpeed3 = dt.Rows[0]["RACK_SPEED3"].ToString();
- //机架转速4
- this.rollResult1.Value.RackSpeed4 = dt.Rows[0]["RACK_SPEED4"].ToString();
- //机架转速5
- this.rollResult1.Value.RackSpeed5 = dt.Rows[0]["RACK_SPEED5"].ToString();
- //机架转速6
- this.rollResult1.Value.RackSpeed6 = dt.Rows[0]["RACK_SPEED6"].ToString();
- //机架转速7
- this.rollResult1.Value.RackSpeed7 = dt.Rows[0]["RACK_SPEED7"].ToString();
- //辊缝转速1
- this.rollResult1.Value.RackSpace1 = dt.Rows[0]["RACK_SPACE1"].ToString();
- //辊缝转速2
- this.rollResult1.Value.RackSpace2 = dt.Rows[0]["RACK_SPACE2"].ToString();
- //辊缝转速3
- this.rollResult1.Value.RackSpace3 = dt.Rows[0]["RACK_SPACE3"].ToString();
- //辊缝转速4
- this.rollResult1.Value.RackSpace4 = dt.Rows[0]["RACK_SPACE4"].ToString();
- //辊缝转速5
- this.rollResult1.Value.RackSpace5 = dt.Rows[0]["RACK_SPACE5"].ToString();
- //辊缝转速6
- this.rollResult1.Value.RackSpace6 = dt.Rows[0]["RACK_SPACE6"].ToString();
- //辊缝转速7
- this.rollResult1.Value.RackSpace7 = dt.Rows[0]["RACK_SPACE7"].ToString();
- //机架轧制力1
- this.rollResult1.Value.RollingForce1 = dt.Rows[0]["ROLLING_FORCE1"].ToString();
- //机架轧制力2
- this.rollResult1.Value.RollingForce2 = dt.Rows[0]["ROLLING_FORCE2"].ToString();
- //机架轧制力3
- this.rollResult1.Value.RollingForce3 = dt.Rows[0]["ROLLING_FORCE3"].ToString();
- //机架轧制力4
- this.rollResult1.Value.RollingForce4 = dt.Rows[0]["ROLLING_FORCE4"].ToString();
- //机架轧制力5
- this.rollResult1.Value.RollingForce5 = dt.Rows[0]["ROLLING_FORCE5"].ToString();
- //机架轧制力6
- this.rollResult1.Value.RollingForce6 = dt.Rows[0]["ROLLING_FORCE6"].ToString();
- //机架轧制力7
- this.rollResult1.Value.RollingForce7 = dt.Rows[0]["ROLLING_FORCE7"].ToString();
- this.rollResult1.Value.StartRollTemp = dt.Rows[0]["START_ROLL_TEMP"].ToString();
- this.rollResult1.UpdateData();
- }
- }
- /// <summary>
- /// 连轧实绩Grid赋值
- /// </summary>
- /// <param name="dt"></param>
- private void GridEditHistoryForRack(DataTable dt)
- {
- ultraTabControl1.Tabs[0].Visible = true;
- ultraTabControl1.Tabs[1].Visible = false;
- if (dt.Rows.Count > 0)
- {
- UltraGridRow ugr1 = ultraGridPlan.ActiveRow;
- string JudgeStoveNo = ugr1.Cells["JUDGE_STOVE_NO"].Value.ToString();
- string ResultNo = ugr1.Cells["ID"].Value.ToString();
- rollResult1.Value.ScrapNum = "0";
- //查询本道工序剔除支数
- DataTable dtScrapNum = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getScrapNum", new object[] { JudgeStoveNo, ResultNo, 3, PlineCode, proPlanId, gxPlanNo }, this.ob);
- if (dtScrapNum.Rows.Count > 0)
- {
- if (!string.IsNullOrEmpty(dtScrapNum.Rows[0][0].ToString()))
- {
- rollResult1.Value.ScrapNum = dtScrapNum.Rows[0][0].ToString();
- }
- }
- DataTable dtQANum = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getQANumBefore", new object[] { JudgeStoveNo, ResultNo, 3, PlineCode, proPlanId, gxPlanNo }, this.ob);
- if (dtQANum.Rows.Count > 0)
- {
- if (!string.IsNullOrEmpty(dtQANum.Rows[0][0].ToString()))
- {
- if (int.Parse(dtQANum.Rows[0][0].ToString()) > int.Parse(rollResult1.Value.ScrapNum.ToString()))
- {
- //合格支数
- rollResult1.Value.Rollingnum = int.Parse(dtQANum.Rows[0][0].ToString()) - int.Parse(rollResult1.Value.ScrapNum.ToString());
- }
- else
- {
- rollResult1.Value.Rollingnum = 0;
- }
- }
- else
- { rollResult1.Value.Rollingnum = 0; }
- }
- //交接班支数
- this.rollResult1.Value.Changeclassnum = dt.Rows[0]["CHANGECLASSNUM"].ToString();
- this.rollResult1.UpdateDataForRack();
- }
- }
- /// <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>
- /// 轧制信息Grid赋值
- /// </summary>
- /// <param name="dt">轧制计划信息datatable</param>
- public void GridEdit(DataTable dt)
- {
- if (dt.Rows.Count > 0)
- {
- DataRow row1 = dt.Rows[0];
- //熔炼炉号
- this.chk.Value.StoveNo = row1["stove_no"].ToString();
- //炉号
- this.chk.Value.JudgeStoveNo = BaseMethod.getJudgeStoveNo(row1["judge_stove_no"].ToString());
- //生产批号
- this.chk.Value.LotNo = row1["lot_no"].ToString();
- //工序合同号
- this.chk.Value.ContractNo = row1["contract_no"].ToString();
- //执行工艺号
- this.chk.Value.ImpProcess = row1["imp_process"].ToString();
- //执行工艺号路径
- this.chk.Value.ImpProcessPath = row1["imp_process_path"].ToString();
- //产线代码
- this.chk.Value.PlineCode = row1["pline_code"].ToString();
- //状态
- this.chk.Value.Status = row1["STATUS"].ToString();
- //监制
- this.chk.Value.Producer = row1["producer"].ToString();
- //工艺状态
- this.chk.Value.ProcessStatus = row1["process_status"].ToString();
- //单倍长
- this.chk.Value.DbLength = row1["db_length"].ToString();
- //单倍重
- this.chk.Value.DbHeight = row1["db_height"].ToString();
- //轧制长度
- this.chk.Value.RollLength = row1["roll_length"].ToString();
- //分切数
- this.chk.Value.SawNum = row1["saw_num"].ToString();
- //目标长度
- this.chk.Value.TargetLength = row1["target_length"].ToString();
- //最终用户
- this.chk.Value.FinishUser = row1["finish_user"].ToString();
- //目标库
- this.chk.Value.TargetLiabrary = row1["target_liabrary"].ToString();
- //品种
- this.chk.Value.Varieties = row1["varieties"].ToString();
- //成品规格
- this.chk.Value.PipeSize = row1["pipe_size"].ToString();
- //扣型
- this.chk.Value.BuckleType = row1["buckle_type"].ToString();
- //长度范围
- this.chk.Value.LengthRange = row1["length_range"].ToString();
- //轧管判定标准
- this.chk.Value.RollStandrad = row1["roll_standrad"].ToString();
- //断面
- this.chk.Value.PipeSection = row1["pipe_section"].ToString();
- //钢种代码
- this.chk.Value.SteelCode = row1["steelcode"].ToString();
- //钢种名称
- this.chk.Value.SteelName = row1["steelname"].ToString();
- //钢级代码
- this.chk.Value.GradeCode = row1["gradecode"].ToString();
- //钢级名称
- this.chk.Value.GradeName = row1["gradename"].ToString();
- //炼钢判定标准
- this.chk.Value.SteelStandrad = row1["steel_standrad"].ToString();
- //去向
- this.chk.Value.Target = row1["target"].ToString();
- //支
- this.chk.Value.PlanNum = row1["BRANCH"].ToString();
- //吨
- this.chk.Value.PlanTon = row1["TON"].ToString();
- //切损去向
- this.chk.Value.CutTarget = row1["cut_target"].ToString();
- //切损长度
- this.chk.Value.CutLength = row1["cut_length"].ToString();
- //切损重量
- this.chk.Value.CutHeight = row1["CUT_WEIGHT"].ToString();
- //倍尺数
- this.chk.Value.DbNum = row1["DB_NUM"].ToString();
- //标准类别代码
- this.chk.Value.StdStyle = row1["STD_STYLE"].ToString();
- //标准类别描述
- this.chk.Value.StdStyleDesc = row1["STD_STYLE_DESC"].ToString();
- //成品备注
- this.chk.Value.ReMark = row1["ReMark"].ToString();
- this.chk.UpdateData();
- }
- }
- #endregion
- #region 报表
- /// <summary>
- /// 打印报表
- /// </summary>
- private void PrintResult()
- {
- 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");
- //strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilRollingResult.cpt&SHIFT=" + Shift + "&GROUP=" + Group + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + _UserID;
- }
- //查询当天晚班的所有数据
- else if (int.Parse(Time) > 204000)
- {
- StartTime = SeverTime.ToShortDateString() + " 20:40:00";
- EndTime = SeverTime.AddDays(1).ToShortDateString() + " 07:20:00";
- //strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilRollingResult.cpt&SHIFT=" + Shift + "&GROUP=" + Group + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + _UserID;
- }
- }
- //白班 中班
- else
- {
- StartTime = SeverTime.ToShortDateString() + " 00:00:00";
- EndTime = SeverTime.AddDays(1).ToShortDateString() + " 00:00:00";
- //strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilRollingResult.cpt&SHIFT=" + Shift + "&GROUP=" + Group + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + _UserID;
- }
- switch (PlineCode)
- {
- case "C008": //250
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilRollingResult250.cpt&format=pdf&SHIFT=" + Shift + "&GROUP=" + Group + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + _UserID;
- break;
- case "C009": //258
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilRollingResult258.cpt&format=pdf&SHIFT=" + Shift + "&GROUP=" + Group + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + _UserID;
- break;
- case "C010": //168
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilRollingResult168.cpt&format=pdf&SHIFT=" + Shift + "&GROUP=" + Group + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + _UserID;
- break;
- case "C012": //Arssel
- break;
- case "C017": //460
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilRollingResult460.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=RepMilRollingResult508.cpt&SHIFT=" + Shift + "&GROUP=" + Group + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + _UserID;
- break;
- }
- FrmRepExcel fre = new FrmRepExcel(ob, strurl);
- fre.AutoSize = true;
- fre.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
- fre.WindowState = FormWindowState.Maximized;
- fre.Show();
- }
- /// <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), 3, 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), 3, 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), 3, 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), 3, 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=RepMilRollingResult250.cpt&format=pdf&SHIFT=" + ShitGroupBefore.Substring(0, 1) + "&GROUP=" + ShitGroupBefore.Substring(1, 1) + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + UserIDBefore;
- break;
- case "C009": //258
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilRollingResult258.cpt&format=pdf&SHIFT=" + ShitGroupBefore.Substring(0, 1) + "&GROUP=" + ShitGroupBefore.Substring(1, 1) + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + UserIDBefore;
- break;
- case "C010": //168
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilRollingResult168.cpt&format=pdf&SHIFT=" + ShitGroupBefore.Substring(0, 1) + "&GROUP=" + ShitGroupBefore.Substring(1, 1) + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + UserIDBefore;
- break;
- case "C012": //Arssel
- break;
- case "C017": //460
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilRollingResult460.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=RepMilRollingResult508.cpt&SHIFT=" + ShitGroupBefore.Substring(0, 1) + "&GROUP=" + ShitGroupBefore.Substring(1, 1) + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + UserIDBefore;
- break;
- }
- FrmRepExcel fre = new FrmRepExcel(ob, strurl);
- fre.AutoSize = true;
- fre.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
- fre.WindowState = FormWindowState.Maximized;
- fre.Show();
- }
- #endregion
- }
- }
|