FrmTestingResult.cs 268 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using CoreFS.CA06;
  10. using Core.Mes.Client.Comm.Control;
  11. using com.steering.mes.zgmil.entity;
  12. using Infragistics.Win.UltraWinGrid;
  13. using Core.Mes.Client.Comm.Server;
  14. using Core.StlMes.Client.ZGMil.Entity;
  15. using Core.StlMes.Client.ZGMil.ResultConrtrol;
  16. using Core.Mes.Client.Comm.Tool;
  17. using Core.StlMes.Client.ZGMil.NodeResultQuery;
  18. using System.Net;
  19. using Infragistics.Win;
  20. using Core.StlMes.Client.ZGMil.Popup;
  21. using System.Collections;
  22. using CoreFS.SA06;
  23. using Core.Mes.Client.Comm.Format;
  24. using Core.StlMes.Client.ZGMil.Common;
  25. namespace Core.StlMes.Client.ZGMil.Result
  26. {
  27. public partial class FrmTestingResult : FrmBase
  28. {
  29. private Infragistics.Win.UltraWinGrid.UltraGrid _grid = null;
  30. private RollingInfomation rl = new RollingInfomation();//计划卡
  31. MilPlan QueryMainPlan = new MilPlan();//查询方法实体类
  32. MilTestingRackEntity TestingRackEntity = new MilTestingRackEntity();//探伤跟踪表
  33. MilPlan MainPlan = new MilPlan();//单击Cell方法实体类
  34. MilPlan InsertMainPlan = new MilPlan();//双击方法修改Status实体类
  35. //private CrackDetectionResult cr = new CrackDetectionResult();//探伤实绩卡
  36. private MilEtResultEntity milet = new MilEtResultEntity();//ET探伤实绩卡赋值类
  37. private MilEtResultEntity InsertMilet = new MilEtResultEntity();//插入探伤实绩表类
  38. private MilEtResultEntity tempmilet = new MilEtResultEntity();//保存当前探伤实绩卡数据
  39. private MilMtResultEntity tempmilmt = new MilMtResultEntity();
  40. private MilUlResulEntity tempmilut = new MilUlResulEntity();
  41. private MilMtResultEntity milmt = new MilMtResultEntity();//MT探伤实绩
  42. private MilTestingResultDetailEntity milmtDetai = new MilTestingResultDetailEntity();//探伤实绩子表
  43. private MilUlResulEntity milul = new MilUlResulEntity();//UL探伤实绩
  44. private string ActiveJUDGE_STOVE_NO = null;//主计划活动行的判定炉号
  45. private string ActiveStatus = null;//主计划活动行的状态
  46. private string proPlanId = null;//轧管订单编号
  47. private string gxPlanNo = null;//工序排产序号
  48. private string lotNo = null;//生产批号
  49. private string ActiveOFFLINE_FLAG = null;
  50. private string ActiveResultNo = null;
  51. private string TestMethod = "";//探伤方式
  52. private string Departm = "";//部门
  53. private string PlineCode = "";//产线
  54. private string Colno = "";//台号
  55. private string stoveno = "";
  56. private string lotno = "";
  57. string PlanStatusQuery = "89";
  58. string PlanStartStatusQuery = "00"; //查询结炉实绩起始状态
  59. private string Shift = "";
  60. private string Group = "";
  61. private string _User = "";
  62. private string _UserName = ""; //签名 姓名
  63. private string _Url = ""; //签名 Url
  64. private string _UserID = ""; //签名 签名ID
  65. private string ChangeUserID = "";
  66. private string beforeQualifiedNum = "";//上道工序合格支数
  67. private string qualifiedNum = "";//该工序合格支数
  68. private string scrapNum = "";//该工序废品支数
  69. private string offineHas = "";//已下线支数
  70. private string offineHead = "";//返线支数
  71. private string specName = "";//规格
  72. private string length = "";//长度
  73. private bool alarmFlag = false;
  74. /// <summary>
  75. /// 工序状态:01-矫直1#,02-矫直2#,03-矫直3#,11-ET探伤,12-MT探伤,13-UT探伤
  76. /// </summary>
  77. private string offlinenode = "";//下线注释
  78. public Infragistics.Win.UltraWinGrid.UltraGrid Grid
  79. {
  80. get { return _grid; }
  81. }
  82. public FrmTestingResult()
  83. {
  84. InitializeComponent();
  85. //各产线的保存方法
  86. //this.testingResultDetailComm1.UltraGridDetail.ClickCellButton += new CellEventHandler(DetailComm1GridBtnClick);
  87. //this.testingResultDetailComm21.UltraGridDetail.ClickCellButton += new CellEventHandler(DetailComm21GridBtnClick);
  88. //this.testingResultDetail1681.UltraGridDetail.ClickCellButton += new CellEventHandler(Detail1681GridBtnClick);
  89. //this.testingResultDetail16821.UltraGridDetail.ClickCellButton += new CellEventHandler(Detail16821GridBtnClick);
  90. //this.testingResultDetail16831.UltraGridDetail.ClickCellButton += new CellEventHandler(Detail16831GridBtnClick);
  91. }
  92. public bool checkGrid(UltraGrid grid)
  93. {
  94. bool result = false;
  95. for (int i = 0; i < grid.Rows.Count; i++)
  96. {
  97. UltraGridRow ugr = grid.Rows[i];
  98. for (int j = 0; j < ugr.Cells.Count; j++)
  99. {
  100. if (string.IsNullOrEmpty(ugr.Cells[j].Value.ToString2()))
  101. {
  102. result = true;
  103. }
  104. }
  105. }
  106. return result;
  107. }
  108. /// <summary>
  109. /// 控件数据验证
  110. /// </summary>
  111. /// <param name="sender"></param>
  112. /// <param name="e"></param>
  113. public bool checkGridData(UltraGrid UltraGridDetail, UltraGrid UltraGridDetailDes1, UltraGrid UltraGridDetailDes2, int flag)
  114. {
  115. bool result = false;
  116. int qunum = 0;//合格
  117. int scrapnum = 0;//剔除
  118. int detecnum = 0;//检测
  119. int suspectnum = 0;//可疑
  120. int reinqunum = 0;//复探合格
  121. int suspectnumSUM = 0;
  122. int scrapnumSUM = 0;
  123. if (flag.Equals(1))
  124. {
  125. qunum = int.Parse(UltraGridDetail.Rows[0].Cells["qualifiedNum1"].Value.ToString3());
  126. scrapnum = int.Parse(UltraGridDetail.Rows[0].Cells["scrapNum1"].Value.ToString3());
  127. detecnum = int.Parse(UltraGridDetail.Rows[0].Cells["detectionNum1"].Value.ToString3());
  128. suspectnum = int.Parse(UltraGridDetail.Rows[0].Cells["suspectProductNum1"].Value.ToString3());
  129. reinqunum = int.Parse(UltraGridDetail.Rows[0].Cells["reinspectionQualifiedNum1"].Value.ToString3());
  130. }
  131. if (flag.Equals(2))
  132. {
  133. qunum = int.Parse(UltraGridDetail.Rows[0].Cells["qualifiedNum2"].Value.ToString3());
  134. scrapnum = int.Parse(UltraGridDetail.Rows[0].Cells["scrapNum2"].Value.ToString3());
  135. detecnum = int.Parse(UltraGridDetail.Rows[0].Cells["detectionNum2"].Value.ToString3());
  136. suspectnum = int.Parse(UltraGridDetail.Rows[0].Cells["suspectProductNum2"].Value.ToString3());
  137. reinqunum = int.Parse(UltraGridDetail.Rows[0].Cells["reinspectionQualifiedNum2"].Value.ToString3());
  138. }
  139. if (flag.Equals(3))
  140. {
  141. qunum = int.Parse(UltraGridDetail.Rows[0].Cells["qualifiedNum3"].Value.ToString3());
  142. scrapnum = int.Parse(UltraGridDetail.Rows[0].Cells["scrapNum3"].Value.ToString3());
  143. detecnum = int.Parse(UltraGridDetail.Rows[0].Cells["detectionNum3"].Value.ToString3());
  144. suspectnum = int.Parse(UltraGridDetail.Rows[0].Cells["suspectProductNum3"].Value.ToString3());
  145. reinqunum = int.Parse(UltraGridDetail.Rows[0].Cells["reinspectionQualifiedNum3"].Value.ToString3());
  146. }
  147. foreach (UltraGridRow ugr1 in UltraGridDetailDes1.Rows)
  148. {
  149. if (ugr1.Cells["Check"].Value.ToString() == "True")
  150. {
  151. suspectnumSUM += int.Parse(ugr1.Cells["reasonNumber"].Value.ToString3());
  152. }
  153. }
  154. foreach (UltraGridRow ugr2 in UltraGridDetailDes2.Rows)
  155. {
  156. if (ugr2.Cells["Check"].Value.ToString() == "True")
  157. {
  158. scrapnumSUM += int.Parse(ugr2.Cells["reasonNumber"].Value.ToString3());
  159. }
  160. }
  161. if (suspectnum - scrapnum < 0)
  162. {
  163. MessageUtil.ShowTips("剔除支数是基于可疑品之下,剔除支数不能大于可疑支数!");
  164. return true;
  165. }
  166. if (detecnum - qunum != scrapnum)
  167. {
  168. MessageBox.Show("您输入的合格支数,剔除支数,检测支数不匹配", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  169. return true;
  170. }
  171. if ((suspectnumSUM != suspectnum))
  172. {
  173. MessageBox.Show("您输入的可疑支数和可疑支数统计累加支数不匹配", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  174. return true;
  175. }
  176. if ((scrapnumSUM != scrapnum))
  177. {
  178. MessageBox.Show("您输入的剔除支数和剔除统计的累加支数不匹配", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  179. return true;
  180. }
  181. return false;
  182. }
  183. public void DetailComm1GridBtnClick(object sender, CellEventArgs e)
  184. {
  185. string hratno = "";
  186. //UltraGrid UltraGridDetail = this.testingResultDetailComm1.UltraGridDetail;
  187. //UltraGrid UltraGridDetailDes1 = this.testingResultDetailComm1.UltraGridDetailDes1;
  188. //UltraGrid UltraGridDetailDes2 = this.testingResultDetailComm1.UltraGridDetailDes2;
  189. //UltraGridDetail.Rows[0].Cells["offlineNum1"].Value = "0";
  190. //UltraGridDetail.Rows[0].Cells["backlineNum1"].Value = "0";
  191. //UltraGridDetail.UpdateData();
  192. //UltraGridDetailDes1.UpdateData();
  193. //UltraGridDetailDes2.UpdateData();
  194. if (this.ultraGridPlan.ActiveRow == null && ActiveJUDGE_STOVE_NO == null)
  195. {
  196. MessageBox.Show("未选择任何炉号,请选择炉号后进行保存操作。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  197. return;
  198. }
  199. if (this.ultraGridPlan.ActiveRow == null)
  200. {
  201. hratno = ActiveJUDGE_STOVE_NO;
  202. }
  203. else
  204. {
  205. hratno = this.ultraGridPlan.ActiveRow.Cells["JUDGE_STOVE_NO"].Value.ToString();
  206. }
  207. if (ActiveStatus == "未开始探伤")
  208. {
  209. MessageBox.Show("炉号:【" + BaseMethod.getJudgeStoveNo(hratno) + "】未开始进行探伤,不允许进行保存或提交操作!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  210. return;
  211. }
  212. //if (checkGrid(UltraGridDetail))
  213. //{
  214. // MessageBox.Show("1#线实绩统计有值未输入,请输入后再保存或提交", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  215. // return;
  216. //}
  217. //if (this.testingResultDetailComm1.UltraGridDetail.ActiveCell.Column.Key == "Bnt2")
  218. //{
  219. // if (checkGrid(this.ulTestingResult1.UltraGrid3))
  220. // {
  221. // MessageBox.Show("该班组无1#线实绩,不能进行回退!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  222. // return;
  223. // }
  224. //}
  225. //if (this.testingResultDetailComm1.UltraGridDetail.ActiveCell.Column.Key == "Btn1")
  226. //{
  227. // if (checkGrid(this.testingResultDetailComm1.UltraGridDetail))
  228. // {
  229. // MessageBox.Show("1#线实绩统计判废品统计有值未输入,请输入后再保存或提交", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  230. // return;
  231. // }
  232. //}
  233. //if (checkGridData(UltraGridDetail, UltraGridDetailDes1, UltraGridDetailDes2, 1))
  234. //{
  235. // return;
  236. //}
  237. //foreach(UltraGridRow uRow in this.testingResultDetailComm1.UltraGridDetailDes1.Rows)
  238. //{
  239. // if (uRow.Cells["Check"].Value.ToString() == "True")
  240. // {
  241. // if (uRow.Cells["reason"].Value.ToString() == "")
  242. // {
  243. // MessageUtil.ShowTips("可疑品原因不能为空,请选择!");
  244. // return;
  245. // }
  246. // if (uRow.Cells["reasonNumber"].Value.ToString() == "" || uRow.Cells["reasonNumber"].Value.ToString() == "0")
  247. // {
  248. // MessageUtil.ShowTips("可疑品支数不能为空或者为零支,请输入!");
  249. // return;
  250. // }
  251. // }
  252. //}
  253. //foreach (UltraGridRow uRow in this.testingResultDetailComm1.UltraGridDetailDes2.Rows)
  254. //{
  255. // if (uRow.Cells["Check"].Value.ToString() == "True")
  256. // {
  257. // if (uRow.Cells["reason"].Value.ToString() == "")
  258. // {
  259. // MessageUtil.ShowTips("剔除品原因不能为空,请选择!");
  260. // return;
  261. // }
  262. // if (uRow.Cells["reasonNumber"].Value.ToString() == "" || uRow.Cells["reasonNumber"].Value.ToString() == "0")
  263. // {
  264. // MessageUtil.ShowTips("剔除品支数不能为空或者为零支,请输入!");
  265. // return;
  266. // }
  267. // }
  268. //}
  269. string plincode = this.PlineCode;
  270. string resultno = this.ActiveResultNo;
  271. string ColGroup = this.UserInfo.GetUserGroup();
  272. string ColUser = this.UserInfo.GetUserName();
  273. string ColShift = this.UserInfo.GetUserOrder();
  274. MilTestingResultDetailEntity detail = new MilTestingResultDetailEntity();
  275. List<MilTestingResultDetailDesEntity> listdes1 = new List<MilTestingResultDetailDesEntity>();
  276. List<MilTestingResultDetailDesEntity> listdes2 = new List<MilTestingResultDetailDesEntity>();
  277. MilTestingResultDetailDesEntity detaildes = new MilTestingResultDetailDesEntity();
  278. //detail = NativeMethod.GetUltraGridToEntity(UltraGridDetail, detail);
  279. //listdes1 = NativeMethod.GetGridToList1(UltraGridDetailDes1, detaildes);
  280. //listdes2 = NativeMethod.GetGridToList1(UltraGridDetailDes2, detaildes);
  281. ArrayList arr = new ArrayList();
  282. ArrayList insertArr = new ArrayList();
  283. detail.JudgeStoveNo = hratno;
  284. detail.ResultNo = resultno;
  285. detail.PlineCode = plincode;
  286. detail.ColGroup = ColGroup;
  287. detail.ColShift = ColShift;
  288. detail.ColUser = ColUser;
  289. detail.ColNo = "1";
  290. arr.Add(detail);
  291. foreach (MilTestingResultDetailDesEntity des in listdes1)
  292. {
  293. des.JudgeStoveNo = hratno;
  294. des.PlineCode = plincode;
  295. des.ResultNo = resultno;
  296. des.ColGroup = ColGroup;
  297. des.ColShift = ColShift;
  298. des.ColUser = ColUser;
  299. des.ColNo = "1";
  300. des.ReasonFlag = "可疑";
  301. //arr.Add(des);
  302. }
  303. foreach (MilTestingResultDetailDesEntity des in listdes2)
  304. {
  305. des.JudgeStoveNo = hratno;
  306. des.PlineCode = plincode;
  307. des.ResultNo = resultno;
  308. des.ColGroup = ColGroup;
  309. des.ColShift = ColShift;
  310. des.ColUser = ColUser;
  311. des.ColNo = "1";
  312. des.ReasonFlag = "剔除";
  313. //arr.Add(des);
  314. }
  315. arr.Add(listdes1);
  316. arr.Add(listdes2);
  317. insertArr.Add(listdes2);
  318. if (this.ultraGridPlan.ActiveRow.Cells["NODE_STATUS"].Text == "探伤完成")
  319. {
  320. MessageUtil.ShowTips("此炉已结炉,不允许进行实绩操作!");
  321. return;
  322. }
  323. if (e.Cell.Column.Key == "Btn1")//保存(直接提交)
  324. {
  325. //保存明细
  326. int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.InsetTestResultdetail", new object[] { arr, this.TestMethod }, this.ob);
  327. if (count > 0)
  328. {
  329. //insertSlabScrapSeq(insertArr);
  330. PlanQuery();
  331. MessageBox.Show("1#实绩保存成功", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  332. }
  333. else
  334. {
  335. MessageBox.Show("1#实绩保存失败", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  336. return;
  337. }
  338. }
  339. if (e.Cell.Column.Key == "Btn2")//回退
  340. {
  341. 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);
  342. PlanQuery();
  343. }
  344. }
  345. public void DetailComm21GridBtnClick(object sender, CellEventArgs e)
  346. {
  347. string hratno = "";
  348. //UltraGrid UltraGridDetail = this.testingResultDetailComm21.UltraGridDetail;
  349. //UltraGrid UltraGridDetailDes1 = this.testingResultDetailComm21.UltraGridDetailDes1;
  350. //UltraGrid UltraGridDetailDes2 = this.testingResultDetailComm21.UltraGridDetailDes2;
  351. //UltraGridDetail.Rows[0].Cells["offlineNum2"].Value = "0";
  352. //UltraGridDetail.Rows[0].Cells["backlineNum2"].Value = "0";
  353. //UltraGridDetail.UpdateData();
  354. //UltraGridDetailDes1.UpdateData();
  355. //UltraGridDetailDes2.UpdateData();
  356. if (this.ultraGridPlan.ActiveRow == null && ActiveJUDGE_STOVE_NO == null)
  357. {
  358. MessageBox.Show("未选择任何炉号,请选择炉号后进行保存操作。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  359. return;
  360. }
  361. if (this.ultraGridPlan.ActiveRow == null)
  362. {
  363. hratno = ActiveJUDGE_STOVE_NO;
  364. }
  365. else
  366. {
  367. hratno = this.ultraGridPlan.ActiveRow.Cells["JUDGE_STOVE_NO"].Value.ToString();
  368. }
  369. if (ActiveStatus == "未开始探伤")
  370. {
  371. MessageBox.Show("炉号:【" + BaseMethod.getJudgeStoveNo(hratno) + "】未开始进行探伤,不允许进行保存或提交操作!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  372. return;
  373. }
  374. //if (checkGrid(UltraGridDetail))
  375. //{
  376. // MessageBox.Show("2#线实绩统计有值未输入,请输入后再保存或提交", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  377. // return;
  378. //}
  379. //if (checkGrid(UltraGridDetailDes1))
  380. //{
  381. // MessageBox.Show("2#线实绩统计可疑品统计有值未输入,请输入后再保存或提交", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  382. // return;
  383. //}
  384. //if (checkGrid(UltraGridDetailDes2))
  385. //{
  386. // MessageBox.Show("2#线实绩统计判废品统计有值未输入,请输入后再保存或提交", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  387. // return;
  388. //}
  389. //if (checkGridData(UltraGridDetail, UltraGridDetailDes1, UltraGridDetailDes2, 2))
  390. //{
  391. // return;
  392. //}
  393. //foreach (UltraGridRow uRow in this.testingResultDetailComm21.UltraGridDetailDes1.Rows)
  394. //{
  395. // if (uRow.Cells["Check"].Value.ToString() == "True")
  396. // {
  397. // if (uRow.Cells["reason"].Value.ToString() == "")
  398. // {
  399. // MessageUtil.ShowTips("可疑品原因不能为空,请选择!");
  400. // return;
  401. // }
  402. // if (uRow.Cells["reasonNumber"].Value.ToString() == ""||uRow.Cells["reasonNumber"].Value.ToString() =="0")
  403. // {
  404. // MessageUtil.ShowTips("可疑品支数不能为空或者零支,请输入!");
  405. // return;
  406. // }
  407. // }
  408. //}
  409. //foreach (UltraGridRow uRow in this.testingResultDetailComm1.UltraGridDetailDes2.Rows)
  410. //{
  411. // if (uRow.Cells["Check"].Value.ToString() == "True")
  412. // {
  413. // if (uRow.Cells["reason"].Value.ToString() == "")
  414. // {
  415. // MessageUtil.ShowTips("剔除品原因不能为空,请选择!");
  416. // return;
  417. // }
  418. // if (uRow.Cells["reasonNumber"].Value.ToString() == "" || uRow.Cells["reasonNumber"].Value.ToString() == "0")
  419. // {
  420. // MessageUtil.ShowTips("剔除品支数不能为空或者为零支,请输入!");
  421. // return;
  422. // }
  423. // }
  424. //}
  425. string plincode = this.PlineCode;
  426. string resultno = this.ActiveResultNo;
  427. string ColGroup = this.UserInfo.GetUserGroup();
  428. string ColUser = this.UserInfo.GetUserName();
  429. string ColShift = this.UserInfo.GetUserOrder();
  430. MilTestingResultDetailEntity detail = new MilTestingResultDetailEntity();
  431. List<MilTestingResultDetailDesEntity> listdes1 = new List<MilTestingResultDetailDesEntity>();
  432. List<MilTestingResultDetailDesEntity> listdes2 = new List<MilTestingResultDetailDesEntity>();
  433. MilTestingResultDetailDesEntity detaildes = new MilTestingResultDetailDesEntity();
  434. //detail = NativeMethod.GetUltraGridToEntity(UltraGridDetail, detail);
  435. //listdes1 = NativeMethod.GetGridToList1(UltraGridDetailDes1, detaildes);
  436. //listdes2 = NativeMethod.GetGridToList1(UltraGridDetailDes2, detaildes);
  437. ArrayList arr = new ArrayList();
  438. detail.JudgeStoveNo = hratno;
  439. detail.ResultNo = resultno;
  440. detail.PlineCode = plincode;
  441. detail.ColGroup = ColGroup;
  442. detail.ColShift = ColShift;
  443. detail.ColUser = ColUser;
  444. detail.ColNo = "2";
  445. arr.Add(detail);
  446. foreach (MilTestingResultDetailDesEntity des in listdes1)
  447. {
  448. des.JudgeStoveNo = hratno;
  449. des.PlineCode = plincode;
  450. des.ResultNo = resultno;
  451. des.ColGroup = ColGroup;
  452. des.ColShift = ColShift;
  453. des.ColUser = ColUser;
  454. des.ColNo = "2";
  455. des.ReasonFlag = "可疑";
  456. //arr.Add(des);
  457. }
  458. foreach (MilTestingResultDetailDesEntity des in listdes2)
  459. {
  460. des.JudgeStoveNo = hratno;
  461. des.PlineCode = plincode;
  462. des.ResultNo = resultno;
  463. des.ColGroup = ColGroup;
  464. des.ColShift = ColShift;
  465. des.ColUser = ColUser;
  466. des.ColNo = "2";
  467. des.ReasonFlag = "剔除";
  468. //arr.Add(des);
  469. }
  470. arr.Add(listdes1);
  471. arr.Add(listdes2);
  472. if (this.ultraGridPlan.ActiveRow.Cells["NODE_STATUS"].Text == "探伤完成")
  473. {
  474. MessageUtil.ShowTips("此炉已结炉,不允许进行实绩操作!");
  475. return;
  476. }
  477. if (e.Cell.Column.Key == "Btn1")//保存(直接提交)
  478. {
  479. //保存明细
  480. int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.InsetTestResultdetail", new object[] { arr, this.TestMethod }, this.ob);
  481. if (count > 0)
  482. {
  483. PlanQuery();
  484. //MessageBox.Show("1#线实绩保存成功", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  485. }
  486. else
  487. {
  488. MessageBox.Show("2#线实绩保存失败", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  489. return;
  490. }
  491. }
  492. if (e.Cell.Column.Key == "Btn2")//提交(交班)
  493. {
  494. 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);
  495. PlanQuery();
  496. }
  497. }
  498. public void Detail16831GridBtnClick(object sender, CellEventArgs e)
  499. {
  500. string hratno = "";
  501. //UltraGrid UltraGridDetail = this.testingResultDetail16831.UltraGridDetail;
  502. //UltraGrid UltraGridDetailDes1 = this.testingResultDetail16831.UltraGridDetailDes1;
  503. //UltraGrid UltraGridDetailDes2 = this.testingResultDetail16831.UltraGridDetailDes2;
  504. //UltraGridDetail.Rows[0].Cells["offlineNum3"].Value = "0";
  505. //UltraGridDetail.Rows[0].Cells["backlineNum3"].Value = "0";
  506. //UltraGridDetail.UpdateData();
  507. //UltraGridDetailDes1.UpdateData();
  508. //UltraGridDetailDes2.UpdateData();
  509. if (this.ultraGridPlan.ActiveRow == null && ActiveJUDGE_STOVE_NO == null)
  510. {
  511. MessageBox.Show("未选择任何炉号,请选择炉号后进行保存操作。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  512. return;
  513. }
  514. if (this.ultraGridPlan.ActiveRow == null)
  515. {
  516. hratno = ActiveJUDGE_STOVE_NO;
  517. }
  518. else
  519. {
  520. hratno = this.ultraGridPlan.ActiveRow.Cells["JUDGE_STOVE_NO"].Value.ToString();
  521. }
  522. if (ActiveStatus == "未开始探伤")
  523. {
  524. MessageBox.Show("炉号:【" + BaseMethod.getJudgeStoveNo(hratno) + "】未开始进行探伤,不允许进行保存或提交操作!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  525. return;
  526. }
  527. //if (checkGrid(UltraGridDetail))
  528. //{
  529. // MessageBox.Show("3#线实绩统计有值未输入,请输入后再保存或提交", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  530. // return;
  531. //}
  532. //if (checkGrid(UltraGridDetailDes1))
  533. //{
  534. // MessageBox.Show("3#线实绩统计可疑品统计有值未输入,请输入后再保存或提交", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  535. // return;
  536. //}
  537. //if (checkGrid(UltraGridDetailDes2))
  538. //{
  539. // MessageBox.Show("3#线实绩统计判废品统计有值未输入,请输入后再保存或提交", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  540. // return;
  541. //}
  542. //if (checkGridData(UltraGridDetail, UltraGridDetailDes1, UltraGridDetailDes2, 3))
  543. //{
  544. // return;
  545. //}
  546. //foreach (UltraGridRow uRow in this.testingResultDetailComm21.UltraGridDetailDes1.Rows)
  547. //{
  548. // if (uRow.Cells["Check"].Value.ToString() == "True")
  549. // {
  550. // if (uRow.Cells["reason"].Value.ToString() == "")
  551. // {
  552. // MessageUtil.ShowTips("可疑品原因不能为空,请选择!");
  553. // return;
  554. // }
  555. // if (uRow.Cells["reasonNumber"].Value.ToString() == "" || uRow.Cells["reasonNumber"].Value.ToString() == "0")
  556. // {
  557. // MessageUtil.ShowTips("可疑品支数不能为空或者零支,请输入!");
  558. // return;
  559. // }
  560. // }
  561. //}
  562. //foreach (UltraGridRow uRow in this.testingResultDetailComm1.UltraGridDetailDes2.Rows)
  563. //{
  564. // if (uRow.Cells["Check"].Value.ToString() == "True")
  565. // {
  566. // if (uRow.Cells["reason"].Value.ToString() == "")
  567. // {
  568. // MessageUtil.ShowTips("剔除品原因不能为空,请选择!");
  569. // return;
  570. // }
  571. // if (uRow.Cells["reasonNumber"].Value.ToString() == "" || uRow.Cells["reasonNumber"].Value.ToString() == "0")
  572. // {
  573. // MessageUtil.ShowTips("剔除品支数不能为空或者零支,请输入!");
  574. // return;
  575. // }
  576. // }
  577. //}
  578. string plincode = this.PlineCode;
  579. string resultno = this.ActiveResultNo;
  580. string ColGroup = this.UserInfo.GetUserGroup();
  581. string ColUser = this.UserInfo.GetUserName();
  582. string ColShift = this.UserInfo.GetUserOrder();
  583. MilTestingResultDetailEntity detail = new MilTestingResultDetailEntity();
  584. List<MilTestingResultDetailDesEntity> listdes1 = new List<MilTestingResultDetailDesEntity>();
  585. List<MilTestingResultDetailDesEntity> listdes2 = new List<MilTestingResultDetailDesEntity>();
  586. MilTestingResultDetailDesEntity detaildes = new MilTestingResultDetailDesEntity();
  587. //detail = NativeMethod.GetUltraGridToEntity(UltraGridDetail, detail);
  588. //listdes1 = NativeMethod.GetGridToList1(UltraGridDetailDes1, detaildes);
  589. //listdes2 = NativeMethod.GetGridToList1(UltraGridDetailDes2, detaildes);
  590. ArrayList arr = new ArrayList();
  591. detail.JudgeStoveNo = hratno;
  592. detail.ResultNo = resultno;
  593. detail.PlineCode = plincode;
  594. detail.ColGroup = ColGroup;
  595. detail.ColShift = ColShift;
  596. detail.ColUser = ColUser;
  597. detail.ColNo = "3";
  598. arr.Add(detail);
  599. foreach (MilTestingResultDetailDesEntity des in listdes1)
  600. {
  601. des.JudgeStoveNo = hratno;
  602. des.PlineCode = plincode;
  603. des.ResultNo = resultno;
  604. des.ColGroup = ColGroup;
  605. des.ColShift = ColShift;
  606. des.ColUser = ColUser;
  607. des.ColNo = "3";
  608. des.ReasonFlag = "可疑";
  609. //arr.Add(des);
  610. }
  611. foreach (MilTestingResultDetailDesEntity des in listdes2)
  612. {
  613. des.JudgeStoveNo = hratno;
  614. des.PlineCode = plincode;
  615. des.ResultNo = resultno;
  616. des.ColGroup = ColGroup;
  617. des.ColShift = ColShift;
  618. des.ColUser = ColUser;
  619. des.ColNo = "3";
  620. des.ReasonFlag = "剔除";
  621. //arr.Add(des);
  622. }
  623. arr.Add(listdes1);
  624. arr.Add(listdes2);
  625. if (this.ultraGridPlan.ActiveRow.Cells["NODE_STATUS"].Text == "探伤完成")
  626. {
  627. MessageUtil.ShowTips("此炉已结炉,不允许进行实绩操作!");
  628. return;
  629. }
  630. if (e.Cell.Column.Key == "Btn1")//保存(直接提交)
  631. {
  632. //保存明细
  633. int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.InsetTestResultdetail", new object[] { arr, this.TestMethod }, this.ob);
  634. if (count > 0)
  635. {
  636. PlanQuery();
  637. //MessageBox.Show("1#线实绩保存成功", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  638. }
  639. else
  640. {
  641. MessageBox.Show("3#线实绩保存失败", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  642. return;
  643. }
  644. }
  645. if (e.Cell.Column.Key == "Btn2")//提交(交班)
  646. {
  647. 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);
  648. PlanQuery();
  649. }
  650. }
  651. /// <summary>
  652. /// 界面初始化事件
  653. /// </summary>
  654. /// <param name="e"></param>
  655. protected override void OnLoad(EventArgs e)
  656. {
  657. base.OnLoad(e);
  658. NativeMethodNew na = new NativeMethodNew(this.ob);
  659. //testingResultDetailComm1.Init(na.GetPCode(UserInfo.GetDepartment()));
  660. //testingResultDetailComm21.Init(na.GetPCode(UserInfo.GetDepartment()));
  661. // this.heatTreatmentControl1.Grid.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
  662. //this.ultraGrid2.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
  663. rollingInfomation1.UltraGrid4.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
  664. rollingCard1.UltraGrid4.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
  665. crackDetectionResult1.UltraGrid3.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
  666. ultraGridPlan.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
  667. ultraTestRack1.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
  668. //ultraTestRack2.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
  669. //ultraTestRack3.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
  670. mtTestingResult1.UltraGrid3.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
  671. ulTestingResult1.UltraGrid3.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
  672. mtTestingResult1.ob = this.ob;
  673. crackDetectionResult1.ob = this.ob;
  674. //mtTestingResult1.LoadData();
  675. //this.testingResultDetailComm1.UltraGridDetail.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
  676. //this.testingResultDetailComm1.UltraGridDetailDes1.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
  677. //this.testingResultDetailComm1.UltraGridDetailDes2.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
  678. //this.testingResultDetailComm21.UltraGridDetail.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
  679. //this.testingResultDetailComm21.UltraGridDetailDes1.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
  680. //this.testingResultDetailComm21.UltraGridDetailDes2.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
  681. //this.testingResultDetail1681.UltraGridDetail.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
  682. //this.testingResultDetail1681.UltraGridDetailDes1.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
  683. //this.testingResultDetail1681.UltraGridDetailDes2.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
  684. //this.testingResultDetail16821.UltraGridDetail.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
  685. //this.testingResultDetail16821.UltraGridDetailDes1.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
  686. //this.testingResultDetail16821.UltraGridDetailDes2.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
  687. //this.testingResultDetail16831.UltraGridDetail.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
  688. //this.testingResultDetail16831.UltraGridDetailDes1.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
  689. //this.testingResultDetail16831.UltraGridDetailDes2.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
  690. txtLOT_NO.Enabled = false;
  691. txtJudgeStoveNo.Enabled = false;
  692. this.crackDetectionResult1.Using1();
  693. this.crackDetectionResult1.Using2();
  694. this.crackDetectionResult1.Using3();
  695. mtTestingResult1.Using1();
  696. mtTestingResult1.Using2();
  697. foreach (UltraGridColumn ugc in ultraGridPlan.DisplayLayout.Bands[0].Columns)
  698. {
  699. ugc.SortIndicator = SortIndicator.Disabled;
  700. }
  701. }
  702. /// <summary>
  703. /// 按钮触发
  704. /// </summary>
  705. /// <param name="sender"></param>
  706. /// <param name="ToolbarKey"></param>
  707. public override void ToolBar_Click(object sender, string ToolbarKey)
  708. {
  709. //base.ToolBar_Click(sender, ToolbarKey);
  710. switch (ToolbarKey)
  711. {
  712. case "Query": //查询
  713. PlanQuery();
  714. break;
  715. case "Save": //保存
  716. ETResultSave();
  717. break;
  718. case "Node": //结炉
  719. ETTestingResultNode();
  720. break;
  721. case "DoNodeBack":
  722. NodeBack();
  723. break;
  724. case "NodeQuery": //结炉实绩查询
  725. NodeQuery();
  726. break;
  727. case "Doofflinre":
  728. Offline();
  729. break;
  730. case "ReLine":
  731. BackLine();
  732. break;
  733. case "DoStart":
  734. DoStart();
  735. break;
  736. case "DoStartBack":
  737. StartBack();
  738. break;
  739. case "colchang":
  740. // colchang();
  741. break;
  742. case "DoChangeCancel":
  743. // ChangeShiftBack();
  744. break;
  745. case "sign":
  746. Sign();
  747. break;
  748. case "DoPrint":
  749. PrintResult();
  750. break;
  751. case "PrintReport":
  752. PrintReport();
  753. break;
  754. case "PrintReportRZ":
  755. PrintReportRZ();
  756. break;
  757. case "changColGroup":
  758. CancelchangColGroup();
  759. break;
  760. case "UpFile":
  761. UpFile();
  762. break;
  763. case "UpFileRZ":
  764. UpFileRZ();
  765. break;
  766. //case "SelectFile":
  767. // SelectFile();
  768. // break;
  769. case "Close":
  770. this.Dispose();
  771. this.Close();
  772. break;
  773. }
  774. }
  775. /// <summary>
  776. /// 查询上传的PDF文件
  777. /// </summary>
  778. private void SelectFile(string filePathNew)
  779. {
  780. dlgOrderAskDown down = new dlgOrderAskDown(this.ob, filePathNew);
  781. down.DeleteButton.Visible = false;
  782. down.ShowDialog();
  783. }
  784. /// <summary>
  785. /// 上传探伤报告
  786. /// </summary>
  787. private void UpFile()
  788. {
  789. WebClient webClient = new WebClient();
  790. List<FileBean> listPdf = new List<FileBean>();
  791. string date = DateTime.Now.ToString("yyyyMMdd");
  792. string heatno = this.ActiveJUDGE_STOVE_NO;
  793. string judge = BaseMethod.getJudgeStoveNo(this.ActiveJUDGE_STOVE_NO);
  794. string Shift = UserInfo.GetUserOrder();
  795. string Group = UserInfo.GetUserGroup();
  796. string url = "";
  797. string filePathNew = ""; //探伤报告目录
  798. string reportNo = ""; //报告编号
  799. DataTable dt = new DataTable();
  800. dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FileUpdate.getReportNo", new object[] { judge, PlineCode, Shift, Group }, this.ob);
  801. if (dt.Rows.Count > 0)
  802. {
  803. reportNo = dt.Rows[0][0].ToString();
  804. }
  805. //craftOrdDesign.CraftPath = filePathNew + craftOrdDesign.CraftNo + ".pdf";
  806. switch (PlineCode)
  807. {
  808. case "C008": //250
  809. 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;
  810. filePathNew = "DicReport/250/" + judge + "/";
  811. break;
  812. case "C009": //258
  813. 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;
  814. filePathNew = "DicReport/258/" + judge + "/";
  815. break;
  816. case "C010": //168
  817. 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;
  818. filePathNew = "DicReport/168/" + judge + "/";
  819. break;
  820. case "C012": //Arssel
  821. break;
  822. case "C017": //460
  823. 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;
  824. filePathNew = "DicReport/460/" + judge + "/";
  825. break;
  826. case "C072": //508
  827. 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;
  828. filePathNew = "DicReport/508/" + judge + "/";
  829. break;
  830. }
  831. byte[] pdf = webClient.DownloadData(url);
  832. FileBean fileBean = new FileBean();
  833. fileBean.setFile(pdf);
  834. fileBean.setFileName(reportNo + ".pdf");
  835. fileBean.setPathName(filePathNew);
  836. listPdf.Add(fileBean);
  837. webClient.Dispose();
  838. bool a = FileHelper.Upload(listPdf);
  839. if (a)
  840. {
  841. CoreClientParam ccp = new CoreClientParam();
  842. ccp.ServerName = "com.steering.mes.zgmil.coup.FileUpdate";
  843. ccp.MethodName = "updateInspectionReport";
  844. ccp.ServerParams = new object[] { judge, Shift, Group, PlineCode, _UserName, filePathNew, proPlanId, gxPlanNo };
  845. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  846. if (ccp.ReturnCode != -1)
  847. {
  848. if (ccp.ReturnInfo.Equals("上传成功!"))
  849. {
  850. MessageUtil.ShowTips(ccp.ReturnInfo);
  851. SelectFile(filePathNew + reportNo + ".pdf");
  852. }
  853. else
  854. {
  855. MessageUtil.ShowTips(ccp.ReturnInfo);
  856. }
  857. }
  858. }
  859. else
  860. {
  861. MessageUtil.ShowError("系统生成PDF失败,请稍后再试!");
  862. return;
  863. }
  864. }
  865. /// <summary>
  866. /// 上传探伤报告(认证)
  867. /// </summary>
  868. private void UpFileRZ()
  869. {
  870. WebClient webClient = new WebClient();
  871. List<FileBean> listPdf = new List<FileBean>();
  872. string date = DateTime.Now.ToString("yyyyMMdd");
  873. string heatno = this.ActiveJUDGE_STOVE_NO;
  874. string judge = BaseMethod.getJudgeStoveNo(this.ActiveJUDGE_STOVE_NO);
  875. string Shift = UserInfo.GetUserOrder();
  876. string Group = UserInfo.GetUserGroup();
  877. string url = "";
  878. string filePathNew = ""; //探伤报告目录
  879. string reportNo = ""; //报告编号
  880. DataTable dt = new DataTable();
  881. dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FileUpdate.getReportNo", new object[] { judge, PlineCode, Shift, Group }, this.ob);
  882. if (dt.Rows.Count > 0)
  883. {
  884. reportNo = dt.Rows[0][0].ToString();
  885. }
  886. //craftOrdDesign.CraftPath = filePathNew + craftOrdDesign.CraftNo + ".pdf";
  887. switch (PlineCode)
  888. {
  889. case "C072": //508
  890. 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;
  891. filePathNew = "DicReport/508/" + judge + "/";
  892. break;
  893. }
  894. byte[] pdf = webClient.DownloadData(url);
  895. FileBean fileBean = new FileBean();
  896. fileBean.setFile(pdf);
  897. fileBean.setFileName(reportNo + ".pdf");
  898. fileBean.setPathName(filePathNew);
  899. listPdf.Add(fileBean);
  900. webClient.Dispose();
  901. bool a = FileHelper.Upload(listPdf);
  902. if (a)
  903. {
  904. CoreClientParam ccp = new CoreClientParam();
  905. ccp.ServerName = "com.steering.mes.zgmil.coup.FileUpdate";
  906. ccp.MethodName = "updateInspectionReport";
  907. ccp.ServerParams = new object[] { judge, Shift, Group, PlineCode, _UserName, filePathNew, proPlanId, gxPlanNo };
  908. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  909. if (ccp.ReturnCode != -1)
  910. {
  911. if (ccp.ReturnInfo.Equals("上传成功!"))
  912. {
  913. MessageUtil.ShowTips(ccp.ReturnInfo);
  914. SelectFile(filePathNew + reportNo + ".pdf");
  915. }
  916. else
  917. {
  918. MessageUtil.ShowTips(ccp.ReturnInfo);
  919. }
  920. }
  921. }
  922. else
  923. {
  924. MessageUtil.ShowError("系统生成PDF失败,请稍后再试!");
  925. return;
  926. }
  927. }
  928. /// <summary>
  929. /// 自动上传PDF文件
  930. /// </summary>
  931. private void AutoUpFile()
  932. {
  933. WebClient webClient = new WebClient();
  934. List<FileBean> listPdf = new List<FileBean>();
  935. string date = DateTime.Now.ToString("yyyyMMdd");
  936. string heatno = this.ActiveJUDGE_STOVE_NO;
  937. string judge = BaseMethod.getJudgeStoveNo(this.ActiveJUDGE_STOVE_NO);
  938. string Shift = UserInfo.GetUserOrder();
  939. string Group = UserInfo.GetUserGroup();
  940. string url = "";
  941. string filePathNew = ""; //探伤报告目录
  942. string reportNo = ""; //报告编号
  943. DataTable dt = new DataTable();
  944. dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FileUpdate.getReportNo", new object[] { judge, PlineCode, Shift, Group }, this.ob);
  945. if (dt.Rows.Count > 0)
  946. {
  947. reportNo = dt.Rows[0][0].ToString();
  948. }
  949. //craftOrdDesign.CraftPath = filePathNew + craftOrdDesign.CraftNo + ".pdf";
  950. switch (PlineCode)
  951. {
  952. case "C008": //250
  953. 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;
  954. filePathNew = "DicReport/250/" + judge + "/";
  955. break;
  956. case "C009": //258
  957. 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;
  958. filePathNew = "DicReport/258/" + judge + "/";
  959. break;
  960. case "C010": //168
  961. 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;
  962. filePathNew = "DicReport/168/" + judge + "/";
  963. break;
  964. case "C012": //Arssel
  965. break;
  966. case "C017": //460
  967. 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;
  968. filePathNew = "DicReport/460/" + judge + "/";
  969. break;
  970. case "C072": //508
  971. 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;
  972. filePathNew = "DicReport/508/" + judge + "/";
  973. break;
  974. }
  975. byte[] pdf = webClient.DownloadData(url);
  976. FileBean fileBean = new FileBean();
  977. fileBean.setFile(pdf);
  978. fileBean.setFileName(reportNo + ".pdf");
  979. fileBean.setPathName(filePathNew);
  980. listPdf.Add(fileBean);
  981. webClient.Dispose();
  982. bool a = FileHelper.Upload(listPdf);
  983. if (a)
  984. {
  985. CoreClientParam ccp = new CoreClientParam();
  986. ccp.ServerName = "com.steering.mes.zgmil.coup.FileUpdate";
  987. ccp.MethodName = "updateInspectionReport";
  988. ccp.ServerParams = new object[] { judge, Shift, Group, PlineCode, _UserName, filePathNew, proPlanId, gxPlanNo };
  989. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  990. if (ccp.ReturnCode != -1)
  991. {
  992. if (ccp.ReturnInfo.Equals("上传成功!"))
  993. {
  994. }
  995. else
  996. {
  997. MessageUtil.ShowTips(ccp.ReturnInfo);
  998. }
  999. }
  1000. }
  1001. else
  1002. {
  1003. MessageUtil.ShowError("系统生成PDF失败,请手动上传报告!");
  1004. return;
  1005. }
  1006. }
  1007. /// <summary>
  1008. /// 取消交接班
  1009. /// </summary>
  1010. private void CancelchangColGroup()
  1011. {
  1012. UltraGridRow ugr_plan = this.ultraGridPlan.ActiveRow;
  1013. if (ugr_plan == null) return;
  1014. //string Status = ugr_plan.Cells["IS_START"].Value.ToString();
  1015. string ActiveJUDGE_STOVE_NO = ugr_plan.Cells["JUDGE_STOVE_NO"].Value.ToString();
  1016. string ActiveResultNo = ugr_plan.Cells["ID"].Value.ToString();
  1017. string Status = doQueryJugeNoStaus(ActiveResultNo, ActiveJUDGE_STOVE_NO, PlineCode);
  1018. if (Status == "1")
  1019. {
  1020. MessageBox.Show("炉号:【" + ActiveJUDGE_STOVE_NO + "】已完成探伤操作,不允许进行交班取消!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  1021. return;
  1022. }
  1023. if (Status == "3")
  1024. {
  1025. MessageBox.Show("炉号:【" + ActiveJUDGE_STOVE_NO + "】未开始探伤操作,不允许进行交班取消!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  1026. return;
  1027. }
  1028. string Shift = UserInfo.GetUserOrder();
  1029. string Group = UserInfo.GetUserGroup();
  1030. NativeMethodNew na = new NativeMethodNew(this.ob);
  1031. na.ChangeShiftBack(ActiveJUDGE_STOVE_NO, ActiveResultNo, proPlanId, gxPlanNo, PlineCode, Shift, Group, 8);
  1032. PlanQuery();
  1033. ChangeGridColor();
  1034. }
  1035. public string DoCheck(CoreUserInfo User)
  1036. {
  1037. return "";
  1038. }
  1039. private void ShowShift()
  1040. {
  1041. colShowShiftGroup1.Ob = this.ob;
  1042. colShowShiftGroup1.Group = this.UserInfo.GetUserGroup();
  1043. colShowShiftGroup1.Shift = this.UserInfo.GetUserOrder();
  1044. colShowShiftGroup1.ShowShift();
  1045. colShowShiftGroup1.Timer1.Enabled = true;
  1046. }
  1047. private void chkLotNo_CheckedChanged(object sender, EventArgs e)
  1048. {
  1049. this.txtLOT_NO.Enabled = this.chkLotNo.Checked;
  1050. }
  1051. private void chkHeatNo_CheckedChanged(object sender, EventArgs e)
  1052. {
  1053. if (this.chkHeatNo.Checked)
  1054. {
  1055. this.txtJudgeStoveNo.Enabled = true;
  1056. }
  1057. else
  1058. {
  1059. this.txtJudgeStoveNo.Enabled = false;
  1060. }
  1061. if (chkStatusQuery.Checked)
  1062. {
  1063. PlanStatusQuery = "99";
  1064. PlanStartStatusQuery = "90";
  1065. }
  1066. else
  1067. {
  1068. PlanStatusQuery = "89";
  1069. PlanStartStatusQuery = "00";
  1070. }
  1071. }
  1072. /// <summary>
  1073. /// 页面开启事件
  1074. /// </summary>
  1075. /// <param name="e"></param>
  1076. protected override void OnShown(EventArgs e)
  1077. {
  1078. base.OnShown(e);
  1079. //string hostname = Dns.GetHostName();
  1080. //IPAddress ip = Dns.GetHostByName(hostname).AddressList[0];
  1081. NativeMethodNew na = new NativeMethodNew(this.ob);
  1082. //TestMethod = na.GetOperateResult(ip.ToString(), "1");
  1083. //if (!TestMethod.Contains("探伤"))
  1084. //{
  1085. // MessageBox.Show("提示:该电脑不是探伤操作台电脑,不允许操作改界面。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  1086. // this.Dispose();
  1087. // this.Close();
  1088. // return;
  1089. //}
  1090. Departm = UserInfo.GetDepartment();
  1091. PlineCode = na.GetPCode(Departm);//获取 用户 对应的产线
  1092. //string plcode = na.GetOperateResult(ip.ToString(), "0");
  1093. //plcode = plcode.ToString().Trim();
  1094. //if (!PlineCode.Equals(plcode.Trim()))
  1095. //{
  1096. // MessageBox.Show("提示:您的账号所属产线与配置不符。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  1097. // this.Dispose();
  1098. // this.Close();
  1099. // return;
  1100. //}
  1101. if (PlineCode.Equals("C009") || PlineCode.Equals("C017") || PlineCode.Equals("C008"))
  1102. {
  1103. offlinenode = "12";
  1104. ValueList va = new ValueList();
  1105. va.ValueListItems.Add("ISO10893-3");
  1106. va.ValueListItems.Add("ASTM E570");
  1107. va.ValueListItems.Add("GB/T12606");
  1108. //va.ValueListItems.Add("ISO10893-1");
  1109. va.ValueListItems.Add("GB/T 40080");
  1110. this.mtTestingResult1.UltraGrid3.Rows[0].Cells["InspectionStandard"].ValueList = va;
  1111. }
  1112. else if (PlineCode.Equals("C072"))
  1113. {
  1114. offlinenode = "12";
  1115. ValueList va = new ValueList();
  1116. va.ValueListItems.Add("ISO10893-3");
  1117. va.ValueListItems.Add("ASTM E570");
  1118. va.ValueListItems.Add("GB/T12606");
  1119. va.ValueListItems.Add("EN 10246-1");
  1120. va.ValueListItems.Add("GB/T 40080");
  1121. va.ValueListItems.Add("ISO 10893-1");
  1122. this.mtTestingResult1.UltraGrid3.Rows[0].Cells["InspectionStandard"].ValueList = va;
  1123. }
  1124. else if (PlineCode.Equals("C010"))
  1125. {
  1126. offlinenode = "11";
  1127. }
  1128. else
  1129. {
  1130. offlinenode = "13";
  1131. }
  1132. //if (TestMethod.Contains("涡流"))
  1133. //{
  1134. // offlinenode = "11";
  1135. //}
  1136. //if (TestMethod.Contains("漏磁"))
  1137. //{
  1138. // offlinenode = "12";
  1139. // ValueList va = new ValueList();
  1140. // va.ValueListItems.Add("ISO10893-3");
  1141. // va.ValueListItems.Add("ASTM E570");
  1142. // va.ValueListItems.Add("GB/T12606");
  1143. // this.mtTestingResult1.UltraGrid3.Rows[0].Cells["InspectionStandard"].ValueList = va;
  1144. //}
  1145. //if (TestMethod.Contains("超声波"))
  1146. //{
  1147. // offlinenode = "13";
  1148. //}
  1149. if (PlineCode.Equals("C009") || PlineCode.Equals("C012") || PlineCode.Equals("C017") || PlineCode.Equals("C072"))
  1150. {
  1151. this.rollingCard1.ChangCard();
  1152. }
  1153. //Colno = TestMethod.Substring(TestMethod.Length - 2, 1);
  1154. if (PlineCode.Equals("C008") || PlineCode.Equals("C009") || PlineCode.Equals("C012") || PlineCode.Equals("C072"))
  1155. {
  1156. ultraTabControl1.Tabs[0].Visible = false;
  1157. ultraTabControl1.Tabs[1].Visible = true;
  1158. ultraTabControl1.Tabs[2].Visible = false;
  1159. }
  1160. else if (PlineCode.Equals("C010"))
  1161. {
  1162. ultraTabControl1.Tabs[0].Visible = true;
  1163. ultraTabControl1.Tabs[1].Visible = false;
  1164. ultraTabControl1.Tabs[2].Visible = false;
  1165. }
  1166. else
  1167. {
  1168. ultraTabControl1.Tabs[0].Visible = false;
  1169. ultraTabControl1.Tabs[1].Visible = false;
  1170. ultraTabControl1.Tabs[2].Visible = true;
  1171. }
  1172. if (PlineCode.Equals("C010"))
  1173. {
  1174. //ultraTabControl3.Tabs[0].Visible = false;
  1175. //ultraTabControl3.Tabs[1].Visible = true;
  1176. // ultraExpandableGroupBox2.Visible = true;
  1177. }
  1178. else
  1179. {
  1180. //ultraTabControl3.Tabs[0].Visible = true;
  1181. //ultraTabControl3.Tabs[1].Visible = false;
  1182. //ultraExpandableGroupBox2.Visible = false;
  1183. }
  1184. //this.testingResultDetailComm21.PlineCode = plcode;
  1185. this.ultraGridPlan.Focus();
  1186. PlanQuery();
  1187. //foreach (UltraGridRow ugr in ultraGridPlan.Rows)
  1188. //{
  1189. // ugr.Cells["JUDGE_NO"].Value = BaseMethod.getJudgeStoveNo(ugr.Cells["JUDGE_STOVE_NO"].Value.ToString());
  1190. //}
  1191. Shift = UserInfo.GetUserOrder();
  1192. Group = UserInfo.GetUserGroup();
  1193. mtTestingResult1.ColGroup = Group;
  1194. mtTestingResult1.PlineCode = PlineCode;
  1195. crackDetectionResult1.ColGroup = Group;
  1196. crackDetectionResult1.PlineCode = PlineCode;
  1197. mtTestingResult1.LoadData();
  1198. crackDetectionResult1.LoadData();
  1199. Sign();
  1200. ShowShift();
  1201. }
  1202. /// <summary>
  1203. /// 签名
  1204. /// </summary>
  1205. private void Sign()
  1206. {
  1207. ColUserName col = new ColUserName();
  1208. col.StationId = "8";
  1209. col.PlineCode = PlineCode;
  1210. col.ColGroup = Group;
  1211. col.Ob = this.ob;
  1212. col.ShowDialog();
  1213. _UserID = col.getUserId();
  1214. _UserName = col.getUserName();
  1215. }
  1216. /// <summary>
  1217. /// 修改IS_START名称
  1218. /// </summary>
  1219. public void ChangeCellName()
  1220. {
  1221. if (ultraGridPlan.Rows.Count > 0)
  1222. {
  1223. NativeMethodNew na = new NativeMethodNew(this.ob);
  1224. foreach (UltraGridRow ugr in ultraGridPlan.Rows)
  1225. {
  1226. //String Judge_Stove_No = ugr.Cells["JUDGE_DTOVE_NO"].Value.ToString();
  1227. //if (na.isBegineNode(Judge_Stove_No, 0))
  1228. //{
  1229. // ugr.Appearance.BackColor = Color.YellowGreen;
  1230. //}
  1231. if (ugr.Cells["IS_START"].Value.ToString() != "未开始探伤" && ugr.Cells["IS_START"].Value.ToString() != "已开始探伤" && ugr.Cells["IS_START"].Value.ToString() != "已完成探伤")
  1232. {
  1233. switch (Convert.ToInt32(ugr.Cells["IS_START"].Value))
  1234. {
  1235. case 3:
  1236. ugr.Cells["IS_START"].Value = "未开始探伤";
  1237. break;
  1238. case 0:
  1239. ugr.Cells["IS_START"].Value = "已开始探伤";
  1240. break;
  1241. case 1:
  1242. ugr.Cells["IS_START"].Value = "已完成探伤";
  1243. break;
  1244. }
  1245. }
  1246. }
  1247. }
  1248. }
  1249. /// <summary>
  1250. /// 判断是否能开始当前炉次
  1251. /// </summary>
  1252. /// <returns></returns>
  1253. private void IsStart()
  1254. {
  1255. foreach (UltraGridRow ugr in ultraGridPlan.Rows)
  1256. {
  1257. if (ugr.Cells["IS_START"].Value.ToString() == "已开始探伤")
  1258. {
  1259. MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(ugr.Cells["JUDGE_STOVE_NO"].Value.ToString()) + "】正在探伤,不能两炉同时开始探伤。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  1260. return;
  1261. }
  1262. }
  1263. }
  1264. /// <summary>
  1265. /// 更改Grid颜色
  1266. /// </summary>
  1267. public void ChangeGridColor()
  1268. {
  1269. foreach (UltraGridRow ugr in ultraGridPlan.Rows)
  1270. {
  1271. if (ugr.Cells["IS_START"].Value.ToString() == "已完成探伤")
  1272. {
  1273. ugr.Appearance.BackColor = Color.YellowGreen;
  1274. }
  1275. }
  1276. if (ultraTestRack1.Rows.Count > 0)
  1277. {
  1278. foreach (UltraGridRow ugr in ultraTestRack1.Rows)
  1279. {
  1280. if (ugr != null)
  1281. {
  1282. if (ugr.Cells["SUSPECT_FLAG"].Value.Equals("可疑"))
  1283. {
  1284. ugr.Appearance.BackColor = Color.LightYellow;
  1285. }
  1286. switch (ugr.Cells["STATUS"].Value.ToString())
  1287. {
  1288. case "判废":
  1289. ugr.Appearance.BackColor = Color.Yellow;
  1290. break;
  1291. case "报警":
  1292. ugr.Appearance.BackColor = Color.YellowGreen;
  1293. break;
  1294. }
  1295. switch (ugr.Cells["CHANGE_FLAG"].Value.ToString())
  1296. {
  1297. case "待接班确认":
  1298. ugr.Appearance.BackColor = Color.LightGreen;
  1299. break;
  1300. }
  1301. }
  1302. }
  1303. }
  1304. }
  1305. /// <summary>
  1306. /// 查询流通卡信息
  1307. /// </summary>
  1308. public void GetRollingCard()
  1309. {
  1310. UltraGridRow ugr = ultraGridPlan.ActiveRow;
  1311. if (ugr != null)
  1312. {
  1313. string JudgeStoveNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
  1314. DataTable dt = new DataTable();
  1315. if (PlineCode.Equals("C009") || PlineCode.Equals("C012") || PlineCode.Equals("C017") || PlineCode.Equals("C072"))
  1316. {
  1317. if (this.ultraGridPlan.ActiveRow.Cells["BACK_PLAN_FLAG"].Text.Trim().ToString2() == "8" || this.ultraGridPlan.ActiveRow.Cells["BACK_PLAN_FLAG"].Text.Trim().ToString2() == "7")
  1318. {
  1319. dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getRollingCard1BackLine", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, ob);
  1320. }
  1321. else
  1322. {
  1323. dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getRollingCard1", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, this.ob);
  1324. }
  1325. }
  1326. else if (PlineCode.Equals("C010"))
  1327. {
  1328. if (this.ultraGridPlan.ActiveRow.Cells["BACK_PLAN_FLAG"].Text.Trim().ToString2() == "8" || this.ultraGridPlan.ActiveRow.Cells["BACK_PLAN_FLAG"].Text.Trim().ToString2() == "7")
  1329. {
  1330. dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.getRollCard168BackLine", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, ob);
  1331. }
  1332. else
  1333. {
  1334. dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.getRollCard168", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, this.ob);
  1335. }
  1336. }
  1337. else
  1338. {
  1339. if (this.ultraGridPlan.ActiveRow.Cells["BACK_PLAN_FLAG"].Text.Trim().ToString2() == "8" || this.ultraGridPlan.ActiveRow.Cells["BACK_PLAN_FLAG"].Text.Trim().ToString2() == "7")
  1340. {
  1341. dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getRollingCardBackLine", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, ob);
  1342. }
  1343. else
  1344. {
  1345. dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getRollingCard", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, this.ob);
  1346. }
  1347. }
  1348. RollingCardEditGrid(dt, JudgeStoveNo);
  1349. }
  1350. }
  1351. /// <summary>
  1352. /// 流通卡赋值
  1353. /// </summary>
  1354. /// <param name="dt"></param>
  1355. public void RollingCardEditGrid(DataTable dt, string heatno)
  1356. {
  1357. clearRollCard();
  1358. if (dt.Rows.Count > 0)
  1359. {
  1360. if (this.ultraGridPlan.ActiveRow.Cells["BACK_PLAN_FLAG"].Text.Trim().ToString2() == "8" || this.ultraGridPlan.ActiveRow.Cells["BACK_PLAN_FLAG"].Text.Trim().ToString2() == "7")
  1361. {
  1362. //上料切前判废支数
  1363. this.rollingCard1.Value.FeedScrapNum = "0";
  1364. //上料切前合格支数
  1365. this.rollingCard1.Value.FeedQualifiedNum = "0";
  1366. //上料判废支数
  1367. this.rollingCard1.Value.FeedScrapDBNum = "0";
  1368. //上料合格支数
  1369. this.rollingCard1.Value.FeedQualifiedDBNum = "0";
  1370. //加热炉判废支数
  1371. this.rollingCard1.Value.FurScrapNum = "0";
  1372. //加热炉合格支数
  1373. this.rollingCard1.Value.FurQualifiedNum = "0";
  1374. //穿孔判废支数
  1375. this.rollingCard1.Value.PerScrapNum = "0";
  1376. //穿孔合格支数
  1377. this.rollingCard1.Value.PerQualifiedNum = "0";
  1378. //连轧判废支数
  1379. this.rollingCard1.Value.RollingScrapNum = "0";
  1380. //连轧合格支数
  1381. this.rollingCard1.Value.RollingQualifiedNum = "0";
  1382. //再加热炉判废支数
  1383. this.rollingCard1.Value.RefurScrapNum = "0";
  1384. //再加热炉合格支数
  1385. this.rollingCard1.Value.RefurQualifiedNum = "0";
  1386. //定径判废支数
  1387. this.rollingCard1.Value.SizingScrapNum = "0";
  1388. //定径合格支数
  1389. this.rollingCard1.Value.SizingQualifiedNum = "0";
  1390. //分切前判废支数
  1391. this.rollingCard1.Value.SawScrapNumBE = "0";
  1392. //分切前合格支数
  1393. this.rollingCard1.Value.SawQualifiedNumBE = "0";
  1394. //分切判废支数
  1395. this.rollingCard1.Value.SawScrapNum = "0";
  1396. //分切合格支数
  1397. this.rollingCard1.Value.SawQualifiedNum = "0";
  1398. //矫直判废支数
  1399. this.rollingCard1.Value.StraightScrapNum = dt.Rows[0]["SCRAP_STRAIGHT"].ToString();
  1400. //矫直合格支数
  1401. this.rollingCard1.Value.StraightQualifiedNum = dt.Rows[0]["QUALIFIED_STRAIGHT"].ToString();
  1402. //矫直下线支数
  1403. this.rollingCard1.Value.OfflineStraight = dt.Rows[0]["OFFLINE_STRAIGHT"].ToString();
  1404. //矫直返线支数
  1405. this.rollingCard1.Value.BacklineStraight = dt.Rows[0]["BACKLINE_STRAIGHT"].ToString();
  1406. //探伤判废支数
  1407. this.rollingCard1.Value.TestingScrapNum = dt.Rows[0]["SCRAP_TESTING"].ToString();
  1408. //探伤合格支数
  1409. this.rollingCard1.Value.TestingQualifiedNum = dt.Rows[0]["QUALIFIED_TESTING"].ToString();
  1410. NativeMethodNew na = new NativeMethodNew(this.ob);
  1411. if (na.isBegineNode(heatno, 8) || na.isBegineNode(heatno, 9) || na.isBegineNode(heatno, 10))
  1412. {
  1413. //探伤下线支数
  1414. this.rollingCard1.Value.OfflineTesting = dt.Rows[0]["OFFLINE_TESTING"].ToString();
  1415. this.rollingCard1.Value.BacklineTesting = dt.Rows[0]["BACKLINE_TESTING"].ToString();
  1416. }
  1417. else
  1418. {
  1419. if (dt.Rows[0]["OFFLINE_TESTING"].ToString() == "0")
  1420. {
  1421. this.rollingCard1.Value.OfflineTesting = "";
  1422. this.rollingCard1.Value.BacklineTesting = "";
  1423. }
  1424. else
  1425. {
  1426. //探伤下线支数
  1427. this.rollingCard1.Value.OfflineTesting = dt.Rows[0]["OFFLINE_TESTING"].ToString();
  1428. this.rollingCard1.Value.BacklineTesting = dt.Rows[0]["BACKLINE_TESTING"].ToString();
  1429. }
  1430. }
  1431. //表检剔除支数
  1432. this.rollingCard1.Value.SurfaceScrapNum = dt.Rows[0]["WASTE_QUANTITY"].ToString();
  1433. //表检合格支数
  1434. this.rollingCard1.Value.SurfaceQualifiedNum = dt.Rows[0]["QUALIFIED_BRANCH"].ToString();
  1435. //表检下线支数
  1436. this.rollingCard1.Value.OfflineSurface = dt.Rows[0]["OFFLINE_QUANTITY"].ToString();
  1437. }
  1438. else
  1439. {
  1440. //上料切前判废支数
  1441. this.rollingCard1.Value.FeedScrapNum = dt.Rows[0]["SCRAP_FEED"].ToString();
  1442. //上料切前合格支数
  1443. this.rollingCard1.Value.FeedQualifiedNum = dt.Rows[0]["QUALIFIED_FEED"].ToString();
  1444. //上料判废支数
  1445. this.rollingCard1.Value.FeedScrapDBNum = dt.Rows[0]["SCRAP_DBFEED"].ToString();
  1446. //上料合格支数
  1447. this.rollingCard1.Value.FeedQualifiedDBNum = dt.Rows[0]["QUALIFIED_DBFEED"].ToString();
  1448. //加热炉判废支数
  1449. this.rollingCard1.Value.FurScrapNum = dt.Rows[0]["SCRAP_FUR"].ToString();
  1450. //加热炉合格支数
  1451. this.rollingCard1.Value.FurQualifiedNum = dt.Rows[0]["QUALIFIED_FUR"].ToString();
  1452. //穿孔判废支数
  1453. this.rollingCard1.Value.PerScrapNum = dt.Rows[0]["SCRAP_PER"].ToString();
  1454. //穿孔合格支数
  1455. this.rollingCard1.Value.PerQualifiedNum = dt.Rows[0]["QUALIFIED_PER"].ToString();
  1456. //连轧判废支数
  1457. this.rollingCard1.Value.RollingScrapNum = dt.Rows[0]["SCRAP_ROLLING"].ToString();
  1458. //连轧合格支数
  1459. this.rollingCard1.Value.RollingQualifiedNum = dt.Rows[0]["QUALIFIED_ROLLING"].ToString();
  1460. //再加热炉判废支数
  1461. this.rollingCard1.Value.RefurScrapNum = dt.Rows[0]["SCRAP_REFUR"].ToString();
  1462. //再加热炉合格支数
  1463. this.rollingCard1.Value.RefurQualifiedNum = dt.Rows[0]["QUALIFIED_REFUR"].ToString();
  1464. //定径判废支数
  1465. this.rollingCard1.Value.SizingScrapNum = dt.Rows[0]["SCRAP_SIZING"].ToString();
  1466. //定径合格支数
  1467. this.rollingCard1.Value.SizingQualifiedNum = dt.Rows[0]["QUALIFIED_SIZING"].ToString();
  1468. //分切前判废支数
  1469. this.rollingCard1.Value.SawScrapNumBE = dt.Rows[0]["SCRAP_SAW_BE"].ToString();
  1470. //分切前合格支数
  1471. this.rollingCard1.Value.SawQualifiedNumBE = dt.Rows[0]["QUALIFIED_SAW_BE"].ToString();
  1472. //分切判废支数
  1473. this.rollingCard1.Value.SawScrapNum = dt.Rows[0]["SCRAP_SAW"].ToString();
  1474. //分切合格支数
  1475. this.rollingCard1.Value.SawQualifiedNum = dt.Rows[0]["QUALIFIED_SAW"].ToString();
  1476. //矫直判废支数
  1477. this.rollingCard1.Value.StraightScrapNum = dt.Rows[0]["SCRAP_STRAIGHT"].ToString();
  1478. //矫直合格支数
  1479. this.rollingCard1.Value.StraightQualifiedNum = dt.Rows[0]["QUALIFIED_STRAIGHT"].ToString();
  1480. //矫直下线支数
  1481. this.rollingCard1.Value.OfflineStraight = dt.Rows[0]["OFFLINE_STRAIGHT"].ToString();
  1482. //矫直返线支数
  1483. this.rollingCard1.Value.BacklineStraight = dt.Rows[0]["BACKLINE_STRAIGHT"].ToString();
  1484. //探伤判废支数
  1485. this.rollingCard1.Value.TestingScrapNum = dt.Rows[0]["SCRAP_TESTING"].ToString();
  1486. //探伤合格支数
  1487. this.rollingCard1.Value.TestingQualifiedNum = dt.Rows[0]["QUALIFIED_TESTING"].ToString();
  1488. NativeMethodNew na = new NativeMethodNew(this.ob);
  1489. if (na.isBegineNode(heatno, 8) || na.isBegineNode(heatno, 9) || na.isBegineNode(heatno, 10))
  1490. {
  1491. //探伤下线支数
  1492. this.rollingCard1.Value.OfflineTesting = dt.Rows[0]["OFFLINE_TESTING"].ToString();
  1493. this.rollingCard1.Value.BacklineTesting = dt.Rows[0]["BACKLINE_TESTING"].ToString();
  1494. }
  1495. else
  1496. {
  1497. if (dt.Rows[0]["OFFLINE_TESTING"].ToString() == "0")
  1498. {
  1499. this.rollingCard1.Value.OfflineTesting = "";
  1500. this.rollingCard1.Value.BacklineTesting = "";
  1501. }
  1502. else
  1503. {
  1504. //探伤下线支数
  1505. this.rollingCard1.Value.OfflineTesting = dt.Rows[0]["OFFLINE_TESTING"].ToString();
  1506. this.rollingCard1.Value.BacklineTesting = dt.Rows[0]["BACKLINE_TESTING"].ToString();
  1507. }
  1508. }
  1509. //表检剔除支数
  1510. this.rollingCard1.Value.SurfaceScrapNum = dt.Rows[0]["WASTE_QUANTITY"].ToString();
  1511. //表检合格支数
  1512. this.rollingCard1.Value.SurfaceQualifiedNum = dt.Rows[0]["QUALIFIED_BRANCH"].ToString();
  1513. //表检下线支数
  1514. this.rollingCard1.Value.OfflineSurface = dt.Rows[0]["OFFLINE_QUANTITY"].ToString();
  1515. }
  1516. this.rollingCard1.UpdateData();
  1517. }
  1518. //else
  1519. //{
  1520. // this.rollingCard1.ClearData();
  1521. //}
  1522. }
  1523. public void clearRollCard()
  1524. {
  1525. //上料切前判废支数
  1526. this.rollingCard1.Value.FeedScrapNum = "0";
  1527. //上料切前合格支数
  1528. this.rollingCard1.Value.FeedQualifiedNum = "0";
  1529. //上料判废支数
  1530. this.rollingCard1.Value.FeedScrapDBNum = "0";
  1531. //上料合格支数
  1532. this.rollingCard1.Value.FeedQualifiedDBNum = "0";
  1533. //加热炉判废支数
  1534. this.rollingCard1.Value.FurScrapNum = "0";
  1535. //加热炉合格支数
  1536. this.rollingCard1.Value.FurQualifiedNum = "0";
  1537. //穿孔判废支数
  1538. this.rollingCard1.Value.PerScrapNum = "0";
  1539. //穿孔合格支数
  1540. this.rollingCard1.Value.PerQualifiedNum = "0";
  1541. //连轧判废支数
  1542. this.rollingCard1.Value.RollingScrapNum = "0";
  1543. //连轧合格支数
  1544. this.rollingCard1.Value.RollingQualifiedNum = "0";
  1545. //再加热炉判废支数
  1546. this.rollingCard1.Value.RefurScrapNum = "0";
  1547. //再加热炉合格支数
  1548. this.rollingCard1.Value.RefurQualifiedNum = "0";
  1549. //定径判废支数
  1550. this.rollingCard1.Value.SizingScrapNum = "0";
  1551. //定径合格支数
  1552. this.rollingCard1.Value.SizingQualifiedNum = "0";
  1553. //分切前判废支数
  1554. this.rollingCard1.Value.SawScrapNumBE = "0";
  1555. //分切前合格支数
  1556. this.rollingCard1.Value.SawQualifiedNumBE = "0";
  1557. //分切判废支数
  1558. this.rollingCard1.Value.SawScrapNum = "0";
  1559. //分切合格支数
  1560. this.rollingCard1.Value.SawQualifiedNum = "0";
  1561. //矫直判废支数
  1562. this.rollingCard1.Value.StraightScrapNum = "0";
  1563. //矫直合格支数
  1564. this.rollingCard1.Value.StraightQualifiedNum = "0";
  1565. //矫直下线支数
  1566. this.rollingCard1.Value.OfflineStraight = "0";
  1567. //矫直返线支数
  1568. this.rollingCard1.Value.BacklineStraight = "0";
  1569. //探伤判废支数
  1570. this.rollingCard1.Value.TestingScrapNum = "0";
  1571. //探伤合格支数
  1572. this.rollingCard1.Value.TestingQualifiedNum = "0";
  1573. //探伤下线支数
  1574. this.rollingCard1.Value.OfflineTesting = "0";
  1575. this.rollingCard1.Value.BacklineTesting = "0";
  1576. //表检剔除支数
  1577. this.rollingCard1.Value.SurfaceScrapNum = "0";
  1578. //表检合格支数
  1579. this.rollingCard1.Value.SurfaceQualifiedNum = "0";
  1580. //表检下线支数
  1581. this.rollingCard1.Value.OfflineSurface = "0";
  1582. this.rollingCard1.UpdateData();
  1583. }
  1584. /// <summary>
  1585. /// 轧制信息Grid赋值
  1586. /// </summary>
  1587. /// <param name="dt">轧制计划信息datatable</param>
  1588. public void GridEdit(DataTable dt)
  1589. {
  1590. if (dt.Rows.Count > 0)
  1591. {
  1592. DataRow row1 = dt.Rows[0];
  1593. //熔炼炉号
  1594. this.rollingInfomation1.Value.StoveNo = row1["stove_no"].ToString();
  1595. //炉号
  1596. this.rollingInfomation1.Value.JudgeStoveNo = BaseMethod.getJudgeStoveNo(row1["judge_stove_no"].ToString());
  1597. //生产批号
  1598. this.rollingInfomation1.Value.LotNo = row1["lot_no"].ToString();
  1599. //工序合同号
  1600. this.rollingInfomation1.Value.ContractNo = row1["contract_no"].ToString();
  1601. //执行工艺号
  1602. this.rollingInfomation1.Value.ImpProcess = row1["imp_process"].ToString();
  1603. //执行工艺号路径
  1604. this.rollingInfomation1.Value.ImpProcessPath = row1["imp_process_path"].ToString();
  1605. //产线代码
  1606. this.rollingInfomation1.Value.PlineCode = row1["pline_code"].ToString();
  1607. //状态
  1608. this.rollingInfomation1.Value.Status = row1["STATUS"].ToString();
  1609. //监制
  1610. this.rollingInfomation1.Value.Producer = row1["producer"].ToString();
  1611. //工艺状态
  1612. this.rollingInfomation1.Value.ProcessStatus = row1["process_status"].ToString();
  1613. //单倍长
  1614. this.rollingInfomation1.Value.DbLength = row1["db_length"].ToString();
  1615. //单倍重
  1616. this.rollingInfomation1.Value.DbHeight = row1["db_height"].ToString();
  1617. //轧制长度
  1618. this.rollingInfomation1.Value.RollLength = row1["roll_length"].ToString();
  1619. //分切数
  1620. this.rollingInfomation1.Value.SawNum = row1["saw_num"].ToString();
  1621. //目标长度
  1622. this.rollingInfomation1.Value.TargetLength = row1["target_length"].ToString();
  1623. //最终用户
  1624. this.rollingInfomation1.Value.FinishUser = row1["finish_user"].ToString();
  1625. //目标库
  1626. this.rollingInfomation1.Value.TargetLiabrary = row1["target_liabrary"].ToString();
  1627. //品种
  1628. this.rollingInfomation1.Value.Varieties = row1["varieties"].ToString();
  1629. //成品规格
  1630. this.rollingInfomation1.Value.PipeSize = row1["pipe_size"].ToString();
  1631. //扣型
  1632. this.rollingInfomation1.Value.BuckleType = row1["buckle_type"].ToString();
  1633. //长度范围
  1634. this.rollingInfomation1.Value.LengthRange = row1["length_range"].ToString();
  1635. //轧管判定标准
  1636. this.rollingInfomation1.Value.RollStandrad = row1["roll_standrad"].ToString();
  1637. //断面
  1638. this.rollingInfomation1.Value.PipeSection = row1["pipe_section"].ToString();
  1639. //钢种代码
  1640. this.rollingInfomation1.Value.SteelCode = row1["steelcode"].ToString();
  1641. //钢种名称
  1642. this.rollingInfomation1.Value.SteelName = row1["steelname"].ToString();
  1643. //钢级代码
  1644. this.rollingInfomation1.Value.GradeCode = row1["gradecode"].ToString();
  1645. //钢级名称
  1646. this.rollingInfomation1.Value.GradeName = row1["gradename"].ToString();
  1647. //炼钢判定标准
  1648. this.rollingInfomation1.Value.SteelStandrad = row1["steel_standrad"].ToString();
  1649. //去向
  1650. this.rollingInfomation1.Value.Target = row1["target"].ToString();
  1651. //支
  1652. this.rollingInfomation1.Value.PlanNum = row1["BRANCH"].ToString();
  1653. //吨
  1654. this.rollingInfomation1.Value.PlanTon = row1["TON"].ToString();
  1655. //切损去向
  1656. this.rollingInfomation1.Value.CutTarget = row1["cut_target"].ToString();
  1657. //切损长度
  1658. this.rollingInfomation1.Value.CutLength = row1["cut_length"].ToString();
  1659. //切损重量
  1660. this.rollingInfomation1.Value.CutHeight = row1["CUT_WEIGHT"].ToString();
  1661. //倍尺数
  1662. this.rollingInfomation1.Value.DbNum = row1["DB_NUM"].ToString();
  1663. //标准类别代码
  1664. this.rollingInfomation1.Value.StdStyle = row1["STD_STYLE"].ToString();
  1665. //标准类别描述
  1666. this.rollingInfomation1.Value.StdStyleDesc = row1["STD_STYLE_DESC"].ToString();
  1667. //成品备注
  1668. this.rollingInfomation1.Value.ReMark = row1["ReMark"].ToString();
  1669. this.rollingInfomation1.UpdateData();
  1670. }
  1671. }
  1672. /// <summary>
  1673. /// 查询探伤跟踪
  1674. /// </summary>
  1675. /// <param name="str">判定炉号JUDGE_STOVE_NO</param>
  1676. public void GetMILTestingRack(string str)
  1677. {
  1678. this.dtTestRack1.Clear();
  1679. this.dtTestRack2.Clear();
  1680. this.dtTestRack3.Clear();
  1681. string flagstatus = "0";
  1682. if (this.ActiveStatus.Equals("已完成探伤"))
  1683. {
  1684. flagstatus = "1";
  1685. }
  1686. if (PlineCode.Equals("C010"))
  1687. {
  1688. ultraTestRack1.DisplayLayout.Bands[0].Columns["RECUT_LENGTH"].Hidden = true;
  1689. ultraTestRack1.DisplayLayout.Bands[0].Columns["RECUT_FLAG"].Hidden = true;
  1690. }
  1691. DataTable dtTR = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.GetTestingRack", new Object[] { str, flagstatus, proPlanId, gxPlanNo }, this.ob);
  1692. GridHelper.CopyDataToDatatable(ref dtTR, ref dtTestRack1, true);
  1693. ChangeGridColor();
  1694. //if (dtTR.Rows.Count > 0)
  1695. //{
  1696. //Infragistics.Win.ValueList valulist = new Infragistics.Win.ValueList();//复探原因
  1697. //valulist.ValueListItems.Add("LOD");
  1698. //valulist.ValueListItems.Add("LID");
  1699. //valulist.ValueListItems.Add("TOD");
  1700. //valulist.ValueListItems.Add("TID");
  1701. //Infragistics.Win.ValueList valulistre = new Infragistics.Win.ValueList();//剔除原因
  1702. //valulistre.ValueListItems.Add("内折");
  1703. //valulistre.ValueListItems.Add("内结疤");
  1704. //valulistre.ValueListItems.Add("内划伤");
  1705. //valulistre.ValueListItems.Add("拉凹");
  1706. //valulistre.ValueListItems.Add("内棱");
  1707. //valulistre.ValueListItems.Add("内壁伤");
  1708. //valulistre.ValueListItems.Add("内鼓包");
  1709. //valulistre.ValueListItems.Add("外折");
  1710. //valulistre.ValueListItems.Add("外结疤");
  1711. //valulistre.ValueListItems.Add("外划伤");
  1712. //valulistre.ValueListItems.Add("裂纹");
  1713. //valulistre.ValueListItems.Add("靑线");
  1714. //valulistre.ValueListItems.Add("轧折");
  1715. //valulistre.ValueListItems.Add("孔洞");
  1716. //if (Colno.Equals("1"))
  1717. //{
  1718. // //this.ultraTabControl2.Tabs[0].Visible = true;
  1719. // //this.ultraTabControl2.Tabs[1].Visible = false;
  1720. // //this.ultraTabControl2.Tabs[2].Visible = false;
  1721. // GridHelper.CopyDataToDatatable(ref dtTR, ref dtTestRack1, true);
  1722. // //ultraTestRack1.DisplayLayout.Bands[0].PerformAutoResizeColumns(true, PerformAutoSizeType.AllRowsInBand);
  1723. // foreach (UltraGridRow ugr in ultraTestRack1.Rows)
  1724. // {
  1725. // ugr.Cells["SCRAP_SLAB"].Value = "判废";
  1726. // //ugr.Cells["SCRAP_REASON"].ValueList = valulistre;
  1727. // ugr.Cells["ReInspection"].Value = "复探";
  1728. // ugr.Cells["ReInspectionBACK"].Value = "复探回退";
  1729. // ugr.Cells["DELBACK"].Value = "判废回退";
  1730. // ugr.Cells["ChangShift"].Value = "交班操作";
  1731. // //ugr.Cells["ALARM_REASON"].ValueList = valulist;
  1732. // ugr.Cells["ChangShift"].Value = "交班操作";
  1733. // ugr.Cells["BTNCHANGECOM"].Value = "接班操作";
  1734. // if (ugr.Cells["SUSPECT_FLAG"].Value.Equals("正常轧制"))
  1735. // {
  1736. // ugr.Cells["SUSPECT"].Value = "可疑";
  1737. // }
  1738. // if (ugr.Cells["SUSPECT_FLAG"].Value.Equals("可疑"))
  1739. // {
  1740. // ugr.Cells["SUSPECT"].Value = "可疑回退";
  1741. // }
  1742. // if (ugr.Cells["RECUT_FLAG"].Value.Equals("再切"))
  1743. // {
  1744. // ugr.Cells["RECUT"].Value = "再切回退";
  1745. // }
  1746. // if (ugr.Cells["RECUT_FLAG"].Value.Equals("不再切"))
  1747. // {
  1748. // ugr.Cells["RECUT"].Value = "子管再切";
  1749. // }
  1750. // if (ugr.Cells["PLINE_CODE"].Value.ToString() == "C008")
  1751. // {
  1752. // ugr.Cells["PLINE_CODE"].Value = "250机组";
  1753. // }
  1754. // if (ugr.Cells["PLINE_CODE"].Value.ToString() == "C009")
  1755. // {
  1756. // ugr.Cells["PLINE_CODE"].Value = "258机组";
  1757. // }
  1758. // if (ugr.Cells["PLINE_CODE"].Value.ToString() == "C010")
  1759. // {
  1760. // ugr.Cells["PLINE_CODE"].Value = "168机组";
  1761. // }
  1762. // if (ugr.Cells["PLINE_CODE"].Value.ToString() == "C012")
  1763. // {
  1764. // ugr.Cells["PLINE_CODE"].Value = "ASSEL机组";
  1765. // }
  1766. // if (ugr.Cells["PLINE_CODE"].Value.ToString() == "C017")
  1767. // {
  1768. // ugr.Cells["PLINE_CODE"].Value = "460机组";
  1769. // }
  1770. // }
  1771. //}
  1772. //}
  1773. }
  1774. /// <summary>
  1775. /// 更新探伤实绩卡
  1776. /// </summary>
  1777. /// <param name="str">判定炉号JUDGE_STOVE_NO</param>
  1778. public void GetMILETResult(string str)
  1779. {
  1780. DataTable dsDetail = new DataTable();
  1781. //if (TestMethod.Contains("涡流"))//涡流ET
  1782. if (PlineCode.Equals("C010"))
  1783. {
  1784. offlinenode = "11";
  1785. ultraTabControl1.Tabs[0].Visible = true;
  1786. ultraTabControl1.Tabs[1].Visible = false;
  1787. ultraTabControl1.Tabs[2].Visible = false;
  1788. DataTable dtETR = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.GetETResult", new object[] { str, proPlanId, gxPlanNo }, this.ob);
  1789. if (dtETR.Rows.Count > 0)
  1790. {
  1791. //查询实绩子表数据
  1792. dsDetail = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.getMtDetail", new object[] { str, this.UserInfo.GetUserOrder(), this.UserInfo.GetUserGroup(), proPlanId, gxPlanNo }, ob);
  1793. milet.Clear();
  1794. //探伤卡赋值
  1795. milet = NativeMethod.GetTableToEntity(dtETR, milet);
  1796. this.crackDetectionResult1.Value = milet;
  1797. crackDetectionResult1.ColOrder = this.UserInfo.GetUserOrder();
  1798. crackDetectionResult1.ColGroup = this.UserInfo.GetUserGroup();
  1799. crackDetectionResult1.PlineCode = PlineCode;
  1800. //crackDetectionResult1.ColNo = Colno;
  1801. crackDetectionResult1.ResultNo = this.ultraGridPlan.ActiveRow.Cells["ID"].Value.ToString();
  1802. if (dsDetail.Rows.Count > 0)
  1803. {
  1804. milmtDetai.Clear();
  1805. milmtDetai = NativeMethod.GetTableToEntity(dsDetail, milmtDetai);
  1806. crackDetectionResult1.Value1 = milmtDetai;
  1807. }
  1808. else
  1809. {
  1810. milmtDetai.Clear();
  1811. crackDetectionResult1.Value1 = milmtDetai;
  1812. }
  1813. if (this.ultraGridPlan.ActiveRow.Cells["NODE_STATUS"].Text == "探伤完成" || this.ultraGridPlan.ActiveRow.Cells["NODE_STATUS"].Text == "人工质检完成" || this.ultraGridPlan.ActiveRow.Cells["NODE_STATUS"].Text == "交库完成")
  1814. {
  1815. this.crackDetectionResult1.Using1();
  1816. this.crackDetectionResult1.Using2();
  1817. this.crackDetectionResult1.Using3();
  1818. }
  1819. else
  1820. {
  1821. milmtDetai.Clear();
  1822. if (Colno.Equals("1"))
  1823. {
  1824. this.crackDetectionResult1.Using1();
  1825. this.crackDetectionResult1.Using4();
  1826. }
  1827. if (Colno.Equals("2"))
  1828. {
  1829. this.crackDetectionResult1.Using2();
  1830. this.crackDetectionResult1.Using5();
  1831. }
  1832. if (Colno.Equals("3"))
  1833. {
  1834. this.crackDetectionResult1.Using3();
  1835. this.crackDetectionResult1.Using6();
  1836. }
  1837. }
  1838. }
  1839. else
  1840. {
  1841. milet.Clear();
  1842. milmtDetai.Clear();
  1843. this.crackDetectionResult1.Value = milet;
  1844. crackDetectionResult1.Value1 = milmtDetai;
  1845. this.crackDetectionResult1.Using1();
  1846. this.crackDetectionResult1.Using2();
  1847. this.crackDetectionResult1.Using3();
  1848. }
  1849. }
  1850. //if (TestMethod.Contains("漏磁"))//磁粉MT
  1851. if (PlineCode.Equals("C009") || PlineCode.Equals("C008") || PlineCode.Equals("C017") || PlineCode.Equals("C072"))
  1852. {
  1853. offlinenode = "12";
  1854. ultraTabControl1.Tabs[0].Visible = false;
  1855. ultraTabControl1.Tabs[1].Visible = true;
  1856. ultraTabControl1.Tabs[2].Visible = false;
  1857. DataTable dtMTR = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.GetMTResult", new object[] { str, proPlanId, gxPlanNo }, this.ob);
  1858. if (dtMTR.Rows.Count > 0)
  1859. {
  1860. //查询实绩子表数据
  1861. dsDetail = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.getMtDetail", new object[] { str, this.UserInfo.GetUserOrder(), this.UserInfo.GetUserGroup(), proPlanId, gxPlanNo }, ob);
  1862. milmt.Clear();
  1863. milmt = NativeMethod.GetTableToEntity(dtMTR, milmt);
  1864. mtTestingResult1.Value = milmt;
  1865. mtTestingResult1.ColOrder = this.UserInfo.GetUserOrder();
  1866. mtTestingResult1.ColGroup = this.UserInfo.GetUserGroup();
  1867. mtTestingResult1.PlineCode = PlineCode;
  1868. mtTestingResult1.ColNo = Colno;
  1869. mtTestingResult1.ResultNo = this.ultraGridPlan.ActiveRow.Cells["ID"].Value.ToString();
  1870. if (dsDetail.Rows.Count > 0)
  1871. {
  1872. milmtDetai.Clear();
  1873. milmtDetai = NativeMethod.GetTableToEntity(dsDetail, milmtDetai);
  1874. mtTestingResult1.Value1 = milmtDetai;
  1875. }
  1876. else
  1877. {
  1878. milmtDetai.Clear();
  1879. mtTestingResult1.Value1 = milmtDetai;
  1880. }
  1881. if (this.ultraGridPlan.ActiveRow.Cells["NODE_STATUS"].Text == "探伤完成" || this.ultraGridPlan.ActiveRow.Cells["NODE_STATUS"].Text == "人工质检完成" || this.ultraGridPlan.ActiveRow.Cells["NODE_STATUS"].Text == "交库完成")
  1882. {
  1883. this.mtTestingResult1.Using1();
  1884. this.mtTestingResult1.Using2();
  1885. }
  1886. else
  1887. {
  1888. milmtDetai.Clear();
  1889. if (Colno.Equals("1"))
  1890. {
  1891. this.mtTestingResult1.Using1();
  1892. this.mtTestingResult1.Using4();
  1893. }
  1894. if (Colno.Equals("2"))
  1895. {
  1896. this.mtTestingResult1.Using2();
  1897. this.mtTestingResult1.Using3();
  1898. }
  1899. }
  1900. }
  1901. else
  1902. {
  1903. milmt.Clear();
  1904. milmtDetai.Clear();
  1905. mtTestingResult1.Value = milmt;
  1906. mtTestingResult1.Value1 = milmtDetai;
  1907. this.mtTestingResult1.Using1();
  1908. this.mtTestingResult1.Using2();
  1909. }
  1910. }
  1911. //if (TestMethod.Contains("超声波"))//超声波UT
  1912. if (PlineCode.Equals("C012"))
  1913. {
  1914. offlinenode = "13";
  1915. ultraTabControl1.Tabs[0].Visible = false;
  1916. ultraTabControl1.Tabs[1].Visible = false;
  1917. ultraTabControl1.Tabs[2].Visible = true;
  1918. DataTable dtUTR = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.GetUTResult", new object[] { str, proPlanId, gxPlanNo }, this.ob);
  1919. if (dtUTR.Rows.Count > 0)
  1920. {
  1921. milul.Clear();
  1922. milul = NativeMethod.GetTableToEntity(dtUTR, milul);
  1923. ulTestingResult1.Value = milul;
  1924. if (Colno.Equals("1"))
  1925. {
  1926. this.ulTestingResult1.Using1();
  1927. }
  1928. if (Colno.Equals("2"))
  1929. {
  1930. this.ulTestingResult1.Using2();
  1931. }
  1932. }
  1933. else
  1934. {
  1935. milul.Clear();
  1936. ulTestingResult1.Value = milul;
  1937. }
  1938. }
  1939. string plincode = this.PlineCode;
  1940. string ColGroup = this.UserInfo.GetUserGroup();
  1941. string ColUser = this.UserInfo.GetUserName();
  1942. string ColShift = this.UserInfo.GetUserOrder();
  1943. MilTestingResultDetailEntity detail = new MilTestingResultDetailEntity();
  1944. DataTable dttetail = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.GetResultDetail", new object[] { str, plincode, ColGroup, ColUser, ColShift, proPlanId, gxPlanNo }, this.ob);
  1945. if (dttetail.Rows.Count > 0)
  1946. {
  1947. detail = NativeMethod.GetTableToEntity(dttetail, detail);
  1948. }
  1949. //if (!PlineCode.Equals("C010"))
  1950. //{
  1951. //this.testingResultDetailComm1.Detail = detail;
  1952. //this.testingResultDetailComm21.Detail = detail;
  1953. //}
  1954. //else
  1955. //{
  1956. //this.testingResultDetailComm1.Detail = detail;
  1957. //this.testingResultDetailComm21.Detail = detail;
  1958. ////this.testingResultDetail1681.Detail = detail;
  1959. ////this.testingResultDetail16821.Detail = detail;
  1960. //this.testingResultDetail16831.Detail = detail;
  1961. //}
  1962. NativeMethodNew na = new NativeMethodNew(this.ob);
  1963. List<MilTestingResultDetailDesEntity> Listdes11 = new List<MilTestingResultDetailDesEntity>();
  1964. List<MilTestingResultDetailDesEntity> Listdes21 = new List<MilTestingResultDetailDesEntity>();
  1965. List<MilTestingResultDetailDesEntity> Listdes12 = new List<MilTestingResultDetailDesEntity>();
  1966. List<MilTestingResultDetailDesEntity> Listdes22 = new List<MilTestingResultDetailDesEntity>();
  1967. List<MilTestingResultDetailDesEntity> Listdes13 = new List<MilTestingResultDetailDesEntity>();
  1968. List<MilTestingResultDetailDesEntity> Listdes23 = new List<MilTestingResultDetailDesEntity>();
  1969. DataTable dtdes = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.GetResultDetaildes", new object[] { str, plincode, ColGroup, ColShift, proPlanId, gxPlanNo }, this.ob);
  1970. if (dtdes.Rows.Count > 0)
  1971. {
  1972. foreach (DataRow dr in dtdes.Rows)
  1973. {
  1974. if (dr["REASON_FLAG"].ToString().Equals("可疑"))
  1975. {
  1976. if (dr["COL_NO"].ToString().Equals("1"))
  1977. {
  1978. MilTestingResultDetailDesEntity des = new MilTestingResultDetailDesEntity();
  1979. des = NativeMethod.GetTableRowToEntity(dr, dtdes, des);
  1980. Listdes11.Add(des);
  1981. }
  1982. if (dr["COL_NO"].ToString().Equals("2"))
  1983. {
  1984. MilTestingResultDetailDesEntity des = new MilTestingResultDetailDesEntity();
  1985. des = NativeMethod.GetTableRowToEntity(dr, dtdes, des);
  1986. Listdes12.Add(des);
  1987. }
  1988. if (dr["COL_NO"].ToString().Equals("3"))
  1989. {
  1990. MilTestingResultDetailDesEntity des = new MilTestingResultDetailDesEntity();
  1991. des = NativeMethod.GetTableRowToEntity(dr, dtdes, des);
  1992. Listdes13.Add(des);
  1993. }
  1994. }
  1995. if (dr["REASON_FLAG"].ToString().Equals("剔除"))
  1996. {
  1997. if (dr["COL_NO"].ToString().Equals("1"))
  1998. {
  1999. MilTestingResultDetailDesEntity des = new MilTestingResultDetailDesEntity();
  2000. des = NativeMethod.GetTableRowToEntity(dr, dtdes, des);
  2001. Listdes21.Add(des);
  2002. }
  2003. if (dr["COL_NO"].ToString().Equals("2"))
  2004. {
  2005. MilTestingResultDetailDesEntity des = new MilTestingResultDetailDesEntity();
  2006. des = NativeMethod.GetTableRowToEntity(dr, dtdes, des);
  2007. Listdes22.Add(des);
  2008. }
  2009. if (dr["COL_NO"].ToString().Equals("3"))
  2010. {
  2011. MilTestingResultDetailDesEntity des = new MilTestingResultDetailDesEntity();
  2012. des = NativeMethod.GetTableRowToEntity(dr, dtdes, des);
  2013. Listdes23.Add(des);
  2014. }
  2015. }
  2016. }
  2017. }
  2018. if (!PlineCode.Equals("C010"))
  2019. {
  2020. //this.testingResultDetailComm1.Listdes1 = Listdes11;
  2021. //this.testingResultDetailComm1.Listdes2 = Listdes21;
  2022. //this.testingResultDetailComm21.Listdes1 = Listdes12;
  2023. //this.testingResultDetailComm21.Listdes2 = Listdes22;
  2024. }
  2025. else
  2026. {
  2027. //this.testingResultDetail1681.Listdes1 = Listdes11;
  2028. //this.testingResultDetail1681.Listdes2 = Listdes21;
  2029. //this.testingResultDetail16821.Listdes1 = Listdes12;
  2030. //this.testingResultDetail16821.Listdes2 = Listdes22;
  2031. //this.testingResultDetail16831.Listdes1 = Listdes13;
  2032. //this.testingResultDetail16831.Listdes1 = Listdes23;
  2033. }
  2034. }
  2035. /// <summary>
  2036. /// 查询按钮
  2037. /// </summary>
  2038. public void PlanQuery()
  2039. {
  2040. string PrimaKey = "";
  2041. string SencodKey = "";
  2042. UltraGridRow ugr = this.ultraGridPlan.ActiveRow;
  2043. if (ugr != null)
  2044. {
  2045. PrimaKey = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
  2046. }
  2047. if (chkHeatNo.Checked == true)
  2048. {
  2049. if (string.IsNullOrEmpty(this.txtJudgeStoveNo.Text))
  2050. {
  2051. MessageBox.Show("请输入判定炉号后再执行查询操作!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  2052. return;
  2053. }
  2054. QueryMainPlan.JudgeStoveNo = this.txtJudgeStoveNo.Text;
  2055. }
  2056. else
  2057. {
  2058. QueryMainPlan.JudgeStoveNo = "";
  2059. }
  2060. if (chkLotNo.Checked == true)
  2061. {
  2062. if (string.IsNullOrEmpty(this.txtLOT_NO.Text))
  2063. {
  2064. MessageBox.Show("请输入生产批号后再执行查询操作!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  2065. return;
  2066. }
  2067. QueryMainPlan.LotNo = this.txtLOT_NO.Text;
  2068. }
  2069. else
  2070. {
  2071. QueryMainPlan.LotNo = "";
  2072. }
  2073. dtTestRack1.Clear();
  2074. QueryMainPlan.PlineCode = PlineCode;
  2075. dtPlan.Clear();
  2076. QueryMainPlan.PlineCode = PlineCode;
  2077. QueryMainPlan.Status = PlanStatusQuery;
  2078. QueryMainPlan.StartStatus = PlanStartStatusQuery;
  2079. QueryMainPlan.ProPlanId = proPlanId;
  2080. QueryMainPlan.GxPlanNo = gxPlanNo;
  2081. DataTable dt = new DataTable();
  2082. if (PlineCode.Equals("C009") || PlineCode.Equals("C008") || PlineCode.Equals("C017") || PlineCode.Equals("C072"))
  2083. {
  2084. dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getSingleMainPlan", new object[] { QueryMainPlan, 11 }, this.ob);
  2085. }
  2086. else if (PlineCode.Equals("C010"))
  2087. {
  2088. dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getSingleMainPlan", new object[] { QueryMainPlan, 9 }, this.ob);
  2089. }
  2090. else
  2091. {
  2092. dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getSingleMainPlan", new object[] { QueryMainPlan, 12 }, this.ob);
  2093. }
  2094. //if (TestMethod.Contains("涡流"))
  2095. //{
  2096. // dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getSingleMainPlan", new object[] { QueryMainPlan, 9 }, this.ob);
  2097. //}
  2098. //if (TestMethod.Contains("漏磁"))
  2099. //{
  2100. // dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getSingleMainPlan", new object[] { QueryMainPlan, 11 }, this.ob);
  2101. //}
  2102. //if (TestMethod.Contains("超声波"))
  2103. //{
  2104. // dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getSingleMainPlan", new object[] { QueryMainPlan, 12 }, this.ob);
  2105. //}
  2106. //查询主表记录
  2107. if (dt.Rows.Count == 0)
  2108. {
  2109. MessageBox.Show("未查询到匹配的数据,请重新查询!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  2110. return;
  2111. }
  2112. else
  2113. {
  2114. GridHelper.CopyDataToDatatable(ref dt, ref dtPlan, true);
  2115. //ultraGridPlan.DisplayLayout.Bands[0].PerformAutoResizeColumns(true, PerformAutoSizeType.AllRowsInBand);
  2116. ChangeGridColor();
  2117. ChangeCellName();
  2118. if (ugr != null)
  2119. {
  2120. foreach (UltraGridRow ugr1 in ultraGridPlan.Rows)
  2121. {
  2122. if (ugr1.Cells["JUDGE_STOVE_NO"].Value.ToString() == PrimaKey)
  2123. {
  2124. ugr1.Activated = true;
  2125. }
  2126. }
  2127. }
  2128. }
  2129. }
  2130. /// <summary>
  2131. /// 单击计划行
  2132. /// </summary>
  2133. /// <param name="sender"></param>
  2134. /// <param name="e"></param>
  2135. private void ultraGridPlan_AfterRowActivate(object sender, EventArgs e)
  2136. {
  2137. //if(this.crackDetectionResult1.UltraGrid3.ce)
  2138. //if (PlineCode.Equals("C010"))
  2139. //{
  2140. // crackDetectionResult1.initGrade();
  2141. // crackDetectionResult1.initGrade1();
  2142. //}
  2143. //else
  2144. //{
  2145. // mtTestingResult1.initGrade();
  2146. // mtTestingResult1.initGrade1();
  2147. //}
  2148. if (this.dtPlan.Rows.Count > 0)
  2149. {
  2150. //this.ultraExpandableGroupBox2.Expanded = true;
  2151. UltraGridRow ugr = ultraGridPlan.ActiveRow;
  2152. //UltraGridRow ugr = e.Row;
  2153. if (ugr != null)
  2154. {
  2155. // this.feedSaw1.DataClear();
  2156. //查询主计划信息
  2157. string HeatNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
  2158. proPlanId = ugr.Cells["PRO_PLAN_ID"].Value.ToString();
  2159. gxPlanNo = ugr.Cells["GX_PLAN_NO"].Value.ToString();
  2160. lotNo = ugr.Cells["LOT_NO"].Value.ToString();
  2161. ActiveJUDGE_STOVE_NO = HeatNo;
  2162. MainPlan.JudgeStoveNo = HeatNo;
  2163. MainPlan.ProPlanId = proPlanId;
  2164. MainPlan.GxPlanNo = gxPlanNo;
  2165. DataTable dtMP = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getSingleMainPlanForHeatNo", new object[] { MainPlan }, this.ob);
  2166. string Status = ugr.Cells["IS_START"].Value.ToString();
  2167. ActiveStatus = Status;
  2168. if (dtMP.Rows.Count > 0)
  2169. {
  2170. ActiveOFFLINE_FLAG = dtMP.Rows[0]["OFFLINE_FLAG"].ToString();
  2171. this.stoveno = dtMP.Rows[0]["STOVE_NO"].ToString();
  2172. this.lotno = dtMP.Rows[0]["LOT_NO"].ToString();
  2173. this.ActiveResultNo = dtMP.Rows[0]["ID"].ToString();
  2174. GridEdit(dtMP); //轧制计划信息卡赋值
  2175. string JudgeStoveNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
  2176. //探伤实绩卡赋值
  2177. GetMILETResult(HeatNo);
  2178. specName = dtMP.Rows[0]["PIPE_SIZE"].ToString();
  2179. length = dtMP.Rows[0]["TARGET_LENGTH"].ToString();
  2180. }
  2181. if (Status != "未开始探伤")
  2182. {
  2183. //查询探伤跟踪
  2184. GetMILTestingRack(HeatNo);
  2185. if (Status == "已完成探伤")
  2186. {
  2187. mtTestingResult1.Using5();
  2188. crackDetectionResult1.Using7();
  2189. }
  2190. else
  2191. {
  2192. mtTestingResult1.Using6();
  2193. crackDetectionResult1.Using8();
  2194. if (PlineCode.Equals("C009") || PlineCode.Equals("C008") || PlineCode.Equals("C017") || PlineCode.Equals("C072"))
  2195. {
  2196. if (mtTestingResult1.UltraGrid3.ActiveRow != null)
  2197. {
  2198. if (mtTestingResult1.UltraGrid3.ActiveRow.Cells["colNo"].Value.ToString2() == "1")
  2199. {
  2200. mtTestingResult1.Using1();
  2201. mtTestingResult1.Using4();
  2202. }
  2203. else if (mtTestingResult1.UltraGrid3.ActiveRow.Cells["colNo"].Value.ToString2() == "2")
  2204. {
  2205. mtTestingResult1.Using2();
  2206. mtTestingResult1.Using3();
  2207. }
  2208. else
  2209. {
  2210. mtTestingResult1.Using1();
  2211. mtTestingResult1.Using2();
  2212. }
  2213. }
  2214. }
  2215. else if (PlineCode.Equals("C010"))
  2216. {
  2217. if (this.crackDetectionResult1.UltraGrid3.ActiveRow != null)
  2218. {
  2219. if (this.crackDetectionResult1.UltraGrid3.ActiveRow.Cells["colNo"].Value.ToString2() == "1")
  2220. {
  2221. crackDetectionResult1.Using1();
  2222. crackDetectionResult1.Using4();
  2223. }
  2224. else if (this.crackDetectionResult1.UltraGrid3.ActiveRow.Cells["colNo"].Value.ToString2() == "2")
  2225. {
  2226. crackDetectionResult1.Using2();
  2227. crackDetectionResult1.Using5();
  2228. }
  2229. else if (this.crackDetectionResult1.UltraGrid3.ActiveRow.Cells["colNo"].Value.ToString2() == "3")
  2230. {
  2231. crackDetectionResult1.Using3();
  2232. crackDetectionResult1.Using6();
  2233. }
  2234. else
  2235. {
  2236. crackDetectionResult1.Using1();
  2237. crackDetectionResult1.Using2();
  2238. crackDetectionResult1.Using3();
  2239. }
  2240. }
  2241. }
  2242. }
  2243. }
  2244. else
  2245. {
  2246. this.dtTestRack1.Rows.Clear();
  2247. this.dtTestRack2.Rows.Clear();
  2248. this.dtTestRack3.Rows.Clear();
  2249. mtTestingResult1.Using5();
  2250. crackDetectionResult1.Using7();
  2251. }
  2252. // GetFeedRack();
  2253. // GetGridButtonName();
  2254. ChangeGridColor();
  2255. GetRollingCard();
  2256. }
  2257. }
  2258. crackDetectionResult1.UltraGrid3.UpdateData();
  2259. }
  2260. /// <summary>
  2261. /// 双击上料事件
  2262. /// </summary>
  2263. /// <param name="sender"></param>
  2264. /// <param name="e"></param>
  2265. //private void ultraGridPlan_DoubleClickRow(object sender, DoubleClickRowEventArgs e)
  2266. private void DoStart()
  2267. {
  2268. //if (this.PlineCode.Equals("C009"))
  2269. //{
  2270. // if (this.TestMethod.Contains("2"))
  2271. // {
  2272. // MessageBox.Show("您的操作台不允许进行探伤开始操作。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  2273. // return;
  2274. // }
  2275. //}
  2276. if (ultraGridPlan.Rows.Count > 0)
  2277. {
  2278. // IsStart();//判断是否还有其他炉次正在探伤
  2279. UltraGridRow ugr = ultraGridPlan.ActiveRow;
  2280. string JudgeStoveNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
  2281. InsertMainPlan.JudgeStoveNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
  2282. InsertMainPlan.ProPlanId = proPlanId;
  2283. InsertMainPlan.GxPlanNo = gxPlanNo;
  2284. string ResultNo = ugr.Cells["ID"].Value.ToString();
  2285. ActiveJUDGE_STOVE_NO = InsertMainPlan.JudgeStoveNo;
  2286. string Status = doQueryJugeNoStaus(ResultNo, JudgeStoveNo, PlineCode);
  2287. //string ResultNo = ugr.Cells["ID"].Value.ToString();
  2288. ActiveStatus = Status;
  2289. DataTable dtMP = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getSingleMainPlanForHeatNo", new object[] { InsertMainPlan }, this.ob);
  2290. ActiveOFFLINE_FLAG = dtMP.Rows[0]["OFFLINE_FLAG"].ToString();
  2291. GridEdit(dtMP); //轧制计划信息卡赋值
  2292. this.stoveno = dtMP.Rows[0]["STOVE_NO"].ToString();
  2293. this.lotno = dtMP.Rows[0]["LOT_NO"].ToString();
  2294. this.ActiveResultNo = dtMP.Rows[0]["ID"].ToString();
  2295. string ROLL_STANDRAD = dtMP.Rows[0]["ROLL_STANDRAD"].ToString();
  2296. if (Status == "0")
  2297. {
  2298. MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(InsertMainPlan.JudgeStoveNo.ToString()) + "】已开始探伤,不能再次开始探伤!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  2299. return;
  2300. }
  2301. if (Status == "1")
  2302. {
  2303. MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(InsertMainPlan.JudgeStoveNo.ToString()) + "】已完成探伤操作,不能再次开始探伤!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  2304. return;
  2305. }
  2306. //if (MessageUtil.ShowYesNoAndQuestion("确认炉号【" + InsertMainPlan.JudgeStoveNo + "】开始探伤?") == DialogResult.No)
  2307. //{
  2308. // return;
  2309. //}
  2310. //if (TestMethod.Contains("涡流"))
  2311. //{
  2312. if (PlineCode.Equals("C010"))
  2313. {
  2314. offlinenode = "11";
  2315. ultraTabControl1.Tabs[0].Visible = true;
  2316. ultraTabControl1.Tabs[1].Visible = false;
  2317. ultraTabControl1.Tabs[2].Visible = false;
  2318. if (tempmilet != null)
  2319. {
  2320. InsertMilet.ProductStandards = ROLL_STANDRAD;
  2321. InsertMilet.InspectionStandard = tempmilet.InspectionStandard;
  2322. //InsertMilet.TestingMethod = tempmilet.TestingMethod;
  2323. InsertMilet.CalibrationMethod = tempmilet.CalibrationMethod;
  2324. InsertMilet.ArtificialDefectShape = tempmilet.ArtificialDefectShape;
  2325. InsertMilet.Signid = tempmilet.Signid;
  2326. InsertMilet.Userid = tempmilet.Userid;
  2327. InsertMilet.ExcitationFrequency1 = tempmilet.ExcitationFrequency1;
  2328. InsertMilet.ExcitationFrequency2 = tempmilet.ExcitationFrequency2;
  2329. InsertMilet.ExcitationFrequency3 = tempmilet.ExcitationFrequency3;
  2330. InsertMilet.TestingSpeed1 = tempmilet.TestingSpeed1;
  2331. InsertMilet.TestingSpeed2 = tempmilet.TestingSpeed2;
  2332. InsertMilet.TestingSpeed3 = tempmilet.TestingSpeed3;
  2333. InsertMilet.AcceptanceGrade = tempmilet.AcceptanceGrade;
  2334. }
  2335. InsertMilet.ResultNo = ResultNo;
  2336. InsertMilet.JudgeStoveNo = dtMP.Rows[0]["JUDGE_STOVE_NO"].ToString();//判定炉号
  2337. InsertMilet.PlineCode = dtMP.Rows[0]["PLINE_CODE"].ToString();//厂线代码
  2338. InsertMilet.StoveNo = dtMP.Rows[0]["STOVE_NO"].ToString();//熔炼炉号
  2339. InsertMilet.LotNo = dtMP.Rows[0]["LOT_NO"].ToString();//生产批号
  2340. InsertMilet.Status = "85";
  2341. InsertMilet.StartTime = DateTime.Now.ToString();
  2342. InsertMilet.ColGroup = UserInfo.GetUserGroup();
  2343. InsertMilet.ColShift = UserInfo.GetUserOrder();
  2344. InsertMilet.ColUser = UserInfo.GetUserName();
  2345. InsertMilet.ColMode = "0";
  2346. InsertMilet.ProPlanId = proPlanId;
  2347. InsertMilet.GxPlanNo = gxPlanNo;
  2348. //添加实绩
  2349. int result = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.AddETResult", new object[] { InsertMilet }, this.ob);
  2350. }
  2351. //if (TestMethod.Contains("漏磁"))
  2352. //{
  2353. if (PlineCode.Equals("C009") || PlineCode.Equals("C008") || PlineCode.Equals("C017") || PlineCode.Equals("C072"))
  2354. {
  2355. offlinenode = "12";
  2356. milmt.Clear();
  2357. ultraTabControl1.Tabs[0].Visible = false;
  2358. ultraTabControl1.Tabs[1].Visible = true;
  2359. ultraTabControl1.Tabs[2].Visible = false;
  2360. if (tempmilmt != null)
  2361. {
  2362. //产品标准
  2363. milmt.ProductStandards = ROLL_STANDRAD;
  2364. //纵向外表面
  2365. milmt.LoSurface = tempmilmt.LoSurface;
  2366. //纵向内表面
  2367. milmt.LiSurface = tempmilmt.LiSurface;
  2368. //横向外表面
  2369. milmt.ToSurface = tempmilmt.ToSurface;
  2370. //横向内表面
  2371. milmt.TiSurface = tempmilmt.TiSurface;
  2372. //人工槽形状
  2373. milmt.GrooveShape = tempmilmt.GrooveShape;
  2374. //探伤标准
  2375. milmt.InspectionStandard = tempmilmt.InspectionStandard;
  2376. //1#纵向电流
  2377. milmt.LongitudinalCurrent1 = tempmilmt.LongitudinalCurrent1;
  2378. //1#横向电流
  2379. milmt.TransverseCurrent1 = tempmilmt.TransverseCurrent1;
  2380. //2#纵向电流
  2381. milmt.LongitudinalCurrent2 = tempmilmt.LongitudinalCurrent2;
  2382. //2#横向电流
  2383. milmt.TransverseCurrent2 = tempmilmt.TransverseCurrent2;
  2384. //1#转速
  2385. milmt.Speed1 = tempmilmt.Speed1;
  2386. //2#转速
  2387. milmt.Speed2 = tempmilmt.Speed2;
  2388. //1#检测速度
  2389. milmt.DetectionSpeed1 = tempmilmt.DetectionSpeed1;
  2390. //2#检测速度
  2391. milmt.DetectionSpeed2 = tempmilmt.DetectionSpeed2;
  2392. //签发人ID
  2393. milmt.Signid = tempmilmt.Signid;
  2394. //监制人
  2395. milmt.ExecutiveProducer = tempmilmt.ExecutiveProducer;
  2396. }
  2397. if (this.PlineCode.Equals("C009") || this.PlineCode.Equals("C008") || this.PlineCode.Equals("C017") || PlineCode.Equals("C072"))
  2398. {
  2399. milmt.GrooveShape = "N型槽";
  2400. ;
  2401. }
  2402. milmt.ResultNo = ResultNo;
  2403. milmt.JudgeStoveNo = dtMP.Rows[0]["JUDGE_STOVE_NO"].ToString();//判定炉号
  2404. milmt.PlineCode = dtMP.Rows[0]["PLINE_CODE"].ToString();//厂线代码
  2405. milmt.StoveNo = dtMP.Rows[0]["STOVE_NO"].ToString();//熔炼炉号
  2406. milmt.LotNo = dtMP.Rows[0]["LOT_NO"].ToString();//生产批号
  2407. milmt.Status = "85";
  2408. milmt.StartTime = DateTime.Now.ToString();
  2409. milmt.ColGroup = UserInfo.GetUserGroup();
  2410. milmt.ColShift = UserInfo.GetUserOrder();
  2411. milmt.ColUser = UserInfo.GetUserName();
  2412. milmt.ColMode = "0";
  2413. milmt.ProPlanId = proPlanId;
  2414. milmt.GxPlanNo = gxPlanNo;
  2415. //添加实绩
  2416. int count1 = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.AddMTResult", new object[] { milmt }, this.ob);
  2417. }
  2418. //if (TestMethod.Contains("超声波"))//UT
  2419. //{
  2420. if (PlineCode.Equals("C012"))
  2421. {
  2422. offlinenode = "13";
  2423. milul.Clear();
  2424. ultraTabControl1.Tabs[0].Visible = false;
  2425. ultraTabControl1.Tabs[1].Visible = false;
  2426. ultraTabControl1.Tabs[2].Visible = true;
  2427. if (tempmilut != null)
  2428. {
  2429. //签发人ID
  2430. milul.Signid = tempmilut.Signid;
  2431. //监制人
  2432. milul.ExecutiveProducer = tempmilut.ExecutiveProducer;
  2433. //产品标准
  2434. milul.ProductStandards = ROLL_STANDRAD;
  2435. //仪器型号
  2436. milul.InstrumentType = tempmilut.InstrumentType;
  2437. // 探头类型
  2438. milul.ProbeType = tempmilut.ProbeType;
  2439. //灵敏度
  2440. milul.Senstivity = tempmilut.Senstivity;
  2441. // 抑制
  2442. milul.Inhibition = tempmilut.Inhibition;
  2443. //耦合剂
  2444. milul.CouplingAgent = tempmilut.CouplingAgent;
  2445. //表面状况
  2446. milul.SurfaceAppearance = tempmilut.SurfaceAppearance;
  2447. //纵向外表面
  2448. milul.LoSurface = tempmilut.LoSurface;
  2449. //纵向内表面
  2450. milul.LiSurface = tempmilut.LiSurface;
  2451. //横向外表面
  2452. milul.ToSurface = tempmilut.ToSurface;
  2453. //横向内表面
  2454. milul.TiSurface = tempmilut.TiSurface;
  2455. }
  2456. milul.ResultNo = ResultNo;
  2457. milul.JudgeStoveNo = dtMP.Rows[0]["JUDGE_STOVE_NO"].ToString();//判定炉号
  2458. milul.ResultNo = ResultNo;
  2459. milul.PlineCode = dtMP.Rows[0]["PLINE_CODE"].ToString();//厂线代码
  2460. milul.StoveNo = dtMP.Rows[0]["STOVE_NO"].ToString();//熔炼炉号
  2461. milul.LotNo = dtMP.Rows[0]["LOT_NO"].ToString();//生产批号
  2462. milul.Status = "85";
  2463. milul.StartTime = DateTime.Now.ToString();
  2464. milul.ColGroup = UserInfo.GetUserGroup();
  2465. milul.ColShift = UserInfo.GetUserOrder();
  2466. milul.ColUser = UserInfo.GetUserName();
  2467. milul.ColMode = "0";
  2468. milul.ProPlanId = proPlanId;
  2469. milul.GxPlanNo = gxPlanNo;
  2470. //添加实绩
  2471. int count2 = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.AddUTResult", new object[] { milul }, this.ob);
  2472. }
  2473. //往跟踪记录表插入探伤开始时间
  2474. NativeMethodNew na = new NativeMethodNew(this.ob);
  2475. na.InsertSTAferDoubleClick(JudgeStoveNo, 8, "0", proPlanId, gxPlanNo);
  2476. // 初始化管号队列(取消分台)
  2477. 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);
  2478. //刷新主表
  2479. DataTable dt = new DataTable();
  2480. //if (TestMethod.Contains("涡流"))
  2481. if (PlineCode.Equals("C010"))
  2482. {
  2483. dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getSingleMainPlan", new object[] { QueryMainPlan, 9 }, this.ob);
  2484. }
  2485. //if (TestMethod.Contains("漏磁"))
  2486. if (PlineCode.Equals("C009") || PlineCode.Equals("C008") || PlineCode.Equals("C017") || PlineCode.Equals("C072"))
  2487. {
  2488. dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getSingleMainPlan", new object[] { QueryMainPlan, 11 }, this.ob);
  2489. }
  2490. //if (TestMethod.Contains("超声波"))
  2491. if (PlineCode.Equals("C012"))
  2492. {
  2493. dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getSingleMainPlan", new object[] { QueryMainPlan, 12 }, this.ob);
  2494. }
  2495. GridHelper.CopyDataToDatatable(ref dt, ref dtPlan, true);
  2496. //ultraGridPlan.DisplayLayout.Bands[0].PerformAutoResizeColumns(true, PerformAutoSizeType.AllRowsInBand);
  2497. ChangeCellName();
  2498. PlanQuery();
  2499. foreach (UltraGridRow ugr1 in this.ultraGridPlan.Rows)
  2500. {
  2501. ugr1.Cells["JUDGE_NO"].Value = BaseMethod.getJudgeStoveNo(ugr1.Cells["JUDGE_STOVE_NO"].Value.ToString());
  2502. if (ugr1.Cells["JUDGE_STOVE_NO"].Value.ToString() == JudgeStoveNo)
  2503. {
  2504. ultraGridPlan.ActiveRow = ugr1;
  2505. }
  2506. }
  2507. }
  2508. }
  2509. /// <summary>
  2510. /// 开始回退
  2511. /// </summary>
  2512. private void StartBack()
  2513. {
  2514. if (ultraGridPlan.Rows.Count > 0)
  2515. {
  2516. if (alarmFlag == true)
  2517. {
  2518. MessageUtil.ShowTips("登记了缺陷项,请先保存实绩!");
  2519. return;
  2520. }
  2521. if (this.ultraGridPlan.ActiveRow == null)
  2522. {
  2523. MessageBox.Show("请选择需要回退的炉号!!!");
  2524. return;
  2525. }
  2526. UltraGridRow ugr = ultraGridPlan.ActiveRow;
  2527. string JudgeStoveNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
  2528. string ResultNo = ugr.Cells["ID"].Value.ToString();
  2529. string StartStatus = doQueryJugeNoStaus(ResultNo, JudgeStoveNo, PlineCode);
  2530. if (StartStatus == "1")
  2531. {
  2532. MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】已结炉,不能开始回退!!!!");
  2533. return;
  2534. }
  2535. if (StartStatus == "3")
  2536. {
  2537. MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】未开始探伤,不能开始回退!!!!");
  2538. return;
  2539. }
  2540. string plincode = this.PlineCode;
  2541. string ColGroup = this.UserInfo.GetUserGroup();
  2542. string ColUser = this.UserInfo.GetUserName();
  2543. string ColShift = this.UserInfo.GetUserOrder();
  2544. DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.startbackcheck", new object[] { JudgeStoveNo, plincode, ColGroup, ColShift, proPlanId, gxPlanNo }, this.ob);
  2545. if (dt.Rows.Count > 0)
  2546. {
  2547. if (MessageUtil.ShowYesNoAndQuestion("已有班次操作过该炉,是否继续回退?") == DialogResult.No)
  2548. {
  2549. return;
  2550. }
  2551. }
  2552. DataTable ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.doQueryOffine", new object[] { JudgeStoveNo, plincode, proPlanId, gxPlanNo }, ob);
  2553. if (ds.Rows.Count > 0)
  2554. {
  2555. MessageUtil.ShowTips("存在下线支数,请先下线回退再开始回退!");
  2556. return;
  2557. }
  2558. int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.TeststartBack", new object[] { JudgeStoveNo, ResultNo, plincode, ColGroup, ColShift, proPlanId, gxPlanNo }, this.ob);
  2559. GetMILTestingRack(JudgeStoveNo);
  2560. ChangeGridColor();
  2561. ChangeCellName();
  2562. PlanQuery();
  2563. }
  2564. }
  2565. /// <summary>
  2566. /// 保存跟踪记录表备注
  2567. /// </summary>
  2568. private void ultraGridMatSeq_AfterCellUpdate(object sender, CellEventArgs e)
  2569. {
  2570. UltraGridRow ugr = null;
  2571. string heatno = "";
  2572. int seq = 0;
  2573. string remark = "";
  2574. if (Colno.Equals("1"))
  2575. {
  2576. ugr = this.ultraTestRack1.ActiveRow;
  2577. }
  2578. if (Colno.Equals("2"))
  2579. {
  2580. //ugr = this.ultraTestRack2.ActiveRow;
  2581. }
  2582. if (Colno.Equals("3"))
  2583. {
  2584. //ugr = this.ultraTestRack3.ActiveRow;
  2585. }
  2586. //if (e.Cell.Column.Key == "REMARK")
  2587. //{
  2588. // if (ugr == null)
  2589. // {
  2590. // //MessageBox.Show("您未选择任何管号队列数据,请重新选择后再进行保存操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  2591. // return;
  2592. // }
  2593. // heatno = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
  2594. // seq = Convert.ToInt16(ugr.Cells["SEQ"].Value.ToString());
  2595. // if (!string.IsNullOrEmpty(ugr.Cells["REMARK"].Value.ToString()))
  2596. // {
  2597. // remark = ugr.Cells["REMARK"].Value.ToString();
  2598. // }
  2599. // else
  2600. // {
  2601. // remark = "";
  2602. // }
  2603. // NativeMethodNew na = new NativeMethodNew(this.ob);
  2604. // na.SaveRackRemark(2, seq, heatno, remark);
  2605. //}
  2606. }
  2607. /// <summary>
  2608. /// 保存探伤实绩
  2609. /// </summary>
  2610. public void ETResultSave()//saveflag=1 只保存参数,
  2611. {
  2612. string hratno = "";
  2613. int count = 0;
  2614. string testOfflineNum = "";//已探下线支数
  2615. milet.Clear();
  2616. milmt.Clear();
  2617. milul.Clear();
  2618. UltraGridRow ugr_roll = this.rollingCard1.UltraGrid4.Rows[0];
  2619. UltraGridRow ugr_ET = this.crackDetectionResult1.UltraGrid3.Rows[0];
  2620. UltraGridRow ugr_MT = this.mtTestingResult1.UltraGrid3.Rows[0];
  2621. UltraGridRow ugr_UT = this.ulTestingResult1.UltraGrid3.Rows[0];
  2622. string saveflage = "0";
  2623. alarmFlag = false;
  2624. if (this.ultraGridPlan.ActiveRow == null && ActiveJUDGE_STOVE_NO == null)
  2625. {
  2626. MessageBox.Show("未选择任何炉号,请选择炉号后进行保存操作。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  2627. return;
  2628. }
  2629. if (this.ultraGridPlan.ActiveRow == null)
  2630. {
  2631. hratno = ActiveJUDGE_STOVE_NO;
  2632. }
  2633. else
  2634. {
  2635. hratno = this.ultraGridPlan.ActiveRow.Cells["JUDGE_STOVE_NO"].Value.ToString();
  2636. }
  2637. if (ActiveStatus == "未开始探伤")
  2638. {
  2639. MessageBox.Show("炉号:【" + BaseMethod.getJudgeStoveNo(hratno) + "】未开始进行探伤,不允许进行保存操作!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  2640. return;
  2641. }
  2642. if (ActiveStatus == "已完成探伤")
  2643. {
  2644. saveflage = "1";
  2645. //MessageBox.Show("炉号:【" + hratno + "】已完成探伤操作,不允许进行保存操作!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  2646. //return;
  2647. }
  2648. //if (ActiveStatus == "已完成探伤")
  2649. //{
  2650. // MessageBox.Show("炉号:【" + hratno + "】已完成探伤操作,不允许进行保存操作!", "提示:", MessageBoxButtons.OK,MessageBoxIcon.Warning);
  2651. // return;
  2652. //}
  2653. //if (MessageUtil.ShowYesNoAndQuestion("确认炉号【" + hratno + "】保存实绩?") == DialogResult.No)
  2654. //{
  2655. // return;
  2656. //}
  2657. DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.GetMIL_STRAIGHTENING_RESULT", new object[] { hratno, proPlanId, gxPlanNo }, this.ob);
  2658. //if (TestMethod.Contains("涡流"))
  2659. if (PlineCode.Equals("C010"))
  2660. {
  2661. this.crackDetectionResult1.UltraGrid3.UpdateData();
  2662. string[] arr = specName.Split('*');
  2663. milet = NativeMethod.GetUltraGridToEntityNEW(this.crackDetectionResult1.UltraGrid3, milet);
  2664. milet.JudgeStoveNo = hratno;
  2665. milet.ProPlanId = proPlanId;
  2666. milet.GxPlanNo = gxPlanNo;
  2667. if (this.ultraGridPlan.ActiveRow != null)
  2668. {
  2669. milet.LotNo = this.ultraGridPlan.ActiveRow.Cells["LOT_NO"].Text.Trim();
  2670. milet.ResultNo = this.ultraGridPlan.ActiveRow.Cells["ID"].Text.Trim();
  2671. }
  2672. Colno = this.crackDetectionResult1.TestingDataSource1.Rows[0]["colNo"].ToString();
  2673. milet.ColNo = Colno;
  2674. milet.ColShift = this.UserInfo.GetUserOrder();
  2675. milet.ColGroup = this.UserInfo.GetUserGroup();
  2676. milet.PlineCode = PlineCode;
  2677. milet.ColUser = _UserName;
  2678. DataTable df = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.doQueryTestedNum", new object[] { milmt.ResultNo, this.UserInfo.GetUserOrder(), this.UserInfo.GetUserGroup(), Colno }, ob);//查询改台下线支数
  2679. if (df.Rows.Count > 0)
  2680. {
  2681. testOfflineNum = df.Rows[0]["REASON_NUMBER"].ToString();
  2682. }
  2683. #region 监督者管控
  2684. if (milet.UseridGrade1.ToString().Trim().Length == 0)
  2685. {
  2686. if (!(milet.UseridGrade2.ToString().Trim().Length == 0 || milet.Userid2.ToString().Trim().Length == 0))
  2687. {
  2688. MessageUtil.ShowTips("操作者1信息为空,监督者1不能有相关信息");
  2689. return;
  2690. }
  2691. }
  2692. if (milet.UseridGrade1.ToString().Trim().Length > 0)
  2693. {
  2694. if (milet.UseridGrade1.ToString().Contains("1"))
  2695. {
  2696. if (milet.UseridGrade2.ToString().Trim().Length == 0 || milet.Userid2.ToString().Trim().Length == 0)
  2697. {
  2698. MessageUtil.ShowTips("操作者1操作等级为1,需要填写监督者1相关信息!");
  2699. return;
  2700. }
  2701. else
  2702. {
  2703. if (milet.UseridGrade2.ToString().Trim().Contains("1"))
  2704. {
  2705. MessageUtil.ShowTips("操作者1操作等级为1,监督者1不能为等级1!");
  2706. return;
  2707. }
  2708. }
  2709. }
  2710. else
  2711. {
  2712. if (milet.UseridGrade2.ToString().Trim().Length > 0 || milet.Userid2.ToString().Trim().Length > 0)
  2713. {
  2714. MessageUtil.ShowTips("操作者1操作等级不为等级1,监督者1信息为空!");
  2715. return;
  2716. }
  2717. }
  2718. }
  2719. #endregion
  2720. if (Colno.Equals("1"))
  2721. {
  2722. milet.SuspectProductNum = this.crackDetectionResult1.TestingDataSource1.Rows[0]["suspectProductNum1"].ToString();
  2723. 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();
  2724. if (int.Parse(milet.SuspectProductNum.ToString3()) > int.Parse(milet.DetectionNum1.ToString3()))
  2725. {
  2726. MessageUtil.ShowTips("报警支数不能大于检测支数!");
  2727. return;
  2728. }
  2729. if (int.Parse(milet.ReinspectionNum1.ToString3()) > int.Parse(milet.SuspectProductNum.ToString3()))
  2730. {
  2731. MessageUtil.ShowTips("复探支数是在报警之下,复探支数不能大于报警支数");
  2732. return;
  2733. }
  2734. if (int.Parse(milet.ReinspectionQualifiedNum1.ToString3()) > int.Parse(milet.ReinspectionNum1.ToString3()))
  2735. {
  2736. MessageUtil.ShowTips("复探合格支数不能大于复探支数!");
  2737. return;
  2738. }
  2739. if (int.Parse(testOfflineNum.ToString3()) + int.Parse(milet.ScrapNum1.ToString3()) > int.Parse(milet.SuspectProductNum.ToString3()))
  2740. {
  2741. MessageUtil.ShowTips("已探下线支数加废品支数不能大于报警支数");
  2742. return;
  2743. }
  2744. }
  2745. if (Colno.Equals("2"))
  2746. {
  2747. milet.SuspectProductNum = this.crackDetectionResult1.TestingDataSource1.Rows[0]["suspectProductNum2"].ToString();
  2748. 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();
  2749. if (int.Parse(milet.SuspectProductNum.ToString3()) > int.Parse(milet.DetectionNum2.ToString3()))
  2750. {
  2751. MessageUtil.ShowTips("报警支数不能大于检测支数!");
  2752. return;
  2753. }
  2754. if (int.Parse(milet.ReinspectionNum2.ToString3()) > int.Parse(milet.SuspectProductNum.ToString3()))
  2755. {
  2756. MessageUtil.ShowTips("复探支数是在报警之下,复探支数不能大于报警支数");
  2757. return;
  2758. }
  2759. if (int.Parse(milet.ReinspectionQualifiedNum2.ToString3()) > int.Parse(milet.ReinspectionNum2.ToString3()))
  2760. {
  2761. MessageUtil.ShowTips("复探合格支数不能大于复探支数!");
  2762. return;
  2763. }
  2764. if (int.Parse(testOfflineNum.ToString3()) + int.Parse(milet.ScrapNum2.ToString3()) > int.Parse(milet.SuspectProductNum.ToString3()))
  2765. {
  2766. MessageUtil.ShowTips("已探下线支数加废品支数不能大于报警支数");
  2767. return;
  2768. }
  2769. }
  2770. if (Colno.Equals("3"))
  2771. {
  2772. milet.SuspectProductNum = this.crackDetectionResult1.TestingDataSource1.Rows[0]["suspectProductNum3"].ToString();
  2773. 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();
  2774. if (int.Parse(milet.SuspectProductNum.ToString3()) > int.Parse(milet.DetectionNum3.ToString3()))
  2775. {
  2776. MessageUtil.ShowTips("报警支数不能大于检测支数!");
  2777. return;
  2778. }
  2779. if (int.Parse(milet.ReinspectionNum3.ToString3()) > int.Parse(milet.SuspectProductNum.ToString3()))
  2780. {
  2781. MessageUtil.ShowTips("复探支数是在报警之下,复探支数不能大于报警支数");
  2782. return;
  2783. }
  2784. if (int.Parse(milet.ReinspectionQualifiedNum3.ToString3()) > int.Parse(milet.ReinspectionNum3.ToString3()))
  2785. {
  2786. MessageUtil.ShowTips("复探合格支数不能大于复探支数!");
  2787. return;
  2788. }
  2789. if (int.Parse(testOfflineNum.ToString3()) + int.Parse(milet.ScrapNum3.ToString3()) > int.Parse(milet.SuspectProductNum.ToString3()))
  2790. {
  2791. MessageUtil.ShowTips("已探下线支数加废品支数不能大于报警支数");
  2792. return;
  2793. }
  2794. }
  2795. string detiaEtTity = JSONFormat.Format(milet);
  2796. ////插入ET探伤实绩表
  2797. //saveflage = "1";
  2798. //count = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.UpdateETResult", new object[] { milet, Colno, saveflage }, this.ob);
  2799. CoreClientParam ccp = new CoreClientParam();
  2800. ccp.ServerName = "com.steering.mes.zgmil.coup.EddyCurrentTestingResult";
  2801. ccp.MethodName = "saveEtResult";
  2802. ccp.ServerParams = new object[] { detiaEtTity, Colno };
  2803. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  2804. if (ccp.ReturnCode != -1)
  2805. {
  2806. if (ccp.ReturnInfo.Equals("保存成功!"))
  2807. {
  2808. PlanQuery();
  2809. MessageUtil.ShowTips(ccp.ReturnInfo);
  2810. }
  2811. else
  2812. {
  2813. MessageUtil.ShowTips(ccp.ReturnInfo);
  2814. }
  2815. }
  2816. }
  2817. //if (TestMethod.Contains("漏磁"))
  2818. if (PlineCode.Equals("C009") || PlineCode.Equals("C008") || PlineCode.Equals("C017") || PlineCode.Equals("C072"))
  2819. {
  2820. this.mtTestingResult1.UltraGrid3.UpdateData();
  2821. //milmt = NativeMethod.GetUltraGridToEntityNEW(this.mtTestingResult1.UltraGrid3, milmt);
  2822. //milmt.JudgeStoveNo = hratno;
  2823. string[] arr = specName.Split('*');
  2824. milmt = NativeMethod.GetUltraGridToEntityNEW(this.mtTestingResult1.UltraGrid3, milmt);
  2825. milmt.JudgeStoveNo = hratno;
  2826. if (this.ultraGridPlan.ActiveRow != null)
  2827. {
  2828. milmt.LotNo = this.ultraGridPlan.ActiveRow.Cells["LOT_NO"].Text.Trim();
  2829. milmt.ResultNo = this.ultraGridPlan.ActiveRow.Cells["ID"].Text.Trim();
  2830. }
  2831. Colno = this.mtTestingResult1.UltraDataSource1.Rows[0]["colNo"].ToString();
  2832. milmt.ColNo = Colno;
  2833. milmt.ColShift = this.UserInfo.GetUserOrder();
  2834. milmt.ColGroup = this.UserInfo.GetUserGroup();
  2835. milmt.PlineCode = PlineCode;
  2836. milmt.ColUser = _UserName;
  2837. milmt.ProPlanId = proPlanId;
  2838. milmt.GxPlanNo = gxPlanNo;
  2839. #region //监督者判定
  2840. if (PlineCode.Equals("C009") || PlineCode.Equals("C008") || PlineCode.Equals("C017"))
  2841. {
  2842. if (milmt.UseridGrade1.ToString().Trim().Length == 0)
  2843. {
  2844. if (!(milmt.UseridGrade1jd.ToString().Trim().Length == 0 || milmt.Userid1jd.ToString().Trim().Length == 0))
  2845. {
  2846. MessageUtil.ShowTips("操作者1信息为空,监督者1不能有相关信息");
  2847. return;
  2848. }
  2849. }
  2850. if (milmt.UseridGrade1.ToString().Trim().Length > 0)
  2851. {
  2852. if (milmt.UseridGrade1.ToString().Contains("1"))
  2853. {
  2854. if (milmt.UseridGrade1jd.ToString().Trim().Length == 0 || milmt.Userid1jd.ToString().Trim().Length == 0)
  2855. {
  2856. MessageUtil.ShowTips("操作者1操作等级为1,需要填写监督者1相关信息!");
  2857. return;
  2858. }
  2859. else
  2860. {
  2861. if (milmt.UseridGrade1jd.ToString().Trim().Contains("1"))
  2862. {
  2863. MessageUtil.ShowTips("操作者1操作等级为1,监督者1不能为等级1!");
  2864. return;
  2865. }
  2866. }
  2867. }
  2868. else
  2869. {
  2870. if (milmt.UseridGrade1jd.ToString().Trim().Length > 0 || milmt.Userid1jd.ToString().Trim().Length > 0)
  2871. {
  2872. MessageUtil.ShowTips("操作者1操作等级不为等级1,监督者1信息为空!");
  2873. return;
  2874. }
  2875. }
  2876. }
  2877. if (milmt.UseridGrade2.ToString().Trim().Length == 0)
  2878. {
  2879. if (milmt.UseridGrade2jd.ToString().Trim().Length > 0 || milmt.Userid2jd.ToString().Trim().Length > 0)
  2880. {
  2881. MessageUtil.ShowTips("操作者2信息为空,监督者2不能有相关信息!");
  2882. return;
  2883. }
  2884. }
  2885. if (milmt.UseridGrade2.ToString().Trim().Length > 0)
  2886. {
  2887. if (milmt.UseridGrade2.ToString().Contains("1"))
  2888. {
  2889. if (milmt.UseridGrade2jd.ToString().Trim().Length == 0 || milmt.Userid2jd.ToString().Trim().Length == 0)
  2890. {
  2891. MessageUtil.ShowTips("操作者2操作等级为1,监督者2信息不能为空!");
  2892. return;
  2893. }
  2894. else
  2895. {
  2896. if (milmt.UseridGrade2jd.ToString().Trim().Contains("1"))
  2897. {
  2898. MessageUtil.ShowTips("操作者等级为1,监督者不能为1!");
  2899. return;
  2900. }
  2901. }
  2902. }
  2903. else
  2904. {
  2905. if (milmt.UseridGrade2jd.ToString().Trim().Length > 0 || milmt.Userid2jd.ToString().Trim().Length > 0)
  2906. {
  2907. MessageUtil.ShowTips("操作者2操作等级不为等级1,监督者2信息要为空!");
  2908. return;
  2909. }
  2910. }
  2911. }
  2912. }
  2913. #endregion
  2914. DataTable df = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.doQueryTestedNum", new object[] { milmt.ResultNo, this.UserInfo.GetUserOrder(), this.UserInfo.GetUserGroup(), Colno }, ob);//查询改台下线支数
  2915. if (df.Rows.Count > 0)
  2916. {
  2917. testOfflineNum = df.Rows[0]["REASON_NUMBER"].ToString();
  2918. }
  2919. if (Colno == "1")
  2920. {
  2921. milmt.AlarmNum = this.mtTestingResult1.UltraDataSource1.Rows[0]["suspectProductNum1"].ToString();
  2922. 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();
  2923. if (int.Parse(milmt.AlarmNum.ToString3()) > int.Parse(milmt.DetectionNum1.ToString3()))
  2924. {
  2925. MessageUtil.ShowTips("报警支数不能大于检测支数!");
  2926. return;
  2927. }
  2928. if (int.Parse(milmt.RecutNum1.ToString3()) > int.Parse(milmt.AlarmNum.ToString3()))
  2929. {
  2930. MessageUtil.ShowTips("子管再切支数是在报警支数之下,子管再切支数不能大于报警支数!");
  2931. return;
  2932. }
  2933. if (int.Parse(milmt.ReinspectionNum1.ToString3()) > int.Parse(milmt.AlarmNum.ToString3()))
  2934. {
  2935. MessageUtil.ShowTips("复探支数是在报警之下,复探支数不能大于报警支数");
  2936. return;
  2937. }
  2938. if (int.Parse(milmt.ReinspectionQualifiedNum1.ToString3()) > int.Parse(milmt.ReinspectionNum1.ToString3()))
  2939. {
  2940. MessageUtil.ShowTips("复探合格支数不能大于复探支数!");
  2941. return;
  2942. }
  2943. if (int.Parse(testOfflineNum.ToString3()) + int.Parse(milmt.RecutNum1.ToString3()) + int.Parse(milmt.ScrapNum1.ToString3()) > int.Parse(milmt.AlarmNum.ToString3()))
  2944. {
  2945. MessageUtil.ShowTips("已探下线支数加废品支数加子管再切支数不能大于报警支数");
  2946. return;
  2947. }
  2948. //if (int.Parse(testOfflineNum.ToString3()) + int.Parse(milmt.ScrapNum1.ToString3()) + int.Parse(milmt.ReinspectionNum1.ToString3()) > int.Parse(milmt.AlarmNum.ToString3()))
  2949. //{
  2950. // MessageUtil.ShowTips("复探支数加废品支数加已探伤下线支数应与报警支数一致!");
  2951. // return;
  2952. //}
  2953. }
  2954. else
  2955. {
  2956. milmt.AlarmNum = this.mtTestingResult1.UltraDataSource1.Rows[0]["suspectProductNum2"].ToString();
  2957. 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();
  2958. if (int.Parse(milmt.AlarmNum.ToString3()) > int.Parse(milmt.DetectionNum2.ToString3()))
  2959. {
  2960. MessageUtil.ShowTips("报警支数不能大于检测支数!");
  2961. return;
  2962. }
  2963. if (int.Parse(milmt.RecutNum2.ToString3()) > int.Parse(milmt.AlarmNum.ToString3()))
  2964. {
  2965. MessageUtil.ShowTips("子管再切支数是在报警支数之下,子管再切支数不能大于报警支数!");
  2966. return;
  2967. }
  2968. if (int.Parse(milmt.ReinspectionNum2.ToString3()) > int.Parse(milmt.AlarmNum.ToString3()))
  2969. {
  2970. MessageUtil.ShowTips("复探支数是在报警支数之下,复探支数不能大于报警支数");
  2971. return;
  2972. }
  2973. if (int.Parse(milmt.ReinspectionQualifiedNum2.ToString3()) > int.Parse(milmt.ReinspectionNum2.ToString3()))
  2974. {
  2975. MessageUtil.ShowTips("复探合格支数不能大于复探支数!");
  2976. return;
  2977. }
  2978. if (int.Parse(testOfflineNum.ToString3()) + int.Parse(milmt.RecutNum2.ToString3()) + int.Parse(milmt.ScrapNum2.ToString3()) > int.Parse(milmt.AlarmNum.ToString3()))
  2979. {
  2980. MessageUtil.ShowTips("已探下线支数加废品支数加子管再切支数不能大于报警支数");
  2981. return;
  2982. }
  2983. //if (int.Parse(this.mtTestingResult1.testOfflineNum.ToString3()) + int.Parse(milmt.ScrapNum2.ToString3()) + int.Parse(milmt.ReinspectionNum2.ToString3()) > int.Parse(milmt.AlarmNum.ToString3()))
  2984. //{
  2985. // MessageUtil.ShowTips("复探支数加废品支数加已探伤下线支数应与报警支数一致!");
  2986. // return;
  2987. //}
  2988. //if (int.Parse(testOfflineNum.ToString3()) + int.Parse(milmt.ScrapNum2.ToString3()) + int.Parse(milmt.ReinspectionNum2.ToString3()) > int.Parse(milmt.AlarmNum.ToString3()))
  2989. //{
  2990. // MessageUtil.ShowTips("复探支数加废品支数加已探伤下线支数应与报警支数一致!");
  2991. // return;
  2992. //}
  2993. }
  2994. string detiaTity = JSONFormat.Format(milmt);
  2995. //插入MT探伤实绩表
  2996. //saveflage = "1";
  2997. // count = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.UpdateMTResult", new object[] { milmtDetai, Colno, saveflage }, this.ob);
  2998. CoreClientParam ccp = new CoreClientParam();
  2999. ccp.ServerName = "com.steering.mes.zgmil.coup.EddyCurrentTestingResult";
  3000. ccp.MethodName = "saveMtResult";
  3001. ccp.ServerParams = new object[] { detiaTity, Colno };
  3002. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  3003. if (ccp.ReturnCode != -1)
  3004. {
  3005. if (ccp.ReturnInfo.Equals("保存成功!"))
  3006. {
  3007. PlanQuery();
  3008. MessageUtil.ShowTips(ccp.ReturnInfo);
  3009. }
  3010. else
  3011. {
  3012. MessageUtil.ShowTips(ccp.ReturnInfo);
  3013. }
  3014. }
  3015. }
  3016. //if (TestMethod.Contains("超声波"))
  3017. if (PlineCode.Equals("C012"))
  3018. {
  3019. this.ulTestingResult1.UltraGrid3.UpdateData();
  3020. milul = NativeMethod.GetUltraGridToEntityNEW(this.ulTestingResult1.UltraGrid3, milul);
  3021. milul.JudgeStoveNo = hratno;
  3022. if (Colno.Equals("1"))
  3023. {
  3024. //milul.DetectionNum1 = this.ultraTestRack1.Rows.Count.ToString();
  3025. // milul.QualifiedNum1 = (this.ultraTestRack1.Rows.Count - int.Parse(milul.ScrapNum1.ToString())).ToString();
  3026. milul.DetectionNum1 = "0";
  3027. milul.QualifiedNum1 = "0";
  3028. int i = 0;
  3029. int j = 0;
  3030. foreach (UltraGridRow ugr in ultraTestRack1.Rows)
  3031. {
  3032. if (ugr.Cells["STATUS"].Value.ToString().Equals("报警"))
  3033. {
  3034. i = i + 1;
  3035. }
  3036. if (ugr.Cells["SUSPECT_FLAG"].Value.ToString().Equals("可疑"))
  3037. {
  3038. j = j + 1;
  3039. }
  3040. }
  3041. milul.ReinspectionQualifiedNum1 = i.ToString();
  3042. milul.SuspectProductNum1 = j.ToString();
  3043. milul.NodeFurFlag1 = "0";
  3044. }
  3045. if (Colno.Equals("2"))
  3046. {
  3047. //milul.DetectionNum2 = this.ultraTestRack2.Rows.Count.ToString();
  3048. //milul.QualifiedNum2 = (this.ultraTestRack2.Rows.Count - int.Parse(milul.ScrapNum2.ToString())).ToString();
  3049. milul.DetectionNum2 = "0";
  3050. milul.QualifiedNum2 = "0";
  3051. int i = 0;
  3052. int j = 0;
  3053. foreach (UltraGridRow ugr in ultraTestRack1.Rows)
  3054. {
  3055. if (ugr.Cells["STATUS"].Value.ToString().Equals("报警"))
  3056. {
  3057. i = i + 1;
  3058. }
  3059. if (ugr.Cells["SUSPECT_FLAG"].Value.ToString().Equals("可疑"))
  3060. {
  3061. j = j + 1;
  3062. }
  3063. }
  3064. milul.ReinspectionQualifiedNum2 = i.ToString();
  3065. milul.SuspectProductNum2 = j.ToString();
  3066. milul.NodeFurFlag2 = "0";
  3067. milul.ProPlanId = proPlanId;
  3068. milul.GxPlanNo = gxPlanNo;
  3069. }
  3070. //插入ET探伤实绩表
  3071. saveflage = "1";
  3072. count = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.UpdateUTResult", new object[] { milul, Colno, saveflage }, this.ob);
  3073. }
  3074. if (count == 1)
  3075. {
  3076. MessageBox.Show("保存操作完成!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  3077. this.crackDetectionResult1.IsCellSelect = false;
  3078. this.mtTestingResult1.IsCellSelect = false;
  3079. this.ulTestingResult1.IsCellSelect = false;
  3080. }
  3081. tempmilet = NativeMethod.GetEntityToEntity(tempmilet, milet);//将当前探伤实绩保存备份
  3082. tempmilmt = NativeMethod.GetEntityToEntity(tempmilmt, milmt);
  3083. //tempmilut = NativeMethod.GetEntityToEntity(tempmilut, milul);
  3084. }
  3085. private String doQueryJugeNoStaus(string resultNo, string jugeNo, string plineCode)
  3086. {
  3087. string staus = "3";
  3088. DataTable ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.doQueryResultStaus", new object[] { resultNo, jugeNo, plineCode, "7", proPlanId, gxPlanNo }, ob);
  3089. if (ds.Rows.Count > 0)
  3090. {
  3091. staus = ds.Rows[0]["NODE_FUR_FLAG"].ToString();
  3092. }
  3093. return staus;
  3094. }
  3095. /// <summary>
  3096. /// 结炉操作
  3097. /// 1、判断上一道工序结炉状态,2、更新实绩表(包括结炉时间,结炉状态),3.更新主表NODE_STATUS
  3098. /// </summary>
  3099. public void ETTestingResultNode()//数据验证,保存参数,设置状态
  3100. {
  3101. ETResultSave();
  3102. //if (this.PlineCode.Equals("C009"))
  3103. //{
  3104. // if (this.TestMethod.Contains("2"))
  3105. // {
  3106. // MessageBox.Show("您的操作台不允许进行探伤结炉操作。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  3107. // return;
  3108. // }
  3109. //}
  3110. string Status = "";
  3111. if (this.ultraGridPlan.ActiveRow == null)
  3112. {
  3113. MessageBox.Show("未选择任何炉号,不允许结炉。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  3114. return;
  3115. }
  3116. UltraGridRow ugr_plan = this.ultraGridPlan.ActiveRow;
  3117. UltraGridRow ugr_roll = this.rollingCard1.UltraGrid4.Rows[0];
  3118. UltraGridRow ugr_ET = this.crackDetectionResult1.UltraGrid3.Rows[0];
  3119. UltraGridRow ugr_MT = this.mtTestingResult1.UltraGrid3.Rows[0];
  3120. UltraGridRow ugr_UT = this.ulTestingResult1.UltraGrid3.Rows[0];
  3121. if (ugr_plan != null)
  3122. {
  3123. string JudgeStoveNo = ugr_plan.Cells["JUDGE_STOVE_NO"].Value.ToString();
  3124. string resultNo = ugr_plan.Cells["ID"].Value.ToString();
  3125. //Status = ugr_plan.Cells["IS_START"].Value.ToString();
  3126. Status = doQueryJugeNoStaus(resultNo, JudgeStoveNo, PlineCode);
  3127. int count = 0;
  3128. if (Status != "0")
  3129. {
  3130. MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】未开始探伤或已完成探伤,不允许结炉!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  3131. return;
  3132. }
  3133. //if (Status == "已完成探伤")
  3134. //{
  3135. // MessageBox.Show("炉号【" + JudgeStoveNo + "】已完成探伤操作,不允许结炉!", "提示:", MessageBoxButtons.OK,MessageBoxIcon.Warning);
  3136. // return;
  3137. //}
  3138. //查询矫直结炉是否完成
  3139. DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.GetMIL_STRAIGHTENING_RESULT", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, this.ob);
  3140. if (dt.Rows.Count == 0)
  3141. {
  3142. MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】还未开始矫直,不能结炉!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  3143. return;
  3144. }
  3145. if (string.IsNullOrEmpty(dt.Rows[0]["NODE_FUR_FLAG"].ToString()))
  3146. {
  3147. MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】还未开始矫直,不能结炉!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  3148. return;
  3149. }
  3150. if (dt.Rows[0]["NODE_FUR_FLAG"].ToString() != "1")//
  3151. {
  3152. MessageBox.Show("炉号【" + JudgeStoveNo + "】还未矫直完成,不能结炉!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  3153. return;
  3154. }
  3155. //验证可疑、废品支数
  3156. DataTable ds = new DataTable();
  3157. DataTable dd = new DataTable();
  3158. DataTable dy = new DataTable();
  3159. //if (PlineCode.Equals("C009")||PlineCode.Equals("C008")||PlineCode.Equals("C017")||PlineCode.Equals("C010"))
  3160. //{
  3161. ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.doQueryAlarm", new object[] { JudgeStoveNo, PlineCode, proPlanId, gxPlanNo }, ob);
  3162. if (ds.Rows.Count > 0)
  3163. {
  3164. if (!ds.Rows[0]["ALARM_NUM"].ToString().Equals(ds.Rows[0]["REASON_NUMBER"].ToString()))
  3165. {
  3166. MessageUtil.ShowTips("报警支数的登记与实绩保存的报警支数不一致,不允许结炉!");
  3167. return;
  3168. }
  3169. }
  3170. dy = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.getMtResultNum", new object[] { JudgeStoveNo, PlineCode, proPlanId, gxPlanNo }, ob);
  3171. if (!dy.Rows[0]["TOTALCOUNT"].ToString().Equals(dt.Rows[0]["QUALIFIED_NUM"].ToString()))
  3172. {
  3173. MessageUtil.ShowTips("结炉总支数与矫直合格支数不一致,不允许结炉!");
  3174. return;
  3175. }
  3176. //}
  3177. //if (!NodeTotale(JudgeStoveNo))
  3178. //{
  3179. // return;
  3180. //}
  3181. if (MessageUtil.ShowYesNoAndQuestion("确认炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】结炉?") == DialogResult.No)
  3182. {
  3183. return;
  3184. }
  3185. string[] arr = specName.Split('*');
  3186. double DBHeight = 0;
  3187. double BurnningRate = 0;
  3188. double BurnningRate1 = 0;
  3189. double DBNum = 1;
  3190. NativeMethodNew na1 = new NativeMethodNew(this.ob);
  3191. string JudgeStoveNotemp = BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "-01";
  3192. double percent = na1.GetLengthPercent(JudgeStoveNotemp, this.ob, 0);
  3193. //if (percent == 100.0)
  3194. //{
  3195. // MessageBox.Show("炉号:【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】尚未开始分切,不允许结炉", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  3196. // return;
  3197. //}
  3198. DataTable dtDBH = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getDbHeight", new object[] { JudgeStoveNo, ActiveResultNo, proPlanId, gxPlanNo }, this.ob);
  3199. if (dtDBH.Rows.Count > 0)
  3200. {
  3201. if (!string.IsNullOrEmpty(dtDBH.Rows[0]["DB_HEIGHT"].ToString()))
  3202. {
  3203. DBHeight = double.Parse(dtDBH.Rows[0]["DB_HEIGHT"].ToString());
  3204. }
  3205. if (!string.IsNullOrEmpty(dtDBH.Rows[0]["BURNNING_RATE"].ToString()))
  3206. {
  3207. BurnningRate = double.Parse(dtDBH.Rows[0]["BURNNING_RATE"].ToString());
  3208. }
  3209. if (!string.IsNullOrEmpty(dtDBH.Rows[0]["BURNINGRATE"].ToString()))
  3210. {
  3211. BurnningRate1 = double.Parse(dtDBH.Rows[0]["BURNINGRATE"].ToString());
  3212. }
  3213. if (!string.IsNullOrEmpty(dtDBH.Rows[0]["DB_NUM"].ToString()))
  3214. {
  3215. DBNum = double.Parse(dtDBH.Rows[0]["DB_NUM"].ToString());
  3216. }
  3217. }
  3218. Double temp = 0.0;
  3219. if (this.PlineCode == "C009" || PlineCode == "C012" || PlineCode == "C017" || this.PlineCode == "C008" || PlineCode == "C072")
  3220. {
  3221. temp = DBHeight * (1 - (BurnningRate / 100));
  3222. }
  3223. else
  3224. {
  3225. temp = DBHeight * (1 - (BurnningRate / 100)) * (1 - (BurnningRate1 / 100));
  3226. }
  3227. temp = temp * percent / 100;
  3228. //if (TestMethod.Contains("涡流"))
  3229. DataTable sd = getStoreNo(PlineCode);
  3230. if (sd == null)
  3231. {
  3232. MessageUtil.ShowTips("无轧管在线库基础信息,请维护!");
  3233. return;
  3234. }
  3235. ArrayList list = new ArrayList();
  3236. list.Add(sd.Rows[0]["STORAGE_NO"].ToString());
  3237. list.Add(sd.Rows[0]["STORAGE_NO"].ToString() + "10101");
  3238. list.Add(sd.Rows[0]["STORAGE_TYPE_NO"].ToString());
  3239. list.Add(sd.Rows[0]["STORAGE_TYPE_NAME"].ToString());
  3240. list.Add(this.UserInfo.GetDeptid());
  3241. list.Add(this.UserInfo.GetDepartment());
  3242. list.Add(this.UserInfo.GetDeptid());
  3243. list.Add(this.UserInfo.GetDepartment());
  3244. //list.Add(PipeManageClass.GetDepartIdBySectionId(this.UserInfo.GetDeptid(), this.ob));
  3245. //list.Add(PipeManageClass.GetDepartBySectionId(this.UserInfo.GetDeptid(), this.ob));
  3246. list.Add(UserInfo.GetUserName());
  3247. CoreClientParam ccp = new CoreClientParam();
  3248. ccp.ServerName = "com.steering.mes.zgmil.coup.FrmStraighteningResult";
  3249. ccp.MethodName = "updateMilSlab";
  3250. ccp.ServerParams = new object[] { JudgeStoveNo, "10", proPlanId, gxPlanNo };
  3251. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  3252. if (ccp.ReturnCode != -1)
  3253. {
  3254. if (ccp.ReturnInfo.Equals("修改成功!"))
  3255. {
  3256. AutoUpFile();
  3257. //更新进程表,废品入库存
  3258. ccp.ServerName = "com.steering.mes.zgmil.coup.EddyCurrentTestingResult";
  3259. ccp.MethodName = "updateProcessTest";
  3260. ccp.ServerParams = new object[] { JudgeStoveNo, "10", "10", list, proPlanId, gxPlanNo, lotNo, PlineCode };
  3261. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  3262. if (ccp.ReturnCode != -1)
  3263. {
  3264. if (ccp.ReturnInfo.Equals("修改成功!"))
  3265. {
  3266. dd = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.doQuerySCRAPNUM", new object[] { JudgeStoveNo, PlineCode, proPlanId, gxPlanNo }, ob);
  3267. if (dd.Rows.Count > 0)
  3268. {
  3269. if (!dd.Rows[0]["SCRAP_NUM"].ToString().Equals(dd.Rows[0]["REASON_NUMBER"].ToString()))
  3270. {
  3271. MessageUtil.ShowTips("废品支数的登记与实绩保存的废品支数不一致,不允许结炉!");
  3272. return;
  3273. }
  3274. if (!dd.Rows[0]["SCRAP_NUM"].ToString().Equals(dd.Rows[0]["ACT_COUNT"].ToString()))
  3275. {
  3276. MessageUtil.ShowTips("废品支数的登记与实绩保存的废品支数不一致,不允许结炉!");
  3277. return;
  3278. }
  3279. }
  3280. if (PlineCode.Equals("C010"))
  3281. {
  3282. this.crackDetectionResult1.UltraGrid3.UpdateData();
  3283. milet = NativeMethod.GetUltraGridToEntityNEW(this.crackDetectionResult1.UltraGrid3, milet);
  3284. milet.JudgeStoveNo = JudgeStoveNo;
  3285. 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();
  3286. milet.ColUser = _UserName;
  3287. milet.ColGroup = UserInfo.GetUserGroup();
  3288. milet.ColShift = UserInfo.GetUserOrder();
  3289. milet.Userid = _UserID;
  3290. milet.ProPlanId = proPlanId;
  3291. milet.GxPlanNo = gxPlanNo;
  3292. milet.JudgeStoveNo = JudgeStoveNo;
  3293. milet.LotNo = lotNo;
  3294. milet.PlineCode = PlineCode;
  3295. count = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.UpdateETResultNodeNEW", new object[] { milet, Colno }, this.ob);
  3296. }
  3297. //if (TestMethod.Contains("漏磁"))
  3298. if (PlineCode.Equals("C009") || PlineCode.Equals("C008") || PlineCode.Equals("C017") || PlineCode.Equals("C072"))
  3299. {
  3300. milmt.Clear();
  3301. this.mtTestingResult1.UltraGrid3.UpdateData();
  3302. milmt = NativeMethod.GetUltraGridToEntityNEW(this.mtTestingResult1.UltraGrid3, milmt);
  3303. milmt.JudgeStoveNo = JudgeStoveNo;
  3304. //milmt.QaTon = (temp * int.Parse(milmt.QualifiedNum.ToString())).ToString();
  3305. 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();
  3306. milmt.ColUser = _UserName;
  3307. milmt.ColGroup = UserInfo.GetUserGroup();
  3308. milmt.ColShift = UserInfo.GetUserOrder();
  3309. milmt.Userid = _UserID;
  3310. milmt.ProPlanId = proPlanId;
  3311. milmt.GxPlanNo = gxPlanNo;
  3312. milmt.JudgeStoveNo = JudgeStoveNo;
  3313. milmt.LotNo = lotNo;
  3314. milmt.PlineCode = PlineCode;
  3315. count = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.UpdateMTResultNodeNEW", new object[] { milmt, Colno }, this.ob);
  3316. }
  3317. //if (TestMethod.Contains("超声波"))
  3318. if (PlineCode.Equals("C012"))
  3319. {
  3320. milul.Clear();
  3321. this.ulTestingResult1.UltraGrid3.UpdateData();
  3322. milul = NativeMethod.GetUltraGridToEntityNEW(this.ulTestingResult1.UltraGrid3, milul);
  3323. milul.JudgeStoveNo = JudgeStoveNo;
  3324. milul.QaTon = (temp * int.Parse(milul.QualifiedNum.ToString())).ToString();
  3325. milul.ColUser = _UserName;
  3326. milul.ColGroup = UserInfo.GetUserGroup();
  3327. milul.ColShift = UserInfo.GetUserOrder();
  3328. milul.ProPlanId = proPlanId;
  3329. milul.GxPlanNo = gxPlanNo;
  3330. milul.JudgeStoveNo = JudgeStoveNo;
  3331. milul.LotNo = lotNo;
  3332. milul.PlineCode = PlineCode;
  3333. count = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.UpdateUTResultNodeNEW", new object[] { milul, Colno }, this.ob);
  3334. }
  3335. if (count == 1)
  3336. {
  3337. //往跟踪记录表插入探伤开始时间
  3338. NativeMethodNew na = new NativeMethodNew(this.ob);
  3339. na.InsertSTAferDoubleClick(JudgeStoveNo, 8, "1", proPlanId, gxPlanNo);
  3340. NativeMethod.CheckNodeMatStatus(JudgeStoveNo, proPlanId, gxPlanNo, 8, this.ob);
  3341. //插入MIL_SLAB_SCRAP表
  3342. //int count1 = ServerHelper.SetData("com.steering.mes.zgmil.coup.FeedSawResult.scrapNodeMat", new object[] { JudgeStoveNo, 9, 0 }, this.ob);
  3343. ccp.ServerName = "com.steering.mes.zgmil.coup.EddyCurrentTestingResult";
  3344. ccp.MethodName = "assignmentMatNo";
  3345. ccp.ServerParams = new object[] { JudgeStoveNo, "9", PlineCode, proPlanId, gxPlanNo };
  3346. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  3347. if (ccp.ReturnCode != -1)
  3348. {
  3349. if (ccp.ReturnInfo.Equals("修改成功!"))
  3350. {
  3351. this.crackDetectionResult1.IsCellSelect = false;
  3352. this.mtTestingResult1.IsCellSelect = false;
  3353. this.ulTestingResult1.IsCellSelect = false;
  3354. string flag = "0";
  3355. //if (TestMethod.Contains("涡流"))
  3356. if (PlineCode.Equals("C010"))
  3357. {
  3358. flag = "1";
  3359. }
  3360. //if (TestMethod.Contains("漏磁"))
  3361. if (PlineCode.Equals("C009") || PlineCode.Equals("C008") || PlineCode.Equals("C017") || PlineCode.Equals("C072"))
  3362. {
  3363. flag = "2";
  3364. }
  3365. //if (TestMethod.Contains("超声波"))
  3366. if (PlineCode.Equals("C012"))
  3367. {
  3368. flag = "3";
  3369. }
  3370. //int ss = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.UpdateToTalNode", new object[] { JudgeStoveNo, flag }, this.ob);
  3371. //刷新主表
  3372. DataTable dt1 = new DataTable();
  3373. //if (TestMethod.Contains("涡流"))
  3374. if (PlineCode.Equals("C010"))
  3375. {
  3376. dt1 = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getSingleMainPlan", new object[] { QueryMainPlan, 9 }, this.ob);
  3377. }
  3378. //if (TestMethod.Contains("漏磁"))
  3379. if (PlineCode.Equals("C009") || PlineCode.Equals("C008") || PlineCode.Equals("C017") || PlineCode.Equals("C072"))
  3380. {
  3381. dt1 = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getSingleMainPlan", new object[] { QueryMainPlan, 11 }, this.ob);
  3382. }
  3383. //if (TestMethod.Contains("超声波"))
  3384. if (PlineCode.Equals("C012"))
  3385. {
  3386. dt1 = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getSingleMainPlan", new object[] { QueryMainPlan, 12 }, this.ob);
  3387. }
  3388. GridHelper.CopyDataToDatatable(ref dt1, ref dtPlan, true);
  3389. //ultraGridPlan.DisplayLayout.Bands[0].PerformAutoResizeColumns(true, PerformAutoSizeType.AllRowsInBand);
  3390. ChangeCellName();
  3391. ChangeGridColor();
  3392. foreach (UltraGridRow ugr1 in this.ultraGridPlan.Rows)
  3393. {
  3394. ugr1.Cells["JUDGE_NO"].Value = BaseMethod.getJudgeStoveNo(ugr1.Cells["JUDGE_STOVE_NO"].Value.ToString());
  3395. if (ugr1.Cells["JUDGE_STOVE_NO"].Value.ToString() == JudgeStoveNo)
  3396. {
  3397. ultraGridPlan.ActiveRow = ugr1;
  3398. }
  3399. }
  3400. MessageBox.Show("炉号【" + JudgeStoveNo + "】结炉完成。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  3401. milet.Clear();
  3402. milmt.Clear();
  3403. milul.Clear();
  3404. this.dataSet2.Clear();
  3405. }
  3406. else
  3407. {
  3408. MessageUtil.ShowTips(ccp.ReturnInfo);
  3409. }
  3410. }
  3411. else
  3412. {
  3413. MessageUtil.ShowTips(ccp.ReturnInfo);
  3414. }
  3415. }
  3416. }
  3417. else
  3418. {
  3419. MessageUtil.ShowTips(ccp.ReturnInfo);
  3420. }
  3421. }
  3422. else
  3423. {
  3424. MessageUtil.ShowTips(ccp.ReturnInfo);
  3425. }
  3426. }
  3427. }
  3428. }
  3429. }
  3430. /// <summary>
  3431. /// 查询仓库信息
  3432. /// </summary>
  3433. /// <param name="plineCode"></param>
  3434. /// <returns></returns>
  3435. private DataTable getStoreNo(string plineCode)
  3436. {
  3437. DataTable ds = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryStoreNo", new object[] { plineCode }, ob);
  3438. if (ds.Rows.Count > 0)
  3439. {
  3440. return ds;
  3441. }
  3442. else
  3443. {
  3444. return null;
  3445. }
  3446. }
  3447. /// <summary>
  3448. /// 结炉回退
  3449. /// </summary>
  3450. private void NodeBack()
  3451. {
  3452. if (this.ultraGridPlan.ActiveRow == null)
  3453. {
  3454. MessageBox.Show("请选择需要回退的炉号!!!");
  3455. return;
  3456. }
  3457. UltraGridRow ugr = ultraGridPlan.ActiveRow;
  3458. string JudgeStoveNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
  3459. string ResultNo = ugr.Cells["ID"].Value.ToString();
  3460. string NodeFlag = doQueryJugeNoStaus(ResultNo, JudgeStoveNo, PlineCode);
  3461. #region
  3462. if (NodeFlag != "1")
  3463. {
  3464. MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】未结炉,不能结炉回退!!!!");
  3465. return;
  3466. }
  3467. DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.doNodeBackCheck", new object[] { JudgeStoveNo, ResultNo, proPlanId, gxPlanNo }, this.ob);
  3468. if (dt.Rows.Count > 0)
  3469. {
  3470. string NodeProcess = ""; //当前炉次结炉工序
  3471. string NodeStatus = dt.Rows[0][0].ToString();
  3472. switch (NodeStatus)
  3473. {
  3474. case "30":
  3475. NodeProcess = "穿孔";
  3476. break;
  3477. case "40":
  3478. NodeProcess = "连轧";
  3479. break;
  3480. case "50":
  3481. NodeProcess = "再加热炉";
  3482. break;
  3483. case "60":
  3484. NodeProcess = "定径";
  3485. break;
  3486. case "70":
  3487. NodeProcess = "分切";
  3488. break;
  3489. case "80":
  3490. NodeProcess = "矫直";
  3491. break;
  3492. case "90":
  3493. NodeProcess = "探伤";
  3494. break;
  3495. case "96":
  3496. NodeProcess = "质检";
  3497. break;
  3498. }
  3499. if (int.Parse(NodeStatus) >= 96)
  3500. {
  3501. MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】后序工序已结炉,当前工序不能结炉回退");
  3502. return;
  3503. }
  3504. }
  3505. DataTable ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.selectBackLineNum", new object[] { ResultNo, JudgeStoveNo, proPlanId, gxPlanNo }, ob);
  3506. if (ds.Rows.Count > 0)
  3507. {
  3508. MessageUtil.ShowTips("存在返线支数,不能结炉回退!");
  3509. return;
  3510. }
  3511. DataTable dd = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.selectMilOfflineGroup", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, ob);
  3512. if (dd.Rows.Count > 0)
  3513. {
  3514. if (int.Parse(dd.Rows[0][0].ToString()) > 0)
  3515. {
  3516. MessageUtil.ShowTips("存在已组炉支数,不能结炉回退");
  3517. return;
  3518. }
  3519. }
  3520. ////判断当前炉次下道工序是否结炉 下道工序结炉 - 不允许回退
  3521. //int Seq = 0;
  3522. //DataTable dt2 = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.changeFlagQuery", new object[] { JudgeStoveNo, ResultNo, 8 }, this.ob);
  3523. //if (dt2.Rows.Count > 0)
  3524. //{
  3525. // Seq = int.Parse(dt2.Rows[0][0].ToString());
  3526. //}
  3527. //int count2 = ServerHelper.SetData("com.steering.mes.zgmil.coup.FeedSawResult.nodeBack", new object[] { JudgeStoveNo, ResultNo, 8, PlineCode, Seq, 0 }, this.ob);
  3528. #endregion
  3529. string Group = UserInfo.GetUserGroup();
  3530. string Shift = UserInfo.GetUserOrder();
  3531. DataTable dtMat = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmOffLine.doQueryMatScrap", new object[] { JudgeStoveNo, PlineCode, proPlanId, gxPlanNo }, this.ob);
  3532. if (dtMat.Rows.Count > 0)
  3533. {
  3534. if (int.Parse(dtMat.Rows[0][0].ToString()) > 0)
  3535. {
  3536. MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】的废品已发运,不能结炉回退!!!!");
  3537. return;
  3538. }
  3539. }
  3540. //查询结炉班次班组
  3541. DataTable dtNodeGroup = new DataTable();
  3542. //if (TestMethod.Contains("涡流"))
  3543. DataTable dW = ServerHelper.GetData("com.steering.mes.signature.FrmDownlineManage.doQueryEntust", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, ob);
  3544. if (dW.Rows.Count > 0)
  3545. {
  3546. MessageUtil.ShowTips("已进行外委加工,不允许结炉回退!");
  3547. return;
  3548. }
  3549. if (PlineCode.Equals("C010"))
  3550. {
  3551. dtNodeGroup = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.doNodeBackCheck", new object[] { JudgeStoveNo, ResultNo, 8, proPlanId, gxPlanNo }, this.ob);
  3552. }
  3553. //if (TestMethod.Contains("漏磁"))
  3554. if (PlineCode.Equals("C009") || PlineCode.Equals("C008") || PlineCode.Equals("C017") || PlineCode.Equals("C072"))
  3555. {
  3556. dtNodeGroup = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.doNodeBackCheck", new object[] { JudgeStoveNo, ResultNo, 9, proPlanId, gxPlanNo }, this.ob);
  3557. }
  3558. //if (TestMethod.Contains("超声波"))
  3559. if (PlineCode.Equals("C012"))
  3560. {
  3561. dtNodeGroup = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.doNodeBackCheck", new object[] { JudgeStoveNo, ResultNo, 10, proPlanId, gxPlanNo }, this.ob);
  3562. }
  3563. if (dtNodeGroup.Rows.Count > 0)
  3564. {
  3565. string NodeShift = dtNodeGroup.Rows[0][0].ToString();
  3566. string NodeGroup = dtNodeGroup.Rows[0][1].ToString();
  3567. if (Shift == NodeShift && Group == NodeGroup)
  3568. {
  3569. string plincode = this.PlineCode;
  3570. string resultno = this.ActiveResultNo;
  3571. string ColGroup = this.UserInfo.GetUserGroup();
  3572. string ColUser = this.UserInfo.GetUserName();
  3573. string ColShift = this.UserInfo.GetUserOrder();
  3574. CoreClientParam ccp = new CoreClientParam();
  3575. ccp.ServerName = "com.steering.mes.zgmil.coup.EddyCurrentTestingResult";
  3576. ccp.MethodName = "doDeleteMatData";
  3577. ccp.ServerParams = new object[] { JudgeStoveNo, proPlanId, gxPlanNo, plincode };
  3578. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  3579. if (ccp.ReturnCode != -1)
  3580. {
  3581. if (ccp.ReturnInfo.Equals("删除成功!"))
  3582. {
  3583. 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);
  3584. ChangeGridColor();
  3585. PlanQuery();
  3586. }
  3587. else
  3588. {
  3589. MessageUtil.ShowTips(ccp.ReturnInfo);
  3590. }
  3591. }
  3592. }
  3593. else
  3594. {
  3595. switch (NodeShift)
  3596. {
  3597. case "0":
  3598. NodeShift = "白班";
  3599. break;
  3600. case "1":
  3601. NodeShift = "早班";
  3602. break;
  3603. case "2":
  3604. NodeShift = "中班";
  3605. break;
  3606. case "3":
  3607. NodeShift = "夜班";
  3608. break;
  3609. }
  3610. switch (NodeGroup)
  3611. {
  3612. case "1":
  3613. NodeGroup = "甲班";
  3614. break;
  3615. case "2":
  3616. NodeGroup = "乙班";
  3617. break;
  3618. case "3":
  3619. NodeGroup = "丙班";
  3620. break;
  3621. case "4":
  3622. NodeGroup = "丁班";
  3623. break;
  3624. }
  3625. switch (this.UserInfo.GetUserOrder())
  3626. {
  3627. case "0":
  3628. Shift = "白班";
  3629. break;
  3630. case "1":
  3631. Shift = "早班";
  3632. break;
  3633. case "2":
  3634. Shift = "中班";
  3635. break;
  3636. case "3":
  3637. Shift = "夜班";
  3638. break;
  3639. }
  3640. switch (this.UserInfo.GetUserGroup())
  3641. {
  3642. case "1":
  3643. Group = "甲班";
  3644. break;
  3645. case "2":
  3646. Group = "乙班";
  3647. break;
  3648. case "3":
  3649. Group = "丙班";
  3650. break;
  3651. case "4":
  3652. Group = "丁班";
  3653. break;
  3654. }
  3655. MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】已由" + NodeGroup + "," + NodeShift + "结炉,当班不能结炉回退");
  3656. return;
  3657. }
  3658. }
  3659. }
  3660. /// <summary>
  3661. /// 操作台结炉后自动判断并整炉结炉
  3662. /// </summary>
  3663. /// <param name="heatno">炉号</param>
  3664. public bool NodeTotale(string heatno)
  3665. {
  3666. //-----数据验证(矫直过来的支数 等于探伤的支数)
  3667. DataTable dtcheck = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.NodeCheckNum", new object[] { ActiveJUDGE_STOVE_NO, ActiveResultNo, TestMethod }, this.ob);
  3668. UltraGridRow ugr1 = this.rollingCard1.UltraGrid4.Rows[0];
  3669. //int straightnum = int.Parse(string.IsNullOrEmpty(ugr1.Cells["QualifiedNum11"].Value.ToString()) ? "0" : ugr1.Cells["QualifiedNum11"].Value.ToString());
  3670. DataTable dtStenth = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.selectStraith", new object[] { heatno }, this.ob);
  3671. int straightnum = int.Parse(dtStenth.Rows[0]["QUALIFIED_NUM"].ToString3());
  3672. int testnum = 0;
  3673. int testnum1 = 0;
  3674. int testnum2 = 0;
  3675. int testnum3 = 0;
  3676. 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());
  3677. testnum1 = int.Parse(dtcheck.Rows[0]["DETECTION_NUM1"].ToString3());
  3678. testnum2 = int.Parse(dtcheck.Rows[0]["DETECTION_NUM2"].ToString3());
  3679. if (this.PlineCode.Equals("C010"))
  3680. {
  3681. testnum3 = int.Parse(dtcheck.Rows[0]["DETECTION_NUM3"].ToString3());
  3682. }
  3683. if (straightnum != testnum)
  3684. {
  3685. MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(ActiveJUDGE_STOVE_NO) + "】在您结炉后与矫直合格支数不匹配,请确认", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  3686. return false;
  3687. }
  3688. //----------
  3689. int result = 0;
  3690. int rack = 0;
  3691. //if (TestMethod.Contains("涡流"))
  3692. if (PlineCode.Equals("C010"))
  3693. {
  3694. DataTable dtETR = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.GetETResult", new object[] { heatno, proPlanId, gxPlanNo }, this.ob);
  3695. //if (testnum1 > 0)
  3696. //{
  3697. // if (!dtETR.Rows[0]["NODE_FUR_FLAG1"].ToString().Equals("1"))
  3698. // {
  3699. // MessageBox.Show("1#台未结炉结炉", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Information);
  3700. // return false;
  3701. // }
  3702. //}
  3703. //if (testnum2 > 0)
  3704. //{
  3705. // if (!dtETR.Rows[0]["NODE_FUR_FLAG2"].ToString().Equals("1"))
  3706. // {
  3707. // MessageBox.Show("2#台未结炉结炉", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Information);
  3708. // return false;
  3709. // }
  3710. //}
  3711. //if (testnum3 > 0)
  3712. //{
  3713. // if (!dtETR.Rows[0]["NODE_FUR_FLAG3"].ToString().Equals("1"))
  3714. // {
  3715. // MessageBox.Show("3#台未结炉结炉", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Information);
  3716. // return false;
  3717. // }
  3718. //}
  3719. //MessageBox.Show("所有操作台均已结炉", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Information);
  3720. int ss = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.UpdateToTalNode", new object[] { heatno, "1" }, this.ob);
  3721. }
  3722. //if (TestMethod.Contains("漏磁"))
  3723. if (PlineCode.Equals("C009") || PlineCode.Equals("C008") || PlineCode.Equals("C017") || PlineCode.Equals("C072"))
  3724. {
  3725. DataTable dtMTR = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.GetMTResult", new object[] { heatno, proPlanId, gxPlanNo }, this.ob);
  3726. //if (testnum1 > 0)
  3727. //{
  3728. // if (!dtMTR.Rows[0]["NODE_FUR_FLAG1"].ToString().Equals("1"))
  3729. // {
  3730. // MessageBox.Show("1#台未结炉结炉", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Information);
  3731. // return false;
  3732. // }
  3733. //}
  3734. //if (testnum2 > 0)
  3735. //{
  3736. // if (!dtMTR.Rows[0]["NODE_FUR_FLAG2"].ToString().Equals("1"))
  3737. // {
  3738. // MessageBox.Show("2#台未结炉结炉", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Information);
  3739. // return false;
  3740. // }
  3741. //}
  3742. //MessageBox.Show("所有操作台均已结炉", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Information);
  3743. int ss = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.UpdateToTalNode", new object[] { heatno, "2" }, this.ob);
  3744. }
  3745. //if (TestMethod.Contains("超声波"))
  3746. if (PlineCode.Equals("C012"))
  3747. {
  3748. DataTable dtUTR = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.GetUTResult", new object[] { heatno, proPlanId, gxPlanNo }, this.ob);
  3749. if (testnum1 > 0)
  3750. {
  3751. if (!dtUTR.Rows[0]["NODE_FUR_FLAG1"].ToString().Equals("1"))
  3752. {
  3753. MessageBox.Show("1#台未结炉结炉", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Information);
  3754. return false;
  3755. }
  3756. }
  3757. if (testnum2 > 0)
  3758. {
  3759. if (!dtUTR.Rows[0]["NODE_FUR_FLAG2"].ToString().Equals("1"))
  3760. {
  3761. MessageBox.Show("2#台未结炉结炉", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Information);
  3762. return false;
  3763. }
  3764. }
  3765. //MessageBox.Show("所有操作台均已结炉", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Information);
  3766. int ss = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.UpdateToTalNode", new object[] { heatno, "3" }, this.ob);
  3767. }
  3768. foreach (UltraGridRow ugr in ultraGridPlan.Rows)
  3769. {
  3770. ugr.Cells["JUDGE_NO"].Value = BaseMethod.getJudgeStoveNo(ugr.Cells["JUDGE_STOVE_NO"].Value.ToString());
  3771. }
  3772. return true;
  3773. }
  3774. /// <summary>
  3775. /// 获取每个台探伤的来料支数
  3776. /// </summary>
  3777. /// <param name="heat"></param>
  3778. /// <returns></returns>
  3779. public int GetDETECTION_NUM(string heat)
  3780. {
  3781. int result = 0;
  3782. string flag = "";
  3783. if (TestMethod.Contains("1"))
  3784. {
  3785. flag = "1";
  3786. }
  3787. if (TestMethod.Contains("2"))
  3788. {
  3789. flag = "2";
  3790. }
  3791. if (TestMethod.Contains("3"))
  3792. {
  3793. flag = "3";
  3794. }
  3795. DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.GetDETECTION_NUM", new object[] { heat, flag }, this.ob);
  3796. if (dt.Rows.Count > 0)
  3797. {
  3798. result = int.Parse(dt.Rows[0]["counts"].ToString());
  3799. }
  3800. return result;
  3801. }
  3802. /// <summary>
  3803. /// 判断主表点击前是否保存实绩
  3804. /// </summary>
  3805. /// <param name="sender"></param>
  3806. /// <param name="e"></param>
  3807. /// <summary>
  3808. /// 计划表ROW点击变换判断
  3809. /// </summary>
  3810. private void ultraGridPlan_BeforeRowActivate(object sender, RowEventArgs e)
  3811. {
  3812. if (this.crackDetectionResult1.IsCellSelect == true)
  3813. {
  3814. if (ActiveStatus != "已开始探伤")
  3815. {
  3816. this.crackDetectionResult1.IsCellSelect = false;
  3817. // MessageBox.Show("警告:炉号:" + ActiveJUDGE_STOVE_NO + "未开始探伤,不允许保存探伤实绩", "提示", MessageBoxButtons.OK);
  3818. return;
  3819. }
  3820. //if (MessageBox.Show("提示:探伤实绩可能已修改,是否保存", "提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
  3821. //{
  3822. this.crackDetectionResult1.IsCellSelect = false;
  3823. //保存探伤实绩
  3824. //ETResultSave();
  3825. //}
  3826. //else
  3827. //{
  3828. this.crackDetectionResult1.IsCellSelect = false;
  3829. foreach (UltraGridRow ugr in this.ultraGridPlan.Rows)
  3830. {
  3831. if (ugr.Cells["JUDGE_STOVE_NO"].Value.ToString() == ActiveJUDGE_STOVE_NO)
  3832. {
  3833. this.ultraGridPlan.ActiveRow = ugr;
  3834. }
  3835. }
  3836. return;
  3837. //}
  3838. }
  3839. if (this.mtTestingResult1.IsCellSelect == true)
  3840. {
  3841. if (ActiveStatus != "已开始探伤")
  3842. {
  3843. this.mtTestingResult1.IsCellSelect = false;
  3844. // MessageBox.Show("警告:炉号:" + ActiveJUDGE_STOVE_NO + "未开始探伤,不允许保存探伤实绩", "提示", MessageBoxButtons.OK);
  3845. return;
  3846. }
  3847. //if (MessageBox.Show("提示:探伤实绩可能已修改,是否保存", "提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
  3848. //{
  3849. this.mtTestingResult1.IsCellSelect = false;
  3850. //保存探伤实绩
  3851. // ETResultSave();
  3852. //}
  3853. //else
  3854. //{
  3855. this.mtTestingResult1.IsCellSelect = false;
  3856. foreach (UltraGridRow ugr in this.ultraGridPlan.Rows)
  3857. {
  3858. if (ugr.Cells["JUDGE_STOVE_NO"].Value.ToString() == ActiveJUDGE_STOVE_NO)
  3859. {
  3860. this.ultraGridPlan.ActiveRow = ugr;
  3861. }
  3862. }
  3863. return;
  3864. //}
  3865. }
  3866. if (this.ulTestingResult1.IsCellSelect == true)
  3867. {
  3868. if (ActiveStatus != "已开始探伤")
  3869. {
  3870. this.ulTestingResult1.IsCellSelect = false;
  3871. // MessageBox.Show("警告:炉号:" + ActiveJUDGE_STOVE_NO + "未开始探伤,不允许保存探伤实绩", "提示", MessageBoxButtons.OK);
  3872. return;
  3873. }
  3874. //if (MessageBox.Show("提示:探伤实绩可能已修改,是否保存", "提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
  3875. //{
  3876. this.ulTestingResult1.IsCellSelect = false;
  3877. //保存探伤实绩
  3878. //ETResultSave();
  3879. //}
  3880. //else
  3881. //{
  3882. this.ulTestingResult1.IsCellSelect = false;
  3883. foreach (UltraGridRow ugr in this.ultraGridPlan.Rows)
  3884. {
  3885. if (ugr.Cells["JUDGE_STOVE_NO"].Value.ToString() == ActiveJUDGE_STOVE_NO)
  3886. {
  3887. this.ultraGridPlan.ActiveRow = ugr;
  3888. }
  3889. }
  3890. return;
  3891. //}
  3892. }
  3893. }
  3894. /// <summary>
  3895. /// 查询结炉实绩
  3896. /// </summary>
  3897. public void NodeQuery()
  3898. {
  3899. string Shift = UserInfo.GetUserOrder();
  3900. string Group = UserInfo.GetUserGroup();
  3901. string PliceCode = PlineCode;
  3902. string StartTime = DateTime.Now.ToString("yyyy-MM-dd");
  3903. string EndTime = DateTime.Now.AddDays(1).ToString("yyyy-MM-dd");
  3904. string Date = StartTime;
  3905. StartTime = StartTime + " 00:00:00";
  3906. EndTime = EndTime + " 00:00:00";
  3907. //if (TestMethod.Contains("涡流"))
  3908. if (PlineCode.Equals("C010"))
  3909. {
  3910. DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.GetETResultNodeQuery", new object[] { PliceCode, Shift, Group, StartTime, EndTime }, this.ob);
  3911. FrmNodeResultQuery frm = new FrmNodeResultQuery(dt, 7, Date, Shift, Group, this.ob);
  3912. frm.ShowDialog();
  3913. }
  3914. //if (TestMethod.Contains("漏磁"))
  3915. if (PlineCode.Equals("C009") || PlineCode.Equals("C008") || PlineCode.Equals("C017") || PlineCode.Equals("C072"))
  3916. {
  3917. DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.GetMTResultNodeQuery", new object[] { PliceCode, Shift, Group, StartTime, EndTime }, this.ob);
  3918. FrmNodeResultQuery frm = new FrmNodeResultQuery(dt, 11, Date, Shift, Group, this.ob);
  3919. frm.ShowDialog();
  3920. }
  3921. //if (TestMethod.Contains("超声波"))
  3922. if (PlineCode.Equals("C012"))
  3923. {
  3924. DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.GetUTResultNodeQuery", new object[] { PliceCode, Shift, Group, StartTime, EndTime }, this.ob);
  3925. FrmNodeResultQuery frm = new FrmNodeResultQuery(dt, 12, Date, Shift, Group, this.ob);
  3926. frm.ShowDialog();
  3927. }
  3928. }
  3929. /// <summary>
  3930. /// 未探离线
  3931. /// </summary>
  3932. public void Offline()
  3933. {
  3934. if (alarmFlag == true)
  3935. {
  3936. MessageUtil.ShowTips("登记了缺陷项,请先保存实绩!");
  3937. return;
  3938. }
  3939. DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.GetMIL_STRAIGHTENING_RESULT", new object[] { ActiveJUDGE_STOVE_NO, proPlanId, gxPlanNo }, this.ob);
  3940. if (dt.Rows.Count == 0)
  3941. {
  3942. MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(ActiveJUDGE_STOVE_NO) + "】还未开始矫直,不能下线!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  3943. return;
  3944. }
  3945. if (string.IsNullOrEmpty(dt.Rows[0]["NODE_FUR_FLAG"].ToString()))
  3946. {
  3947. MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(ActiveJUDGE_STOVE_NO) + "】还未开始矫直,不能下线!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  3948. return;
  3949. }
  3950. if (dt.Rows[0]["NODE_FUR_FLAG"].ToString() != "1")//
  3951. {
  3952. MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(ActiveJUDGE_STOVE_NO) + "】还未矫直完成,不能下线!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  3953. return;
  3954. }
  3955. //工序状态:01-矫直1#,02-矫直2#,03-矫直3#,11-ET探伤,12-MT探伤,13-UT探伤
  3956. string Node = offlinenode;
  3957. //Node = Node + Colno;
  3958. beforeQualifiedNum = this.rollingCard1.Value.StraightQualifiedNum;
  3959. qualifiedNum = string.IsNullOrEmpty(this.rollingCard1.Value.TestingQualifiedNum) ? "0" : this.rollingCard1.Value.TestingQualifiedNum;
  3960. scrapNum = string.IsNullOrEmpty(this.rollingCard1.Value.TestingScrapNum) ? "0" : this.rollingCard1.Value.TestingScrapNum;
  3961. offineHas = string.IsNullOrEmpty(this.rollingCard1.Value.OfflineTesting) ? "0" : this.rollingCard1.Value.OfflineTesting;
  3962. offineHead = string.IsNullOrEmpty(this.rollingCard1.Value.BacklineTesting) ? "0" : this.rollingCard1.Value.BacklineTesting;
  3963. string numb = (int.Parse(beforeQualifiedNum.ToString3()) - int.Parse(qualifiedNum.ToString3()) - int.Parse(scrapNum.ToString3()) - int.Parse(offineHas.ToString3()) + int.Parse(offineHead.ToString3())).ToString();
  3964. FrmOffLineOperation frm = new FrmOffLineOperation("TS", this.ob, PlineCode, this.ActiveJUDGE_STOVE_NO, this.lotno, numb, proPlanId, gxPlanNo);
  3965. frm.ShowDialog();
  3966. PlanQuery();
  3967. }
  3968. public void BackLine()
  3969. {
  3970. //工序状态:01-矫直1#,02-矫直2#,03-矫直3#,11-ET探伤,12-MT探伤,13-UT探伤
  3971. string Node = offlinenode;
  3972. Node = Node + Colno;
  3973. DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmBackLine.GetOfflineResult", new object[] { "1" }, this.ob);
  3974. if (dt.Rows.Count > 0)
  3975. {
  3976. BackLineOperate frm = new BackLineOperate(Node, this.ob, PlineCode, stoveno, lotno);
  3977. frm.ShowDialog();
  3978. PlanQuery();
  3979. }
  3980. else
  3981. {
  3982. MessageBox.Show("未查询到可返线实绩", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  3983. }
  3984. }
  3985. public void colchang()
  3986. {
  3987. if (string.IsNullOrEmpty(ActiveJUDGE_STOVE_NO))
  3988. {
  3989. MessageBox.Show("您未选择任何住计划,不允许执行子管换台操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  3990. return;
  3991. }
  3992. DataTable dtFlag = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.GetQueryNodefurresult", new object[] { ActiveJUDGE_STOVE_NO }, this.ob);
  3993. if (dtFlag.Rows.Count == 0)
  3994. {
  3995. MessageBox.Show("炉号:【" + BaseMethod.getJudgeStoveNo(ActiveJUDGE_STOVE_NO) + "】尚开始矫直,不允许进行子管换台操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  3996. return;
  3997. }
  3998. if (string.IsNullOrEmpty(dtFlag.Rows[0]["NODE_FUR_FLAG"].ToString()))
  3999. {
  4000. MessageBox.Show("炉号:【" + BaseMethod.getJudgeStoveNo(ActiveJUDGE_STOVE_NO) + "】尚开始矫直,不允许进行子管换台操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  4001. return;
  4002. }
  4003. if (!dtFlag.Rows[0]["NODE_FUR_FLAG"].ToString().Equals("1"))
  4004. {
  4005. MessageBox.Show("炉号:【" + BaseMethod.getJudgeStoveNo(ActiveJUDGE_STOVE_NO) + "】在矫直工序尚未结炉,不允许进行子管换台操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  4006. return;
  4007. }
  4008. DataTable dt = new DataTable();
  4009. if (this.offlinenode.Equals("11"))
  4010. {
  4011. dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.GetETResult", new object[] { ActiveJUDGE_STOVE_NO, proPlanId, gxPlanNo }, this.ob);
  4012. }
  4013. if (this.offlinenode.Equals("12"))
  4014. {
  4015. dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.GetMTResult", new object[] { ActiveJUDGE_STOVE_NO, proPlanId, gxPlanNo }, this.ob);
  4016. }
  4017. if (this.offlinenode.Equals("13"))
  4018. {
  4019. dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.GetUTResult", new object[] { ActiveJUDGE_STOVE_NO, proPlanId, gxPlanNo }, this.ob);
  4020. }
  4021. if (dt.Rows.Count == 0)
  4022. {
  4023. MessageBox.Show("炉号:【" + BaseMethod.getJudgeStoveNo(ActiveJUDGE_STOVE_NO) + "】尚开始探伤,不允许进行子管换台操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  4024. return;
  4025. }
  4026. if (string.IsNullOrEmpty(dt.Rows[0]["NODE_FUR_FLAG"].ToString()))
  4027. {
  4028. MessageBox.Show("炉号:【" + BaseMethod.getJudgeStoveNo(ActiveJUDGE_STOVE_NO) + "】尚开始探伤,不允许进行子管换台操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  4029. return;
  4030. }
  4031. if (dt.Rows[0]["NODE_FUR_FLAG"].ToString().Equals("1"))
  4032. {
  4033. MessageBox.Show("炉号:【" + BaseMethod.getJudgeStoveNo(ActiveJUDGE_STOVE_NO) + "】在已完成探伤,不允许进行子管换台操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  4034. return;
  4035. }
  4036. ColNoChanges col = new ColNoChanges(this.ob, "10", ActiveJUDGE_STOVE_NO, PlineCode, proPlanId, gxPlanNo);
  4037. col.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
  4038. if (col.ShowDialog() == DialogResult.OK)
  4039. {
  4040. GetMILTestingRack(ActiveJUDGE_STOVE_NO);
  4041. ChangeGridColor();
  4042. }
  4043. }
  4044. private void ChangeShiftBack()
  4045. {
  4046. if (string.IsNullOrEmpty(this.ActiveJUDGE_STOVE_NO))
  4047. {
  4048. MessageBox.Show("您未选择任何计划,不允许进行交班回退操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  4049. return;
  4050. }
  4051. UltraGridRow ugr_plan = this.ultraGridPlan.ActiveRow;
  4052. string Status = ugr_plan.Cells["IS_START"].Value.ToString();
  4053. if (Status == "已完成探伤")
  4054. {
  4055. MessageBox.Show("炉号:【" + ActiveJUDGE_STOVE_NO + "】已完成探伤操作,不允许进行交班取消!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  4056. return;
  4057. }
  4058. if (Status == "未开始探伤")
  4059. {
  4060. MessageBox.Show("炉号:【" + ActiveJUDGE_STOVE_NO + "】未开始探伤操作,不允许进行交班取消!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  4061. return;
  4062. }
  4063. string Shift = UserInfo.GetUserOrder();
  4064. string Group = UserInfo.GetUserGroup();
  4065. NativeMethodNew na = new NativeMethodNew(this.ob);
  4066. 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))
  4067. {
  4068. int count = na.ChangeShiftBack(this.ActiveJUDGE_STOVE_NO, this.ActiveResultNo, this.PlineCode, Shift, Group, 8, this.Colno, proPlanId, gxPlanNo);
  4069. if (this.Colno.Equals("1"))
  4070. {
  4071. this.ultraTestRack1.DisplayLayout.Bands[0].Columns["SEQ"].SortIndicator = SortIndicator.None;
  4072. }
  4073. if (this.Colno.Equals("2"))
  4074. {
  4075. this.ultraTestRack1.DisplayLayout.Bands[0].Columns["SEQ"].SortIndicator = SortIndicator.None;
  4076. }
  4077. if (this.Colno.Equals("3"))
  4078. {
  4079. this.ultraTestRack1.DisplayLayout.Bands[0].Columns["SEQ"].SortIndicator = SortIndicator.None;
  4080. }
  4081. //na.ChangeShiftBack(this.ActiveJUDGE_STOVE_NO, this.ActiveResultNo, this.PlineCode, Shift, Group, 8, "2");
  4082. //if (this.PlineCode.Equals("C010"))
  4083. //{
  4084. // na.ChangeShiftBack(this.ActiveJUDGE_STOVE_NO, this.ActiveResultNo, this.PlineCode, Shift, Group, 8, "3");
  4085. //}
  4086. if (count < 1)
  4087. {
  4088. //MessageBox.Show("交班回退失败, 请确认后重新操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  4089. }
  4090. }
  4091. else
  4092. {
  4093. switch (Shift)
  4094. {
  4095. case "1":
  4096. Shift = "早班";
  4097. break;
  4098. case "2":
  4099. Shift = "中班";
  4100. break;
  4101. case "3":
  4102. Shift = "夜班";
  4103. break;
  4104. }
  4105. switch (Group)
  4106. {
  4107. case "1":
  4108. Group = "甲班";
  4109. break;
  4110. case "2":
  4111. Group = "乙班";
  4112. break;
  4113. case "3":
  4114. Group = "丙班";
  4115. break;
  4116. case "4":
  4117. Group = "丁班";
  4118. break;
  4119. }
  4120. MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(ActiveJUDGE_STOVE_NO) + "】未在" + Group + "," + Shift + "进行交班操作,不允许进行交班取消操作");
  4121. return;
  4122. }
  4123. GetMILETResult(ActiveJUDGE_STOVE_NO);
  4124. GetMILTestingRack(ActiveJUDGE_STOVE_NO);
  4125. ChangeGridColor();
  4126. }
  4127. private void PrintResult()
  4128. {
  4129. DateTime SeverTime = NativeMethod.GetSeverTime(this.ob);
  4130. string Time = SeverTime.ToLongTimeString();
  4131. string StartTime = "";
  4132. string EndTime = "";
  4133. string strurl = "";
  4134. switch (PlineCode)
  4135. {
  4136. case "C008": //250
  4137. //晚班
  4138. Time = Time.Replace(":", "");
  4139. if (int.Parse(Time) < 070000)
  4140. {
  4141. StartTime = SeverTime.AddDays(-1).ToShortDateString() + " 07:00:00";
  4142. EndTime = SeverTime.ToShortDateString() + " 07:00:00";
  4143. string Date2 = SeverTime.ToString("yyyy-MM-dd");
  4144. 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;
  4145. }
  4146. else
  4147. {
  4148. StartTime = SeverTime.ToShortDateString() + " 07:00:00";
  4149. EndTime = SeverTime.AddDays(1).ToShortDateString() + " 07:00:00";
  4150. 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;
  4151. }
  4152. break;
  4153. case "C009": //258
  4154. //晚班
  4155. Time = Time.Replace(":", "");
  4156. if (int.Parse(Time) < 070000)
  4157. {
  4158. StartTime = SeverTime.AddDays(-1).ToShortDateString() + " 07:00:00";
  4159. EndTime = SeverTime.ToShortDateString() + " 07:00:00";
  4160. string Date2 = SeverTime.ToString("yyyy-MM-dd");
  4161. 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;
  4162. }
  4163. else
  4164. {
  4165. StartTime = SeverTime.ToShortDateString() + " 07:00:00";
  4166. EndTime = SeverTime.AddDays(1).ToShortDateString() + " 07:00:00";
  4167. 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;
  4168. }
  4169. break;
  4170. case "C010": //168
  4171. //晚班
  4172. Time = Time.Replace(":", "");
  4173. if (int.Parse(Time) < 070000)
  4174. {
  4175. StartTime = SeverTime.AddDays(-1).ToShortDateString() + " 07:00:00";
  4176. EndTime = SeverTime.ToShortDateString() + " 07:00:00";
  4177. string Date2 = SeverTime.ToString("yyyy-MM-dd");
  4178. 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;
  4179. }
  4180. else
  4181. {
  4182. StartTime = SeverTime.ToShortDateString() + " 07:00:00";
  4183. EndTime = SeverTime.AddDays(1).ToShortDateString() + " 07:00:00";
  4184. 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;
  4185. }
  4186. break;
  4187. case "C012": //Arssel
  4188. break;
  4189. case "C017": //460
  4190. //晚班
  4191. Time = Time.Replace(":", "");
  4192. if (int.Parse(Time) < 070000)
  4193. {
  4194. StartTime = SeverTime.AddDays(-1).ToShortDateString() + " 07:00:00";
  4195. EndTime = SeverTime.ToShortDateString() + " 07:00:00";
  4196. string Date2 = SeverTime.ToString("yyyy-MM-dd");
  4197. 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;
  4198. }
  4199. else
  4200. {
  4201. StartTime = SeverTime.ToShortDateString() + " 07:00:00";
  4202. EndTime = SeverTime.AddDays(1).ToShortDateString() + " 07:00:00";
  4203. 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;
  4204. }
  4205. break;
  4206. case "C072": //508
  4207. //晚班
  4208. Time = Time.Replace(":", "");
  4209. if (int.Parse(Time) < 070000)
  4210. {
  4211. StartTime = SeverTime.AddDays(-1).ToShortDateString() + " 07:00:00";
  4212. EndTime = SeverTime.ToShortDateString() + " 07:00:00";
  4213. string Date2 = SeverTime.ToString("yyyy-MM-dd");
  4214. 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;
  4215. }
  4216. else
  4217. {
  4218. StartTime = SeverTime.ToShortDateString() + " 07:00:00";
  4219. EndTime = SeverTime.AddDays(1).ToShortDateString() + " 07:00:00";
  4220. 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;
  4221. }
  4222. break;
  4223. }
  4224. FrmExcel fre = new FrmExcel(this.ob, strurl);
  4225. //FrmRepExcel fre = new FrmRepExcel(ob, strurl);
  4226. fre.AutoSize = true;
  4227. fre.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
  4228. fre.WindowState = FormWindowState.Maximized;
  4229. fre.Show();
  4230. }
  4231. /// <summary>
  4232. /// 探伤报告
  4233. /// </summary>
  4234. private void PrintReport()
  4235. {
  4236. if (this.ultraGridPlan.ActiveRow == null)
  4237. {
  4238. MessageBox.Show("您未选择任何计划,不允许进行报表打印", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  4239. return;
  4240. }
  4241. string heatno = this.ActiveJUDGE_STOVE_NO;
  4242. string Shift = UserInfo.GetUserOrder();
  4243. string Group = UserInfo.GetUserGroup();
  4244. string url = "";
  4245. switch (PlineCode)
  4246. {
  4247. case "C008": //250
  4248. // url = "http://localhost:8075/WebReport/ReportServer?reportlet=RepMilInspectionTestReport250New1.cpt&format=pdf&JUDGE_STOVE_NO=" + heatno + "&COL_GROUP=" + Group + "&COL_SHIFT=" + Shift;
  4249. 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;
  4250. break;
  4251. case "C009": //258
  4252. 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;
  4253. break;
  4254. case "C010": //168
  4255. 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;
  4256. break;
  4257. case "C012": //Arssel
  4258. break;
  4259. case "C017": //460
  4260. 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;
  4261. break;
  4262. case "C072": //508
  4263. url = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilInspectionTestReport508.cpt&JUDGE_STOVE_NO=" + heatno + "&COL_GROUP=" + Group + "&COL_SHIFT=" + Shift;
  4264. break;
  4265. }
  4266. FrmExcel fre = new FrmExcel(this.ob, url);
  4267. //FrmRepExcel fre = new FrmRepExcel(ob, strurl);
  4268. fre.AutoSize = true;
  4269. fre.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
  4270. fre.WindowState = FormWindowState.Maximized;
  4271. fre.Show();
  4272. }
  4273. /// <summary>
  4274. /// 探伤报告(认证)
  4275. /// </summary>
  4276. private void PrintReportRZ()
  4277. {
  4278. if (this.ultraGridPlan.ActiveRow == null)
  4279. {
  4280. MessageBox.Show("您未选择任何计划,不允许进行报表打印", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  4281. return;
  4282. }
  4283. string heatno = this.ActiveJUDGE_STOVE_NO;
  4284. string Shift = UserInfo.GetUserOrder();
  4285. string Group = UserInfo.GetUserGroup();
  4286. string url = "";
  4287. switch (PlineCode)
  4288. {
  4289. case "C072": //508
  4290. url = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilInspectionTestReport508TH.cpt&JUDGE_STOVE_NO=" + heatno + "&COL_GROUP=" + Group + "&COL_SHIFT=" + Shift;
  4291. break;
  4292. }
  4293. FrmExcel fre = new FrmExcel(this.ob, url);
  4294. fre.AutoSize = true;
  4295. fre.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
  4296. fre.WindowState = FormWindowState.Maximized;
  4297. fre.Show();
  4298. }
  4299. private void FrmEddyCurrentTestingResult_KeyDown(object sender, KeyEventArgs e)
  4300. {
  4301. if (e.KeyCode == Keys.Enter)
  4302. {
  4303. PlanQuery();
  4304. }
  4305. }
  4306. private void ultraTestRack1_ClickCellButton(object sender, CellEventArgs e)
  4307. {
  4308. UltraGridRow ugr_pian = ultraGridPlan.ActiveRow;
  4309. string HeatNo = ugr_pian.Cells["JUDGE_STOVE_NO"].Value.ToString();
  4310. UltraGridRow ugr_testingrack = ultraTestRack1.ActiveRow;
  4311. string offline = ugr_testingrack.Cells["OFFLINE_FLAG"].Value.ToString();
  4312. MilPlan milpian = new MilPlan();
  4313. string SEQ = ugr_testingrack.Cells["SEQ"].Value.ToString();
  4314. int sql1 = int.Parse(SEQ);
  4315. string MatStatus = ugr_testingrack.Cells["STATUS"].Value.ToString();
  4316. // UltraGridRow ugr = this.ultraTestRack1.ActiveRow;
  4317. HOTMethod hm = new HOTMethod(this.ob);
  4318. NativeMethodNew na = new NativeMethodNew(this.ob);
  4319. string plinCode = na.GetPCode(this.UserInfo.GetDepartment());
  4320. int Seq = int.Parse(ugr_testingrack.Cells["SEQ"].Value.ToString());
  4321. string JudgeStoveNo = ugr_testingrack.Cells["JUDGE_STOVE_NO"].Value.ToString();
  4322. string ResultNo = ugr_pian.Cells["ID"].Value.ToString();
  4323. string shif = ugr_testingrack.Cells["COL_SHIFT"].Value.ToString2();
  4324. string group = ugr_testingrack.Cells["COL_GROUP"].Value.ToString2();
  4325. //判废管坯序号类
  4326. //MilSlabScrapSeqEntity ScrapSlab = new MilSlabScrapSeqEntity();
  4327. //string reflag = "0";
  4328. //int countss = 0;
  4329. //string flag = "0";
  4330. //if (TestMethod.Contains("涡流"))
  4331. //{
  4332. // flag = "1";
  4333. //}
  4334. //if (TestMethod.Contains("漏磁"))
  4335. //{
  4336. // flag = "2";
  4337. //}
  4338. //if (TestMethod.Contains("超声波"))
  4339. //{
  4340. // flag = "3";
  4341. //}
  4342. //DataTable dtnodeflag = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.GetTSNodeFlagColno", new object[] { HeatNo, int.Parse(flag), int.Parse(Colno) }, this.ob);
  4343. //if (dtnodeflag.Rows.Count > 0)
  4344. //{
  4345. // if (dtnodeflag.Rows[0]["NODEFLAG"].ToString().Equals("1"))
  4346. // {
  4347. // MessageBox.Show("探伤操作台【" + this.Colno + "】#台已完成探伤操作,不允许进行管号队列操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  4348. // return;
  4349. // }
  4350. //}
  4351. //else
  4352. //{
  4353. // MessageBox.Show("炉号【" + HeatNo + "】未开始探伤,不允许进行管号队列操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  4354. // return;
  4355. //}
  4356. //if (ActiveStatus == "已完成探伤")
  4357. //{
  4358. // MessageBox.Show("炉号:【" + BaseMethod.getJudgeStoveNo(HeatNo) + "】已完成探伤操作,不允许进行判废操作!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  4359. // return;
  4360. //}
  4361. //if (ActiveOFFLINE_FLAG.Equals("2"))
  4362. //{
  4363. // if (!offline.Equals("返线"))
  4364. // {
  4365. // MessageBox.Show("当前为矫直返线,只允许对下线状态为返线的子管进行操作,", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  4366. // return;
  4367. // }
  4368. //}
  4369. ////Shift = UserInfo.GetUserOrder();
  4370. ////Group = UserInfo.GetUserGroup();
  4371. //NativeMethodNew nasssss = new NativeMethodNew(this.ob);
  4372. //if (nasssss.IsRackOperate(shif, group))
  4373. //{
  4374. // MessageBox.Show("序号:【" + SEQ + "】子管已由" + shif + "," + group + "操作,不允许再进行操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  4375. // return;
  4376. //}
  4377. ////判废
  4378. //if (e.Cell.Column.Key == "SCRAP_SLAB")
  4379. //{
  4380. // if (ugr_testingrack.Cells["STATUS"].Value.ToString() == "判废")
  4381. // {
  4382. // MessageBox.Show("坯料已被判废不能再次判废!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  4383. // return;
  4384. // }
  4385. // if (ugr_pian.Cells["IS_START"].Value.ToString() != "已开始探伤")
  4386. // {
  4387. // MessageBox.Show("炉号:【" + ugr_pian.Cells["JUDGE_STOVE_NO"].Value.ToString().Replace("-.*", "") + "】的坯料未开始探伤,请检查确认后再判废", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  4388. // return;
  4389. // }
  4390. // int ScrapNumBefore = 0;
  4391. // DataTable dtcountaftersaw = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.scrapMatCheckAfterSaw", new object[] { HeatNo, 10, "1" }, this.ob);
  4392. // ScrapNumBefore = int.Parse(dtcountaftersaw.Rows[0]["Countss"].ToString());
  4393. // DataTable dtcount = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.GetRackCounts", new object[] { HeatNo, sql1, "1" }, this.ob);
  4394. // if (dtcount.Rows.Count > 0)
  4395. // {
  4396. // countss = int.Parse(dtcount.Rows[0]["COUNTSS"].ToString());
  4397. // }
  4398. // if (this.ultraTestRack1.Rows.Count - (countss + 1) < ScrapNumBefore)
  4399. // {
  4400. // MessageBox.Show("不存在序号为【" + sql1 + "】的管号,可能是被前道工序判废,不能再次判废!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  4401. // return;
  4402. // }
  4403. // //if (MessageUtil.ShowYesNoAndQuestion("是否判废该子管") == DialogResult.No)
  4404. // //{
  4405. // // return;
  4406. // //}
  4407. // if (string.IsNullOrEmpty(ugr_testingrack.Cells["SCRAP_REASON"].Value.ToString2()))
  4408. // {
  4409. // MessageBox.Show("请选择判废原因后再进行判废操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  4410. // return;
  4411. // }
  4412. // ScrapSlab.JudgeStoveNo = ugr_pian.Cells["JUDGE_STOVE_NO"].Value.ToString();
  4413. // ScrapSlab.Seq = ugr_testingrack.Cells["SEQ"].Value.ToString();
  4414. // ScrapSlab.ScrapReason = ugr_testingrack.Cells["SCRAP_REASON"].Value.ToString();
  4415. // ScrapSlab.ProcessNo = "10";
  4416. // ScrapSlab.Flag = "0";
  4417. // ScrapSlab.ColMode = "1";
  4418. // ScrapSlab.ColUser = UserInfo.GetUserName();
  4419. // ScrapSlab.ColGroup = UserInfo.GetUserGroup();
  4420. // ScrapSlab.ColShift = UserInfo.GetUserOrder();
  4421. // ScrapSlab.ColNo = "1";
  4422. // if (ugr_testingrack.Cells["STATUS"].Value.ToString() == "报警")
  4423. // {
  4424. // //报警的话则修改复探合格支数
  4425. // int re = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.scrapREINSPECTION", new object[] { HeatNo, flag, Colno }, this.ob);
  4426. // }
  4427. // //剔管操作,:1、插入MIL_SLAB_SCRAP_SEQ表,2、探伤跟踪记录表状态,3、修改加探伤实绩表判废支数
  4428. // int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.scrapInspectionMat", new Object[] { ScrapSlab, flag, Colno }, this.ob);
  4429. // //int ScrapNum = 0;
  4430. // //if (string.IsNullOrEmpty(this.crackDetectionResult1.TestingDataSource1.Rows[0]["ScrapNum"].ToString()) || this.crackDetectionResult1.TestingDataSource1.Rows[0]["ScrapNum"].ToString() == "0")
  4431. // //{
  4432. // // ScrapNum = 1;
  4433. // //}
  4434. // //else
  4435. // //{
  4436. // // ScrapNum = int.Parse(this.crackDetectionResult1.TestingDataSource1.Rows[0]["ScrapNum"].ToString()) + count;
  4437. // //}
  4438. // //crackDetectionResult1.milet.ScrapNum = ScrapNum.ToString();
  4439. // //crackDetectionResult1.UpdateData();//探伤实绩卡重新赋值,
  4440. // //this.GetMILTestingRack(this.ultraGridPlan.ActiveRow.Cells["JUDGE_STOVE_NO"].Value.ToString());
  4441. // //MessageBox.Show("管序号【" + SEQ + "】判废成功!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  4442. //}
  4443. ////复探
  4444. //if (e.Cell.Column.Key == "ReInspection")
  4445. //{
  4446. // int ScrapNumBefore = 0;
  4447. // DataTable dtcountaftersaw = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.scrapMatCheckAfterSaw", new object[] { HeatNo, 10, "1" }, this.ob);
  4448. // ScrapNumBefore = int.Parse(dtcountaftersaw.Rows[0]["Countss"].ToString());
  4449. // DataTable dtcount = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.GetRackCounts", new object[] { HeatNo, sql1, "1" }, this.ob);
  4450. // if (dtcount.Rows.Count > 0)
  4451. // {
  4452. // countss = int.Parse(dtcount.Rows[0]["COUNTSS"].ToString());
  4453. // }
  4454. // if (this.ultraTestRack1.Rows.Count - (countss + 1) < ScrapNumBefore)
  4455. // {
  4456. // MessageBox.Show("不存在序号为【" + sql1 + "】的管号,可能是被前道工序判废,不能再次判废!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  4457. // return;
  4458. // }
  4459. // if (this.ultraTestRack1.ActiveRow.Cells["STATUS"].Value.ToString() != "判废")
  4460. // {
  4461. // MilTestingRackEntity testrack = new MilTestingRackEntity();
  4462. // testrack.JudgeStoveNo = this.ultraTestRack1.ActiveRow.Cells["JUDGE_STOVE_NO"].Value.ToString();//判定炉号
  4463. // testrack.Seq = this.ultraTestRack1.ActiveRow.Cells["SEQ"].Value.ToString();//序号
  4464. // if (ugr_testingrack.Cells["STATUS"].Value.ToString() != "报警")
  4465. // {
  4466. // reflag = "1";
  4467. // }
  4468. // else
  4469. // {
  4470. // reflag = "0";
  4471. // }
  4472. // //复探操作:1、更新复探跟踪表(插入复探原因,更新复探支数),2、探伤实绩表复探支数+1
  4473. // int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.ReInspection", new object[] { testrack, flag, Colno, reflag }, this.ob);
  4474. // if (count == 1)
  4475. // {
  4476. // //MessageBox.Show("管序号【" + ugr_testingrack.Cells["SEQ"].Value.ToString() + "】复探成功。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  4477. // //GetMILTestingRack(this.ultraGridPlan.ActiveRow.Cells["JUDGE_STOVE_NO"].Value.ToString());
  4478. // }
  4479. // }
  4480. // else
  4481. // {
  4482. // MessageBox.Show("管序号【" + ugr_testingrack.Cells["SEQ"].Value.ToString() + "】已判废,不允许复探!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  4483. // return;
  4484. // }
  4485. //}
  4486. //if (e.Cell.Column.Key == "ReInspectionBACK")//复探回退
  4487. //{
  4488. // if (this.ultraTestRack1.ActiveRow.Cells["STATUS"].Value.ToString() != "判废")
  4489. // {
  4490. // MilTestingRackEntity testrack = new MilTestingRackEntity();
  4491. // testrack.JudgeStoveNo = this.ultraTestRack1.ActiveRow.Cells["JUDGE_STOVE_NO"].Value.ToString();//判定炉号
  4492. // testrack.Seq = this.ultraTestRack1.ActiveRow.Cells["SEQ"].Value.ToString();//序号
  4493. // int retestnum = int.Parse(this.ultraTestRack1.ActiveRow.Cells["RETEST_NUM"].Value.ToString());
  4494. // testrack.RetestNum = retestnum.ToString();//序号
  4495. // if (ugr_testingrack.Cells["STATUS"].Value.ToString() == "报警")
  4496. // {
  4497. // int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.ReInspectionBACK", new object[] { testrack, flag, Colno }, this.ob);
  4498. // }
  4499. // else
  4500. // {
  4501. // MessageBox.Show("管序号【" + ugr_testingrack.Cells["SEQ"].Value.ToString() + "】未进行复探,不允许复探回退。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  4502. // return;
  4503. // }
  4504. // }
  4505. // else
  4506. // {
  4507. // MessageBox.Show("管序号【" + ugr_testingrack.Cells["SEQ"].Value.ToString() + "】已判废!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  4508. // return;
  4509. // }
  4510. //}
  4511. //if (e.Cell.Column.Key == "DELBACK")
  4512. //{
  4513. // //if (MessageUtil.ShowYesNoAndQuestion("是否回退该判废的坯料") == DialogResult.No)
  4514. // //{
  4515. // // return;
  4516. // //}
  4517. // if (!MatStatus.Equals("判废"))
  4518. // {
  4519. // MessageBox.Show("该坯料未被判废,请确认后重新选择!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  4520. // return;
  4521. // }
  4522. // NativeMethodNew na = new NativeMethodNew(this.ob);
  4523. // int counts = 0;
  4524. // if (flag == "1")
  4525. // {
  4526. // counts = na.DeleteSlabSeq(HeatNo, SEQ, 12, 1, 0, Colno);
  4527. // }
  4528. // if (flag == "2")
  4529. // {
  4530. // counts = na.DeleteSlabSeq(HeatNo, SEQ, 13, 1, 0, Colno);
  4531. // }
  4532. // if (flag == "3")
  4533. // {
  4534. // counts = na.DeleteSlabSeq(HeatNo, SEQ, 14, 1, 0, Colno);
  4535. // }
  4536. // if (counts > 0)
  4537. // {
  4538. // //MessageBox.Show("判废回退成功。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  4539. // }
  4540. // else
  4541. // {
  4542. // MessageBox.Show("判废回退失败。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  4543. // return;
  4544. // }
  4545. //}
  4546. //if (e.Cell.Column.Key == "SUSPECT")//可疑或可疑回退
  4547. //{
  4548. // int ScrapNumBefore = 0;
  4549. // DataTable dtcountaftersaw = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.scrapMatCheckAfterSaw", new object[] { HeatNo, 10, "1" }, this.ob);
  4550. // ScrapNumBefore = int.Parse(dtcountaftersaw.Rows[0]["Countss"].ToString());
  4551. // DataTable dtcount = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.GetRackCounts", new object[] { HeatNo, sql1, "1" }, this.ob);
  4552. // if (dtcount.Rows.Count > 0)
  4553. // {
  4554. // countss = int.Parse(dtcount.Rows[0]["COUNTSS"].ToString());
  4555. // }
  4556. // if (this.ultraTestRack1.Rows.Count - (countss + 1) < ScrapNumBefore)
  4557. // {
  4558. // MessageBox.Show("不存在序号为【" + sql1 + "】的管号,可能是被前道工序判废,不能再次判废!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  4559. // return;
  4560. // }
  4561. // if (this.ultraTestRack1.ActiveRow.Cells["STATUS"].Value.ToString() == "判废")
  4562. // {
  4563. // MessageBox.Show("管号:【" + SEQ + "】已判废,不允许定为可疑品", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  4564. // return;
  4565. // }
  4566. // int AlarmReason = 0;
  4567. // if (String.IsNullOrEmpty(this.ultraTestRack1.ActiveRow.Cells["ALARM_REASON"].Value.ToString()) != true)
  4568. // {
  4569. // switch (this.ultraTestRack1.ActiveRow.Cells["ALARM_REASON"].Value.ToString())
  4570. // {
  4571. // case "LOD": AlarmReason = 1;//复探原因
  4572. // break;
  4573. // case "LID": AlarmReason = 2;
  4574. // break;
  4575. // case "TOD": AlarmReason = 3;
  4576. // break;
  4577. // case "TID": AlarmReason = 4;
  4578. // break;
  4579. // }
  4580. // }
  4581. // else
  4582. // {
  4583. // MessageBox.Show("提示:请选择复探(报警)原因后重新进行可以操作!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  4584. // return;
  4585. // }
  4586. // string suspectflag = ugr_testingrack.Cells["SUSPECT_FLAG"].Value.ToString();
  4587. // if (suspectflag.Equals("正常轧制"))
  4588. // {
  4589. // int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.Suspect", new object[] { HeatNo, flag, Colno, SEQ, AlarmReason }, this.ob);
  4590. // if (count > 0)
  4591. // {
  4592. // //MessageBox.Show("设定成功。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  4593. // }
  4594. // }
  4595. // if (suspectflag.Equals("可疑"))
  4596. // {
  4597. // int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.SuspectBack", new object[] { HeatNo, flag, Colno, SEQ }, this.ob);
  4598. // if (count > 0)
  4599. // {
  4600. // //MessageBox.Show("回退成功。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  4601. // }
  4602. // }
  4603. //}
  4604. //if (e.Cell.Column.Key == "RECUT")
  4605. //{
  4606. // int ScrapNumBefore = 0;
  4607. // DataTable dtcountaftersaw = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.scrapMatCheckAfterSaw", new object[] { HeatNo, 10, "1" }, this.ob);
  4608. // ScrapNumBefore = int.Parse(dtcountaftersaw.Rows[0]["Countss"].ToString());
  4609. // DataTable dtcount = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.GetRackCounts", new object[] { HeatNo, sql1, "1" }, this.ob);
  4610. // if (dtcount.Rows.Count > 0)
  4611. // {
  4612. // countss = int.Parse(dtcount.Rows[0]["COUNTSS"].ToString());
  4613. // }
  4614. // if (this.ultraTestRack1.Rows.Count - (countss + 1) < ScrapNumBefore)
  4615. // {
  4616. // MessageBox.Show("不存在序号为【" + sql1 + "】的管号,可能是被前道工序判废,不能再次判废!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  4617. // return;
  4618. // }
  4619. // if (this.ultraTestRack1.ActiveRow.Cells["STATUS"].Value.ToString() == "判废")
  4620. // {
  4621. // MessageBox.Show("管号:【" + SEQ + "】已判废,不允许进行子管再切", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  4622. // return;
  4623. // }
  4624. // string recutflag = ugr_testingrack.Cells["RECUT_FLAG"].Value.ToString();
  4625. // if (recutflag.Equals("再切"))//再切回退
  4626. // {
  4627. // int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.RecutBack", new object[] { HeatNo, flag, Colno, SEQ }, this.ob);
  4628. // }
  4629. // if (recutflag.Equals("不再切"))//子管再切
  4630. // {
  4631. // if (ugr_testingrack.Cells["RECUT_LENGTH"].Value.ToString2().Equals(""))
  4632. // {
  4633. // MessageBox.Show("请输入子管再切长度后再进行子管再切操作。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  4634. // return;
  4635. // }
  4636. // if (Convert.ToDouble(ugr_testingrack.Cells["RECUT_LENGTH"].Value.ToString2()) == 0)
  4637. // {
  4638. // MessageBox.Show("您输入的子管再切长度错误。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  4639. // return;
  4640. // }
  4641. // double recutlength = Convert.ToDouble(ugr_testingrack.Cells["RECUT_LENGTH"].Value.ToString2());
  4642. // double legth = Convert.ToDouble(this.rollingInfomation1.Value.TargetLength);
  4643. // if (recutlength > legth)
  4644. // {
  4645. // MessageBox.Show("您输入的子管再切长度大于计划目标长度,不允许进行子管再切", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  4646. // return;
  4647. // }
  4648. // int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.Recut", new object[] { HeatNo, flag, Colno, SEQ, recutlength.ToString() }, this.ob);
  4649. // }
  4650. //}
  4651. //if (e.Cell.Column.Key == "RECUT_FLAG")
  4652. //{
  4653. // string recutFlag = ugr_testingrack.Cells["RECUT_FLAG"].Text.Trim();
  4654. // string seq = ugr_testingrack.Cells["SEQ"].Text.Trim();
  4655. // string recutLen = ugr_testingrack.Cells["RECUT_LENGTH"].Text.Trim();
  4656. // if (ActiveStatus == "已完成探伤")
  4657. // {
  4658. // MessageBox.Show("炉号:【" + BaseMethod.getJudgeStoveNo(HeatNo) + "】已完成探伤操作,不允许进行切后长度修改操作!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  4659. // return;
  4660. // }
  4661. // if (recutFlag != "再切")
  4662. // {
  4663. // MessageUtil.ShowTips("所操作的管号为不可再切管,不允许进行切后长度修改!");
  4664. // return;
  4665. // }
  4666. // int updateLen = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.updateRecutLen", new object[] { HeatNo, seq, recutLen }, ob);
  4667. //}
  4668. //交班
  4669. if (e.Cell.Column.Key == "CHANGE_GROUP")
  4670. {
  4671. if (ActiveStatus == "已完成探伤")
  4672. {
  4673. MessageBox.Show("炉号:【" + BaseMethod.getJudgeStoveNo(HeatNo) + "】已完成探伤操作,不允许进行交班操作!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  4674. return;
  4675. }
  4676. string Shift = UserInfo.GetUserOrder();
  4677. string Group = UserInfo.GetUserGroup();
  4678. string User = UserInfo.GetUserName();
  4679. int BeforeChangeNum = 0;
  4680. //查询上个班交班支数
  4681. DataTable dtChangeNum = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getChangeSeq", new object[] { JudgeStoveNo, ResultNo, 8, plinCode, Shift, Group, proPlanId, gxPlanNo }, this.ob);
  4682. if (dtChangeNum.Rows.Count > 0)
  4683. {
  4684. if (!string.IsNullOrEmpty(dtChangeNum.Rows[0][0].ToString()))
  4685. {
  4686. BeforeChangeNum = int.Parse(dtChangeNum.Rows[0][0].ToString());
  4687. }
  4688. }
  4689. int Seq2 = Seq;
  4690. if (Seq2 <= BeforeChangeNum)
  4691. {
  4692. MessageBox.Show("前道班次已交班,该支不能再次交班。");
  4693. return;
  4694. }
  4695. hm.UpdateChangeFlag(JudgeStoveNo, ResultNo, "", 8, Seq, 0);
  4696. AutoUpFile();
  4697. }
  4698. //接班
  4699. if (e.Cell.Column.Key == "TAKE_OVER")
  4700. {
  4701. if (ActiveStatus == "已完成探伤")
  4702. {
  4703. MessageBox.Show("炉号:【" + BaseMethod.getJudgeStoveNo(HeatNo) + "】已完成探伤操作,不允许进行接班操作!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  4704. return;
  4705. }
  4706. string Shift = UserInfo.GetUserOrder();
  4707. string Group = UserInfo.GetUserGroup();
  4708. string User = UserInfo.GetUserName();
  4709. int BeforeChangeNum = 0;
  4710. //查询上个班交班支数
  4711. DataTable dtChangeNum = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getChangeSeq", new object[] { JudgeStoveNo, ResultNo, 8, plinCode, Shift, Group, proPlanId, gxPlanNo }, this.ob);
  4712. if (dtChangeNum.Rows.Count > 0)
  4713. {
  4714. if (!string.IsNullOrEmpty(dtChangeNum.Rows[0][0].ToString()))
  4715. {
  4716. BeforeChangeNum = int.Parse(dtChangeNum.Rows[0][0].ToString());
  4717. }
  4718. }
  4719. int WaitChangeSeq = hm.GetWaitChangeSeq(JudgeStoveNo, ResultNo, "", 8, 0, proPlanId, gxPlanNo);
  4720. if (WaitChangeSeq == 0)
  4721. {
  4722. MessageBox.Show("没有待交班确认的管号。");
  4723. return;
  4724. }
  4725. if (WaitChangeSeq != Seq)
  4726. {
  4727. MessageBox.Show("交班管序号与接班管序号不符,请确认后接班。");
  4728. return;
  4729. }
  4730. if (MessageUtil.ShowYesNoAndQuestion("确认炉号:【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】序号:【" + Seq + "】交班?") == DialogResult.No)
  4731. {
  4732. return;
  4733. }
  4734. //查询是否有该班接班记录
  4735. DateTime SeverTime = NativeMethod.GetSeverTime(this.ob);
  4736. string Time = SeverTime.ToLongTimeString();
  4737. string StartTime = SeverTime.ToShortDateString() + " 00:00:00";
  4738. string EndTime = SeverTime.AddDays(1).ToShortDateString() + " 00:00:00";
  4739. if (this.DoRelogin(DoCheck))
  4740. {
  4741. //插入接班确认履历表
  4742. hm.InsertChangeRemuse(Shift, Group, _UserName, "8", plinCode);
  4743. int Seq2 = Seq;
  4744. 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);
  4745. // ChangeFlag = 1;
  4746. }
  4747. }
  4748. if (this.ultraGridPlan.Rows == null)
  4749. {
  4750. return;
  4751. }
  4752. //探伤实绩卡赋值
  4753. GetMILETResult(HeatNo);
  4754. //探伤跟踪重新赋值
  4755. GetMILTestingRack(HeatNo);
  4756. ChangeGridColor();
  4757. GetRollingCard();
  4758. foreach (UltraGridRow ugr_1 in ultraTestRack1.Rows)
  4759. {
  4760. if (ugr_1.Cells["SEQ"].Value.ToString() == SEQ)
  4761. {
  4762. ultraTestRack1.ActiveRow = ugr_1;
  4763. }
  4764. }
  4765. }
  4766. private void ultraTestRack2_ClickCellButton(object sender, CellEventArgs e)
  4767. {
  4768. UltraGridRow ugr_pian = ultraGridPlan.ActiveRow;
  4769. string HeatNo = ugr_pian.Cells["JUDGE_STOVE_NO"].Value.ToString();
  4770. UltraGridRow ugr_testingrack = ultraTestRack1.ActiveRow;
  4771. string offline = ugr_testingrack.Cells["OFFLINE_FLAG"].Value.ToString();
  4772. MilPlan milpian = new MilPlan();
  4773. string SEQ = ugr_testingrack.Cells["SEQ"].Value.ToString();
  4774. int sql1 = int.Parse(SEQ);
  4775. string MatStatus = ugr_testingrack.Cells["STATUS"].Value.ToString();
  4776. //判废管坯序号类
  4777. MilSlabScrapSeqEntity ScrapSlab = new MilSlabScrapSeqEntity();
  4778. string reflag = "0";
  4779. int countss = 0;
  4780. string flag = "0";
  4781. //if (TestMethod.Contains("涡流"))
  4782. if (PlineCode.Equals("C010"))
  4783. {
  4784. flag = "1";
  4785. }
  4786. //if (TestMethod.Contains("漏磁"))
  4787. if (PlineCode.Equals("C009") || PlineCode.Equals("C008") || PlineCode.Equals("C017") || PlineCode.Equals("C072"))
  4788. {
  4789. flag = "2";
  4790. }
  4791. //if (TestMethod.Contains("超声波"))
  4792. if (PlineCode.Equals("C012"))
  4793. {
  4794. flag = "3";
  4795. }
  4796. DataTable dtnodeflag = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.GetTSNodeFlagColno", new object[] { HeatNo, int.Parse(flag), int.Parse(Colno) }, this.ob);
  4797. if (dtnodeflag.Rows.Count > 0)
  4798. {
  4799. if (dtnodeflag.Rows[0]["NODEFLAG"].ToString().Equals("1"))
  4800. {
  4801. MessageBox.Show("探伤操作台【" + this.Colno + "】#台已完成探伤操作,不允许进行管号队列操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  4802. return;
  4803. }
  4804. }
  4805. else
  4806. {
  4807. MessageBox.Show("炉号【" + HeatNo + "】未开始探伤,不允许进行管号队列操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  4808. return;
  4809. }
  4810. if (ActiveStatus == "已完成探伤")
  4811. {
  4812. MessageBox.Show("炉号:【" + BaseMethod.getJudgeStoveNo(HeatNo) + "】已完成探伤操作,不允许进行判废操作!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  4813. return;
  4814. }
  4815. if (ActiveOFFLINE_FLAG.Equals("2"))
  4816. {
  4817. if (!offline.Equals("返线"))
  4818. {
  4819. MessageBox.Show("当前为矫直返线,只允许对下线状态为返线的子管进行操作,", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  4820. return;
  4821. }
  4822. }
  4823. string shif = ugr_testingrack.Cells["COL_SHIFT"].Value.ToString();
  4824. string group = ugr_testingrack.Cells["COL_GROUP"].Value.ToString();
  4825. Shift = UserInfo.GetUserOrder();
  4826. Group = UserInfo.GetUserGroup();
  4827. NativeMethodNew nasssss = new NativeMethodNew(this.ob);
  4828. if (nasssss.IsRackOperate(shif, group))
  4829. {
  4830. MessageBox.Show("序号:【" + SEQ + "】子管已由" + shif + "," + group + "操作,不允许再进行操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  4831. return;
  4832. }
  4833. //复探
  4834. if (e.Cell.Column.Key == "ReInspection")
  4835. {
  4836. int ScrapNumBefore = 0;
  4837. DataTable dtcountaftersaw = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.scrapMatCheckAfterSaw", new object[] { HeatNo, 10, "2", proPlanId, gxPlanNo }, this.ob);
  4838. ScrapNumBefore = int.Parse(dtcountaftersaw.Rows[0]["Countss"].ToString());
  4839. DataTable dtcount = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.GetRackCounts", new object[] { HeatNo, sql1, "2", proPlanId, gxPlanNo }, this.ob);
  4840. if (dtcount.Rows.Count > 0)
  4841. {
  4842. countss = int.Parse(dtcount.Rows[0]["COUNTSS"].ToString());
  4843. }
  4844. if (this.ultraTestRack1.Rows.Count - (countss + 1) < ScrapNumBefore)
  4845. {
  4846. MessageBox.Show("不存在序号为【" + sql1 + "】的管号,可能是被前道工序判废,不能再次判废!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  4847. return;
  4848. }
  4849. if (this.ultraTestRack1.ActiveRow.Cells["STATUS"].Value.ToString() != "判废")
  4850. {
  4851. MilTestingRackEntity testrack = new MilTestingRackEntity();
  4852. testrack.JudgeStoveNo = this.ultraTestRack1.ActiveRow.Cells["JUDGE_STOVE_NO"].Value.ToString();//判定炉号
  4853. testrack.Seq = this.ultraTestRack1.ActiveRow.Cells["SEQ"].Value.ToString();//序号
  4854. if (ugr_testingrack.Cells["STATUS"].Value.ToString() != "报警")
  4855. {
  4856. reflag = "1";
  4857. }
  4858. else
  4859. {
  4860. reflag = "0";
  4861. }
  4862. //复探操作:1、更新复探跟踪表(插入复探原因,更新复探支数),2、探伤实绩表复探支数+1
  4863. int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.ReInspection", new object[] { testrack, flag, Colno, reflag }, this.ob);
  4864. if (count == 1)
  4865. {
  4866. MessageBox.Show("管序号【" + ugr_testingrack.Cells["SEQ"].Value.ToString() + "】复探成功。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  4867. //GetMILTestingRack(this.ultraGridPlan.ActiveRow.Cells["JUDGE_STOVE_NO"].Value.ToString());
  4868. }
  4869. }
  4870. else
  4871. {
  4872. MessageBox.Show("管序号【" + ugr_testingrack.Cells["SEQ"].Value.ToString() + "】已判废,不允许复探!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  4873. return;
  4874. }
  4875. }
  4876. if (e.Cell.Column.Key == "ReInspectionBACK")//复探回退
  4877. {
  4878. if (this.ultraTestRack1.ActiveRow.Cells["STATUS"].Value.ToString() != "判废")
  4879. {
  4880. MilTestingRackEntity testrack = new MilTestingRackEntity();
  4881. testrack.JudgeStoveNo = this.ultraTestRack1.ActiveRow.Cells["JUDGE_STOVE_NO"].Value.ToString();//判定炉号
  4882. testrack.Seq = this.ultraTestRack1.ActiveRow.Cells["SEQ"].Value.ToString();//序号
  4883. int retestnum = int.Parse(this.ultraTestRack1.ActiveRow.Cells["RETEST_NUM"].Value.ToString());
  4884. testrack.RetestNum = retestnum.ToString();//序号
  4885. if (ugr_testingrack.Cells["STATUS"].Value.ToString() == "报警")
  4886. {
  4887. int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.ReInspectionBACK", new object[] { testrack, flag, Colno }, this.ob);
  4888. }
  4889. else
  4890. {
  4891. MessageBox.Show("管序号【" + ugr_testingrack.Cells["SEQ"].Value.ToString() + "】未进行复探,不允许复探回退。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  4892. return;
  4893. }
  4894. }
  4895. else
  4896. {
  4897. MessageBox.Show("管序号【" + ugr_testingrack.Cells["SEQ"].Value.ToString() + "】已判废!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  4898. return;
  4899. }
  4900. }
  4901. if (e.Cell.Column.Key == "RECUT")
  4902. {
  4903. int ScrapNumBefore = 0;
  4904. DataTable dtcountaftersaw = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.scrapMatCheckAfterSaw", new object[] { HeatNo, 10, "2", proPlanId, gxPlanNo }, this.ob);
  4905. ScrapNumBefore = int.Parse(dtcountaftersaw.Rows[0]["Countss"].ToString());
  4906. DataTable dtcount = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.GetRackCounts", new object[] { HeatNo, sql1, "2", proPlanId, gxPlanNo }, this.ob);
  4907. if (dtcount.Rows.Count > 0)
  4908. {
  4909. countss = int.Parse(dtcount.Rows[0]["COUNTSS"].ToString());
  4910. }
  4911. if (this.ultraTestRack1.Rows.Count - (countss + 1) < ScrapNumBefore)
  4912. {
  4913. MessageBox.Show("不存在序号为【" + sql1 + "】的管号,可能是被前道工序判废,不能再次判废!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  4914. return;
  4915. }
  4916. if (this.ultraTestRack1.ActiveRow.Cells["STATUS"].Value.ToString() == "判废")
  4917. {
  4918. MessageBox.Show("管号:【" + SEQ + "】已判废,不允许进行子管再切", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  4919. return;
  4920. }
  4921. string recutflag = ugr_testingrack.Cells["RECUT_FLAG"].Value.ToString();
  4922. if (recutflag.Equals("再切"))//再切回退
  4923. {
  4924. int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.RecutBack", new object[] { HeatNo, flag, Colno, SEQ }, this.ob);
  4925. }
  4926. if (recutflag.Equals("不再切"))//子管再切
  4927. {
  4928. if (ugr_testingrack.Cells["RECUT_LENGTH"].Value.ToString2().Equals(""))
  4929. {
  4930. MessageBox.Show("请输入子管再切长度后再进行子管再切操作。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  4931. return;
  4932. }
  4933. if (Convert.ToDouble(ugr_testingrack.Cells["RECUT_LENGTH"].Value.ToString2()) == 0)
  4934. {
  4935. MessageBox.Show("您输入的子管再切长度错误。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  4936. return;
  4937. }
  4938. double recutlength = Convert.ToDouble(ugr_testingrack.Cells["RECUT_LENGTH"].Value.ToString2());
  4939. double legth = Convert.ToDouble(this.rollingInfomation1.Value.TargetLength);
  4940. if (recutlength > legth)
  4941. {
  4942. MessageBox.Show("您输入的子管再切长度大于计划目标长度,不允许进行子管再切", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  4943. return;
  4944. }
  4945. int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.Recut", new object[] { HeatNo, flag, Colno, SEQ, recutlength.ToString() }, this.ob);
  4946. }
  4947. }
  4948. //探伤实绩卡赋值
  4949. GetMILETResult(HeatNo);
  4950. //探伤跟踪重新赋值
  4951. GetMILTestingRack(HeatNo);
  4952. ChangeGridColor();
  4953. GetRollingCard();
  4954. }
  4955. private void ultraTestRack1_KeyDown(object sender, KeyEventArgs e)
  4956. {
  4957. if (recutFlag != "再切") return;
  4958. if (!recutLen.TryParseDouble())
  4959. {
  4960. MessageUtil.ShowTips("输入的切后长度不是有效数字!");
  4961. return;
  4962. }
  4963. if (e.KeyCode == Keys.Enter)
  4964. {
  4965. int updateLen = ServerHelper.SetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.updateRecutLen", new object[] { jugeNo, seq, recutLen }, ob);
  4966. GetMILTestingRack(jugeNo);
  4967. ChangeGridColor();
  4968. }
  4969. }
  4970. private string jugeNo = "";//炉号
  4971. private string seq = "";//序号
  4972. private string recutLen = "";//切后长度
  4973. private string recutFlag = "";
  4974. private void ultraTestRack1_CellChange(object sender, CellEventArgs e)
  4975. {
  4976. if (e.Cell.Column.Key == "RECUT_LENGTH")
  4977. {
  4978. jugeNo = this.ultraTestRack1.ActiveRow.Cells["JUDGE_STOVE_NO"].Text.Trim();
  4979. seq = this.ultraTestRack1.ActiveRow.Cells["SEQ"].Text.Trim();
  4980. recutLen = this.ultraTestRack1.ActiveRow.Cells["RECUT_LENGTH"].Text.Trim().Replace("_", "");
  4981. recutFlag = this.ultraTestRack1.ActiveRow.Cells["RECUT_FLAG"].Text.Trim();
  4982. if (ActiveStatus == "已完成探伤")
  4983. {
  4984. MessageBox.Show("炉号:【" + jugeNo + "】已完成探伤操作,不允许进行切后长度修改操作!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  4985. return;
  4986. }
  4987. if (recutFlag != "再切")
  4988. {
  4989. MessageUtil.ShowTips("所操作的管号为不可再切管,不允许进行切后长度修改!");
  4990. return;
  4991. }
  4992. }
  4993. }
  4994. private void mtTestingResult1_cellChange(object sender, CellEventArgs e)
  4995. {
  4996. //e.Cell.Column.Key == "detectionNum1" || e.Cell.Column.Key == "detectionNum2" || e.Cell.Column.Key == "sampleNum1" || e.Cell.Column.Key == "sampleNum2" ||
  4997. 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")
  4998. {
  4999. string Status = doQueryJugeNoStaus(ActiveResultNo, ActiveJUDGE_STOVE_NO, PlineCode);
  5000. //if (Status == "1")
  5001. //{
  5002. GetMILTestingRack(ActiveJUDGE_STOVE_NO);
  5003. //}
  5004. alarmFlag = true;
  5005. }
  5006. }
  5007. private void ultraGridPlan_BeforeRowDeactivate(object sender, CancelEventArgs e)
  5008. {
  5009. if (alarmFlag == true)
  5010. {
  5011. e.Cancel = true;
  5012. MessageUtil.ShowTips("登记了缺陷项,请先保存实绩!");
  5013. return;
  5014. }
  5015. }
  5016. private void FrmTestingResult_FormClosing(object sender, FormClosingEventArgs e)
  5017. {
  5018. if (alarmFlag == true)
  5019. {
  5020. e.Cancel = true;
  5021. MessageUtil.ShowTips("登记了缺陷项,请先保存实绩!");
  5022. return;
  5023. }
  5024. }
  5025. private void crackDetectionResult1_cellChange(object sender, CellEventArgs e)
  5026. {
  5027. 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")
  5028. {
  5029. string Status = doQueryJugeNoStaus(ActiveResultNo, ActiveJUDGE_STOVE_NO, PlineCode);
  5030. //if (Status == "1")
  5031. //{
  5032. GetMILTestingRack(ActiveJUDGE_STOVE_NO);
  5033. //}
  5034. alarmFlag = true;
  5035. }
  5036. }
  5037. }
  5038. }