| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344 |
- using Core.Mes.Client.Comm.Control;
- using Core.Mes.Client.Comm.Format;
- using Core.Mes.Client.Comm.Tool;
- using Core.StlMes.Client.Lims.Port.封装类.方法;
- using Core.StlMes.Client.Lims.Port.数据管理.实体类;
- using CoreFS.CA06;
- using Infragistics.Win;
- using Infragistics.Win.UltraWinGrid;
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- namespace Core.StlMes.Client.Lims.Port
- {
- public partial class FrmHttBatchSampleNew : FrmBase
- {
- public FrmHttBatchSampleNew()
- {
- InitializeComponent();
- }
- private string plineCode = "";//产线
- List<CraftSamplingMEntity> dtPlanM = null;//检验计划主信息
- List<CraftSamplingDetailEntity> dtPlanDetial = null;//检验计划从信息
- List<CraftSamplingMEntity> dtPlanM1 = null;//分批详细方案
- int minBatchNum = 0;//最小分批数量
- private Color color1 = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
- private Color color2 = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(224)))), ((int)(((byte)(192)))));
- private string batchNoZ = "";//性能批号产线标识
- private void FrmMilBatchSampleNew_Load(object sender, EventArgs e)
- {
- DateTime now = DateTime.Now;
- DateTime dt1 = new DateTime(now.Year, now.Month, 1);//当月第一天
- DateTime dt2 = dt1.AddMonths(1).AddDays(-1);//当月最后一天
- this.RegStartTime.Value = DateTime.Parse(dt1.ToString("yyyy-MM-dd") + " 00:00:00");
- this.RegEndTime.Value = DateTime.Parse(dt2.ToString("yyyy-MM-dd") + " 23:59:59");
- EntityHelper.ShowGridCaption<PlnZyRclMEntity>(this.ultraGrid1.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<PlnZyRclMEntity>(this.ultraGrid2.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<PortHttBatchSampleResultEntity>(this.ultraGrid3.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<PortHttBatchSampleResultEntity>(this.ultraGrid8.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<PlnZyRclMEntity>(this.ultraGrid5.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<PlnZyRclMEntity>(this.ultraGrid6.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<PortHttBatchSampleResultEntity>(this.ultraGrid7.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<PlnZyRclMEntity>(this.ultraGrid9.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<PlnZyRclMEntity>(this.ultraGrid10.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<PlnZyRclMEntity>(this.ultraGrid12.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<PlnZyRclMEntity>(this.ultraGrid13.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<PipeCheckconsignNoqualifiedEntity>(this.ultraGrid15.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<PipeCheckconsignNoqualifiedEntity>(this.ultraGrid16.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<PortHttBatchSampleResultEntity>(this.ultraGrid17.DisplayLayout.Bands[0]);
-
- EntityHelper.ShowGridCaption<PipeCheckconsignNoqualifiedEntity>(this.ultraGrid19.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<PipeCheckconsignNoqualifiedEntity>(this.ultraGrid20.DisplayLayout.Bands[0]);
- plineCode = PublicPort.GetPCode(this.ValidDataPurviewIds, ob);
- cmbSampleType.SelectedIndex = 0;
- initPostion();
- }
- /// <summary>
- /// 加载基础取样位置
- /// </summary>
- private void initPostion()
- {
- DataTable ds = PublicServer.GetData("com.steering.mes.port.vrp.FrmHttBatchSaplmeNew.doQueryPostion", new object[] { }, ob);
- if (ds != null && ds.Rows.Count > 0)
- {
- cmbPostion.DataSource = ds;
- cmbPostion.ValueMember = "BASECODE";
- cmbPostion1.DataSource = ds;
- cmbPostion1.ValueMember = "BASECODE";
- cmbPiecePostion.DataSource = ds;
- cmbPiecePostion.ValueMember = "BASECODE";
- }
- }
- /// <summary>
- /// 重写基类方法
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="ToolbarKey"></param>
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Query":
- doQueryPlan();
- break;
- case "QueryRepeate":
- doQueryRepeate();
- break;
- case "BatchSeting":
- batchSeting();
- break;
- case "CancelBatchSeting":
- cancelBatchSeting();
- break;
- case "OprocessBatch":
- oprocessBatch();
- break;
- case "CancelOprocessBatch":
- cancelBatch();
- break;
- case "GetSample":
- getSample();
- break;
- case"GetSamplePipece":
- getSamplePipece();
- break;
- case"ComfrimComplete":
- comfrimComplete();
- break;
- case "CancelGetSample":
- cancelGetSample();
- break;
- case"Approval":
- approval();
- break;
- case "Confirm":
- confirm();
- break;
- case "CancelConfirm":
- cancelConfirm();
- break;
- case"MergerConfrim":
- mergerConfrim();
- break;
- case "ReGetSample":
- reGetSample();
- break;
- case "CancelReGetSample":
- cancelReGetSample();
- break;
- case "RepeateFrim":
- repeateFrim();
- break;
- case "CancelRepeateFrim":
- cancelRepeateFrim();
- break;
- case "Print":
- printTrust();
- break;
- case "PrintLable":
- printLable();
- break;
- case "PrintReLable":
- printReLable();
- break;
- case "PrintRe":
- printReTrust();
- break;
- case "Close":
- close();
- break;
- }
- }
-
-
-
- /// <summary>
- /// 撤销复取样
- /// </summary>
- private void cancelReGetSample()
- {
- this.ultraGrid15.UpdateData();
- this.ultraGrid17.UpdateData();
- UltraGridRow uRow = this.ultraGrid15.ActiveRow;
- List<PortHttBatchSampleResultEntity> lists = portHttBatchSampleResultEntityBindingSource2.DataSource as List<PortHttBatchSampleResultEntity>;
- if (uRow == null || lists.Count <= 0)
- {
- return;
- }
- PipeCheckconsignNoqualifiedEntity milPlans = (PipeCheckconsignNoqualifiedEntity)uRow.ListObject;
- string milPlanEntity = JSONFormat.Format(milPlans);
- List<string> portMilEntity = lists.Where(p => p.ResamplePipeLenA != "" || p.ResamplePipeLenB != "" || p.ResamplePipeLenC != "" || p.ResamplePipeLenD != "" || p.ResamplePipeLenM != "" || p.ResamplePipeLenE != "" || p.ResamplePipeLenF != "" || p.ResamplePipeLenP != "" || p.ResamplePipeLenQ != "").Select(JSONFormat.Format).ToList();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.port.vrp.FrmHttBatchSaplmeNew";
- ccp.MethodName = "cancelReGetSample";
- ccp.ServerParams = new object[] { milPlanEntity, portMilEntity };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("撤销成功!"))
- {
- doQueryRepeate();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 复取样
- /// </summary>
- private void reGetSample()
- {
- this.ultraGrid15.UpdateData();
- this.ultraGrid17.UpdateData();
- UltraGridRow uRow = this.ultraGrid15.ActiveRow;
- List<PortHttBatchSampleResultEntity> lists = portHttBatchSampleResultEntityBindingSource2.DataSource as List<PortHttBatchSampleResultEntity>;
- if (uRow == null || lists.Count <= 0)
- {
- return;
- }
- if (lists.Any(p => p.Chk == true && p.ResamplePipeLenA == "" && p.ResamplePipeLenB == "" && p.ResamplePipeLenC == "" && p.ResamplePipeLenD == "" && p.ResamplePipeLenE == "" && p.ResamplePipeLenF == "" && p.ResamplePipeLenP == "" && p.ResamplePipeLenQ == "" && p.ResamplePipeLenM == ""))
- {
- MessageUtil.ShowTips("还有已选做样管未输入样管长度的管材,不允许进行复取样完成!");
- return;
- }
- if (lists.Any(p => p.Chk == true && !StringUtil.IsInt32(p.ResamplePipeLenA) && !StringUtil.IsInt32(p.ResamplePipeLenB) && !StringUtil.IsInt32(p.ResamplePipeLenC) && !StringUtil.IsInt32(p.ResamplePipeLenD) && !StringUtil.IsInt32(p.ResamplePipeLenE) && !StringUtil.IsInt32(p.ResamplePipeLenF) && !StringUtil.IsInt32(p.ResamplePipeLenP) && !StringUtil.IsInt32(p.ResamplePipeLenQ)&& !StringUtil.IsInt32(p.ResamplePipeLenM)))
- {
- MessageUtil.ShowTips("样管长度单位为毫米,请输入整数!");
- return;
- }
- PipeCheckconsignNoqualifiedEntity milPlans = (PipeCheckconsignNoqualifiedEntity)uRow.ListObject;
- string milPlanEntity = JSONFormat.Format(milPlans);
- List<string> portMilEntity = lists.Where(p => p.Chk).Select(JSONFormat.Format).ToList();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.port.vrp.FrmHttBatchSaplmeNew";
- ccp.MethodName = "reGetSample";
- ccp.ServerParams = new object[] { milPlanEntity, portMilEntity, UserInfo.GetUserName(), UserInfo.GetUserGroup(), UserInfo.GetUserOrder() };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("复取样完成!"))
- {
- doQueryRepeate();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 委托完成
- /// </summary>
- private void comfrimComplete()
- {
- this.ultraGrid1.UpdateData();
- UltraGridRow row = this.ultraGrid1.ActiveRow;
- if (row == null) return;
- PlnZyRclMEntity planEntity = (PlnZyRclMEntity)row.ListObject;
- string planTity = JSONFormat.Format(planEntity);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.port.vrp.FrmHttBatchSaplmeNew";
- ccp.MethodName = "comfrimComplete";
- ccp.ServerParams = new object[] { planTity };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("委托完成!"))
- {
- doQueryPlan();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 拆批
- /// </summary>
- private void approval()
- {
- this.ultraGrid3.UpdateData();
- int startSeq = int.Parse(this.ultraSTART_PIPE_NO.Text);
- int endSeq = int.Parse(this.ultraEND_PIPE_NO.Text);
- if (startSeq > endSeq)
- {
- MessageUtil.ShowTips("起始序号不允许大于结束序号!");
- return;
- }
- List<PortHttBatchSampleResultEntity> list = portHttBatchSampleResultEntityBindingSource.DataSource as List<PortHttBatchSampleResultEntity>;
- List<string> a = list.Skip(startSeq - 1).Take(endSeq - startSeq + 1).ToList().Select(JSONFormat.Format).ToList();
- if (MessageUtil.ShowYesNoAndQuestion("是否确定将序号" + startSeq + "至" + endSeq + "总共" + (endSeq - startSeq+1)+ "支管材进行拆批 ?") == DialogResult.No)
- {
- return;
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.port.vrp.FrmHttBatchSaplmeNew";
- ccp.MethodName = "approval";
- ccp.ServerParams = new object[] { a };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("拆批成功!"))
- {
- doQueryPlan();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 查询复取样信息
- /// </summary>
- private void doQueryRepeate()
- {
- string startTime = "";
- string endTim = "";
- string lotNo = "";
- string judgeNo = "";
- if (this.chkRegTime.Checked)
- {
- startTime = this.RegStartTime.Value.ToString();
- endTim = this.RegEndTime.Value.ToString();
- }
- if (chkLotNo.Checked && this.txtLotNo.Text.Trim() != "")
- {
- lotNo = this.txtLotNo.Text;
- }
- if (chkJudgeNo.Checked && this.txtJudgeNo.Text.Trim() != "")
- {
- judgeNo = this.txtJudgeNo.Text;
- }
- ArrayList parm = new ArrayList();
- parm.Add(startTime);
- parm.Add(endTim);
- parm.Add(lotNo);
- parm.Add(judgeNo);
- if (ultraTabControl1.SelectedTab.Key == "4")
- {
- parm.Add("0");
- }
- else if (ultraTabControl1.SelectedTab.Key == "5")
- {
- parm.Add("1");
- }
- List<PipeCheckconsignNoqualifiedEntity> listSource = EntityHelper.GetData<PipeCheckconsignNoqualifiedEntity>(
- "com.steering.mes.port.mil.FrmMilBatchSampleNew.doQueryRepeate", new object[] { parm, plineCode }, this.ob);
- if (ultraTabControl1.SelectedTab.Key == "4")
- {
- pipeCheckconsignNoqualifiedEntityBindingSource.DataSource = listSource;
- }
- else if (ultraTabControl1.SelectedTab.Key == "5")
- {
- pipeCheckconsignNoqualifiedEntityBindingSource3.DataSource = listSource;
- }
- }
- /// <summary>
- /// 复取样委托
- /// </summary>
- private void repeateFrim()
- {
- this.ultraGrid19.UpdateData();
- this.ultraGrid20.UpdateData();
- UltraGridRow uRow = this.ultraGrid19.ActiveRow;
- if (uRow == null) return;
- PipeCheckconsignNoqualifiedEntity pipeCheckEntity = (PipeCheckconsignNoqualifiedEntity)uRow.ListObject;
- string pipeTity = JSONFormat.Format(pipeCheckEntity);
- List<List<string>> parmList = new List<List<string>>();
- foreach (UltraGridRow row in this.ultraGrid21.Rows)
- {
- List<string> list = new List<string>();
- list.Add(row.Cells["PHY_BATCH_NO"].Text);
- list.Add(row.Cells["MAT_NO"].Text);
- list.Add(row.Cells["SAMPLE_PIPE_LEN"].Text);
- list.Add(row.Cells["SAMPLE_POSTION"].Text);
- for (int j = 5; j < dataTable5.Columns.Count; j++)
- {
- if (row.Cells[j].Value == "√")
- {
- list.Add(row.Cells[j].Column.Key);
- }
- }
- parmList.Add(list);
- }
- List<List<string>> batchList = parmList.GroupBy(p => p[0]).Select(p => p.FirstOrDefault()
- ).ToList();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.port.vrp.FrmHttBatchSaplmeNew";
- ccp.MethodName = "repeateFrim";
- ccp.ServerParams = new object[] { pipeTity, parmList, batchList, UserInfo.GetUserName(), UserInfo.GetDepartment(), this.txtRemark2.Text.ToString().Trim() };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("复取样委托成功!"))
- {
- doQueryRepeate();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 撤销复取样委托
- /// </summary>
- private void cancelRepeateFrim()
- {
- this.ultraGrid19.UpdateData();
- UltraGridRow uRow = this.ultraGrid19.ActiveRow;
- if (uRow == null) return;
- PipeCheckconsignNoqualifiedEntity pipeNoTity = (PipeCheckconsignNoqualifiedEntity)uRow.ListObject;
- string pipeNoEntity = JSONFormat.Format(pipeNoTity);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.port.vrp.FrmHttBatchSaplmeNew";
- ccp.MethodName = "cancelRepeateFrim";
- ccp.ServerParams = new object[] { pipeNoEntity };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("撤销复取样委托成功!"))
- {
- doQueryRepeate();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 打印复样标签
- /// </summary>
- private void printReLable()
- {
- this.ultraGrid19.UpdateData();
- UltraGridRow uRow = this.ultraGrid19.ActiveRow;
- if (uRow == null) return;
- string checkNo = "F" + uRow.Cells["CheckNo"].Text.Trim();
- string strurl = "";
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepEntrustLabelHTT.cpt" + "&CHECK_NO=" + checkNo;
- FrmRepExcel fBug = new FrmRepExcel(ob, strurl);
- fBug.AutoSize = true;
- fBug.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
- fBug.WindowState = FormWindowState.Maximized;
- fBug.Text = "样管号标签";
- fBug.Show();
- }
- /// <summary>
- /// 标签
- /// </summary>
- private void printLable()
- {
- this.ultraGrid12.UpdateData();
- UltraGridRow uRow = this.ultraGrid12.ActiveRow;
- if (uRow == null) return;
- string checkNo = uRow.Cells["CheckNo"].Text.Trim();
- string strurl = "";
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepEntrustLabelHTT.cpt&&format=pdf&__embed__=true" + "&CHECK_NO=" + checkNo + "&JUDGE_STOVE_NO=" + uRow.Cells["JudgeStoveNo"].Text.Trim() + "&PROCESS_CODE=F";
- FrmRepExcel fBug = new FrmRepExcel(ob, strurl);
- fBug.AutoSize = true;
- fBug.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
- fBug.WindowState = FormWindowState.Maximized;
- fBug.Text = "样管号标签";
- fBug.Show();
- }
- /// <summary>
- /// 打印
- /// </summary>
- private void printTrust()
- {
- this.ultraGrid12.UpdateData();
- UltraGridRow uRow = this.ultraGrid12.ActiveRow;
- if (uRow == null) return;
- this.ultraGrid13.UpdateData();
- UltraGridRow uRow2 = this.ultraGrid13.ActiveRow;
- if (uRow2 == null) return;
- string checkNo = uRow.Cells["CheckNo"].Text.Trim();
- string orderNo = uRow2.Cells["OrderNo"].Text.Trim();
- string strurl = "";
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepLimsPortCheckConsignOrder.cpt&&format=pdf&__embed__=true" + "&CHECK_NO=" + checkNo + "&orderNo=" + orderNo;
- FrmRepExcel fBug = new FrmRepExcel(ob, strurl);
- fBug.AutoSize = true;
- fBug.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
- fBug.WindowState = FormWindowState.Maximized;
- fBug.Text = "检验委托单";
- fBug.Show();
- }
- /// <summary>
- /// 打印复样委托单
- /// </summary>
- private void printReTrust()
- {
- this.ultraGrid19.UpdateData();
- UltraGridRow uRow = this.ultraGrid19.ActiveRow;
- if (uRow == null) return;
- this.ultraGrid20.UpdateData();
- UltraGridRow uRow2 = this.ultraGrid20.ActiveRow;
- if (uRow2 == null) return;
- string checkNo = "F" + uRow.Cells["CheckNo"].Text.Trim();
-
- string strurl = "";
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepLimsPortCheckConsignOrder.cpt&&format=pdf&__embed__=true" + "&CHECK_NO=" + checkNo ;
- FrmRepExcel fBug = new FrmRepExcel(ob, strurl);
- fBug.AutoSize = true;
- fBug.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
- fBug.WindowState = FormWindowState.Maximized;
- fBug.Text = "检验委托单";
- fBug.Show();
- }
- private void close()
- {
- this.Close();
- }
- /// <summary>
- /// 分批取样完成
- /// </summary>
- private void batchSeting()
- {
- this.ultraGrid1.UpdateData();
- this.ultraGrid3.UpdateData();
- UltraGridRow uRow = this.ultraGrid1.ActiveRow;
- List<PortHttBatchSampleResultEntity> lists = portHttBatchSampleResultEntityBindingSource.DataSource as List<PortHttBatchSampleResultEntity>;
- if (uRow == null || lists.Count <= 0)
- {
- return;
- }
- //if (lists.Any(p => p.PhyBatchNo == ""))
- //{
- // MessageUtil.ShowTips("还有未分配批号管材,不允许进行分批完成!");
- // return;
- //}
- if (lists.Any(p => p.Chk == true && p.SamplePipeLenA == "" && p.SamplePipeLenB == "" && p.SamplePipeLenC == "" && p.SamplePipeLenD == "" && p.SamplePipeLenM == "" && p.SamplePipeLenE == "" && p.SamplePipeLenF == "" && p.SamplePipeLenP == "" && p.SamplePipeLenQ == ""))
- {
- MessageUtil.ShowTips("还有已选做样管未输入样管长度的管材,不允许进行分批完成!");
- return;
- }
- if (lists.Any(p => p.Chk == true && !StringUtil.IsInt32(p.SamplePipeLenA) && !StringUtil.IsInt32(p.SamplePipeLenB) && !StringUtil.IsInt32(p.SamplePipeLenC) && !StringUtil.IsInt32(p.SamplePipeLenD) && !StringUtil.IsInt32(p.SamplePipeLenM) && !StringUtil.IsInt32(p.SamplePipeLenE) && !StringUtil.IsInt32(p.SamplePipeLenF) && !StringUtil.IsInt32(p.SamplePipeLenP) && !StringUtil.IsInt32(p.SamplePipeLenQ)))
- {
- MessageUtil.ShowTips("样管长度单位为毫米,请输入整数!");
- return;
- }
- PlnZyRclMEntity milPlans = (PlnZyRclMEntity)uRow.ListObject;
- string milPlanEntity = JSONFormat.Format(milPlans);
- List<string> portMilEntity = lists.Select(JSONFormat.Format).ToList();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.port.vrp.FrmHttBatchSaplmeNew";
- ccp.MethodName = "batchSeting";
- ccp.ServerParams = new object[] { milPlanEntity, portMilEntity,UserInfo.GetUserName(),UserInfo.GetUserGroup(),UserInfo.GetUserOrder(),this.cmbSampleType.Value.ToString() };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("分批取样完成!"))
- {
-
- doQueryPlan();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 撤销分批取样
- /// </summary>
- private void cancelBatchSeting()
- {
- this.ultraGrid5.UpdateData();
- UltraGridRow uRow = this.ultraGrid5.ActiveRow;
- if (uRow == null) return;
- PlnZyRclMEntity milPlans = (PlnZyRclMEntity)uRow.ListObject;
- string milPlanEntity = JSONFormat.Format(milPlans);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.port.vrp.FrmHttBatchSaplmeNew";
- ccp.MethodName = "cancelBatchSeting";
- ccp.ServerParams = new object[] { milPlanEntity};
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("撤销成功!"))
- {
- doQueryPlan();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 分批完成
- /// </summary>
- private void oprocessBatch()
- {
- this.ultraGrid1.UpdateData();
- this.ultraGrid3.UpdateData();
- UltraGridRow uRow = this.ultraGrid1.ActiveRow;
- List<PortHttBatchSampleResultEntity> lists = portHttBatchSampleResultEntityBindingSource.DataSource as List<PortHttBatchSampleResultEntity>;
- if (uRow == null || lists.Count <= 0)
- {
- return;
- }
- //if (lists.Any(p => p.PhyBatchNo == ""))
- //{
- // MessageUtil.ShowTips("还有未分配批号管材,不允许进行分批完成!");
- // return;
- //}
- PlnZyRclMEntity milPlans = (PlnZyRclMEntity)uRow.ListObject;
- string milPlanEntity = JSONFormat.Format(milPlans);
- List<string> portMilEntity = lists.Select(JSONFormat.Format).ToList();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.port.vrp.FrmHttBatchSaplmeNew";
- ccp.MethodName = "oprocessBatch";
- ccp.ServerParams = new object[] { milPlanEntity, portMilEntity, UserInfo.GetUserName(), UserInfo.GetUserGroup(), UserInfo.GetUserOrder() };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("分批完成!"))
- {
- doQueryPlan();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 撤销分批
- /// </summary>
- private void cancelBatch()
- {
- this.ultraGrid1.UpdateData();
- this.ultraGrid3.UpdateData();
- UltraGridRow uRow = this.ultraGrid1.ActiveRow;
- UltraGridRow row = this.ultraGrid4.ActiveRow;
- if (uRow == null || row == null) return;
- PlnZyRclMEntity milPlans = (PlnZyRclMEntity)uRow.ListObject;
- string milPlanEntity = JSONFormat.Format(milPlans);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.port.vrp.FrmHttBatchSaplmeNew";
- ccp.MethodName = "cancelBatch";
- ccp.ServerParams = new object[] { milPlanEntity, row.Cells["PHY_BATCH_NO"].Text };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("撤销成功!"))
- {
- doQueryPlan();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 撤销取样完成
- /// </summary>
- private void cancelGetSample()
- {
- this.ultraGrid5.UpdateData();
- UltraGridRow uRow = this.ultraGrid5.ActiveRow;
- UltraGridRow row = this.ultraGrid8.ActiveRow;
- if (uRow == null || row == null) return;
- PlnZyRclMEntity milPlans = (PlnZyRclMEntity)uRow.ListObject;
- string milPlanEntity = JSONFormat.Format(milPlans);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.port.vrp.FrmHttBatchSaplmeNew";
- ccp.MethodName = "cancelGetSample";
- ccp.ServerParams = new object[] { milPlanEntity,row.Cells["PHY_BATCH_NO"].Text };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("撤销成功!"))
- {
- doQueryPlan();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 取样完成
- /// </summary>
- private void getSample()
- {
- this.ultraGrid1.UpdateData();
- this.ultraGrid3.UpdateData();
- UltraGridRow uRow = this.ultraGrid1.ActiveRow;
- List<PortHttBatchSampleResultEntity> lists = portHttBatchSampleResultEntityBindingSource.DataSource as List<PortHttBatchSampleResultEntity>;
- if (uRow == null || lists.Count <= 0)
- {
- return;
- }
- //if (lists.Any(p => p.PhyBatchNo == ""))
- //{
- // MessageUtil.ShowTips("还有未进行分批的管材,不允许进行取样!");
- // return;
- //}
- if (lists.Any(p => p.Chk == true && p.SamplePipeLenA == "" && p.SamplePipeLenB == "" && p.SamplePipeLenC == "" && p.SamplePipeLenD == "" && p.SamplePipeLenM == "" && p.SamplePipeLenE == "" && p.SamplePipeLenF == ""&&p.SamplePipeLenP == "" && p.SamplePipeLenQ == ""))
- {
- MessageUtil.ShowTips("还有已选做样管未输入样管长度的管材,不允许进行取样完成!");
- return;
- }
- if (lists.Any(p => p.Chk == true && !StringUtil.IsInt32(p.SamplePipeLenA) && !StringUtil.IsInt32(p.SamplePipeLenB) && !StringUtil.IsInt32(p.SamplePipeLenC) && !StringUtil.IsInt32(p.SamplePipeLenD) && !StringUtil.IsInt32(p.SamplePipeLenM) && !StringUtil.IsInt32(p.SamplePipeLenE) && !StringUtil.IsInt32(p.SamplePipeLenF) && !StringUtil.IsInt32(p.SamplePipeLenP) && !StringUtil.IsInt32(p.SamplePipeLenQ)))
- {
- MessageUtil.ShowTips("样管长度单位为毫米,请输入整数!");
- return;
- }
- PlnZyRclMEntity milPlans = (PlnZyRclMEntity)uRow.ListObject;
- string milPlanEntity = JSONFormat.Format(milPlans);
- List<string> portMilEntity = lists.Where(p=>p.Chk).Select(JSONFormat.Format).ToList();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.port.vrp.FrmHttBatchSaplmeNew";
- ccp.MethodName = "getSample";
- ccp.ServerParams = new object[] { milPlanEntity, portMilEntity, UserInfo.GetUserName(), UserInfo.GetUserGroup(), UserInfo.GetUserOrder(),this.cmbSampleType.Value.ToString() };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("取样完成!"))
- {
- doQueryPlan();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 逐支取样
- /// </summary>
- private void getSamplePipece()
- {
- this.ultraGrid1.UpdateData();
- this.ultraGrid3.UpdateData();
- UltraGridRow uRow = this.ultraGrid1.ActiveRow;
- List<PortHttBatchSampleResultEntity> lists = portHttBatchSampleResultEntityBindingSource.DataSource as List<PortHttBatchSampleResultEntity>;
- if (uRow == null || lists.Count <= 0)
- {
- return;
- }
- PlnZyRclMEntity milPlans = (PlnZyRclMEntity)uRow.ListObject;
- string milPlanEntity = JSONFormat.Format(milPlans);
- List<string> portMilEntity = lists.Where(p => p.Chk).Select(JSONFormat.Format).ToList();
- List<string> batchList = lists.Select(p => p.PhyBatchNo).Distinct().ToList();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.port.vrp.FrmHttBatchSaplmeNew";
- ccp.MethodName = "getSamplePipece";
- ccp.ServerParams = new object[] { milPlanEntity, UserInfo.GetUserName(), UserInfo.GetUserGroup(), UserInfo.GetUserOrder(),this.cmbSampleType.Value.ToString() };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("逐支取样成功!"))
- {
- doQueryPlan();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
-
- }
- /// <summary>
- /// 确认委托
- /// </summary>
- private void confirm()
- {
- this.ultraGrid9.UpdateData();
- this.ultraGrid10.UpdateData();
- this.ultraGrid11.UpdateData();
- this.ultraGrid18.UpdateData();
- UltraGrid ug = null;
- DataTable dataTable = null;
- string craftSource = "";
- if (ultraTabControl3.SelectedTab.Key == "0")
- {
- ug = ultraGrid11;
- dataTable = dataTable3;
- craftSource = "0";
- }
- else if (ultraTabControl3.SelectedTab.Key == "1")
- {
- ug = ultraGrid18;
- dataTable = dataTable5;
- craftSource = "1";
- }
- else if (ultraTabControl3.SelectedTab.Key == "2")
- {
- ug = ultraGrid23;
- dataTable = dataTable7;
- craftSource = "2";
- }
-
- if (ultraGrid10.ActiveRow.Cells["Cic"].Text == "" && ultraGrid10.ActiveRow.Cells["IfProduct"].Text.Trim() == "1")
- {
- MessageUtil.ShowTips("缺少成分索引码,不能确认委托!");
- return;
- }
- UltraGridRow uRow = ultraGrid9.ActiveRow;
- if (uRow == null) return;
- // List<CraftOrdDesignStdCicEntity> chemSource = EntityHelper.GetData<CraftOrdDesignStdCicEntity>(
- //"com.steering.mes.port.vrp.FrmHttBatchSaplmeNew.doQueryChem", new object[] { uRow.Cells["ProPlanId"].Text, uRow.Cells["GxPlanNo"].Text, uRow.Cells["JudgeStoveNo"].Text.Replace("-.*", "") }, this.ob);//查询成分详细信息
- // List<CraftOrdDesignStdPicEntity> phySource = EntityHelper.GetData<CraftOrdDesignStdPicEntity>(
- //"com.steering.mes.port.vrp.FrmHttBatchSaplmeNew.doQueryPhy", new object[] { uRow.Cells["ProPlanId"].Text, uRow.Cells["GxPlanNo"].Text, uRow.Cells["JudgeStoveNo"].Text.Replace("-.*", "") }, this.ob);//查询理化详细信息
- PlnZyRclMEntity milTity = (PlnZyRclMEntity)uRow.ListObject;
- milTity.CraftSource = craftSource;
- string milEntity = JSONFormat.Format(milTity);
- List<List<string>> parmList = new List<List<string>>();
- foreach(UltraGridRow row in ug.Rows)
- {
- int m = 0;
- List<string> list = new List<string>();
- list.Add(row.Cells["PHY_BATCH_NO"].Text);
- list.Add(row.Cells["MAT_NO"].Text);
- list.Add(row.Cells["SAMPLE_PIPE_LEN"].Text);
- list.Add(row.Cells["SAMPLE_POSTION"].Text);
- for (int j = 5; j < dataTable.Columns.Count; j++)
- {
- if (row.Cells[j].Value == "√")
- {
- list.Add(row.Cells[j].Column.Key);
- m = m + 1;
- }
- }
- if (m > 0)
- {
- parmList.Add(list);
- }
-
- }
- List<List<string>> batchList = parmList.GroupBy(p => p[0]).Select(p => p.FirstOrDefault()
- ).ToList();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.port.vrp.FrmHttBatchSaplmeNew";
- ccp.MethodName = "confirm";
- ccp.ServerParams = new object[] { milEntity, parmList, batchList, UserInfo.GetUserName(), UserInfo.GetDepartment(),this.txtConMemo.Text.Trim() };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("委托成功!"))
- {
- doQueryPlan();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 并单委托
- /// </summary>
- private void mergerConfrim()
- {
- this.ultraGrid9.UpdateData();
- this.ultraGrid10.UpdateData();
- this.ultraGrid11.UpdateData();
- this.ultraGrid18.UpdateData();
- UltraGrid ug = null;
- DataTable dataTable = null;
- string craftSource = "";
- if (ultraTabControl3.SelectedTab.Key == "0")
- {
- ug = ultraGrid11;
- dataTable = dataTable3;
- craftSource = "0";
- }
- else if (ultraTabControl3.SelectedTab.Key == "1")
- {
- ug = ultraGrid18;
- dataTable = dataTable5;
- craftSource = "1";
- }
- UltraGridRow uRow = ultraGrid9.ActiveRow;
- if (uRow == null) return;
- PlnZyRclMEntity milTity = (PlnZyRclMEntity)uRow.ListObject;
- milTity.CraftSource = craftSource;
- string milEntity = JSONFormat.Format(milTity);
- List<List<string>> parmList = new List<List<string>>();
- foreach (UltraGridRow row in ug.Rows)
- {
- int m = 0;
- List<string> list = new List<string>();
- list.Add(row.Cells["PHY_BATCH_NO"].Text);
- list.Add(row.Cells["MAT_NO"].Text);
- list.Add(row.Cells["SAMPLE_PIPE_LEN"].Text);
- list.Add(row.Cells["SAMPLE_POSTION"].Text);
- for (int j = 5; j < dataTable.Columns.Count; j++)
- {
- if (row.Cells[j].Value == "√")
- {
- list.Add(row.Cells[j].Column.Key);
- m = m + 1;
- }
- }
- if (m > 0)
- {
- parmList.Add(list);
- }
- }
- List<List<string>> batchList = parmList.GroupBy(p => p[0]).Select(p => p.FirstOrDefault()
- ).ToList();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.port.vrp.FrmHttBatchSaplmeNew";
- ccp.MethodName = "mergerConfrim";
- ccp.ServerParams = new object[] { milEntity, parmList, batchList, UserInfo.GetUserName(), UserInfo.GetDepartment() };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("委托成功!"))
- {
- doQueryPlan();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 取消确认
- /// </summary>
- private void cancelConfirm()
- {
- this.ultraGrid14.UpdateData();
- UltraGridRow uRow = this.ultraGrid12.ActiveRow;
- if (uRow == null) return;
- PlnZyRclMEntity milTity = (PlnZyRclMEntity)uRow.ListObject;
- string milPlanEntity = JSONFormat.Format(milTity);
- //ArrayList parmList = new ArrayList();
- //IQueryable<UltraGridRow> checkMag = this.ultraGrid14.Rows.AsQueryable().Where(" CHK = 'True'");
- //if (checkMag.Count() == 0)
- //{
- // return;
- //}
- //foreach (UltraGridRow row in checkMag)
- //{
- // PortHttBatchSampleResultEntity portHttTity = new PortHttBatchSampleResultEntity();
- // portHttTity.MatNo = row.Cells["MAT_NO"].Text;
- // portHttTity.PhyBatchNo = row.Cells["PHY_BATCH_NO"].Text;
- // portHttTity.CheckNo = row.Cells["CHECK_NO"].Text;
- // string portEntity = JSONFormat.Format(portHttTity);
- // parmList.Add(portEntity);
- //}
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.port.vrp.FrmHttBatchSaplmeNew";
- ccp.MethodName = "cancelConfirm";
- ccp.ServerParams = new object[] { milPlanEntity };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("撤销委托成功!"))
- {
- doQueryPlan();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 查询炉计划
- /// </summary>
- private void doQueryPlan()
- {
- string startTime = "";
- string endTim = "";
- string lotNo = "";
- string judgeNo = "";
- List<PlnZyRclMEntity> listSource = null;
- if (this.chkRegTime.Checked)
- {
- startTime = this.RegStartTime.Value.ToString();
- endTim = this.RegEndTime.Value.ToString();
- }
- if (chkLotNo.Checked && this.txtLotNo.Text.Trim() != "")
- {
- lotNo = this.txtLotNo.Text;
- }
- if (chkJudgeNo.Checked && this.txtJudgeNo.Text.Trim() != "")
- {
- judgeNo = this.txtJudgeNo.Text;
- }
- ArrayList parm = new ArrayList();
- parm.Add(startTime);
- parm.Add(endTim);
- parm.Add(lotNo);
- parm.Add(judgeNo);
- if (this.ultraTabControl1.SelectedTab.Key == "0")
- {
- parm.Add("0");
- listSource = EntityHelper.GetData<PlnZyRclMEntity>(
- "com.steering.mes.port.vrp.FrmHttBatchSaplmeNew.doQueryPlan", new object[] { parm, plineCode }, this.ob);
- }
- else if (this.ultraTabControl1.SelectedTab.Key == "1")
- {
- parm.Add("2");
- listSource = EntityHelper.GetData<PlnZyRclMEntity>(
- "com.steering.mes.port.vrp.FrmHttBatchSaplmeNew.doQueryPlan", new object[] { parm, plineCode }, this.ob);
- }
- else if (this.ultraTabControl1.SelectedTab.Key == "2")
- {
- parm.Add("2");
- listSource = EntityHelper.GetData<PlnZyRclMEntity>(
- "com.steering.mes.port.vrp.FrmHttBatchSaplmeNew.doQueryPlan", new object[] { parm, plineCode }, this.ob);
- }
- else if (this.ultraTabControl1.SelectedTab.Key == "3")
- {
- parm.Add("3");
- listSource = EntityHelper.GetData<PlnZyRclMEntity>(
- "com.steering.mes.port.vrp.FrmHttBatchSaplmeNew.doQueryPipeBaseInfo", new object[] { parm, plineCode }, this.ob);
- }
-
- if (this.ultraTabControl1.SelectedTab.Key == "0")
- {
- plnZyRclMEntityBindingSource1.Clear();
- portHttBatchSampleResultEntityBindingSource.Clear();
- dataTable1.Clear();
- plnZyRclMEntityBindingSource.DataSource = listSource;
- }
- else if (this.ultraTabControl1.SelectedTab.Key == "1")
- {
- plnZyRclMEntityBindingSource3.Clear();
- portHttBatchSampleResultEntityBindingSource1.Clear();
- dataTable2.Clear();
- plnZyRclMEntityBindingSource2.DataSource = listSource;
- }
- else if (this.ultraTabControl1.SelectedTab.Key == "2")
- {
- plnZyRclMEntityBindingSource5.Clear();
- dataTable3.Clear();
- plnZyRclMEntityBindingSource4.DataSource = listSource;
- }
- else if (this.ultraTabControl1.SelectedTab.Key == "3")
- {
- plnZyRclMEntityBindingSource7.Clear();
- dataTable4.Clear();
- plnZyRclMEntityBindingSource6.DataSource = listSource;
- }
-
- }
- private void chkRegTime_CheckedChanged(object sender, EventArgs e)
- {
- this.RegStartTime.Enabled = this.RegEndTime.Enabled = this.chkRegTime.Checked;
- }
- private void chkLotNo_CheckedChanged(object sender, EventArgs e)
- {
- this.txtLotNo.Enabled = this.chkLotNo.Checked;
- }
- private void chkJudgeNo_CheckedChanged(object sender, EventArgs e)
- {
- this.txtJudgeNo.Enabled = this.chkJudgeNo.Checked;
- }
- private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
- {
- this.ultraGrid1.UpdateData();
- UltraGridRow uRow = this.ultraGrid1.ActiveRow;
- batchNoZ = doQueryBacthPline(uRow);
- doQueryBasePlan(uRow);
- doQueryRack(uRow);
- dtPlanDetial = doQueryCheckPlanDetila(uRow);
- if (dtPlanDetial != null && dtPlanDetial.Count() > 0)
- {
- var s = dtPlanDetial.Where(p => p.Rate == "408601" || p.Rate == "408608").ToList();
- if (s.Any())
- {
- dtPlanM = doQueryCheckPlan(uRow, "1");
- }
- else
- {
- dtPlanM = doQueryCheckPlan(uRow, "0");
- }
- }
-
- ultraGrid3.Update();
- ultraGrid3.DataBind();
- ultraGrid3_CellChange(null, null);
- if (dtPlanM == null || dtPlanDetial == null || dtPlanM.Count == 0 || dtPlanDetial.Count == 0)
- {
- txt_BatchMax.Text = "";
- txtBATCH_MIN.Text = this.txtPIPE_NUM.Text;//参考批数;
- return;
- }
- //bool isFlag = dtPlanDetial.Any(p => p.Rate == "408607" || p.Rate == "408608" || p.Rate == "408601");
- //if (isFlag)
- //{
- //}
- //else
- //{
- // if (int.Parse(uRow.Cells["IsBatch"].Text) >= 1)
- // {
- // //txt_BatchMax.Text = this.ultraGrid4.Rows[0].Cells["NUM"].Text;
- // if (this.txt_BatchMax.Text == "")
- // {
- // txtBATCH_MIN.Text = this.txtPIPE_NUM.Text;//参考批数;
- // }
- // else
- // {
- // txtBATCH_MIN.Text = (Math.Ceiling(double.Parse(this.txtPIPE_NUM.Text) / int.Parse(this.txt_BatchMax.Text.ToString3()))).ToString();
- // }
-
- // }
- // else
- // {
- minBatchNum = dtPlanDetial.Min(p => p.BatchCnt == null ? int.Parse(this.txtPIPE_NUM.Text) : (int)(p.BatchCnt));//检验计划最小分批数量
- txt_BatchMax.Text = minBatchNum.ToString();//分批上限
- txtREMARK.Text = dtPlanM.Select(p => p.Remark).Distinct().Aggregate((a, b) => a + " " + b);
- if (minBatchNum == 0)
- {
- txtBATCH_MIN.Text = "0";
- }
- else
- {
- txtBATCH_MIN.Text = (Math.Ceiling(double.Parse(this.txtPIPE_NUM.Text) / minBatchNum)).ToString();//参考批数
- }
- ultraGrid3.Update();
- ultraGrid3.DataBind();
- ultraGrid3_CellChange(null, null);
- //}
- //}
-
-
- }
- private string doQueryBacthPline(UltraGridRow uRow)
- {
- string ss = "";
- DataTable ds = PublicServer.GetData("com.steering.mes.port.mil.FrmMilBatchSampleNew.doQueryBacthNo",new object[]{uRow.Cells["PlineCode"].Text},ob);
- if(ds.Rows.Count >0)
- {
- ss = ds.Rows[0][0].ToString();
- }
- return ss;
- }
-
- private void initBindTable(UltraGridRow row)
- {
- List<PortHttBatchSampleResultEntity> lists = portHttBatchSampleResultEntityBindingSource1.DataSource as List<PortHttBatchSampleResultEntity>;
- DataTable ds = PublicServer.GetData("com.steering.mes.port.vrp.FrmHttBatchSaplmeNew.doQueryHeadNum", new object[] { row.Cells["HeatPlanNo"].Text, row.Cells["JudgeStoveNo"].Text }, ob);
- dataTable2.Rows.Clear();
- if (lists == null || lists.Count() <= 0) return;
- foreach (var list in lists.Where(p => p.PhyBatchNo != "").GroupBy(p => p.PhyBatchNo))
- {
- DataRow newRow;
- newRow = dataTable2.NewRow();
- newRow["PHY_BATCH_NO"] = list.Key;
- newRow["START_SEQ"] = list.Min(p => int.Parse(p.Seq));
- newRow["END_SEQ"] = list.Max(p => int.Parse(p.Seq));
- newRow["NUM"] = list.Count();
- newRow["SAMPLE_NUM"] = list.Count(p => p.SamplePipeLenA != "" || p.SamplePipeLenB != "" || p.SamplePipeLenC != "" || p.SamplePipeLenD != "" || p.SamplePipeLenM != "" || p.SamplePipeLenE != "" || p.SamplePipeLenF != "" || p.SamplePipeLenP != "" || p.SamplePipeLenQ != "");
- if (ds.Rows.Count > 0)
- {
- for (int i = 0; i < ds.Rows.Count; i++)
- {
- if (ds.Rows[i]["BATCH_NO"].ToString() == list.Key)
- {
- newRow["HEAD_NUM"] = ds.Rows[i]["ACOUNT"].ToString();
- }
- }
- }
- //newRow["HEAD_NUM"] = list.Sum(p => (p.SamplePipeLenA == "" ? 0 : 1) + (p.SamplePipeLenB == "" ? 0 : 1) + (p.SamplePipeLenC == "" ? 0 : 1) + (p.SamplePipeLenD == "" ? 0 : 1) + (p.SamplePipeLenM == "" ? 0 : 1) + (p.SamplePipeLenE == "" ? 0 : 1) + (p.SamplePipeLenF == "" ? 0 : 1) + (p.SamplePipeLenP == "" ? 0 : 1) + (p.SamplePipeLenQ == "" ? 0 : 1));
- dataTable2.Rows.Add(newRow);
- }
- ultraGrid8.Update();
- }
- /// <summary>
- /// 自动分批
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void btnAuto_Click(object sender, EventArgs e)
- {
- this.ultraGrid4.UpdateData();
- List<PortHttBatchSampleResultEntity> lists = portHttBatchSampleResultEntityBindingSource.DataSource as List<PortHttBatchSampleResultEntity>;
-
- if (lists==null || lists.Count<=0)
- {
- MessageUtil.ShowTips("不存在有效管号队列,不允许进行分批!");
- return;
- }
- if (dtPlanM.Count <= 0)
- {
- MessageUtil.ShowTips("检验计划未确认,不能自动分批!");
- return;
- }
- int maxBacthNum = int.Parse(this.txt_BatchMax.Text);//分批上限
- int maxBacth = dtPlanM.Max(p => p.BatchNo == null ? 1 : (int)(p.BatchNo));//取主表最大方案
- string sampleLen = "";//样管长度
- string sampleCount = "";//样管数量
-
-
- //为批号赋值
- for (int i = 0; i < int.Parse(this.txtBATCH_MIN.Text);i++)
- {
- var list = dtPlanM1.Where(p => p.BatchNo == (i+1 > maxBacth ? maxBacth : i+1)).ToList();
- var listA = list.Where(p => p.Position == "401201").ToList();
- var listB = list.Where(p => p.Position == "401202").ToList();
- var listC = list.Where(p => p.Position == "401217").ToList();
- var listD = list.Where(p => p.Position == "401218").ToList();
- var listM = list.Where(p => p.Position == "401219").ToList();
- var listE = list.Where(p => p.Position == "401220").ToList();
- var listF = list.Where(p => p.Position == "401221").ToList();
- var listP = list.Where(p => p.Position == "401222").ToList();
- var listQ = list.Where(p => p.Position == "401223").ToList();
- int m = 0;
- for (int k = 0; k < listA.Count; k++)
- {
- var crft = listA[k];
- int a = (int)crft.SampleCount;//样管数量
- for (int j = 0; j < a; j++,m++)
- {
- if (lists.Count > m + i * maxBacthNum)
- {
- lists[m + i * maxBacthNum].SamplePipeLenA = crft.SampleLength.ToString();
- lists[m + i * maxBacthNum].PhyCodeGroup = crft.PhyCodeGroup.ToString();
- lists[m + i * maxBacthNum].Chk = true;
- }
- }
- }
- m = 0;
- for (int k = 0; k < listB.Count; k++)
- {
- var crft = listB[k];
- int a = (int)crft.SampleCount;//样管数量
- for (int j = 0; j < a; j++, m++)
- {
- if (lists.Count > m + i * maxBacthNum)
- {
- lists[m + i * maxBacthNum].SamplePipeLenB = crft.SampleLength.ToString();
- lists[m + i * maxBacthNum].PhyCodeGroupb = crft.PhyCodeGroup.ToString();
- lists[m + i * maxBacthNum].Chk = true;
- }
- }
- }
- m = 0;
- for (int k = 0; k < listC.Count; k++)
- {
- var crft = listC[k];
- int a = (int)crft.SampleCount;//样管数量
- for (int j = 0; j < a; j++, m++)
- {
- if (lists.Count > m + i * maxBacthNum)
- {
- lists[m + i * maxBacthNum].SamplePipeLenC = crft.SampleLength.ToString();
- lists[m + i * maxBacthNum].PhyCodeGroupc = crft.PhyCodeGroup.ToString();
- lists[m + i * maxBacthNum].Chk = true;
- }
- }
- }
- m = 0;
- for (int k = 0; k < listD.Count; k++)
- {
- var crft = listD[k];
- int a = (int)crft.SampleCount;//样管数量
- for (int j = 0; j < a; j++, m++)
- {
- if (lists.Count > m + i * maxBacthNum)
- {
- lists[m + i * maxBacthNum].SamplePipeLenD = crft.SampleLength.ToString();
- lists[m + i * maxBacthNum].PhyCodeGroupd = crft.PhyCodeGroup.ToString();
- lists[m + i * maxBacthNum].Chk = true;
- }
- }
- }
- m = 0;
- for (int k = 0; k < listM.Count; k++)
- {
- var crft = listM[k];
- int a = (int)crft.SampleCount;//样管数量
- for (int j = 0; j < a; j++, m++)
- {
- if (lists.Count > m + i * maxBacthNum)
- {
- lists[m + i * maxBacthNum].SamplePipeLenD = crft.SampleLength.ToString();
- lists[m + i * maxBacthNum].PhyCodeGroupd = crft.PhyCodeGroup.ToString();
- lists[m + i * maxBacthNum].Chk = true;
- }
- }
- }
- m = 0;
- for (int k = 0; k < listE.Count; k++)
- {
- var crft = listE[k];
- int a = (int)crft.SampleCount;//样管数量
- for (int j = 0; j < a; j++, m++)
- {
- if (lists.Count > m + i * maxBacthNum)
- {
- lists[m + i * maxBacthNum].SamplePipeLenE = crft.SampleLength.ToString();
- lists[m + i * maxBacthNum].PhyCodeGroupe = crft.PhyCodeGroup.ToString();
- lists[m + i * maxBacthNum].Chk = true;
- }
- }
- }
- m = 0;
- for (int k = 0; k < listF.Count; k++)
- {
- var crft = listF[k];
- int a = (int)crft.SampleCount;//样管数量
- for (int j = 0; j < a; j++, m++)
- {
- if (lists.Count > m + i * maxBacthNum)
- {
- lists[m + i * maxBacthNum].SamplePipeLenF = crft.SampleLength.ToString();
- lists[m + i * maxBacthNum].PhyCodeGroupf = crft.PhyCodeGroup.ToString();
- lists[m + i * maxBacthNum].Chk = true;
- }
- }
- }
- m = 0;
- for (int k = 0; k < listP.Count; k++)
- {
- var crft = listP[k];
- int a = (int)crft.SampleCount;//样管数量
- for (int j = 0; j < a; j++, m++)
- {
- if (lists.Count > m + i * maxBacthNum)
- {
- lists[m + i * maxBacthNum].SamplePipeLenP = crft.SampleLength.ToString();
- lists[m + i * maxBacthNum].PhyCodeGroupp = crft.PhyCodeGroup.ToString();
- lists[m + i * maxBacthNum].Chk = true;
- }
- }
- }
- m = 0;
- for (int k = 0; k < listQ.Count; k++)
- {
- var crft = listQ[k];
- int a = (int)crft.SampleCount;//样管数量
- for (int j = 0; j < a; j++, m++)
- {
- if (lists.Count > m + i * maxBacthNum)
- {
- lists[m + i * maxBacthNum].SamplePipeLenQ = crft.SampleLength.ToString();
- lists[m + i * maxBacthNum].PhyCodeGroupq = crft.PhyCodeGroup.ToString();
- lists[m + i * maxBacthNum].Chk = true;
- }
- }
- }
- lists.Skip(i * maxBacthNum).Take((i + 1) * maxBacthNum).ToList().ForEach(p => p.PhyBatchNo = batchNoZ + (i + 1).ToString("000"));
-
- }
-
- ultraGrid3.Update();
- ultraGrid3.DataBind();
- ultraGrid3_CellChange(null, null);
-
- }
- /// <summary>
- /// 人工分批
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void btnConfirm_Click(object sender, EventArgs e)
- {
- this.ultraGrid4.UpdateData();
- int sampleNum = 0;
- if (!StringUtil.IsInt32(this.txt_SampleNum.Text.Trim().ToString3()))
- {
- MessageUtil.ShowTips("样管数量需输入正整数!");
- return;
- }
- else
- {
- sampleNum = int.Parse(this.txt_SampleNum.Text.Trim().ToString3());
- }
- if (!StringUtil.IsInt32(txt_BatchMax.Text.ToString3()) || int.Parse(txt_BatchMax.Text.ToString3()) <= 0)
- {
- MessageUtil.ShowTips("人工分批输入的分批上限需为正整数!");
- return;
- }
- List<PortHttBatchSampleResultEntity> lists = portHttBatchSampleResultEntityBindingSource.DataSource as List<PortHttBatchSampleResultEntity>;
- var m = lists.Where(p => p.PhyBatchNo == "").ToList();//判断是否还未分配性能批号集合数据
- if (m.Count == 0)
- {
- return;
- }
- int Bathno = 1;
- for (int k = 0; k < int.Parse(this.txtBATCH_MIN.Text.ToString3()); k++)
- {
- int startSeq = int.Parse(ultraSTART_PIPE_NO.Text);//开始序号
- int endSeq = int.Parse(ultraEND_PIPE_NO.Text);//结束序号
- var lists1 = lists.Where(p => p.PhyBatchNo != "").ToList();
- if (lists1.Any())
- {
- Bathno = lists1.Max(p => int.Parse(p.PhyBatchNo.Substring(2, 3))) + 1;
- }
- m.Take(endSeq - startSeq + 1).ToList().ForEach(p => p.PhyBatchNo = batchNoZ + Bathno.ToString("000"));//赋值批号
- m.Take(sampleNum).ToList().ForEach(p => p.Chk = true);
- ultraSTART_PIPE_NO.Text = m.First().Seq.ToString();//初始序号 跳过已赋值批号数据
- ultraEND_PIPE_NO.Text = m.Take(int.Parse(txt_BatchMax.Text)).Last().Seq.ToString();//结束序号
- ultraGrid3.Update();
- ultraGrid3.DataBind();
- ultraGrid3_CellChange(null, null);
- m = lists.Where(p => p.PhyBatchNo == "").ToList();//判断是否还未分配性能批号集合数据
- if (m.Count == 0)
- {
- return;
- }
- }
- }
- /// <summary>
- /// 查询检验计划子表
- /// </summary>
- /// <param name="uRow"></param>
- /// <returns></returns>
- private List<CraftSamplingDetailEntity> doQueryCheckPlanDetila(UltraGridRow uRow)
- {
- List<CraftSamplingDetailEntity> listSource = EntityHelper.GetData<CraftSamplingDetailEntity>(
- "com.steering.mes.port.vrp.FrmHttBatchSaplmeNew.doQueryCheckPlanDetial", new object[] { uRow.Cells["OrdLnPk"].Text, uRow.Cells["CraftFileNo"].Text, uRow.Cells["CraftSeq"].Text }, this.ob);//查询检验计划主表
- return listSource;
- }
- /// <summary>
- /// 查询检验计划主表
- /// </summary>
- /// <param name="uRow"></param>
- private List<CraftSamplingMEntity> doQueryCheckPlan(UltraGridRow uRow,String flag)
- {
- List<CraftSamplingMEntity> listSource = EntityHelper.GetData<CraftSamplingMEntity>(
- "com.steering.mes.port.vrp.FrmHttBatchSaplmeNew.doQueryCheckPlan", new object[] { uRow.Cells["OrdLnPk"].Text, uRow.Cells["CraftFileNo"].Text, uRow.Cells["CraftSeq"].Text, flag }, this.ob);//查询检验计划主表
- return listSource;
- }
- /// <summary>
- /// 查询炉计划基础信息
- /// </summary>
- /// <param name="row"></param>
- private void doQueryBasePlan(UltraGridRow row)
- {
- List<PlnZyRclMEntity> listSource = EntityHelper.GetData<PlnZyRclMEntity>(
- "com.steering.mes.port.vrp.FrmHttBatchSaplmeNew.doQueryBasePlan", new object[] { row.Cells["ZyBatchId"].Text, row.Cells["JudgeStoveNo"].Text, row.Cells["HeatPlanNo"].Text }, this.ob);
- if (this.ultraTabControl1.SelectedTab.Key == "0")
- {
- plnZyRclMEntityBindingSource1.DataSource = listSource;
- }
- else if (this.ultraTabControl1.SelectedTab.Key == "1")
- {
- plnZyRclMEntityBindingSource3.DataSource = listSource;
- }
- else if (this.ultraTabControl1.SelectedTab.Key == "2")
- {
- plnZyRclMEntityBindingSource5.DataSource = listSource;
- }else if(this.ultraTabControl1.SelectedTab.Key == "3")
- {
- plnZyRclMEntityBindingSource7.DataSource = listSource;
- }
- }
- /// <summary>
- /// 查询管号队列
- /// </summary>
- /// <param name="row"></param>
- private void doQueryRack(UltraGridRow row)
- {
- List<PortHttBatchSampleResultEntity> lists1 = null;
- List<PortHttBatchSampleResultEntity> listSource = null;
- if (this.ultraTabControl1.SelectedTab.Key == "0")
- {
- listSource = EntityHelper.GetData<PortHttBatchSampleResultEntity>(
- "com.steering.mes.port.vrp.FrmHttBatchSaplmeNew.doQueryRackQ", new object[] { row.Cells["HeatPlanNo"].Text, row.Cells["JudgeStoveNo"].Text, row.Cells["IfMatchOdd"].Text, row.Cells["HeatPlanNoOld"].Text }, this.ob);
- portHttBatchSampleResultEntityBindingSource.DataSource = listSource;
- txtPIPE_NUM.Text = listSource.Count.ToString();
- lists1 = portHttBatchSampleResultEntityBindingSource.DataSource as List<PortHttBatchSampleResultEntity>;
- GridHelper.RefreshAndAutoSize(ultraGrid3);
- }
- else if (this.ultraTabControl1.SelectedTab.Key == "1")
- {
- listSource = EntityHelper.GetData<PortHttBatchSampleResultEntity>(
- "com.steering.mes.port.vrp.FrmHttBatchSaplmeNew.doQueryRack", new object[] { row.Cells["HeatPlanNo"].Text, row.Cells["JudgeStoveNo"].Text, row.Cells["IfMatchOdd"].Text, row.Cells["HeatPlanNoOld"].Text }, this.ob);
- List<PortHttBatchSampleResultEntity> lists = listSource as List<PortHttBatchSampleResultEntity>;
- lists.Where(p => p.IsSamplePipe == "1").ToList().ForEach(p => p.Chk = true);
- portHttBatchSampleResultEntityBindingSource1.DataSource = lists;
- initBindTable(row);
- lists1 = portHttBatchSampleResultEntityBindingSource1.DataSource as List<PortHttBatchSampleResultEntity>;
- }
- var k = lists1.Where(p => p.PhyBatchNo == "").ToList();
- if (k.Count() == 0)
- {
- ultraSTART_PIPE_NO.Text = this.txtPIPE_NUM.Text;
- }
- else
- {
- ultraSTART_PIPE_NO.Text = k.First().Seq.ToString();//初始序号 跳过已赋值批号数据
- }
- if (lists1.Count() > 0)
- {
- ultraEND_PIPE_NO.DataSource = lists1;
- ultraEND_PIPE_NO.DisplayMember = "Seq";
- ultraEND_PIPE_NO.ValueMember = "Seq";
- ultraEND_PIPE_NO.SelectedIndex = lists1.Count - 1;
- ultraSTART_PIPE_NO.DataSource = lists1;
- ultraSTART_PIPE_NO.DisplayMember = "Seq";
- ultraSTART_PIPE_NO.ValueMember = "Seq";
- }
-
- }
- private void txt_BatchMax_ValueChanged(object sender, EventArgs e)
- {
- UltraGridRow uRow = this.ultraGrid1.ActiveRow;
- if (uRow == null) return;
- if (!StringUtil.IsInt32(this.txt_BatchMax.Text.Trim()))
- {
- return;
- }
- doQueryRack(uRow);
- dataTable1.Clear();
- if (int.Parse(this.txt_BatchMax.Text) == 0)
- {
- txtBATCH_MIN.Text = "0";
- }else
- {
- txtBATCH_MIN.Text = (Math.Ceiling(double.Parse(this.txtPIPE_NUM.Text) / int.Parse(this.txt_BatchMax.Text))).ToString();
- }
-
- if (dtPlanDetial.Count > 0)
- {
- //bool isBacthFlag = dtPlanDetial.Any(p => p.Rate == "408601" || p.Rate == "408608");//判断是否试样组有生产批
- //if (isBacthFlag)
- //{
- //}
- //else
- //{
- int maxBacth = dtPlanM.Max(p => p.BatchNum == null ? 1 : (int)(p.BatchNum));//取主表最大方案
- int batchNum = int.Parse(txtBATCH_MIN.Text);//实际批数
- dtPlanM1 = dtPlanM.Where(p => p.BatchNum == (batchNum > maxBacth ? maxBacth : batchNum)).ToList();//取具体方案
- //}
- List<PortHttBatchSampleResultEntity> lists = portHttBatchSampleResultEntityBindingSource.DataSource as List<PortHttBatchSampleResultEntity>;
- if (lists == null || lists.Count() == 0)
- {
- return;
- }
- var lists1 = lists.Where(p => p.PhyBatchNo == "").ToList();
- if (lists1.Any())
- {
- ultraSTART_PIPE_NO.Text = lists1.First().Seq.ToString();
- ultraEND_PIPE_NO.Text =
- lists1.Take(int.Parse(txt_BatchMax.Text)).Last().Seq.ToString();
- }
- else
- {
- ultraSTART_PIPE_NO.Text = (lists.Count()).ToString();
- ultraEND_PIPE_NO.Text = (lists.Count()).ToString();
- }
- /* ultraSTART_PIPE_NO.Text = lists.Where(p => p.BatchNo == "").First().Seq.ToString();
- ultraEND_PIPE_NO.Text = lists.Where(p => p.BatchNo == "").Take(int.Parse(txt_BatchMax.Text)).Last().Seq.ToString();*/
- }
- else
- {
- ultraSTART_PIPE_NO.Text = "1";
- ultraEND_PIPE_NO.Text = this.txt_BatchMax.Text;
- }
- }
- private void ultraGrid3_CellChange(object sender, CellEventArgs e)
- {
- this.ultraGrid3.UpdateData();
- dataTable1.Rows.Clear();
- ultraGrid3.Update();
- ultraGrid3.UpdateData();
- List<PortHttBatchSampleResultEntity> lists = portHttBatchSampleResultEntityBindingSource.DataSource as List<PortHttBatchSampleResultEntity>;
- if (lists == null || lists.Count() <= 0) return;
- foreach (var list in lists.Where(p => p.PhyBatchNo != "").GroupBy(p => p.PhyBatchNo))
- {
- DataRow newRow;
- newRow = dataTable1.NewRow();
- newRow["PHY_BATCH_NO"] = list.Key;
- newRow["START_SEQ"] = list.Min(p => int.Parse(p.Seq));
- newRow["END_SEQ"] = list.Max(p => int.Parse(p.Seq));
- newRow["NUM"] = list.Count();
- newRow["SAMPLE_NUM"] = list.Count(p => p.SamplePipeLenA != "" || p.SamplePipeLenB != "" || p.SamplePipeLenC != "" || p.SamplePipeLenD != "" || p.SamplePipeLenM != "" || p.SamplePipeLenE != "" || p.SamplePipeLenF != "" || p.SamplePipeLenP != "" || p.SamplePipeLenQ != "");
- newRow["HEAD_NUM"] = list.Sum(p => (p.SamplePipeLenA == "" ? 0 : 1) + (p.SamplePipeLenB == "" ? 0 : 1) + (p.SamplePipeLenC == "" ? 0 : 1) + (p.SamplePipeLenD == "" ? 0 : 1) + (p.SamplePipeLenM == "" ? 0 : 1) + (p.SamplePipeLenE == "" ? 0 : 1) + (p.SamplePipeLenF == "" ? 0 : 1) + (p.SamplePipeLenP == "" ? 0 : 1) + (p.SamplePipeLenQ == "" ? 0 : 1));
- dataTable1.Rows.Add(newRow);
- }
-
- ultraGrid4.Update();
- if (e != null && (e.Cell.Column.Key == "SamplePipeLenA" || e.Cell.Column.Key == "SamplePipeLenB" || e.Cell.Column.Key == "SamplePipeLenC" || e.Cell.Column.Key == "SamplePipeLenD" || e.Cell.Column.Key == "SamplePipeLenM"))
- {
- if (e.Cell.Row.Cells["Chk"].Value.ToString() == "False")
- {
- MessageUtil.ShowTips("输入长度前,请勾选样管!");
- return;
- }
- }
- if (e != null && e.Cell.Column.Key == "Chk")
- {
- if (e.Cell.Value.ToString() == "True")
- {
- e.Cell.Row.RowSelectorAppearance.BackColor = Color.Red;
- txtMatNo.Text = e.Cell.Row.Cells["MatNo"].Text;
- }
- else
- {
- e.Cell.Row.RowSelectorAppearance.BackColor = Color.Empty;
- }
- }
- }
- private void ultraGrid5_AfterRowActivate(object sender, EventArgs e)
- {
- this.ultraGrid5.UpdateData();
- UltraGridRow uRow = this.ultraGrid5.ActiveRow;
- if (uRow == null) return;
- doQueryRack(uRow);
- doQueryBasePlan(uRow);
- }
- DataTable dtChem = new DataTable();
- DataTable dtPhy = new DataTable();
- private void ultraGrid9_AfterRowActivate(object sender, EventArgs e)
- {
- this.ultraGrid9.UpdateData();
- UltraGridRow uRow = this.ultraGrid9.ActiveRow;
- if (uRow == null) return;
- doQuerySampleRack(uRow,"0");//查询正常样管信息
- doQuerySampleRack(uRow,"1");//查询首日检样管信息
- doQuerySampleRack(uRow, "2");//查询生产加样样管信息
- doQueryBasePlan(uRow);
- doQueryPhyChem(uRow,"0");//查询正常样成分、理化项目明细
- doQueryPhyChem(uRow,"1");//查询首日检成分、理化项目明细
- doQueryPhyChem(uRow, "2");//查询生产加样成分、理化项目明细
- initBaseInfo(uRow);//加载已委托检验单
-
- }
- private void initBaseInfo(UltraGridRow row)
- {
- DataTable ds = PublicServer.GetData("com.steering.mes.port.vrp.FrmHttBatchSaplmeNew.initBaseInfo", new object[] { row.Cells["JudgeStoveNo"].Text, "F" }, ob);
- if (ds != null && ds.Rows.Count > 0)
- {
- //cmbCheckNo.DataSource = ds;
- //cmbCheckNo.ValueMember = "CHECK_NO_VALUE";
- }
- }
- private void ultraGrid12_AfterRowActivate(object sender, EventArgs e)
- {
- this.ultraGrid12.UpdateData();
- UltraGridRow uRow = this.ultraGrid12.ActiveRow;
- if (uRow == null) return;
- doQueryBasePlan(uRow);
- doQuerySampleNo(uRow);//查询试样号信息
- }
- /// <summary>
- /// 查询试样号信息
- /// </summary>
- /// <param name="uRow"></param>
- private void doQuerySampleNo(UltraGridRow uRow)
- {
- while (dataTable4.Columns.Count > 5)
- {
- dataTable4.Columns.RemoveAt(5);
- }
- DataTable dtSample = PublicServer.GetData("com.steering.mes.port.vrp.FrmHttBatchSaplmeNew.doQueryDetialSampleNo",
- new Object[] { uRow.Cells["CheckNo"].Text }, ob);
- dataTable4.Rows.Clear();
- dtSample.AsEnumerable().GroupBy(p => new { BatchNo = p["BATCH_NO"].ToString(), Sample = p["HEAD_MAT_NO"].ToString(),MatNo = p["MAT_NO"].ToString(),CheckNo = p["CHECK_NO"].ToString() }).ToList()
- .ForEach(p =>
- {
- foreach (DataRow row in p)
- {
- if (!dataTable4.Columns.Contains(row["PHY_CODE_MAX"].ToString()))
- {
- DataColumn phyCloum = new DataColumn();
- phyCloum.ColumnName = row["PHY_CODE_MAX"].ToString();
- phyCloum.Caption = row["PHY_NAME_MAX"].ToString();
- dataTable4.Columns.Add(phyCloum);
- }
- }
- DataRow dr = dataTable4.NewRow();
- dr["PHY_BATCH_NO"] = p.Key.BatchNo;
- dr["HEAD_MAT_NO"] = p.Key.Sample;
- dr["SAMPLE_LEN"] = p.Max(q => q["SAMPLE_LEN"]);
- dr["MAT_NO"] = p.Key.MatNo;
- dr["CHECK_NO"] = p.Key.CheckNo;
- foreach (DataRow row in p)
- {
- dr[row["PHY_CODE_MAX"].ToString()] = row["SAMPLE_COUNT"].ToString();
- }
- dataTable4.Rows.Add(dr);
- });
- ultraGrid14.DataBind();
- GridHelper.RefreshAndAutoSize(ultraGrid14);
- }
- /// <summary>
- /// 查询成分理化项目明细
- /// </summary>
- /// <param name="uRow"></param>
- private void doQueryPhyChem(UltraGridRow uRow,string sampleType)
- {
- DataTable dataTable = null;
- UltraGrid ug = null;
- string craftSource = "";
- if (sampleType == "0")
- {
- dataTable = dataTable3;
- ug = ultraGrid11;
- craftSource = "0";
- }
- else if (sampleType == "1")
- {
- dataTable = dataTable5;
- ug = ultraGrid18;
- craftSource = "2";
- ultraLabel17.Text = "";
- }
- else if (sampleType == "2")
- {
- dataTable = dataTable7;
- ug = ultraGrid23;
- craftSource = "0";
- }
- while (dataTable.Columns.Count > 5)
- {
- dataTable.Columns.RemoveAt(5);
- }
- dtChem = PublicServer.GetData("com.steering.mes.port.vrp.FrmHttBatchSaplmeNew.doQueryChem", new Object[] { uRow.Cells["ProPlanId"].Text, uRow.Cells["GxPlanNo"].Text, BaseMethod.getJudgeStoveNo(uRow.Cells["JudgeStoveNo"].Text), craftSource, uRow.Cells["HeatPlanNo"].Text }, ob);//查询成分明细
- if (dtChem.Rows.Count > 0)
- {
- DataColumn hxCloum = new DataColumn();
- hxCloum.ColumnName = "HX";
- hxCloum.Caption = "化学";
- dataTable.Columns.Add(hxCloum);
- }
- dtPhy = PublicServer.GetData("com.steering.mes.port.vrp.FrmHttBatchSaplmeNew.doQueryPhy", new Object[] { uRow.Cells["ProPlanId"].Text, uRow.Cells["GxPlanNo"].Text,BaseMethod.getJudgeStoveNo(uRow.Cells["JudgeStoveNo"].Text) , craftSource,uRow.Cells["Pic"].Text }, ob);//查询理化明细
- string[] phyMaxCode = null;
- ultraLabel4.Text = "";
- List<string> list = new List<string>();
- if (dtPhy.Rows.Count > 0)
- {
- dtPhy.AsEnumerable().Select(p => new { Code = p["PHY_CODE_MIN"].ToString(), Name = p["PHY_NAME_MIN"].ToString(), rate = p["RATE"].ToString(), rateName = p["DESC_RATE"].ToString(), common = p["COMMON"].ToString() }).Distinct().ToList()
- .ForEach(p =>
- {
- DataColumn phyCloum = new DataColumn();
- phyCloum.ColumnName = p.Code;
- phyCloum.Caption = p.Name;
- try
- {
- dataTable.Columns.Add(phyCloum);
- }
- catch
- { };
- if (p.rate.Equals("408601") || p.rate.Equals("408608"))
- {
- ultraLabel4.Text = ultraLabel4.Text + p.Name + " 取样频次:" + p.rateName;
- list.Add(p.Code);
- }
- if (sampleType == "1")
- {
- if (p.common.Equals("1"))
- {
- ultraLabel17.Text = ultraLabel17.Text + p.Name + " (共样) ";
- }
- }
- });
- }
- foreach (DataRow dr in dataTable.Rows)
- {
- string[] phyCodeGroup = dr["PHY_CODE_GROUP"].ToString().Split(',');
- for (int i = 5; i < dataTable.Columns.Count; i++)
- {
- if (phyCodeGroup.Contains(dataTable.Columns[i].ColumnName))
- {
- dr[i] = "√";
- }
- }
- }
- phyMaxCode = list.ToArray();
- ug.DataBind();
- GridHelper.RefreshAndAutoSize(ug);
- ultraLabel4.ForeColor = Color.Red;
- ultraLabel17.ForeColor = Color.Red;
- //if (phyMaxCode.Length > 0)
- //{
- // doQueryPhyCodeMax(phyMaxCode, uRow.Cells["LotNo"].Text);
- //}
- }
- private void doQueryPhyCodeMax(string[] phyMaxCode, string lotNo)
- {
- List<PipeCheckconsignDetailEntity> listSource = EntityHelper.GetData<PipeCheckconsignDetailEntity>(
- "com.steering.mes.port.mil.FrmMilBatchSampleNew.doQueryPhyCodeMax", new object[] { lotNo, phyMaxCode }, this.ob);
- pipeCheckconsignDetailEntityBindingSource.DataSource = listSource;
- }
- /// <summary>
- /// 查询正常样管信息
- /// </summary>
- private void doQuerySampleRack(UltraGridRow uRow, string sampleType)
- {
- DataTable dtBatchNo = null;
- if (sampleType == "0")
- {
- dtBatchNo = PublicServer.GetData("com.steering.mes.port.vrp.FrmHttBatchSaplmeNew.doQuerySampleInfo",
- new Object[] { uRow.Cells["ZyBatchId"].Text, uRow.Cells["JudgeStoveNo"].Text, sampleType }, ob);
- }else if(sampleType == "1")
- {
- dtBatchNo = PublicServer.GetData("com.steering.mes.port.vrp.FrmHttBatchSaplmeNew.doQuerySampleInfo",
- new Object[] { uRow.Cells["ZyBatchId"].Text, uRow.Cells["JudgeStoveNo"].Text, "1" }, ob);
- }
- else if (sampleType == "2")
- {
- dtBatchNo = PublicServer.GetData("com.steering.mes.port.vrp.FrmHttBatchSaplmeNew.doQuerySampleInfo",
- new Object[] { uRow.Cells["ZyBatchId"].Text, uRow.Cells["JudgeStoveNo"].Text, "2" }, ob);
- }
- if (sampleType == "0")
- {
- GridHelper.CopyDataToDatatable(dtBatchNo, dataTable3, true);
- }
- else if (sampleType == "1")
- {
- GridHelper.CopyDataToDatatable(dtBatchNo, dataTable5, true);
- }
- else if (sampleType == "2")
- {
- GridHelper.CopyDataToDatatable(dtBatchNo, dataTable7, true);
- }
- //DataTable dataTable = null;
- //UltraGrid ug = null;
- //if (sampleType == "0")
- //{
- // dataTable = dataTable3;
- // ug = ultraGrid11;
- //}
- //else if (sampleType == "1")
- //{
- // dataTable = dataTable5;
- // ug = ultraGrid18;
- //}
- //dataTable.Rows.Clear();
- //foreach (DataRow row in dtBatchNo.Rows)
- //{
- // if (row["SAMPLE_PIPE_LEN_A"] != null && row["SAMPLE_PIPE_LEN_A"].ToString() != "")
- // {
- // DataRow newRowA = dataTable.NewRow();
- // newRowA["PHY_BATCH_NO"] = row["PHY_BATCH_NO"].ToString();
- // newRowA["MAT_NO"] = row["MAT_NO"].ToString();
- // newRowA["SAMPLE_PIPE_LEN"] = row["SAMPLE_PIPE_LEN_A"].ToString();
- // newRowA["SAMPLE_POSTION"] = "A端";
- // newRowA["PHY_CODE_GROUP"] = row["PHY_CODE_GROUP"].ToString();
- // dataTable.Rows.Add(newRowA);
- // }
- // if (row["SAMPLE_PIPE_LEN_B"] != null && row["SAMPLE_PIPE_LEN_B"].ToString() != "")
- // {
- // DataRow newRowA = dataTable.NewRow();
- // newRowA["PHY_BATCH_NO"] = row["PHY_BATCH_NO"].ToString();
- // newRowA["MAT_NO"] = row["MAT_NO"].ToString();
- // newRowA["SAMPLE_PIPE_LEN"] = row["SAMPLE_PIPE_LEN_B"].ToString();
- // newRowA["SAMPLE_POSTION"] = "B端";
- // newRowA["PHY_CODE_GROUP"] = row["PHY_CODE_GROUPB"].ToString();
- // dataTable.Rows.Add(newRowA);
- // }
- // if (row["SAMPLE_PIPE_LEN_C"] != null && row["SAMPLE_PIPE_LEN_C"].ToString() != "")
- // {
- // DataRow newRowA = dataTable.NewRow();
- // newRowA["PHY_BATCH_NO"] = row["PHY_BATCH_NO"].ToString();
- // newRowA["MAT_NO"] = row["MAT_NO"].ToString();
- // newRowA["SAMPLE_PIPE_LEN"] = row["SAMPLE_PIPE_LEN_C"].ToString();
- // newRowA["SAMPLE_POSTION"] = "C端";
- // newRowA["PHY_CODE_GROUP"] = row["PHY_CODE_GROUPC"].ToString();
- // dataTable.Rows.Add(newRowA);
- // }
- // if (row["SAMPLE_PIPE_LEN_D"] != null && row["SAMPLE_PIPE_LEN_D"].ToString() != "")
- // {
- // DataRow newRowA = dataTable.NewRow();
- // newRowA["PHY_BATCH_NO"] = row["PHY_BATCH_NO"].ToString();
- // newRowA["MAT_NO"] = row["MAT_NO"].ToString();
- // newRowA["SAMPLE_PIPE_LEN"] = row["SAMPLE_PIPE_LEN_D"].ToString();
- // newRowA["SAMPLE_POSTION"] = "D端";
- // newRowA["PHY_CODE_GROUP"] = row["PHY_CODE_GROUPD"].ToString();
- // dataTable.Rows.Add(newRowA);
- // }
- // if (row["SAMPLE_PIPE_LEN_M"] != null && row["SAMPLE_PIPE_LEN_M"].ToString() != "")
- // {
- // DataRow newRowA = dataTable.NewRow();
- // newRowA["PHY_BATCH_NO"] = row["PHY_BATCH_NO"].ToString();
- // newRowA["MAT_NO"] = row["MAT_NO"].ToString();
- // newRowA["SAMPLE_PIPE_LEN"] = row["SAMPLE_PIPE_LEN_M"].ToString();
- // newRowA["SAMPLE_POSTION"] = "M端";
- // newRowA["PHY_CODE_GROUP"] = row["PHY_CODE_GROUPM"].ToString();
- // dataTable.Rows.Add(newRowA);
- // }
- // if (row["SAMPLE_PIPE_LEN_E"] != null && row["SAMPLE_PIPE_LEN_E"].ToString() != "")
- // {
- // DataRow newRowA = dataTable.NewRow();
- // newRowA["PHY_BATCH_NO"] = row["PHY_BATCH_NO"].ToString();
- // newRowA["MAT_NO"] = row["MAT_NO"].ToString();
- // newRowA["SAMPLE_PIPE_LEN"] = row["SAMPLE_PIPE_LEN_E"].ToString();
- // newRowA["SAMPLE_POSTION"] = "E端";
- // newRowA["PHY_CODE_GROUP"] = row["PHY_CODE_GROUPE"].ToString();
- // dataTable.Rows.Add(newRowA);
- // }
- // if (row["SAMPLE_PIPE_LEN_F"] != null && row["SAMPLE_PIPE_LEN_F"].ToString() != "")
- // {
- // DataRow newRowA = dataTable.NewRow();
- // newRowA["PHY_BATCH_NO"] = row["PHY_BATCH_NO"].ToString();
- // newRowA["MAT_NO"] = row["MAT_NO"].ToString();
- // newRowA["SAMPLE_PIPE_LEN"] = row["SAMPLE_PIPE_LEN_F"].ToString();
- // newRowA["SAMPLE_POSTION"] = "F端";
- // newRowA["PHY_CODE_GROUP"] = row["PHY_CODE_GROUPF"].ToString();
- // dataTable.Rows.Add(newRowA);
- // }
- // if (row["SAMPLE_PIPE_LEN_P"] != null && row["SAMPLE_PIPE_LEN_P"].ToString() != "")
- // {
- // DataRow newRowA = dataTable.NewRow();
- // newRowA["PHY_BATCH_NO"] = row["PHY_BATCH_NO"].ToString();
- // newRowA["MAT_NO"] = row["MAT_NO"].ToString();
- // newRowA["SAMPLE_PIPE_LEN"] = row["SAMPLE_PIPE_LEN_P"].ToString();
- // newRowA["SAMPLE_POSTION"] = "P端";
- // newRowA["PHY_CODE_GROUP"] = row["PHY_CODE_GROUPP"].ToString();
- // dataTable.Rows.Add(newRowA);
- // }
- // if (row["SAMPLE_PIPE_LEN_Q"] != null && row["SAMPLE_PIPE_LEN_Q"].ToString() != "")
- // {
- // DataRow newRowA = dataTable.NewRow();
- // newRowA["PHY_BATCH_NO"] = row["PHY_BATCH_NO"].ToString();
- // newRowA["MAT_NO"] = row["MAT_NO"].ToString();
- // newRowA["SAMPLE_PIPE_LEN"] = row["SAMPLE_PIPE_LEN_Q"].ToString();
- // newRowA["SAMPLE_POSTION"] = "Q端";
- // newRowA["PHY_CODE_GROUP"] = row["PHY_CODE_GROUPQ"].ToString();
- // dataTable.Rows.Add(newRowA);
- // }
- //}
- //GridHelper.RefreshAndAutoSize(ug);
- }
- private void ultraGrid11_ClickCell(object sender, ClickCellEventArgs e)
- {
- this.ultraGrid9.UpdateData();
- UltraGridRow uRow = this.ultraGrid9.ActiveRow;
- if (uRow == null) return;
- string craftSource = "";
- if (ultraTabControl3.SelectedTab.Key == "0")
- {
- craftSource = "0";
- }
- else if (ultraTabControl3.SelectedTab.Key == "1")
- {
- craftSource = "2";
- }
- else
- {
- craftSource = "0";
- }
-
- if (e.Cell.Column.Key != "PHY_BATCH_NO" && e.Cell.Column.Key != "MAT_NO" && e.Cell.Column.Key != "SAMPLE_PIPE_LEN" && e.Cell.Column.Key != "SAMPLE_POSTION")
- {
- if (e.Cell.Text.Trim() == "")
- {
- DataTable ds = new DataTable();
- if (e.Cell.Column.Key == "C0004" || e.Cell.Column.Key == "C0100" || e.Cell.Column.Key == "C0103" || e.Cell.Column.Key == "C0107")
- {
- if(ultraGrid11.DisplayLayout.Bands[0].Columns.Exists("C0030")){
- ds = PublicServer.GetData("com.steering.mes.port.vrp.FrmHttBatchSaplmeNew.doQueryS", new object[] { craftSource, uRow.Cells["ProPlanId"].Text, uRow.Cells["GxPlanNo"].Text, uRow.Cells["JudgeStoveNo"].Text, "C0030", uRow.Cells["Pic"].Text }, ob);
- if (ds.Rows[0]["SSC_CONDITION"].ToString().Equals("409902"))
- {
- e.Cell.Row.Cells["C0030"].Value = "√";
- }
- }
- if (ultraGrid11.DisplayLayout.Bands[0].Columns.Exists("C0033"))
- {
- ds = PublicServer.GetData("com.steering.mes.port.vrp.FrmHttBatchSaplmeNew.doQueryS", new object[] { craftSource, uRow.Cells["ProPlanId"].Text, uRow.Cells["GxPlanNo"].Text, uRow.Cells["JudgeStoveNo"].Text, "C0033", uRow.Cells["Pic"].Text }, ob);
- if (ds.Rows[0]["SSC_CONDITION"].ToString().Equals("409902"))
- {
- e.Cell.Row.Cells["C0033"].Value = "√";
- }
- } if (ultraGrid11.DisplayLayout.Bands[0].Columns.Exists("C0133"))
- {
- ds = PublicServer.GetData("com.steering.mes.port.vrp.FrmHttBatchSaplmeNew.doQueryS", new object[] { craftSource, uRow.Cells["ProPlanId"].Text, uRow.Cells["GxPlanNo"].Text, uRow.Cells["JudgeStoveNo"].Text, "C0133", uRow.Cells["Pic"].Text }, ob);
- if (ds.Rows[0]["SSC_CONDITION"].ToString().Equals("409902"))
- {
- e.Cell.Row.Cells["C0133"].Value = "√";
- }
- }
- }
- else if (e.Cell.Column.Key == "C0030")
- {
- ds = PublicServer.GetData("com.steering.mes.port.vrp.FrmHttBatchSaplmeNew.doQueryS", new object[] { craftSource, uRow.Cells["ProPlanId"].Text, uRow.Cells["GxPlanNo"].Text, uRow.Cells["JudgeStoveNo"].Text, "C0030", uRow.Cells["Pic"].Text }, ob);
- if (ds.Rows[0]["SSC_CONDITION"].ToString().Equals("409902"))
- {
- if (ultraGrid11.DisplayLayout.Bands[0].Columns.Exists("C0107"))
- {
- e.Cell.Row.Cells["C0107"].Value = "√";
- }
- else if (ultraGrid11.DisplayLayout.Bands[0].Columns.Exists("C0103"))
- {
- e.Cell.Row.Cells["C0103"].Value = "√";
- }
- else if (ultraGrid11.DisplayLayout.Bands[0].Columns.Exists("C0100"))
- {
- e.Cell.Row.Cells["C0100"].Value = "√";
- }
- else if (ultraGrid11.DisplayLayout.Bands[0].Columns.Exists("C0004"))
- {
- e.Cell.Row.Cells["C0004"].Value = "√";
- }
-
-
- }
- }
- else if (e.Cell.Column.Key == "C0033")
- {
- ds = PublicServer.GetData("com.steering.mes.port.vrp.FrmHttBatchSaplmeNew.doQueryS", new object[] { craftSource, uRow.Cells["ProPlanId"].Text, uRow.Cells["GxPlanNo"].Text, uRow.Cells["JudgeStoveNo"].Text, "C0033", uRow.Cells["Pic"].Text }, ob);
- if (ds.Rows[0]["SSC_CONDITION"].ToString().Equals("409902"))
- {
- if (ultraGrid11.DisplayLayout.Bands[0].Columns.Exists("C0107"))
- {
- e.Cell.Row.Cells["C0107"].Value = "√";
- }
- else if (ultraGrid11.DisplayLayout.Bands[0].Columns.Exists("C0103"))
- {
- e.Cell.Row.Cells["C0103"].Value = "√";
- }
- else if (ultraGrid11.DisplayLayout.Bands[0].Columns.Exists("C0100"))
- {
- e.Cell.Row.Cells["C0100"].Value = "√";
- }
- else if (ultraGrid11.DisplayLayout.Bands[0].Columns.Exists("C0004"))
- {
- e.Cell.Row.Cells["C0004"].Value = "√";
- }
- }
- }
- else if (e.Cell.Column.Key == "C0133")
- {
- ds = PublicServer.GetData("com.steering.mes.port.vrp.FrmHttBatchSaplmeNew.doQueryS", new object[] { craftSource, uRow.Cells["ProPlanId"].Text, uRow.Cells["GxPlanNo"].Text, uRow.Cells["JudgeStoveNo"].Text, "C0133", uRow.Cells["Pic"].Text }, ob);
- if (ds.Rows[0]["SSC_CONDITION"].ToString().Equals("409902"))
- {
- if (ultraGrid11.DisplayLayout.Bands[0].Columns.Exists("C0107"))
- {
- e.Cell.Row.Cells["C0107"].Value = "√";
- }
- else if (ultraGrid11.DisplayLayout.Bands[0].Columns.Exists("C0103"))
- {
- e.Cell.Row.Cells["C0103"].Value = "√";
- }
- else if (ultraGrid11.DisplayLayout.Bands[0].Columns.Exists("C0100"))
- {
- e.Cell.Row.Cells["C0100"].Value = "√";
- }
- else if (ultraGrid11.DisplayLayout.Bands[0].Columns.Exists("C0004"))
- {
- e.Cell.Row.Cells["C0004"].Value = "√";
- }
- }
- }
- e.Cell.Value = "√";
- }
- else
- {
- DataTable ds = new DataTable();
- if (e.Cell.Column.Key == "C0004" || e.Cell.Column.Key == "C0100" || e.Cell.Column.Key == "C0103" || e.Cell.Column.Key == "C0107")
- {
- if (ultraGrid11.DisplayLayout.Bands[0].Columns.Exists("C0030"))
- {
- ds = PublicServer.GetData("com.steering.mes.port.vrp.FrmHttBatchSaplmeNew.doQueryS", new object[] { craftSource, uRow.Cells["ProPlanId"].Text, uRow.Cells["GxPlanNo"].Text, uRow.Cells["JudgeStoveNo"].Text, "C0030", uRow.Cells["Pic"].Text }, ob);
- if (ds.Rows[0]["SSC_CONDITION"].ToString().Equals("409902"))
- {
- e.Cell.Row.Cells["C0030"].Value = "";
- }
- }
- if (ultraGrid11.DisplayLayout.Bands[0].Columns.Exists("C0033"))
- {
- ds = PublicServer.GetData("com.steering.mes.port.vrp.FrmHttBatchSaplmeNew.doQueryS", new object[] { craftSource, uRow.Cells["ProPlanId"].Text, uRow.Cells["GxPlanNo"].Text, uRow.Cells["JudgeStoveNo"].Text, "C0033", uRow.Cells["Pic"].Text }, ob);
- if (ds.Rows[0]["SSC_CONDITION"].ToString().Equals("409902"))
- {
- e.Cell.Row.Cells["C0033"].Value = "";
- }
- } if (ultraGrid11.DisplayLayout.Bands[0].Columns.Exists("C0133"))
- {
- ds = PublicServer.GetData("com.steering.mes.port.vrp.FrmHttBatchSaplmeNew.doQueryS", new object[] { craftSource, uRow.Cells["ProPlanId"].Text, uRow.Cells["GxPlanNo"].Text, uRow.Cells["JudgeStoveNo"].Text, "C0133", uRow.Cells["Pic"].Text }, ob);
- if (ds.Rows[0]["SSC_CONDITION"].ToString().Equals("409902"))
- {
- e.Cell.Row.Cells["C0133"].Value = "";
- }
- }
- }
- else if (e.Cell.Column.Key == "C0030")
- {
- ds = PublicServer.GetData("com.steering.mes.port.vrp.FrmHttBatchSaplmeNew.doQueryS", new object[] { craftSource, uRow.Cells["ProPlanId"].Text, uRow.Cells["GxPlanNo"].Text, uRow.Cells["JudgeStoveNo"].Text, "C0030", uRow.Cells["Pic"].Text }, ob);
- if (ds.Rows[0]["SSC_CONDITION"].ToString().Equals("409902"))
- {
- if (ultraGrid11.DisplayLayout.Bands[0].Columns.Exists("C0107"))
- {
- e.Cell.Row.Cells["C0107"].Value = "";
- }
- else if (ultraGrid11.DisplayLayout.Bands[0].Columns.Exists("C0103"))
- {
- e.Cell.Row.Cells["C0103"].Value = "";
- }
- else if (ultraGrid11.DisplayLayout.Bands[0].Columns.Exists("C0100"))
- {
- e.Cell.Row.Cells["C0100"].Value = "";
- }
- else if (ultraGrid11.DisplayLayout.Bands[0].Columns.Exists("C0004"))
- {
- e.Cell.Row.Cells["C0004"].Value = "";
- }
- }
- }
- else if (e.Cell.Column.Key == "C0033")
- {
- ds = PublicServer.GetData("com.steering.mes.port.vrp.FrmHttBatchSaplmeNew.doQueryS", new object[] { craftSource, uRow.Cells["ProPlanId"].Text, uRow.Cells["GxPlanNo"].Text, uRow.Cells["JudgeStoveNo"].Text, "C0033", uRow.Cells["Pic"].Text }, ob);
- if (ds.Rows[0]["SSC_CONDITION"].ToString().Equals("409902"))
- {
- if (ultraGrid11.DisplayLayout.Bands[0].Columns.Exists("C0107"))
- {
- e.Cell.Row.Cells["C0107"].Value = "";
- }
- else if (ultraGrid11.DisplayLayout.Bands[0].Columns.Exists("C0103"))
- {
- e.Cell.Row.Cells["C0103"].Value = "";
- }
- else if (ultraGrid11.DisplayLayout.Bands[0].Columns.Exists("C0100"))
- {
- e.Cell.Row.Cells["C0100"].Value = "";
- }
- else if (ultraGrid11.DisplayLayout.Bands[0].Columns.Exists("C0004"))
- {
- e.Cell.Row.Cells["C0004"].Value = "";
- }
- }
- }
- else if (e.Cell.Column.Key == "C0133")
- {
- ds = PublicServer.GetData("com.steering.mes.port.vrp.FrmHttBatchSaplmeNew.doQueryS", new object[] { craftSource, uRow.Cells["ProPlanId"].Text, uRow.Cells["GxPlanNo"].Text, uRow.Cells["JudgeStoveNo"].Text, "C0133", uRow.Cells["Pic"].Text }, ob);
- if (ds.Rows[0]["SSC_CONDITION"].ToString().Equals("409902"))
- {
- if (ultraGrid11.DisplayLayout.Bands[0].Columns.Exists("C0107"))
- {
- e.Cell.Row.Cells["C0107"].Value = "";
- }
- else if (ultraGrid11.DisplayLayout.Bands[0].Columns.Exists("C0103"))
- {
- e.Cell.Row.Cells["C0103"].Value = "";
- }
- else if (ultraGrid11.DisplayLayout.Bands[0].Columns.Exists("C0100"))
- {
- e.Cell.Row.Cells["C0100"].Value = "";
- }
- else if (ultraGrid11.DisplayLayout.Bands[0].Columns.Exists("C0004"))
- {
- e.Cell.Row.Cells["C0004"].Value = "";
- }
- }
- }
- e.Cell.Value = "";
- }
- }
- }
- private void FrmMilBatchSampleNew_Shown(object sender, EventArgs e)
- {
- if (toolMenu == null || toolMenu.Toolbars == null) return;
- if (toolMenu.Toolbars[0].Tools.Exists("CancelBatchSeting"))
- {
- toolMenu.Toolbars[0].Tools["CancelBatchSeting"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("Confirm"))
- {
- toolMenu.Toolbars[0].Tools["Confirm"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("CancelConfirm"))
- {
- toolMenu.Toolbars[0].Tools["CancelConfirm"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("Print"))
- {
- toolMenu.Toolbars[0].Tools["Print"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("PrintLable"))
- {
- toolMenu.Toolbars[0].Tools["PrintLable"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("CancelGetSample"))
- {
- toolMenu.Toolbars[0].Tools["CancelGetSample"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("QueryRepeate"))
- {
- toolMenu.Toolbars[0].Tools["QueryRepeate"].InstanceProps.Visible = DefaultableBoolean.False;
- }
-
- if (toolMenu.Toolbars[0].Tools.Exists("ReGetSample"))
- {
- toolMenu.Toolbars[0].Tools["ReGetSample"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("CancelReGetSample"))
- {
- toolMenu.Toolbars[0].Tools["CancelReGetSample"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("RepeateFrim"))
- {
- toolMenu.Toolbars[0].Tools["RepeateFrim"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("CancelRepeateFrim"))
- {
- toolMenu.Toolbars[0].Tools["CancelRepeateFrim"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("PrintRe"))
- {
- toolMenu.Toolbars[0].Tools["PrintRe"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("PrintReLable"))
- {
- toolMenu.Toolbars[0].Tools["PrintReLable"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- btnConfirm.Visible = false;
- btnAuto.Visible = false;
- buttonBatchNo.Visible = false;
- buttonGetSample.Visible = false;
- buttonSd.Visible = true;
- txt_BatchMax.ReadOnly = true;
- }
- private void ultraTabControl1_SelectedTabChanged(object sender, Infragistics.Win.UltraWinTabControl.SelectedTabChangedEventArgs e)
- {
- if (toolMenu == null || toolMenu.Toolbars == null) return;
- if (toolMenu.Toolbars[0].Tools.Exists("Query")) { toolMenu.Toolbars[0].Tools["Query"].InstanceProps.Visible = this.ultraTabControl1.SelectedTab.Index == 4 || this.ultraTabControl1.SelectedTab.Index == 5 ? DefaultableBoolean.False : DefaultableBoolean.True; }
- if (toolMenu.Toolbars[0].Tools.Exists("BatchSeting")) { toolMenu.Toolbars[0].Tools["BatchSeting"].InstanceProps.Visible = this.ultraTabControl1.SelectedTab.Index == 0 ? DefaultableBoolean.True : DefaultableBoolean.False; }
- if (toolMenu.Toolbars[0].Tools.Exists("CancelBatchSeting")) { toolMenu.Toolbars[0].Tools["CancelBatchSeting"].InstanceProps.Visible = this.ultraTabControl1.SelectedTab.Index == 1 ? DefaultableBoolean.True : DefaultableBoolean.False; }
- if (toolMenu.Toolbars[0].Tools.Exists("OprocessBatch")) { toolMenu.Toolbars[0].Tools["OprocessBatch"].InstanceProps.Visible = this.ultraTabControl1.SelectedTab.Index == 0 ? DefaultableBoolean.True : DefaultableBoolean.False; }
- if (toolMenu.Toolbars[0].Tools.Exists("CancelOprocessBatch")) { toolMenu.Toolbars[0].Tools["CancelOprocessBatch"].InstanceProps.Visible = this.ultraTabControl1.SelectedTab.Index == 0 ? DefaultableBoolean.True : DefaultableBoolean.False; }
- if (toolMenu.Toolbars[0].Tools.Exists("GetSample")) { toolMenu.Toolbars[0].Tools["GetSample"].InstanceProps.Visible = this.ultraTabControl1.SelectedTab.Index == 0 ? DefaultableBoolean.True : DefaultableBoolean.False; }
- if (toolMenu.Toolbars[0].Tools.Exists("Approval")) { toolMenu.Toolbars[0].Tools["Approval"].InstanceProps.Visible = this.ultraTabControl1.SelectedTab.Index == 0 ? DefaultableBoolean.True : DefaultableBoolean.False; }
- if (toolMenu.Toolbars[0].Tools.Exists("ComfrimComplete")) { toolMenu.Toolbars[0].Tools["ComfrimComplete"].InstanceProps.Visible = this.ultraTabControl1.SelectedTab.Index == 0 ? DefaultableBoolean.True : DefaultableBoolean.False; }
- if (toolMenu.Toolbars[0].Tools.Exists("CancelGetSample")) { toolMenu.Toolbars[0].Tools["CancelGetSample"].InstanceProps.Visible = this.ultraTabControl1.SelectedTab.Index == 1 ? DefaultableBoolean.True : DefaultableBoolean.False; }
- if (toolMenu.Toolbars[0].Tools.Exists("Confirm")) { toolMenu.Toolbars[0].Tools["Confirm"].InstanceProps.Visible = this.ultraTabControl1.SelectedTab.Index == 2 ? DefaultableBoolean.True : DefaultableBoolean.False; }
- if (toolMenu.Toolbars[0].Tools.Exists("CancelConfirm")) { toolMenu.Toolbars[0].Tools["CancelConfirm"].InstanceProps.Visible = this.ultraTabControl1.SelectedTab.Index == 3 ? DefaultableBoolean.True : DefaultableBoolean.False; }
- if (toolMenu.Toolbars[0].Tools.Exists("Print")) { toolMenu.Toolbars[0].Tools["Print"].InstanceProps.Visible = this.ultraTabControl1.SelectedTab.Index == 3 ? DefaultableBoolean.True : DefaultableBoolean.False; }
- if (toolMenu.Toolbars[0].Tools.Exists("PrintLable")) { toolMenu.Toolbars[0].Tools["PrintLable"].InstanceProps.Visible = this.ultraTabControl1.SelectedTab.Index == 3 ? DefaultableBoolean.True : DefaultableBoolean.False; }
- if (toolMenu.Toolbars[0].Tools.Exists("ReGetSample")) { toolMenu.Toolbars[0].Tools["ReGetSample"].InstanceProps.Visible = this.ultraTabControl1.SelectedTab.Index == 4 ? DefaultableBoolean.True : DefaultableBoolean.False; }
- if (toolMenu.Toolbars[0].Tools.Exists("CancelReGetSample")) { toolMenu.Toolbars[0].Tools["CancelReGetSample"].InstanceProps.Visible = this.ultraTabControl1.SelectedTab.Index == 4 ? DefaultableBoolean.True : DefaultableBoolean.False; }
- if (toolMenu.Toolbars[0].Tools.Exists("QueryRepeate")) { toolMenu.Toolbars[0].Tools["QueryRepeate"].InstanceProps.Visible = this.ultraTabControl1.SelectedTab.Index == 4 || this.ultraTabControl1.SelectedTab.Index == 5 ? DefaultableBoolean.True : DefaultableBoolean.False; }
- if (toolMenu.Toolbars[0].Tools.Exists("RepeateFrim")) { toolMenu.Toolbars[0].Tools["RepeateFrim"].InstanceProps.Visible = this.ultraTabControl1.SelectedTab.Index == 5 ? DefaultableBoolean.True : DefaultableBoolean.False; }
- if (toolMenu.Toolbars[0].Tools.Exists("CancelRepeateFrim")) { toolMenu.Toolbars[0].Tools["CancelRepeateFrim"].InstanceProps.Visible = this.ultraTabControl1.SelectedTab.Index == 5 ? DefaultableBoolean.True : DefaultableBoolean.False; }
- if (toolMenu.Toolbars[0].Tools.Exists("PrintRe")) { toolMenu.Toolbars[0].Tools["PrintRe"].InstanceProps.Visible = this.ultraTabControl1.SelectedTab.Index == 5 ? DefaultableBoolean.True : DefaultableBoolean.False; }
- if (toolMenu.Toolbars[0].Tools.Exists("PrintReLable")) { toolMenu.Toolbars[0].Tools["PrintReLable"].InstanceProps.Visible = this.ultraTabControl1.SelectedTab.Index == 5 ? DefaultableBoolean.True : DefaultableBoolean.False; }
- }
- /// <summary>
- /// 纯手工分批
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void buttonSd_Click(object sender, EventArgs e)
- {
- this.ultraGrid4.UpdateData();
- UltraGridRow row = this.ultraGrid1.ActiveRow;
- if (row == null) return;
- List<PortHttBatchSampleResultEntity> lists = portHttBatchSampleResultEntityBindingSource.DataSource as List<PortHttBatchSampleResultEntity>;
- var m = lists.Where(p => p.PhyBatchNo == "").ToList();//判断是否还未分配性能批号集合数据
- if (m.Count == 0)
- {
- return;
- }
- int Bathno = 1;
- int tsBatchNo = 0;//探伤最大批号
- int pipeBatchNo = 0;//检验最大批号
- int sampleNum = int.Parse(this.txt_SampleNum.Text.ToString3());
- int startSeq = int.Parse(ultraSTART_PIPE_NO.Text);//开始序号
- int endSeq = int.Parse(ultraEND_PIPE_NO.Text);//结束序号
- if(this.txt_BatchMax.Text.Trim() != "")
- {
- if (endSeq - startSeq + 1 > int.Parse(this.txt_BatchMax.Text.ToString3()))
- {
- MessageUtil.ShowTips("分批数量不能大于工艺要求分批上限!");
- return;
- }
- }
-
- var lists1 = lists.Where(p => p.PhyBatchNo != "").ToList();
- if (lists1.Any())
- {
- Bathno = lists1.Max(p => int.Parse(p.PhyBatchNo.Substring(2, 3))) + 1;
-
- }
- DataTable ds = PublicServer.GetData("com.steering.mes.port.vrp.FrmHttBatchSaplmeNew.doQueryMaxBatchNo", new object[] { row.Cells["HeatPlanNo"].Text, row.Cells["PlineCode"].Text }, ob);//查询探伤实绩最大的批号
- if (ds.Rows.Count > 0)
- {
- tsBatchNo = int.Parse(ds.Rows[0][0].ToString());
- }
- DataTable dsPipe = PublicServer.GetData("com.steering.mes.port.vrp.FrmHttBatchSaplmeNew.doQueryMaxBatchNoPipe", new object[] { row.Cells["JudgeStoveNo"].Text, row.Cells["PlineCode"].Text }, ob);//查询探检验最大的批号
- if (dsPipe.Rows.Count > 0)
- {
- pipeBatchNo = int.Parse(dsPipe.Rows[0][0].ToString());
- }
- if (pipeBatchNo > Bathno)
- {
- Bathno = pipeBatchNo;
- }
- //if (tsBatchNo > pipeBatchNo)
- //{
- // if (tsBatchNo > Bathno)
- // {
- // Bathno = tsBatchNo;
- // }
- //}
- //else
- //{
- // if (pipeBatchNo > Bathno)
- // {
- // Bathno = pipeBatchNo;
- // }
- //}
- m.Take(endSeq - startSeq + 1).ToList().ForEach(p => p.PhyBatchNo = batchNoZ + Bathno.ToString("000"));//赋值批号
- //m.Take(sampleNum).ToList().ForEach(p => p.Chk = true);
- List<PortHttBatchSampleResultEntity> lists2 = portHttBatchSampleResultEntityBindingSource.DataSource as List<PortHttBatchSampleResultEntity>;
-
- var k = lists2.Where(p =>p.PhyBatchNo == "").ToList();
- if (k.Count() > 0)
- {
- ultraSTART_PIPE_NO.Text = k.First().Seq.ToString();//初始序号 跳过已赋值批号数据
- }
- else
- {
- ultraSTART_PIPE_NO.Text = (lists2.Count()).ToString();
- }
- ultraEND_PIPE_NO.Text = (lists2.Count()).ToString();//结束序号
- ultraGrid3.Update();
- ultraGrid3.DataBind();
- ultraGrid3_CellChange(null, null);
- for (int i = 0; i < this.ultraGrid3.Rows.Count();i++)
- {
- if (this.ultraGrid3.Rows[i].Cells["PhyBatchNo"].Value.ToString2() == "") return;
- if (ultraGrid3.Rows[0].Cells["SamplePipeLenA"].Value.ToString2() != "" || ultraGrid3.Rows[0].Cells["SamplePipeLenB"].Value.ToString2() != "" || ultraGrid3.Rows[0].Cells["SamplePipeLenC"].Value.ToString2() != "" || ultraGrid3.Rows[0].Cells["SamplePipeLenD"].Value.ToString2() != "" || ultraGrid3.Rows[0].Cells["SamplePipeLenM"].Value.ToString2() != "")
- {
- this.ultraGrid3.Rows[0].RowSelectorAppearance.BackColor = Color.Red;
- }
- if (i == 0)
- {
- this.ultraGrid3.Rows[0].Appearance.BackColor = color1;
- }
- else
- {
- PortHttBatchSampleResultEntity lastList = ultraGrid3.Rows[ultraGrid3.Rows[i - 1].Index].ListObject as PortHttBatchSampleResultEntity;
- if ((this.ultraGrid3.Rows[i].Cells["PhyBatchNo"].Value.ToString2() == lastList.PhyBatchNo))
- {
- this.ultraGrid3.Rows[i].Appearance.BackColor = ultraGrid3.Rows[ultraGrid3.Rows[i - 1].Index].Appearance.BackColor;
- }
- else
- {
- this.ultraGrid3.Rows[i].Appearance.BackColor = ultraGrid3.Rows[ultraGrid3.Rows[i - 1].Index].Appearance.BackColor == color1 ? color2 : color1;
- }
- }
- }
- }
-
-
- /// <summary>
- /// 仅分批
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void buttonBatchNo_Click(object sender, EventArgs e)
- {
- this.ultraGrid4.UpdateData();
- if (!StringUtil.IsInt32(txt_BatchMax.Text.ToString3()) || int.Parse(txt_BatchMax.Text.ToString3()) <= 0)
- {
- MessageUtil.ShowTips("人工分批输入的分批上限需为正整数!");
- return;
- }
- List<PortHttBatchSampleResultEntity> lists = portHttBatchSampleResultEntityBindingSource.DataSource as List<PortHttBatchSampleResultEntity>;
- var m = lists.Where(p => p.PhyBatchNo == "").ToList();//判断是否还未分配性能批号集合数据
- if (m.Count == 0)
- {
- return;
- }
- int Bathno = 1;
- int sampleNum = 0;
- for (int k = 0; k < int.Parse(this.txtBATCH_MIN.Text.ToString3()); k++)
- {
- int startSeq = int.Parse(ultraSTART_PIPE_NO.Text);//开始序号
- int endSeq = int.Parse(ultraEND_PIPE_NO.Text);//结束序号
- var lists1 = lists.Where(p => p.PhyBatchNo != "").ToList();
- if (lists1.Any())
- {
- Bathno = lists1.Max(p => int.Parse(p.PhyBatchNo.Substring(2, 3))) + 1;
- }
- m.Take(endSeq - startSeq + 1).ToList().ForEach(p => p.PhyBatchNo = batchNoZ + Bathno.ToString("000"));//赋值批号
- m.Take(sampleNum).ToList().ForEach(p => p.Chk = true);
- ultraSTART_PIPE_NO.Text = m.First().Seq.ToString();//初始序号 跳过已赋值批号数据
- ultraEND_PIPE_NO.Text = m.Take(int.Parse(txt_BatchMax.Text.ToString3())).Last().Seq.ToString();//结束序号
- ultraGrid3.Update();
- ultraGrid3.DataBind();
- ultraGrid3_CellChange(null, null);
- m = lists.Where(p => p.PhyBatchNo == "").ToList();//判断是否还未分配性能批号集合数据
- if (m.Count == 0)
- {
- return;
- }
- }
- }
- /// <summary>
- /// 逐支取样
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void pipeceButtonStd_Click(object sender, EventArgs e)
- {
- this.ultraGrid1.UpdateData();
- this.ultraGrid3.UpdateData();
- UltraGridRow uRow = this.ultraGrid1.ActiveRow;
- if (uRow == null) return;
- string len = "";
- List<PortHttBatchSampleResultEntity> lists = portHttBatchSampleResultEntityBindingSource.DataSource as List<PortHttBatchSampleResultEntity>;
- var m = lists.Where(p => p.PhyBatchNo != "").ToList();//判断是否还未分配性能批号集合数据
- if (m.Count == 0)
- {
- return;
- }
- if (this.txtPieceLen.Text == "")
- {
- MessageUtil.ShowTips("请输入逐支取样长度!");
- return;
- }
- if (!StringUtil.IsInt(this.txtPieceLen.Text.Trim().ToString3()))
- {
- MessageUtil.ShowTips("逐支取样长度需输入正整数!");
- return;
- }
- len = this.txtPieceLen.Text.Trim();
- DataTable ds = PublicServer.GetData("com.steering.mes.port.vrp.FrmHttBatchSaplmeNew.doQueryPhyMaxPipece", new object[] { uRow.Cells["ProPlanId"].Text, uRow.Cells["GxPlanNo"].Text, uRow.Cells["JudgeStoveNo"].Text, this.cmbSampleType.Value.ToString() }, ob);
- if (ds.Rows.Count == 0)
- {
- MessageUtil.ShowTips("无逐支取样试样组,不允许一键取样!");
- return;
- }
- var status = new List<string> { };
- status = this.cmbPiecePostion.CheckedItems.Select(p => p.DataValue.ToString()).ToList();
- if (!status.Any()) status = new List<string> { "401201", "401202", "401217", "401218", "401219", "401220", "401221", "401222", "401223" };
- List<PipeCheckconsignDetailEntity> listS = EntityHelper.GetData<PipeCheckconsignDetailEntity>(
- "com.steering.mes.port.vrp.FrmHttBatchSaplmeNew.doQuerySampleMatNo", new object[] { uRow.Cells["JudgeStoveNo"].Text, this.cmbSampleType.Value.ToString() }, this.ob);
- for (int i = 0; i < lists.Count; i++)
- {
- var p = lists[i];
- if (status.ToArray().Length == 1)
- {
- var listD = listS.Where(q => q.MatNo == p.MatNo).ToList();
- if (listD.Any()) return;
- if (status.Contains("401201") || status.Contains("401202"))
- {
- if (i == 0)
- {
- p.SamplePipeLenA = len;
- }
- else
- {
- var LastlistD = listS.Where(q => q.MatNo == lists[i - 1].MatNo).ToList();
- if (LastlistD.Any())
- {
- if (LastlistD[0].Postion == "A")
- {
- p.SamplePipeLenB = len;
- }
- else
- {
- p.SamplePipeLenA = len;
- }
- }
- else
- {
- if (lists[i - 1].SamplePipeLenA == "")
- {
- p.SamplePipeLenA = len;
- }
- else
- {
- p.SamplePipeLenB = len;
- }
- }
- }
- }
- if (status.Contains("401217"))
- {
- p.SamplePipeLenC = len;
- }
- if (status.Contains("401218"))
- {
- p.SamplePipeLenD = len;
- }
- if (status.Contains("401219"))
- {
- p.SamplePipeLenM = len;
- }
- if (status.Contains("401220"))
- {
- p.SamplePipeLenE = len;
- }
- if (status.Contains("401221"))
- {
- p.SamplePipeLenF = len;
- }
- if (status.Contains("401222"))
- {
- p.SamplePipeLenP = len;
- }
- if (status.Contains("401223"))
- {
- p.SamplePipeLenQ = len;
- }
- }
- else
- {
- var listD = listS.Where(q => q.MatNo == p.MatNo).ToList();
- if (listD.Any()) return;
- if (status.Contains("401201"))
- {
- p.SamplePipeLenA = len;
- }
- if (status.Contains("401202"))
- {
- p.SamplePipeLenB = len;
- }
- if (status.Contains("401217"))
- {
- p.SamplePipeLenC = len;
- }
- if (status.Contains("401218"))
- {
- p.SamplePipeLenD = len;
- }
- if (status.Contains("401219"))
- {
- p.SamplePipeLenM = len;
- }
- if (status.Contains("401220"))
- {
- p.SamplePipeLenE = len;
- }
- if (status.Contains("401221"))
- {
- p.SamplePipeLenF = len;
- }
- if (status.Contains("401222"))
- {
- p.SamplePipeLenP = len;
- }
- if (status.Contains("401223"))
- {
- p.SamplePipeLenQ = len;
- }
- }
- p.ChemResultCode = "1";
- p.Chk = true;
- }
- ultraGrid3.Update();
- ultraGrid3.DataBind();
- ultraGrid3_CellChange(null, null);
- }
- /// <summary>
- /// 仅取样
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void buttonGetSample_Click(object sender, EventArgs e)
- {
- this.ultraGrid4.UpdateData();
- int sampleNum = 0;
- List<PortHttBatchSampleResultEntity> lists = portHttBatchSampleResultEntityBindingSource.DataSource as List<PortHttBatchSampleResultEntity>;
- var m = lists.Where(p => p.PhyBatchNo != "").ToList();//判断是否还未分配性能批号集合数据
- if (m.Count == 0)
- {
- return;
- }
- if (!StringUtil.IsInt32(this.txt_SampleNum.Text.Trim().ToString3()))
- {
- MessageUtil.ShowTips("样管数量需输入正整数!");
- return;
- }
- if (int.Parse(this.txt_SampleNum.Text.Trim().ToString3()) <= 0)
- {
- MessageUtil.ShowTips("取样时每批样管数应大于0");
- return;
- }
- else
- {
- sampleNum = int.Parse(this.txt_SampleNum.Text.Trim().ToString3());
- }
- if (dtPlanM1 == null || dtPlanM1.Count() == 0)
- {
-
- foreach (var item in m.GroupBy(p => p.PhyBatchNo))
- {
- item.Take(sampleNum).ToList().ForEach(p => p.Chk = true);
- }
- }
- else
- {
- int maxBacthNum = int.Parse(this.ultraGrid4.Rows[0].Cells["NUM"].Text);//分批上限
- int maxBacth = dtPlanM.Max(p => p.BatchNo == null ? 1 : (int)(p.BatchNo));//取主表最大方案
- for (int i = 0; i < m.GroupBy(p => p.PhyBatchNo).Count(); i++)
- {
- var list = dtPlanM1.Where(p => p.BatchNo == (i + 1 > maxBacth ? maxBacth : i + 1)).ToList();
- var listA = list.Where(p => p.Position == "401201").ToList();
- var listB = list.Where(p => p.Position == "401202").ToList();
- var listC = list.Where(p => p.Position == "401217").ToList();
- var listD = list.Where(p => p.Position == "401218").ToList();
- int s = 0;
- for (int k = 0; k < listA.Count; k++)
- {
- var crft = list[k];
- int a = (int)crft.SampleCount;//样管数量
- for (int j = 0; j < a; j++, s++)
- {
- if (lists.Count > s + i * maxBacthNum)
- {
- lists[s + i * maxBacthNum].SamplePipeLenA = crft.SampleLength.ToString();
- lists[s + i * maxBacthNum].PhyCodeGroup = crft.PhyCodeGroup.ToString();
- lists[s + i * maxBacthNum].Chk = true;
- }
- }
- }
- s = 0;
- for (int k = 0; k < listB.Count; k++)
- {
- var crft = list[k];
- int a = (int)crft.SampleCount;//样管数量
- for (int j = 0; j < a; j++, s++)
- {
- if (lists.Count > s + i * maxBacthNum)
- {
- lists[s + i * maxBacthNum].SamplePipeLenB = crft.SampleLength.ToString();
- lists[s + i * maxBacthNum].PhyCodeGroupb = crft.PhyCodeGroup.ToString();
- lists[s + i * maxBacthNum].Chk = true;
- }
- }
- }
- s = 0;
- for (int k = 0; k < listC.Count; k++)
- {
- var crft = list[k];
- int a = (int)crft.SampleCount;//样管数量
- for (int j = 0; j < a; j++, s++)
- {
- if (lists.Count > s + i * maxBacthNum)
- {
- lists[s + i * maxBacthNum].SamplePipeLenC = crft.SampleLength.ToString();
- lists[s + i * maxBacthNum].PhyCodeGroupc = crft.PhyCodeGroup.ToString();
- lists[s + i * maxBacthNum].Chk = true;
- }
- }
- }
- s = 0;
- for (int k = 0; k < listD.Count; k++)
- {
- var crft = list[k];
- int a = (int)crft.SampleCount;//样管数量
- for (int j = 0; j < a; j++, s++)
- {
- if (lists.Count > s + i * maxBacthNum)
- {
- lists[s + i * maxBacthNum].SamplePipeLenD = crft.SampleLength.ToString();
- lists[s + i * maxBacthNum].PhyCodeGroupd = crft.PhyCodeGroup.ToString();
- lists[s + i * maxBacthNum].Chk = true;
- }
- }
- }
- }
- }
- ultraGrid3.Update();
- ultraGrid3.DataBind();
- ultraGrid3_CellChange(null, null);
- }
- private void txtBATCH_MIN_ValueChanged(object sender, EventArgs e)
- {
- if (txtBATCH_MIN.Text == "") return;
- if (dtPlanM == null || dtPlanDetial == null || dtPlanM.Count == 0 || dtPlanDetial.Count == 0)
- {
- return;
- }
- //bool isBacthFlag = dtPlanDetial.Any(p => p.Rate == "408601" || p.Rate == "408608");//判断是否试样组有生产批
- //if (isBacthFlag)
- //{
- //}
- //else
- //{
- int maxBacth = dtPlanM.Max(p => p.BatchNum == null ? 1 : (int)(p.BatchNum));//取主表最大方案
- int batchNum = int.Parse(txtBATCH_MIN.Text.ToString3());//实际批数
- dtPlanM1 = dtPlanM.Where(p => p.BatchNum == (batchNum > maxBacth ? maxBacth : batchNum)).ToList();//取具体方案
- //}
- }
- private void ultraTabControl2_SelectedTabChanged(object sender, Infragistics.Win.UltraWinTabControl.SelectedTabChangedEventArgs e)
- {
- if (ultraTabControl2.SelectedTab.Key == "0")
- {
- btnConfirm.Visible = false;
- btnAuto.Visible = false;
- buttonBatchNo.Visible = false;
- buttonGetSample.Visible = false;
- buttonSd.Visible = true;
- pipeceButtonStd.Visible = true;
- txt_BatchMax.ReadOnly = true;
- ultraLabel3.Visible = true;
- txtBatchCount.Visible = true;
- this.ultraSTART_PIPE_NO.ReadOnly = true;
- }
- else if (ultraTabControl2.SelectedTab.Key == "1")
- {
- btnConfirm.Visible = true;
- btnAuto.Visible = true;
- buttonBatchNo.Visible = true;
- buttonGetSample.Visible = true;
- buttonSd.Visible = false;
- pipeceButtonStd.Visible = false;
- txt_BatchMax.ReadOnly = false;
- ultraLabel3.Visible = false;
- txtBatchCount.Visible = false;
- this.ultraSTART_PIPE_NO.ReadOnly = true;
- }
- else if (ultraTabControl2.SelectedTab.Key == "2")
- {
- btnConfirm.Visible = false;
- btnAuto.Visible = false;
- buttonBatchNo.Visible = false;
- buttonGetSample.Visible = false;
- pipeceButtonStd.Visible = false;
- buttonSd.Visible = false;
- ultraLabel3.Visible = false;
- txtBatchCount.Visible = false;
- txt_BatchMax.ReadOnly = true;
- this.ultraSTART_PIPE_NO.ReadOnly = false;
- }
- }
- private void txtBatchCount_ValueChanged(object sender, EventArgs e)
- {
- List<PortHttBatchSampleResultEntity> lists = portHttBatchSampleResultEntityBindingSource.DataSource as List<PortHttBatchSampleResultEntity>;
- if (!StringUtil.IsInt32(txtBatchCount.Text.ToString3()))
- {
- MessageUtil.ShowTips("分批数量请输入整数!");
- return;
- }
- if ((int.Parse(ultraSTART_PIPE_NO.Text.ToString3()) + Math.Abs(int.Parse(txtBatchCount.Text.ToString3())) - 1) > lists.Max(p => int.Parse(p.Seq)))
- {
- ultraEND_PIPE_NO.Text = lists.Max(p =>int.Parse(p.Seq)).ToString();
- }
- else
- {
- ultraEND_PIPE_NO.Text = (int.Parse(ultraSTART_PIPE_NO.Text.ToString3()) + Math.Abs(int.Parse(txtBatchCount.Text.ToString3())) - 1).ToString();
- }
-
- }
- private void ultraGrid3_InitializeRow(object sender, InitializeRowEventArgs e)
- {
- PortHttBatchSampleResultEntity portHttBatchSampleResultEntity = e.Row.ListObject as PortHttBatchSampleResultEntity;
- if (portHttBatchSampleResultEntity.PhyBatchNo == "") return;
- if (portHttBatchSampleResultEntity.IsSamplePipe == "1")
- {
- ultraGrid3.Rows[e.Row.Index].RowSelectorAppearance.BackColor = Color.Red;
- }
- if (e.Row.Index == 0)
- {
- e.Row.Appearance.BackColor = color1;
- }
- else
- {
- PortHttBatchSampleResultEntity lastList = ultraGrid3.Rows[e.Row.Index - 1].ListObject as PortHttBatchSampleResultEntity;
- if (portHttBatchSampleResultEntity.PhyBatchNo == lastList.PhyBatchNo)
- {
- e.Row.Appearance.BackColor = ultraGrid3.Rows[e.Row.Index - 1].Appearance.BackColor;
- }
- else
- {
- e.Row.Appearance.BackColor = ultraGrid3.Rows[e.Row.Index - 1].Appearance.BackColor == color1 ? color2 : color1;
- }
- }
- }
- private void txtLen_ValueChanged(object sender, EventArgs e)
- {
- if (!StringUtil.IsInt(this.txtLen.Text)) return;
- List<PortHttBatchSampleResultEntity> list1 = null;
- //if (ultraTabControl3.SelectedTab.Key == "0")
- //{
- list1 = portHttBatchSampleResultEntityBindingSource.DataSource as List<PortHttBatchSampleResultEntity>;
- if (list1.Any())
- {
- if (this.cmbPostion.Value.ToString().Equals("401201"))//A端
- {
- list1.Where(p => p.MatNo == txtMatNo.Text).ToList().ForEach(p =>p.SamplePipeLenA = txtLen.Text);
- }
- else if (this.cmbPostion.Value.ToString().Equals("401202"))
- {
- list1.Where(p => p.MatNo == txtMatNo.Text).ToList().ForEach(p => p.SamplePipeLenB = txtLen.Text);
- }
- else if (this.cmbPostion.Value.ToString().Equals("401217"))
- {
- list1.Where(p => p.MatNo == txtMatNo.Text).ToList().ForEach(p => p.SamplePipeLenC = txtLen.Text);
- }
- else if (this.cmbPostion.Value.ToString().Equals("401218"))
- {
- list1.Where(p => p.MatNo == txtMatNo.Text).ToList().ForEach(p => p.SamplePipeLenD = txtLen.Text);
- }
- else if (this.cmbPostion.Value.ToString().Equals("401219"))
- {
- list1.Where(p => p.MatNo == txtMatNo.Text).ToList().ForEach(p => p.SamplePipeLenM = txtLen.Text);
- }
- else if (this.cmbPostion.Value.ToString().Equals("401220"))
- {
- list1.Where(p => p.MatNo == txtMatNo.Text).ToList().ForEach(p => p.SamplePipeLenE = txtLen.Text);
- }
- else if (this.cmbPostion.Value.ToString().Equals("401221"))
- {
- list1.Where(p => p.MatNo == txtMatNo.Text).ToList().ForEach(p => p.SamplePipeLenF = txtLen.Text);
- }
- else if (this.cmbPostion.Value.ToString().Equals("401222"))
- {
- list1.Where(p => p.MatNo == txtMatNo.Text).ToList().ForEach(p => p.SamplePipeLenP = txtLen.Text);
- }
- else if (this.cmbPostion.Value.ToString().Equals("401223"))
- {
- list1.Where(p => p.MatNo == txtMatNo.Text).ToList().ForEach(p => p.SamplePipeLenQ = txtLen.Text);
- }
- }
- ultraGrid3_CellChange(null, null);
- ultraGrid3.Refresh();
- //}
- //else if (ultraTabControl3.SelectedTab.Key == "1")
- //{
- // list1 = portHttBatchSampleResultEntityBindingSource2.DataSource as List<PortHttBatchSampleResultEntity>;
- //}
- }
- private void ultraGrid15_AfterRowActivate(object sender, EventArgs e)
- {
- this.ultraGrid15.UpdateData();
- UltraGridRow uRow = this.ultraGrid15.ActiveRow;
- if (uRow == null) return;
- List<PipeCheckconsignNoqualifiedEntity> listSource = EntityHelper.GetData<PipeCheckconsignNoqualifiedEntity>(
- "com.steering.mes.port.mil.FrmMilBatchSampleNew.doQueryRepeateInformation", new object[] { uRow.Cells["CheckNo"].Text, uRow.Cells["JudgeStoveNo"].Text }, this.ob);
- pipeCheckconsignNoqualifiedEntityBindingSource2.DataSource = listSource;
- List<PortHttBatchSampleResultEntity> listSource1 = EntityHelper.GetData<PortHttBatchSampleResultEntity>(
- "com.steering.mes.port.vrp.FrmHttBatchSaplmeNew.doQueryRepeatRack", new object[] { uRow.Cells["JudgeStoveNo"].Text }, this.ob);
- portHttBatchSampleResultEntityBindingSource2.DataSource = listSource1;
- foreach (UltraGridRow row in this.ultraGrid17.Rows)
- {
- if (row.Cells["IsSamplePipe"].Text == "1")
- {
- row.RowSelectorAppearance.BackColor = Color.Red;
- }
- }
- }
- private void ultraGrid19_AfterRowActivate(object sender, EventArgs e)
- {
- UltraGridRow uRow = this.ultraGrid19.ActiveRow;
- if (uRow == null) return;
- List<PipeCheckconsignNoqualifiedEntity> listSource = EntityHelper.GetData<PipeCheckconsignNoqualifiedEntity>(
- "com.steering.mes.port.mil.FrmMilBatchSampleNew.doQueryRepeateInformation", new object[] { uRow.Cells["CheckNo"].Text, uRow.Cells["JudgeStoveNo"].Text }, this.ob);
- pipeCheckconsignNoqualifiedEntityBindingSource4.DataSource = listSource;
- doQueryResampleRck(uRow);
- doQueryChemPhy(uRow);
- doQueryResampleNo(uRow);//复取样委托信息
- }
- private void doQueryResampleNo(UltraGridRow uRow)
- {
- while (dataTable6.Columns.Count > 3)
- {
- dataTable6.Columns.RemoveAt(3);
- }
- DataTable dtSample = PublicServer.GetData("com.steering.mes.port.mil.FrmMilBatchSampleNew.doQueryReDetialSampleNo",
- new Object[] { uRow.Cells["CheckNo"].Text, "2", "F" }, ob);
- dataTable6.Rows.Clear();
- dtSample.AsEnumerable().GroupBy(p => new { BatchNo = p["BATCH_NO"].ToString(), Sample = p["HEAD_MAT_NO"].ToString() }).ToList()
- .ForEach(p =>
- {
- foreach (DataRow row in p)
- {
- if (!dataTable6.Columns.Contains(row["PHY_CODE_MAX"].ToString()))
- {
- DataColumn phyCloum = new DataColumn();
- phyCloum.ColumnName = row["PHY_CODE_MAX"].ToString();
- phyCloum.Caption = row["PHY_NAME_MAX"].ToString();
- dataTable6.Columns.Add(phyCloum);
- }
- }
- DataRow dr = dataTable6.NewRow();
- dr["PHY_BATCH_NO"] = p.Key.BatchNo;
- dr["HEAD_MAT_NO"] = p.Key.Sample;
- dr["SAMPLE_LEN"] = p.Max(q => q["SAMPLE_LEN"]);
- foreach (DataRow row in p)
- {
- dr[row["PHY_CODE_MAX"].ToString()] = row["SAMPLE_COUNT"].ToString();
- }
- dataTable6.Rows.Add(dr);
- });
- ultraGrid21.DataBind();
- GridHelper.RefreshAndAutoSize(ultraGrid21);
- }
- private void doQueryChemPhy(UltraGridRow uRow)
- {
- while (dataTable5.Columns.Count > 5)
- {
- dataTable5.Columns.RemoveAt(5);
- }
- dtPhy = PublicServer.GetData("com.steering.mes.port.mil.FrmMilBatchSampleNew.doQueryReChemPhy", new Object[] { uRow.Cells["LotNo"].Text, uRow.Cells["JudgeStoveNo"].Text, uRow.Cells["CheckNo"].Text }, ob);//查询复取样试样组
- List<string> list = new List<string>();
- if (dtPhy.Rows.Count > 0)
- {
- dtPhy.AsEnumerable().Select(p => new { Code = p["PHY_CODE_MAX"].ToString(), Name = p["PHY_NAME_MAX"].ToString() }).Distinct().ToList()
- .ForEach(p =>
- {
- DataColumn phyCloum = new DataColumn();
- phyCloum.ColumnName = p.Code;
- phyCloum.Caption = p.Name;
- dataTable5.Columns.Add(phyCloum);
- });
- }
- ultraGrid20.DataBind();
- GridHelper.RefreshAndAutoSize(ultraGrid20);
- }
- private void doQueryResampleRck(UltraGridRow uRow)
- {
- DataTable dtBatchNo = PublicServer.GetData("com.steering.mes.port.vrp.FrmHttBatchSaplmeNew.doQueryResampleInfo",
- new Object[] { uRow.Cells["JudgeStoveNo"].Text, "F" + uRow.Cells["CheckNo"].Text }, ob);
- dataTable5.Rows.Clear();
- foreach (DataRow row in dtBatchNo.Rows)
- {
- if (row["RESAMPLE_PIPE_LEN_A"] != null && row["RESAMPLE_PIPE_LEN_A"].ToString() != "")
- {
- DataRow newRowA = dataTable5.NewRow();
- newRowA["PHY_BATCH_NO"] = row["PHY_BATCH_NO"].ToString();
- newRowA["MAT_NO"] = row["MAT_NO"].ToString();
- newRowA["SAMPLE_PIPE_LEN"] = row["RESAMPLE_PIPE_LEN_A"].ToString();
- newRowA["SAMPLE_POSTION"] = "A端";
- newRowA["PHY_CODE_GROUP"] = "";
- dataTable5.Rows.Add(newRowA);
- }
- if (row["RESAMPLE_PIPE_LEN_B"] != null && row["RESAMPLE_PIPE_LEN_B"].ToString() != "")
- {
- DataRow newRowA = dataTable5.NewRow();
- newRowA["PHY_BATCH_NO"] = row["PHY_BATCH_NO"].ToString();
- newRowA["MAT_NO"] = row["MAT_NO"].ToString();
- newRowA["SAMPLE_PIPE_LEN"] = row["RESAMPLE_PIPE_LEN_B"].ToString();
- newRowA["SAMPLE_POSTION"] = "B端";
- newRowA["PHY_CODE_GROUP"] = "";
- dataTable5.Rows.Add(newRowA);
- }
- if (row["RESAMPLE_PIPE_LEN_C"] != null && row["RESAMPLE_PIPE_LEN_C"].ToString() != "")
- {
- DataRow newRowA = dataTable5.NewRow();
- newRowA["PHY_BATCH_NO"] = row["PHY_BATCH_NO"].ToString();
- newRowA["MAT_NO"] = row["MAT_NO"].ToString();
- newRowA["SAMPLE_PIPE_LEN"] = row["RESAMPLE_PIPE_LEN_C"].ToString();
- newRowA["SAMPLE_POSTION"] = "C端";
- newRowA["PHY_CODE_GROUP"] = "";
- dataTable5.Rows.Add(newRowA);
- }
- if (row["RESAMPLE_PIPE_LEN_D"] != null && row["RESAMPLE_PIPE_LEN_D"].ToString() != "")
- {
- DataRow newRowA = dataTable5.NewRow();
- newRowA["PHY_BATCH_NO"] = row["PHY_BATCH_NO"].ToString();
- newRowA["MAT_NO"] = row["MAT_NO"].ToString();
- newRowA["SAMPLE_PIPE_LEN"] = row["RESAMPLE_PIPE_LEN_D"].ToString();
- newRowA["SAMPLE_POSTION"] = "D端";
- newRowA["PHY_CODE_GROUP"] = "";
- dataTable5.Rows.Add(newRowA);
- }
- if (row["RESAMPLE_PIPE_LEN_E"] != null && row["RESAMPLE_PIPE_LEN_E"].ToString() != "")
- {
- DataRow newRowA = dataTable5.NewRow();
- newRowA["PHY_BATCH_NO"] = row["PHY_BATCH_NO"].ToString();
- newRowA["MAT_NO"] = row["MAT_NO"].ToString();
- newRowA["SAMPLE_PIPE_LEN"] = row["RESAMPLE_PIPE_LEN_E"].ToString();
- newRowA["SAMPLE_POSTION"] = "E端";
- newRowA["PHY_CODE_GROUP"] = "";
- dataTable5.Rows.Add(newRowA);
- }
- if (row["RESAMPLE_PIPE_LEN_F"] != null && row["RESAMPLE_PIPE_LEN_F"].ToString() != "")
- {
- DataRow newRowA = dataTable5.NewRow();
- newRowA["PHY_BATCH_NO"] = row["PHY_BATCH_NO"].ToString();
- newRowA["MAT_NO"] = row["MAT_NO"].ToString();
- newRowA["SAMPLE_PIPE_LEN"] = row["RESAMPLE_PIPE_LEN_F"].ToString();
- newRowA["SAMPLE_POSTION"] = "F端";
- newRowA["PHY_CODE_GROUP"] = "";
- dataTable5.Rows.Add(newRowA);
- }
- if (row["RESAMPLE_PIPE_LEN_P"] != null && row["RESAMPLE_PIPE_LEN_P"].ToString() != "")
- {
- DataRow newRowA = dataTable5.NewRow();
- newRowA["PHY_BATCH_NO"] = row["PHY_BATCH_NO"].ToString();
- newRowA["MAT_NO"] = row["MAT_NO"].ToString();
- newRowA["SAMPLE_PIPE_LEN"] = row["RESAMPLE_PIPE_LEN_P"].ToString();
- newRowA["SAMPLE_POSTION"] = "P端";
- newRowA["PHY_CODE_GROUP"] = "";
- dataTable5.Rows.Add(newRowA);
- }
- if (row["RESAMPLE_PIPE_LEN_Q"] != null && row["RESAMPLE_PIPE_LEN_Q"].ToString() != "")
- {
- DataRow newRowA = dataTable5.NewRow();
- newRowA["PHY_BATCH_NO"] = row["PHY_BATCH_NO"].ToString();
- newRowA["MAT_NO"] = row["MAT_NO"].ToString();
- newRowA["SAMPLE_PIPE_LEN"] = row["RESAMPLE_PIPE_LEN_Q"].ToString();
- newRowA["SAMPLE_POSTION"] = "Q端";
- newRowA["PHY_CODE_GROUP"] = "";
- dataTable5.Rows.Add(newRowA);
- }
- }
- GridHelper.RefreshAndAutoSize(ultraGrid20);
- }
- private void ultraGrid17_CellChange(object sender, CellEventArgs e)
- {
- this.ultraGrid17.UpdateData();
- ultraGrid17.Update();
- if (e.Cell.Column.Key == "Chk")
- {
- if (e.Cell.Value.ToString() == "True")
- {
- e.Cell.Row.RowSelectorAppearance.BackColor = Color.Red;
- txtMatNo1.Text = e.Cell.Row.Cells["MatNo"].Text;
- }
- else
- {
- e.Cell.Row.RowSelectorAppearance.BackColor = Color.Empty;
- }
- }
- }
- private void txtLen1_ValueChanged(object sender, EventArgs e)
- {
- if (!StringUtil.IsInt(this.txtLen1.Text)) return;
- List<PortHttBatchSampleResultEntity> list1 = null;
- list1 = portHttBatchSampleResultEntityBindingSource2.DataSource as List<PortHttBatchSampleResultEntity>;
- if (list1.Any())
- {
- if (this.cmbPostion1.Value.ToString().Equals("401201"))//A端
- {
- list1.Where(p => p.MatNo == txtMatNo1.Text).ToList().ForEach(p => p.ResamplePipeLenA = txtLen1.Text);
- }
- else if (this.cmbPostion1.Value.ToString().Equals("401202"))
- {
- list1.Where(p => p.MatNo == txtMatNo1.Text).ToList().ForEach(p => p.ResamplePipeLenB = txtLen1.Text);
- }
- else if (this.cmbPostion1.Value.ToString().Equals("401217"))
- {
- list1.Where(p => p.MatNo == txtMatNo1.Text).ToList().ForEach(p => p.ResamplePipeLenC = txtLen1.Text);
- }
- else if (this.cmbPostion1.Value.ToString().Equals("401218"))
- {
- list1.Where(p => p.MatNo == txtMatNo1.Text).ToList().ForEach(p => p.ResamplePipeLenD = txtLen1.Text);
- }
- else if (this.cmbPostion1.Value.ToString().Equals("401219"))
- {
- list1.Where(p => p.MatNo == txtMatNo1.Text).ToList().ForEach(p => p.ResamplePipeLenM = txtLen1.Text);
- }
- else if (this.cmbPostion1.Value.ToString().Equals("401220"))
- {
- list1.Where(p => p.MatNo == txtMatNo1.Text).ToList().ForEach(p => p.ResamplePipeLenE = txtLen1.Text);
- }
- else if (this.cmbPostion1.Value.ToString().Equals("401221"))
- {
- list1.Where(p => p.MatNo == txtMatNo1.Text).ToList().ForEach(p => p.ResamplePipeLenF = txtLen1.Text);
- }
- else if (this.cmbPostion1.Value.ToString().Equals("401222"))
- {
- list1.Where(p => p.MatNo == txtMatNo1.Text).ToList().ForEach(p => p.ResamplePipeLenP = txtLen1.Text);
- }
- else if (this.cmbPostion1.Value.ToString().Equals("401223"))
- {
- list1.Where(p => p.MatNo == txtMatNo1.Text).ToList().ForEach(p => p.ResamplePipeLenQ = txtLen1.Text);
- }
- }
- GridHelper.RefreshAndAutoSize(ultraGrid17);
- }
- private void ultraGrid21_ClickCell(object sender, ClickCellEventArgs e)
- {
- if (e.Cell.Column.Key != "PHY_BATCH_NO" && e.Cell.Column.Key != "MAT_NO" && e.Cell.Column.Key != "SAMPLE_PIPE_LEN" && e.Cell.Column.Key != "SAMPLE_POSTION")
- {
- if (e.Cell.Text.Trim() == "")
- {
- e.Cell.Value = "√";
- }
- else
- {
- e.Cell.Value = "";
- }
- }
- }
- private void ultraGrid18_ClickCell(object sender, ClickCellEventArgs e)
- {
- if (e.Cell.Column.Key != "PHY_BATCH_NO" && e.Cell.Column.Key != "MAT_NO" && e.Cell.Column.Key != "SAMPLE_PIPE_LEN" && e.Cell.Column.Key != "SAMPLE_POSTION")
- {
- if (e.Cell.Text.Trim() == "")
- {
- e.Cell.Value = "√";
- }
- else
- {
- e.Cell.Value = "";
- }
- }
- }
- private void ultraGrid8_AfterRowActivate(object sender, EventArgs e)
- {
- this.ultraGrid5.UpdateData();
- this.ultraGrid8.UpdateData();
- UltraGridRow uRow = this.ultraGrid5.ActiveRow;
- UltraGridRow row = this.ultraGrid8.ActiveRow;
- doQueryBatchRack(uRow,row);
- }
- /// <summary>
- /// 按批查管号队列
- /// </summary>
- /// <param name="uRow"></param>
- /// <param name="row"></param>
- private void doQueryBatchRack(UltraGridRow uRow, UltraGridRow row)
- {
- List<PortHttBatchSampleResultEntity> listSource = EntityHelper.GetData<PortHttBatchSampleResultEntity>(
- "com.steering.mes.port.vrp.FrmHttBatchSaplmeNew.doQueryBatchRack", new object[] { uRow.Cells["HeatPlanNo"].Text, uRow.Cells["JudgeStoveNo"].Text, row.Cells["PHY_BATCH_NO"].Text }, this.ob);
- portHttBatchSampleResultEntityBindingSource1.DataSource = listSource;
- }
- private void ultraGrid23_ClickCell(object sender, ClickCellEventArgs e)
- {
- if (e.Cell.Column.Key != "PHY_BATCH_NO" && e.Cell.Column.Key != "MAT_NO" && e.Cell.Column.Key != "SAMPLE_PIPE_LEN" && e.Cell.Column.Key != "SAMPLE_POSTION")
- {
- if (e.Cell.Text.Trim() == "")
- {
- e.Cell.Value = "√";
- }
- else
- {
- e.Cell.Value = "";
- }
- }
- }
- private void btnGetCic_Click(object sender, EventArgs e)
- {
- if (ultraGrid10.ActiveRow.Cells["Cic"].Text.ToString().Trim().Length >0)
- {
- MessageUtil.ShowTips("已有CIC信息,不需要重新获取");
- return;
- }
- if (ultraGrid10.ActiveRow.Cells["HeatPlanNo"].Text.ToString().Length < 1)
- {
- MessageUtil.ShowTips("未委托信息为空!");
- return;
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.port.vrp.FrmHttBatchSaplmeNew";
- ccp.MethodName = "GetCIC";
- ccp.ServerParams = new object[] { ultraGrid10.ActiveRow.Cells["HeatPlanNo"].Text };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("获取CIC成功!"))
- {
- doQueryPlan();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- }
- }
|