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