PDAModuleService.cs 393 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116
  1. /*******************************************************************************
  2. * Copyright(c) 2014 DongkeSoft All rights reserved. / Confidential
  3. * 类的信息:
  4. * 1.程序名称:PDAModuleService.cs
  5. * 2.功能描述:PDA模块WCF服务
  6. * 编辑履历:
  7. * 作者 日期 版本 修改内容
  8. * 陈晓野 2014/09/16 1.00 新建
  9. *******************************************************************************/
  10. using System;
  11. using System.Collections.Generic;
  12. using System.Data;
  13. using System.IO;
  14. using System.ServiceModel;
  15. using System.ServiceModel.Activation;
  16. using Curtain.Log;
  17. using Dongke.IBOSS.PRD.Basics.BaseResources;
  18. using Dongke.IBOSS.PRD.Basics.Library;
  19. using Dongke.IBOSS.PRD.Service.BarcodePrintService;
  20. using Dongke.IBOSS.PRD.Service.CommonModuleLogic;
  21. using Dongke.IBOSS.PRD.Service.DataModels;
  22. using Dongke.IBOSS.PRD.Service.DKIBOSSPRDLogic;
  23. using Dongke.IBOSS.PRD.Service.PCModuleLogic;
  24. using Dongke.IBOSS.PRD.Service.PDAModuleLogic;
  25. using Dongke.IBOSS.PRD.Service.PMModuleLogic;
  26. using Dongke.IBOSS.PRD.Service.PublicModuleService;
  27. using Dongke.IBOSS.PRD.Service.ReportModuleLogic;
  28. using Dongke.IBOSS.PRD.Service.SmartDeviceService;
  29. using Dongke.IBOSS.PRD.Service.SystemModuleLogic;
  30. using Dongke.IBOSS.PRD.WCF.Contracts;
  31. using Dongke.IBOSS.PRD.WCF.DataModels;
  32. using Dongke.IBOSS.PRD.WCF.DataModels.ConfigModule;
  33. using Dongke.IBOSS.PRD.WCF.DataModels.HRModule;
  34. using Dongke.IBOSS.PRD.WCF.DataModels.PCModule;
  35. using Dongke.IBOSS.PRD.WCF.DataModels.PMModule;
  36. namespace Dongke.IBOSS.PRD.WCF.Services
  37. {
  38. // 服务实现类,继承服务声明接口
  39. // 该标签声明该服务可以在ASP.NET下运行
  40. [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
  41. [ServiceBehavior(ConfigurationName = "PDAModuleService",
  42. InstanceContextMode = InstanceContextMode.PerCall,
  43. ConcurrencyMode = ConcurrencyMode.Multiple,
  44. UseSynchronizationContext = false)]
  45. public partial class PDAModuleService : IPDAModule
  46. {
  47. #region 属性
  48. /// <summary>
  49. /// 用户登陆的信息
  50. /// </summary>
  51. SUserInfo sUserInfo
  52. {
  53. get;
  54. set;
  55. }
  56. #endregion
  57. #region 构造函数
  58. /// <summary>
  59. /// 构造函数
  60. /// </summary>
  61. public PDAModuleService()
  62. : base()
  63. {
  64. }
  65. #endregion
  66. #region 验证
  67. /// <summary>
  68. /// 验证访问头
  69. /// </summary>
  70. /// <param name="accountCode">帐套编码</param>
  71. /// <param name="userCode">用户编码</param>
  72. /// <param name="userPassword">用户密码</param>
  73. /// <param name="sessionKey">访问密钥</param>
  74. /// <returns></returns>
  75. private ActionResult DoPDACheck(string accountCode, string userCode, string userPassword, string sessionKey)
  76. {
  77. try
  78. {
  79. ActionResult actionResult = new ActionResult();
  80. LoginRequestEntity requestEntity = new LoginRequestEntity();
  81. requestEntity.AccountCode = accountCode;
  82. requestEntity.UserCode = userCode;
  83. requestEntity.Password = userPassword;
  84. requestEntity.SessionKey = sessionKey;
  85. SUserInfo userInfo = null;
  86. string loginStatus = DKIBOSSPRDLogic.AuthenticateRepeatLogin(requestEntity, out userInfo);
  87. // 用户登录信息错误
  88. if (Constant.INT_IS_ONE.ToString().Equals(loginStatus))
  89. {
  90. actionResult.Status = (int)Constant.PDAResult.LoginInfoError;
  91. actionResult.Message = Constant.PDA_RESULT_LOGININFOERROR;
  92. }
  93. // 用户在其它终端登陆
  94. else if (Constant.INT_IS_TWO.ToString().Equals(loginStatus))
  95. {
  96. actionResult.Status = (int)Constant.PDAResult.RepeatLogin;
  97. actionResult.Message = Constant.PDA_RESULT_REPEATLOGIN;
  98. }
  99. // Lic错误
  100. else if ("3".Equals(loginStatus))
  101. {
  102. actionResult.Status = (int)Constant.PDAResult.LicInfoError;
  103. actionResult.Message = "授权信息错误,请联系管理员。";
  104. }
  105. else
  106. {
  107. actionResult.Status = (int)Constant.PDAResult.Success;
  108. }
  109. sUserInfo = userInfo;
  110. return actionResult;
  111. }
  112. catch (Exception ex)
  113. {
  114. throw ex;
  115. }
  116. }
  117. #endregion
  118. #region WCF服务
  119. /// <summary>
  120. /// 测试PDA连接WCF服务
  121. /// </summary>
  122. /// <param name="value">测试文本</param>
  123. /// <returns>返回文本</returns>
  124. public string TestConnectionEx(string value)
  125. {
  126. return "连接成功!" + value;
  127. }
  128. public string TestConnection()
  129. {
  130. return "连接成功!";
  131. }
  132. #endregion
  133. #region 系统登录
  134. /// <summary>
  135. /// 系统登录
  136. /// </summary>
  137. /// <param name="accountCode"></param>
  138. /// <param name="userCode"></param>
  139. /// <param name="userPassword"></param>
  140. /// <param name="macAddress"></param>
  141. /// <param name="ipAddress"></param>
  142. /// <param name="phoneCode"></param>
  143. /// <param name="phoneType"></param>
  144. /// <param name="appVersion"></param>
  145. /// <param name="systemType"></param>
  146. /// <param name="systemVersion"></param>
  147. /// <returns></returns>
  148. public PDALoginResult DoPDALogin(string accountCode, string userCode, string userPassword,
  149. string macAddress, string ipAddress, string phoneCode, string phoneType,
  150. string appVersion, string systemType, string systemVersion,string IMEI)
  151. {
  152. try
  153. {
  154. LoginRequestEntity requestEntity = new LoginRequestEntity();
  155. requestEntity.AccountCode = accountCode;
  156. requestEntity.UserCode = userCode;
  157. requestEntity.Password = userPassword;
  158. requestEntity.ComputerName = phoneCode;
  159. requestEntity.IPAddress = ipAddress;
  160. requestEntity.MACAddress = macAddress;
  161. PDALoginResult result = ServiceInvoker.Invoke<PDALoginResult>(this,
  162. () => PDAModuleLogic.DoPDALogin(requestEntity));
  163. return result;
  164. }
  165. catch (Exception ex)
  166. {
  167. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  168. OutputLog.TraceLog(LogPriority.Error,
  169. this.ToString(),
  170. System.Reflection.MethodBase.GetCurrentMethod().Name,
  171. ex.ToString(),
  172. LocalPath.LogExePath);
  173. PDALoginResult result = new PDALoginResult();
  174. result.Status = (int)Constant.PDAResult.Exception;
  175. result.Message = Constant.PDA_RESULT_EXCEPTION;
  176. return result;
  177. }
  178. }
  179. /// <summary>
  180. /// 退出
  181. /// </summary>
  182. /// <param name="accountCode">帐套code</param>
  183. /// <param name="userCode">用户code</param>
  184. /// <param name="userPassword">用户密码</param>
  185. /// <param name="sessionKey">本次登陆密钥</param>
  186. /// <returns></returns>
  187. public ActionResult DoPDAOut(string accountCode, string userCode, string userPassword, string sessionKey)
  188. {
  189. ActionResult actionResult = new ActionResult();
  190. try
  191. {
  192. // 验证请求头信息
  193. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  194. // 验证失败
  195. if (actionResult.Status != (int)Constant.PDAResult.Success)
  196. {
  197. return actionResult;
  198. }
  199. bool result = DKIBOSSPRDLogic.Logout(sUserInfo.UserID, "3", sUserInfo);
  200. actionResult.Result = JsonHelper.ToJson(result);
  201. actionResult.Status = (int)Constant.PDAResult.Success;
  202. }
  203. catch (Exception ex)
  204. {
  205. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  206. OutputLog.TraceLog(LogPriority.Error,
  207. this.ToString(),
  208. System.Reflection.MethodBase.GetCurrentMethod().Name,
  209. ex.ToString(),
  210. LocalPath.LogExePath);
  211. actionResult.Status = (int)Constant.PDAResult.Exception;
  212. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  213. }
  214. return actionResult;
  215. }
  216. /// <summary>
  217. /// 修改密码
  218. /// </summary>
  219. /// <param name="accountCode"></param>
  220. /// <param name="userCode"></param>
  221. /// <param name="userPassword"></param>
  222. /// <param name="sessionKey"></param>
  223. /// <returns></returns>
  224. public ActionResult ChangeUserPassword(string accountCode, string userCode, string userPassword, string sessionKey,
  225. string newPassWord)
  226. {
  227. ActionResult actionResult = new ActionResult();
  228. try
  229. {
  230. // 验证请求头信息
  231. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  232. // 验证失败
  233. if (actionResult.Status != (int)Constant.PDAResult.Success)
  234. {
  235. return actionResult;
  236. }
  237. string result = ServiceInvoker.Invoke<string>(this,
  238. () => SystemModuleDAL.SaveUserPassWord(newPassWord, userCode, null, sUserInfo));
  239. actionResult.Status = (int)Constant.PDAResult.Success;
  240. }
  241. catch (Exception ex)
  242. {
  243. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  244. OutputLog.TraceLog(LogPriority.Error,
  245. this.ToString(),
  246. System.Reflection.MethodBase.GetCurrentMethod().Name,
  247. ex.ToString(),
  248. LocalPath.LogExePath);
  249. actionResult.Status = (int)Constant.PDAResult.Exception;
  250. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  251. }
  252. return actionResult;
  253. }
  254. #endregion
  255. #region 取得展示数据
  256. /// <summary>
  257. /// 获得生产线菜单
  258. /// </summary>
  259. /// <param name="accountCode">帐套code</param>
  260. /// <param name="userCode">用户code</param>
  261. /// <param name="userPassword">用户密码</param>
  262. /// <param name="sessionKey">本次登陆密钥</param>
  263. /// <returns></returns>
  264. /// <remarks>
  265. /// 陈冰 2014.09.18 新建
  266. /// </remarks>
  267. public ActionResult GetProductionLineMenu(string accountCode, string userCode, string userPassword, string sessionKey)
  268. {
  269. ActionResult actionResult = new ActionResult();
  270. try
  271. {
  272. // 验证请求头信息
  273. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  274. // 验证失败
  275. if (actionResult.Status != (int)Constant.PDAResult.Success)
  276. {
  277. return actionResult;
  278. }
  279. // 查询菜单
  280. DataTable dtPLM = ServiceInvoker.Invoke<DataTable>(this,
  281. () => PDAModuleLogic.GetProductionLineMenu(sUserInfo));
  282. PDAFunctionResult pdaFunction = new PDAFunctionResult();
  283. pdaFunction.MenuCode = "Root";
  284. DataRow[] navigationRows = dtPLM.Select("LEN(MenuCode) = " + Constant.INT_IS_TWO.ToString(), "MenuCode ASC"); // 编号2为一级菜单
  285. foreach (DataRow newRow in navigationRows)
  286. {
  287. #region 插入子节点数据
  288. int? intProcedureID = null;
  289. int? intModelType = null;
  290. if (!string.IsNullOrEmpty(newRow["ProcedureID"].ToString()))
  291. {
  292. intProcedureID = Convert.ToInt32(newRow["ProcedureID"]);
  293. }
  294. if (!string.IsNullOrEmpty(newRow["ModelType"].ToString()))
  295. {
  296. intModelType = Convert.ToInt32(newRow["ModelType"]);
  297. }
  298. PDAFunctionResult pdaFunctionChild = new PDAFunctionResult();
  299. //xuwei add 2020-01-02
  300. pdaFunctionChild.IsGlazeChange = string.IsNullOrEmpty(newRow["IsGlazeChange"].ToString()) ? 0 : Convert.ToInt32(newRow["IsGlazeChange"].ToString());
  301. //pdaFunctionChild.IsGlazeChange = 0;
  302. pdaFunctionChild.MenuCode = newRow["MenuCode"].ToString();
  303. pdaFunctionChild.MenuName = newRow["MenuName"].ToString();
  304. pdaFunctionChild.ProcedureID = intProcedureID;
  305. pdaFunctionChild.ProcedureModel = newRow["ProcedureModel"].ToString();
  306. pdaFunctionChild.ModelType = intModelType;
  307. pdaFunction.PDAFunctions.Add(pdaFunctionChild);
  308. #endregion
  309. InitTreeView(dtPLM, newRow["MenuCode"].ToString(), pdaFunctionChild);
  310. }
  311. //actionResult.Result = JsonHelper.ToJson(dtPLM);
  312. actionResult.Result = JsonHelper.ToJson(pdaFunction);
  313. actionResult.Status = (int)Constant.PDAResult.Success;
  314. }
  315. catch (Exception ex)
  316. {
  317. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  318. OutputLog.TraceLog(LogPriority.Error,
  319. this.ToString(),
  320. System.Reflection.MethodBase.GetCurrentMethod().Name,
  321. ex.ToString(),
  322. LocalPath.LogExePath);
  323. actionResult.Status = (int)Constant.PDAResult.Exception;
  324. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  325. }
  326. return actionResult;
  327. }
  328. /// <summary>
  329. /// 初始化树形控件
  330. /// </summary>
  331. /// <param name="treeTable">菜单数据表</param>
  332. /// <param name="rows">待处理的菜单集合</param>
  333. /// <param name="node">当前树节点</param>
  334. private void InitTreeView(DataTable treeTable, string pFuncCode, PDAFunctionResult pFunctions)
  335. {
  336. string filterExpression = "MenuCode LIKE '" + pFuncCode + "%' AND LEN(MenuCode) = "
  337. + (pFuncCode.Length + Constant.INT_IS_TWO);
  338. DataRow[] subRows = treeTable.Select(filterExpression, "MenuCode ASC");
  339. //DataRow[] subRows = treeTable.Select(filterExpression, "ProcedureCode ASC");
  340. foreach (DataRow newRow in subRows)
  341. {
  342. #region 插入子节点数据
  343. int? intProcedureID = null;
  344. int? intModelType = null;
  345. if (!string.IsNullOrEmpty(newRow["ProcedureID"].ToString()))
  346. {
  347. intProcedureID = Convert.ToInt32(newRow["ProcedureID"]);
  348. }
  349. if (!string.IsNullOrEmpty(newRow["ModelType"].ToString()))
  350. {
  351. intModelType = Convert.ToInt32(newRow["ModelType"]);
  352. }
  353. PDAFunctionResult pdaFunctionChild = new PDAFunctionResult();
  354. //xuwei add 2020-01-02
  355. pdaFunctionChild.IsGlazeChange = string.IsNullOrEmpty(newRow["IsGlazeChange"].ToString()) ? 0 : Convert.ToInt32(newRow["IsGlazeChange"].ToString());
  356. //pdaFunctionChild.IsGlazeChange = 0;
  357. pdaFunctionChild.MenuCode = newRow["MenuCode"].ToString();
  358. pdaFunctionChild.MenuName = newRow["MenuName"].ToString();
  359. pdaFunctionChild.ProcedureID = intProcedureID;
  360. pdaFunctionChild.ProcedureModel = newRow["ProcedureModel"].ToString();
  361. pdaFunctionChild.ModelType = intModelType;
  362. pFunctions.PDAFunctions.Add(pdaFunctionChild);
  363. #endregion
  364. // 递归方法
  365. InitTreeView(treeTable, newRow["MenuCode"].ToString(), pdaFunctionChild);
  366. }
  367. }
  368. #endregion
  369. #region 获得工序信息
  370. /// <summary>
  371. /// 获得工序信息
  372. /// </summary>
  373. /// <param name="accountCode">帐套code</param>
  374. /// <param name="userCode">用户code</param>
  375. /// <param name="userPassword">用户密码</param>
  376. /// <param name="sessionKey">本次登陆密钥</param>
  377. /// <param name="procedureID">工序ID</param>
  378. /// <returns></returns>
  379. /// <remarks>
  380. /// 陈冰 2014.09.18 新建
  381. /// </remarks>
  382. public ActionResult GetProcedureByID(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  383. {
  384. ActionResult actionResult = new ActionResult();
  385. try
  386. {
  387. // 验证请求头信息
  388. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  389. // 验证失败
  390. if (actionResult.Status != (int)Constant.PDAResult.Success)
  391. {
  392. return actionResult;
  393. }
  394. ProcedureEntity procedureEntity = ServiceInvoker.Invoke<ProcedureEntity>(this,
  395. () => PMModuleLogic.GetProcedureDataEntityByID(procedureID, sUserInfo));
  396. actionResult.Result = JsonHelper.ToJson(procedureEntity);
  397. actionResult.Status = (int)Constant.PDAResult.Success;
  398. }
  399. catch (Exception ex)
  400. {
  401. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  402. OutputLog.TraceLog(LogPriority.Error,
  403. this.ToString(),
  404. System.Reflection.MethodBase.GetCurrentMethod().Name,
  405. ex.ToString(),
  406. LocalPath.LogExePath);
  407. actionResult.Status = (int)Constant.PDAResult.Exception;
  408. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  409. }
  410. return actionResult;
  411. }
  412. #endregion
  413. #region 校验
  414. /// <summary>
  415. /// 校验产品条码是否可以走到该工序
  416. /// </summary>
  417. /// <param name="accountCode">帐套code</param>
  418. /// <param name="userCode">用户code</param>
  419. /// <param name="userPassword">用户密码</param>
  420. /// <param name="sessionKey">本次登陆密钥</param>
  421. /// <param name="procedureID">工序ID</param>
  422. /// <param name="barcode">条码</param>
  423. /// <returns></returns>
  424. /// <remarks>
  425. /// 陈冰 2014.09.18 新建
  426. /// </remarks>
  427. public ActionResult CheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  428. {
  429. ActionResult actionResult = new ActionResult();
  430. try
  431. {
  432. // 验证请求头信息
  433. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  434. // 验证失败
  435. if (actionResult.Status != (int)Constant.PDAResult.Success)
  436. {
  437. return actionResult;
  438. }
  439. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  440. () => PMModuleLogic.CheckBarcodePDA(procedureID, barcode, sUserInfo));
  441. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  442. {
  443. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  444. actionResult.Status = (int)Constant.PDAResult.Success;
  445. }
  446. else
  447. {
  448. actionResult.Status = (int)Constant.PDAResult.Fail;
  449. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  450. }
  451. }
  452. catch (Exception ex)
  453. {
  454. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  455. OutputLog.TraceLog(LogPriority.Error,
  456. this.ToString(),
  457. System.Reflection.MethodBase.GetCurrentMethod().Name,
  458. ex.ToString(),
  459. LocalPath.LogExePath);
  460. actionResult.Status = (int)Constant.PDAResult.Exception;
  461. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  462. }
  463. return actionResult;
  464. }
  465. /// <summary>
  466. /// 校验产品条码是否可以进行干补
  467. /// </summary>
  468. /// <param name="accountCode">帐套code</param>
  469. /// <param name="userCode">用户code</param>
  470. /// <param name="userPassword">用户密码</param>
  471. /// <param name="sessionKey">本次登陆密钥</param>
  472. /// <param name="procedureID">工序ID</param>
  473. /// <param name="barcode">条码</param>
  474. /// <returns></returns>
  475. /// <remarks>
  476. /// 袁新成 2015.4.1 新建
  477. /// </remarks>
  478. public ActionResult CheckDryRepairBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  479. {
  480. ActionResult actionResult = new ActionResult();
  481. try
  482. {
  483. // 验证请求头信息
  484. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  485. // 验证失败
  486. if (actionResult.Status != (int)Constant.PDAResult.Success)
  487. {
  488. return actionResult;
  489. }
  490. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  491. () => PMModuleLogic.CheckDryRepairBarcode(procedureID, barcode, sUserInfo));
  492. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  493. {
  494. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  495. actionResult.Status = (int)Constant.PDAResult.Success;
  496. }
  497. else
  498. {
  499. actionResult.Status = (int)Constant.PDAResult.Fail;
  500. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  501. }
  502. }
  503. catch (Exception ex)
  504. {
  505. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  506. OutputLog.TraceLog(LogPriority.Error,
  507. this.ToString(),
  508. System.Reflection.MethodBase.GetCurrentMethod().Name,
  509. ex.ToString(),
  510. LocalPath.LogExePath);
  511. actionResult.Status = (int)Constant.PDAResult.Exception;
  512. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  513. }
  514. return actionResult;
  515. }
  516. /// <summary>
  517. /// 检验生产工号
  518. /// </summary>
  519. /// <param name="accountCode">帐套code</param>
  520. /// <param name="userCode">用户code</param>
  521. /// <param name="userPassword">用户密码</param>
  522. /// <param name="sessionKey">本次登陆密钥</param>
  523. /// <param name="procedureID">工序ID</param>
  524. /// <param name="procedureUserCode">生产工号</param>
  525. /// <remarks>
  526. /// 陈冰 2014.09.18 新建
  527. /// </remarks>
  528. public ActionResult CheckProcedureUser(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string procedureUserCode)
  529. {
  530. ActionResult actionResult = new ActionResult();
  531. try
  532. {
  533. // 验证请求头信息
  534. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  535. // 验证失败
  536. if (actionResult.Status != (int)Constant.PDAResult.Success)
  537. {
  538. return actionResult;
  539. }
  540. CheckProcedureUserResult checkProcedureUserResult = ServiceInvoker.Invoke<CheckProcedureUserResult>(this,
  541. () => PMModuleLogic.CheckProcedureUser(procedureID, procedureUserCode, sUserInfo));
  542. actionResult.Result = JsonHelper.ToJson(checkProcedureUserResult);
  543. actionResult.Status = (int)Constant.PDAResult.Success;
  544. }
  545. catch (Exception ex)
  546. {
  547. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  548. OutputLog.TraceLog(LogPriority.Error,
  549. this.ToString(),
  550. System.Reflection.MethodBase.GetCurrentMethod().Name,
  551. ex.ToString(),
  552. LocalPath.LogExePath);
  553. actionResult.Status = (int)Constant.PDAResult.Exception;
  554. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  555. }
  556. return actionResult;
  557. }
  558. /// <summary>
  559. /// 校验窑车是否可装车并返回窑车信息
  560. /// </summary>
  561. /// <param name="accountCode">帐套code</param>
  562. /// <param name="userCode">用户code</param>
  563. /// <param name="userPassword">用户密码</param>
  564. /// <param name="sessionKey">本次登陆密钥</param>
  565. /// <param name="kilnCarCode">窑车号</param>
  566. /// <param name="modelType">工序类别</param>
  567. /// <returns></returns>
  568. /// <remarks>
  569. /// 陈冰 2014.10.04 新建
  570. /// </remarks>
  571. public ActionResult CheckKilnCar(string accountCode, string userCode, string userPassword, string sessionKey, int pProcedureId, string kilnCarCode, int modelType)
  572. {
  573. ActionResult actionResult = new ActionResult();
  574. try
  575. {
  576. // 验证请求头信息
  577. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  578. // 验证失败
  579. if (actionResult.Status != (int)Constant.PDAResult.Success)
  580. {
  581. return actionResult;
  582. }
  583. CheckKilnCarResultEntity checkKilnCarResultEntity = ServiceInvoker.Invoke<CheckKilnCarResultEntity>(this,
  584. () => PMModuleLogic.CheckKilnCar(pProcedureId, kilnCarCode, modelType, sUserInfo));
  585. actionResult.Result = JsonHelper.ToJson(checkKilnCarResultEntity);
  586. actionResult.Status = (int)Constant.PDAResult.Success;
  587. }
  588. catch (Exception ex)
  589. {
  590. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  591. OutputLog.TraceLog(LogPriority.Error,
  592. this.ToString(),
  593. System.Reflection.MethodBase.GetCurrentMethod().Name,
  594. ex.ToString(),
  595. LocalPath.LogExePath);
  596. actionResult.Status = (int)Constant.PDAResult.Exception;
  597. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  598. }
  599. return actionResult;
  600. }
  601. #endregion
  602. #region 保存条码信息
  603. /// <summary>
  604. /// 保存条码信息
  605. /// </summary>
  606. /// <param name="accountCode">帐套code</param>
  607. /// <param name="userCode">用户code</param>
  608. /// <param name="userPassword">用户密码</param>
  609. /// <param name="sessionKey">本次登陆密钥</param>
  610. /// <param name="procedureID">工序ID</param>
  611. /// <param name="productionDataEntitys">条码信息</param>
  612. public ActionResult AddWorkPiece(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, ProductionDataEntity[] productionDataEntitys)
  613. {
  614. ActionResult actionResult = new ActionResult();
  615. try
  616. {
  617. // 验证请求头信息
  618. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  619. // 验证失败
  620. if (actionResult.Status != (int)Constant.PDAResult.Success)
  621. {
  622. return actionResult;
  623. }
  624. DataTable dtProductionData = DataConvert.ObjectConvertToTable<ProductionDataEntity>(productionDataEntitys);
  625. if (!dtProductionData.Columns.Contains("IsPDA"))
  626. {
  627. dtProductionData.Columns.Add("IsPDA");
  628. }
  629. ProcedureEntity procedureInfo = null;
  630. DataTable resultDT = ServiceInvoker.Invoke<DataTable>(this,
  631. () => PMModuleLogicDAL.AddWorkPiece(procedureID, dtProductionData, sUserInfo, out procedureInfo));
  632. actionResult.Result = JsonHelper.ToJson(resultDT);
  633. actionResult.Status = (int)Constant.PDAResult.Success;
  634. if (resultDT != null)
  635. {
  636. DataRow[] drs = resultDT.Select("out_errMsg is not null and out_errMsg <> ''");
  637. if (drs != null && drs.Length > 0)
  638. {
  639. return actionResult;
  640. }
  641. }
  642. #region PDA条码打印
  643. if (procedureInfo != null && procedureInfo.BarCodePrintCopies > 0 &&
  644. procedureInfo.ModelType == (int)Constant.ProcedureModelType.Normal)
  645. {
  646. try
  647. {
  648. if (procedureInfo.CollectType == 1)
  649. {
  650. //foreach (DataRow item in dtProductionData.Rows)
  651. //{
  652. // ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode(item["barcode"].ToString(),
  653. // procedureInfo.BarCodePrintCopies, null, sUserInfo);
  654. // if (sre.Status != Constant.ServiceResultStatus.Success)
  655. // {
  656. // actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  657. // actionResult.Message = sre.Message;
  658. // return actionResult;
  659. // }
  660. //}
  661. }
  662. else
  663. {
  664. //ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode(dtProductionData.Rows[0]["barcode"].ToString(),
  665. // procedureInfo.BarCodePrintCopies, null, sUserInfo);
  666. ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode_3C(dtProductionData.Rows[0]["barcode"].ToString(),
  667. procedureInfo.BarCodePrintCopies, null, sUserInfo, 0);
  668. if (sre.Status != Constant.ServiceResultStatus.Success)
  669. {
  670. actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  671. actionResult.Message = sre.Message;
  672. return actionResult;
  673. }
  674. }
  675. }
  676. catch (Exception ex)
  677. {
  678. OutputLog.TraceLog(LogPriority.Error,
  679. this.ToString(),
  680. System.Reflection.MethodBase.GetCurrentMethod().Name,
  681. ex.ToString(),
  682. LocalPath.LogExePath);
  683. actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  684. actionResult.Message = "条码打印异常";
  685. return actionResult;
  686. }
  687. }
  688. #endregion PDA条码打印
  689. }
  690. catch (Exception ex)
  691. {
  692. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  693. OutputLog.TraceLog(LogPriority.Error,
  694. this.ToString(),
  695. System.Reflection.MethodBase.GetCurrentMethod().Name,
  696. ex.ToString(),
  697. LocalPath.LogExePath);
  698. try
  699. {
  700. string ss = JsonHelper.ToJson(productionDataEntitys);
  701. OutputLog.TraceLog(LogPriority.Error,
  702. this.ToString(),
  703. System.Reflection.MethodBase.GetCurrentMethod().Name,
  704. $" userCode:{userCode} procedureID:{procedureID} " + ss,
  705. LocalPath.LogExePath);
  706. }
  707. catch
  708. {
  709. }
  710. actionResult.Status = (int)Constant.PDAResult.Exception;
  711. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  712. }
  713. return actionResult;
  714. }
  715. #endregion
  716. #region 获得系统/基数数据
  717. /// <summary>
  718. /// 获得数据字典
  719. /// </summary>
  720. /// <param name="accountCode">帐套code</param>
  721. /// <param name="userCode">用户code</param>
  722. /// <param name="userPassword">用户密码</param>
  723. /// <param name="sessionKey">本次登陆密钥</param>
  724. /// <param name="dicType">字典类型</param>
  725. /// <returns></returns>
  726. public ActionResult GetDataDictionaryByType(string accountCode, string userCode, string userPassword, string sessionKey, string dicType)
  727. {
  728. ActionResult actionResult = new ActionResult();
  729. try
  730. {
  731. // 验证请求头信息
  732. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  733. // 验证失败
  734. if (actionResult.Status != (int)Constant.PDAResult.Success)
  735. {
  736. return actionResult;
  737. }
  738. DataTable dicDataTable = ServiceInvoker.Invoke<DataTable>(this,
  739. () => CommonModuleLogic.GetDataDictionaryByType(sUserInfo, dicType));
  740. actionResult.Result = JsonHelper.ToJson(dicDataTable);
  741. actionResult.Status = (int)Constant.PDAResult.Success;
  742. }
  743. catch (Exception ex)
  744. {
  745. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  746. OutputLog.TraceLog(LogPriority.Error,
  747. this.ToString(),
  748. System.Reflection.MethodBase.GetCurrentMethod().Name,
  749. ex.ToString(),
  750. LocalPath.LogExePath);
  751. actionResult.Status = (int)Constant.PDAResult.Exception;
  752. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  753. }
  754. return actionResult;
  755. }
  756. #endregion
  757. #region 检验工序接口
  758. /// <summary>
  759. /// 获得检验标识
  760. /// </summary>
  761. /// <param name="accountCode">帐套code</param>
  762. /// <param name="userCode">用户code</param>
  763. /// <param name="userPassword">用户密码</param>
  764. /// <param name="sessionKey">本次登陆密钥</param>
  765. /// <returns></returns>
  766. /// <remarks>
  767. /// 陈冰 2014.10.04 新建
  768. /// </remarks>
  769. public ActionResult GetDefectFlagData(string accountCode, string userCode, string userPassword, string sessionKey)
  770. {
  771. ActionResult actionResult = new ActionResult();
  772. try
  773. {
  774. // 验证请求头信息
  775. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  776. // 验证失败
  777. if (actionResult.Status != (int)Constant.PDAResult.Success)
  778. {
  779. return actionResult;
  780. }
  781. #region 构造缺陷标识的数据源
  782. DataTable dtDefectFlag = CreateDataSource.GetDefectFlagTable();
  783. #endregion
  784. actionResult.Result = JsonHelper.ToJson(dtDefectFlag);
  785. actionResult.Status = (int)Constant.PDAResult.Success;
  786. }
  787. catch (Exception ex)
  788. {
  789. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  790. OutputLog.TraceLog(LogPriority.Error,
  791. this.ToString(),
  792. System.Reflection.MethodBase.GetCurrentMethod().Name,
  793. ex.ToString(),
  794. LocalPath.LogExePath);
  795. actionResult.Status = (int)Constant.PDAResult.Exception;
  796. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  797. }
  798. return actionResult;
  799. }
  800. /// <summary>
  801. /// 由条码和当前检验工序获取返工工序
  802. /// </summary>
  803. /// <param name="accountCode">帐套code</param>
  804. /// <param name="userCode">用户code</param>
  805. /// <param name="userPassword">用户密码</param>
  806. /// <param name="sessionKey">本次登陆密钥</param>
  807. /// <param name="procedureID">当前检验工序ID</param>
  808. /// <param name="barcode">条码</param>
  809. /// <returns></returns>
  810. /// <remarks>
  811. /// 陈冰 2014.10.04 新建
  812. /// </remarks>
  813. public ActionResult GetReworkProcedureByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  814. {
  815. ActionResult actionResult = new ActionResult();
  816. try
  817. {
  818. // 验证请求头信息
  819. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  820. // 验证失败
  821. if (actionResult.Status != (int)Constant.PDAResult.Success)
  822. {
  823. return actionResult;
  824. }
  825. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  826. () => PMModuleLogic.GetReworkProcedureByBarcode(procedureID, barcode));
  827. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  828. {
  829. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  830. actionResult.Status = (int)Constant.PDAResult.Success;
  831. }
  832. else
  833. {
  834. actionResult.Status = (int)Constant.PDAResult.Fail;
  835. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  836. }
  837. }
  838. catch (Exception ex)
  839. {
  840. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  841. OutputLog.TraceLog(LogPriority.Error,
  842. this.ToString(),
  843. System.Reflection.MethodBase.GetCurrentMethod().Name,
  844. ex.ToString(),
  845. LocalPath.LogExePath);
  846. actionResult.Status = (int)Constant.PDAResult.Exception;
  847. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  848. }
  849. return actionResult;
  850. }
  851. /// <summary>
  852. /// 由当前检验工序获取缺陷列表
  853. /// </summary>
  854. /// <param name="accountCode">帐套code</param>
  855. /// <param name="userCode">用户code</param>
  856. /// <param name="userPassword">用户密码</param>
  857. /// <param name="sessionKey">本次登陆密钥</param>
  858. /// <param name="procedureID">当前检验工序ID</param>
  859. /// <param name="defectCode">缺陷编码</param>
  860. /// <returns></returns>
  861. /// <remarks>
  862. /// 陈冰 2014.10.04 新建
  863. /// </remarks>
  864. public ActionResult GetDefectByProcedureIDAndDefectCode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string defectCode)
  865. {
  866. ActionResult actionResult = new ActionResult();
  867. try
  868. {
  869. // 验证请求头信息
  870. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  871. // 验证失败
  872. if (actionResult.Status != (int)Constant.PDAResult.Success)
  873. {
  874. return actionResult;
  875. }
  876. object defectDs = ServiceInvoker.Invoke<object>(this,
  877. () => PMModuleLogic.GetDefectByProcedureIDAndDefectCode(procedureID, defectCode));
  878. if (defectDs != null)
  879. {
  880. actionResult.Result = JsonHelper.ToJson(defectDs);
  881. actionResult.Status = (int)Constant.PDAResult.Success;
  882. }
  883. else
  884. {
  885. actionResult.Status = (int)Constant.PDAResult.Fail;
  886. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  887. }
  888. }
  889. catch (Exception ex)
  890. {
  891. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  892. OutputLog.TraceLog(LogPriority.Error,
  893. this.ToString(),
  894. System.Reflection.MethodBase.GetCurrentMethod().Name,
  895. ex.ToString(),
  896. LocalPath.LogExePath);
  897. actionResult.Status = (int)Constant.PDAResult.Exception;
  898. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  899. }
  900. return actionResult;
  901. }
  902. /// <summary>
  903. /// 根据产品ID查出缺陷位置
  904. /// </summary>
  905. /// <param name="accountCode">帐套code</param>
  906. /// <param name="userCode">用户code</param>
  907. /// <param name="userPassword">用户密码</param>
  908. /// <param name="sessionKey">本次登陆密钥</param>
  909. /// <param name="goodsID">产品ID</param>
  910. /// <param name="positionCode">位置编码</param>
  911. /// <returns></returns>
  912. /// <remarks>
  913. /// 陈冰 2014.10.04 新建
  914. /// </remarks>
  915. public ActionResult GetDefectPositionByGoodsIDAndPositionCode(string accountCode, string userCode, string userPassword, string sessionKey, int goodsID, string positionCode)
  916. {
  917. ActionResult actionResult = new ActionResult();
  918. try
  919. {
  920. // 验证请求头信息
  921. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  922. // 验证失败
  923. if (actionResult.Status != (int)Constant.PDAResult.Success)
  924. {
  925. return actionResult;
  926. }
  927. // 缺陷位置已经不用在关联产品
  928. //object defectDs = ServiceInvoker.Invoke<object>(this,() => PMModuleLogic.GetDefectPositionByGoodsIDAndPositionCode(goodsID, positionCode));
  929. object defectDs = ServiceInvoker.Invoke<object>(this, () => PMModuleLogic.GetDefectPosition(positionCode, sUserInfo));
  930. if (defectDs != null)
  931. {
  932. actionResult.Result = JsonHelper.ToJson(defectDs);
  933. actionResult.Status = (int)Constant.PDAResult.Success;
  934. }
  935. else
  936. {
  937. actionResult.Status = (int)Constant.PDAResult.Fail;
  938. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  939. }
  940. }
  941. catch (Exception ex)
  942. {
  943. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  944. OutputLog.TraceLog(LogPriority.Error,
  945. this.ToString(),
  946. System.Reflection.MethodBase.GetCurrentMethod().Name,
  947. ex.ToString(),
  948. LocalPath.LogExePath);
  949. actionResult.Status = (int)Constant.PDAResult.Exception;
  950. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  951. }
  952. return actionResult;
  953. }
  954. /// <summary>
  955. /// 通过条码和缺陷查出责任工序
  956. /// </summary>
  957. /// <param name="accountCode">帐套code</param>
  958. /// <param name="userCode">用户code</param>
  959. /// <param name="userPassword">用户密码</param>
  960. /// <param name="sessionKey">本次登陆密钥</param>
  961. /// <param name="barcode">条码</param>
  962. /// <param name="defectid">缺陷ID</param>
  963. /// <returns></returns>
  964. /// <remarks>
  965. /// 陈冰 2014.10.04 新建
  966. /// </remarks>
  967. public ActionResult GetDutyProcedureByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int defectid)
  968. {
  969. ActionResult actionResult = new ActionResult();
  970. try
  971. {
  972. // 验证请求头信息
  973. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  974. // 验证失败
  975. if (actionResult.Status != (int)Constant.PDAResult.Success)
  976. {
  977. return actionResult;
  978. }
  979. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  980. () => PMModuleLogic.GetDutyProcedureByBarCode(barcode, defectid, sUserInfo.AccountID));
  981. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  982. {
  983. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs);
  984. actionResult.Status = (int)Constant.PDAResult.Success;
  985. }
  986. else
  987. {
  988. actionResult.Status = (int)Constant.PDAResult.Fail;
  989. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  990. }
  991. }
  992. catch (Exception ex)
  993. {
  994. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  995. OutputLog.TraceLog(LogPriority.Error,
  996. this.ToString(),
  997. System.Reflection.MethodBase.GetCurrentMethod().Name,
  998. ex.ToString(),
  999. LocalPath.LogExePath);
  1000. actionResult.Status = (int)Constant.PDAResult.Exception;
  1001. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1002. }
  1003. return actionResult;
  1004. }
  1005. /// <summary>
  1006. /// 通过条码与工序查出责任工号(己废)
  1007. /// </summary>
  1008. /// <param name="accountCode">帐套code</param>
  1009. /// <param name="userCode">用户code</param>
  1010. /// <param name="userPassword">用户密码</param>
  1011. /// <param name="sessionKey">本次登陆密钥</param>
  1012. /// <param name="barcode">条码</param>
  1013. /// <param name="dutyProcedureID">责任工序</param>
  1014. /// <returns></returns>
  1015. /// <remarks>
  1016. /// 陈冰 2014.10.04 新建
  1017. /// </remarks>
  1018. public ActionResult GetDutyProcedureCodeByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int dutyProcedureID)
  1019. {
  1020. ActionResult actionResult = new ActionResult();
  1021. try
  1022. {
  1023. // 验证请求头信息
  1024. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1025. // 验证失败
  1026. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1027. {
  1028. return actionResult;
  1029. }
  1030. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1031. () => PMModuleLogic.GetDutyProcedureCodeByBarCode(barcode, dutyProcedureID));
  1032. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1033. {
  1034. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1035. actionResult.Status = (int)Constant.PDAResult.Success;
  1036. }
  1037. else
  1038. {
  1039. actionResult.Status = (int)Constant.PDAResult.Fail;
  1040. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1041. }
  1042. }
  1043. catch (Exception ex)
  1044. {
  1045. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1046. OutputLog.TraceLog(LogPriority.Error,
  1047. this.ToString(),
  1048. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1049. ex.ToString(),
  1050. LocalPath.LogExePath);
  1051. actionResult.Status = (int)Constant.PDAResult.Exception;
  1052. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1053. }
  1054. return actionResult;
  1055. }
  1056. /// <summary>
  1057. /// 通过条码与工序查出责任工号
  1058. /// </summary>
  1059. /// <param name="accountCode"></param>
  1060. /// <param name="userCode"></param>
  1061. /// <param name="userPassword"></param>
  1062. /// <param name="sessionKey"></param>
  1063. /// <param name="ProductionDataID">生产数据ID</param>
  1064. /// <returns></returns>
  1065. public ActionResult GetDutyProcedureCodeByProductionDataID(string accountCode, string userCode, string userPassword, string sessionKey, int ProductionDataID)
  1066. {
  1067. ActionResult actionResult = new ActionResult();
  1068. try
  1069. {
  1070. // 验证请求头信息
  1071. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1072. // 验证失败
  1073. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1074. {
  1075. return actionResult;
  1076. }
  1077. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1078. () => PMModuleLogic.GetDutyProcedureCodeByProductionDataID(ProductionDataID));
  1079. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1080. {
  1081. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1082. actionResult.Status = (int)Constant.PDAResult.Success;
  1083. }
  1084. else
  1085. {
  1086. actionResult.Status = (int)Constant.PDAResult.Fail;
  1087. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1088. }
  1089. }
  1090. catch (Exception ex)
  1091. {
  1092. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1093. OutputLog.TraceLog(LogPriority.Error,
  1094. this.ToString(),
  1095. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1096. ex.ToString(),
  1097. LocalPath.LogExePath);
  1098. actionResult.Status = (int)Constant.PDAResult.Exception;
  1099. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1100. }
  1101. return actionResult;
  1102. }
  1103. /// <summary>
  1104. /// 通过生产数据与工号ID查询工种
  1105. /// </summary>
  1106. /// <param name="accountCode">帐套code</param>
  1107. /// <param name="userCode">用户code</param>
  1108. /// <param name="userPassword">用户密码</param>
  1109. /// <param name="sessionKey">本次登陆密钥</param>
  1110. /// <param name="productionDataID">生产数据ID</param>
  1111. /// <param name="userID">工号ID</param>
  1112. /// <returns></returns>
  1113. /// <remarks>
  1114. /// 陈冰 2014.10.08 新建
  1115. /// </remarks>
  1116. public ActionResult GetDutyJobsByUserIDAndProductionID(string accountCode, string userCode, string userPassword, string sessionKey,
  1117. //int productionDataID, int userID)
  1118. int classesSettingID, int defectid, int procedureID)
  1119. {
  1120. ActionResult actionResult = new ActionResult();
  1121. try
  1122. {
  1123. // 验证请求头信息
  1124. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1125. // 验证失败
  1126. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1127. {
  1128. return actionResult;
  1129. }
  1130. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1131. //() => PMModuleLogic.GetDutyJobsCodeByUser(userID, productionDataID));
  1132. () => PDAModuleLogic.GetDutyJobsCodeByUser(classesSettingID, defectid, procedureID));
  1133. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1134. {
  1135. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1136. actionResult.Status = (int)Constant.PDAResult.Success;
  1137. }
  1138. else
  1139. {
  1140. actionResult.Status = (int)Constant.PDAResult.Fail;
  1141. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1142. }
  1143. }
  1144. catch (Exception ex)
  1145. {
  1146. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1147. OutputLog.TraceLog(LogPriority.Error,
  1148. this.ToString(),
  1149. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1150. ex.ToString(),
  1151. LocalPath.LogExePath);
  1152. actionResult.Status = (int)Constant.PDAResult.Exception;
  1153. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1154. }
  1155. return actionResult;
  1156. }
  1157. /// <summary>
  1158. /// 根据生产数据ID,用户ID及工种选出责任员工
  1159. /// </summary>
  1160. /// <param name="accountCode">帐套code</param>
  1161. /// <param name="userCode">用户code</param>
  1162. /// <param name="userPassword">用户密码</param>
  1163. /// <param name="sessionKey">本次登陆密钥</param>
  1164. /// <param name="productionDataID">生产数据ID</param>
  1165. /// <param name="userID">工号ID</param>
  1166. /// <param name="jobsID">工种ID</param>
  1167. /// <returns></returns>
  1168. /// <remarks>
  1169. /// 陈冰 2014.10.08 新建
  1170. /// </remarks>
  1171. public ActionResult GetDutyStaffByUserIDAndJobs(string accountCode, string userCode, string userPassword, string sessionKey,
  1172. //int productionDataID, int userID, int jobsID)
  1173. int classesSettingID, int jobsID)
  1174. {
  1175. ActionResult actionResult = new ActionResult();
  1176. try
  1177. {
  1178. // 验证请求头信息
  1179. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1180. // 验证失败
  1181. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1182. {
  1183. return actionResult;
  1184. }
  1185. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1186. //() => PMModuleLogic.GetDutyStaffByUserIDAndJobs(productionDataID, userID, jobsID));
  1187. () => PDAModuleLogic.GetDutyStaffByUserIDAndJobs(classesSettingID, jobsID));
  1188. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1189. {
  1190. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1191. actionResult.Status = (int)Constant.PDAResult.Success;
  1192. }
  1193. else
  1194. {
  1195. actionResult.Status = (int)Constant.PDAResult.Fail;
  1196. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1197. }
  1198. }
  1199. catch (Exception ex)
  1200. {
  1201. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1202. OutputLog.TraceLog(LogPriority.Error,
  1203. this.ToString(),
  1204. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1205. ex.ToString(),
  1206. LocalPath.LogExePath);
  1207. actionResult.Status = (int)Constant.PDAResult.Exception;
  1208. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1209. }
  1210. return actionResult;
  1211. }
  1212. /// <summary>
  1213. /// 获得产品分级
  1214. /// </summary>
  1215. /// <param name="accountCode">帐套code</param>
  1216. /// <param name="userCode">用户code</param>
  1217. /// <param name="userPassword">用户密码</param>
  1218. /// <param name="sessionKey">本次登陆密钥</param>
  1219. /// <returns></returns>
  1220. /// <remarks>
  1221. /// 陈冰 2014.10.08 新建
  1222. /// xuwei 2019-12-4 添加参数type 默认为2成检 为1时 半检
  1223. /// </remarks>
  1224. public ActionResult GetGoodsGradeData(string accountCode, string userCode, string userPassword, string sessionKey, int type = 2)
  1225. {
  1226. ActionResult actionResult = new ActionResult();
  1227. try
  1228. {
  1229. // 验证请求头信息
  1230. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1231. // 验证失败
  1232. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1233. {
  1234. return actionResult;
  1235. }
  1236. #region 构造产品分级的数据源
  1237. //DataTable dtGrade = CreateDataSource.GetGoodsGradeTable();
  1238. //xuwei modify 2019-12-04 支持半检 没传参数 type=0
  1239. //DataSet dsGrade = SystemModuleLogic.GetGoodsLevel(2 , sUserInfo);
  1240. DataSet dsGrade = SystemModuleLogic.GetGoodsLevel(type == 0 ? 2 : type, sUserInfo);
  1241. if (dsGrade != null && dsGrade.Tables.Count > Constant.INT_IS_ZERO)
  1242. {
  1243. actionResult.Result = JsonHelper.ToJson(dsGrade.Tables[0]);
  1244. actionResult.Status = (int)Constant.PDAResult.Success;
  1245. }
  1246. else
  1247. {
  1248. actionResult.Status = (int)Constant.PDAResult.Fail;
  1249. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1250. }
  1251. #endregion
  1252. }
  1253. catch (Exception ex)
  1254. {
  1255. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1256. OutputLog.TraceLog(LogPriority.Error,
  1257. this.ToString(),
  1258. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1259. ex.ToString(),
  1260. LocalPath.LogExePath);
  1261. OutputLog.TraceLog(LogPriority.Error,
  1262. this.ToString(),
  1263. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1264. ex.ToString(),
  1265. LocalPath.LogExePath);
  1266. actionResult.Status = (int)Constant.PDAResult.Exception;
  1267. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1268. }
  1269. return actionResult;
  1270. }
  1271. #endregion
  1272. #region 保存检验条码
  1273. /// <summary>
  1274. /// 保存检验条码
  1275. /// </summary>
  1276. /// <param name="accountCode">帐套code</param>
  1277. /// <param name="userCode">用户code</param>
  1278. /// <param name="userPassword">用户密码</param>
  1279. /// <param name="sessionKey">本次登陆密钥</param>
  1280. /// <param name="procedureID">工序ID</param>
  1281. /// <param name="productionDataEntitys">条码信息</param>
  1282. /// <returns></returns>
  1283. public ActionResult AddCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, ProductionDataEntity[] productionDataEntitys)
  1284. {
  1285. ActionResult actionResult = new ActionResult();
  1286. try
  1287. {
  1288. // 验证请求头信息
  1289. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1290. // 验证失败
  1291. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1292. {
  1293. return actionResult;
  1294. }
  1295. //if(productionDataEntitys.Length>0)
  1296. //{
  1297. // if(productionDataEntitys[0].ProductionDataID>0)
  1298. // {
  1299. // productionDataEntitys[0].OPTimeStamp = Convert.ToDateTime(productionDataEntitys[0].OPTimeStampPDA.Replace("-","/"));
  1300. // }
  1301. //}
  1302. string err = ServiceInvoker.Invoke<string>(this,
  1303. //() => PMModuleLogicDAL.AddCheckBarcode(procedureID, productionDataEntitys, sUserInfo));
  1304. () => PMModuleLogicDAL.AddCheckBarcodePDA(procedureID, productionDataEntitys, sUserInfo));
  1305. if (err == null)
  1306. {
  1307. err = "";
  1308. }
  1309. //actionResult.Result = JsonHelper.ToJson(err);
  1310. actionResult.Result = err;// JsonHelper.ToJson(err);
  1311. actionResult.Status = (int)Constant.PDAResult.Success;
  1312. }
  1313. catch (Exception ex)
  1314. {
  1315. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1316. OutputLog.TraceLog(LogPriority.Error,
  1317. this.ToString(),
  1318. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1319. ex.ToString(),
  1320. LocalPath.LogExePath);
  1321. actionResult.Status = (int)Constant.PDAResult.Exception;
  1322. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1323. }
  1324. return actionResult;
  1325. }
  1326. #endregion
  1327. #region 文件上传下载
  1328. /// <summary>
  1329. /// 软件更新
  1330. /// </summary>
  1331. /// <param name="accountCode">帐套code</param>
  1332. /// <param name="userCode">用户code</param>
  1333. /// <param name="userPassword">用户密码</param>
  1334. /// <param name="sessionKey">本次登陆密钥</param>
  1335. /// <returns></returns>
  1336. public Stream AutoUpgrade(string accountCode, string userCode, string userPassword, string sessionKey)
  1337. {
  1338. try
  1339. {
  1340. return ServiceInvoker.Invoke<Stream>(this, () => PDAModuleLogic.AutoUpgrade());
  1341. }
  1342. catch (Exception ex)
  1343. {
  1344. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1345. OutputLog.TraceLog(LogPriority.Error,
  1346. this.ToString(),
  1347. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1348. ex.ToString(),
  1349. LocalPath.LogExePath);
  1350. return null;
  1351. }
  1352. }
  1353. /// <summary>
  1354. /// 上传临时文件
  1355. /// </summary>
  1356. /// <param name="imgStream"></param>
  1357. /// <returns></returns>
  1358. public ActionResult SaveImg(Stream mageStream)
  1359. {
  1360. ActionResult actionResult = new ActionResult();
  1361. try
  1362. {
  1363. string err = PDAModuleLogic.SaveImg(mageStream);
  1364. if (err == null)
  1365. {
  1366. err = "";
  1367. }
  1368. actionResult.Result = err;
  1369. actionResult.Status = (int)Constant.PDAResult.Success;
  1370. }
  1371. catch (Exception ex)
  1372. {
  1373. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1374. OutputLog.TraceLog(LogPriority.Error,
  1375. this.ToString(),
  1376. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1377. ex.ToString(),
  1378. LocalPath.LogExePath);
  1379. actionResult.Status = (int)Constant.PDAResult.Exception;
  1380. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1381. }
  1382. return actionResult;
  1383. }
  1384. public Stream GetFileTest(string path)
  1385. {
  1386. return PDAModuleLogic.GetImg(path);
  1387. }
  1388. public Stream GetFileStream()
  1389. {
  1390. FileStream fs = new FileStream("999.apk", FileMode.OpenOrCreate, FileAccess.Read);
  1391. long l = fs.Length;
  1392. return fs;
  1393. }
  1394. public byte[] GetFileTestByte(string path)
  1395. {
  1396. FileStream stream = new FileInfo(path).OpenRead();
  1397. Byte[] buffer = new Byte[stream.Length];
  1398. //从流中读取字节块并将该数据写入给定缓冲区buffer中
  1399. stream.Read(buffer, 0, Convert.ToInt32(stream.Length));
  1400. return buffer;
  1401. }
  1402. public string GetFile(string path)
  1403. {
  1404. string imgFilePath = path;
  1405. System.IO.FileStream fs = new System.IO.FileStream(imgFilePath, System.IO.FileMode.Open);
  1406. int i = (int)fs.Length;
  1407. byte[] content = new byte[i];
  1408. fs.Read(content, 0, i);
  1409. string result = Convert.ToBase64String(content);
  1410. fs.Close();
  1411. FileStream fsTxt = new FileStream("A.txt", FileMode.OpenOrCreate);
  1412. StreamWriter sw = new StreamWriter(fsTxt, System.Text.Encoding.Default);
  1413. sw.Write(result);
  1414. sw.Close();
  1415. fsTxt.Close();
  1416. return result;
  1417. }
  1418. #endregion
  1419. /// <summary>
  1420. /// 获得产品分级
  1421. /// </summary>
  1422. /// <param name="accountCode">帐套code</param>
  1423. /// <param name="userCode">用户code</param>
  1424. /// <param name="userPassword">用户密码</param>
  1425. /// <param name="sessionKey">本次登陆密钥</param>
  1426. /// <param name="procedureID">当前工序ID</param>
  1427. /// <returns></returns>
  1428. /// <remarks>
  1429. /// 陈冰 2014.10.22 新建
  1430. /// </remarks>
  1431. public ActionResult GetReworkProcedureByProcedureID(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  1432. {
  1433. ActionResult actionResult = new ActionResult();
  1434. try
  1435. {
  1436. // 验证请求头信息
  1437. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1438. // 验证失败
  1439. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1440. {
  1441. return actionResult;
  1442. }
  1443. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1444. () => PMModuleLogic.GetReworkProcedureByProcedureID(procedureID));
  1445. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1446. {
  1447. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1448. actionResult.Status = (int)Constant.PDAResult.Success;
  1449. }
  1450. else
  1451. {
  1452. actionResult.Status = (int)Constant.PDAResult.Fail;
  1453. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1454. }
  1455. }
  1456. catch (Exception ex)
  1457. {
  1458. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1459. OutputLog.TraceLog(LogPriority.Error,
  1460. this.ToString(),
  1461. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1462. ex.ToString(),
  1463. LocalPath.LogExePath);
  1464. actionResult.Status = (int)Constant.PDAResult.Exception;
  1465. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1466. }
  1467. return actionResult;
  1468. }
  1469. /// <summary>
  1470. /// 获得产品分级
  1471. /// </summary>
  1472. /// <param name="accountCode">帐套code</param>
  1473. /// <param name="userCode">用户code</param>
  1474. /// <param name="userPassword">用户密码</param>
  1475. /// <param name="sessionKey">本次登陆密钥</param>
  1476. /// <param name="barcode">条码</param>
  1477. /// <returns></returns>
  1478. public ActionResult GetKilnCarByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  1479. {
  1480. ActionResult actionResult = new ActionResult();
  1481. try
  1482. {
  1483. // 验证请求头信息
  1484. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1485. // 验证失败
  1486. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1487. {
  1488. return actionResult;
  1489. }
  1490. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1491. () => PMModuleLogic.GetKilnCarByBarCode(barcode));
  1492. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1493. {
  1494. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1495. actionResult.Status = (int)Constant.PDAResult.Success;
  1496. }
  1497. else
  1498. {
  1499. actionResult.Status = (int)Constant.PDAResult.Fail;
  1500. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1501. }
  1502. }
  1503. catch (Exception ex)
  1504. {
  1505. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1506. OutputLog.TraceLog(LogPriority.Error,
  1507. this.ToString(),
  1508. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1509. ex.ToString(),
  1510. LocalPath.LogExePath);
  1511. actionResult.Status = (int)Constant.PDAResult.Exception;
  1512. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1513. }
  1514. return actionResult;
  1515. }
  1516. #region 统计
  1517. /// <summary>
  1518. /// 统计当日计数数量
  1519. /// </summary>
  1520. /// <param name="accountCode">帐套code</param>
  1521. /// <param name="userCode">用户code</param>
  1522. /// <param name="userPassword">用户密码</param>
  1523. /// <param name="sessionKey">本次登陆密钥</param>
  1524. /// <param name="procedureID">工序ID</param>
  1525. /// <returns></returns>
  1526. public ActionResult StatisticsCollectBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  1527. {
  1528. ActionResult actionResult = new ActionResult();
  1529. try
  1530. {
  1531. // 验证请求头信息
  1532. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1533. // 验证失败
  1534. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1535. {
  1536. return actionResult;
  1537. }
  1538. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1539. () => PDAModuleLogic.StatisticsCollectBarcode(procedureID, sUserInfo));
  1540. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1541. {
  1542. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1543. actionResult.Status = (int)Constant.PDAResult.Success;
  1544. }
  1545. else
  1546. {
  1547. actionResult.Status = (int)Constant.PDAResult.Fail;
  1548. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1549. }
  1550. }
  1551. catch (Exception ex)
  1552. {
  1553. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1554. OutputLog.TraceLog(LogPriority.Error,
  1555. this.ToString(),
  1556. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1557. ex.ToString(),
  1558. LocalPath.LogExePath);
  1559. actionResult.Status = (int)Constant.PDAResult.Exception;
  1560. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1561. }
  1562. return actionResult;
  1563. }
  1564. /// <summary>
  1565. /// 统计当日计数数量
  1566. /// </summary>
  1567. /// <param name="accountCode">帐套code</param>
  1568. /// <param name="userCode">用户code</param>
  1569. /// <param name="userPassword">用户密码</param>
  1570. /// <param name="sessionKey">本次登陆密钥</param>
  1571. /// <param name="procedureID">工序ID</param>
  1572. /// <returns></returns>
  1573. public ActionResult StatisticsKilnCar(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  1574. {
  1575. ActionResult actionResult = new ActionResult();
  1576. try
  1577. {
  1578. // 验证请求头信息
  1579. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1580. // 验证失败
  1581. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1582. {
  1583. return actionResult;
  1584. }
  1585. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1586. () => PDAModuleLogic.StatisticsKilnCar(procedureID, sUserInfo));
  1587. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1588. {
  1589. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1590. actionResult.Status = (int)Constant.PDAResult.Success;
  1591. }
  1592. else
  1593. {
  1594. actionResult.Status = (int)Constant.PDAResult.Fail;
  1595. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1596. }
  1597. }
  1598. catch (Exception ex)
  1599. {
  1600. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1601. OutputLog.TraceLog(LogPriority.Error,
  1602. this.ToString(),
  1603. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1604. ex.ToString(),
  1605. LocalPath.LogExePath);
  1606. actionResult.Status = (int)Constant.PDAResult.Exception;
  1607. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1608. }
  1609. return actionResult;
  1610. }
  1611. /// <summary>
  1612. /// 统计产品跟踪
  1613. /// </summary>
  1614. /// <param name="accountCode">帐套code</param>
  1615. /// <param name="userCode">用户code</param>
  1616. /// <param name="userPassword">用户密码</param>
  1617. /// <param name="sessionKey">本次登陆密钥</param>
  1618. /// <param name="procedureID">工序ID</param>
  1619. /// <returns></returns>
  1620. public ActionResult StatisticsProductTrack(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  1621. {
  1622. ActionResult actionResult = new ActionResult();
  1623. try
  1624. {
  1625. // 验证请求头信息
  1626. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1627. // 验证失败
  1628. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1629. {
  1630. return actionResult;
  1631. }
  1632. RPT020101_SE se = new RPT020101_SE();
  1633. se.Barcode = barcode;
  1634. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  1635. () => Dongke.IBOSS.PRD.Service.ReportModuleLogic.ReportModuleLogic.GetRPT020101SData(sUserInfo, se));
  1636. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  1637. {
  1638. actionResult.Status = (int)Constant.PDAResult.Fail;
  1639. actionResult.Message = Messages.MSG_CMN_I002;
  1640. }
  1641. else
  1642. {
  1643. actionResult.Result = JsonHelper.ToJson(sre.Data);
  1644. actionResult.Status = (int)Constant.PDAResult.Success;
  1645. }
  1646. //ProductionDataEntity productionDataEntity = ServiceInvoker.Invoke<ProductionDataEntity>(this,
  1647. // () => PDAModuleLogic.StatisticsProductTrack(barcode, sUserInfo));
  1648. //if (productionDataEntity != null)
  1649. //{
  1650. // actionResult.Result = JsonHelper.ToJson(productionDataEntity);
  1651. // actionResult.Status = (int)Constant.PDAResult.Success;
  1652. //}
  1653. //else
  1654. //{
  1655. // actionResult.Status = (int)Constant.PDAResult.Fail;
  1656. // actionResult.Message = Messages.MSG_CMN_I002;
  1657. //}
  1658. }
  1659. catch (Exception ex)
  1660. {
  1661. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1662. OutputLog.TraceLog(LogPriority.Error,
  1663. this.ToString(),
  1664. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1665. ex.ToString() + ex.HelpLink,
  1666. LocalPath.LogExePath);
  1667. actionResult.Status = (int)Constant.PDAResult.Exception;
  1668. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1669. }
  1670. return actionResult;
  1671. }
  1672. #endregion
  1673. #region 撤销装车及成检
  1674. /// <summary>
  1675. /// 检验条码是否可以撤销装车
  1676. /// </summary>
  1677. /// <param name="accountCode">帐套code</param>
  1678. /// <param name="userCode">用户code</param>
  1679. /// <param name="userPassword">用户密码</param>
  1680. /// <param name="sessionKey">本次登陆密钥</param>
  1681. /// <param name="procedureID">当前工序ID</param>
  1682. /// <param name="barcode">条码</param>
  1683. /// <returns></returns>
  1684. public ActionResult CheckCancelLoadCar(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  1685. {
  1686. ActionResult actionResult = new ActionResult();
  1687. try
  1688. {
  1689. // 验证请求头信息
  1690. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1691. // 验证失败
  1692. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1693. {
  1694. return actionResult;
  1695. }
  1696. CheckCancelLoadCar checkCancelLoadCar = ServiceInvoker.Invoke<CheckCancelLoadCar>(this,
  1697. () => PMModuleLogic.CheckCancelLoadCar(procedureID, barcode, sUserInfo));
  1698. actionResult.Result = JsonHelper.ToJson(checkCancelLoadCar);
  1699. actionResult.Status = (int)Constant.PDAResult.Success;
  1700. }
  1701. catch (Exception ex)
  1702. {
  1703. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1704. OutputLog.TraceLog(LogPriority.Error,
  1705. this.ToString(),
  1706. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1707. ex.ToString(),
  1708. LocalPath.LogExePath);
  1709. actionResult.Status = (int)Constant.PDAResult.Exception;
  1710. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1711. }
  1712. return actionResult;
  1713. }
  1714. /// <summary>
  1715. /// 保存撤销装车的条码
  1716. /// </summary>
  1717. /// <param name="accountCode">帐套code</param>
  1718. /// <param name="userCode">用户code</param>
  1719. /// <param name="userPassword">用户密码</param>
  1720. /// <param name="sessionKey">本次登陆密钥</param>
  1721. /// <param name="procedureID">当前工序ID</param>
  1722. /// <param name="barcode">条码</param>
  1723. /// <returns></returns>
  1724. public ActionResult AddCancelLoadCar(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  1725. {
  1726. ActionResult actionResult = new ActionResult();
  1727. try
  1728. {
  1729. // 验证请求头信息
  1730. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1731. // 验证失败
  1732. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1733. {
  1734. return actionResult;
  1735. }
  1736. string err = ServiceInvoker.Invoke<string>(this,
  1737. () => PMModuleLogicDAL.AddCancelLoadCar(procedureID, barcode, sUserInfo));
  1738. if (err == null)
  1739. {
  1740. err = "";
  1741. }
  1742. actionResult.Result = JsonHelper.ToJson(err);
  1743. actionResult.Status = (int)Constant.PDAResult.Success;
  1744. }
  1745. catch (Exception ex)
  1746. {
  1747. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1748. OutputLog.TraceLog(LogPriority.Error,
  1749. this.ToString(),
  1750. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1751. ex.ToString(),
  1752. LocalPath.LogExePath);
  1753. actionResult.Status = (int)Constant.PDAResult.Exception;
  1754. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1755. }
  1756. return actionResult;
  1757. }
  1758. /// <summary>
  1759. /// 由产品条码获取注浆信息
  1760. /// </summary>
  1761. /// <param name="barcode"></param>
  1762. /// <returns></returns>
  1763. public ActionResult GetGroutingProducttByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  1764. {
  1765. ActionResult actionResult = new ActionResult();
  1766. try
  1767. {
  1768. // 验证请求头信息
  1769. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1770. // 验证失败
  1771. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1772. {
  1773. return actionResult;
  1774. }
  1775. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1776. () => PDAModuleLogic.GetGroutingProducttByBarCode(barcode));
  1777. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1778. {
  1779. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1780. actionResult.Status = (int)Constant.PDAResult.Success;
  1781. }
  1782. else
  1783. {
  1784. actionResult.Status = (int)Constant.PDAResult.Fail;
  1785. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1786. }
  1787. }
  1788. catch (Exception ex)
  1789. {
  1790. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1791. OutputLog.TraceLog(LogPriority.Error,
  1792. this.ToString(),
  1793. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1794. ex.ToString(),
  1795. LocalPath.LogExePath);
  1796. actionResult.Status = (int)Constant.PDAResult.Exception;
  1797. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1798. }
  1799. return actionResult;
  1800. }
  1801. /// <summary>
  1802. /// 获取工号下的所有工种信息
  1803. /// </summary>
  1804. /// <param name="UserID">工号ID</param>
  1805. /// <returns></returns>
  1806. public ActionResult GetAllJobsByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int UserID)
  1807. {
  1808. ActionResult actionResult = new ActionResult();
  1809. try
  1810. {
  1811. // 验证请求头信息
  1812. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1813. // 验证失败
  1814. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1815. {
  1816. return actionResult;
  1817. }
  1818. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1819. () => PDAModuleLogic.GetAllJobsByUserID(UserID, sUserInfo));
  1820. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1821. {
  1822. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1823. actionResult.Status = (int)Constant.PDAResult.Success;
  1824. }
  1825. else
  1826. {
  1827. actionResult.Status = (int)Constant.PDAResult.Fail;
  1828. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1829. }
  1830. }
  1831. catch (Exception ex)
  1832. {
  1833. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1834. OutputLog.TraceLog(LogPriority.Error,
  1835. this.ToString(),
  1836. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1837. ex.ToString(),
  1838. LocalPath.LogExePath);
  1839. actionResult.Status = (int)Constant.PDAResult.Exception;
  1840. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1841. }
  1842. return actionResult;
  1843. }
  1844. /// <summary>
  1845. /// 根据所选工号对应的工种,查出缺陷责任员工
  1846. /// </summary>
  1847. /// <param name="jobs">工种ID</param>
  1848. /// <returns></returns>
  1849. public ActionResult GetDutyStaffByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int jobs)
  1850. {
  1851. ActionResult actionResult = new ActionResult();
  1852. try
  1853. {
  1854. // 验证请求头信息
  1855. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1856. // 验证失败
  1857. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1858. {
  1859. return actionResult;
  1860. }
  1861. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1862. () => PDAModuleLogic.GetDutyStaffByUserID(jobs, sUserInfo));
  1863. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1864. {
  1865. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1866. actionResult.Status = (int)Constant.PDAResult.Success;
  1867. }
  1868. else
  1869. {
  1870. actionResult.Status = (int)Constant.PDAResult.Fail;
  1871. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1872. }
  1873. }
  1874. catch (Exception ex)
  1875. {
  1876. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1877. OutputLog.TraceLog(LogPriority.Error,
  1878. this.ToString(),
  1879. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1880. ex.ToString(),
  1881. LocalPath.LogExePath);
  1882. actionResult.Status = (int)Constant.PDAResult.Exception;
  1883. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1884. }
  1885. return actionResult;
  1886. }
  1887. /// <summary>
  1888. /// 根据所选工号,查出漏检责任员工
  1889. /// </summary>
  1890. /// <param name="userid">工号</param>
  1891. /// <returns></returns>
  1892. public ActionResult GetMissedStaffByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int userid)
  1893. {
  1894. ActionResult actionResult = new ActionResult();
  1895. try
  1896. {
  1897. // 验证请求头信息
  1898. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1899. // 验证失败
  1900. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1901. {
  1902. return actionResult;
  1903. }
  1904. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1905. () => PDAModuleLogic.GetMissedStaffByUserID(userid, sUserInfo));
  1906. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1907. {
  1908. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1909. actionResult.Status = (int)Constant.PDAResult.Success;
  1910. }
  1911. else
  1912. {
  1913. actionResult.Status = (int)Constant.PDAResult.Fail;
  1914. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1915. }
  1916. }
  1917. catch (Exception ex)
  1918. {
  1919. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1920. OutputLog.TraceLog(LogPriority.Error,
  1921. this.ToString(),
  1922. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1923. ex.ToString(),
  1924. LocalPath.LogExePath);
  1925. actionResult.Status = (int)Constant.PDAResult.Exception;
  1926. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1927. }
  1928. return actionResult;
  1929. }
  1930. /// <summary>
  1931. /// 获取用户列表
  1932. /// </summary>
  1933. /// <param name="requestEntity">用户实体</param>
  1934. /// <returns></returns>
  1935. public ActionResult SearchUserData(string accountCode, string userCode, string userPassword, string sessionKey, byte IsWorker)
  1936. {
  1937. ActionResult actionResult = new ActionResult();
  1938. try
  1939. {
  1940. // 验证请求头信息
  1941. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1942. // 验证失败
  1943. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1944. {
  1945. return actionResult;
  1946. }
  1947. SUserEntity requestEntity = new SUserEntity();
  1948. requestEntity.IsWorker = IsWorker;
  1949. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1950. () => PDAModuleLogic.SearchUserData(requestEntity, sUserInfo));
  1951. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1952. {
  1953. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1954. actionResult.Status = (int)Constant.PDAResult.Success;
  1955. }
  1956. else
  1957. {
  1958. actionResult.Status = (int)Constant.PDAResult.Fail;
  1959. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1960. }
  1961. }
  1962. catch (Exception ex)
  1963. {
  1964. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1965. OutputLog.TraceLog(LogPriority.Error,
  1966. this.ToString(),
  1967. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1968. ex.ToString(),
  1969. LocalPath.LogExePath);
  1970. actionResult.Status = (int)Constant.PDAResult.Exception;
  1971. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1972. }
  1973. return actionResult;
  1974. }
  1975. /// <summary>
  1976. /// 获取数据字典管理的数据
  1977. /// </summary>
  1978. /// <param name="Pvalue">显示停用标识</param>
  1979. /// <param name="dictionaryType">字典类别</param>
  1980. /// <returns></returns>
  1981. /// <remarks>
  1982. /// 2014.12.03 新建
  1983. /// </remarks>
  1984. public ActionResult GetDictionaryData(string accountCode, string userCode, string userPassword, string sessionKey, byte Pvalue, string dictionaryType)
  1985. {
  1986. ActionResult actionResult = new ActionResult();
  1987. try
  1988. {
  1989. // 验证请求头信息
  1990. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1991. // 验证失败
  1992. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1993. {
  1994. return actionResult;
  1995. }
  1996. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1997. () => PDAModuleLogic.GetDictionaryData(Pvalue, dictionaryType, sUserInfo));
  1998. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1999. {
  2000. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2001. actionResult.Status = (int)Constant.PDAResult.Success;
  2002. }
  2003. else
  2004. {
  2005. actionResult.Status = (int)Constant.PDAResult.Fail;
  2006. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2007. }
  2008. }
  2009. catch (Exception ex)
  2010. {
  2011. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2012. OutputLog.TraceLog(LogPriority.Error,
  2013. this.ToString(),
  2014. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2015. ex.ToString(),
  2016. LocalPath.LogExePath);
  2017. actionResult.Status = (int)Constant.PDAResult.Exception;
  2018. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2019. }
  2020. return actionResult;
  2021. }
  2022. #endregion
  2023. #region 保存半检数据
  2024. /// <summary>
  2025. /// 保存半检数据
  2026. /// </summary>
  2027. /// <param name="accountCode">帐套code</param>
  2028. /// <param name="userCode">用户code</param>
  2029. /// <param name="userPassword">用户密码</param>
  2030. /// <param name="sessionKey">本次登陆密钥</param>
  2031. /// <param name="productionDataEntitys">半检信息</param>
  2032. /// <returns></returns>
  2033. public ActionResult AddSemiTest(string accountCode, string userCode, string userPassword, string sessionKey, SemiTestEntity[] semiTestEntitys)
  2034. {
  2035. ActionResult actionResult = new ActionResult();
  2036. try
  2037. {
  2038. // 验证请求头信息
  2039. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2040. // 验证失败
  2041. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2042. {
  2043. return actionResult;
  2044. }
  2045. string err = ServiceInvoker.Invoke<string>(this,
  2046. () => PMModuleLogicDAL.AddSemiTest(semiTestEntitys, sUserInfo));
  2047. if (err == null)
  2048. {
  2049. err = "";
  2050. }
  2051. actionResult.Result = JsonHelper.ToJson(err);
  2052. actionResult.Status = (int)Constant.PDAResult.Success;
  2053. }
  2054. catch (Exception ex)
  2055. {
  2056. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2057. OutputLog.TraceLog(LogPriority.Error,
  2058. this.ToString(),
  2059. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2060. ex.ToString(),
  2061. LocalPath.LogExePath);
  2062. actionResult.Status = (int)Constant.PDAResult.Exception;
  2063. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2064. }
  2065. return actionResult;
  2066. }
  2067. #endregion
  2068. /// <summary>
  2069. /// 获取产品列表
  2070. /// </summary>
  2071. /// <returns></returns>
  2072. public ActionResult SerachGoods(string accountCode, string userCode, string userPassword, string sessionKey, int valueFlag)
  2073. {
  2074. ActionResult actionResult = new ActionResult();
  2075. try
  2076. {
  2077. // 验证请求头信息
  2078. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2079. // 验证失败
  2080. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2081. {
  2082. return actionResult;
  2083. }
  2084. GoodsEntity goodsEntity = new GoodsEntity();
  2085. goodsEntity.ValueFlag = 1;//有效标记
  2086. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2087. () => PDAModuleLogic.SerachGoods(sUserInfo, goodsEntity));
  2088. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2089. {
  2090. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2091. actionResult.Status = (int)Constant.PDAResult.Success;
  2092. }
  2093. else
  2094. {
  2095. actionResult.Status = (int)Constant.PDAResult.Fail;
  2096. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2097. }
  2098. }
  2099. catch (Exception ex)
  2100. {
  2101. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2102. OutputLog.TraceLog(LogPriority.Error,
  2103. this.ToString(),
  2104. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2105. ex.ToString(),
  2106. LocalPath.LogExePath);
  2107. actionResult.Status = (int)Constant.PDAResult.Exception;
  2108. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2109. }
  2110. return actionResult;
  2111. }
  2112. /// <summary>
  2113. /// 使用存储过程PRO_PM_GetProductionData获取生产工序计件数据
  2114. /// </summary>
  2115. /// <param name="searchEntity">生产数据实体类</param>
  2116. /// <returns>DataTable</returns>
  2117. public ActionResult GetProductionData(string accountCode, string userCode, string userPassword, string sessionKey, int ProcedureID, string BarCode)
  2118. {
  2119. ActionResult actionResult = new ActionResult();
  2120. try
  2121. {
  2122. // 验证请求头信息
  2123. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2124. // 验证失败
  2125. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2126. {
  2127. return actionResult;
  2128. }
  2129. SearchProductionDataEntity searchEntity = new SearchProductionDataEntity();
  2130. searchEntity.ProcedureID = ProcedureID;
  2131. searchEntity.BarCode = BarCode;
  2132. DataTable reworkDs = ServiceInvoker.Invoke<DataTable>(this,
  2133. () => PDAModuleLogic.GetProductionData(searchEntity, sUserInfo));
  2134. if (reworkDs != null && reworkDs.Rows.Count > Constant.INT_IS_ZERO)
  2135. {
  2136. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2137. actionResult.Status = (int)Constant.PDAResult.Success;
  2138. }
  2139. else
  2140. {
  2141. actionResult.Status = (int)Constant.PDAResult.Fail;
  2142. actionResult.Message = Constant.PDA_RESULT_ALLOW_ERR;
  2143. }
  2144. }
  2145. catch (Exception ex)
  2146. {
  2147. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2148. OutputLog.TraceLog(LogPriority.Error,
  2149. this.ToString(),
  2150. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2151. ex.ToString(),
  2152. LocalPath.LogExePath);
  2153. actionResult.Status = (int)Constant.PDAResult.Exception;
  2154. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2155. }
  2156. return actionResult;
  2157. }
  2158. /// <summary>
  2159. /// xuwei add 2020-03-23 此方法用于成检后 回收 再次成检 获取正确ID
  2160. /// </summary>
  2161. /// <param name="searchEntity">生产数据实体类</param>
  2162. /// <returns>DataTable</returns>
  2163. public ActionResult GetProductionDataCheckID(string accountCode, string userCode, string userPassword, string sessionKey, string BarCode)
  2164. {
  2165. ActionResult actionResult = new ActionResult();
  2166. try
  2167. {
  2168. // 验证请求头信息
  2169. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2170. // 验证失败
  2171. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2172. {
  2173. return actionResult;
  2174. }
  2175. SearchProductionDataEntity searchEntity = new SearchProductionDataEntity();
  2176. searchEntity.BarCode = BarCode;
  2177. DataTable reworkDs = ServiceInvoker.Invoke<DataTable>(this,
  2178. () => PDAModuleLogic.GetProductionDataCheckID(searchEntity, sUserInfo));
  2179. if (reworkDs != null && reworkDs.Rows.Count > Constant.INT_IS_ZERO)
  2180. {
  2181. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2182. actionResult.Status = (int)Constant.PDAResult.Success;
  2183. }
  2184. else
  2185. {
  2186. actionResult.Status = (int)Constant.PDAResult.Fail;
  2187. actionResult.Message = Constant.PDA_RESULT_ALLOW_ERR;
  2188. }
  2189. }
  2190. catch (Exception ex)
  2191. {
  2192. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2193. OutputLog.TraceLog(LogPriority.Error,
  2194. this.ToString(),
  2195. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2196. ex.ToString(),
  2197. LocalPath.LogExePath);
  2198. actionResult.Status = (int)Constant.PDAResult.Exception;
  2199. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2200. }
  2201. return actionResult;
  2202. }
  2203. /// <summary>
  2204. /// 根据所选生产数据ID,显示成检数据信息
  2205. /// </summary>
  2206. /// <param name="productionDataID">生产数据ID</param>
  2207. /// <returns>DataSet</returns>
  2208. public ActionResult GetProductionDataByID(string accountCode, string userCode, string userPassword, string sessionKey, int productionDataID)
  2209. {
  2210. ActionResult actionResult = new ActionResult();
  2211. try
  2212. {
  2213. // 验证请求头信息
  2214. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2215. // 验证失败
  2216. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2217. {
  2218. return actionResult;
  2219. }
  2220. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2221. () => PDAModuleLogic.GetProductionDataByID(productionDataID));
  2222. PDAProductionDataResult productionDatas = new PDAProductionDataResult();
  2223. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2224. {
  2225. if (reworkDs != null && reworkDs.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  2226. {
  2227. for (int i = 0; i < reworkDs.Tables[0].Rows.Count; i++)
  2228. {
  2229. PDAProductionDataResult productionData = new PDAProductionDataResult();
  2230. productionData.BarCode = reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
  2231. if (reworkDs.Tables[0].Rows[i]["GoodsID"].ToString() != "")
  2232. {
  2233. productionData.GoodsID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsID"].ToString());
  2234. }
  2235. productionData.GoodsCode = reworkDs.Tables[0].Rows[i]["GoodsCode"].ToString();
  2236. productionData.GoodsName = reworkDs.Tables[0].Rows[i]["GoodsName"].ToString();
  2237. if (reworkDs.Tables[0].Rows[0]["DefectFlagID"].ToString() != "")
  2238. {
  2239. productionData.DefectFlagID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["DefectFlagID"].ToString());
  2240. }
  2241. if (reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString() != "")
  2242. {
  2243. productionData.ReworkProcedureID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString());
  2244. }
  2245. productionData.Remarks = reworkDs.Tables[0].Rows[i]["Remarks"].ToString();
  2246. if (reworkDs.Tables[0].Rows[i]["UserID"].ToString() != "")
  2247. {
  2248. productionData.UserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["UserID"].ToString());
  2249. }
  2250. if (reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString() != "")
  2251. {
  2252. productionData.GoodsLevelTypeID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString());
  2253. }
  2254. productionData.UserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
  2255. productionData.UserName = reworkDs.Tables[0].Rows[i]["UserName"].ToString();
  2256. productionData.SpecialRepairflag = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["SpecialRepairflag"]);
  2257. productionData.IsReFire = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["IsReFire"]);
  2258. productionData.KilnCarCode = reworkDs.Tables[0].Rows[i]["KilnCarCode"].ToString();
  2259. productionData.KilnCode = reworkDs.Tables[0].Rows[i]["KilnCode"].ToString();
  2260. productionData.GlazeName = reworkDs.Tables[0].Rows[i]["GlazeName"].ToString();
  2261. if (reworkDs.Tables[0].Rows[i]["logoid"].ToString() != "")
  2262. {
  2263. productionData.LogoID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["logoid"]);
  2264. productionData.LogoCode = reworkDs.Tables[0].Rows[i]["LogoCode"].ToString();
  2265. productionData.LogoName = reworkDs.Tables[0].Rows[i]["LogoName"].ToString();
  2266. }
  2267. productionData.CreateTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["CreateTime"]);
  2268. if (reworkDs.Tables[0].Rows[i]["CheckTime"].ToString() != "")
  2269. {
  2270. productionData.CheckTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["CheckTime"].ToString());
  2271. }
  2272. DataView dvDefect = reworkDs.Tables[1].DefaultView;
  2273. dvDefect.RowFilter = "BarCode=" + reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
  2274. DataTable dtDefect = dvDefect.ToTable();
  2275. for (int row = 0; row < dtDefect.Rows.Count; row++)
  2276. {
  2277. // 产品缺陷
  2278. PDADefectResult defect = new PDADefectResult();
  2279. defect.SpecialDefect = dtDefect.Rows[row]["SpecialDefect"].ToString();
  2280. defect.DefectDeductionNum = Convert.ToDecimal(dtDefect.Rows[row]["DefectDeductionNum"].ToString());
  2281. if (dtDefect.Rows[row]["ProductionDefectID"].ToString() != "")
  2282. {
  2283. defect.ProductionDefectID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDefectID"].ToString());
  2284. }
  2285. defect.BarCode = dtDefect.Rows[row]["BarCode"].ToString();
  2286. if (dtDefect.Rows[row]["DefectID"].ToString() != "")
  2287. {
  2288. defect.DefectID = Convert.ToInt32(dtDefect.Rows[row]["DefectID"].ToString());
  2289. }
  2290. defect.DefectName = dtDefect.Rows[row]["DefectName"].ToString();
  2291. defect.DefectCode = dtDefect.Rows[row]["DefectCode"].ToString();
  2292. if (dtDefect.Rows[row]["DefectPositionID"].ToString() != "")
  2293. {
  2294. defect.DefectPositionID = Convert.ToInt32(dtDefect.Rows[row]["DefectPositionID"].ToString());
  2295. }
  2296. defect.DefectPositionName = dtDefect.Rows[row]["DefectPositionName"].ToString();
  2297. defect.DefectPositionCode = dtDefect.Rows[row]["DefectPositionCode"].ToString();
  2298. if (dtDefect.Rows[row]["DefectProcedureID"].ToString() != "")
  2299. {
  2300. defect.DefectProcedureID = Convert.ToInt32(dtDefect.Rows[row]["DefectProcedureID"].ToString());
  2301. }
  2302. defect.DefectProcedureName = dtDefect.Rows[row]["DefectProcedureName"].ToString();
  2303. defect.DefectProcedureCode = dtDefect.Rows[row]["DefectProcedureCode"].ToString();
  2304. if (dtDefect.Rows[row]["DefectUserID"].ToString() != "")
  2305. {
  2306. defect.DefectUserID = Convert.ToInt32(dtDefect.Rows[row]["DefectUserID"].ToString());
  2307. }
  2308. defect.DefectUserName = dtDefect.Rows[row]["DefectUserName"].ToString();
  2309. defect.DefectUserCode = dtDefect.Rows[row]["DefectUserCode"].ToString();
  2310. if (dtDefect.Rows[row]["Jobs"].ToString() != "")
  2311. {
  2312. defect.Jobs = Convert.ToInt32(dtDefect.Rows[row]["Jobs"].ToString());
  2313. }
  2314. if (dtDefect.Rows[row]["MissedUserID"].ToString() != "")
  2315. {
  2316. defect.MissedUserID = Convert.ToInt32(dtDefect.Rows[row]["MissedUserID"].ToString());
  2317. }
  2318. defect.MissedUserCode = dtDefect.Rows[row]["MissedUserCode"].ToString();
  2319. defect.MissedUserName = dtDefect.Rows[row]["MissedUserName"].ToString();
  2320. defect.JobsText = dtDefect.Rows[row]["JobsText"].ToString();
  2321. defect.DefectRemarks = dtDefect.Rows[row]["DefectRemarks"].ToString();
  2322. if (dtDefect.Rows[row]["ProductionDataID"].ToString() != "")
  2323. {
  2324. defect.ProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDataID"].ToString());
  2325. }
  2326. if (dtDefect.Rows[row]["DefectProductionDataID"].ToString() != "")
  2327. {
  2328. defect.DefectProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["DefectProductionDataID"].ToString());
  2329. }
  2330. if (dtDefect.Rows[row]["DefectFineID"].ToString() != "")
  2331. {
  2332. defect.DefectFineID = Convert.ToInt32(dtDefect.Rows[row]["DefectFineID"].ToString());
  2333. }
  2334. defect.DefectFineValue = dtDefect.Rows[row]["DefectFineValue"].ToString();
  2335. defect.CheckTime = Convert.ToDateTime(dtDefect.Rows[row]["CheckTime"]);
  2336. //--------责任员工-------------------
  2337. DataRow[] drRow = reworkDs.Tables[2].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[row]["ProductionDefectID"]);
  2338. if (drRow.Length > Constant.INT_IS_ZERO)
  2339. {
  2340. foreach (DataRow r in drRow)
  2341. {
  2342. PDADefectResponsibleResult defectResponsible = new PDADefectResponsibleResult();
  2343. if (r["ProductionDefectID"].ToString() != "")
  2344. {
  2345. defectResponsible.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
  2346. }
  2347. if (r["StaffID"].ToString() != "")
  2348. {
  2349. defectResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
  2350. }
  2351. defectResponsible.StaffCode = r["StaffCode"].ToString();
  2352. defectResponsible.StaffName = r["StaffName"].ToString();
  2353. if (r["StaffStatus"].ToString() != "")
  2354. {
  2355. defectResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
  2356. }
  2357. if (r["UJobsID"].ToString() != "")
  2358. {
  2359. defectResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
  2360. }
  2361. if (r["SJobsID"].ToString() != "")
  2362. {
  2363. defectResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
  2364. }
  2365. defect.PDADefectResponsibles.Add(defectResponsible);
  2366. }
  2367. }
  2368. //------------------------------
  2369. //--------漏检员工-------------------
  2370. DataRow[] drMissedRow = reworkDs.Tables[4].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[i]["ProductionDefectID"]);
  2371. if (drMissedRow.Length > Constant.INT_IS_ZERO)
  2372. {
  2373. foreach (DataRow r in drMissedRow)
  2374. {
  2375. PDADefectMissedResponsibleResult defectMissedResponsible = new PDADefectMissedResponsibleResult();
  2376. if (r["ProductionDefectID"].ToString() != "")
  2377. {
  2378. defectMissedResponsible.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
  2379. }
  2380. if (r["StaffID"].ToString() != "")
  2381. {
  2382. defectMissedResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
  2383. }
  2384. defectMissedResponsible.StaffCode = r["StaffCode"].ToString();
  2385. defectMissedResponsible.StaffName = r["StaffName"].ToString();
  2386. if (r["StaffStatus"].ToString() != "")
  2387. {
  2388. defectMissedResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
  2389. }
  2390. if (r["UJobsID"].ToString() != "")
  2391. {
  2392. defectMissedResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
  2393. }
  2394. if (r["SJobsID"].ToString() != "")
  2395. {
  2396. defectMissedResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
  2397. }
  2398. defect.PDADefectMissedResponsibles.Add(defectMissedResponsible);
  2399. }
  2400. }
  2401. //------------------------------
  2402. DataRow[] drImageRow = reworkDs.Tables[3].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[row]["ProductionDefectID"]);
  2403. if (drImageRow.Length > Constant.INT_IS_ZERO)
  2404. {
  2405. foreach (DataRow r in drImageRow)
  2406. {
  2407. PDADefectImageResult defectImage = new PDADefectImageResult();
  2408. if (r["ProductionDefectID"].ToString() != "")
  2409. {
  2410. defectImage.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
  2411. }
  2412. defectImage.Thumbnailpath = r["Thumbnailpath"].ToString();
  2413. //if (File.Exists(System.AppDomain.CurrentDomain.BaseDirectory + r["Imagepath"].ToString()))
  2414. //{
  2415. defectImage.Imagepath = r["Imagepath"].ToString();// r["Imagepath"].ToString();
  2416. //}
  2417. defect.PDADefectImageResults.Add(defectImage);
  2418. }
  2419. }
  2420. productionData.PDADefects.Add(defect);
  2421. }
  2422. if (productionDatas.PDAProductionData == null)
  2423. {
  2424. productionDatas.PDAProductionData = new System.Collections.Generic.List<PDAProductionDataResult>();
  2425. }
  2426. productionDatas.PDAProductionData.Add(productionData);
  2427. //---------------------------------------------------------------------------------
  2428. }
  2429. }
  2430. actionResult.Result = JsonHelper.ToJson(productionDatas);
  2431. actionResult.Status = (int)Constant.PDAResult.Success;
  2432. }
  2433. else
  2434. {
  2435. actionResult.Status = (int)Constant.PDAResult.Fail;
  2436. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2437. }
  2438. }
  2439. catch (Exception ex)
  2440. {
  2441. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2442. OutputLog.TraceLog(LogPriority.Error,
  2443. this.ToString(),
  2444. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2445. ex.ToString(),
  2446. LocalPath.LogExePath);
  2447. actionResult.Status = (int)Constant.PDAResult.Exception;
  2448. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2449. }
  2450. return actionResult;
  2451. }
  2452. /// <summary>
  2453. /// 编辑后删除生产数据
  2454. /// </summary>
  2455. /// <param name="productionDataID">生产数据ID</param>
  2456. /// <returns>int</returns>
  2457. public ActionResult DeleteProductionDataByID(string accountCode, string userCode, string userPassword, string sessionKey, int productionDataID)
  2458. {
  2459. ActionResult actionResult = new ActionResult();
  2460. try
  2461. {
  2462. // 验证请求头信息
  2463. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2464. // 验证失败
  2465. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2466. {
  2467. return actionResult;
  2468. }
  2469. int row = ServiceInvoker.Invoke<int>(this,
  2470. () => PMModuleLogic.DeleteProductionDataByID(productionDataID));
  2471. actionResult.Result = JsonHelper.ToJson(row);
  2472. actionResult.Status = (int)Constant.PDAResult.Success;
  2473. }
  2474. catch (Exception ex)
  2475. {
  2476. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2477. OutputLog.TraceLog(LogPriority.Error,
  2478. this.ToString(),
  2479. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2480. ex.ToString(),
  2481. LocalPath.LogExePath);
  2482. actionResult.Status = (int)Constant.PDAResult.Exception;
  2483. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2484. }
  2485. return actionResult;
  2486. }
  2487. /// <summary>
  2488. /// 获取产品完成工序的ID
  2489. /// </summary>
  2490. /// <param name="barcode">产品条码</param>
  2491. /// <returns>int</returns>
  2492. public ActionResult GetCompleteProcedureID(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  2493. {
  2494. ActionResult actionResult = new ActionResult();
  2495. try
  2496. {
  2497. // 验证请求头信息
  2498. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2499. // 验证失败
  2500. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2501. {
  2502. return actionResult;
  2503. }
  2504. int row = ServiceInvoker.Invoke<int>(this,
  2505. () => PMModuleLogic.GetCompleteProcedureID(barcode));
  2506. actionResult.Result = JsonHelper.ToJson(row);
  2507. actionResult.Status = (int)Constant.PDAResult.Success;
  2508. }
  2509. catch (Exception ex)
  2510. {
  2511. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2512. OutputLog.TraceLog(LogPriority.Error,
  2513. this.ToString(),
  2514. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2515. ex.ToString(),
  2516. LocalPath.LogExePath);
  2517. actionResult.Status = (int)Constant.PDAResult.Exception;
  2518. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2519. }
  2520. return actionResult;
  2521. }
  2522. /// <summary>
  2523. /// 绑定图片
  2524. /// </summary>
  2525. /// <param name="accountCode">帐套code</param>
  2526. /// <param name="userCode">用户code</param>
  2527. /// <param name="userPassword">用户密码</param>
  2528. /// <param name="sessionKey">本次登陆密钥</param>
  2529. /// <param name="imagePath">图片路径</param>
  2530. /// <returns></returns>
  2531. public Stream BindDefectImage(string accountCode, string userCode, string userPassword, string sessionKey, string imagePath)
  2532. {
  2533. try
  2534. {
  2535. return ServiceInvoker.Invoke<Stream>(this, () => PDAModuleLogic.BindDefectImage(imagePath));
  2536. }
  2537. catch (Exception ex)
  2538. {
  2539. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2540. OutputLog.TraceLog(LogPriority.Error,
  2541. this.ToString(),
  2542. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2543. ex.ToString(),
  2544. LocalPath.LogExePath);
  2545. return null;
  2546. }
  2547. }
  2548. /// <summary>
  2549. /// 根据所选工号对应的工种,查出缺陷责任员工
  2550. /// </summary>
  2551. /// <param name="jobs">工种ID</param>
  2552. /// <returns></returns>
  2553. public ActionResult GetDutyStaffByUserJobsID(string accountCode, string userCode, string userPassword, string sessionKey, int jobs, int userid)
  2554. {
  2555. ActionResult actionResult = new ActionResult();
  2556. try
  2557. {
  2558. // 验证请求头信息
  2559. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2560. // 验证失败
  2561. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2562. {
  2563. return actionResult;
  2564. }
  2565. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2566. () => PDAModuleLogic.GetDutyStaffByUserJobsID(jobs, sUserInfo, userid));
  2567. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2568. {
  2569. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2570. actionResult.Status = (int)Constant.PDAResult.Success;
  2571. }
  2572. else
  2573. {
  2574. actionResult.Status = (int)Constant.PDAResult.Fail;
  2575. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2576. }
  2577. }
  2578. catch (Exception ex)
  2579. {
  2580. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2581. OutputLog.TraceLog(LogPriority.Error,
  2582. this.ToString(),
  2583. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2584. ex.ToString(),
  2585. LocalPath.LogExePath);
  2586. actionResult.Status = (int)Constant.PDAResult.Exception;
  2587. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2588. }
  2589. return actionResult;
  2590. }
  2591. #region 产品报废
  2592. /// <summary>
  2593. /// 验证废弃产品唯一性
  2594. /// </summary>
  2595. /// <param name="barcode">产品条码</param>
  2596. /// <returns>int</returns>
  2597. public ActionResult ScrapProductChack(string accountCode, string userCode, string userPassword, string sessionKey, string barCode)
  2598. {
  2599. ActionResult actionResult = new ActionResult();
  2600. try
  2601. {
  2602. // 验证请求头信息
  2603. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2604. // 验证失败
  2605. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2606. {
  2607. return actionResult;
  2608. }
  2609. string row = ServiceInvoker.Invoke<string>(this,
  2610. () => PDAModuleLogic.ScrapProductChack(barCode, sUserInfo));
  2611. string[] rm = row.Split(':');
  2612. actionResult.Result = rm[0];//JsonHelper.ToJson(rm[0]);
  2613. if (rm.Length > 1)
  2614. {
  2615. actionResult.Message = rm[1];
  2616. }
  2617. actionResult.Status = (int)Constant.PDAResult.Success;
  2618. }
  2619. catch (Exception ex)
  2620. {
  2621. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2622. OutputLog.TraceLog(LogPriority.Error,
  2623. this.ToString(),
  2624. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2625. ex.ToString(),
  2626. LocalPath.LogExePath);
  2627. actionResult.Status = (int)Constant.PDAResult.Exception;
  2628. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2629. }
  2630. return actionResult;
  2631. }
  2632. /// <summary>
  2633. /// 根据条码获取该产品的在产信息以及生产数据
  2634. /// </summary>
  2635. /// <param name="Barcode">产品条码</param>
  2636. /// <returns>装有两个DataTable的数据集,第一个是在产信息,第二个是生产数据</returns>
  2637. public ActionResult GetInProductionAndProductionData(string accountCode, string userCode, string userPassword, string sessionKey, string barCode)
  2638. {
  2639. ActionResult actionResult = new ActionResult();
  2640. try
  2641. {
  2642. // 验证请求头信息
  2643. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2644. // 验证失败
  2645. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2646. {
  2647. return actionResult;
  2648. }
  2649. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2650. () => PDAModuleLogic.GetInProductionAndProductionData(barCode, sUserInfo));
  2651. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2652. {
  2653. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2654. actionResult.Status = (int)Constant.PDAResult.Success;
  2655. }
  2656. else
  2657. {
  2658. actionResult.Status = (int)Constant.PDAResult.Fail;
  2659. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2660. }
  2661. }
  2662. catch (Exception ex)
  2663. {
  2664. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2665. OutputLog.TraceLog(LogPriority.Error,
  2666. this.ToString(),
  2667. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2668. ex.ToString(),
  2669. LocalPath.LogExePath);
  2670. actionResult.Status = (int)Constant.PDAResult.Exception;
  2671. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2672. }
  2673. return actionResult;
  2674. }
  2675. /// <summary>
  2676. /// 根据工号查询员工档案信息
  2677. /// </summary>
  2678. /// <param name="accountCode"></param>
  2679. /// <param name="userCode"></param>
  2680. /// <param name="userPassword"></param>
  2681. /// <param name="sessionKey"></param>
  2682. /// <param name="userId"></param>
  2683. /// <returns></returns>
  2684. public ActionResult SearchHrStaffInfo(string accountCode, string userCode, string userPassword, string sessionKey, int userId)
  2685. {
  2686. ActionResult actionResult = new ActionResult();
  2687. try
  2688. {
  2689. // 验证请求头信息
  2690. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2691. // 验证失败
  2692. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2693. {
  2694. return actionResult;
  2695. }
  2696. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2697. () => PDAModuleLogic.SearchHrStaffInfo(userId, sUserInfo));
  2698. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2699. {
  2700. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2701. actionResult.Status = (int)Constant.PDAResult.Success;
  2702. }
  2703. else
  2704. {
  2705. actionResult.Status = (int)Constant.PDAResult.Fail;
  2706. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2707. }
  2708. }
  2709. catch (Exception ex)
  2710. {
  2711. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2712. OutputLog.TraceLog(LogPriority.Error,
  2713. this.ToString(),
  2714. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2715. ex.ToString(),
  2716. LocalPath.LogExePath);
  2717. actionResult.Status = (int)Constant.PDAResult.Exception;
  2718. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2719. }
  2720. return actionResult;
  2721. }
  2722. /// <summary>
  2723. /// 添加废弃产品记录
  2724. /// </summary>
  2725. /// <param name="SProductEntity">废弃产品实体</param>
  2726. /// <param name="RProcedureEntity">废弃责任工序实体</param>
  2727. /// <param name="SResponsibleList">责任者集合</param>
  2728. /// <param name="userInfo">用户基本信息</param>
  2729. /// <returns>int结果返回值</returns>
  2730. /// <remarks>
  2731. /// 庄天威 2014.09.24 新建
  2732. /// </remarks>
  2733. public ActionResult AddScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey,
  2734. ScrapProductEntity SProductEntity, ResponProcedureEntity RProcedureEntity,
  2735. ScrapResponsibleEntity[] SResponsibleList)
  2736. {
  2737. ActionResult actionResult = new ActionResult();
  2738. if (SResponsibleList == null || SResponsibleList.Length == 0)
  2739. {
  2740. actionResult.Status = (int)Constant.PDAResult.Fail;
  2741. actionResult.Message = "没有选择责任人";
  2742. }
  2743. try
  2744. {
  2745. // 验证请求头信息
  2746. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2747. // 验证失败
  2748. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2749. {
  2750. return actionResult;
  2751. }
  2752. int addRow = ServiceInvoker.Invoke<int>(this,
  2753. () => PDAModuleLogic.AddScrapProduct(SProductEntity, RProcedureEntity, SResponsibleList, sUserInfo));
  2754. actionResult.Result = JsonHelper.ToJson(addRow);
  2755. actionResult.Status = (int)Constant.PDAResult.Success;
  2756. }
  2757. catch (Exception ex)
  2758. {
  2759. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2760. OutputLog.TraceLog(LogPriority.Error,
  2761. this.ToString(),
  2762. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2763. ex.ToString(),
  2764. LocalPath.LogExePath);
  2765. actionResult.Status = (int)Constant.PDAResult.Exception;
  2766. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2767. // TODO 空指针异常问题检测
  2768. try
  2769. {
  2770. OutputLog.TraceLog(LogPriority.Error,
  2771. this.ToString(),
  2772. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2773. "accountCode:" + accountCode + "#userCode:" + userCode + "#sessionKey:" + sessionKey,
  2774. LocalPath.LogExePath);
  2775. string json1 = JsonHelper.ToJson(SProductEntity);
  2776. OutputLog.TraceLog(LogPriority.Error,
  2777. this.ToString(),
  2778. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2779. "SProductEntity:" + json1,
  2780. LocalPath.LogExePath);
  2781. string json2 = JsonHelper.ToJson(RProcedureEntity);
  2782. OutputLog.TraceLog(LogPriority.Error,
  2783. this.ToString(),
  2784. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2785. "RProcedureEntity:" + json2,
  2786. LocalPath.LogExePath);
  2787. string json3 = JsonHelper.ToJson(SResponsibleList);
  2788. OutputLog.TraceLog(LogPriority.Error,
  2789. this.ToString(),
  2790. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2791. "SResponsibleList:" + json3,
  2792. LocalPath.LogExePath);
  2793. }
  2794. catch (Exception exc)
  2795. {
  2796. OutputLog.TraceLog(LogPriority.Error,
  2797. this.ToString(),
  2798. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2799. "参数输入异常:" + exc.Message,
  2800. LocalPath.LogExePath);
  2801. }
  2802. }
  2803. return actionResult;
  2804. }
  2805. /// <summary>
  2806. /// 获取产品分级的数据(根据ID)
  2807. /// </summary>
  2808. /// <param name="GoodsLevelTypeID">分类类别ID</param>
  2809. /// <param name="GoodsLevelID">分类ID</param>
  2810. /// <param name="sUserInfo">用户基本信息</param>
  2811. /// <returns>DataSet</returns>
  2812. /// <remarks>
  2813. /// 2014.10.22 庄天威 新建
  2814. public ActionResult GetGoodsLevelDataById(string accountCode, string userCode, string userPassword, string sessionKey, int? GoodsLevelTypeID)
  2815. {
  2816. ActionResult actionResult = new ActionResult();
  2817. try
  2818. {
  2819. // 验证请求头信息
  2820. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2821. // 验证失败
  2822. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2823. {
  2824. return actionResult;
  2825. }
  2826. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2827. () => SystemModuleLogic.GetGoodsLevelDataById(GoodsLevelTypeID, null, sUserInfo));
  2828. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2829. {
  2830. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2831. actionResult.Status = (int)Constant.PDAResult.Success;
  2832. }
  2833. else
  2834. {
  2835. actionResult.Status = (int)Constant.PDAResult.Fail;
  2836. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2837. }
  2838. }
  2839. catch (Exception ex)
  2840. {
  2841. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2842. OutputLog.TraceLog(LogPriority.Error,
  2843. this.ToString(),
  2844. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2845. ex.ToString(),
  2846. LocalPath.LogExePath);
  2847. actionResult.Status = (int)Constant.PDAResult.Exception;
  2848. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2849. }
  2850. return actionResult;
  2851. }
  2852. /// <summary>
  2853. /// 获取账务日期
  2854. /// </summary>
  2855. /// <param name="accountCode"></param>
  2856. /// <param name="userCode"></param>
  2857. /// <param name="userPassword"></param>
  2858. /// <param name="sessionKey"></param>
  2859. /// <returns></returns>
  2860. public ActionResult GetAccountDate(string accountCode, string userCode, string userPassword, string sessionKey)
  2861. {
  2862. ActionResult actionResult = new ActionResult();
  2863. try
  2864. {
  2865. // 验证请求头信息
  2866. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2867. // 验证失败
  2868. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2869. {
  2870. return actionResult;
  2871. }
  2872. DateTime reworkDs = ServiceInvoker.Invoke<DateTime>(this,
  2873. () => CommonModuleLogic.GetAccountDate(sUserInfo));
  2874. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2875. actionResult.Status = (int)Constant.PDAResult.Success;
  2876. }
  2877. catch (Exception ex)
  2878. {
  2879. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2880. OutputLog.TraceLog(LogPriority.Error,
  2881. this.ToString(),
  2882. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2883. ex.ToString(),
  2884. LocalPath.LogExePath);
  2885. actionResult.Status = (int)Constant.PDAResult.Exception;
  2886. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2887. }
  2888. return actionResult;
  2889. }
  2890. /// <summary>
  2891. /// 获取登陆帐户有无报损权限
  2892. /// </summary>
  2893. /// <param name="accountCode"></param>
  2894. /// <param name="userCode"></param>
  2895. /// <param name="userPassword"></param>
  2896. /// <param name="sessionKey"></param>
  2897. /// <param name="usercode">工号编码</param>
  2898. /// <returns></returns>
  2899. public ActionResult GetScrapFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  2900. {
  2901. ActionResult actionResult = new ActionResult();
  2902. try
  2903. {
  2904. // 验证请求头信息
  2905. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2906. // 验证失败
  2907. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2908. {
  2909. return actionResult;
  2910. }
  2911. int returnValue = ServiceInvoker.Invoke<int>(this,
  2912. () => PDAModuleLogic.GetScrapFuntion(userCode, sUserInfo));
  2913. actionResult.Result = JsonHelper.ToJson(returnValue);
  2914. actionResult.Status = (int)Constant.PDAResult.Success;
  2915. }
  2916. catch (Exception ex)
  2917. {
  2918. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2919. OutputLog.TraceLog(LogPriority.Error,
  2920. this.ToString(),
  2921. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2922. ex.ToString(),
  2923. LocalPath.LogExePath);
  2924. actionResult.Status = (int)Constant.PDAResult.Exception;
  2925. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2926. }
  2927. return actionResult;
  2928. }
  2929. #endregion
  2930. /// <summary>
  2931. /// 获取是否存在报损未审核产品
  2932. /// </summary>
  2933. /// <param name="barcode">产品条码</param>
  2934. /// <returns>int</returns>
  2935. public ActionResult GetScrapProductAuditStatus(string accountCode, string userCode, string userPassword, string sessionKey, string barCode)
  2936. {
  2937. ActionResult actionResult = new ActionResult();
  2938. try
  2939. {
  2940. // 验证请求头信息
  2941. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2942. // 验证失败
  2943. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2944. {
  2945. return actionResult;
  2946. }
  2947. int row = ServiceInvoker.Invoke<int>(this,
  2948. () => PDAModuleLogic.GetScrapProductAuditStatus(barCode));
  2949. actionResult.Result = JsonHelper.ToJson(row);
  2950. actionResult.Status = (int)Constant.PDAResult.Success;
  2951. }
  2952. catch (Exception ex)
  2953. {
  2954. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2955. OutputLog.TraceLog(LogPriority.Error,
  2956. this.ToString(),
  2957. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2958. ex.ToString(),
  2959. LocalPath.LogExePath);
  2960. actionResult.Status = (int)Constant.PDAResult.Exception;
  2961. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2962. }
  2963. return actionResult;
  2964. }
  2965. /// <summary>
  2966. /// 查询报废产品信息
  2967. /// </summary>
  2968. /// <param name="accountCode"></param>
  2969. /// <param name="userCode"></param>
  2970. /// <param name="userPassword"></param>
  2971. /// <param name="sessionKey"></param>
  2972. /// <param name="barCode">产品条码</param>
  2973. /// <param name="scrapProductID">报废产品ID</param>
  2974. /// <returns></returns>
  2975. public ActionResult GetScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barCode, int scrapProductID)
  2976. {
  2977. ActionResult actionResult = new ActionResult();
  2978. try
  2979. {
  2980. // 验证请求头信息
  2981. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2982. // 验证失败
  2983. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2984. {
  2985. return actionResult;
  2986. }
  2987. ScrapProductEntity selectProEntity = new ScrapProductEntity();
  2988. selectProEntity.BarCode = barCode;
  2989. selectProEntity.ScrapProductID = scrapProductID;
  2990. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2991. () => PMModuleLogic.GetScrapProduct(selectProEntity, sUserInfo));
  2992. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2993. {
  2994. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2995. actionResult.Status = (int)Constant.PDAResult.Success;
  2996. }
  2997. else
  2998. {
  2999. actionResult.Status = (int)Constant.PDAResult.Fail;
  3000. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3001. }
  3002. }
  3003. catch (Exception ex)
  3004. {
  3005. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3006. OutputLog.TraceLog(LogPriority.Error,
  3007. this.ToString(),
  3008. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3009. ex.ToString(),
  3010. LocalPath.LogExePath);
  3011. actionResult.Status = (int)Constant.PDAResult.Exception;
  3012. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3013. }
  3014. return actionResult;
  3015. }
  3016. /// <summary>
  3017. /// 根据废弃产品ID获取责任工序
  3018. /// </summary>
  3019. /// <param name="accountCode"></param>
  3020. /// <param name="userCode"></param>
  3021. /// <param name="userPassword"></param>
  3022. /// <param name="sessionKey"></param>
  3023. /// <param name="scrapProductID">报废产品ID</param>
  3024. /// <returns></returns>
  3025. public ActionResult GetResponProcedureBySPId(string accountCode, string userCode, string userPassword, string sessionKey, int scrapProductID)
  3026. {
  3027. ActionResult actionResult = new ActionResult();
  3028. try
  3029. {
  3030. // 验证请求头信息
  3031. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3032. // 验证失败
  3033. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3034. {
  3035. return actionResult;
  3036. }
  3037. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3038. () => PMModuleLogic.GetResponProcedureBySPId(scrapProductID));
  3039. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3040. {
  3041. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3042. actionResult.Status = (int)Constant.PDAResult.Success;
  3043. }
  3044. else
  3045. {
  3046. actionResult.Status = (int)Constant.PDAResult.Fail;
  3047. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3048. }
  3049. }
  3050. catch (Exception ex)
  3051. {
  3052. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3053. OutputLog.TraceLog(LogPriority.Error,
  3054. this.ToString(),
  3055. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3056. ex.ToString(),
  3057. LocalPath.LogExePath);
  3058. actionResult.Status = (int)Constant.PDAResult.Exception;
  3059. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3060. }
  3061. return actionResult;
  3062. }
  3063. /// <summary>
  3064. /// 根据废弃产品ID获取责任人列表
  3065. /// </summary>
  3066. /// <param name="accountCode"></param>
  3067. /// <param name="userCode"></param>
  3068. /// <param name="userPassword"></param>
  3069. /// <param name="sessionKey"></param>
  3070. /// <param name="scrapProductID">报废产品ID</param>
  3071. /// <returns></returns>
  3072. public ActionResult GetScrapResponsibleBySPId(string accountCode, string userCode, string userPassword, string sessionKey, int scrapProductID)
  3073. {
  3074. ActionResult actionResult = new ActionResult();
  3075. try
  3076. {
  3077. // 验证请求头信息
  3078. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3079. // 验证失败
  3080. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3081. {
  3082. return actionResult;
  3083. }
  3084. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3085. () => PMModuleLogic.GetScrapResponsibleBySPId(scrapProductID));
  3086. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3087. {
  3088. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3089. actionResult.Status = (int)Constant.PDAResult.Success;
  3090. }
  3091. else
  3092. {
  3093. actionResult.Status = (int)Constant.PDAResult.Fail;
  3094. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3095. }
  3096. }
  3097. catch (Exception ex)
  3098. {
  3099. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3100. OutputLog.TraceLog(LogPriority.Error,
  3101. this.ToString(),
  3102. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3103. ex.ToString(),
  3104. LocalPath.LogExePath);
  3105. actionResult.Status = (int)Constant.PDAResult.Exception;
  3106. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3107. }
  3108. return actionResult;
  3109. }
  3110. /// <summary>
  3111. /// 添加废弃产品记录
  3112. /// </summary>
  3113. /// <param name="SProductEntity">废弃产品实体</param>
  3114. /// <param name="RProcedureEntity">废弃责任工序实体</param>
  3115. /// <param name="SResponsibleList">责任者集合</param>
  3116. /// <param name="userInfo">用户基本信息</param>
  3117. /// <returns>int结果返回值</returns>
  3118. /// <remarks>
  3119. /// 庄天威 2014.09.24 新建
  3120. /// </remarks>
  3121. public ActionResult UpdateScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, ScrapProductEntity UpdateSProductEntity,
  3122. ResponProcedureEntity UpdateRProcedureEntity,
  3123. ScrapResponsibleEntity[] UpdateSResponsibleList, ScrapResponsibleEntity[] YSResponsibleList)
  3124. {
  3125. ActionResult actionResult = new ActionResult();
  3126. try
  3127. {
  3128. // 验证请求头信息
  3129. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3130. // 验证失败
  3131. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3132. {
  3133. return actionResult;
  3134. }
  3135. int addRow = ServiceInvoker.Invoke<int>(this,
  3136. () => PDAModuleLogic.UpdateScrapProduct(UpdateSProductEntity, UpdateRProcedureEntity, UpdateSResponsibleList, YSResponsibleList, sUserInfo));
  3137. actionResult.Result = JsonHelper.ToJson(addRow);
  3138. actionResult.Status = (int)Constant.PDAResult.Success;
  3139. }
  3140. catch (Exception ex)
  3141. {
  3142. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3143. OutputLog.TraceLog(LogPriority.Error,
  3144. this.ToString(),
  3145. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3146. ex.ToString(),
  3147. LocalPath.LogExePath);
  3148. actionResult.Status = (int)Constant.PDAResult.Exception;
  3149. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3150. }
  3151. return actionResult;
  3152. }
  3153. /// <summary>
  3154. /// 获取产品窑炉
  3155. /// </summary>
  3156. /// <param name="accountCode"></param>
  3157. /// <param name="userCode"></param>
  3158. /// <param name="userPassword"></param>
  3159. /// <param name="sessionKey"></param>
  3160. /// <returns>Datase</returns>
  3161. public ActionResult GetAllKilntInfo(string accountCode, string userCode, string userPassword, string sessionKey)
  3162. {
  3163. ActionResult actionResult = new ActionResult();
  3164. try
  3165. {
  3166. // 验证请求头信息
  3167. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3168. // 验证失败
  3169. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3170. {
  3171. return actionResult;
  3172. }
  3173. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3174. () => PDAModuleLogic.GetAllKilntInfo(sUserInfo));
  3175. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3176. {
  3177. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3178. actionResult.Status = (int)Constant.PDAResult.Success;
  3179. }
  3180. else
  3181. {
  3182. actionResult.Status = (int)Constant.PDAResult.Fail;
  3183. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3184. }
  3185. }
  3186. catch (Exception ex)
  3187. {
  3188. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3189. OutputLog.TraceLog(LogPriority.Error,
  3190. this.ToString(),
  3191. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3192. ex.ToString(),
  3193. LocalPath.LogExePath);
  3194. actionResult.Status = (int)Constant.PDAResult.Exception;
  3195. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3196. }
  3197. return actionResult;
  3198. }
  3199. /// <summary>
  3200. /// 获取次品产品条码允许编辑
  3201. /// </summary>
  3202. /// <param name="accountCode"></param>
  3203. /// <param name="userCode"></param>
  3204. /// <param name="userPassword"></param>
  3205. /// <param name="sessionKey"></param>
  3206. /// <param name="barcode">产品条码</param>
  3207. /// <returns>Datase</returns>
  3208. public ActionResult GetSubstandardInfo(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3209. {
  3210. ActionResult actionResult = new ActionResult();
  3211. try
  3212. {
  3213. // 验证请求头信息
  3214. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3215. // 验证失败
  3216. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3217. {
  3218. return actionResult;
  3219. }
  3220. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3221. () => PDAModuleLogic.GetSubstandardInfo(barcode));
  3222. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3223. {
  3224. actionResult.Result = JsonHelper.ToJson(1);
  3225. actionResult.Status = (int)Constant.PDAResult.Success;
  3226. }
  3227. else
  3228. {
  3229. actionResult.Result = JsonHelper.ToJson(0);
  3230. actionResult.Status = (int)Constant.PDAResult.Fail;
  3231. actionResult.Message = "次品条码:" + barcode + "不允许修改";
  3232. }
  3233. }
  3234. catch (Exception ex)
  3235. {
  3236. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3237. OutputLog.TraceLog(LogPriority.Error,
  3238. this.ToString(),
  3239. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3240. ex.ToString(),
  3241. LocalPath.LogExePath);
  3242. actionResult.Status = (int)Constant.PDAResult.Exception;
  3243. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3244. }
  3245. return actionResult;
  3246. }
  3247. /// <summary>
  3248. /// 获取产品条码是否重烧
  3249. /// </summary>
  3250. /// <param name="accountCode"></param>
  3251. /// <param name="userCode"></param>
  3252. /// <param name="userPassword"></param>
  3253. /// <param name="sessionKey"></param>
  3254. /// <param name="barcode">产品条码</param>
  3255. /// <returns>Datase</returns>
  3256. public ActionResult GetReFine(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3257. {
  3258. ActionResult actionResult = new ActionResult();
  3259. try
  3260. {
  3261. // 验证请求头信息
  3262. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3263. // 验证失败
  3264. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3265. {
  3266. return actionResult;
  3267. }
  3268. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3269. () => PDAModuleLogic.GetReFine(barcode));
  3270. if (reworkDs != null && reworkDs.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  3271. {
  3272. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(reworkDs.Tables[0].Rows[0]["IsReFire"]));
  3273. }
  3274. else
  3275. {
  3276. actionResult.Result = JsonHelper.ToJson(0);
  3277. }
  3278. actionResult.Status = (int)Constant.PDAResult.Success;
  3279. }
  3280. catch (Exception ex)
  3281. {
  3282. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3283. OutputLog.TraceLog(LogPriority.Error,
  3284. this.ToString(),
  3285. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3286. ex.ToString(),
  3287. LocalPath.LogExePath);
  3288. actionResult.Status = (int)Constant.PDAResult.Exception;
  3289. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3290. }
  3291. return actionResult;
  3292. }
  3293. /// <summary>
  3294. /// 获取登陆帐户有无成检编辑权限
  3295. /// </summary>
  3296. /// <param name="accountCode"></param>
  3297. /// <param name="userCode"></param>
  3298. /// <param name="userPassword"></param>
  3299. /// <param name="sessionKey"></param>
  3300. /// <param name="usercode">工号编码</param>
  3301. /// <returns></returns>
  3302. public ActionResult GetFinishedProductEditFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  3303. {
  3304. ActionResult actionResult = new ActionResult();
  3305. try
  3306. {
  3307. // 验证请求头信息
  3308. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3309. // 验证失败
  3310. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3311. {
  3312. return actionResult;
  3313. }
  3314. int returnValue = ServiceInvoker.Invoke<int>(this,
  3315. () => PDAModuleLogic.GetFinishedProductEditFuntion(sUserInfo));
  3316. actionResult.Result = JsonHelper.ToJson(returnValue);
  3317. actionResult.Status = (int)Constant.PDAResult.Success;
  3318. }
  3319. catch (Exception ex)
  3320. {
  3321. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3322. OutputLog.TraceLog(LogPriority.Error,
  3323. this.ToString(),
  3324. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3325. ex.ToString(),
  3326. LocalPath.LogExePath);
  3327. actionResult.Status = (int)Constant.PDAResult.Exception;
  3328. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3329. }
  3330. return actionResult;
  3331. }
  3332. /// <summary>
  3333. /// 根据条码及工序判断是否漏扫
  3334. /// </summary>
  3335. /// <param name="accountCode"></param>
  3336. /// <param name="userCode"></param>
  3337. /// <param name="userPassword"></param>
  3338. /// <param name="sessionKey"></param>
  3339. /// <param name="usercode">工号编码</param>
  3340. /// <param name="barcode">产品条码</param>
  3341. /// <param name="produceid">工序ID</param>
  3342. /// <returns></returns>
  3343. public ActionResult AddBarCodeMissing(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int produceid)
  3344. {
  3345. ActionResult actionResult = new ActionResult();
  3346. try
  3347. {
  3348. // 验证请求头信息
  3349. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3350. // 验证失败
  3351. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3352. {
  3353. return actionResult;
  3354. }
  3355. int returnValue = 1;
  3356. //int returnValue = ServiceInvoker.Invoke<int>(this,
  3357. // () => PMModuleLogicDAL.AddBarCodeMissing(barcode, produceid, sUserInfo));
  3358. actionResult.Result = JsonHelper.ToJson(returnValue);
  3359. actionResult.Status = (int)Constant.PDAResult.Success;
  3360. }
  3361. catch (Exception ex)
  3362. {
  3363. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3364. OutputLog.TraceLog(LogPriority.Error,
  3365. this.ToString(),
  3366. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3367. ex.ToString(),
  3368. LocalPath.LogExePath);
  3369. actionResult.Status = (int)Constant.PDAResult.Exception;
  3370. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3371. }
  3372. return actionResult;
  3373. }
  3374. /// <summary>
  3375. /// 获取登陆帐户有无报损审批权限
  3376. /// </summary>
  3377. /// <param name="accountCode"></param>
  3378. /// <param name="userCode"></param>
  3379. /// <param name="userPassword"></param>
  3380. /// <param name="sessionKey"></param>
  3381. /// <param name="usercode">工号编码</param>
  3382. /// <returns></returns>
  3383. public ActionResult GetScrapProductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  3384. {
  3385. ActionResult actionResult = new ActionResult();
  3386. try
  3387. {
  3388. // 验证请求头信息
  3389. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3390. // 验证失败
  3391. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3392. {
  3393. return actionResult;
  3394. }
  3395. int returnValue = ServiceInvoker.Invoke<int>(this,
  3396. () => PDAModuleLogic.GetScrapProductFuntion(sUserInfo));
  3397. actionResult.Result = JsonHelper.ToJson(returnValue);
  3398. actionResult.Status = (int)Constant.PDAResult.Success;
  3399. }
  3400. catch (Exception ex)
  3401. {
  3402. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3403. OutputLog.TraceLog(LogPriority.Error,
  3404. this.ToString(),
  3405. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3406. ex.ToString(),
  3407. LocalPath.LogExePath);
  3408. actionResult.Status = (int)Constant.PDAResult.Exception;
  3409. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3410. }
  3411. return actionResult;
  3412. }
  3413. /// <summary>
  3414. /// 获取登陆帐户有无报损审批权限
  3415. /// </summary>
  3416. /// <param name="accountCode"></param>
  3417. /// <param name="userCode"></param>
  3418. /// <param name="userPassword"></param>
  3419. /// <param name="sessionKey"></param>
  3420. /// <param name="usercode">工号编码</param>
  3421. /// <returns></returns>
  3422. public ActionResult GetSpecialRepairflagByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3423. {
  3424. ActionResult actionResult = new ActionResult();
  3425. try
  3426. {
  3427. // 验证请求头信息
  3428. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3429. // 验证失败
  3430. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3431. {
  3432. return actionResult;
  3433. }
  3434. int returnValue = ServiceInvoker.Invoke<int>(this,
  3435. () => PMModuleLogic.GetSpecialRepairflagByBarcode(barcode, sUserInfo));
  3436. actionResult.Result = JsonHelper.ToJson(returnValue);
  3437. actionResult.Status = (int)Constant.PDAResult.Success;
  3438. }
  3439. catch (Exception ex)
  3440. {
  3441. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3442. OutputLog.TraceLog(LogPriority.Error,
  3443. this.ToString(),
  3444. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3445. ex.ToString(),
  3446. LocalPath.LogExePath);
  3447. actionResult.Status = (int)Constant.PDAResult.Exception;
  3448. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3449. }
  3450. return actionResult;
  3451. }
  3452. /// <summary>
  3453. /// 获取窑车对应产品列表
  3454. /// </summary>
  3455. /// <param name="accountCode"></param>
  3456. /// <param name="userCode"></param>
  3457. /// <param name="userPassword"></param>
  3458. /// <param name="sessionKey"></param>
  3459. /// <param name="KilnCarID">窑车ID</param>
  3460. /// <returns>Dataset</returns>
  3461. public ActionResult GetKilnCarGoodsByKilnCarID(string accountCode, string userCode, string userPassword, string sessionKey, int KilnCarID)
  3462. {
  3463. ActionResult actionResult = new ActionResult();
  3464. try
  3465. {
  3466. // 验证请求头信息
  3467. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3468. // 验证失败
  3469. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3470. {
  3471. return actionResult;
  3472. }
  3473. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3474. () => PMModuleLogic.GetKilnCarGoodsByKilnCarID(KilnCarID));
  3475. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3476. {
  3477. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3478. actionResult.Status = (int)Constant.PDAResult.Success;
  3479. }
  3480. else
  3481. {
  3482. actionResult.Status = (int)Constant.PDAResult.Fail;
  3483. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3484. }
  3485. }
  3486. catch (Exception ex)
  3487. {
  3488. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3489. OutputLog.TraceLog(LogPriority.Error,
  3490. this.ToString(),
  3491. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3492. ex.ToString(),
  3493. LocalPath.LogExePath);
  3494. actionResult.Status = (int)Constant.PDAResult.Exception;
  3495. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3496. }
  3497. return actionResult;
  3498. }
  3499. /// <summary>
  3500. /// 更换条码
  3501. /// </summary>
  3502. /// <param name="accountCode"></param>
  3503. /// <param name="userCode"></param>
  3504. /// <param name="userPassword"></param>
  3505. /// <param name="sessionKey"></param>
  3506. ///<param name="barcode">原条码</param>
  3507. /// <param name="newBarcode">新条码</param>
  3508. /// <param name="remarks">备注</param>
  3509. /// <returns>操作结果</returns>
  3510. public ActionResult SaveBarCodeChange(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, string newBarcode, string remarks, string groutingUserCode, string goodsCode)
  3511. {
  3512. ActionResult actionResult = new ActionResult();
  3513. try
  3514. {
  3515. // 验证请求头信息
  3516. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3517. // 验证失败
  3518. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3519. {
  3520. return actionResult;
  3521. }
  3522. ServiceResultEntity serviceResultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  3523. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SetFPM0201Data(sUserInfo, barcode, newBarcode, remarks, groutingUserCode, goodsCode));
  3524. if (serviceResultEntity.Status == Constant.ServiceResultStatus.Success)
  3525. {
  3526. actionResult.Result = 1;
  3527. actionResult.Status = (int)Constant.PDAResult.Success;
  3528. }
  3529. else
  3530. {
  3531. actionResult.Status = (int)Constant.PDAResult.Fail;
  3532. actionResult.Message = serviceResultEntity.Message;
  3533. }
  3534. }
  3535. catch (Exception ex)
  3536. {
  3537. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3538. OutputLog.TraceLog(LogPriority.Error,
  3539. this.ToString(),
  3540. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3541. ex.ToString(),
  3542. LocalPath.LogExePath);
  3543. actionResult.Status = (int)Constant.PDAResult.Exception;
  3544. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3545. }
  3546. return actionResult;
  3547. }
  3548. /// <summary>
  3549. /// 获取(注浆登记)的查询数据
  3550. /// </summary>
  3551. /// <param name="accountCode"></param>
  3552. /// <param name="userCode"></param>
  3553. /// <param name="userPassword"></param>
  3554. /// <param name="sessionKey"></param>
  3555. /// <param name="se">查询条件</param>
  3556. /// <returns>Dataset</returns>
  3557. public ActionResult GetGroutingList(string accountCode, string userCode, string userPassword, string sessionKey, FPM0202_SE se)
  3558. {
  3559. ActionResult actionResult = new ActionResult();
  3560. try
  3561. {
  3562. // 验证请求头信息
  3563. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3564. // 验证失败
  3565. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3566. {
  3567. return actionResult;
  3568. }
  3569. ServiceResultEntity serviceResultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  3570. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetFPM0202SData(sUserInfo, se));
  3571. if (serviceResultEntity.Status != Constant.ServiceResultStatus.NoSearchResults)
  3572. {
  3573. // PDA不显示的列删除掉
  3574. //serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingDailyDetailID");
  3575. //serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingDailyID");
  3576. serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingLineName");
  3577. serviceResultEntity.Data.Tables[0].Columns.Remove("UserCode");
  3578. serviceResultEntity.Data.Tables[0].Columns.Remove("GoodsName");
  3579. serviceResultEntity.Data.Tables[0].Columns.Remove("GMouldStatusName");
  3580. serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingCount");
  3581. serviceResultEntity.Data.Tables[0].Columns.Remove("Remarks");
  3582. serviceResultEntity.Data.Tables[0].Columns.Remove("GMouldTypeName");
  3583. //serviceResultEntity.Data.Tables[0].Columns.Remove("DMUserCode");
  3584. serviceResultEntity.Data.Tables[0].Columns.Remove("IsPublicBody");
  3585. actionResult.Result = JsonHelper.ToJson(serviceResultEntity.Data.Tables[0]);
  3586. actionResult.Status = (int)Constant.PDAResult.Success;
  3587. }
  3588. else
  3589. {
  3590. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3591. actionResult.Message = "无查询数据";
  3592. }
  3593. }
  3594. catch (Exception ex)
  3595. {
  3596. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3597. OutputLog.TraceLog(LogPriority.Error,
  3598. this.ToString(),
  3599. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3600. ex.ToString(),
  3601. LocalPath.LogExePath);
  3602. actionResult.Status = (int)Constant.PDAResult.Exception;
  3603. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3604. }
  3605. return actionResult;
  3606. }
  3607. /// <summary>
  3608. /// 获取(注浆登记)的查询数据
  3609. /// </summary>
  3610. /// <param name="accountCode"></param>
  3611. /// <param name="userCode"></param>
  3612. /// <param name="userPassword"></param>
  3613. /// <param name="sessionKey"></param>
  3614. /// <param name="se">查询条件</param>
  3615. /// <returns>Dataset</returns>
  3616. public ActionResult GetGroutingListByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3617. {
  3618. ActionResult actionResult = new ActionResult();
  3619. try
  3620. {
  3621. // 验证请求头信息
  3622. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3623. // 验证失败
  3624. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3625. {
  3626. return actionResult;
  3627. }
  3628. ServiceResultEntity serviceResultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  3629. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetFPM0203SData(sUserInfo, barcode));
  3630. if (serviceResultEntity.Status != Constant.ServiceResultStatus.NoSearchResults)
  3631. {
  3632. actionResult.Result = JsonHelper.ToJson(serviceResultEntity.Data.Tables[0]);
  3633. actionResult.Status = (int)Constant.PDAResult.Success;
  3634. }
  3635. else
  3636. {
  3637. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3638. actionResult.Message = "无查询数据";
  3639. }
  3640. }
  3641. catch (Exception ex)
  3642. {
  3643. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3644. OutputLog.TraceLog(LogPriority.Error,
  3645. this.ToString(),
  3646. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3647. ex.ToString(),
  3648. LocalPath.LogExePath);
  3649. actionResult.Status = (int)Constant.PDAResult.Exception;
  3650. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3651. }
  3652. return actionResult;
  3653. }
  3654. /// <summary>
  3655. ///获得成型线信息
  3656. /// </summary>
  3657. /// <param name="accountCode"></param>
  3658. /// <param name="userCode"></param>
  3659. /// <param name="userPassword"></param>
  3660. /// <param name="sessionKey"></param>
  3661. /// <param name="se">查询条件</param>
  3662. /// <returns>Dataset</returns>
  3663. public ActionResult GetGroutingLine(string accountCode, string userCode, string userPassword, string sessionKey, GroutingLineEntity groutingLineEntity)
  3664. {
  3665. ActionResult actionResult = new ActionResult();
  3666. try
  3667. {
  3668. // 验证请求头信息
  3669. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3670. // 验证失败
  3671. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3672. {
  3673. return actionResult;
  3674. }
  3675. DataSet dsReturn = ServiceInvoker.Invoke<DataSet>(this,
  3676. () => Dongke.IBOSS.PRD.Service.PCModuleLogic.PCModuleLogic.GetGroutingLine(groutingLineEntity, sUserInfo));
  3677. if (dsReturn != null && dsReturn.Tables[0].Rows.Count > 0)
  3678. {
  3679. actionResult.Result = JsonHelper.ToJson(dsReturn.Tables[0]);
  3680. actionResult.Status = (int)Constant.PDAResult.Success;
  3681. }
  3682. else
  3683. {
  3684. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3685. actionResult.Message = "无查询数据";
  3686. }
  3687. }
  3688. catch (Exception ex)
  3689. {
  3690. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3691. OutputLog.TraceLog(LogPriority.Error,
  3692. this.ToString(),
  3693. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3694. ex.ToString(),
  3695. LocalPath.LogExePath);
  3696. actionResult.Status = (int)Constant.PDAResult.Exception;
  3697. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3698. }
  3699. return actionResult;
  3700. }
  3701. /// <summary>
  3702. ///获取在产产品的信息标识列表
  3703. /// </summary>
  3704. /// <param name="accountCode"></param>
  3705. /// <param name="userCode"></param>
  3706. /// <param name="userPassword"></param>
  3707. /// <param name="sessionKey"></param>
  3708. /// <param name="barcode">查询条件</param>
  3709. /// <returns>Dataset</returns>
  3710. public ActionResult GetInProductionDataList(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3711. {
  3712. ActionResult actionResult = new ActionResult();
  3713. try
  3714. {
  3715. // 验证请求头信息
  3716. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3717. // 验证失败
  3718. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3719. {
  3720. return actionResult;
  3721. }
  3722. DataSet dsReturn = ServiceInvoker.Invoke<DataSet>(this,
  3723. () => PMModuleLogic.GetInProductionDataList(barcode));
  3724. if (dsReturn != null && dsReturn.Tables[0].Rows.Count > 0)
  3725. {
  3726. actionResult.Result = JsonHelper.ToJson(dsReturn.Tables[0]);
  3727. actionResult.Status = (int)Constant.PDAResult.Success;
  3728. }
  3729. else
  3730. {
  3731. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3732. actionResult.Message = "无查询数据";
  3733. }
  3734. }
  3735. catch (Exception ex)
  3736. {
  3737. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3738. OutputLog.TraceLog(LogPriority.Error,
  3739. this.ToString(),
  3740. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3741. ex.ToString(),
  3742. LocalPath.LogExePath);
  3743. actionResult.Status = (int)Constant.PDAResult.Exception;
  3744. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3745. }
  3746. return actionResult;
  3747. }
  3748. /// <summary>
  3749. ///获取条码是否注浆登记过,0行无效
  3750. /// </summary>
  3751. /// <param name="accountCode"></param>
  3752. /// <param name="userCode"></param>
  3753. /// <param name="userPassword"></param>
  3754. /// <param name="sessionKey"></param>
  3755. /// <param name="barcode">查询条件</param>
  3756. /// <returns>Dataset</returns>
  3757. public ActionResult GetBarCodeInGroutingDailyDetail(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3758. {
  3759. ActionResult actionResult = new ActionResult();
  3760. try
  3761. {
  3762. // 验证请求头信息
  3763. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3764. // 验证失败
  3765. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3766. {
  3767. return actionResult;
  3768. }
  3769. DataSet dsReturn = ServiceInvoker.Invoke<DataSet>(this,
  3770. () => PMModuleLogic.GetBarCodeInGroutingDailyDetail(barcode));
  3771. if (dsReturn != null && dsReturn.Tables[0].Rows.Count > 0)
  3772. {
  3773. actionResult.Result = JsonHelper.ToJson(dsReturn.Tables[0]);
  3774. actionResult.Status = (int)Constant.PDAResult.Success;
  3775. }
  3776. else
  3777. {
  3778. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3779. actionResult.Message = "该产品条码无效,无法报损!";
  3780. }
  3781. }
  3782. catch (Exception ex)
  3783. {
  3784. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3785. OutputLog.TraceLog(LogPriority.Error,
  3786. this.ToString(),
  3787. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3788. ex.ToString(),
  3789. LocalPath.LogExePath);
  3790. actionResult.Status = (int)Constant.PDAResult.Exception;
  3791. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3792. }
  3793. return actionResult;
  3794. }
  3795. /// <summary>
  3796. /// 获取登陆帐户有变更条码权限
  3797. /// </summary>
  3798. /// <param name="accountCode"></param>
  3799. /// <param name="userCode"></param>
  3800. /// <param name="userPassword"></param>
  3801. /// <param name="sessionKey"></param>
  3802. /// <returns></returns>
  3803. public ActionResult GetBarCodeRecordFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  3804. {
  3805. ActionResult actionResult = new ActionResult();
  3806. try
  3807. {
  3808. // 验证请求头信息
  3809. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3810. // 验证失败
  3811. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3812. {
  3813. return actionResult;
  3814. }
  3815. int returnValue = ServiceInvoker.Invoke<int>(this,
  3816. () => PDAModuleLogic.GetBarCodeRecordFuntion(sUserInfo));
  3817. actionResult.Result = JsonHelper.ToJson(returnValue);
  3818. actionResult.Status = (int)Constant.PDAResult.Success;
  3819. }
  3820. catch (Exception ex)
  3821. {
  3822. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3823. OutputLog.TraceLog(LogPriority.Error,
  3824. this.ToString(),
  3825. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3826. ex.ToString(),
  3827. LocalPath.LogExePath);
  3828. actionResult.Status = (int)Constant.PDAResult.Exception;
  3829. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3830. }
  3831. return actionResult;
  3832. }
  3833. /// <summary>
  3834. /// 成检时获取此条码是否报损
  3835. /// </summary>
  3836. /// <param name="accountCode"></param>
  3837. /// <param name="userCode"></param>
  3838. /// <param name="userPassword"></param>
  3839. /// <param name="sessionKey"></param>
  3840. /// <param name="barcode">产品条码</param>
  3841. /// <returns></returns>
  3842. public ActionResult CheckScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3843. {
  3844. ActionResult actionResult = new ActionResult();
  3845. try
  3846. {
  3847. // 验证请求头信息
  3848. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3849. // 验证失败
  3850. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3851. {
  3852. return actionResult;
  3853. }
  3854. int returnValue = ServiceInvoker.Invoke<int>(this,
  3855. () => PMModuleLogic.CheckScrapProduct(barcode));
  3856. if (returnValue == -100)
  3857. {
  3858. actionResult.Result = JsonHelper.ToJson(returnValue);
  3859. actionResult.Status = (int)Constant.PDAResult.Success;
  3860. }
  3861. else
  3862. {
  3863. actionResult.Status = (int)Constant.PDAResult.Fail;
  3864. if (returnValue == 0)
  3865. {
  3866. actionResult.Message = "该条码:" + barcode + "存在报损记录(待审批)";
  3867. }
  3868. else
  3869. {
  3870. actionResult.Message = "该条码:" + barcode + "存在报损记录(审批通过)";
  3871. }
  3872. }
  3873. }
  3874. catch (Exception ex)
  3875. {
  3876. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3877. OutputLog.TraceLog(LogPriority.Error,
  3878. this.ToString(),
  3879. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3880. ex.ToString(),
  3881. LocalPath.LogExePath);
  3882. actionResult.Status = (int)Constant.PDAResult.Exception;
  3883. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3884. }
  3885. return actionResult;
  3886. }
  3887. /// <summary>
  3888. /// 获取产品完成工序的ID(PDA)
  3889. /// </summary>
  3890. /// <param name="barcode">产品条码</param>
  3891. /// <returns>int</returns>
  3892. public ActionResult GetCompleteProcedureIDPDA(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3893. {
  3894. ActionResult actionResult = new ActionResult();
  3895. try
  3896. {
  3897. // 验证请求头信息
  3898. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3899. // 验证失败
  3900. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3901. {
  3902. return actionResult;
  3903. }
  3904. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  3905. () => PMModuleLogic.GetCompleteProcedureIDPDA(barcode));
  3906. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  3907. actionResult.Status = (int)Constant.PDAResult.Success;
  3908. }
  3909. catch (Exception ex)
  3910. {
  3911. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3912. OutputLog.TraceLog(LogPriority.Error,
  3913. this.ToString(),
  3914. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3915. ex.ToString(),
  3916. LocalPath.LogExePath);
  3917. actionResult.Status = (int)Constant.PDAResult.Exception;
  3918. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3919. }
  3920. return actionResult;
  3921. }
  3922. /// <summary>
  3923. /// 获取产品完成工序的ID(PDA)
  3924. /// </summary>
  3925. /// <param name="barcode">产品条码</param>
  3926. /// <returns>int</returns>
  3927. public ActionResult GetGoodsInfoBybarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3928. {
  3929. ActionResult actionResult = new ActionResult();
  3930. try
  3931. {
  3932. // 验证请求头信息
  3933. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3934. // 验证失败
  3935. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3936. {
  3937. return actionResult;
  3938. }
  3939. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  3940. () => PMModuleLogic.GetGoodsInfoBybarcode(barcode));
  3941. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  3942. actionResult.Status = (int)Constant.PDAResult.Success;
  3943. }
  3944. catch (Exception ex)
  3945. {
  3946. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3947. OutputLog.TraceLog(LogPriority.Error,
  3948. this.ToString(),
  3949. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3950. ex.ToString(),
  3951. LocalPath.LogExePath);
  3952. actionResult.Status = (int)Constant.PDAResult.Exception;
  3953. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3954. }
  3955. return actionResult;
  3956. }
  3957. /// <summary>
  3958. /// 成检-校验生产工号
  3959. /// </summary>
  3960. /// <param name="usercode">生产工号</param>
  3961. /// <returns>int</returns>
  3962. public ActionResult GetUserCode(string accountCode, string userCode, string userPassword, string sessionKey, string usercode)
  3963. {
  3964. ActionResult actionResult = new ActionResult();
  3965. try
  3966. {
  3967. // 验证请求头信息
  3968. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3969. // 验证失败
  3970. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3971. {
  3972. return actionResult;
  3973. }
  3974. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  3975. () => PDAModuleLogic.GetUserCode(usercode, sUserInfo));
  3976. actionResult.Result = JsonHelper.ToJson(ds);
  3977. actionResult.Status = (int)Constant.PDAResult.Success;
  3978. }
  3979. catch (Exception ex)
  3980. {
  3981. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3982. OutputLog.TraceLog(LogPriority.Error,
  3983. this.ToString(),
  3984. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3985. ex.ToString(),
  3986. LocalPath.LogExePath);
  3987. actionResult.Status = (int)Constant.PDAResult.Exception;
  3988. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3989. }
  3990. return actionResult;
  3991. }
  3992. /// <summary>
  3993. /// 更新漏扫的成型工号
  3994. /// </summary>
  3995. /// <param name="accountCode"></param>
  3996. /// <param name="userCode"></param>
  3997. /// <param name="userPassword"></param>
  3998. /// <param name="sessionKey"></param>
  3999. /// <param name="groutingUserCode">成型工号</param>
  4000. /// <param name="missingID">漏扫ID</param>
  4001. /// <returns></returns>
  4002. public ActionResult UpdateGroutingUserCodeByMissingID(string accountCode, string userCode, string userPassword, string sessionKey, string groutingUserCode, int missingID)
  4003. {
  4004. ActionResult actionResult = new ActionResult();
  4005. try
  4006. {
  4007. // 验证请求头信息
  4008. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4009. // 验证失败
  4010. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4011. {
  4012. return actionResult;
  4013. }
  4014. int returnValue = ServiceInvoker.Invoke<int>(this,
  4015. () => PMModuleLogicDAL.UpdateGroutingUserCodeByMissingID(groutingUserCode, missingID, sUserInfo));
  4016. if (returnValue != -1)
  4017. {
  4018. actionResult.Result = JsonHelper.ToJson(returnValue);
  4019. actionResult.Status = (int)Constant.PDAResult.Success;
  4020. }
  4021. else
  4022. {
  4023. actionResult.Status = (int)Constant.PDAResult.Fail;
  4024. actionResult.Message = "存在无效的漏扫工号";
  4025. }
  4026. }
  4027. catch (Exception ex)
  4028. {
  4029. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4030. OutputLog.TraceLog(LogPriority.Error,
  4031. this.ToString(),
  4032. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4033. ex.ToString(),
  4034. LocalPath.LogExePath);
  4035. actionResult.Status = (int)Constant.PDAResult.Exception;
  4036. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4037. }
  4038. return actionResult;
  4039. }
  4040. /// <summary>
  4041. /// 在入窑工序检验窑车号是否存在
  4042. /// </summary>
  4043. /// <param name="accountCode"></param>
  4044. /// <param name="userCode"></param>
  4045. /// <param name="userPassword"></param>
  4046. /// <param name="sessionKey"></param>
  4047. /// <param name="kilncarcode">窑车编码</param>
  4048. /// <param name="procedureid">工序ID</param>
  4049. /// <returns></returns>
  4050. public ActionResult CheckKilnCarByIntoCar(string accountCode, string userCode, string userPassword, string sessionKey, string kilncarcode, int procedureid)
  4051. {
  4052. ActionResult actionResult = new ActionResult();
  4053. try
  4054. {
  4055. // 验证请求头信息
  4056. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4057. // 验证失败
  4058. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4059. {
  4060. return actionResult;
  4061. }
  4062. int returnValue = ServiceInvoker.Invoke<int>(this,
  4063. () => PMModuleLogicDAL.CheckKilnCarByIntoCar(kilncarcode, procedureid, sUserInfo));
  4064. if (returnValue == 1)
  4065. {
  4066. actionResult.Result = JsonHelper.ToJson(returnValue);
  4067. actionResult.Status = (int)Constant.PDAResult.Success;
  4068. }
  4069. else
  4070. {
  4071. actionResult.Status = (int)Constant.PDAResult.Fail;
  4072. if (returnValue == -99)
  4073. actionResult.Message = "窑炉车号无效";
  4074. else if (returnValue == -98)
  4075. actionResult.Message = "窑车己无产品";
  4076. else if (returnValue == -97)
  4077. actionResult.Message = "窑车没有入窑,不可以撤销";
  4078. else if (returnValue == -1)
  4079. actionResult.Message = "保存失败";
  4080. }
  4081. }
  4082. catch (Exception ex)
  4083. {
  4084. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4085. OutputLog.TraceLog(LogPriority.Error,
  4086. this.ToString(),
  4087. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4088. ex.ToString(),
  4089. LocalPath.LogExePath);
  4090. actionResult.Status = (int)Constant.PDAResult.Exception;
  4091. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4092. }
  4093. return actionResult;
  4094. }
  4095. /// <summary>
  4096. /// 获取盘点单列表
  4097. /// </summary>
  4098. /// <param name="sUserInfo"></param>
  4099. /// <returns></returns>
  4100. public ActionResult GetInCheckedList(string accountCode, string userCode, string userPassword, string sessionKey)
  4101. {
  4102. ActionResult actionResult = new ActionResult();
  4103. try
  4104. {
  4105. // 验证请求头信息
  4106. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4107. // 验证失败
  4108. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4109. {
  4110. return actionResult;
  4111. }
  4112. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4113. () => PMModuleLogic.GetInCheckedList(sUserInfo));
  4114. actionResult.Result = JsonHelper.ToJson(ds);
  4115. actionResult.Status = (int)Constant.PDAResult.Success;
  4116. }
  4117. catch (Exception ex)
  4118. {
  4119. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4120. OutputLog.TraceLog(LogPriority.Error,
  4121. this.ToString(),
  4122. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4123. ex.ToString(),
  4124. LocalPath.LogExePath);
  4125. actionResult.Status = (int)Constant.PDAResult.Exception;
  4126. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4127. }
  4128. return actionResult;
  4129. }
  4130. /// <summary>
  4131. /// 进行盘点操作
  4132. /// </summary>
  4133. /// <param name="accountCode"></param>
  4134. /// <param name="userCode"></param>
  4135. /// <param name="userPassword"></param>
  4136. /// <param name="sessionKey"></param>
  4137. /// <param name="InCheckedID">盘点单ID</param>
  4138. /// <param name="BarCode">产品条码</param>
  4139. /// <returns></returns>
  4140. public ActionResult UpdateInChecked(string accountCode, string userCode, string userPassword, string sessionKey, int InCheckedID, string BarCode)
  4141. {
  4142. ActionResult actionResult = new ActionResult();
  4143. try
  4144. {
  4145. // 验证请求头信息
  4146. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4147. // 验证失败
  4148. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4149. {
  4150. return actionResult;
  4151. }
  4152. int returnValue = ServiceInvoker.Invoke<int>(this,
  4153. () => PMModuleLogicDAL.UpdateInChecked(InCheckedID, BarCode, sUserInfo));
  4154. if (returnValue > 0)
  4155. {
  4156. actionResult.Result = JsonHelper.ToJson(returnValue);
  4157. actionResult.Status = (int)Constant.PDAResult.Success;
  4158. actionResult.Message = "产品" + BarCode + "盘点成功";
  4159. }
  4160. else if (returnValue == 10)
  4161. {
  4162. actionResult.Result = JsonHelper.ToJson(returnValue);
  4163. actionResult.Status = (int)Constant.PDAResult.Success;
  4164. actionResult.Message = "产品" + BarCode + "盘盈成功";
  4165. }
  4166. else
  4167. {
  4168. actionResult.Status = (int)Constant.PDAResult.Fail;
  4169. if (returnValue == -2)
  4170. actionResult.Message = "产品" + BarCode + "不是在产产品";
  4171. //if (returnValue == 10)
  4172. // actionResult.Message = "产品" + BarCode + "盘盈成功";
  4173. //if (returnValue > 0)
  4174. // actionResult.Message = "产品" + BarCode + "盘点成功";
  4175. if (returnValue == -22)
  4176. actionResult.Message = "产品" + BarCode + "己被其他工号盘点";
  4177. if (returnValue == -23)
  4178. actionResult.Message = "产品" + BarCode + "己被其他工号盘盈";
  4179. if (returnValue == -24)
  4180. actionResult.Message = "产品" + BarCode + "己被此工号盘点";
  4181. if (returnValue == -25)
  4182. actionResult.Message = "产品" + BarCode + "己被此工号盘盈";
  4183. else if (returnValue == 0)
  4184. actionResult.Message = "盘点失败";
  4185. }
  4186. }
  4187. catch (Exception ex)
  4188. {
  4189. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4190. OutputLog.TraceLog(LogPriority.Error,
  4191. this.ToString(),
  4192. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4193. ex.ToString(),
  4194. LocalPath.LogExePath);
  4195. actionResult.Status = (int)Constant.PDAResult.Exception;
  4196. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4197. }
  4198. return actionResult;
  4199. }
  4200. #region 班次配置
  4201. /// <summary>
  4202. /// 班次配置-通过工号获取工种列表
  4203. /// </summary>
  4204. /// <param name="userId">工号ID</param>
  4205. /// <returns></returns>
  4206. public ActionResult BindUserJobs(string accountCode, string userCode, string userPassword, string sessionKey, int userId)
  4207. {
  4208. ActionResult actionResult = new ActionResult();
  4209. try
  4210. {
  4211. // 验证请求头信息
  4212. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4213. // 验证失败
  4214. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4215. {
  4216. return actionResult;
  4217. }
  4218. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4219. () => SystemModuleLogic.GetJobByUserId(userId));
  4220. actionResult.Result = JsonHelper.ToJson(ds);
  4221. actionResult.Status = (int)Constant.PDAResult.Success;
  4222. }
  4223. catch (Exception ex)
  4224. {
  4225. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4226. OutputLog.TraceLog(LogPriority.Error,
  4227. this.ToString(),
  4228. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4229. ex.ToString(),
  4230. LocalPath.LogExePath);
  4231. actionResult.Status = (int)Constant.PDAResult.Exception;
  4232. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4233. }
  4234. return actionResult;
  4235. }
  4236. ///// <summary>
  4237. ///// 班次配置-根据工号查询员工档案信息
  4238. ///// </summary>
  4239. ///// <param name="userId">工号ID</param>
  4240. ///// <returns></returns>
  4241. //public ActionResult SearchHrStaffInfo(string accountCode, string userCode, string userPassword, string sessionKey, int userId)
  4242. //{
  4243. // ActionResult actionResult = new ActionResult();
  4244. // try
  4245. // {
  4246. // // 验证请求头信息
  4247. // actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4248. // // 验证失败
  4249. // if (actionResult.Status != (int)Constant.PDAResult.Success)
  4250. // {
  4251. // return actionResult;
  4252. // }
  4253. // DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4254. // () => HRModuleLogic.SearchHrStaffInfo(userId,sUserInfo));
  4255. // actionResult.Result = JsonHelper.ToJson(ds);
  4256. // actionResult.Status = (int)Constant.PDAResult.Success;
  4257. // }
  4258. // catch (Exception ex)
  4259. // {
  4260. // //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4261. // OutputLog.TraceLog(LogPriority.Error,
  4262. // this.ToString(),
  4263. // System.Reflection.MethodBase.GetCurrentMethod().Name,
  4264. // ex.ToString(),
  4265. // LocalPath.LogExePath);
  4266. // actionResult.Status = (int)Constant.PDAResult.Exception;
  4267. // actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4268. // }
  4269. // return actionResult;
  4270. //}
  4271. /// <summary>
  4272. /// 班次配置-根据员工姓名查员工信息
  4273. /// </summary>
  4274. /// <param name="searchStaffEntity"></param>
  4275. /// <returns></returns>
  4276. public ActionResult SearchStaffInfo(string accountCode, string userCode, string userPassword, string sessionKey, SearchStaffEntity searchStaffEntity)
  4277. {
  4278. ActionResult actionResult = new ActionResult();
  4279. try
  4280. {
  4281. // 验证请求头信息
  4282. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4283. // 验证失败
  4284. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4285. {
  4286. return actionResult;
  4287. }
  4288. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4289. () => PDAModuleLogic.SearchStaffInfo(searchStaffEntity, sUserInfo));
  4290. actionResult.Result = JsonHelper.ToJson(ds);
  4291. actionResult.Status = (int)Constant.PDAResult.Success;
  4292. }
  4293. catch (Exception ex)
  4294. {
  4295. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4296. OutputLog.TraceLog(LogPriority.Error,
  4297. this.ToString(),
  4298. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4299. ex.ToString(),
  4300. LocalPath.LogExePath);
  4301. actionResult.Status = (int)Constant.PDAResult.Exception;
  4302. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4303. }
  4304. return actionResult;
  4305. }
  4306. /// <summary>
  4307. /// 获取班次配置信息
  4308. /// </summary>
  4309. /// <param name="searchEntity"></param>
  4310. /// <returns></returns>
  4311. public ActionResult SearchClassesSetting(string accountCode, string userCode, string userPassword, string sessionKey, SearchClassesSettingEntity searchEntity)
  4312. {
  4313. ActionResult actionResult = new ActionResult();
  4314. try
  4315. {
  4316. // 验证请求头信息
  4317. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4318. // 验证失败
  4319. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4320. {
  4321. return actionResult;
  4322. }
  4323. searchEntity.StartAccountDate = Convert.ToDateTime(searchEntity.StartAccountDatePDA);
  4324. searchEntity.EndAccountDate = Convert.ToDateTime(searchEntity.EndAccountDatePDA).AddDays(1).AddMinutes(-1);
  4325. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4326. () => PCModuleLogic.SearchClassesSetting(searchEntity, sUserInfo));
  4327. actionResult.Result = JsonHelper.ToJson(ds);
  4328. actionResult.Status = (int)Constant.PDAResult.Success;
  4329. }
  4330. catch (Exception ex)
  4331. {
  4332. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4333. OutputLog.TraceLog(LogPriority.Error,
  4334. this.ToString(),
  4335. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4336. ex.ToString(),
  4337. LocalPath.LogExePath);
  4338. actionResult.Status = (int)Constant.PDAResult.Exception;
  4339. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4340. }
  4341. return actionResult;
  4342. }
  4343. public ActionResult SaveClassesSetting(string accountCode, string userCode, string userPassword, string sessionKey, ClassesSettingEntity setEntity, ClassesDetailSettingEntity[] setDetailEntity)
  4344. {
  4345. ActionResult actionResult = new ActionResult();
  4346. try
  4347. {
  4348. // 验证请求头信息
  4349. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4350. // 验证失败
  4351. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4352. {
  4353. return actionResult;
  4354. }
  4355. int returnValue = ServiceInvoker.Invoke<int>(this,
  4356. () => PDAModuleLogic.SaveClassesSetting(setEntity, setDetailEntity, sUserInfo));
  4357. if (returnValue > 0)
  4358. {
  4359. actionResult.Result = JsonHelper.ToJson(returnValue);
  4360. actionResult.Status = (int)Constant.PDAResult.Success;
  4361. }
  4362. else
  4363. {
  4364. actionResult.Status = (int)Constant.PDAResult.Fail;
  4365. actionResult.Message = "保存失败";
  4366. }
  4367. }
  4368. catch (Exception ex)
  4369. {
  4370. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4371. OutputLog.TraceLog(LogPriority.Error,
  4372. this.ToString(),
  4373. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4374. ex.ToString(),
  4375. LocalPath.LogExePath);
  4376. actionResult.Status = (int)Constant.PDAResult.Exception;
  4377. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4378. }
  4379. return actionResult;
  4380. }
  4381. /// <summary>
  4382. /// 班次配置--获取详细信息
  4383. /// </summary>
  4384. /// <param name="searchEntity"></param>
  4385. /// <returns></returns>
  4386. public ActionResult SearchClassesDetail(string accountCode, string userCode, string userPassword, string sessionKey, int classesSettingID)
  4387. {
  4388. ActionResult actionResult = new ActionResult();
  4389. try
  4390. {
  4391. // 验证请求头信息
  4392. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4393. // 验证失败
  4394. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4395. {
  4396. return actionResult;
  4397. }
  4398. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4399. () => PCModuleLogic.SearchClassesDetail(classesSettingID, sUserInfo));
  4400. actionResult.Result = JsonHelper.ToJson(ds);
  4401. actionResult.Status = (int)Constant.PDAResult.Success;
  4402. }
  4403. catch (Exception ex)
  4404. {
  4405. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4406. OutputLog.TraceLog(LogPriority.Error,
  4407. this.ToString(),
  4408. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4409. ex.ToString(),
  4410. LocalPath.LogExePath);
  4411. actionResult.Status = (int)Constant.PDAResult.Exception;
  4412. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4413. }
  4414. return actionResult;
  4415. }
  4416. /// <summary>
  4417. /// 获取用户是否有班次配置权限
  4418. /// </summary>
  4419. /// <param name="accountCode"></param>
  4420. /// <param name="userCode"></param>
  4421. /// <param name="userPassword"></param>
  4422. /// <param name="sessionKey"></param>
  4423. /// <returns></returns>
  4424. public ActionResult GetClassesSettingFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  4425. {
  4426. ActionResult actionResult = new ActionResult();
  4427. try
  4428. {
  4429. // 验证请求头信息
  4430. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4431. // 验证失败
  4432. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4433. {
  4434. return actionResult;
  4435. }
  4436. int returnValue = ServiceInvoker.Invoke<int>(this,
  4437. () => PDAModuleLogic.GetClassesSettingFuntion(sUserInfo));
  4438. actionResult.Result = JsonHelper.ToJson(returnValue);
  4439. actionResult.Status = (int)Constant.PDAResult.Success;
  4440. }
  4441. catch (Exception ex)
  4442. {
  4443. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4444. OutputLog.TraceLog(LogPriority.Error,
  4445. this.ToString(),
  4446. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4447. ex.ToString(),
  4448. LocalPath.LogExePath);
  4449. actionResult.Status = (int)Constant.PDAResult.Exception;
  4450. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4451. }
  4452. return actionResult;
  4453. }
  4454. /// <summary>
  4455. /// 获取盘点单列表
  4456. /// </summary>
  4457. /// <param name="sUserInfo"></param>
  4458. /// <returns></returns>
  4459. public ActionResult GetAllInChecked(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity)
  4460. {
  4461. ActionResult actionResult = new ActionResult();
  4462. try
  4463. {
  4464. // 验证请求头信息
  4465. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4466. // 验证失败
  4467. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4468. {
  4469. return actionResult;
  4470. }
  4471. entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA);
  4472. entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1);
  4473. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4474. () => PDAModuleLogic.GetAllInChecked(entity, sUserInfo));
  4475. actionResult.Result = JsonHelper.ToJson(ds);
  4476. actionResult.Status = (int)Constant.PDAResult.Success;
  4477. }
  4478. catch (Exception ex)
  4479. {
  4480. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4481. OutputLog.TraceLog(LogPriority.Error,
  4482. this.ToString(),
  4483. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4484. ex.ToString(),
  4485. LocalPath.LogExePath);
  4486. actionResult.Status = (int)Constant.PDAResult.Exception;
  4487. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4488. }
  4489. return actionResult;
  4490. }
  4491. #endregion
  4492. #region PDA报表
  4493. /// <summary>
  4494. /// 产品质量跟踪
  4495. /// </summary>
  4496. /// <param name="accountCode"></param>
  4497. /// <param name="userCode"></param>
  4498. /// <param name="userPassword"></param>
  4499. /// <param name="sessionKey"></param>
  4500. /// <param name="se"></param>
  4501. /// <returns></returns>
  4502. public ActionResult GetRPT040104SData(string accountCode, string userCode, string userPassword, string sessionKey, RPT040104_SE se)
  4503. {
  4504. ActionResult actionResult = new ActionResult();
  4505. try
  4506. {
  4507. // 验证请求头信息
  4508. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4509. // 验证失败
  4510. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4511. {
  4512. return actionResult;
  4513. }
  4514. se.CreateTimeStart = Convert.ToDateTime(se.CreateTimeStartPDA);
  4515. se.CreateTimeEnd = Convert.ToDateTime(se.CreateTimeEndPDA).AddDays(1);
  4516. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4517. () => PDAModuleLogic.GetRPT040104SData(sUserInfo, se));
  4518. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4519. {
  4520. actionResult.Status = (int)Constant.PDAResult.Fail;
  4521. actionResult.Message = Messages.MSG_CMN_I002;
  4522. }
  4523. else
  4524. {
  4525. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4526. actionResult.Status = (int)Constant.PDAResult.Success;
  4527. }
  4528. }
  4529. catch (Exception ex)
  4530. {
  4531. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4532. OutputLog.TraceLog(LogPriority.Error,
  4533. this.ToString(),
  4534. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4535. ex.ToString(),
  4536. LocalPath.LogExePath);
  4537. actionResult.Status = (int)Constant.PDAResult.Exception;
  4538. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4539. }
  4540. return actionResult;
  4541. }
  4542. /// <summary>
  4543. /// 工号产量质量分析表
  4544. /// </summary>
  4545. /// <param name="accountCode"></param>
  4546. /// <param name="userCode"></param>
  4547. /// <param name="userPassword"></param>
  4548. /// <param name="sessionKey"></param>
  4549. /// <param name="se"></param>
  4550. /// <returns></returns>
  4551. public ActionResult GetFP00002Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4552. int rptSProcedureID, string workcode, string date)
  4553. {
  4554. ActionResult actionResult = new ActionResult();
  4555. try
  4556. {
  4557. // 验证请求头信息
  4558. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4559. // 验证失败
  4560. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4561. {
  4562. return actionResult;
  4563. }
  4564. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4565. () => PDAModuleLogic.GetFP00002Data(sUserInfo, rptSProcedureID, workcode, Convert.ToDateTime(date)));
  4566. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4567. {
  4568. actionResult.Status = (int)Constant.PDAResult.Fail;
  4569. actionResult.Message = Messages.MSG_CMN_I002;
  4570. }
  4571. else
  4572. {
  4573. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4574. actionResult.Status = (int)Constant.PDAResult.Success;
  4575. }
  4576. }
  4577. catch (Exception ex)
  4578. {
  4579. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4580. OutputLog.TraceLog(LogPriority.Error,
  4581. this.ToString(),
  4582. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4583. ex.ToString(),
  4584. LocalPath.LogExePath);
  4585. actionResult.Status = (int)Constant.PDAResult.Exception;
  4586. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4587. }
  4588. return actionResult;
  4589. }
  4590. /// <summary>
  4591. /// 工号产量质量分析表(中陶)
  4592. /// </summary>
  4593. /// <param name="accountCode"></param>
  4594. /// <param name="userCode"></param>
  4595. /// <param name="userPassword"></param>
  4596. /// <param name="sessionKey"></param>
  4597. /// <param name="se"></param>
  4598. /// <returns></returns>
  4599. public ActionResult GetFP00002_1Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4600. int rptSProcedureID, string workcode, string date, string goodscode)
  4601. {
  4602. ActionResult actionResult = new ActionResult();
  4603. try
  4604. {
  4605. // 验证请求头信息
  4606. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4607. // 验证失败
  4608. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4609. {
  4610. return actionResult;
  4611. }
  4612. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4613. () => PDAModuleLogic.GetFP00002_1Data(sUserInfo, rptSProcedureID, workcode,
  4614. Convert.ToDateTime(date), goodscode));
  4615. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4616. {
  4617. actionResult.Status = (int)Constant.PDAResult.Fail;
  4618. actionResult.Message = Messages.MSG_CMN_I002;
  4619. }
  4620. else
  4621. {
  4622. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4623. actionResult.Status = (int)Constant.PDAResult.Success;
  4624. }
  4625. }
  4626. catch (Exception ex)
  4627. {
  4628. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4629. OutputLog.TraceLog(LogPriority.Error,
  4630. this.ToString(),
  4631. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4632. ex.ToString(),
  4633. LocalPath.LogExePath);
  4634. actionResult.Status = (int)Constant.PDAResult.Exception;
  4635. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4636. }
  4637. return actionResult;
  4638. }
  4639. /// <summary>
  4640. /// 半检数据统计表
  4641. /// </summary>
  4642. /// <param name="accountCode"></param>
  4643. /// <param name="userCode"></param>
  4644. /// <param name="userPassword"></param>
  4645. /// <param name="sessionKey"></param>
  4646. /// <param name="se"></param>
  4647. /// <returns></returns>
  4648. public ActionResult GetPDARPT000001Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4649. string workcode, string datebegin, string dateend)
  4650. {
  4651. ActionResult actionResult = new ActionResult();
  4652. try
  4653. {
  4654. // 验证请求头信息
  4655. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4656. // 验证失败
  4657. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4658. {
  4659. return actionResult;
  4660. }
  4661. DateTime datetimebegin = Convert.ToDateTime(datebegin);
  4662. DateTime datetimeend = Convert.ToDateTime(dateend);
  4663. datetimebegin = datetimebegin.Date;
  4664. datetimeend = datetimeend.Date.AddDays(1).AddSeconds(-1);
  4665. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4666. () => PDAModuleLogic.GetPDARPT000001Data(sUserInfo, workcode, datetimebegin, datetimeend));
  4667. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4668. {
  4669. actionResult.Status = (int)Constant.PDAResult.Fail;
  4670. actionResult.Message = Messages.MSG_CMN_I002;
  4671. }
  4672. else
  4673. {
  4674. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4675. actionResult.Status = (int)Constant.PDAResult.Success;
  4676. }
  4677. }
  4678. catch (Exception ex)
  4679. {
  4680. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4681. OutputLog.TraceLog(LogPriority.Error,
  4682. this.ToString(),
  4683. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4684. ex.ToString(),
  4685. LocalPath.LogExePath);
  4686. actionResult.Status = (int)Constant.PDAResult.Exception;
  4687. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4688. }
  4689. return actionResult;
  4690. }
  4691. /// <summary>
  4692. /// 工号质量统计表
  4693. /// </summary>
  4694. /// <param name="accountCode"></param>
  4695. /// <param name="userCode"></param>
  4696. /// <param name="userPassword"></param>
  4697. /// <param name="sessionKey"></param>
  4698. /// <param name="se"></param>
  4699. /// <returns></returns>
  4700. public ActionResult GetPDARPT000002Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4701. int rptSProcedureID, string workcode, string datebegin, string dateend)
  4702. {
  4703. ActionResult actionResult = new ActionResult();
  4704. try
  4705. {
  4706. // 验证请求头信息
  4707. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4708. // 验证失败
  4709. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4710. {
  4711. return actionResult;
  4712. }
  4713. DateTime datetimebegin = Convert.ToDateTime(datebegin);
  4714. DateTime datetimeend = Convert.ToDateTime(dateend);
  4715. datetimebegin = datetimebegin.Date;
  4716. datetimeend = datetimeend.Date.AddDays(1).AddSeconds(-1);
  4717. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4718. () => PDAModuleLogic.GetPDARPT000002Data(sUserInfo, rptSProcedureID, workcode, datetimebegin, datetimeend));
  4719. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4720. {
  4721. actionResult.Status = (int)Constant.PDAResult.Fail;
  4722. actionResult.Message = Messages.MSG_CMN_I002;
  4723. }
  4724. else
  4725. {
  4726. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4727. actionResult.Status = (int)Constant.PDAResult.Success;
  4728. }
  4729. }
  4730. catch (Exception ex)
  4731. {
  4732. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4733. OutputLog.TraceLog(LogPriority.Error,
  4734. this.ToString(),
  4735. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4736. ex.ToString(),
  4737. LocalPath.LogExePath);
  4738. actionResult.Status = (int)Constant.PDAResult.Exception;
  4739. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4740. }
  4741. return actionResult;
  4742. }
  4743. /// <summary>
  4744. /// 损坯数据统计表
  4745. /// </summary>
  4746. /// <param name="accountCode"></param>
  4747. /// <param name="userCode"></param>
  4748. /// <param name="userPassword"></param>
  4749. /// <param name="sessionKey"></param>
  4750. /// <param name="se"></param>
  4751. /// <returns></returns>
  4752. public ActionResult GetPDARPT000003Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4753. string workcode, string datebegin, string dateend)
  4754. {
  4755. ActionResult actionResult = new ActionResult();
  4756. try
  4757. {
  4758. // 验证请求头信息
  4759. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4760. // 验证失败
  4761. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4762. {
  4763. return actionResult;
  4764. }
  4765. DateTime datetimebegin = Convert.ToDateTime(datebegin);
  4766. DateTime datetimeend = Convert.ToDateTime(dateend);
  4767. datetimebegin = datetimebegin.Date;
  4768. datetimeend = datetimeend.Date.AddDays(1).AddSeconds(-1);
  4769. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4770. () => PDAModuleLogic.GetPDARPT000003Data(sUserInfo, workcode, datetimebegin, datetimeend));
  4771. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4772. {
  4773. actionResult.Status = (int)Constant.PDAResult.Fail;
  4774. actionResult.Message = Messages.MSG_CMN_I002;
  4775. }
  4776. else
  4777. {
  4778. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4779. actionResult.Status = (int)Constant.PDAResult.Success;
  4780. }
  4781. }
  4782. catch (Exception ex)
  4783. {
  4784. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4785. OutputLog.TraceLog(LogPriority.Error,
  4786. this.ToString(),
  4787. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4788. ex.ToString(),
  4789. LocalPath.LogExePath);
  4790. actionResult.Status = (int)Constant.PDAResult.Exception;
  4791. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4792. }
  4793. return actionResult;
  4794. }
  4795. #endregion
  4796. /// <summary>
  4797. /// 取得报表数据源数据
  4798. /// </summary>
  4799. /// <param name="accountCode"></param>
  4800. /// <param name="userCode"></param>
  4801. /// <param name="userPassword"></param>
  4802. /// <param name="sessionKey"></param>
  4803. /// <returns></returns>
  4804. public ActionResult GetRptProcedureModule(string accountCode, string userCode, string userPassword, string sessionKey)
  4805. {
  4806. ActionResult actionResult = new ActionResult();
  4807. try
  4808. {
  4809. // 验证请求头信息
  4810. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4811. // 验证失败
  4812. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4813. {
  4814. return actionResult;
  4815. }
  4816. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4817. () => ReportModuleLogic.GetRptProcedureModule(sUserInfo));
  4818. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4819. {
  4820. actionResult.Status = (int)Constant.PDAResult.Fail;
  4821. actionResult.Message = Messages.MSG_CMN_I002;
  4822. }
  4823. else
  4824. {
  4825. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4826. actionResult.Status = (int)Constant.PDAResult.Success;
  4827. }
  4828. }
  4829. catch (Exception ex)
  4830. {
  4831. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4832. OutputLog.TraceLog(LogPriority.Error,
  4833. this.ToString(),
  4834. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4835. ex.ToString(),
  4836. LocalPath.LogExePath);
  4837. actionResult.Status = (int)Constant.PDAResult.Exception;
  4838. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4839. }
  4840. return actionResult;
  4841. }
  4842. /// <summary>
  4843. /// 取得报表的查询数据源统计工序数据
  4844. /// </summary>
  4845. /// <param name="accountCode"></param>
  4846. /// <param name="userCode"></param>
  4847. /// <param name="userPassword"></param>
  4848. /// <param name="sessionKey"></param>
  4849. /// <param name="RptProcedureID"></param>
  4850. /// <returns></returns>
  4851. public ActionResult GetRptSourceProcedureModule(string accountCode, string userCode, string userPassword, string sessionKey, int? RptProcedureID)
  4852. {
  4853. ActionResult actionResult = new ActionResult();
  4854. try
  4855. {
  4856. // 验证请求头信息
  4857. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4858. // 验证失败
  4859. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4860. {
  4861. return actionResult;
  4862. }
  4863. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4864. () => ReportModuleLogic.GetRptSourceProcedureModule(sUserInfo, RptProcedureID));
  4865. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4866. {
  4867. actionResult.Status = (int)Constant.PDAResult.Fail;
  4868. actionResult.Message = Messages.MSG_CMN_I002;
  4869. }
  4870. else
  4871. {
  4872. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4873. actionResult.Status = (int)Constant.PDAResult.Success;
  4874. }
  4875. }
  4876. catch (Exception ex)
  4877. {
  4878. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4879. OutputLog.TraceLog(LogPriority.Error,
  4880. this.ToString(),
  4881. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4882. ex.ToString(),
  4883. LocalPath.LogExePath);
  4884. actionResult.Status = (int)Constant.PDAResult.Exception;
  4885. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4886. }
  4887. return actionResult;
  4888. }
  4889. /// <summary>
  4890. /// 获取用户是否有统计产成品权限
  4891. /// </summary>
  4892. /// <param name="accountCode"></param>
  4893. /// <param name="userCode"></param>
  4894. /// <param name="userPassword"></param>
  4895. /// <param name="sessionKey"></param>
  4896. /// <returns></returns>
  4897. public ActionResult GetStatisticsFinishedProductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  4898. {
  4899. ActionResult actionResult = new ActionResult();
  4900. try
  4901. {
  4902. // 验证请求头信息
  4903. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4904. // 验证失败
  4905. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4906. {
  4907. return actionResult;
  4908. }
  4909. int returnValue = ServiceInvoker.Invoke<int>(this,
  4910. () => PDAModuleLogic.GetStatisticsFinishedProductFuntion(sUserInfo));
  4911. actionResult.Result = JsonHelper.ToJson(returnValue);
  4912. actionResult.Status = (int)Constant.PDAResult.Success;
  4913. }
  4914. catch (Exception ex)
  4915. {
  4916. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4917. OutputLog.TraceLog(LogPriority.Error,
  4918. this.ToString(),
  4919. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4920. ex.ToString(),
  4921. LocalPath.LogExePath);
  4922. actionResult.Status = (int)Constant.PDAResult.Exception;
  4923. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4924. }
  4925. return actionResult;
  4926. }
  4927. /// <summary>
  4928. /// 获取用户是否有盘点权限
  4929. /// </summary>
  4930. /// <param name="accountCode"></param>
  4931. /// <param name="userCode"></param>
  4932. /// <param name="userPassword"></param>
  4933. /// <param name="sessionKey"></param>
  4934. /// <returns></returns>
  4935. public ActionResult GetInCheckedFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  4936. {
  4937. ActionResult actionResult = new ActionResult();
  4938. try
  4939. {
  4940. // 验证请求头信息
  4941. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4942. // 验证失败
  4943. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4944. {
  4945. return actionResult;
  4946. }
  4947. int returnValue = ServiceInvoker.Invoke<int>(this,
  4948. () => PDAModuleLogic.GetInCheckedFuntion(sUserInfo));
  4949. actionResult.Result = JsonHelper.ToJson(returnValue);
  4950. actionResult.Status = (int)Constant.PDAResult.Success;
  4951. }
  4952. catch (Exception ex)
  4953. {
  4954. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4955. OutputLog.TraceLog(LogPriority.Error,
  4956. this.ToString(),
  4957. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4958. ex.ToString(),
  4959. LocalPath.LogExePath);
  4960. actionResult.Status = (int)Constant.PDAResult.Exception;
  4961. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4962. }
  4963. return actionResult;
  4964. }
  4965. /// <summary>
  4966. /// 根据条件查询是否存在班次配置
  4967. /// </summary>
  4968. /// <param name="accountCode"></param>
  4969. /// <param name="userCode"></param>
  4970. /// <param name="userPassword"></param>
  4971. /// <param name="sessionKey"></param>
  4972. /// <param name="userCode">工号编码</param>
  4973. /// <returns></returns>
  4974. public ActionResult GetClassesSetting(string accountCode, string userCode, string userPassword, string sessionKey, string uCode)
  4975. {
  4976. ActionResult actionResult = new ActionResult();
  4977. try
  4978. {
  4979. // 验证请求头信息
  4980. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4981. // 验证失败
  4982. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4983. {
  4984. return actionResult;
  4985. }
  4986. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4987. () => PDAModuleLogic.GetClassesSetting(uCode, sUserInfo));
  4988. actionResult.Result = JsonHelper.ToJson(ds);
  4989. actionResult.Status = (int)Constant.PDAResult.Success;
  4990. }
  4991. catch (Exception ex)
  4992. {
  4993. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4994. OutputLog.TraceLog(LogPriority.Error,
  4995. this.ToString(),
  4996. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4997. ex.ToString(),
  4998. LocalPath.LogExePath);
  4999. actionResult.Status = (int)Constant.PDAResult.Exception;
  5000. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5001. }
  5002. return actionResult;
  5003. }
  5004. /// <summary>
  5005. /// 报损工序查出工号根据生产数据ID
  5006. /// </summary>
  5007. /// <param name="accountCode"></param>
  5008. /// <param name="userCode"></param>
  5009. /// <param name="userPassword"></param>
  5010. /// <param name="sessionKey"></param>
  5011. /// <param name="ProductionDataID">生产数据ID</param>
  5012. /// <returns></returns>
  5013. public ActionResult GetScrapProductUserCodeByProductionDataID(string accountCode, string userCode, string userPassword, string sessionKey, int ProductionDataID)
  5014. {
  5015. ActionResult actionResult = new ActionResult();
  5016. try
  5017. {
  5018. // 验证请求头信息
  5019. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5020. // 验证失败
  5021. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5022. {
  5023. return actionResult;
  5024. }
  5025. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  5026. () => PMModuleLogic.GetScrapProductUserCodeByProductionDataID(ProductionDataID));
  5027. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  5028. {
  5029. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  5030. actionResult.Status = (int)Constant.PDAResult.Success;
  5031. }
  5032. else
  5033. {
  5034. actionResult.Status = (int)Constant.PDAResult.Fail;
  5035. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5036. }
  5037. }
  5038. catch (Exception ex)
  5039. {
  5040. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5041. OutputLog.TraceLog(LogPriority.Error,
  5042. this.ToString(),
  5043. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5044. ex.ToString(),
  5045. LocalPath.LogExePath);
  5046. actionResult.Status = (int)Constant.PDAResult.Exception;
  5047. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5048. }
  5049. return actionResult;
  5050. }
  5051. /// <summary>
  5052. /// 在入窑工序检验窑车号是否存在
  5053. /// </summary>
  5054. /// <param name="accountCode"></param>
  5055. /// <param name="userCode"></param>
  5056. /// <param name="userPassword"></param>
  5057. /// <param name="sessionKey"></param>
  5058. /// <param name="kilncarcode">窑车编码</param>
  5059. /// <param name="procedureid">工序ID</param>
  5060. /// <returns></returns>
  5061. public ActionResult CheckKilnCarByIntoCar2(string accountCode, string userCode, string userPassword, string sessionKey, string kilncarcode, int procedureid)
  5062. {
  5063. ActionResult actionResult = new ActionResult();
  5064. try
  5065. {
  5066. // 验证请求头信息
  5067. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5068. // 验证失败
  5069. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5070. {
  5071. return actionResult;
  5072. }
  5073. int returnValue = ServiceInvoker.Invoke<int>(this,
  5074. () => PMModuleLogicDAL.CheckKilnCarByIntoCar2(kilncarcode, procedureid, sUserInfo));
  5075. if (returnValue == 1)
  5076. {
  5077. actionResult.Result = JsonHelper.ToJson(returnValue);
  5078. actionResult.Status = (int)Constant.PDAResult.Success;
  5079. }
  5080. else
  5081. {
  5082. actionResult.Status = (int)Constant.PDAResult.Fail;
  5083. if (returnValue == -99)
  5084. actionResult.Message = "窑炉车号无效";
  5085. else if (returnValue == -98)
  5086. actionResult.Message = "窑车己无产品";
  5087. else if (returnValue == -97)
  5088. actionResult.Message = "窑车没有入窑,不可以撤销";
  5089. else if (returnValue == -1)
  5090. actionResult.Message = "保存失败";
  5091. }
  5092. }
  5093. catch (Exception ex)
  5094. {
  5095. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5096. OutputLog.TraceLog(LogPriority.Error,
  5097. this.ToString(),
  5098. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5099. ex.ToString(),
  5100. LocalPath.LogExePath);
  5101. actionResult.Status = (int)Constant.PDAResult.Exception;
  5102. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5103. }
  5104. return actionResult;
  5105. }
  5106. /// <summary>
  5107. /// 撤销包装
  5108. /// </summary>
  5109. /// <param name="accountCode"></param>
  5110. /// <param name="userCode"></param>
  5111. /// <param name="userPassword"></param>
  5112. /// <param name="sessionKey"></param>
  5113. /// <param name="barcode"></param>
  5114. /// <returns></returns>
  5115. public ActionResult AddChancelFinishedproduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5116. {
  5117. ActionResult actionResult = new ActionResult();
  5118. try
  5119. {
  5120. // 验证请求头信息
  5121. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5122. // 验证失败
  5123. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5124. {
  5125. return actionResult;
  5126. }
  5127. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5128. () => PMModuleLogicDAL.AddChancelFinishedproduct(barcode, sUserInfo));
  5129. if (Convert.ToInt32(returnValue.Result) > 0)
  5130. {
  5131. actionResult.Result = JsonHelper.ToJson(returnValue);
  5132. actionResult.Status = (int)Constant.PDAResult.Success;
  5133. }
  5134. else
  5135. {
  5136. actionResult.Status = (int)Constant.PDAResult.Fail;
  5137. if (Convert.ToInt32(returnValue.Result) == -1)
  5138. actionResult.Message = "产品条码不存在包装记录";
  5139. else if (Convert.ToInt32(returnValue.Result) == -200)
  5140. actionResult.Message = returnValue.Message;
  5141. else
  5142. actionResult.Message = "成品撤销失败";
  5143. }
  5144. }
  5145. catch (Exception ex)
  5146. {
  5147. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5148. OutputLog.TraceLog(LogPriority.Error,
  5149. this.ToString(),
  5150. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5151. ex.ToString(),
  5152. LocalPath.LogExePath);
  5153. actionResult.Status = (int)Constant.PDAResult.Exception;
  5154. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5155. }
  5156. return actionResult;
  5157. }
  5158. /*
  5159. /// <summary>
  5160. /// 获取用户是否有撤销包装权限
  5161. /// </summary>
  5162. /// <param name="accountCode"></param>
  5163. /// <param name="userCode"></param>
  5164. /// <param name="userPassword"></param>
  5165. /// <param name="sessionKey"></param>
  5166. /// <returns></returns>
  5167. public ActionResult GetChancelFinishedproductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5168. {
  5169. ActionResult actionResult = new ActionResult();
  5170. try
  5171. {
  5172. // 验证请求头信息
  5173. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5174. // 验证失败
  5175. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5176. {
  5177. return actionResult;
  5178. }
  5179. int returnValue = ServiceInvoker.Invoke<int>(this,
  5180. () => PDAModuleLogic.GetChancelFinishedproductFuntion(sUserInfo));
  5181. actionResult.Result = JsonHelper.ToJson(returnValue);
  5182. actionResult.Status = (int)Constant.PDAResult.Success;
  5183. }
  5184. catch (Exception ex)
  5185. {
  5186. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5187. OutputLog.TraceLog(LogPriority.Error,
  5188. this.ToString(),
  5189. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5190. ex.ToString(),
  5191. LocalPath.LogExePath);
  5192. actionResult.Status = (int)Constant.PDAResult.Exception;
  5193. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5194. }
  5195. return actionResult;
  5196. }
  5197. */
  5198. /// <summary>
  5199. /// 窑车状态明细表查询
  5200. /// </summary>
  5201. /// <param name="accountCode"></param>
  5202. /// <param name="userCode"></param>
  5203. /// <param name="userPassword"></param>
  5204. /// <param name="sessionKey"></param>
  5205. /// <param name="kilnCarCode"></param>
  5206. /// <returns></returns>
  5207. public ActionResult GetKilnCarStatusDetailByCode(string accountCode, string userCode, string userPassword, string sessionKey, string kilnCarCode)
  5208. {
  5209. ActionResult actionResult = new ActionResult();
  5210. try
  5211. {
  5212. // 验证请求头信息
  5213. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5214. // 验证失败
  5215. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5216. {
  5217. return actionResult;
  5218. }
  5219. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5220. () => ReportModuleLogic.GetKilnCarStatusDetailByCode(kilnCarCode, sUserInfo));
  5221. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  5222. {
  5223. actionResult.Status = (int)Constant.PDAResult.Fail;
  5224. actionResult.Message = Messages.MSG_CMN_I002;
  5225. }
  5226. else
  5227. {
  5228. actionResult.Result = JsonHelper.ToJson(sre.Data);
  5229. actionResult.Status = (int)Constant.PDAResult.Success;
  5230. }
  5231. }
  5232. catch (Exception ex)
  5233. {
  5234. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5235. OutputLog.TraceLog(LogPriority.Error,
  5236. this.ToString(),
  5237. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5238. ex.ToString(),
  5239. LocalPath.LogExePath);
  5240. actionResult.Status = (int)Constant.PDAResult.Exception;
  5241. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5242. }
  5243. return actionResult;
  5244. }
  5245. /// <summary>
  5246. /// 损坯撤销
  5247. /// </summary>
  5248. /// <param name="accountCode"></param>
  5249. /// <param name="userCode"></param>
  5250. /// <param name="userPassword"></param>
  5251. /// <param name="sessionKey"></param>
  5252. /// <param name="barcode"></param>
  5253. /// <returns></returns>
  5254. public ActionResult AddCancelScrapProduction(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5255. {
  5256. ActionResult actionResult = new ActionResult();
  5257. try
  5258. {
  5259. // 验证请求头信息
  5260. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5261. // 验证失败
  5262. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5263. {
  5264. return actionResult;
  5265. }
  5266. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5267. () => PMModuleLogicDAL.AddCancelScrapProduction(barcode, sUserInfo));
  5268. if (Convert.ToInt32(returnValue.Result) > 0)
  5269. {
  5270. actionResult.Result = JsonHelper.ToJson(returnValue);
  5271. actionResult.Status = (int)Constant.PDAResult.Success;
  5272. }
  5273. else
  5274. {
  5275. actionResult.Status = (int)Constant.PDAResult.Fail;
  5276. if (Convert.ToInt32(returnValue.Result) == -1)
  5277. actionResult.Message = "此产品没有损坯,不能撤销";
  5278. else if (Convert.ToInt32(returnValue.Result) == -200)
  5279. actionResult.Message = returnValue.Message;
  5280. else
  5281. actionResult.Message = "损坯撤销失败";
  5282. }
  5283. }
  5284. catch (Exception ex)
  5285. {
  5286. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5287. OutputLog.TraceLog(LogPriority.Error,
  5288. this.ToString(),
  5289. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5290. ex.ToString(),
  5291. LocalPath.LogExePath);
  5292. actionResult.Status = (int)Constant.PDAResult.Exception;
  5293. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5294. }
  5295. return actionResult;
  5296. }
  5297. /*
  5298. /// <summary>
  5299. /// 获取用户是否有损坯撤销权限
  5300. /// </summary>
  5301. /// <param name="accountCode"></param>
  5302. /// <param name="userCode"></param>
  5303. /// <param name="userPassword"></param>
  5304. /// <param name="sessionKey"></param>
  5305. /// <returns></returns>
  5306. public ActionResult GetCancelScrapProductionFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5307. {
  5308. ActionResult actionResult = new ActionResult();
  5309. try
  5310. {
  5311. // 验证请求头信息
  5312. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5313. // 验证失败
  5314. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5315. {
  5316. return actionResult;
  5317. }
  5318. int returnValue = ServiceInvoker.Invoke<int>(this,
  5319. () => PDAModuleLogic.GetCancelScrapProductionFuntion(sUserInfo));
  5320. actionResult.Result = JsonHelper.ToJson(returnValue);
  5321. actionResult.Status = (int)Constant.PDAResult.Success;
  5322. }
  5323. catch (Exception ex)
  5324. {
  5325. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5326. OutputLog.TraceLog(LogPriority.Error,
  5327. this.ToString(),
  5328. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5329. ex.ToString(),
  5330. LocalPath.LogExePath);
  5331. actionResult.Status = (int)Constant.PDAResult.Exception;
  5332. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5333. }
  5334. return actionResult;
  5335. }
  5336. */
  5337. /// <summary>
  5338. /// 获取条码注浆信息
  5339. /// </summary>
  5340. /// <param name="accountCode"></param>
  5341. /// <param name="userCode"></param>
  5342. /// <param name="userPassword"></param>
  5343. /// <param name="sessionKey"></param>
  5344. /// <returns></returns>
  5345. public ActionResult GetGroutingInfoBybarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5346. {
  5347. ActionResult actionResult = new ActionResult();
  5348. try
  5349. {
  5350. // 验证请求头信息
  5351. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5352. // 验证失败
  5353. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5354. {
  5355. return actionResult;
  5356. }
  5357. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  5358. () => PMModuleLogic.GetGroutingInfoBybarcode(barcode, sUserInfo));
  5359. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  5360. {
  5361. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  5362. actionResult.Status = (int)Constant.PDAResult.Success;
  5363. }
  5364. else
  5365. {
  5366. actionResult.Status = (int)Constant.PDAResult.Fail;
  5367. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5368. }
  5369. }
  5370. catch (Exception ex)
  5371. {
  5372. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5373. OutputLog.TraceLog(LogPriority.Error,
  5374. this.ToString(),
  5375. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5376. ex.ToString(),
  5377. LocalPath.LogExePath);
  5378. actionResult.Status = (int)Constant.PDAResult.Exception;
  5379. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5380. }
  5381. return actionResult;
  5382. }
  5383. /// <summary>
  5384. /// 获取条码注浆信息
  5385. /// </summary>
  5386. /// <param name="accountCode"></param>
  5387. /// <param name="userCode"></param>
  5388. /// <param name="userPassword"></param>
  5389. /// <param name="sessionKey"></param>
  5390. /// <returns></returns>
  5391. public ActionResult GetFinishedProductGroutingInfoBybarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5392. {
  5393. ActionResult actionResult = new ActionResult();
  5394. try
  5395. {
  5396. // 验证请求头信息
  5397. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5398. // 验证失败
  5399. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5400. {
  5401. return actionResult;
  5402. }
  5403. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  5404. () => PMModuleLogic.GetFinishedProductGroutingInfoBybarcode(barcode, sUserInfo));
  5405. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  5406. {
  5407. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  5408. actionResult.Status = (int)Constant.PDAResult.Success;
  5409. }
  5410. else
  5411. {
  5412. actionResult.Status = (int)Constant.PDAResult.Fail;
  5413. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5414. }
  5415. }
  5416. catch (Exception ex)
  5417. {
  5418. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5419. OutputLog.TraceLog(LogPriority.Error,
  5420. this.ToString(),
  5421. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5422. ex.ToString(),
  5423. LocalPath.LogExePath);
  5424. actionResult.Status = (int)Constant.PDAResult.Exception;
  5425. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5426. }
  5427. return actionResult;
  5428. }
  5429. /// <summary>
  5430. /// 公坯设定
  5431. /// </summary>
  5432. /// <param name="accountCode"></param>
  5433. /// <param name="userCode"></param>
  5434. /// <param name="userPassword"></param>
  5435. /// <param name="sessionKey"></param>
  5436. /// <param name="barcode"></param>
  5437. /// <returns></returns>
  5438. public ActionResult AddPublicBodyProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5439. {
  5440. ActionResult actionResult = new ActionResult();
  5441. try
  5442. {
  5443. // 验证请求头信息
  5444. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5445. // 验证失败
  5446. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5447. {
  5448. return actionResult;
  5449. }
  5450. int returnValue = ServiceInvoker.Invoke<int>(this,
  5451. () => PMModuleLogicDAL.AddPublicBodyProduct(barcode, sUserInfo));
  5452. if (returnValue > 0)
  5453. {
  5454. actionResult.Result = JsonHelper.ToJson(returnValue);
  5455. actionResult.Status = (int)Constant.PDAResult.Success;
  5456. }
  5457. else
  5458. {
  5459. actionResult.Status = (int)Constant.PDAResult.Fail;
  5460. if (returnValue == -1)
  5461. actionResult.Message = "此产品不在生产线上";
  5462. else if (returnValue == -2)
  5463. actionResult.Message = "该产品已经标识为公坯";
  5464. else
  5465. actionResult.Message = "公坯设定失败";
  5466. }
  5467. }
  5468. catch (Exception ex)
  5469. {
  5470. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5471. OutputLog.TraceLog(LogPriority.Error,
  5472. this.ToString(),
  5473. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5474. ex.ToString(),
  5475. LocalPath.LogExePath);
  5476. actionResult.Status = (int)Constant.PDAResult.Exception;
  5477. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5478. }
  5479. return actionResult;
  5480. }
  5481. /*
  5482. /// <summary>
  5483. /// 获取用户是否有公坯设定
  5484. /// </summary>
  5485. /// <param name="accountCode"></param>
  5486. /// <param name="userCode"></param>
  5487. /// <param name="userPassword"></param>
  5488. /// <param name="sessionKey"></param>
  5489. /// <returns></returns>
  5490. public ActionResult GetPublicBodyProductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5491. {
  5492. ActionResult actionResult = new ActionResult();
  5493. try
  5494. {
  5495. // 验证请求头信息
  5496. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5497. // 验证失败
  5498. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5499. {
  5500. return actionResult;
  5501. }
  5502. int returnValue = ServiceInvoker.Invoke<int>(this,
  5503. () => PDAModuleLogic.GetPublicBodyProductFuntion(sUserInfo));
  5504. actionResult.Result = JsonHelper.ToJson(returnValue);
  5505. actionResult.Status = (int)Constant.PDAResult.Success;
  5506. }
  5507. catch (Exception ex)
  5508. {
  5509. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5510. OutputLog.TraceLog(LogPriority.Error,
  5511. this.ToString(),
  5512. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5513. ex.ToString(),
  5514. LocalPath.LogExePath);
  5515. actionResult.Status = (int)Constant.PDAResult.Exception;
  5516. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5517. }
  5518. return actionResult;
  5519. }
  5520. */
  5521. /// <summary>
  5522. /// 校验产品条码是否可以走到该工序
  5523. /// </summary>
  5524. /// <param name="accountCode">帐套code</param>
  5525. /// <param name="userCode">用户code</param>
  5526. /// <param name="userPassword">用户密码</param>
  5527. /// <param name="sessionKey">本次登陆密钥</param>
  5528. /// <param name="procedureID">工序ID</param>
  5529. /// <param name="barcode">条码</param>
  5530. /// <returns></returns>
  5531. /// <remarks>
  5532. /// 陈冰 2014.09.18 新建
  5533. /// </remarks>
  5534. public ActionResult CheckBarcodeDeliverMud(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  5535. {
  5536. ActionResult actionResult = new ActionResult();
  5537. try
  5538. {
  5539. // 验证请求头信息
  5540. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5541. // 验证失败
  5542. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5543. {
  5544. return actionResult;
  5545. }
  5546. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  5547. () => PMModuleLogic.CheckBarcodeDeliverMud(procedureID, barcode, sUserInfo));
  5548. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  5549. {
  5550. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  5551. actionResult.Status = (int)Constant.PDAResult.Success;
  5552. }
  5553. else
  5554. {
  5555. actionResult.Status = (int)Constant.PDAResult.Fail;
  5556. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5557. }
  5558. }
  5559. catch (Exception ex)
  5560. {
  5561. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5562. OutputLog.TraceLog(LogPriority.Error,
  5563. this.ToString(),
  5564. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5565. ex.ToString(),
  5566. LocalPath.LogExePath);
  5567. actionResult.Status = (int)Constant.PDAResult.Exception;
  5568. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5569. }
  5570. return actionResult;
  5571. }
  5572. /// <summary>
  5573. /// 获取用户所有菜单权限
  5574. /// </summary>
  5575. /// <param name="accountCode"></param>
  5576. /// <param name="userCode"></param>
  5577. /// <param name="userPassword"></param>
  5578. /// <param name="sessionKey"></param>
  5579. /// <returns></returns>
  5580. public ActionResult GetUserAllFunction(string accountCode, string userCode, string userPassword, string sessionKey)
  5581. {
  5582. ActionResult actionResult = new ActionResult();
  5583. try
  5584. {
  5585. // 验证请求头信息
  5586. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5587. // 验证失败
  5588. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5589. {
  5590. return actionResult;
  5591. }
  5592. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  5593. () => PDAModuleLogic.GetUserAllFunction(sUserInfo));
  5594. actionResult.Result = JsonHelper.ToJson(returnValue);
  5595. actionResult.Status = (int)Constant.PDAResult.Success;
  5596. }
  5597. catch (Exception ex)
  5598. {
  5599. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5600. OutputLog.TraceLog(LogPriority.Error,
  5601. this.ToString(),
  5602. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5603. ex.ToString(),
  5604. LocalPath.LogExePath);
  5605. actionResult.Status = (int)Constant.PDAResult.Exception;
  5606. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5607. }
  5608. return actionResult;
  5609. }
  5610. public ActionResult AddChancelBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5611. {
  5612. ActionResult actionResult = new ActionResult();
  5613. try
  5614. {
  5615. // 验证请求头信息
  5616. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5617. // 验证失败
  5618. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5619. {
  5620. return actionResult;
  5621. }
  5622. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5623. () => PMModuleLogicDAL.AddChancelBarCode(barcode, sUserInfo));
  5624. if (Convert.ToInt32(returnValue.Result) > 0)
  5625. {
  5626. actionResult.Result = JsonHelper.ToJson(returnValue);
  5627. actionResult.Status = (int)Constant.PDAResult.Success;
  5628. }
  5629. else
  5630. {
  5631. actionResult.Status = (int)Constant.PDAResult.Fail;
  5632. if (Convert.ToInt32(returnValue.Result) == -1)
  5633. actionResult.Message = "无效条码";
  5634. else if (Convert.ToInt32(returnValue.Result) == -2)
  5635. actionResult.Message = "已经生产完成";
  5636. else if (Convert.ToInt32(returnValue.Result) == -3)
  5637. actionResult.Message = "条码已经申请报废";
  5638. else if (Convert.ToInt32(returnValue.Result) == -4)
  5639. actionResult.Message = "此条码当前工序不允许进行撤销";
  5640. else if (Convert.ToInt32(returnValue.Result) == -5)
  5641. actionResult.Message = "此条码没有生产数据";
  5642. else if (Convert.ToInt32(returnValue.Result) == -6)
  5643. actionResult.Message = "没有当前工序权限";
  5644. else if (Convert.ToInt32(returnValue.Result) == -7)
  5645. actionResult.Message = "条码不在生产线上";
  5646. else if (Convert.ToInt32(returnValue.Result) == -8)
  5647. actionResult.Message = "操作用户无此工序的撤销范围权限";
  5648. else if (Convert.ToInt32(returnValue.Result) == -9)
  5649. actionResult.Message = "条码已经是返工状态";
  5650. else if (Convert.ToInt32(returnValue.Result) == -200)
  5651. actionResult.Message = returnValue.Message;
  5652. }
  5653. }
  5654. catch (Exception ex)
  5655. {
  5656. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5657. OutputLog.TraceLog(LogPriority.Error,
  5658. this.ToString(),
  5659. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5660. ex.ToString(),
  5661. LocalPath.LogExePath);
  5662. actionResult.Status = (int)Constant.PDAResult.Exception;
  5663. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5664. }
  5665. return actionResult;
  5666. }
  5667. public ActionResult AddChancelDeliverMudBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5668. {
  5669. ActionResult actionResult = new ActionResult();
  5670. try
  5671. {
  5672. // 验证请求头信息
  5673. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5674. // 验证失败
  5675. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5676. {
  5677. return actionResult;
  5678. }
  5679. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5680. () => PMModuleLogicDAL.AddChancelDeliverMudBarCode(barcode, sUserInfo));
  5681. if (Convert.ToInt32(returnValue.Result) > 0)
  5682. {
  5683. actionResult.Result = JsonHelper.ToJson(returnValue);
  5684. actionResult.Status = (int)Constant.PDAResult.Success;
  5685. }
  5686. else
  5687. {
  5688. actionResult.Status = (int)Constant.PDAResult.Fail;
  5689. if (Convert.ToInt32(returnValue.Result) == -1)
  5690. actionResult.Message = "无效条码";
  5691. else if (Convert.ToInt32(returnValue.Result) == -2)
  5692. actionResult.Message = "已经生产完成";
  5693. else if (Convert.ToInt32(returnValue.Result) == -3)
  5694. actionResult.Message = "条码已经申请报废";
  5695. else if (Convert.ToInt32(returnValue.Result) == -4)
  5696. actionResult.Message = "此条码当前工序不允许进行撤销";
  5697. else if (Convert.ToInt32(returnValue.Result) == -5)
  5698. actionResult.Message = "此条码没有生产数据";
  5699. else if (Convert.ToInt32(returnValue.Result) == -55)
  5700. actionResult.Message = "条码已经不在交坯工序,不允许撤销";
  5701. else if (Convert.ToInt32(returnValue.Result) == -6)
  5702. actionResult.Message = "没有任何影响行";
  5703. else if (Convert.ToInt32(returnValue.Result) == -7)
  5704. actionResult.Message = "条码不在生产线上";
  5705. else if (Convert.ToInt32(returnValue.Result) == -8)
  5706. actionResult.Message = "条码已经是返工状态";
  5707. else if (Convert.ToInt32(returnValue.Result) == -200)
  5708. actionResult.Message = returnValue.Message;
  5709. }
  5710. }
  5711. catch (Exception ex)
  5712. {
  5713. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5714. OutputLog.TraceLog(LogPriority.Error,
  5715. this.ToString(),
  5716. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5717. ex.ToString(),
  5718. LocalPath.LogExePath);
  5719. actionResult.Status = (int)Constant.PDAResult.Exception;
  5720. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5721. }
  5722. return actionResult;
  5723. }
  5724. public ActionResult GetAllLogoInfo(string accountCode, string userCode, string userPassword, string sessionKey)
  5725. {
  5726. ActionResult actionResult = new ActionResult();
  5727. try
  5728. {
  5729. // 验证请求头信息
  5730. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5731. // 验证失败
  5732. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5733. {
  5734. return actionResult;
  5735. }
  5736. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  5737. //() => SystemModuleLogic.GetAllLogoInfo(sUserInfo));
  5738. () => SystemModuleLogic.GetLogoInfo(sUserInfo));
  5739. if (returnValue != null && returnValue.Tables[0].Rows.Count > 0)
  5740. {
  5741. //DataView dv = returnValue.Tables[0].DefaultView;
  5742. //dv.RowFilter = "ValueFlag=1";
  5743. //actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  5744. actionResult.Result = JsonHelper.ToJson(returnValue.Tables[0]);
  5745. actionResult.Status = (int)Constant.PDAResult.Success;
  5746. }
  5747. }
  5748. catch (Exception ex)
  5749. {
  5750. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5751. OutputLog.TraceLog(LogPriority.Error,
  5752. this.ToString(),
  5753. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5754. ex.ToString(),
  5755. LocalPath.LogExePath);
  5756. actionResult.Status = (int)Constant.PDAResult.Exception;
  5757. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5758. }
  5759. return actionResult;
  5760. }
  5761. /// <summary>
  5762. /// 变更产品商标用
  5763. /// </summary>
  5764. /// <param name="accountCode"></param>
  5765. /// <param name="userCode"></param>
  5766. /// <param name="userPassword"></param>
  5767. /// <param name="sessionKey"></param>
  5768. /// <param name="goodsid"></param>
  5769. /// <returns></returns>
  5770. public ActionResult GetLogoInfoForChange(string accountCode, string userCode, string userPassword, string sessionKey
  5771. , int goodsid)
  5772. {
  5773. ActionResult actionResult = new ActionResult();
  5774. try
  5775. {
  5776. // 验证请求头信息
  5777. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5778. // 验证失败
  5779. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5780. {
  5781. return actionResult;
  5782. }
  5783. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  5784. //() => SystemModuleLogic.GetAllLogoInfo(sUserInfo));
  5785. //() => SystemModuleLogic.GetLogoInfo(sUserInfo));
  5786. () => SystemModuleLogic.GetLogoInfoForChange(sUserInfo, goodsid));
  5787. if (returnValue != null && returnValue.Tables[0].Rows.Count > 0)
  5788. {
  5789. //DataView dv = returnValue.Tables[0].DefaultView;
  5790. //dv.RowFilter = "ValueFlag=1";
  5791. //actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  5792. actionResult.Result = JsonHelper.ToJson(returnValue.Tables[0]);
  5793. actionResult.Status = (int)Constant.PDAResult.Success;
  5794. }
  5795. }
  5796. catch (Exception ex)
  5797. {
  5798. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5799. OutputLog.TraceLog(LogPriority.Error,
  5800. this.ToString(),
  5801. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5802. ex.ToString(),
  5803. LocalPath.LogExePath);
  5804. actionResult.Status = (int)Constant.PDAResult.Exception;
  5805. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5806. }
  5807. return actionResult;
  5808. }
  5809. public ActionResult GetLogoID(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  5810. {
  5811. ActionResult actionResult = new ActionResult();
  5812. try
  5813. {
  5814. // 验证请求头信息
  5815. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5816. // 验证失败
  5817. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5818. {
  5819. return actionResult;
  5820. }
  5821. int returnValue = ServiceInvoker.Invoke<int>(this,
  5822. () => PMModuleLogic.GetLogoID(procedureID, sUserInfo));
  5823. actionResult.Result = JsonHelper.ToJson(returnValue);
  5824. actionResult.Status = (int)Constant.PDAResult.Success;
  5825. }
  5826. catch (Exception ex)
  5827. {
  5828. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5829. OutputLog.TraceLog(LogPriority.Error,
  5830. this.ToString(),
  5831. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5832. ex.ToString(),
  5833. LocalPath.LogExePath);
  5834. actionResult.Status = (int)Constant.PDAResult.Exception;
  5835. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5836. }
  5837. return actionResult;
  5838. }
  5839. public ActionResult SaveBarCodeLogo(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int logoid)
  5840. {
  5841. ActionResult actionResult = new ActionResult();
  5842. try
  5843. {
  5844. // 验证请求头信息
  5845. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5846. // 验证失败
  5847. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5848. {
  5849. return actionResult;
  5850. }
  5851. int returnValue = ServiceInvoker.Invoke<int>(this,
  5852. () => PMModuleLogicDAL.SaveBarCodeLogo(barcode, logoid, sUserInfo));
  5853. actionResult.Result = JsonHelper.ToJson(returnValue);
  5854. actionResult.Status = (int)Constant.PDAResult.Success;
  5855. }
  5856. catch (Exception ex)
  5857. {
  5858. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5859. OutputLog.TraceLog(LogPriority.Error,
  5860. this.ToString(),
  5861. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5862. ex.ToString(),
  5863. LocalPath.LogExePath);
  5864. actionResult.Status = (int)Constant.PDAResult.Exception;
  5865. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5866. }
  5867. return actionResult;
  5868. }
  5869. public ActionResult SaveBarCodeLogoAndGlazetype(string accountCode, string userCode, string userPassword, string sessionKey,
  5870. string barcode, int logoid, int glazetypeid)
  5871. {
  5872. ActionResult actionResult = new ActionResult();
  5873. try
  5874. {
  5875. // 验证请求头信息
  5876. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5877. // 验证失败
  5878. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5879. {
  5880. return actionResult;
  5881. }
  5882. int returnValue = ServiceInvoker.Invoke<int>(this,
  5883. () => PMModuleLogicDAL.SaveBarCodeLogoAndGlazetype(barcode, logoid, glazetypeid, sUserInfo));
  5884. actionResult.Result = JsonHelper.ToJson(returnValue);
  5885. if (returnValue > 0)
  5886. {
  5887. actionResult.Status = (int)Constant.PDAResult.Success;
  5888. }
  5889. else
  5890. {
  5891. actionResult.Status = (int)Constant.PDAResult.Fail;
  5892. actionResult.Message = "条码不存在";
  5893. }
  5894. }
  5895. catch (Exception ex)
  5896. {
  5897. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5898. OutputLog.TraceLog(LogPriority.Error,
  5899. this.ToString(),
  5900. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5901. ex.ToString(),
  5902. LocalPath.LogExePath);
  5903. actionResult.Status = (int)Constant.PDAResult.Exception;
  5904. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5905. }
  5906. return actionResult;
  5907. }
  5908. public ActionResult SaveBarCodesLogoAndGlazetype(string accountCode, string userCode, string userPassword, string sessionKey,
  5909. string barcodes, int logoid, int glazetypeid, int procedureID)
  5910. {
  5911. ActionResult actionResult = new ActionResult();
  5912. try
  5913. {
  5914. // 验证请求头信息
  5915. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5916. // 验证失败
  5917. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5918. {
  5919. return actionResult;
  5920. }
  5921. int returnValue = ServiceInvoker.Invoke<int>(this,
  5922. () => PMModuleLogicDAL.SaveBarCodesLogoAndGlazetype(barcodes, logoid, glazetypeid, procedureID, sUserInfo));
  5923. actionResult.Result = JsonHelper.ToJson(returnValue);
  5924. if (returnValue > 0)
  5925. {
  5926. actionResult.Status = (int)Constant.PDAResult.Success;
  5927. }
  5928. else
  5929. {
  5930. actionResult.Status = (int)Constant.PDAResult.Fail;
  5931. actionResult.Message = "条码不存在";
  5932. }
  5933. }
  5934. catch (Exception ex)
  5935. {
  5936. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5937. OutputLog.TraceLog(LogPriority.Error,
  5938. this.ToString(),
  5939. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5940. ex.ToString(),
  5941. LocalPath.LogExePath);
  5942. actionResult.Status = (int)Constant.PDAResult.Exception;
  5943. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5944. }
  5945. return actionResult;
  5946. }
  5947. public ActionResult GetBarCodeLogoID(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5948. {
  5949. ActionResult actionResult = new ActionResult();
  5950. try
  5951. {
  5952. // 验证请求头信息
  5953. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5954. // 验证失败
  5955. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5956. {
  5957. return actionResult;
  5958. }
  5959. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  5960. () => PMModuleLogic.GetBarCodeLogoID(barcode, sUserInfo));
  5961. if (returnValue != null && returnValue.Tables[0].Rows.Count > 0)
  5962. {
  5963. actionResult.Result = JsonHelper.ToJson(returnValue.Tables[0]);
  5964. actionResult.Status = (int)Constant.PDAResult.Success;
  5965. }
  5966. }
  5967. catch (Exception ex)
  5968. {
  5969. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5970. OutputLog.TraceLog(LogPriority.Error,
  5971. this.ToString(),
  5972. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5973. ex.ToString(),
  5974. LocalPath.LogExePath);
  5975. actionResult.Status = (int)Constant.PDAResult.Exception;
  5976. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5977. }
  5978. return actionResult;
  5979. }
  5980. /// <summary>
  5981. /// 半检时,入窑前检验获取此条码是否报损为废品
  5982. /// </summary>
  5983. /// <param name="accountCode"></param>
  5984. /// <param name="userCode"></param>
  5985. /// <param name="userPassword"></param>
  5986. /// <param name="sessionKey"></param>
  5987. /// <param name="barcode">产品条码</param>
  5988. /// <returns></returns>
  5989. public ActionResult CheckWasteScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5990. {
  5991. ActionResult actionResult = new ActionResult();
  5992. try
  5993. {
  5994. // 验证请求头信息
  5995. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5996. // 验证失败
  5997. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5998. {
  5999. return actionResult;
  6000. }
  6001. int returnValue = ServiceInvoker.Invoke<int>(this,
  6002. () => PMModuleLogic.CheckWasteScrapProduct(barcode));
  6003. if (returnValue != -100)
  6004. {
  6005. actionResult.Result = JsonHelper.ToJson(returnValue);
  6006. actionResult.Status = (int)Constant.PDAResult.Success;
  6007. }
  6008. else
  6009. {
  6010. actionResult.Status = (int)Constant.PDAResult.Fail;
  6011. actionResult.Message = "条码[" + barcode + "]不是废品,不能进行编辑";
  6012. }
  6013. }
  6014. catch (Exception ex)
  6015. {
  6016. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6017. OutputLog.TraceLog(LogPriority.Error,
  6018. this.ToString(),
  6019. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6020. ex.ToString(),
  6021. LocalPath.LogExePath);
  6022. actionResult.Status = (int)Constant.PDAResult.Exception;
  6023. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6024. }
  6025. return actionResult;
  6026. }
  6027. /// <summary>
  6028. /// 获取登陆帐户有无入窑前检验数据编辑权限
  6029. /// </summary>
  6030. /// <param name="accountCode"></param>
  6031. /// <param name="userCode"></param>
  6032. /// <param name="userPassword"></param>
  6033. /// <param name="sessionKey"></param>
  6034. /// <param name="usercode">工号编码</param>
  6035. /// <returns></returns>
  6036. public ActionResult GetIntoKilnCheckEditFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  6037. {
  6038. ActionResult actionResult = new ActionResult();
  6039. try
  6040. {
  6041. // 验证请求头信息
  6042. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6043. // 验证失败
  6044. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6045. {
  6046. return actionResult;
  6047. }
  6048. int returnValue = ServiceInvoker.Invoke<int>(this,
  6049. () => PDAModuleLogic.GetIntoKilnCheckEditFuntion(sUserInfo));
  6050. actionResult.Result = JsonHelper.ToJson(returnValue);
  6051. actionResult.Status = (int)Constant.PDAResult.Success;
  6052. }
  6053. catch (Exception ex)
  6054. {
  6055. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6056. OutputLog.TraceLog(LogPriority.Error,
  6057. this.ToString(),
  6058. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6059. ex.ToString(),
  6060. LocalPath.LogExePath);
  6061. actionResult.Status = (int)Constant.PDAResult.Exception;
  6062. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6063. }
  6064. return actionResult;
  6065. }
  6066. /// <summary>
  6067. /// 获取登陆帐户有无半检验数据编辑权限
  6068. /// </summary>
  6069. /// <param name="accountCode"></param>
  6070. /// <param name="userCode"></param>
  6071. /// <param name="userPassword"></param>
  6072. /// <param name="sessionKey"></param>
  6073. /// <param name="usercode">工号编码</param>
  6074. /// <returns></returns>
  6075. public ActionResult GetNormalCheckEditFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  6076. {
  6077. ActionResult actionResult = new ActionResult();
  6078. try
  6079. {
  6080. // 验证请求头信息
  6081. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6082. // 验证失败
  6083. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6084. {
  6085. return actionResult;
  6086. }
  6087. int returnValue = ServiceInvoker.Invoke<int>(this,
  6088. () => PDAModuleLogic.GetNormalCheckEditFuntion(sUserInfo));
  6089. actionResult.Result = JsonHelper.ToJson(returnValue);
  6090. actionResult.Status = (int)Constant.PDAResult.Success;
  6091. }
  6092. catch (Exception ex)
  6093. {
  6094. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6095. OutputLog.TraceLog(LogPriority.Error,
  6096. this.ToString(),
  6097. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6098. ex.ToString(),
  6099. LocalPath.LogExePath);
  6100. actionResult.Status = (int)Constant.PDAResult.Exception;
  6101. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6102. }
  6103. return actionResult;
  6104. }
  6105. /// <summary>
  6106. /// 获取缺陷扣罚管理的全部数据
  6107. /// </summary>
  6108. /// <param name="accountCode"></param>
  6109. /// <param name="userCode"></param>
  6110. /// <param name="userPassword"></param>
  6111. /// <param name="sessionKey"></param>
  6112. /// <returns></returns>
  6113. public ActionResult GetAllDefectFine(string accountCode, string userCode, string userPassword, string sessionKey)
  6114. {
  6115. ActionResult actionResult = new ActionResult();
  6116. try
  6117. {
  6118. // 验证请求头信息
  6119. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6120. // 验证失败
  6121. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6122. {
  6123. return actionResult;
  6124. }
  6125. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6126. () => SystemModuleLogic.GetAllDefectFine(sUserInfo));
  6127. if (ds != null && ds.Tables[0].Rows.Count > 0)
  6128. {
  6129. DataView dv = ds.Tables[0].DefaultView;
  6130. dv.RowFilter = "valueflag=1";
  6131. actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  6132. actionResult.Status = (int)Constant.PDAResult.Success;
  6133. }
  6134. else
  6135. {
  6136. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  6137. actionResult.Status = (int)Constant.PDAResult.Success;
  6138. }
  6139. }
  6140. catch (Exception ex)
  6141. {
  6142. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6143. OutputLog.TraceLog(LogPriority.Error,
  6144. this.ToString(),
  6145. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6146. ex.ToString(),
  6147. LocalPath.LogExePath);
  6148. actionResult.Status = (int)Constant.PDAResult.Exception;
  6149. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6150. }
  6151. return actionResult;
  6152. }
  6153. /// <summary>
  6154. /// 获取缺陷扣除数管理的全部数据
  6155. /// </summary>
  6156. /// <param name="accountCode"></param>
  6157. /// <param name="userCode"></param>
  6158. /// <param name="userPassword"></param>
  6159. /// <param name="sessionKey"></param>
  6160. /// <returns></returns>
  6161. public ActionResult GetAllDefectDeduction(string accountCode, string userCode, string userPassword, string sessionKey)
  6162. {
  6163. ActionResult actionResult = new ActionResult();
  6164. try
  6165. {
  6166. // 验证请求头信息
  6167. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6168. // 验证失败
  6169. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6170. {
  6171. return actionResult;
  6172. }
  6173. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6174. () => SystemModuleLogic.GetAllDefectDeduction(sUserInfo));
  6175. if (ds != null && ds.Tables[0].Rows.Count > 0)
  6176. {
  6177. DataView dv = ds.Tables[0].DefaultView;
  6178. dv.RowFilter = "valueflag=1";
  6179. actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  6180. actionResult.Status = (int)Constant.PDAResult.Success;
  6181. }
  6182. else
  6183. {
  6184. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  6185. actionResult.Status = (int)Constant.PDAResult.Success;
  6186. }
  6187. }
  6188. catch (Exception ex)
  6189. {
  6190. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6191. OutputLog.TraceLog(LogPriority.Error,
  6192. this.ToString(),
  6193. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6194. ex.ToString(),
  6195. LocalPath.LogExePath);
  6196. actionResult.Status = (int)Constant.PDAResult.Exception;
  6197. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6198. }
  6199. return actionResult;
  6200. }
  6201. /// <summary>
  6202. /// 获取缺陷扣罚关系管理的全部数据
  6203. /// </summary>
  6204. /// <param name="accountCode"></param>
  6205. /// <param name="userCode"></param>
  6206. /// <param name="userPassword"></param>
  6207. /// <param name="sessionKey"></param>
  6208. /// <returns></returns>
  6209. public ActionResult GetAllDefectFineRelation(string accountCode, string userCode, string userPassword, string sessionKey)
  6210. {
  6211. ActionResult actionResult = new ActionResult();
  6212. try
  6213. {
  6214. // 验证请求头信息
  6215. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6216. // 验证失败
  6217. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6218. {
  6219. return actionResult;
  6220. }
  6221. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6222. () => SystemModuleLogic.GetAllDefectFineRelation(sUserInfo));
  6223. DataTable dt = new DataTable();
  6224. dt.Columns.Add("DefectID");
  6225. dt.Columns.Add("DefectFineID");
  6226. DataView dv = ds.Tables[0].DefaultView;
  6227. DataTable dtFor = dv.ToTable("defectid", true);
  6228. for (int i = 0; i < dtFor.Rows.Count; i++)
  6229. {
  6230. DataRow[] r = ds.Tables[0].Select("defectid=" + dtFor.Rows[i]["defectid"]);
  6231. string substring = "";
  6232. foreach (DataRow r1 in r)
  6233. {
  6234. substring += r1["DefectFineID"].ToString() + "-" + r1["DEFECTFINECODE"].ToString() + ",";
  6235. }
  6236. if (substring != "")
  6237. {
  6238. DataRow drnew = dt.NewRow();
  6239. drnew["DefectID"] = dtFor.Rows[i]["defectid"];
  6240. drnew["DefectFineID"] = substring.TrimEnd(',');
  6241. dt.Rows.Add(drnew);
  6242. }
  6243. }
  6244. actionResult.Result = JsonHelper.ToJson(dt);//ds.Tables[0]
  6245. actionResult.Status = (int)Constant.PDAResult.Success;
  6246. }
  6247. catch (Exception ex)
  6248. {
  6249. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6250. OutputLog.TraceLog(LogPriority.Error,
  6251. this.ToString(),
  6252. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6253. ex.ToString(),
  6254. LocalPath.LogExePath);
  6255. actionResult.Status = (int)Constant.PDAResult.Exception;
  6256. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6257. }
  6258. return actionResult;
  6259. }
  6260. /// <summary>
  6261. /// 获取缺陷扣除数关系管理的全部数据
  6262. /// </summary>
  6263. /// <param name="accountCode"></param>
  6264. /// <param name="userCode"></param>
  6265. /// <param name="userPassword"></param>
  6266. /// <param name="sessionKey"></param>
  6267. /// <returns></returns>
  6268. public ActionResult GetAllDefectDeductionRelation(string accountCode, string userCode, string userPassword, string sessionKey)
  6269. {
  6270. ActionResult actionResult = new ActionResult();
  6271. try
  6272. {
  6273. // 验证请求头信息
  6274. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6275. // 验证失败
  6276. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6277. {
  6278. return actionResult;
  6279. }
  6280. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6281. () => SystemModuleLogic.GetAllDefectDeductionRelation(sUserInfo));
  6282. DataTable dt = new DataTable();
  6283. dt.Columns.Add("DefectID");
  6284. dt.Columns.Add("DefectDeductionNum");
  6285. DataView dv = ds.Tables[0].DefaultView;
  6286. DataTable dtFor = dv.ToTable("defectid", true);
  6287. for (int i = 0; i < dtFor.Rows.Count; i++)
  6288. {
  6289. DataRow[] r = ds.Tables[0].Select("defectid=" + dtFor.Rows[i]["defectid"]);
  6290. string substring = "";
  6291. foreach (DataRow r1 in r)
  6292. {
  6293. substring += r1["DefectDeductionID"].ToString() + "-" + r1["DefectDeductionNum"].ToString() + ",";
  6294. }
  6295. if (substring != "")
  6296. {
  6297. DataRow drnew = dt.NewRow();
  6298. drnew["DefectID"] = dtFor.Rows[i]["defectid"];
  6299. drnew["DefectDeductionNum"] = substring.TrimEnd(',');
  6300. dt.Rows.Add(drnew);
  6301. }
  6302. }
  6303. actionResult.Result = JsonHelper.ToJson(dt);//ds.Tables[0]
  6304. actionResult.Status = (int)Constant.PDAResult.Success;
  6305. }
  6306. catch (Exception ex)
  6307. {
  6308. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6309. OutputLog.TraceLog(LogPriority.Error,
  6310. this.ToString(),
  6311. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6312. ex.ToString(),
  6313. LocalPath.LogExePath);
  6314. actionResult.Status = (int)Constant.PDAResult.Exception;
  6315. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6316. }
  6317. return actionResult;
  6318. }
  6319. /// <summary>
  6320. /// 获取盘点单明细
  6321. /// </summary>
  6322. /// <param name="sUserInfo"></param>
  6323. /// <returns></returns>
  6324. public ActionResult GetUpdateInCheckedInfo(string accountCode, string userCode, string userPassword, string sessionKey, string incheckedno)
  6325. {
  6326. ActionResult actionResult = new ActionResult();
  6327. try
  6328. {
  6329. // 验证请求头信息
  6330. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6331. // 验证失败
  6332. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6333. {
  6334. return actionResult;
  6335. }
  6336. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6337. () => PMModuleLogic.GetUpdateInCheckedInfo(incheckedno, sUserInfo));
  6338. actionResult.Result = JsonHelper.ToJson(ds);
  6339. actionResult.Status = (int)Constant.PDAResult.Success;
  6340. }
  6341. catch (Exception ex)
  6342. {
  6343. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6344. OutputLog.TraceLog(LogPriority.Error,
  6345. this.ToString(),
  6346. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6347. ex.ToString(),
  6348. LocalPath.LogExePath);
  6349. actionResult.Status = (int)Constant.PDAResult.Exception;
  6350. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6351. }
  6352. return actionResult;
  6353. }
  6354. /// <summary>
  6355. /// 半检检验条码
  6356. /// </summary>
  6357. /// <param name="sUserInfo"></param>
  6358. /// <returns></returns>
  6359. public ActionResult SemiCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6360. {
  6361. ActionResult actionResult = new ActionResult();
  6362. try
  6363. {
  6364. // 验证请求头信息
  6365. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6366. // 验证失败
  6367. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6368. {
  6369. return actionResult;
  6370. }
  6371. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6372. () => PMModuleLogic.SemiCheckBarcode(barcode, sUserInfo));
  6373. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6374. if (Convert.ToInt32(resultEntity.Result) < 0)
  6375. {
  6376. actionResult.Status = (int)Constant.PDAResult.Fail;
  6377. }
  6378. else
  6379. {
  6380. actionResult.Status = (int)Constant.PDAResult.Success;
  6381. }
  6382. actionResult.Message = resultEntity.Message;
  6383. }
  6384. catch (Exception ex)
  6385. {
  6386. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6387. OutputLog.TraceLog(LogPriority.Error,
  6388. this.ToString(),
  6389. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6390. ex.ToString(),
  6391. LocalPath.LogExePath);
  6392. actionResult.Status = (int)Constant.PDAResult.Exception;
  6393. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6394. }
  6395. return actionResult;
  6396. }
  6397. /// <summary>
  6398. /// 根据条码获取经过的工序,用于绑定返工工序
  6399. /// </summary>
  6400. /// <param name="sUserInfo"></param>
  6401. /// <returns></returns>
  6402. public ActionResult GetSemiCheckPassProcedure(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6403. {
  6404. ActionResult actionResult = new ActionResult();
  6405. try
  6406. {
  6407. // 验证请求头信息
  6408. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6409. // 验证失败
  6410. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6411. {
  6412. return actionResult;
  6413. }
  6414. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6415. () => PMModuleLogic.GetSemiCheckPassProcedure(barcode));
  6416. actionResult.Result = JsonHelper.ToJson(resultEntity);
  6417. actionResult.Status = (int)Constant.PDAResult.Success;
  6418. }
  6419. catch (Exception ex)
  6420. {
  6421. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6422. OutputLog.TraceLog(LogPriority.Error,
  6423. this.ToString(),
  6424. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6425. ex.ToString(),
  6426. LocalPath.LogExePath);
  6427. actionResult.Status = (int)Constant.PDAResult.Exception;
  6428. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6429. }
  6430. return actionResult;
  6431. }
  6432. /// <summary>
  6433. /// 获取登陆帐户有无半检状态权限
  6434. /// </summary>
  6435. /// <param name="sUserInfo"></param>
  6436. /// <returns></returns>
  6437. public ActionResult GetSemiCheckStatusFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  6438. {
  6439. ActionResult actionResult = new ActionResult();
  6440. try
  6441. {
  6442. // 验证请求头信息
  6443. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6444. // 验证失败
  6445. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6446. {
  6447. return actionResult;
  6448. }
  6449. int resultEntity = ServiceInvoker.Invoke<int>(this,
  6450. () => PMModuleLogic.GetSemiCheckStatusFuntion(sUserInfo));
  6451. actionResult.Result = JsonHelper.ToJson(resultEntity);
  6452. actionResult.Status = (int)Constant.PDAResult.Success;
  6453. }
  6454. catch (Exception ex)
  6455. {
  6456. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6457. OutputLog.TraceLog(LogPriority.Error,
  6458. this.ToString(),
  6459. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6460. ex.ToString(),
  6461. LocalPath.LogExePath);
  6462. actionResult.Status = (int)Constant.PDAResult.Exception;
  6463. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6464. }
  6465. return actionResult;
  6466. }
  6467. /// <summary>
  6468. /// 复检状态数据源
  6469. /// </summary>
  6470. /// <param name="sUserInfo"></param>
  6471. /// <returns></returns>
  6472. public ActionResult GetSemiCheckType(string accountCode, string userCode, string userPassword, string sessionKey)
  6473. {
  6474. ActionResult actionResult = new ActionResult();
  6475. try
  6476. {
  6477. // 验证请求头信息
  6478. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6479. // 验证失败
  6480. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6481. {
  6482. return actionResult;
  6483. }
  6484. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6485. () => SystemModuleLogic.GetSemiCheckType());
  6486. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6487. actionResult.Status = (int)Constant.PDAResult.Success;
  6488. }
  6489. catch (Exception ex)
  6490. {
  6491. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6492. OutputLog.TraceLog(LogPriority.Error,
  6493. this.ToString(),
  6494. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6495. ex.ToString(),
  6496. LocalPath.LogExePath);
  6497. actionResult.Status = (int)Constant.PDAResult.Exception;
  6498. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6499. }
  6500. return actionResult;
  6501. }
  6502. /// <summary>
  6503. /// 根据半成品检验数据ID,显示半成品数据信息
  6504. /// </summary>
  6505. /// <param name="sUserInfo"></param>
  6506. /// <returns></returns>
  6507. public ActionResult GetSemiCheckByID(string accountCode, string userCode, string userPassword, string sessionKey, int semiCheckID)
  6508. {
  6509. ActionResult actionResult = new ActionResult();
  6510. try
  6511. {
  6512. // 验证请求头信息
  6513. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6514. // 验证失败
  6515. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6516. {
  6517. return actionResult;
  6518. }
  6519. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  6520. () => PMModuleLogic.GetSemiCheckByID(semiCheckID));
  6521. SemiCheckEntity[] productionDatas = new SemiCheckEntity[1];
  6522. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  6523. {
  6524. if (reworkDs != null && reworkDs.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  6525. {
  6526. for (int i = 0; i < reworkDs.Tables[0].Rows.Count; i++)
  6527. {
  6528. SemiCheckEntity productionData = new SemiCheckEntity();
  6529. productionData.BarCode = reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
  6530. if (reworkDs.Tables[0].Rows[i]["GoodsID"].ToString() != "")
  6531. {
  6532. productionData.GoodsID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsID"].ToString());
  6533. }
  6534. productionData.SemiCheckID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["SemiCheckID"].ToString());
  6535. productionData.GoodsCode = reworkDs.Tables[0].Rows[i]["GoodsCode"].ToString();
  6536. productionData.GoodsName = reworkDs.Tables[0].Rows[i]["GoodsName"].ToString();
  6537. productionData.SemiCheckType = reworkDs.Tables[0].Rows[i]["SemiCheckType"].ToString();
  6538. productionData.ReFine = 0;
  6539. if (reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString() != "")
  6540. {
  6541. productionData.ReworkProcedureID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString());
  6542. }
  6543. productionData.ReSemiCheckType = reworkDs.Tables[0].Rows[i]["ReSemiCheckType"].ToString();
  6544. productionData.ReworkProcedureCode = reworkDs.Tables[0].Rows[i]["ReworkProcedureCode"].ToString();
  6545. productionData.ReworkProcedureName = reworkDs.Tables[0].Rows[i]["ReworkProcedureName"].ToString();
  6546. productionData.Remarks = reworkDs.Tables[0].Rows[i]["Remarks"].ToString();
  6547. if (reworkDs.Tables[0].Rows[i]["UserID"].ToString() != "")
  6548. {
  6549. productionData.SemiCheckUserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["UserID"].ToString());
  6550. productionData.SemiCheckUserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
  6551. }
  6552. if (reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString() != "")
  6553. {
  6554. productionData.GoodsLevelTypeID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString());
  6555. }
  6556. //productionData.UserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
  6557. //productionData.UserName = reworkDs.Tables[0].Rows[i]["UserName"].ToString();
  6558. productionData.SpecialRepairFlag = reworkDs.Tables[0].Rows[i]["SpecialRepairFlag"].ToString();
  6559. productionData.GroutingUserCode = reworkDs.Tables[0].Rows[i]["GroutingUserCode"].ToString();
  6560. productionData.GroutingNum = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GroutingNum"]);
  6561. productionData.IsPublicBody = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["IsPublicBody"]);
  6562. productionData.MouldCode = reworkDs.Tables[0].Rows[i]["MouldCode"].ToString();
  6563. productionData.GroutingDate = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["GroutingDate"]);
  6564. if (reworkDs.Tables[0].Rows[i]["ReworkUserID"].ToString() != "")
  6565. {
  6566. productionData.ReworkUserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkUserID"].ToString());
  6567. productionData.ReworkUserCode = reworkDs.Tables[0].Rows[i]["ReworkUserCode"].ToString();
  6568. }
  6569. productionData.ReSemiCheckUserCode = reworkDs.Tables[0].Rows[i]["ReSemiCheckUserCode"].ToString();
  6570. if (reworkDs.Tables[0].Rows[i]["logoid"].ToString() != "")
  6571. {
  6572. productionData.Logoid = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["Logoid"]);
  6573. productionData.LogoCode = reworkDs.Tables[0].Rows[i]["LogoCode"].ToString();
  6574. productionData.LogoName = reworkDs.Tables[0].Rows[i]["LogoName"].ToString();
  6575. }
  6576. productionData.SemiCheckTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["SemiCheckTime"]);
  6577. if (reworkDs.Tables[0].Rows[i]["ReSemiCheckTime"] != DBNull.Value)
  6578. {
  6579. productionData.ReSemiCheckDateTimeStart = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["ReSemiCheckTime"]);
  6580. }
  6581. DataView dvDefect = reworkDs.Tables[1].DefaultView;
  6582. dvDefect.RowFilter = "SemiCheckID=" + reworkDs.Tables[0].Rows[i]["SemiCheckID"].ToString();
  6583. DataTable dtDefect = dvDefect.ToTable();
  6584. for (int row = 0; row < dtDefect.Rows.Count; row++)
  6585. {
  6586. // 产品缺陷
  6587. SemiCheckDefectEntity defect = new SemiCheckDefectEntity();
  6588. //defect.SpecialDefect = dtDefect.Rows[row]["SpecialDefect"].ToString();
  6589. //defect.DefectDeductionNum = Convert.ToDecimal(dtDefect.Rows[row]["DefectDeductionNum"].ToString());
  6590. //if (dtDefect.Rows[row]["ProductionDefectID"].ToString() != "")
  6591. //{
  6592. // defect.ProductionDefectID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDefectID"].ToString());
  6593. //}
  6594. //defect.BarCode = dtDefect.Rows[row]["BarCode"].ToString();
  6595. if (dtDefect.Rows[row]["DefectID"].ToString() != "")
  6596. {
  6597. defect.DefectID = Convert.ToInt32(dtDefect.Rows[row]["DefectID"].ToString());
  6598. }
  6599. defect.DefectName = dtDefect.Rows[row]["DefectName"].ToString();
  6600. defect.DefectCode = dtDefect.Rows[row]["DefectCode"].ToString();
  6601. if (dtDefect.Rows[row]["DefectPositionID"].ToString() != "")
  6602. {
  6603. defect.DefectPositionID = Convert.ToInt32(dtDefect.Rows[row]["DefectPositionID"].ToString());
  6604. }
  6605. defect.DefectPositionName = dtDefect.Rows[row]["DefectPositionName"].ToString();
  6606. defect.DefectPositionCode = dtDefect.Rows[row]["DefectPositionCode"].ToString();
  6607. if (dtDefect.Rows[row]["DefectProcedureID"].ToString() != "")
  6608. {
  6609. defect.DefectProcedureID = Convert.ToInt32(dtDefect.Rows[row]["DefectProcedureID"].ToString());
  6610. }
  6611. defect.DefectProcedureName = dtDefect.Rows[row]["DefectProcedureName"].ToString();
  6612. defect.DefectProcedureCode = dtDefect.Rows[row]["DefectProcedureCode"].ToString();
  6613. if (dtDefect.Rows[row]["DefectUserID"].ToString() != "")
  6614. {
  6615. defect.DefectUserID = Convert.ToInt32(dtDefect.Rows[row]["DefectUserID"].ToString());
  6616. }
  6617. defect.DefectUserName = dtDefect.Rows[row]["DefectUserName"].ToString();
  6618. defect.DefectUserCode = dtDefect.Rows[row]["DefectUserCode"].ToString();
  6619. //if (dtDefect.Rows[row]["Jobs"].ToString() != "")
  6620. //{
  6621. // defect.Jobs = Convert.ToInt32(dtDefect.Rows[row]["Jobs"].ToString());
  6622. //}
  6623. //if (dtDefect.Rows[row]["MissedUserID"].ToString() != "")
  6624. //{
  6625. // defect.MissedUserID = Convert.ToInt32(dtDefect.Rows[row]["MissedUserID"].ToString());
  6626. //}
  6627. //defect.MissedUserCode = dtDefect.Rows[row]["MissedUserCode"].ToString();
  6628. //defect.MissedUserName = dtDefect.Rows[row]["MissedUserName"].ToString();
  6629. //defect.JobsText = dtDefect.Rows[row]["JobsText"].ToString();
  6630. defect.Remarks = dtDefect.Rows[row]["remarks"].ToString();
  6631. if (dtDefect.Rows[row]["semicheckid"].ToString() != "")
  6632. {
  6633. defect.SemiCheckID = Convert.ToInt32(dtDefect.Rows[row]["semicheckid"].ToString());
  6634. }
  6635. if (dtDefect.Rows[row]["DefectProductionDataID"].ToString() != "")
  6636. {
  6637. defect.DefectProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["DefectProductionDataID"].ToString());
  6638. }
  6639. //if (dtDefect.Rows[row]["DefectFineID"].ToString() != "")
  6640. //{
  6641. // defect.DefectFineID = Convert.ToInt32(dtDefect.Rows[row]["DefectFineID"].ToString());
  6642. //}
  6643. //defect.DefectFineValue = dtDefect.Rows[row]["DefectFineValue"].ToString();
  6644. //--------责任员工-------------------
  6645. DataRow[] drRow = reworkDs.Tables[2].Select("SemiCheckDefectID=" + reworkDs.Tables[1].Rows[row]["SemiCheckDefectID"]);
  6646. if (drRow.Length > Constant.INT_IS_ZERO)
  6647. {
  6648. if (defect.DefectResponsibles == null)
  6649. {
  6650. defect.DefectResponsibles = new List<SemiCheckResponsibleEntity>();
  6651. }
  6652. foreach (DataRow r in drRow)
  6653. {
  6654. SemiCheckResponsibleEntity defectResponsible = new SemiCheckResponsibleEntity();
  6655. if (r["SemiCheckDefectID"].ToString() != "")
  6656. {
  6657. defectResponsible.SemiCheckDefectID = Convert.ToInt32(r["SemiCheckDefectID"]);
  6658. }
  6659. if (r["StaffID"].ToString() != "")
  6660. {
  6661. defectResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
  6662. }
  6663. defectResponsible.StaffCode = r["StaffCode"].ToString();
  6664. defectResponsible.StaffName = r["StaffName"].ToString();
  6665. if (r["StaffStatus"].ToString() != "")
  6666. {
  6667. defectResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
  6668. }
  6669. if (r["UJobsID"].ToString() != "")
  6670. {
  6671. defectResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
  6672. }
  6673. if (r["SJobsID"].ToString() != "")
  6674. {
  6675. defectResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
  6676. }
  6677. defect.DefectResponsibles.Add(defectResponsible);
  6678. }
  6679. }
  6680. //------------------------------
  6681. if (productionData.SemiCheckDefects == null)
  6682. {
  6683. productionData.SemiCheckDefects = new List<SemiCheckDefectEntity>();
  6684. }
  6685. productionData.SemiCheckDefects.Add(defect);
  6686. }
  6687. //if (productionDatas.PDAProductionData == null)
  6688. //{
  6689. // productionDatas.PDAProductionData = new System.Collections.Generic.List<PDAProductionDataResult>();
  6690. //}
  6691. productionDatas[0] = productionData;
  6692. //---------------------------------------------------------------------------------
  6693. }
  6694. }
  6695. }
  6696. actionResult.Result = JsonHelper.ToJson(productionDatas);
  6697. actionResult.Status = (int)Constant.PDAResult.Success;
  6698. }
  6699. catch (Exception ex)
  6700. {
  6701. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6702. OutputLog.TraceLog(LogPriority.Error,
  6703. this.ToString(),
  6704. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6705. ex.ToString(),
  6706. LocalPath.LogExePath);
  6707. actionResult.Status = (int)Constant.PDAResult.Exception;
  6708. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6709. }
  6710. return actionResult;
  6711. }
  6712. /// <summary>
  6713. /// 保存半检登记
  6714. /// </summary>
  6715. /// <param name="accountCode">帐套code</param>
  6716. /// <param name="userCode">用户code</param>
  6717. /// <param name="userPassword">用户密码</param>
  6718. /// <param name="sessionKey">本次登陆密钥</param>
  6719. /// <param name="entity">半检实体类</param>
  6720. /// <param name="sUserInfo">用户基本信息</param>
  6721. /// <returns></returns>
  6722. public ActionResult AddSemiCheck(string accountCode, string userCode, string userPassword, string sessionKey, SemiCheckEntity[] entityobj)
  6723. {
  6724. ActionResult actionResult = new ActionResult();
  6725. try
  6726. {
  6727. // 验证请求头信息
  6728. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6729. // 验证失败
  6730. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6731. {
  6732. return actionResult;
  6733. }
  6734. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6735. () => PMModuleLogicDAL.AddSemiCheck(entityobj, sUserInfo));
  6736. string err = string.Empty;
  6737. err = resultEntity.Message;
  6738. if (err == null)
  6739. {
  6740. err = "";
  6741. }
  6742. SemiCheckEntity entity = entityobj[0];
  6743. if (entity.SemiCheckCategory == 1) // 半检登记
  6744. {
  6745. }
  6746. else if (entity.SemiCheckCategory == 2)// 复检登记
  6747. {
  6748. err = JsonHelper.ToJson(err);
  6749. }
  6750. else if (entity.SemiCheckCategory == 3)// 撤销复检
  6751. {
  6752. err = JsonHelper.ToJson(err);
  6753. }
  6754. //actionResult.Result = JsonHelper.ToJson(err);
  6755. actionResult.Result = err;//JsonHelper.ToJson(err);
  6756. actionResult.Status = (int)Constant.PDAResult.Success;
  6757. }
  6758. catch (Exception ex)
  6759. {
  6760. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6761. OutputLog.TraceLog(LogPriority.Error,
  6762. this.ToString(),
  6763. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6764. ex.ToString(),
  6765. LocalPath.LogExePath);
  6766. actionResult.Status = (int)Constant.PDAResult.Exception;
  6767. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6768. }
  6769. return actionResult;
  6770. }
  6771. /// <summary>
  6772. /// 根据所选工号,查出缺陷责任员工
  6773. /// </summary>
  6774. /// <param name="sUserInfo"></param>
  6775. /// <returns></returns>
  6776. public ActionResult GetSemiCheckDefectStaffByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int userid)
  6777. {
  6778. ActionResult actionResult = new ActionResult();
  6779. try
  6780. {
  6781. // 验证请求头信息
  6782. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6783. // 验证失败
  6784. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6785. {
  6786. return actionResult;
  6787. }
  6788. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6789. () => PMModuleLogic.GetSemiCheckDefectStaffByUserID(sUserInfo, userid));
  6790. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6791. actionResult.Status = (int)Constant.PDAResult.Success;
  6792. }
  6793. catch (Exception ex)
  6794. {
  6795. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6796. OutputLog.TraceLog(LogPriority.Error,
  6797. this.ToString(),
  6798. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6799. ex.ToString(),
  6800. LocalPath.LogExePath);
  6801. actionResult.Status = (int)Constant.PDAResult.Exception;
  6802. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6803. }
  6804. return actionResult;
  6805. }
  6806. /// <summary>
  6807. /// 获取半成品缺陷管理的全部数据
  6808. /// </summary>
  6809. /// <param name="sUserInfo"></param>
  6810. /// <returns></returns>
  6811. public ActionResult GetAllSemicheckDefect(string accountCode, string userCode, string userPassword, string sessionKey)
  6812. {
  6813. ActionResult actionResult = new ActionResult();
  6814. try
  6815. {
  6816. // 验证请求头信息
  6817. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6818. // 验证失败
  6819. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6820. {
  6821. return actionResult;
  6822. }
  6823. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6824. () => SystemModuleLogic.GetAllSemicheckDefect(sUserInfo));
  6825. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6826. actionResult.Status = (int)Constant.PDAResult.Success;
  6827. }
  6828. catch (Exception ex)
  6829. {
  6830. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6831. OutputLog.TraceLog(LogPriority.Error,
  6832. this.ToString(),
  6833. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6834. ex.ToString(),
  6835. LocalPath.LogExePath);
  6836. actionResult.Status = (int)Constant.PDAResult.Exception;
  6837. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6838. }
  6839. return actionResult;
  6840. }
  6841. /// <summary>
  6842. /// 获取半成品缺陷位置管理的全部数据
  6843. /// </summary>
  6844. /// <param name="sUserInfo"></param>
  6845. /// <returns></returns>
  6846. public ActionResult GetAllScdefectPosition(string accountCode, string userCode, string userPassword, string sessionKey)
  6847. {
  6848. ActionResult actionResult = new ActionResult();
  6849. try
  6850. {
  6851. // 验证请求头信息
  6852. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6853. // 验证失败
  6854. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6855. {
  6856. return actionResult;
  6857. }
  6858. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6859. () => SystemModuleLogic.GetAllScdefectPosition(sUserInfo));
  6860. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6861. actionResult.Status = (int)Constant.PDAResult.Success;
  6862. }
  6863. catch (Exception ex)
  6864. {
  6865. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6866. OutputLog.TraceLog(LogPriority.Error,
  6867. this.ToString(),
  6868. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6869. ex.ToString(),
  6870. LocalPath.LogExePath);
  6871. actionResult.Status = (int)Constant.PDAResult.Exception;
  6872. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6873. }
  6874. return actionResult;
  6875. }
  6876. /// <summary>
  6877. /// 复检验条码
  6878. /// </summary>
  6879. /// <param name="sUserInfo"></param>
  6880. /// <returns></returns>
  6881. public ActionResult ReSemiCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6882. {
  6883. ActionResult actionResult = new ActionResult();
  6884. try
  6885. {
  6886. // 验证请求头信息
  6887. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6888. // 验证失败
  6889. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6890. {
  6891. return actionResult;
  6892. }
  6893. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6894. () => PMModuleLogic.ReSemiCheckBarcode(barcode, sUserInfo));
  6895. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6896. if (Convert.ToInt32(resultEntity.Result) < 0)
  6897. {
  6898. actionResult.Status = (int)Constant.PDAResult.Fail;
  6899. }
  6900. else
  6901. {
  6902. actionResult.Status = (int)Constant.PDAResult.Success;
  6903. }
  6904. actionResult.Message = resultEntity.Message;
  6905. }
  6906. catch (Exception ex)
  6907. {
  6908. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6909. OutputLog.TraceLog(LogPriority.Error,
  6910. this.ToString(),
  6911. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6912. ex.ToString(),
  6913. LocalPath.LogExePath);
  6914. actionResult.Status = (int)Constant.PDAResult.Exception;
  6915. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6916. }
  6917. return actionResult;
  6918. }
  6919. /// <summary>
  6920. /// 撤销复检验条码
  6921. /// </summary>
  6922. /// <param name="sUserInfo"></param>
  6923. /// <returns></returns>
  6924. public ActionResult CancelSemiCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6925. {
  6926. ActionResult actionResult = new ActionResult();
  6927. try
  6928. {
  6929. // 验证请求头信息
  6930. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6931. // 验证失败
  6932. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6933. {
  6934. return actionResult;
  6935. }
  6936. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6937. () => PMModuleLogic.CancelSemiCheckBarcode(barcode, sUserInfo));
  6938. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6939. if (Convert.ToInt32(resultEntity.Result) < 0)
  6940. {
  6941. actionResult.Status = (int)Constant.PDAResult.Fail;
  6942. }
  6943. else
  6944. {
  6945. actionResult.Status = (int)Constant.PDAResult.Success;
  6946. }
  6947. actionResult.Message = resultEntity.Message;
  6948. }
  6949. catch (Exception ex)
  6950. {
  6951. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6952. OutputLog.TraceLog(LogPriority.Error,
  6953. this.ToString(),
  6954. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6955. ex.ToString(),
  6956. LocalPath.LogExePath);
  6957. actionResult.Status = (int)Constant.PDAResult.Exception;
  6958. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6959. }
  6960. return actionResult;
  6961. }
  6962. /// <summary>
  6963. /// 恢复数据
  6964. /// </summary>
  6965. /// <param name="sUserInfo"></param>
  6966. /// <returns></returns>
  6967. public ActionResult ResetBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6968. {
  6969. ActionResult actionResult = new ActionResult();
  6970. try
  6971. {
  6972. // 验证请求头信息
  6973. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6974. // 验证失败
  6975. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6976. {
  6977. return actionResult;
  6978. }
  6979. int resultEntity = ServiceInvoker.Invoke<int>(this,
  6980. () => PMModuleLogicDAL.ResetBarCode(barcode));
  6981. if (resultEntity > 0)
  6982. {
  6983. actionResult.Status = (int)Constant.PDAResult.Success;
  6984. actionResult.Message = "恢复数据成功";
  6985. }
  6986. else
  6987. {
  6988. actionResult.Status = (int)Constant.PDAResult.Fail;
  6989. if (resultEntity == -1)
  6990. {
  6991. actionResult.Message = "此条码没有清除,不能恢复";
  6992. }
  6993. else if (resultEntity == 0)
  6994. {
  6995. actionResult.Message = "没有可恢复的数据";
  6996. }
  6997. }
  6998. }
  6999. catch (Exception ex)
  7000. {
  7001. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7002. OutputLog.TraceLog(LogPriority.Error,
  7003. this.ToString(),
  7004. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7005. ex.ToString(),
  7006. LocalPath.LogExePath);
  7007. actionResult.Status = (int)Constant.PDAResult.Exception;
  7008. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7009. }
  7010. return actionResult;
  7011. }
  7012. /// <summary>
  7013. /// 通过SettingCode获取系统参数管理的数据
  7014. /// </summary>
  7015. /// <param name="accountCode"></param>
  7016. /// <param name="userCode"></param>
  7017. /// <param name="userPassword"></param>
  7018. /// <param name="sessionKey"></param>
  7019. /// <param name="settingcode">设置编码</param>
  7020. /// <returns></returns>
  7021. public ActionResult GetSystemSettingDataByCode(string accountCode, string userCode, string userPassword, string sessionKey, string settingcode)
  7022. {
  7023. ActionResult actionResult = new ActionResult();
  7024. try
  7025. {
  7026. // 验证请求头信息
  7027. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7028. // 验证失败
  7029. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7030. {
  7031. return actionResult;
  7032. }
  7033. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  7034. () => SystemModuleLogic.GetSystemSettingDataByCode(settingcode, sUserInfo));
  7035. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7036. actionResult.Status = (int)Constant.PDAResult.Success;
  7037. }
  7038. catch (Exception ex)
  7039. {
  7040. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7041. OutputLog.TraceLog(LogPriority.Error,
  7042. this.ToString(),
  7043. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7044. ex.ToString(),
  7045. LocalPath.LogExePath);
  7046. actionResult.Status = (int)Constant.PDAResult.Exception;
  7047. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7048. }
  7049. return actionResult;
  7050. }
  7051. /// <summary>
  7052. /// 校验条码是否允许撤销,如果不允许提示错误消息
  7053. /// </summary>
  7054. /// <param name="accountCode"></param>
  7055. /// <param name="userCode"></param>
  7056. /// <param name="userPassword"></param>
  7057. /// <param name="sessionKey"></param>
  7058. /// <param name="orgTime">原时间</param>
  7059. /// <param name="days">允许撤销天数</param>
  7060. /// <param name="settingCode">设置code,用于返回不同错误消息</param>
  7061. /// <returns></returns>
  7062. public ActionResult BarcodeAllowCancel(string accountCode, string userCode, string userPassword, string sessionKey, string orgTime, int days, string settingCode)
  7063. {
  7064. ActionResult actionResult = new ActionResult();
  7065. try
  7066. {
  7067. // 验证请求头信息
  7068. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7069. // 验证失败
  7070. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7071. {
  7072. return actionResult;
  7073. }
  7074. string[] subOrgTime = orgTime.Split('-');
  7075. DateTime newOrgTime = new DateTime(Convert.ToInt32(subOrgTime[0]), Convert.ToInt32(subOrgTime[1]), Convert.ToInt32(subOrgTime[2]));
  7076. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7077. () => PMModuleLogic.BarcodeAllowCancel(newOrgTime, days, settingCode, sUserInfo));
  7078. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7079. if (Convert.ToInt32(resultEntity.Result) < 0)
  7080. {
  7081. actionResult.Status = (int)Constant.PDAResult.Fail;
  7082. }
  7083. else
  7084. {
  7085. actionResult.Status = (int)Constant.PDAResult.Success;
  7086. }
  7087. actionResult.Message = resultEntity.Message;
  7088. }
  7089. catch (Exception ex)
  7090. {
  7091. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7092. OutputLog.TraceLog(LogPriority.Error,
  7093. this.ToString(),
  7094. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7095. ex.ToString(),
  7096. LocalPath.LogExePath);
  7097. actionResult.Status = (int)Constant.PDAResult.Exception;
  7098. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7099. }
  7100. return actionResult;
  7101. }
  7102. /// <summary>
  7103. /// 获取生产订单管理的全部数据
  7104. /// </summary>
  7105. /// <param name="sUserInfo"></param>
  7106. /// <returns></returns>
  7107. public ActionResult GetOrderList(string accountCode, string userCode, string userPassword, string sessionKey, OrderEntity order)
  7108. {
  7109. ActionResult actionResult = new ActionResult();
  7110. try
  7111. {
  7112. // 验证请求头信息
  7113. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7114. // 验证失败
  7115. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7116. {
  7117. return actionResult;
  7118. }
  7119. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  7120. () => PMModuleLogic.GetOrderList(order, sUserInfo));
  7121. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7122. actionResult.Status = (int)Constant.PDAResult.Success;
  7123. }
  7124. catch (Exception ex)
  7125. {
  7126. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7127. OutputLog.TraceLog(LogPriority.Error,
  7128. this.ToString(),
  7129. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7130. ex.ToString(),
  7131. LocalPath.LogExePath);
  7132. actionResult.Status = (int)Constant.PDAResult.Exception;
  7133. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7134. }
  7135. return actionResult;
  7136. }
  7137. public ActionResult FinishedHandoverBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7138. {
  7139. ActionResult actionResult = new ActionResult();
  7140. try
  7141. {
  7142. // 验证请求头信息
  7143. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7144. // 验证失败
  7145. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7146. {
  7147. return actionResult;
  7148. }
  7149. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7150. () => PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo));
  7151. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7152. if (Convert.ToInt32(resultEntity.Result) < 0)
  7153. {
  7154. actionResult.Status = (int)Constant.PDAResult.Fail;
  7155. actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
  7156. }
  7157. else
  7158. {
  7159. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  7160. actionResult.Status = (int)Constant.PDAResult.Success;
  7161. }
  7162. actionResult.Message = resultEntity.Message;
  7163. }
  7164. catch (Exception ex)
  7165. {
  7166. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7167. OutputLog.TraceLog(LogPriority.Error,
  7168. this.ToString(),
  7169. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7170. ex.ToString(),
  7171. LocalPath.LogExePath);
  7172. actionResult.Status = (int)Constant.PDAResult.Exception;
  7173. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7174. }
  7175. return actionResult;
  7176. }
  7177. public ActionResult GetSystemData(string accountCode, string userCode, string userPassword, string sessionKey)
  7178. {
  7179. ActionResult actionResult = new ActionResult();
  7180. try
  7181. {
  7182. // 验证请求头信息
  7183. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7184. // 验证失败
  7185. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7186. {
  7187. return actionResult;
  7188. }
  7189. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  7190. () => SystemModuleLogic.GetSystemData(sUserInfo));
  7191. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7192. actionResult.Status = (int)Constant.PDAResult.Success;
  7193. }
  7194. catch (Exception ex)
  7195. {
  7196. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7197. OutputLog.TraceLog(LogPriority.Error,
  7198. this.ToString(),
  7199. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7200. ex.ToString(),
  7201. LocalPath.LogExePath);
  7202. actionResult.Status = (int)Constant.PDAResult.Exception;
  7203. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7204. }
  7205. return actionResult;
  7206. }
  7207. public ActionResult SaveFinishedHandover(string accountCode, string userCode, string userPassword, string sessionKey, int orderid, OrderEntity[] orderEntity)
  7208. {
  7209. ActionResult actionResult = new ActionResult();
  7210. try
  7211. {
  7212. // 验证请求头信息
  7213. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7214. // 验证失败
  7215. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7216. {
  7217. return actionResult;
  7218. }
  7219. DataTable dtOrderData = DataConvert.ObjectConvertToTable<OrderEntity>(orderEntity);
  7220. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7221. () => PMModuleLogicDAL.SaveFinishedHandover(orderid, dtOrderData, sUserInfo));
  7222. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7223. if (Convert.ToInt32(resultEntity.Result) < 0)
  7224. {
  7225. actionResult.Status = (int)Constant.PDAResult.Fail;
  7226. }
  7227. else
  7228. {
  7229. actionResult.Status = (int)Constant.PDAResult.Success;
  7230. }
  7231. actionResult.Message = resultEntity.Message;
  7232. }
  7233. catch (Exception ex)
  7234. {
  7235. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7236. OutputLog.TraceLog(LogPriority.Error,
  7237. this.ToString(),
  7238. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7239. ex.ToString(),
  7240. LocalPath.LogExePath);
  7241. actionResult.Status = (int)Constant.PDAResult.Exception;
  7242. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7243. }
  7244. return actionResult;
  7245. }
  7246. public ActionResult CancelFinishedHandoverBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7247. {
  7248. ActionResult actionResult = new ActionResult();
  7249. try
  7250. {
  7251. // 验证请求头信息
  7252. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7253. // 验证失败
  7254. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7255. {
  7256. return actionResult;
  7257. }
  7258. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7259. () => PMModuleLogic.CancelFinishedHandoverBarcode(barcode, sUserInfo));
  7260. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7261. if (Convert.ToInt32(resultEntity.Result) < 0)
  7262. {
  7263. actionResult.Status = (int)Constant.PDAResult.Fail;
  7264. }
  7265. else
  7266. {
  7267. actionResult.Result = JsonHelper.ToJson(resultEntity.Data.Tables[0]);
  7268. actionResult.Status = (int)Constant.PDAResult.Success;
  7269. }
  7270. actionResult.Message = resultEntity.Message;
  7271. }
  7272. catch (Exception ex)
  7273. {
  7274. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7275. OutputLog.TraceLog(LogPriority.Error,
  7276. this.ToString(),
  7277. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7278. ex.ToString(),
  7279. LocalPath.LogExePath);
  7280. actionResult.Status = (int)Constant.PDAResult.Exception;
  7281. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7282. }
  7283. return actionResult;
  7284. }
  7285. public ActionResult SaveCancelFinishedHandoverByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7286. {
  7287. ActionResult actionResult = new ActionResult();
  7288. try
  7289. {
  7290. // 验证请求头信息
  7291. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7292. // 验证失败
  7293. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7294. {
  7295. return actionResult;
  7296. }
  7297. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7298. () => PMModuleLogicDAL.SaveCancelFinishedHandoverByBarcode(barcode, sUserInfo));
  7299. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7300. if (Convert.ToInt32(resultEntity.Result) < 0)
  7301. {
  7302. actionResult.Status = (int)Constant.PDAResult.Fail;
  7303. }
  7304. else
  7305. {
  7306. actionResult.Status = (int)Constant.PDAResult.Success;
  7307. }
  7308. actionResult.Message = resultEntity.Message;
  7309. }
  7310. catch (Exception ex)
  7311. {
  7312. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7313. OutputLog.TraceLog(LogPriority.Error,
  7314. this.ToString(),
  7315. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7316. ex.ToString(),
  7317. LocalPath.LogExePath);
  7318. actionResult.Status = (int)Constant.PDAResult.Exception;
  7319. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7320. }
  7321. return actionResult;
  7322. }
  7323. public ActionResult SaveChangeFinishedHandoverByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int orderid)
  7324. {
  7325. ActionResult actionResult = new ActionResult();
  7326. try
  7327. {
  7328. // 验证请求头信息
  7329. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7330. // 验证失败
  7331. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7332. {
  7333. return actionResult;
  7334. }
  7335. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7336. () => PMModuleLogicDAL.SaveChangeFinishedHandoverByBarcode(barcode, orderid, sUserInfo));
  7337. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7338. if (Convert.ToInt32(resultEntity.Result) < 0)
  7339. {
  7340. actionResult.Status = (int)Constant.PDAResult.Fail;
  7341. }
  7342. else
  7343. {
  7344. actionResult.Status = (int)Constant.PDAResult.Success;
  7345. }
  7346. actionResult.Message = resultEntity.Message;
  7347. }
  7348. catch (Exception ex)
  7349. {
  7350. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7351. OutputLog.TraceLog(LogPriority.Error,
  7352. this.ToString(),
  7353. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7354. ex.ToString(),
  7355. LocalPath.LogExePath);
  7356. actionResult.Status = (int)Constant.PDAResult.Exception;
  7357. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7358. }
  7359. return actionResult;
  7360. }
  7361. #region PDA条码打印
  7362. /// <summary>
  7363. /// 获取条码打印机
  7364. /// </summary>
  7365. /// <param name="accountCode"></param>
  7366. /// <param name="userCode"></param>
  7367. /// <param name="userPassword"></param>
  7368. /// <param name="sessionKey"></param>
  7369. /// <returns></returns>
  7370. public ActionResult GetBarcodePrinter(string accountCode, string userCode, string userPassword, string sessionKey, int printType=0)
  7371. {
  7372. ActionResult actionResult = new ActionResult();
  7373. try
  7374. {
  7375. // 验证请求头信息
  7376. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7377. // 验证失败
  7378. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7379. {
  7380. return actionResult;
  7381. }
  7382. DataSet resultEntity = BarcodePrintLogic.GetBarcodePrinter(sUserInfo, printType);
  7383. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7384. actionResult.Status = (int)Constant.PDAResult.Success;
  7385. }
  7386. catch (Exception ex)
  7387. {
  7388. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7389. OutputLog.TraceLog(LogPriority.Error,
  7390. this.ToString(),
  7391. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7392. ex.ToString(),
  7393. LocalPath.LogExePath);
  7394. actionResult.Status = (int)Constant.PDAResult.Exception;
  7395. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7396. }
  7397. return actionResult;
  7398. }
  7399. /// <summary>
  7400. /// 打印条码样式(补打)
  7401. /// </summary>
  7402. /// <param name="accountCode"></param>
  7403. /// <param name="userCode"></param>
  7404. /// <param name="userPassword"></param>
  7405. /// <param name="sessionKey"></param>
  7406. /// <returns></returns>
  7407. public ActionResult PrintBarcodeLayout(string accountCode, string userCode, string userPassword, string sessionKey,
  7408. string barcode, int copies, int printerID, int printWay=2)
  7409. {
  7410. ActionResult actionResult = new ActionResult();
  7411. try
  7412. {
  7413. // 验证请求头信息
  7414. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7415. // 验证失败
  7416. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7417. {
  7418. return actionResult;
  7419. }
  7420. //ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode(barcode,
  7421. // copies, printerID, sUserInfo);
  7422. ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode_3C(barcode,
  7423. copies, printerID, sUserInfo, printWay);
  7424. if (sre.Status != Constant.ServiceResultStatus.Success)
  7425. {
  7426. actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  7427. actionResult.Message = sre.Message;
  7428. return actionResult;
  7429. }
  7430. actionResult.Result = JsonHelper.ToJson(sre.Result as DataTable);
  7431. actionResult.Status = (int)Constant.PDAResult.Success;
  7432. }
  7433. catch (Exception ex)
  7434. {
  7435. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7436. OutputLog.TraceLog(LogPriority.Error,
  7437. this.ToString(),
  7438. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7439. ex.ToString(),
  7440. LocalPath.LogExePath);
  7441. actionResult.Status = (int)Constant.PDAResult.Exception;
  7442. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7443. }
  7444. return actionResult;
  7445. }
  7446. #endregion PDA条码打印
  7447. #region 统计报表
  7448. /// <summary>
  7449. /// 成型结算报表
  7450. /// </summary>
  7451. /// <param name="accountCode"></param>
  7452. /// <param name="userCode"></param>
  7453. /// <param name="userPassword"></param>
  7454. /// <param name="sessionKey"></param>
  7455. /// <returns></returns>
  7456. public ActionResult GetGroutingSettlementInfo(string accountCode, string userCode, string userPassword, string sessionKey,
  7457. int currentMonth)
  7458. {
  7459. ActionResult actionResult = new ActionResult();
  7460. try
  7461. {
  7462. // 验证请求头信息
  7463. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7464. // 验证失败
  7465. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7466. {
  7467. return actionResult;
  7468. }
  7469. DateTime date = DateTime.Now;
  7470. if (currentMonth != 1)
  7471. {
  7472. date = date.AddMonths(-1);
  7473. }
  7474. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7475. () => PublicModuleLogic.GetFP00002Data(sUserInfo.AccountID, userCode, date));
  7476. if (resultEntity == null || resultEntity.Data == null)
  7477. {
  7478. actionResult.Status = (int)Constant.PDAResult.Fail;
  7479. actionResult.Message = "查询失败";
  7480. return actionResult;
  7481. }
  7482. if (resultEntity.Status == Constant.ServiceResultStatus.Other)
  7483. {
  7484. actionResult.Status = (int)Constant.PDAResult.Fail;
  7485. actionResult.Message = resultEntity.Message;
  7486. return actionResult;
  7487. }
  7488. actionResult.Result = JsonHelper.ToJson(resultEntity.Data.Tables["DataM"]);
  7489. actionResult.Status = (int)Constant.PDAResult.Success;
  7490. }
  7491. catch (Exception ex)
  7492. {
  7493. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7494. OutputLog.TraceLog(LogPriority.Error,
  7495. this.ToString(),
  7496. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7497. ex.ToString(),
  7498. LocalPath.LogExePath);
  7499. actionResult.Status = (int)Constant.PDAResult.Exception;
  7500. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7501. }
  7502. return actionResult;
  7503. }
  7504. #endregion
  7505. #region 设置当期用户默认打印机配置
  7506. /// <summary>
  7507. /// 设置当期用户默认打印机配置
  7508. /// </summary>
  7509. /// <param name="accountCode"></param>
  7510. /// <param name="userCode"></param>
  7511. /// <param name="userPassword"></param>
  7512. /// <param name="sessionKey"></param>
  7513. /// <param name="printerID"></param>
  7514. /// <returns></returns>
  7515. public ActionResult SetCurrentUserPrinter(string accountCode, string userCode, string userPassword, string sessionKey,
  7516. int printerID)
  7517. {
  7518. ActionResult actionResult = new ActionResult();
  7519. try
  7520. {
  7521. // 验证请求头信息
  7522. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7523. // 验证失败
  7524. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7525. {
  7526. return actionResult;
  7527. }
  7528. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7529. () => BarcodePrintLogic.SetCurrentUserPrinter(printerID, sUserInfo));
  7530. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7531. if (resultEntity.Status == Constant.ServiceResultStatus.Other || Convert.ToInt32(resultEntity.Result) < 0)
  7532. {
  7533. actionResult.Status = (int)Constant.PDAResult.Fail;
  7534. }
  7535. else
  7536. {
  7537. actionResult.Status = (int)Constant.PDAResult.Success;
  7538. }
  7539. actionResult.Message = resultEntity.Message;
  7540. }
  7541. catch (Exception ex)
  7542. {
  7543. OutputLog.TraceLog(LogPriority.Error,
  7544. this.ToString(),
  7545. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7546. ex.ToString(),
  7547. LocalPath.LogExePath);
  7548. actionResult.Status = (int)Constant.PDAResult.Exception;
  7549. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7550. }
  7551. return actionResult;
  7552. }
  7553. /// <summary>
  7554. /// 校验产品条码是否可以进行回收
  7555. /// </summary>
  7556. /// <param name="accountCode">帐套code</param>
  7557. /// <param name="userCode">用户code</param>
  7558. /// <param name="userPassword">用户密码</param>
  7559. /// <param name="sessionKey">本次登陆密钥</param>
  7560. /// <param name="procedureID">工序ID</param>
  7561. /// <param name="barcode">条码</param>
  7562. /// <returns></returns>
  7563. /// <remarks>
  7564. /// 王鑫 2017.7.21 新建
  7565. /// </remarks>
  7566. public ActionResult CheckRecydingFlagBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  7567. {
  7568. ActionResult actionResult = new ActionResult();
  7569. try
  7570. {
  7571. // 验证请求头信息
  7572. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7573. // 验证失败
  7574. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7575. {
  7576. return actionResult;
  7577. }
  7578. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  7579. () => PMModuleLogic.CheckRecydingFlagBarcode(procedureID, barcode, sUserInfo));
  7580. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  7581. {
  7582. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  7583. actionResult.Status = (int)Constant.PDAResult.Success;
  7584. }
  7585. else
  7586. {
  7587. actionResult.Status = (int)Constant.PDAResult.Fail;
  7588. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  7589. }
  7590. }
  7591. catch (Exception ex)
  7592. {
  7593. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7594. OutputLog.TraceLog(LogPriority.Error,
  7595. this.ToString(),
  7596. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7597. ex.ToString(),
  7598. LocalPath.LogExePath);
  7599. actionResult.Status = (int)Constant.PDAResult.Exception;
  7600. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7601. }
  7602. return actionResult;
  7603. }
  7604. /// <summary>
  7605. /// 获取回收标识
  7606. /// </summary>
  7607. /// <param name="accountCode"></param>
  7608. /// <param name="userCode"></param>
  7609. /// <param name="userPassword"></param>
  7610. /// <param name="sessionKey"></param>
  7611. /// <param name="usercode">工号编码</param>
  7612. /// <returns></returns>
  7613. public ActionResult GetRecyclingflagByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7614. {
  7615. ActionResult actionResult = new ActionResult();
  7616. try
  7617. {
  7618. // 验证请求头信息
  7619. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7620. // 验证失败
  7621. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7622. {
  7623. return actionResult;
  7624. }
  7625. int returnValue = ServiceInvoker.Invoke<int>(this,
  7626. () => PMModuleLogic.GetRecyclingflagByBarcode(barcode, sUserInfo));
  7627. actionResult.Result = JsonHelper.ToJson(returnValue);
  7628. actionResult.Status = (int)Constant.PDAResult.Success;
  7629. }
  7630. catch (Exception ex)
  7631. {
  7632. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7633. OutputLog.TraceLog(LogPriority.Error,
  7634. this.ToString(),
  7635. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7636. ex.ToString(),
  7637. LocalPath.LogExePath);
  7638. actionResult.Status = (int)Constant.PDAResult.Exception;
  7639. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7640. }
  7641. return actionResult;
  7642. }
  7643. #endregion
  7644. #region 注浆盘点
  7645. /// <summary>
  7646. /// 获取注浆盘点单列表
  7647. /// </summary>
  7648. /// <param name="sUserInfo"></param>
  7649. /// <returns></returns>
  7650. public ActionResult GetAllGBChecked(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity)
  7651. {
  7652. ActionResult actionResult = new ActionResult();
  7653. try
  7654. {
  7655. // 验证请求头信息
  7656. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7657. // 验证失败
  7658. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7659. {
  7660. return actionResult;
  7661. }
  7662. entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA);
  7663. entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1);
  7664. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  7665. () => PDAModuleLogic.GetAllGBChecked(entity, sUserInfo));
  7666. actionResult.Result = JsonHelper.ToJson(ds);
  7667. actionResult.Status = (int)Constant.PDAResult.Success;
  7668. }
  7669. catch (Exception ex)
  7670. {
  7671. string json = JsonHelper.ToJson(entity);
  7672. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7673. OutputLog.TraceLog(LogPriority.Error,
  7674. this.ToString(),
  7675. System.Reflection.MethodBase.GetCurrentMethod().Name + "\r\n" + json,
  7676. ex.ToString(),
  7677. LocalPath.LogExePath);
  7678. actionResult.Status = (int)Constant.PDAResult.Exception;
  7679. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7680. }
  7681. return actionResult;
  7682. }
  7683. /// <summary>
  7684. /// 进行盘点操作
  7685. /// </summary>
  7686. /// <param name="accountCode"></param>
  7687. /// <param name="userCode"></param>
  7688. /// <param name="userPassword"></param>
  7689. /// <param name="sessionKey"></param>
  7690. /// <param name="InCheckedID">盘点单ID</param>
  7691. /// <param name="BarCode">产品条码</param>
  7692. /// <returns></returns>
  7693. public ActionResult UpdateGBChecked(string accountCode, string userCode, string userPassword, string sessionKey, int CheckedID, string BarCode)
  7694. {
  7695. ActionResult actionResult = new ActionResult();
  7696. try
  7697. {
  7698. // 验证请求头信息
  7699. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7700. // 验证失败
  7701. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7702. {
  7703. return actionResult;
  7704. }
  7705. ClientRequestEntity cre = new ClientRequestEntity();
  7706. cre.Properties["CheckedID"] = CheckedID;
  7707. cre.Properties["Barcode"] = BarCode;
  7708. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7709. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.UpdateGBChecked(sUserInfo, cre));
  7710. if (returnValue.Status == Constant.ServiceResultStatus.Success)
  7711. {
  7712. //actionResult.Result = JsonHelper.ToJson(returnValue);
  7713. actionResult.Status = (int)Constant.PDAResult.Success;
  7714. actionResult.Message = "产品【" + BarCode + "】盘点成功";
  7715. }
  7716. else
  7717. {
  7718. //actionResult.Result = JsonHelper.ToJson(returnValue);
  7719. actionResult.Status = (int)Constant.PDAResult.Fail;
  7720. actionResult.Message = returnValue.Message;
  7721. }
  7722. }
  7723. catch (Exception ex)
  7724. {
  7725. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7726. OutputLog.TraceLog(LogPriority.Error,
  7727. this.ToString(),
  7728. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7729. ex.ToString(),
  7730. LocalPath.LogExePath);
  7731. actionResult.Status = (int)Constant.PDAResult.Exception;
  7732. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7733. }
  7734. return actionResult;
  7735. }
  7736. /// <summary>
  7737. /// 获取盘点单明细
  7738. /// </summary>
  7739. /// <param name="sUserInfo"></param>
  7740. /// <returns></returns>
  7741. public ActionResult GetUpdateGBCheckedInfo(string accountCode, string userCode, string userPassword, string sessionKey, int checkedID)
  7742. {
  7743. ActionResult actionResult = new ActionResult();
  7744. try
  7745. {
  7746. // 验证请求头信息
  7747. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7748. // 验证失败
  7749. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7750. {
  7751. return actionResult;
  7752. }
  7753. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  7754. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.
  7755. GetUpdateGBCheckedInfo(checkedID, sUserInfo));
  7756. actionResult.Result = JsonHelper.ToJson(ds);
  7757. actionResult.Status = (int)Constant.PDAResult.Success;
  7758. }
  7759. catch (Exception ex)
  7760. {
  7761. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7762. OutputLog.TraceLog(LogPriority.Error,
  7763. this.ToString(),
  7764. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7765. ex.ToString(),
  7766. LocalPath.LogExePath);
  7767. actionResult.Status = (int)Constant.PDAResult.Exception;
  7768. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7769. }
  7770. return actionResult;
  7771. }
  7772. #endregion
  7773. #region 模具盘点
  7774. /// <summary>
  7775. /// 获取模具盘点单列表
  7776. /// </summary>
  7777. /// <param name="sUserInfo"></param>
  7778. /// <returns></returns>
  7779. public ActionResult GetAllMouldChecked(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity)
  7780. {
  7781. ActionResult actionResult = new ActionResult();
  7782. try
  7783. {
  7784. // 验证请求头信息
  7785. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7786. // 验证失败
  7787. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7788. {
  7789. return actionResult;
  7790. }
  7791. entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA);
  7792. entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1);
  7793. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  7794. () => PDAModuleLogic.GetAllMouldChecked(entity, sUserInfo));
  7795. actionResult.Result = JsonHelper.ToJson(ds);
  7796. actionResult.Status = (int)Constant.PDAResult.Success;
  7797. }
  7798. catch (Exception ex)
  7799. {
  7800. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7801. OutputLog.TraceLog(LogPriority.Error,
  7802. this.ToString(),
  7803. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7804. ex.ToString(),
  7805. LocalPath.LogExePath);
  7806. actionResult.Status = (int)Constant.PDAResult.Exception;
  7807. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7808. }
  7809. return actionResult;
  7810. }
  7811. /// <summary>
  7812. /// 进行盘点操作
  7813. /// </summary>
  7814. /// <param name="accountCode"></param>
  7815. /// <param name="userCode"></param>
  7816. /// <param name="userPassword"></param>
  7817. /// <param name="sessionKey"></param>
  7818. /// <param name="InCheckedID">盘点单ID</param>
  7819. /// <param name="BarCode">产品条码</param>
  7820. /// <returns></returns>
  7821. public ActionResult UpdateMouldChecked(string accountCode, string userCode, string userPassword, string sessionKey, int CheckedID, string BarCode)
  7822. {
  7823. ActionResult actionResult = new ActionResult();
  7824. try
  7825. {
  7826. // 验证请求头信息
  7827. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7828. // 验证失败
  7829. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7830. {
  7831. return actionResult;
  7832. }
  7833. ClientRequestEntity cre = new ClientRequestEntity();
  7834. cre.Properties["CheckedID"] = CheckedID;
  7835. cre.Properties["Barcode"] = BarCode;
  7836. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7837. () => Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.UpdateMouldChecked(sUserInfo, cre));
  7838. if (returnValue.Status == Constant.ServiceResultStatus.Success)
  7839. {
  7840. //actionResult.Result = JsonHelper.ToJson(returnValue);
  7841. actionResult.Status = (int)Constant.PDAResult.Success;
  7842. actionResult.Message = "产品【" + BarCode + "】盘点成功";
  7843. }
  7844. else
  7845. {
  7846. //actionResult.Result = JsonHelper.ToJson(returnValue);
  7847. actionResult.Status = (int)Constant.PDAResult.Fail;
  7848. actionResult.Message = returnValue.Message;
  7849. }
  7850. }
  7851. catch (Exception ex)
  7852. {
  7853. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7854. OutputLog.TraceLog(LogPriority.Error,
  7855. this.ToString(),
  7856. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7857. ex.ToString(),
  7858. LocalPath.LogExePath);
  7859. actionResult.Status = (int)Constant.PDAResult.Exception;
  7860. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7861. }
  7862. return actionResult;
  7863. }
  7864. /// <summary>
  7865. /// 获取盘点单明细
  7866. /// </summary>
  7867. /// <param name="sUserInfo"></param>
  7868. /// <returns></returns>
  7869. public ActionResult GetUpdateMouldCheckedInfo(string accountCode, string userCode, string userPassword, string sessionKey, int checkedID)
  7870. {
  7871. ActionResult actionResult = new ActionResult();
  7872. try
  7873. {
  7874. // 验证请求头信息
  7875. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7876. // 验证失败
  7877. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7878. {
  7879. return actionResult;
  7880. }
  7881. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  7882. () => Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.
  7883. GetUpdateMouldCheckedInfo(checkedID, sUserInfo));
  7884. actionResult.Result = JsonHelper.ToJson(ds);
  7885. actionResult.Status = (int)Constant.PDAResult.Success;
  7886. }
  7887. catch (Exception ex)
  7888. {
  7889. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7890. OutputLog.TraceLog(LogPriority.Error,
  7891. this.ToString(),
  7892. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7893. ex.ToString(),
  7894. LocalPath.LogExePath);
  7895. actionResult.Status = (int)Constant.PDAResult.Exception;
  7896. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7897. }
  7898. return actionResult;
  7899. }
  7900. #endregion
  7901. #region 通用接口
  7902. /// <summary>
  7903. /// PDA调用通用接口
  7904. /// </summary>
  7905. /// <param name="accountCode"></param>
  7906. /// <param name="userCode"></param>
  7907. /// <param name="userPassword"></param>
  7908. /// <param name="sessionKey"></param>
  7909. /// <param name="module"></param>
  7910. /// <param name="action"></param>
  7911. /// <param name="data"></param>
  7912. /// <returns></returns>
  7913. public ActionResult DoAction(string accountCode, string userCode, string userPassword, string sessionKey,
  7914. string module, string action, string jsonData)
  7915. {
  7916. ActionResult actionResult = null;
  7917. try
  7918. {
  7919. // 验证请求头信息
  7920. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7921. // 验证失败
  7922. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7923. {
  7924. return actionResult;
  7925. }
  7926. actionResult.Status = (int)Constant.PDAResult.Fail;
  7927. Dictionary<string, object> data = null;
  7928. if (!string.IsNullOrEmpty(jsonData) && jsonData[0] == '{')
  7929. {
  7930. data = JsonHelper.FromJson<Dictionary<string, object>>(jsonData);
  7931. }
  7932. #region PDA报表
  7933. if (module == "Report")
  7934. {
  7935. // 成型月度结算
  7936. if (action == "GetGroutingSettlementInfo")
  7937. {
  7938. DateTime month = DateTime.Now;
  7939. month = new DateTime(month.Year, month.Month, 1);
  7940. //month = new DateTime(2017, 6, 1);
  7941. int currentMonth = Convert.ToInt32(data["CurrentMonth"]);
  7942. if (currentMonth != 1)
  7943. {
  7944. month = month.AddMonths(-1);
  7945. }
  7946. ServiceResultEntity sre = PDAModuleLogic.GetGroutingSettlementInfo(sUserInfo, month);
  7947. if (sre.Status == Constant.ServiceResultStatus.Success)
  7948. {
  7949. actionResult.Status = (int)Constant.PDAResult.Success;
  7950. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  7951. }
  7952. else
  7953. {
  7954. actionResult.Status = (int)Constant.PDAResult.Fail;
  7955. actionResult.Message = sre.Message;
  7956. }
  7957. return actionResult;
  7958. }
  7959. // 成型月度结算-明细
  7960. if (action == "GetGroutingSettlementDetail")
  7961. {
  7962. DateTime month = DateTime.Now;
  7963. month = new DateTime(month.Year, month.Month, 1);
  7964. //month = new DateTime(2017, 6, 1);
  7965. int currentMonth = Convert.ToInt32(data["CurrentMonth"]);
  7966. if (currentMonth != 1)
  7967. {
  7968. month = month.AddMonths(-1);
  7969. }
  7970. string goodsCode = data["GoodsCode"].ToString();
  7971. string detailDate = data["DetailDate"].ToString();
  7972. DateTime? date = null;
  7973. if (detailDate != "合计")
  7974. {
  7975. date = DateTime.Parse(detailDate);
  7976. }
  7977. ServiceResultEntity sre = PDAModuleLogic.GetGroutingSettlementDetail(sUserInfo, month, goodsCode, date);
  7978. if (sre.Status == Constant.ServiceResultStatus.Success)
  7979. {
  7980. actionResult.Status = (int)Constant.PDAResult.Success;
  7981. actionResult.Result = JsonHelper.ToJson(sre.Data);
  7982. }
  7983. else
  7984. {
  7985. actionResult.Status = (int)Constant.PDAResult.Fail;
  7986. actionResult.Message = sre.Message;
  7987. }
  7988. return actionResult;
  7989. }
  7990. // 产成品交接汇总
  7991. if (action == "GetFinishedProductHandoverSum")
  7992. {
  7993. DateTime date = DateTime.Parse(data["date"].ToString());
  7994. ServiceResultEntity sre = ReportModuleLogic.GetRPT0030112NPDAData(date,
  7995. data["goodscode"] as string, sUserInfo);
  7996. if (sre.Status == Constant.ServiceResultStatus.Success)
  7997. {
  7998. actionResult.Status = (int)Constant.PDAResult.Success;
  7999. actionResult.Result = JsonHelper.ToJson(sre.Data);
  8000. }
  8001. else if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  8002. {
  8003. actionResult.Status = (int)Constant.PDAResult.Success;
  8004. }
  8005. else
  8006. {
  8007. actionResult.Status = (int)Constant.PDAResult.Fail;
  8008. actionResult.Message = sre.Message;
  8009. }
  8010. return actionResult;
  8011. }
  8012. //xuwei add 2019-10-21
  8013. //统计当前工号,当日,按产品编码分组统计半检返修数据数量
  8014. if (action == "GetSemiReworkDayCount")
  8015. {
  8016. //不指定参数查询当天
  8017. string dateStr = DateTime.Now.ToString("yyyy-MM-dd");
  8018. //dateStr = "2019-10-17";
  8019. //指定参数查询特定日期
  8020. if(data.ContainsKey("SemiReworkDate")) dateStr = data["SemiReworkDate"].ToString();
  8021. ServiceResultEntity sre = ReportModuleLogic.GetSemiReworkDayCount(sUserInfo, dateStr);
  8022. if (sre.Status == Constant.ServiceResultStatus.Success)
  8023. {
  8024. actionResult.Status = (int)Constant.PDAResult.Success;
  8025. actionResult.Result = JsonHelper.ToJson(sre.Data);
  8026. }
  8027. else
  8028. {
  8029. actionResult.Status = (int)Constant.PDAResult.Fail;
  8030. actionResult.Message = sre.Message;
  8031. }
  8032. return actionResult;
  8033. }
  8034. //xuwe end
  8035. return actionResult;
  8036. }
  8037. #endregion
  8038. #region 模具管理
  8039. if (module == "PC_Mould")
  8040. {
  8041. #region 模具新建画面数据初始化
  8042. if (action == "GetMouldAddInit")
  8043. {
  8044. ClientRequestEntity cre = new ClientRequestEntity();
  8045. cre.Properties["MouldID"] = 0;
  8046. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1002LoadData(sUserInfo, cre);
  8047. if (sre.Status == Constant.ServiceResultStatus.Success)
  8048. {
  8049. actionResult.Status = (int)Constant.PDAResult.Success;
  8050. actionResult.Result = JsonHelper.ToJson(sre.Data);
  8051. }
  8052. else
  8053. {
  8054. actionResult.Status = (int)Constant.PDAResult.Fail;
  8055. actionResult.Message = sre.Message;
  8056. }
  8057. return actionResult;
  8058. }
  8059. #endregion
  8060. #region 验证模具产品型号
  8061. if (action == "CheckGoodsCodeOnMould")
  8062. {
  8063. ClientRequestEntity cre = new ClientRequestEntity();
  8064. cre.Properties["GoodsCode"] = data["GoodsCode"];
  8065. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1002GoodsData(sUserInfo, cre);
  8066. if (sre.Status == Constant.ServiceResultStatus.Success &&
  8067. sre.Data.Tables[0].Rows.Count > 0)
  8068. {
  8069. actionResult.Status = (int)Constant.PDAResult.Success;
  8070. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8071. }
  8072. else
  8073. {
  8074. actionResult.Status = (int)Constant.PDAResult.Fail;
  8075. actionResult.Message = "无效产品型号";
  8076. }
  8077. return actionResult;
  8078. }
  8079. #endregion
  8080. #region 验证模具生产工号
  8081. if (action == "CheckUserCodeOnMould")
  8082. {
  8083. DataTable sre = PDAModuleLogic.GetUserCodeOnMould(sUserInfo, data["UserCode"].ToString());
  8084. if (sre != null && sre.Rows.Count > 0)
  8085. {
  8086. actionResult.Status = (int)Constant.PDAResult.Success;
  8087. actionResult.Result = JsonHelper.ToJson(sre);
  8088. }
  8089. else
  8090. {
  8091. actionResult.Status = (int)Constant.PDAResult.Fail;
  8092. actionResult.Message = "无效生产工号";
  8093. }
  8094. return actionResult;
  8095. }
  8096. #endregion
  8097. #region 新建保存
  8098. if (action == "SetMouldAdd" || action == "SetMouldEdit")
  8099. {
  8100. ClientRequestEntity cre = new ClientRequestEntity();
  8101. foreach (string item in data.Keys)
  8102. {
  8103. if (item == "ProductionDate")
  8104. {
  8105. cre.Properties.Add(item, Convert.ToDateTime(data[item]));
  8106. }
  8107. else
  8108. {
  8109. cre.Properties.Add(item, data[item]);
  8110. }
  8111. }
  8112. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1002Data(sUserInfo, cre);
  8113. if (sre.Status == Constant.ServiceResultStatus.Success)
  8114. {
  8115. actionResult.Status = (int)Constant.PDAResult.Success;
  8116. }
  8117. else
  8118. {
  8119. actionResult.Status = (int)Constant.PDAResult.Fail;
  8120. actionResult.Result = sre.OtherStatus;
  8121. actionResult.Message = sre.Message;
  8122. }
  8123. return actionResult;
  8124. }
  8125. #endregion
  8126. #region 模具编辑画面数据初始化
  8127. if (action == "GetMouldEditInfo")
  8128. {
  8129. DataTable sre = PDAModuleLogic.GetMouldEditInfo(sUserInfo, data["MouldBarcode"].ToString());
  8130. if (sre != null && sre.Rows.Count > 0)
  8131. {
  8132. actionResult.Status = (int)Constant.PDAResult.Success;
  8133. actionResult.Result = JsonHelper.ToJson(sre);
  8134. }
  8135. else
  8136. {
  8137. actionResult.Status = (int)Constant.PDAResult.Fail;
  8138. actionResult.Message = "无效模具条码";
  8139. }
  8140. return actionResult;
  8141. }
  8142. #endregion
  8143. #region 模具操作-画面初始化
  8144. if (action == "GetMouldOperationInit")
  8145. {
  8146. ClientRequestEntity cre = new ClientRequestEntity();
  8147. cre.Properties["MouldOperationType"] = data["MouldOperationType"];
  8148. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1004LoadData(sUserInfo, cre);
  8149. if (sre.Status == Constant.ServiceResultStatus.Success)
  8150. {
  8151. actionResult.Status = (int)Constant.PDAResult.Success;
  8152. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8153. }
  8154. else
  8155. {
  8156. actionResult.Status = (int)Constant.PDAResult.Fail;
  8157. actionResult.Result = sre.OtherStatus;
  8158. actionResult.Message = sre.Message;
  8159. }
  8160. return actionResult;
  8161. }
  8162. #endregion
  8163. #region 模具操作-验证模具条码
  8164. if (action == "CheckMouldBarcode")
  8165. {
  8166. ClientRequestEntity cre = new ClientRequestEntity();
  8167. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8168. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetMouldData(sUserInfo, cre);
  8169. if (sre.Status == Constant.ServiceResultStatus.Success)
  8170. {
  8171. if (sre.Data.Tables[0].Rows.Count == 0)
  8172. {
  8173. actionResult.Status = (int)Constant.PDAResult.Fail;
  8174. actionResult.Result = -1;
  8175. actionResult.Message = "模具【" + data["MouldBarcode"] + "】不存在";
  8176. return actionResult;
  8177. }
  8178. int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
  8179. int mouldStatusID = Convert.ToInt32(sre.Data.Tables[0].Rows[0]["MouldStatus"]);
  8180. string mouldStatusName = sre.Data.Tables[0].Rows[0]["MouldStatusName"].ToString();
  8181. #region 报损
  8182. if (mouldOperationType == 2)
  8183. {
  8184. if (mouldStatusID == 1 || mouldStatusID == 3)
  8185. {
  8186. actionResult.Status = (int)Constant.PDAResult.Success;
  8187. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8188. }
  8189. else
  8190. {
  8191. actionResult.Status = (int)Constant.PDAResult.Fail;
  8192. actionResult.Result = -2;
  8193. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行报损操作";
  8194. }
  8195. return actionResult;
  8196. }
  8197. #endregion
  8198. #region 撤销
  8199. if (mouldOperationType == 3)
  8200. {
  8201. if (mouldStatusID == 4)
  8202. {
  8203. actionResult.Status = (int)Constant.PDAResult.Success;
  8204. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8205. }
  8206. else
  8207. {
  8208. actionResult.Status = (int)Constant.PDAResult.Fail;
  8209. actionResult.Result = -2;
  8210. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行撤销报损操作";
  8211. }
  8212. return actionResult;
  8213. }
  8214. #endregion
  8215. #region 领用
  8216. if (mouldOperationType == 4)
  8217. {
  8218. if (mouldStatusID == 1)
  8219. {
  8220. actionResult.Status = (int)Constant.PDAResult.Success;
  8221. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8222. }
  8223. else
  8224. {
  8225. actionResult.Status = (int)Constant.PDAResult.Fail;
  8226. actionResult.Result = -2;
  8227. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行领用操作";
  8228. }
  8229. return actionResult;
  8230. }
  8231. #endregion
  8232. #region 回收
  8233. if (mouldOperationType == 5)
  8234. {
  8235. if (mouldStatusID == 3)
  8236. {
  8237. actionResult.Status = (int)Constant.PDAResult.Success;
  8238. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8239. }
  8240. else
  8241. {
  8242. actionResult.Status = (int)Constant.PDAResult.Fail;
  8243. actionResult.Result = -2;
  8244. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行回收操作";
  8245. }
  8246. return actionResult;
  8247. }
  8248. #endregion
  8249. #region 变更型号
  8250. if (mouldOperationType == -1)
  8251. {
  8252. if (mouldStatusID != 4)
  8253. {
  8254. actionResult.Status = (int)Constant.PDAResult.Success;
  8255. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8256. }
  8257. else
  8258. {
  8259. actionResult.Status = (int)Constant.PDAResult.Fail;
  8260. actionResult.Result = -2;
  8261. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行变更型号操作";
  8262. }
  8263. return actionResult;
  8264. }
  8265. #endregion
  8266. #region 替换条码
  8267. if (mouldOperationType == -2)
  8268. {
  8269. actionResult.Status = (int)Constant.PDAResult.Success;
  8270. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8271. return actionResult;
  8272. }
  8273. #endregion
  8274. return actionResult;
  8275. }
  8276. }
  8277. #endregion
  8278. #region 模具操作-保存
  8279. if (action == "SetMouldOperation")
  8280. {
  8281. ClientRequestEntity cre = new ClientRequestEntity();
  8282. cre.Properties["MouldIDs"] = string.Join(",", JsonHelper.FromJson<int[]>(data["MouldIDs"].ToString()));
  8283. cre.Properties["MouldOperationType"] = data["MouldOperationType"];
  8284. cre.Properties["Remarks"] = data["Remarks"];
  8285. int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
  8286. if (mouldOperationType == (int)Constant.MouldOperationType.ChangeGoodsCode)
  8287. {
  8288. cre.Properties["GoodsID"] = data["GoodsID"];
  8289. cre.Properties["GoodsCode"] = data["GoodsCode"];
  8290. }
  8291. else if (mouldOperationType == (int)Constant.MouldOperationType.InvToScrap)
  8292. {
  8293. cre.Properties["ScrapReason"] = data["ScrapReason"];
  8294. cre.Properties["ScrapResponsibility"] = data["ScrapRemarks"];
  8295. }
  8296. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1004Data(sUserInfo, cre);
  8297. if (sre.Status == Constant.ServiceResultStatus.Success)
  8298. {
  8299. actionResult.Status = (int)Constant.PDAResult.Success;
  8300. }
  8301. else
  8302. {
  8303. actionResult.Status = (int)Constant.PDAResult.Fail;
  8304. }
  8305. return actionResult;
  8306. }
  8307. #endregion
  8308. #region 模具操作-替换条码
  8309. if (action == "ChangedMouldBarcode")
  8310. {
  8311. ClientRequestEntity cre = new ClientRequestEntity();
  8312. cre.Properties["MouldID"] = data["MouldID"];
  8313. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8314. cre.Properties["NewMouldBarcode"] = data["NewMouldBarcode"];
  8315. cre.Properties["Remarks"] = data["Remarks"];
  8316. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1003Data(sUserInfo, cre);
  8317. if (sre.Status == Constant.ServiceResultStatus.Success)
  8318. {
  8319. actionResult.Status = (int)Constant.PDAResult.Success;
  8320. }
  8321. else
  8322. {
  8323. actionResult.Status = (int)Constant.PDAResult.Fail;
  8324. actionResult.Result = sre.OtherStatus;
  8325. actionResult.Message = sre.Message;
  8326. }
  8327. return actionResult;
  8328. }
  8329. #endregion
  8330. #region 模具跟踪表
  8331. if (action == "GetMoldTracking")
  8332. {
  8333. ClientRequestEntity cre = new ClientRequestEntity();
  8334. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8335. ServiceResultEntity sre = ReportModuleLogic.GetRPT020105Data(cre, sUserInfo);
  8336. if (sre.Status == Constant.ServiceResultStatus.Success)
  8337. {
  8338. actionResult.Status = (int)Constant.PDAResult.Success;
  8339. actionResult.Result = JsonHelper.ToJson(sre.Data);
  8340. }
  8341. else
  8342. {
  8343. actionResult.Status = (int)Constant.PDAResult.Fail;
  8344. actionResult.Message = "此模具条码不存在";
  8345. }
  8346. return actionResult;
  8347. }
  8348. #endregion
  8349. return actionResult;
  8350. }
  8351. #endregion
  8352. #region 成型线模具管理
  8353. if (module == "PC_GroutingLineMould")
  8354. {
  8355. #region 获取当前用户成型线模具管理权限
  8356. if (action == "GetGMouldStatusRight")
  8357. {
  8358. DataTable right = PDAModuleLogic.GetGMouldStatusRight(sUserInfo);
  8359. actionResult.Status = (int)Constant.PDAResult.Success;
  8360. if (right != null && right.Rows.Count > 0)
  8361. {
  8362. actionResult.Result = JsonHelper.ToJson(right);
  8363. }
  8364. return actionResult;
  8365. }
  8366. #endregion
  8367. #region 获取成型线状态等信息,和成型模具信息
  8368. if (action == "GetGroutingLineMould")
  8369. {
  8370. int? groutingLineID = null;
  8371. string groutingLineCode = null;
  8372. if (data.ContainsKey("GroutingLineID"))
  8373. {
  8374. groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8375. }
  8376. else
  8377. {
  8378. groutingLineCode = data["GroutingLineCode"] + "";
  8379. }
  8380. DataSet lineInfo = PDAModuleLogic.GetGroutingLineMould(sUserInfo, groutingLineCode, groutingLineID);
  8381. if (lineInfo == null)
  8382. {
  8383. actionResult.Status = (int)Constant.PDAResult.Fail;
  8384. actionResult.Message = "成型线【" + groutingLineCode + "】不存在或是停用状态";
  8385. }
  8386. else
  8387. {
  8388. actionResult.Status = (int)Constant.PDAResult.Success;
  8389. actionResult.Result = JsonHelper.ToJson(lineInfo);
  8390. }
  8391. return actionResult;
  8392. }
  8393. #endregion
  8394. #region 模具操作-画面初始化
  8395. if (action == "GetMouldOperationInit")
  8396. {
  8397. ClientRequestEntity cre = new ClientRequestEntity();
  8398. cre.Properties["MouldOperationType"] = 2;
  8399. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1004LoadData(sUserInfo, cre);
  8400. if (sre.Status == Constant.ServiceResultStatus.Success)
  8401. {
  8402. actionResult.Status = (int)Constant.PDAResult.Success;
  8403. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8404. }
  8405. else
  8406. {
  8407. actionResult.Status = (int)Constant.PDAResult.Fail;
  8408. actionResult.Result = sre.OtherStatus;
  8409. actionResult.Message = sre.Message;
  8410. }
  8411. return actionResult;
  8412. }
  8413. #endregion
  8414. #region 成型模具操作-画面初始化
  8415. if (action == "GetGroutingMouldOperationInit")
  8416. {
  8417. DataTable initData = PDAModuleLogic.GetGroutingMouldOperationInit(sUserInfo, 6);
  8418. if (initData != null && initData.Rows.Count > 0)
  8419. {
  8420. actionResult.Status = (int)Constant.PDAResult.Success;
  8421. Dictionary<string, string> syssetting = new Dictionary<string, string>();
  8422. foreach (DataRow item in initData.Rows)
  8423. {
  8424. syssetting.Add(item["settingcode"].ToString(), item["settingvalue"].ToString());
  8425. }
  8426. actionResult.Result = JsonHelper.ToJson(syssetting);
  8427. }
  8428. else
  8429. {
  8430. actionResult.Status = (int)Constant.PDAResult.Fail;
  8431. }
  8432. return actionResult;
  8433. }
  8434. #endregion
  8435. #region 模具操作-验证模具条码
  8436. if (action == "CheckMouldBarcode")
  8437. {
  8438. ClientRequestEntity cre = new ClientRequestEntity();
  8439. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8440. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetMouldData(sUserInfo, cre);
  8441. if (sre.Status == Constant.ServiceResultStatus.Success)
  8442. {
  8443. if (sre.Data.Tables[0].Rows.Count == 0)
  8444. {
  8445. actionResult.Status = (int)Constant.PDAResult.Fail;
  8446. actionResult.Result = -1;
  8447. actionResult.Message = "模具【" + data["MouldBarcode"] + "】不存在";
  8448. return actionResult;
  8449. }
  8450. int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
  8451. int mouldStatusID = Convert.ToInt32(sre.Data.Tables[0].Rows[0]["MouldStatus"]);
  8452. string mouldStatusName = sre.Data.Tables[0].Rows[0]["MouldStatusName"].ToString();
  8453. #region 上线
  8454. if (mouldOperationType == 6)
  8455. {
  8456. if (mouldStatusID == 1 || mouldStatusID == 3)
  8457. {
  8458. if (data.ContainsKey("GoodsID"))
  8459. {
  8460. if (sre.Data.Tables[0].Rows[0]["GoodsID"] + "" != data["GoodsID"] + "")
  8461. {
  8462. actionResult.Status = (int)Constant.PDAResult.Fail;
  8463. actionResult.Result = -3;
  8464. actionResult.Message =
  8465. "模具【" + data["MouldBarcode"] + "】的产品型号为【" +
  8466. sre.Data.Tables[0].Rows[0]["GoodsCode"] +
  8467. "】与当前不一致";
  8468. return actionResult;
  8469. }
  8470. }
  8471. actionResult.Status = (int)Constant.PDAResult.Success;
  8472. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8473. }
  8474. else
  8475. {
  8476. actionResult.Status = (int)Constant.PDAResult.Fail;
  8477. actionResult.Result = -2;
  8478. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行报损操作";
  8479. }
  8480. return actionResult;
  8481. }
  8482. #endregion
  8483. return actionResult;
  8484. }
  8485. }
  8486. #endregion
  8487. #region 停用
  8488. if (action == "StopGroutingLineDetail")
  8489. {
  8490. if (data == null || !data.ContainsKey("Details"))
  8491. {
  8492. actionResult.Status = (int)Constant.PDAResult.Fail;
  8493. actionResult.Message = "参数错误";
  8494. return actionResult;
  8495. }
  8496. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8497. DataTable gTable = new DataTable();
  8498. gTable.Columns.Add("GroutingLineID", typeof(int));
  8499. gTable.Columns.Add("GroutingLineCode");
  8500. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8501. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8502. gTable.Columns.Add("GroutingMouldCode");
  8503. gTable.Columns.Add("RecordRemarks");
  8504. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8505. gTable.Columns.Add("MouldID", typeof(int));
  8506. gTable.Columns.Add("MouldCode");
  8507. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8508. string groutingLineCode = data["GroutingLineCode"] + "";
  8509. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8510. foreach (Dictionary<string, object> item in details)
  8511. {
  8512. int? mouldID = null;
  8513. if (item.ContainsKey("MouldID"))
  8514. {
  8515. mouldID = Convert.ToInt32(item["MouldID"]);
  8516. if (mouldID == 0)
  8517. {
  8518. mouldID = null;
  8519. }
  8520. }
  8521. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8522. item["GLineDetailID"], item["GLineDetailCode"],
  8523. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8524. mouldID, item["MouldCode"]);
  8525. }
  8526. int result = PCModuleLogicDAL.StopGroutingLineDetail(gTable, sUserInfo);
  8527. if (result > 0)
  8528. {
  8529. actionResult.Status = (int)Constant.PDAResult.Success;
  8530. }
  8531. else
  8532. {
  8533. actionResult.Status = (int)Constant.PDAResult.Fail;
  8534. actionResult.Result = result;
  8535. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8536. return actionResult;
  8537. }
  8538. return actionResult;
  8539. }
  8540. #endregion
  8541. #region 启用
  8542. if (action == "StartGroutingLineDetail")
  8543. {
  8544. if (data == null || !data.ContainsKey("Details"))
  8545. {
  8546. actionResult.Status = (int)Constant.PDAResult.Fail;
  8547. actionResult.Message = "参数错误";
  8548. return actionResult;
  8549. }
  8550. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8551. DataTable gTable = new DataTable();
  8552. gTable.Columns.Add("GroutingLineID", typeof(int));
  8553. gTable.Columns.Add("GroutingLineCode");
  8554. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8555. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8556. gTable.Columns.Add("GroutingMouldCode");
  8557. gTable.Columns.Add("RecordRemarks");
  8558. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8559. gTable.Columns.Add("MouldID", typeof(int));
  8560. gTable.Columns.Add("MouldCode");
  8561. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8562. string groutingLineCode = data["GroutingLineCode"] + "";
  8563. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8564. foreach (Dictionary<string, object> item in details)
  8565. {
  8566. int? mouldID = null;
  8567. if (item.ContainsKey("MouldID"))
  8568. {
  8569. mouldID = Convert.ToInt32(item["MouldID"]);
  8570. if (mouldID == 0)
  8571. {
  8572. mouldID = null;
  8573. }
  8574. }
  8575. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8576. item["GLineDetailID"], item["GLineDetailCode"],
  8577. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8578. mouldID, item["MouldCode"]);
  8579. }
  8580. int result = PCModuleLogicDAL.StartGroutingLineDetail(gTable, sUserInfo);
  8581. if (result > 0)
  8582. {
  8583. actionResult.Status = (int)Constant.PDAResult.Success;
  8584. }
  8585. else
  8586. {
  8587. actionResult.Status = (int)Constant.PDAResult.Fail;
  8588. actionResult.Result = result;
  8589. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8590. return actionResult;
  8591. }
  8592. return actionResult;
  8593. }
  8594. #endregion
  8595. #region 维修
  8596. if (action == "RepairStartGroutingLineDetail")
  8597. {
  8598. if (data == null || !data.ContainsKey("Details"))
  8599. {
  8600. actionResult.Status = (int)Constant.PDAResult.Fail;
  8601. actionResult.Message = "参数错误";
  8602. return actionResult;
  8603. }
  8604. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8605. DataTable gTable = new DataTable();
  8606. gTable.Columns.Add("GroutingLineID", typeof(int));
  8607. gTable.Columns.Add("GroutingLineCode");
  8608. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8609. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8610. gTable.Columns.Add("GroutingMouldCode");
  8611. gTable.Columns.Add("RecordRemarks");
  8612. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8613. gTable.Columns.Add("MouldID", typeof(int));
  8614. gTable.Columns.Add("MouldCode");
  8615. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8616. string groutingLineCode = data["GroutingLineCode"] + "";
  8617. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8618. foreach (Dictionary<string, object> item in details)
  8619. {
  8620. int? mouldID = null;
  8621. if (item.ContainsKey("MouldID"))
  8622. {
  8623. mouldID = Convert.ToInt32(item["MouldID"]);
  8624. if (mouldID == 0)
  8625. {
  8626. mouldID = null;
  8627. }
  8628. }
  8629. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8630. item["GLineDetailID"], item["GLineDetailCode"],
  8631. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8632. mouldID, item["MouldCode"]);
  8633. }
  8634. int result = PCModuleLogicDAL.RepairStartGroutingLineDetail(gTable, sUserInfo);
  8635. if (result > 0)
  8636. {
  8637. actionResult.Status = (int)Constant.PDAResult.Success;
  8638. }
  8639. else
  8640. {
  8641. actionResult.Status = (int)Constant.PDAResult.Fail;
  8642. actionResult.Result = result;
  8643. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8644. return actionResult;
  8645. }
  8646. return actionResult;
  8647. }
  8648. #endregion
  8649. #region 结束维修
  8650. if (action == "RepairEndGroutingLineDetail")
  8651. {
  8652. if (data == null || !data.ContainsKey("Details"))
  8653. {
  8654. actionResult.Status = (int)Constant.PDAResult.Fail;
  8655. actionResult.Message = "参数错误";
  8656. return actionResult;
  8657. }
  8658. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8659. DataTable gTable = new DataTable();
  8660. gTable.Columns.Add("GroutingLineID", typeof(int));
  8661. gTable.Columns.Add("GroutingLineCode");
  8662. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8663. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8664. gTable.Columns.Add("GroutingMouldCode");
  8665. gTable.Columns.Add("RecordRemarks");
  8666. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8667. gTable.Columns.Add("MouldID", typeof(int));
  8668. gTable.Columns.Add("MouldCode");
  8669. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8670. string groutingLineCode = data["GroutingLineCode"] + "";
  8671. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8672. foreach (Dictionary<string, object> item in details)
  8673. {
  8674. int? mouldID = null;
  8675. if (item.ContainsKey("MouldID"))
  8676. {
  8677. mouldID = Convert.ToInt32(item["MouldID"]);
  8678. if (mouldID == 0)
  8679. {
  8680. mouldID = null;
  8681. }
  8682. }
  8683. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8684. item["GLineDetailID"], item["GLineDetailCode"],
  8685. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8686. mouldID, item["MouldCode"]);
  8687. }
  8688. int result = PCModuleLogicDAL.RepairEndGroutingLineDetail(gTable, sUserInfo);
  8689. if (result > 0)
  8690. {
  8691. actionResult.Status = (int)Constant.PDAResult.Success;
  8692. }
  8693. else
  8694. {
  8695. actionResult.Status = (int)Constant.PDAResult.Fail;
  8696. actionResult.Result = result;
  8697. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8698. return actionResult;
  8699. }
  8700. return actionResult;
  8701. }
  8702. #endregion
  8703. #region 换模
  8704. if (action == "ChangeGMouldStartGroutingLineDetail")
  8705. {
  8706. if (data == null || !data.ContainsKey("Details"))
  8707. {
  8708. actionResult.Status = (int)Constant.PDAResult.Fail;
  8709. actionResult.Message = "参数错误";
  8710. return actionResult;
  8711. }
  8712. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8713. DataTable gTable = new DataTable();
  8714. gTable.Columns.Add("GroutingLineID", typeof(int));
  8715. gTable.Columns.Add("GroutingLineCode");
  8716. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8717. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8718. gTable.Columns.Add("GroutingMouldCode");
  8719. gTable.Columns.Add("RecordRemarks");
  8720. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8721. gTable.Columns.Add("MouldID", typeof(int));
  8722. gTable.Columns.Add("MouldCode");
  8723. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8724. gTable.Columns.Add("MouldStatus", typeof(int));
  8725. gTable.Columns.Add("ScrapReason", typeof(int));
  8726. gTable.Columns.Add("ScrapResponsibility");
  8727. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8728. string groutingLineCode = data["GroutingLineCode"] + "";
  8729. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8730. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  8731. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  8732. string scrapResponsibility = data["ScrapRemarks"] + "";
  8733. foreach (Dictionary<string, object> item in details)
  8734. {
  8735. int? mouldID = null;
  8736. if (item.ContainsKey("MouldID"))
  8737. {
  8738. mouldID = Convert.ToInt32(item["MouldID"]);
  8739. if (mouldID == 0)
  8740. {
  8741. mouldID = null;
  8742. }
  8743. }
  8744. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8745. item["GLineDetailID"], item["GLineDetailCode"],
  8746. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8747. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  8748. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  8749. }
  8750. int result = PCModuleLogicDAL.ChangeGMouldStartGroutingLineDetail(gTable, sUserInfo);
  8751. if (result > 0)
  8752. {
  8753. actionResult.Status = (int)Constant.PDAResult.Success;
  8754. }
  8755. else
  8756. {
  8757. actionResult.Status = (int)Constant.PDAResult.Fail;
  8758. actionResult.Result = result;
  8759. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8760. return actionResult;
  8761. }
  8762. return actionResult;
  8763. }
  8764. #endregion
  8765. #region 变产
  8766. if (action == "UpdateLineStartGroutingLineDetail")
  8767. {
  8768. if (data == null || !data.ContainsKey("Details"))
  8769. {
  8770. actionResult.Status = (int)Constant.PDAResult.Fail;
  8771. actionResult.Message = "参数错误";
  8772. return actionResult;
  8773. }
  8774. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8775. DataTable gTable = new DataTable();
  8776. gTable.Columns.Add("GroutingLineID", typeof(int));
  8777. gTable.Columns.Add("GroutingLineCode");
  8778. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8779. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8780. gTable.Columns.Add("GroutingMouldCode");
  8781. gTable.Columns.Add("RecordRemarks");
  8782. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8783. gTable.Columns.Add("MouldID", typeof(int));
  8784. gTable.Columns.Add("MouldCode");
  8785. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8786. gTable.Columns.Add("MouldStatus", typeof(int));
  8787. gTable.Columns.Add("ScrapReason", typeof(int));
  8788. gTable.Columns.Add("ScrapResponsibility");
  8789. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8790. string groutingLineCode = data["GroutingLineCode"] + "";
  8791. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8792. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  8793. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  8794. string scrapResponsibility = data["ScrapRemarks"] + "";
  8795. foreach (Dictionary<string, object> item in details)
  8796. {
  8797. int? mouldID = null;
  8798. if (item.ContainsKey("MouldID"))
  8799. {
  8800. mouldID = Convert.ToInt32(item["MouldID"]);
  8801. if (mouldID == 0)
  8802. {
  8803. mouldID = null;
  8804. }
  8805. }
  8806. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8807. item["GLineDetailID"], item["GLineDetailCode"],
  8808. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8809. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  8810. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  8811. }
  8812. int result = PCModuleLogicDAL.UpdateLineStartGroutingLineDetail(gTable, sUserInfo);
  8813. if (result > 0)
  8814. {
  8815. actionResult.Status = (int)Constant.PDAResult.Success;
  8816. }
  8817. else
  8818. {
  8819. actionResult.Status = (int)Constant.PDAResult.Fail;
  8820. actionResult.Result = result;
  8821. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8822. return actionResult;
  8823. }
  8824. return actionResult;
  8825. }
  8826. #endregion
  8827. #region 整线变产
  8828. if (action == "UpdateAllLineStartGroutingLineDetail")
  8829. {
  8830. if (data == null || !data.ContainsKey("Details"))
  8831. {
  8832. actionResult.Status = (int)Constant.PDAResult.Fail;
  8833. actionResult.Message = "参数错误";
  8834. return actionResult;
  8835. }
  8836. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8837. DataTable gTable = new DataTable();
  8838. gTable.Columns.Add("GroutingLineID", typeof(int));
  8839. gTable.Columns.Add("GroutingLineCode");
  8840. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8841. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8842. gTable.Columns.Add("GroutingMouldCode");
  8843. gTable.Columns.Add("RecordRemarks");
  8844. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8845. gTable.Columns.Add("MouldID", typeof(int));
  8846. gTable.Columns.Add("MouldCode");
  8847. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8848. gTable.Columns.Add("MouldStatus", typeof(int));
  8849. gTable.Columns.Add("ScrapReason", typeof(int));
  8850. gTable.Columns.Add("ScrapResponsibility");
  8851. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8852. string groutingLineCode = data["GroutingLineCode"] + "";
  8853. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8854. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  8855. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  8856. string scrapResponsibility = data["ScrapRemarks"] + "";
  8857. foreach (Dictionary<string, object> item in details)
  8858. {
  8859. int? mouldID = null;
  8860. if (item.ContainsKey("MouldID"))
  8861. {
  8862. mouldID = Convert.ToInt32(item["MouldID"]);
  8863. if (mouldID == 0)
  8864. {
  8865. mouldID = null;
  8866. }
  8867. }
  8868. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8869. item["GLineDetailID"], item["GLineDetailCode"],
  8870. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8871. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  8872. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  8873. }
  8874. int result = PCModuleLogicDAL.UpdateAllLineStartGroutingLineDetail(gTable, groutingLineID, lineOPTimeStamp, sUserInfo);
  8875. if (result > 0)
  8876. {
  8877. actionResult.Status = (int)Constant.PDAResult.Success;
  8878. }
  8879. else
  8880. {
  8881. actionResult.Status = (int)Constant.PDAResult.Fail;
  8882. actionResult.Result = result;
  8883. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8884. return actionResult;
  8885. }
  8886. return actionResult;
  8887. }
  8888. #endregion
  8889. #region 卸模
  8890. if (action == "UnloadGroutingLineDetail")
  8891. {
  8892. if (data == null || !data.ContainsKey("Details"))
  8893. {
  8894. actionResult.Status = (int)Constant.PDAResult.Fail;
  8895. actionResult.Message = "参数错误";
  8896. return actionResult;
  8897. }
  8898. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8899. DataTable gTable = new DataTable();
  8900. gTable.Columns.Add("GroutingLineID", typeof(int));
  8901. gTable.Columns.Add("GroutingLineCode");
  8902. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8903. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8904. gTable.Columns.Add("GroutingMouldCode");
  8905. gTable.Columns.Add("RecordRemarks");
  8906. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8907. gTable.Columns.Add("MouldID", typeof(int));
  8908. gTable.Columns.Add("MouldCode");
  8909. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8910. gTable.Columns.Add("MouldStatus", typeof(int));
  8911. gTable.Columns.Add("ScrapReason", typeof(int));
  8912. gTable.Columns.Add("ScrapResponsibility");
  8913. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8914. string groutingLineCode = data["GroutingLineCode"] + "";
  8915. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8916. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  8917. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  8918. string scrapResponsibility = data["ScrapRemarks"] + "";
  8919. foreach (Dictionary<string, object> item in details)
  8920. {
  8921. int? mouldID = null;
  8922. if (item.ContainsKey("MouldID"))
  8923. {
  8924. mouldID = Convert.ToInt32(item["MouldID"]);
  8925. if (mouldID == 0)
  8926. {
  8927. mouldID = null;
  8928. }
  8929. }
  8930. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8931. item["GLineDetailID"], item["GLineDetailCode"],
  8932. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8933. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  8934. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  8935. }
  8936. int result = PCModuleLogicDAL.UnloadGroutingLineDetail(gTable, sUserInfo);
  8937. if (result > 0)
  8938. {
  8939. actionResult.Status = (int)Constant.PDAResult.Success;
  8940. }
  8941. else
  8942. {
  8943. actionResult.Status = (int)Constant.PDAResult.Fail;
  8944. actionResult.Result = result;
  8945. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8946. return actionResult;
  8947. }
  8948. return actionResult;
  8949. }
  8950. #endregion
  8951. #region 结束换模
  8952. if (action == "ChangeGMouldEndGroutingLineDetail")
  8953. {
  8954. if (data == null || !data.ContainsKey("Details"))
  8955. {
  8956. actionResult.Status = (int)Constant.PDAResult.Fail;
  8957. actionResult.Message = "参数错误";
  8958. return actionResult;
  8959. }
  8960. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8961. DataTable gTable = new DataTable();
  8962. gTable.Columns.Add("GroutingLineID", typeof(int));
  8963. gTable.Columns.Add("GroutingLineCode");
  8964. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8965. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8966. gTable.Columns.Add("GroutingMouldCode");
  8967. gTable.Columns.Add("RreasonRemarks");
  8968. gTable.Columns.Add("RecordRemarks");
  8969. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8970. gTable.Columns.Add("MouldID", typeof(int));
  8971. gTable.Columns.Add("MouldCode");
  8972. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8973. gTable.Columns.Add("GoodsID", typeof(int));
  8974. gTable.Columns.Add("GoodsCode");
  8975. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  8976. gTable.Columns.Add("GroutingCount", typeof(int));
  8977. gTable.Columns.Add("MouldSource");
  8978. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8979. string groutingLineCode = data["GroutingLineCode"] + "";
  8980. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8981. foreach (Dictionary<string, object> item in details)
  8982. {
  8983. int? mouldID = null;
  8984. if (item.ContainsKey("MouldID"))
  8985. {
  8986. mouldID = Convert.ToInt32(item["MouldID"]);
  8987. if (mouldID == 0)
  8988. {
  8989. mouldID = null;
  8990. }
  8991. }
  8992. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8993. item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"],
  8994. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8995. mouldID, item["MouldCode"], item["MouldOutputNo"],
  8996. item["GoodsID"], item["GoodsCode"],
  8997. item["StandardGroutingCount"], item["GroutingCount"],
  8998. (mouldID == null ? "0" : "1"));
  8999. }
  9000. ServiceResultEntity result = PCModuleLogicDAL.ChangeGMouldEndGroutingLineDetail(gTable, sUserInfo);
  9001. if (result.Status == Constant.ServiceResultStatus.Success)
  9002. {
  9003. actionResult.Status = (int)Constant.PDAResult.Success;
  9004. }
  9005. else if (result.OtherStatus == -100)
  9006. {
  9007. actionResult.Status = (int)Constant.PDAResult.Fail;
  9008. actionResult.Result = -100;
  9009. actionResult.Message = result.Message;
  9010. return actionResult;
  9011. }
  9012. else
  9013. {
  9014. actionResult.Status = (int)Constant.PDAResult.Fail;
  9015. actionResult.Result = -500;
  9016. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9017. return actionResult;
  9018. }
  9019. return actionResult;
  9020. }
  9021. #endregion
  9022. #region 结束变产
  9023. if (action == "UpdateLineEndGroutingLineDetail")
  9024. {
  9025. if (data == null || !data.ContainsKey("Details"))
  9026. {
  9027. actionResult.Status = (int)Constant.PDAResult.Fail;
  9028. actionResult.Message = "参数错误";
  9029. return actionResult;
  9030. }
  9031. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9032. DataTable gTable = new DataTable();
  9033. gTable.Columns.Add("GroutingLineID", typeof(int));
  9034. gTable.Columns.Add("GroutingLineCode");
  9035. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9036. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9037. gTable.Columns.Add("GroutingMouldCode");
  9038. gTable.Columns.Add("RreasonRemarks");
  9039. gTable.Columns.Add("RecordRemarks");
  9040. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9041. gTable.Columns.Add("MouldID", typeof(int));
  9042. gTable.Columns.Add("MouldCode");
  9043. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9044. gTable.Columns.Add("GoodsID", typeof(int));
  9045. gTable.Columns.Add("GoodsCode");
  9046. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  9047. gTable.Columns.Add("GroutingCount", typeof(int));
  9048. gTable.Columns.Add("MouldSource");
  9049. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9050. string groutingLineCode = data["GroutingLineCode"] + "";
  9051. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9052. foreach (Dictionary<string, object> item in details)
  9053. {
  9054. int? mouldID = null;
  9055. if (item.ContainsKey("MouldID"))
  9056. {
  9057. mouldID = Convert.ToInt32(item["MouldID"]);
  9058. if (mouldID == 0)
  9059. {
  9060. mouldID = null;
  9061. }
  9062. }
  9063. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9064. item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"],
  9065. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  9066. mouldID, item["MouldCode"], item["MouldOutputNo"],
  9067. item["GoodsID"], item["GoodsCode"],
  9068. item["StandardGroutingCount"], item["GroutingCount"],
  9069. (mouldID == null ? "0" : "1"));
  9070. }
  9071. ServiceResultEntity result = PCModuleLogicDAL.UpdateLineEndGroutingLineDetail(gTable, 0, sUserInfo);
  9072. if (result.Status == Constant.ServiceResultStatus.Success)
  9073. {
  9074. actionResult.Status = (int)Constant.PDAResult.Success;
  9075. }
  9076. else if (result.OtherStatus == -100)
  9077. {
  9078. actionResult.Status = (int)Constant.PDAResult.Fail;
  9079. actionResult.Result = -100;
  9080. actionResult.Message = result.Message;
  9081. return actionResult;
  9082. }
  9083. else
  9084. {
  9085. actionResult.Status = (int)Constant.PDAResult.Fail;
  9086. actionResult.Result = -500;
  9087. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9088. return actionResult;
  9089. }
  9090. return actionResult;
  9091. }
  9092. #endregion
  9093. #region 结束整线变产
  9094. if (action == "UpdateAllLineEndGroutingLineDetail")
  9095. {
  9096. if (data == null || !data.ContainsKey("Details"))
  9097. {
  9098. actionResult.Status = (int)Constant.PDAResult.Fail;
  9099. actionResult.Message = "参数错误";
  9100. return actionResult;
  9101. }
  9102. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9103. DataTable gTable = new DataTable();
  9104. gTable.Columns.Add("GroutingLineID", typeof(int));
  9105. gTable.Columns.Add("GroutingLineCode");
  9106. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9107. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9108. gTable.Columns.Add("GroutingMouldCode");
  9109. gTable.Columns.Add("Remarks");
  9110. gTable.Columns.Add("RecordRemarks");
  9111. //gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9112. gTable.Columns.Add("MouldID", typeof(int));
  9113. gTable.Columns.Add("MouldCode");
  9114. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9115. gTable.Columns.Add("GoodsID", typeof(int));
  9116. gTable.Columns.Add("GoodsCode");
  9117. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  9118. gTable.Columns.Add("GroutingCount", typeof(int));
  9119. gTable.Columns.Add("MouldSource");
  9120. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9121. string groutingLineCode = data["GroutingLineCode"] + "";
  9122. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9123. foreach (Dictionary<string, object> item in details)
  9124. {
  9125. int? mouldID = null;
  9126. if (item.ContainsKey("MouldID"))
  9127. {
  9128. mouldID = Convert.ToInt32(item["MouldID"]);
  9129. if (mouldID == 0)
  9130. {
  9131. mouldID = null;
  9132. }
  9133. }
  9134. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9135. item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"],
  9136. item["RecordRemarks"], //Convert.ToDateTime(item["OPTimeStamp"]),
  9137. mouldID, item["MouldCode"], item["MouldOutputNo"],
  9138. item["GoodsID"], item["GoodsCode"],
  9139. item["StandardGroutingCount"], item["GroutingCount"],
  9140. (mouldID == null ? "0" : "1"));
  9141. }
  9142. ServiceResultEntity result = PCModuleLogicDAL.UpdateAllLineEndGroutingLineDetail(gTable, null, groutingLineID, lineOPTimeStamp, sUserInfo);
  9143. if (result.Status == Constant.ServiceResultStatus.Success)
  9144. {
  9145. actionResult.Status = (int)Constant.PDAResult.Success;
  9146. }
  9147. else if (result.OtherStatus == -100)
  9148. {
  9149. actionResult.Status = (int)Constant.PDAResult.Fail;
  9150. actionResult.Result = -100;
  9151. actionResult.Message = result.Message;
  9152. return actionResult;
  9153. }
  9154. else
  9155. {
  9156. actionResult.Status = (int)Constant.PDAResult.Fail;
  9157. actionResult.Result = -500;
  9158. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9159. return actionResult;
  9160. }
  9161. return actionResult;
  9162. }
  9163. #endregion
  9164. #region 上模
  9165. if (action == "UpdateGroutingLine_AddMould")
  9166. {
  9167. if (data == null || !data.ContainsKey("Details"))
  9168. {
  9169. actionResult.Status = (int)Constant.PDAResult.Fail;
  9170. actionResult.Message = "参数错误";
  9171. return actionResult;
  9172. }
  9173. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9174. DataTable gTable = new DataTable();
  9175. gTable.Columns.Add("GroutingLineID", typeof(int));
  9176. gTable.Columns.Add("GroutingLineCode");
  9177. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9178. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9179. gTable.Columns.Add("GroutingMouldCode");
  9180. gTable.Columns.Add("Remarks");
  9181. gTable.Columns.Add("RecordRemarks");
  9182. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9183. gTable.Columns.Add("MouldID", typeof(int));
  9184. gTable.Columns.Add("MouldCode");
  9185. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9186. gTable.Columns.Add("GoodsID", typeof(int));
  9187. gTable.Columns.Add("GoodsCode");
  9188. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  9189. gTable.Columns.Add("GroutingCount", typeof(int));
  9190. gTable.Columns.Add("MouldSource");
  9191. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9192. string groutingLineCode = data["GroutingLineCode"] + "";
  9193. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9194. foreach (Dictionary<string, object> item in details)
  9195. {
  9196. int? mouldID = null;
  9197. if (item.ContainsKey("MouldID"))
  9198. {
  9199. mouldID = Convert.ToInt32(item["MouldID"]);
  9200. if (mouldID == 0)
  9201. {
  9202. mouldID = null;
  9203. }
  9204. }
  9205. int gldID = Convert.ToInt32(item["GLineDetailID"]);
  9206. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9207. gldID, item["GLineDetailCode"],
  9208. item["DetailRemarks"], item["RecordRemarks"],
  9209. (gldID > 0 ? (object)Convert.ToDateTime(item["OPTimeStamp"]) : null),
  9210. mouldID, item["MouldCode"], item["MouldOutputNo"],
  9211. item["GoodsID"], item["GoodsCode"],
  9212. item["StandardGroutingCount"], item["GroutingCount"],
  9213. (mouldID == null ? "0" : "1"));
  9214. }
  9215. ServiceResultEntity result = PCModuleLogicDAL.UpdateGroutingLine_AddMould(groutingLineID, groutingLineCode, lineOPTimeStamp, gTable, sUserInfo);
  9216. if (result.Status == Constant.ServiceResultStatus.Success)
  9217. {
  9218. actionResult.Status = (int)Constant.PDAResult.Success;
  9219. }
  9220. else if (result.OtherStatus == -2 || result.OtherStatus == -100)
  9221. {
  9222. actionResult.Status = (int)Constant.PDAResult.Fail;
  9223. actionResult.Result = result.OtherStatus;
  9224. actionResult.Message = result.Message;
  9225. return actionResult;
  9226. }
  9227. else
  9228. {
  9229. actionResult.Status = (int)Constant.PDAResult.Fail;
  9230. actionResult.Result = -500;
  9231. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9232. return actionResult;
  9233. }
  9234. return actionResult;
  9235. }
  9236. #endregion
  9237. return actionResult;
  9238. }
  9239. #endregion
  9240. #region 包装装板限制
  9241. if (module == "FinishedLoadingCar")
  9242. {
  9243. if (action == "GetSetting")
  9244. {
  9245. ClientRequestEntity cre = new ClientRequestEntity();
  9246. cre.Properties["GoodsID"] = data["GoodsID"];
  9247. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetFinishedLoadingCarSetting(sUserInfo, cre);
  9248. if (sre.Status == Constant.ServiceResultStatus.Success)
  9249. {
  9250. actionResult.Status = (int)Constant.PDAResult.Success;
  9251. foreach (DataRow item in sre.Data.Tables[0].Rows)
  9252. {
  9253. if (item["settingcode"].ToString() == "S_PM_011")
  9254. {
  9255. cre.Properties["S_PM_011"] = item["settingvalue"];
  9256. }
  9257. else if (item["settingcode"].ToString() == "S_PM_012")
  9258. {
  9259. cre.Properties["S_PM_012"] = item["settingvalue"];
  9260. }
  9261. else if (item["settingcode"].ToString() == "S_PM_013")
  9262. {
  9263. cre.Properties["S_PM_013"] = item["settingvalue"];
  9264. }
  9265. }
  9266. cre.Properties["PlatelitNum"] = sre.Result;
  9267. actionResult.Result = JsonHelper.ToJson(cre.Properties);
  9268. }
  9269. else
  9270. {
  9271. actionResult.Status = (int)Constant.PDAResult.Fail;
  9272. actionResult.Message = "";
  9273. }
  9274. return actionResult;
  9275. }
  9276. }
  9277. #endregion
  9278. #region 成型报损
  9279. if (module == "GroutingScrapProduct")
  9280. {
  9281. // 查询注浆日报明细表
  9282. if ("GetGroutingDailyDetail" == action)
  9283. {
  9284. ClientRequestEntity cre = new ClientRequestEntity();
  9285. cre.NameSpace = module;
  9286. cre.Name = action;
  9287. if (!string.IsNullOrEmpty(jsonData))
  9288. {
  9289. cre.Properties["BarCode"] = data["BarCode"];
  9290. }
  9291. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetGroutingDailyDetail(cre, sUserInfo);
  9292. //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9293. actionResult.Status = (int)Constant.PDAResult.Success;
  9294. if (sre == null || sre.Data == null || sre.Data.Tables.Count == 0
  9295. || sre.Data.Tables[0].Rows.Count == 0)
  9296. {
  9297. actionResult.Message = "未查询到该产品信息,请确认该产品是否已经进行注浆!";
  9298. actionResult.Status = (int)Constant.PDAResult.Fail;
  9299. }
  9300. else
  9301. {
  9302. DataRow _barCodeRow = sre.Data.Tables[0].Rows[0];
  9303. // 判断是否进行了注浆
  9304. if ("0".Equals(_barCodeRow["GroutingFlag"]))
  9305. {
  9306. actionResult.Message = "该产品还未进行注浆!";
  9307. actionResult.Status = (int)Constant.PDAResult.Fail;
  9308. }
  9309. // 判断是否进行了交坯
  9310. if ("1".Equals(_barCodeRow["DeliverFlag"]))
  9311. {
  9312. actionResult.Message = "该产品已经交坯!";
  9313. actionResult.Status = (int)Constant.PDAResult.Fail;
  9314. }
  9315. // 判断是否已经报损
  9316. if ("1".Equals(_barCodeRow["ScrapFlag"]))
  9317. {
  9318. actionResult.Message = "该产品已经报损!";
  9319. actionResult.Status = (int)Constant.PDAResult.Fail;
  9320. }
  9321. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9322. }
  9323. }
  9324. // 获取成型报损原因
  9325. else if ("GetScrapReasonData" == action)
  9326. {
  9327. ClientRequestEntity cre = new ClientRequestEntity();
  9328. cre.NameSpace = module;
  9329. cre.Name = action;
  9330. ServiceResultEntity sre = SystemModuleLogic.GetScrapReasonData(cre, sUserInfo);
  9331. actionResult.Status = (int)Constant.PDAResult.Success;
  9332. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9333. }
  9334. // 保存成型报损
  9335. else if ("SaveGroutingScrapProduct" == action)
  9336. {
  9337. ClientRequestEntity cre = new ClientRequestEntity();
  9338. cre.NameSpace = module;
  9339. cre.Name = action;
  9340. if (!string.IsNullOrEmpty(jsonData))
  9341. {
  9342. // DataSet returnData = JsonHelper.FromJson<DataSet>(jsonData);
  9343. DataTable dt = JsonHelper.FromJson<DataTable>(data["Table"] + "");
  9344. DataTable dtResponsible = JsonHelper.FromJson<DataTable>(data["Table1"] + "");
  9345. if (dt != null && dt.Rows.Count > 0)
  9346. {
  9347. // 总单信息
  9348. DataRow properties = dt.Rows[0];
  9349. cre.Properties["BarCode"] = properties["BarCode"]; // 产品条码
  9350. cre.Properties["GoodsID"] = properties["GoodsID"]; // 产品ID
  9351. cre.Properties["GoodsCode"] = properties["GoodsCode"]; // 产品编码
  9352. cre.Properties["GoodsName"] = properties["GoodsName"]; // 产品名称
  9353. cre.Properties["GroutingDailyID"] = properties["GroutingDailyID"]; // 注浆日报ID
  9354. cre.Properties["GroutingDailyDetailID"] = properties["GroutingDailyDetailID"]; // 注浆日报明细ID
  9355. cre.Properties["GroutingDate"] = properties["GroutingDate"]; // 注浆日期
  9356. cre.Properties["GroutingLineID"] = properties["GroutingLineID"]; // 成型生产线ID
  9357. cre.Properties["GroutingLineCode"] = properties["GroutingLineCode"]; // 成型生产线编码
  9358. cre.Properties["GroutingLineName"] = properties["GroutingLineName"]; // 成型生产线名称
  9359. cre.Properties["GMouldTypeID"] = properties["GMouldTypeID"]; // 成型线类型ID
  9360. cre.Properties["GroutingLineDetailID"] = properties["GroutingLineDetailID"]; // 成型生产线明细ID
  9361. cre.Properties["GroutingMouldCode"] = properties["GroutingMouldCode"]; // 注浆模具编号
  9362. cre.Properties["MouldCode"] = properties["MouldCode"]; // 模具编号
  9363. cre.Properties["GroutingUserID"] = properties["GroutingUserID"]; // 注浆工号ID
  9364. cre.Properties["GroutingUserCode"] = properties["GroutingUserCode"]; // 注浆工号编码
  9365. cre.Properties["GroutingNum"] = properties["GroutingNum"]; // 注浆次数
  9366. cre.Properties["ScrapType"] = properties["ScrapType"]; // 损坯类型
  9367. cre.Properties["ScrapDate"] = properties["ScrapDate"]; // 报损日期
  9368. cre.Properties["ScrapRreasonID"] = properties["ScrapRreasonID"]; // 报损日期
  9369. cre.Properties["ResponUserID"] = properties["ResponUserID"]; // 损坯工号
  9370. cre.Properties["ResponUserCode"] = properties["ResponUserCode"];
  9371. cre.Properties["Remarks"] = properties["Remarks"]; // 备注
  9372. cre.Properties["AuditStatus"] = properties["AuditStatus"]; // 审批状态
  9373. // 责任员工
  9374. cre.Data = new DataSet();
  9375. //DataTable returnTable = returnData.Tables[1].Copy();
  9376. cre.Data.Tables.Add(dtResponsible);
  9377. }
  9378. }
  9379. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveGroutingScrapProduct(cre, sUserInfo);
  9380. if (sre.Status == Constant.ServiceResultStatus.Success)
  9381. {
  9382. actionResult.Status = (int)Constant.PDAResult.Success;
  9383. actionResult.Result = sre.Result;
  9384. }
  9385. else
  9386. {
  9387. actionResult.Status = (int)Constant.PDAResult.Fail;
  9388. actionResult.Result = sre.OtherStatus;
  9389. actionResult.Message = sre.Message;
  9390. }
  9391. }
  9392. // 获取成型报损信息 用于撤销使用
  9393. else if ("GetGroutingScrapProduct" == action)
  9394. {
  9395. ClientRequestEntity cre = new ClientRequestEntity();
  9396. cre.NameSpace = module;
  9397. cre.Name = action;
  9398. if (!string.IsNullOrEmpty(jsonData))
  9399. {
  9400. cre.Properties["BarCode"] = data["BarCode"];
  9401. }
  9402. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetGroutingScrapProduct(cre, sUserInfo);
  9403. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9404. actionResult.Status = (int)Constant.PDAResult.Success;
  9405. }
  9406. //xuwei add 2020-03-23
  9407. //获取成型报损信息 用于撤销使用 支持 浆日报直接报损
  9408. else if ("GetGroutingScrap" == action)
  9409. {
  9410. ClientRequestEntity cre = new ClientRequestEntity();
  9411. cre.NameSpace = module;
  9412. cre.Name = action;
  9413. if (!string.IsNullOrEmpty(jsonData))
  9414. {
  9415. cre.Properties["BarCode"] = data["BarCode"];
  9416. }
  9417. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetGroutingScrap(cre, sUserInfo);
  9418. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9419. actionResult.Status = (int)Constant.PDAResult.Success;
  9420. }
  9421. // 撤销成型报损
  9422. else if ("ReverseGroutingScrapProduct" == action)
  9423. {
  9424. ClientRequestEntity cre = new ClientRequestEntity();
  9425. cre.NameSpace = module;
  9426. cre.Name = action;
  9427. if (!string.IsNullOrEmpty(jsonData))
  9428. {
  9429. cre.Properties["BarCode"] = data["BarCode"];
  9430. }
  9431. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.ReverseGroutingScrapProduct(cre, sUserInfo);
  9432. if (sre.Status == Constant.ServiceResultStatus.Success)
  9433. {
  9434. actionResult.Status = (int)Constant.PDAResult.Success;
  9435. actionResult.Result = sre.Result;
  9436. }
  9437. else
  9438. {
  9439. actionResult.Status = (int)Constant.PDAResult.Fail;
  9440. actionResult.Result = sre.OtherStatus;
  9441. actionResult.Message = sre.Message;
  9442. }
  9443. }
  9444. }
  9445. #endregion
  9446. #region 产品挂起
  9447. if (module == "ProductSuspend")
  9448. {
  9449. // 获取可以挂起的工序(干补、装车、入窑、出窑)工序不能挂起
  9450. if (action == "GetSuspendProcedure")
  9451. {
  9452. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetSuspendProcedure(sUserInfo);
  9453. if (sre.Status == Constant.ServiceResultStatus.Success)
  9454. {
  9455. actionResult.Status = (int)Constant.PDAResult.Success;
  9456. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9457. }
  9458. else
  9459. {
  9460. actionResult.Status = (int)Constant.PDAResult.Fail;
  9461. actionResult.Message = sre.Message;
  9462. }
  9463. return actionResult;
  9464. }
  9465. // 验证挂起条码
  9466. if (action == "CheckSuspendBarcode")
  9467. {
  9468. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.CheckSuspendBarcode(sUserInfo, data["barcode"] + "");
  9469. if (sre.Status == Constant.ServiceResultStatus.Success)
  9470. {
  9471. actionResult.Status = (int)Constant.PDAResult.Success;
  9472. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9473. }
  9474. else
  9475. {
  9476. actionResult.Status = (int)Constant.PDAResult.Fail;
  9477. actionResult.Message = sre.Message;
  9478. }
  9479. return actionResult;
  9480. }
  9481. // 挂起条码
  9482. if (action == "SaveSuspendProduct")
  9483. {
  9484. int[] gids = JsonHelper.FromJson<int[]>(data["groutingdailydetailids"] + "");
  9485. int[] pids = JsonHelper.FromJson<int[]>(data["procedureids"] + "");
  9486. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveSuspendProduct(sUserInfo, pids, gids, data["remarks"] + "");
  9487. if (sre.Status == Constant.ServiceResultStatus.Success)
  9488. {
  9489. actionResult.Status = (int)Constant.PDAResult.Success;
  9490. //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9491. }
  9492. else
  9493. {
  9494. actionResult.Status = (int)Constant.PDAResult.Fail;
  9495. actionResult.Message = sre.Message;
  9496. }
  9497. return actionResult;
  9498. }
  9499. // 撤销挂起条码
  9500. if (action == "DeleteSuspendProduct")
  9501. {
  9502. int[] gids = JsonHelper.FromJson<int[]>(data["groutingdailydetailids"] + "");
  9503. int[] pids = JsonHelper.FromJson<int[]>(data["procedureids"] + "");
  9504. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.DeleteSuspendProduct(sUserInfo, pids, gids);
  9505. if (sre.Status == Constant.ServiceResultStatus.Success)
  9506. {
  9507. actionResult.Status = (int)Constant.PDAResult.Success;
  9508. //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9509. }
  9510. else
  9511. {
  9512. actionResult.Status = (int)Constant.PDAResult.Fail;
  9513. actionResult.Message = sre.Message;
  9514. }
  9515. return actionResult;
  9516. }
  9517. // 查询挂起条码
  9518. if (action == "GetSuspendProduct")
  9519. {
  9520. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetSuspendProduct(sUserInfo, data["barcode"] + "");
  9521. if (sre.Status == Constant.ServiceResultStatus.Success)
  9522. {
  9523. if (sre.Data.Tables[0].Rows.Count == 0)
  9524. {
  9525. actionResult.Status = (int)Constant.PDAResult.Fail;
  9526. actionResult.Message = "此条码没有可撤销的挂起信息";
  9527. }
  9528. else
  9529. {
  9530. actionResult.Status = (int)Constant.PDAResult.Success;
  9531. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9532. }
  9533. }
  9534. else
  9535. {
  9536. actionResult.Status = (int)Constant.PDAResult.Fail;
  9537. actionResult.Message = sre.Message;
  9538. }
  9539. return actionResult;
  9540. }
  9541. }
  9542. #endregion
  9543. #region 品保抽查
  9544. if (module == "QASpotCheck")
  9545. {
  9546. if (action == "GetAllQASpotCheck")
  9547. {
  9548. ClientRequestEntity cre = new ClientRequestEntity();
  9549. cre.NameSpace = module;
  9550. cre.Name = action;
  9551. if (data != null && data.Count > 0)
  9552. {
  9553. foreach (string item in data.Keys)
  9554. {
  9555. if (item.StartsWith("checktime"))
  9556. {
  9557. cre.Properties.Add(item, DateTime.ParseExact(data[item] + "", "yyyy-MM-dd", null));
  9558. }
  9559. else
  9560. {
  9561. cre.Properties.Add(item, data[item]);
  9562. }
  9563. }
  9564. }
  9565. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetAllQASpotCheck(sUserInfo, cre));
  9566. if (sre.Status == Constant.ServiceResultStatus.Success)
  9567. {
  9568. actionResult.Status = (int)Constant.PDAResult.Success;
  9569. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9570. }
  9571. else if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  9572. {
  9573. actionResult.Status = (int)Constant.PDAResult.Success;
  9574. }
  9575. else
  9576. {
  9577. actionResult.Status = (int)Constant.PDAResult.Fail;
  9578. actionResult.Message = sre.Message;
  9579. }
  9580. return actionResult;
  9581. }
  9582. if (action == "AutoSaveQASpotCheck")
  9583. {
  9584. string barcode = data["barcode"] + "";
  9585. string remarks = data["remarks"] + "";
  9586. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.AutoSaveQASpotCheck(sUserInfo, barcode, remarks));
  9587. if (sre.Status == Constant.ServiceResultStatus.Success)
  9588. {
  9589. actionResult.Status = (int)Constant.PDAResult.Success;
  9590. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9591. }
  9592. else
  9593. {
  9594. actionResult.Status = (int)Constant.PDAResult.Fail;
  9595. actionResult.Message = sre.Message;
  9596. }
  9597. return actionResult;
  9598. }
  9599. if (action == "CheckQASpotCheck")
  9600. {
  9601. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.CheckQASpotCheck(sUserInfo, jsonData));
  9602. if (sre.Status == Constant.ServiceResultStatus.Success)
  9603. {
  9604. actionResult.Status = (int)Constant.PDAResult.Success;
  9605. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9606. }
  9607. else
  9608. {
  9609. actionResult.Status = (int)Constant.PDAResult.Fail;
  9610. actionResult.Message = sre.Message;
  9611. }
  9612. return actionResult;
  9613. }
  9614. if (action == "SaveQASpotCheck")
  9615. {
  9616. data["CheckTime"] = DateTime.ParseExact(data["CheckTime"] + "", "yyyy-MM-dd HH:mm:ss", null);
  9617. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveQASpotCheck(sUserInfo, data));
  9618. if (sre.Status == Constant.ServiceResultStatus.Success)
  9619. {
  9620. actionResult.Status = (int)Constant.PDAResult.Success;
  9621. }
  9622. else
  9623. {
  9624. actionResult.Status = (int)Constant.PDAResult.Fail;
  9625. actionResult.Message = sre.Message;
  9626. }
  9627. return actionResult;
  9628. }
  9629. return null;
  9630. }
  9631. #endregion
  9632. #region 产成品交接
  9633. if (module == "FinishedProduct")
  9634. {
  9635. // 设定商标
  9636. if (action == "GetFinishedBarcode")
  9637. {
  9638. string barcode = data["barcode"].ToString();
  9639. ServiceResultEntity resultEntity = PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo, 2);
  9640. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9641. if (Convert.ToInt32(resultEntity.Result) < 0)
  9642. {
  9643. actionResult.Status = (int)Constant.PDAResult.Fail;
  9644. actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
  9645. actionResult.Message = resultEntity.Message;
  9646. }
  9647. else
  9648. {
  9649. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9650. actionResult.Status = (int)Constant.PDAResult.Success;
  9651. actionResult.Message = resultEntity.Message;
  9652. }
  9653. return actionResult;
  9654. }
  9655. if (action == "GetHandoveredBarcode")
  9656. {
  9657. string barcode = data["barcode"].ToString();
  9658. ServiceResultEntity resultEntity = PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo, 1);
  9659. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9660. if (Convert.ToInt32(resultEntity.Result) < 0)
  9661. {
  9662. actionResult.Status = (int)Constant.PDAResult.Fail;
  9663. actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
  9664. actionResult.Message = resultEntity.Message;
  9665. }
  9666. else
  9667. {
  9668. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9669. actionResult.Status = (int)Constant.PDAResult.Success;
  9670. actionResult.Message = resultEntity.Message;
  9671. }
  9672. return actionResult;
  9673. }
  9674. if (action == "SetFinishedLogo")
  9675. {
  9676. int logoid = Convert.ToInt32(data["logoid"]);
  9677. string[] barcodes = data["barcodes"].ToString().Split(',');
  9678. int result = PMModuleLogicDAL.SetFinishedLogo(barcodes, logoid, sUserInfo);
  9679. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9680. if (result < 0)
  9681. {
  9682. actionResult.Status = (int)Constant.PDAResult.Fail;
  9683. }
  9684. else
  9685. {
  9686. actionResult.Status = (int)Constant.PDAResult.Success;
  9687. }
  9688. return actionResult;
  9689. }
  9690. if (action == "SetHandoveredOrder")
  9691. {
  9692. int orderID = Convert.ToInt32(data["orderID"]);
  9693. string[] barcodes = data["barcodes"].ToString().Split(',');
  9694. int result = PMModuleLogicDAL.SetHandoveredOrder(barcodes, orderID, sUserInfo);
  9695. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9696. if (result < 0)
  9697. {
  9698. actionResult.Status = (int)Constant.PDAResult.Fail;
  9699. }
  9700. else
  9701. {
  9702. actionResult.Status = (int)Constant.PDAResult.Success;
  9703. }
  9704. return actionResult;
  9705. }
  9706. }
  9707. #endregion
  9708. #region 产成品装车
  9709. /*
  9710. if (module == "FinishedLoading")
  9711. {
  9712. // 设定商标
  9713. if (action == "GetMaxLoadingNo")
  9714. {
  9715. int no = Service.PMModuleService.PMModuleLogic.GetMaxLoadingNo(sUserInfo);
  9716. actionResult.Status = (int)Constant.PDAResult.Success;
  9717. actionResult.Result = no;
  9718. return actionResult;
  9719. }
  9720. if (action == "CheckFinishedLaodingBarcode")
  9721. {
  9722. string barcode = data["barcode"].ToString();
  9723. ServiceResultEntity resultEntity = Service.PMModuleService.PMModuleLogic.CheckFinishedLaodingBarcode(sUserInfo, barcode);
  9724. if (resultEntity.Status == Constant.ServiceResultStatus.Success)
  9725. {
  9726. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9727. actionResult.Status = (int)Constant.PDAResult.Success;
  9728. actionResult.Message = resultEntity.Message;
  9729. }
  9730. else
  9731. {
  9732. actionResult.Status = (int)Constant.PDAResult.Fail;
  9733. actionResult.Result = resultEntity.OtherStatus;
  9734. actionResult.Message = resultEntity.Message;
  9735. }
  9736. return actionResult;
  9737. }
  9738. if (action == "SaveFinishedLoading")
  9739. {
  9740. int loadingNo = Convert.ToInt32(data["loadingNo"]);
  9741. string carLicense = data["carLicense"] + "";
  9742. int palletNum = Convert.ToInt32(data["palletNum"]);
  9743. int goodsNum = Convert.ToInt32(data["goodsNum"]);
  9744. string remarks = data["remarks"] + "";
  9745. Dictionary<string, object>[] details =
  9746. JsonHelper.FromJson<Dictionary<string, object>[]>(data["details"] + "");
  9747. //"[{\"A\":1,\"B\":\"V\"},{\"A\":2,\"B\":\"V1\"}]"
  9748. ServiceResultEntity result = Service.PMModuleService.PMModuleLogic.SaveFinishedLoading(sUserInfo,
  9749. loadingNo, carLicense, palletNum, goodsNum, remarks, details);
  9750. if (result.Status == Constant.ServiceResultStatus.Success)
  9751. {
  9752. actionResult.Status = (int)Constant.PDAResult.Success;
  9753. actionResult.Message = result.Message;
  9754. }
  9755. else
  9756. {
  9757. actionResult.Status = (int)Constant.PDAResult.Fail;
  9758. actionResult.Result = result.OtherStatus;
  9759. actionResult.Message = result.Message;
  9760. }
  9761. return actionResult;
  9762. }
  9763. }
  9764. */
  9765. #endregion
  9766. #region 产成品质量改判
  9767. if (module == "FinishedProductTamper")
  9768. {
  9769. // 获取产成品信息及缺陷数据
  9770. if (action == "GetDefectData")
  9771. {
  9772. string barcode = data["barcode"].ToString();
  9773. ServiceResultEntity sre = PDAModuleLogic.GetDefectData(barcode, sUserInfo);
  9774. if (sre.Status == Constant.ServiceResultStatus.Success)
  9775. {
  9776. actionResult.Status = (int)Constant.PDAResult.Success;
  9777. actionResult.Result = JsonHelper.ToJson(sre.Result);
  9778. actionResult.Message = sre.Message;
  9779. }
  9780. else
  9781. {
  9782. actionResult.Status = (int)Constant.PDAResult.Fail;
  9783. actionResult.Result = sre.OtherStatus;
  9784. actionResult.Message = sre.Message;
  9785. }
  9786. return actionResult;
  9787. }
  9788. // 获取产成品信息及缺陷数据
  9789. if (action == "SaveDefectData")
  9790. {
  9791. ProductionDataEntity productionDataEntity = JsonHelper.FromJson<ProductionDataEntity>(data["ProductionDataEntity"] + "");
  9792. ServiceResultEntity sre = PDAModuleLogic.SaveDefectData(productionDataEntity, sUserInfo);
  9793. if (sre.Status == Constant.ServiceResultStatus.Success)
  9794. {
  9795. actionResult.Status = (int)Constant.PDAResult.Success;
  9796. actionResult.Message = sre.Message;
  9797. }
  9798. else
  9799. {
  9800. actionResult.Status = (int)Constant.PDAResult.Fail;
  9801. actionResult.Message = sre.Message;
  9802. }
  9803. return actionResult;
  9804. }
  9805. // 通过条码查出责任工序(成品改判用)
  9806. if (action == "GetDutyProcedureByBarCodeForTamper")
  9807. {
  9808. string barcode = data["barcode"] + "";
  9809. int defectid = int.Parse(data["defectid"] + "");
  9810. ServiceResultEntity sre = PDAModuleLogic.GetDutyProcedureByBarCodeForTamper(barcode, defectid, sUserInfo.AccountID);
  9811. if (sre.Status == Constant.ServiceResultStatus.Success)
  9812. {
  9813. actionResult.Status = (int)Constant.PDAResult.Success;
  9814. actionResult.Result = JsonHelper.ToJson(sre.Data);
  9815. actionResult.Message = sre.Message;
  9816. }
  9817. else
  9818. {
  9819. actionResult.Status = (int)Constant.PDAResult.Fail;
  9820. actionResult.Result = sre.OtherStatus;
  9821. actionResult.Message = sre.Message;
  9822. }
  9823. return actionResult;
  9824. }
  9825. }
  9826. #endregion
  9827. #region PDA独立功能
  9828. #region 水效标识
  9829. if (module == "WaterEffect")
  9830. {
  9831. // 获取产成品信息及水效标识
  9832. if (action == "GetGoodsByBarCode")
  9833. {
  9834. string barcode = data["barcode"].ToString();
  9835. ServiceResultEntity sre = PDAModuleLogic.GetGoodsByBarCode(barcode, sUserInfo);
  9836. if (sre.Status == Constant.ServiceResultStatus.Success)
  9837. {
  9838. actionResult.Status = (int)Constant.PDAResult.Success;
  9839. actionResult.Result = JsonHelper.ToJson(sre.Result);
  9840. actionResult.Message = sre.Message;
  9841. }
  9842. else
  9843. {
  9844. actionResult.Status = (int)Constant.PDAResult.Fail;
  9845. actionResult.Result = sre.OtherStatus;
  9846. actionResult.Message = sre.Message;
  9847. }
  9848. return actionResult;
  9849. }
  9850. }
  9851. #endregion
  9852. #region 盖板型号
  9853. if (module == "SeatCoverType")
  9854. {
  9855. // 获取产成品信息及水效标识
  9856. if (action == "SendGoodsCodeToPLC")
  9857. {
  9858. string barcode = data["barcode"].ToString();
  9859. int sre = PLCModuleLogic.SendGoodsCodeToPLCBySeatCover(barcode, sUserInfo);
  9860. if (sre == 0)
  9861. {
  9862. actionResult.Status = (int)Constant.PDAResult.Success;
  9863. }
  9864. else
  9865. {
  9866. actionResult.Status = (int)Constant.PDAResult.Fail;
  9867. actionResult.Result = sre;
  9868. switch (sre)
  9869. {
  9870. case 1:
  9871. case 2:
  9872. actionResult.Message = "无效条码";
  9873. break;
  9874. case 3:
  9875. actionResult.Message = "此产品型号没有设置盖板标识码";
  9876. break;
  9877. case 4:
  9878. actionResult.Message = "当前用户没有设置PLC参数";
  9879. break;
  9880. case 5:
  9881. actionResult.Message = "PLC参数设置不全";
  9882. break;
  9883. default:
  9884. actionResult.Message = "PLC通信异常";
  9885. break;
  9886. }
  9887. }
  9888. return actionResult;
  9889. }
  9890. }
  9891. #endregion
  9892. #region PDA PLC 相关功能
  9893. if (module == "PDA_FUN_PLC")
  9894. {
  9895. // PDA扫码发送到PLCServer
  9896. if (action == "SendBarcodeToPLCServer")
  9897. {
  9898. string barcode = data["barcode"].ToString();
  9899. int sre = PLCModuleLogic.SendBarcodeToPLCServer(barcode, sUserInfo);
  9900. if (sre == 0)
  9901. {
  9902. actionResult.Status = (int)Constant.PDAResult.Success;
  9903. }
  9904. else
  9905. {
  9906. actionResult.Status = (int)Constant.PDAResult.Fail;
  9907. actionResult.Result = sre;
  9908. switch (sre)
  9909. {
  9910. case 1:
  9911. case 2:
  9912. actionResult.Message = "无效条码";
  9913. break;
  9914. case 3:
  9915. actionResult.Message = "PLC通信异常";
  9916. break;
  9917. case 4:
  9918. actionResult.Message = "当前用户没有设置PLC参数";
  9919. break;
  9920. case 5:
  9921. actionResult.Message = "PLC参数设置不全";
  9922. break;
  9923. default:
  9924. actionResult.Message = "PLC通信异常";
  9925. break;
  9926. }
  9927. }
  9928. return actionResult;
  9929. }
  9930. }
  9931. #endregion
  9932. #endregion
  9933. #region 半检返修
  9934. if (module == "SemiRework")
  9935. {
  9936. // 验证半检返修条码
  9937. if (action == "CheckSemiReworkBarcode")
  9938. {
  9939. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9940. PMModuleLogic.CheckSemiReworkBarcode(jsonData);
  9941. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9942. if (Convert.ToInt32(resultEntity.Result) < 0)
  9943. {
  9944. actionResult.Status = (int)Constant.PDAResult.Fail;
  9945. }
  9946. else
  9947. {
  9948. actionResult.Status = (int)Constant.PDAResult.Success;
  9949. }
  9950. actionResult.Message = resultEntity.Message;
  9951. return actionResult;
  9952. }
  9953. // 可以返修的工序
  9954. if (action == "GetSemiReworkProcedure")
  9955. {
  9956. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9957. PMModuleLogic.GetSemiReworkProcedure(jsonData, sUserInfo);
  9958. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9959. actionResult.Status = (int)Constant.PDAResult.Success;
  9960. return actionResult;
  9961. }
  9962. // 根据条码获取经过的工序,用于责任工序
  9963. if (action == "GetSemiReworkPassProcedure")
  9964. {
  9965. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9966. PMModuleLogic.GetSemiReworkPassProcedure(jsonData);
  9967. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9968. actionResult.Status = (int)Constant.PDAResult.Success;
  9969. return actionResult;
  9970. }
  9971. // 根据所选生产工序(生产数据ID)查询责任员工
  9972. if (action == "GetSemiReworkDefectStaffByProductionDataID")
  9973. {
  9974. int productionDataID = Convert.ToInt32(jsonData);
  9975. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9976. PMModuleLogic.GetSemiReworkDefectStaffByProductionDataID(productionDataID);
  9977. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9978. actionResult.Status = (int)Constant.PDAResult.Success;
  9979. return actionResult;
  9980. }
  9981. // 根据所选工号,查出缺陷责任员工
  9982. if (action == "GetSemiReworkDefectStaffByUserID")
  9983. {
  9984. int userID = Convert.ToInt32(jsonData);
  9985. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9986. PMModuleLogic.GetSemiReworkDefectStaffByUserID(userID);
  9987. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9988. actionResult.Status = (int)Constant.PDAResult.Success;
  9989. return actionResult;
  9990. }
  9991. // 新建半检返修
  9992. if (action == "AddSemiRework")
  9993. {
  9994. SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"]+"");
  9995. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9996. PMModuleLogic.AddSemiRework(entity, sUserInfo);
  9997. actionResult.Result = resultEntity.Result;
  9998. actionResult.Message = resultEntity.Message;
  9999. if (Convert.ToInt32(resultEntity.Result) > 0)
  10000. {
  10001. actionResult.Status = (int)Constant.PDAResult.Success;
  10002. }
  10003. else
  10004. {
  10005. actionResult.Status = (int)Constant.PDAResult.Fail;
  10006. }
  10007. return actionResult;
  10008. }
  10009. // 编辑半检返修
  10010. if (action == "EditSemiRework")
  10011. {
  10012. SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"] + "");
  10013. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10014. PMModuleLogic.EditSemiRework(entity, sUserInfo);
  10015. actionResult.Result = resultEntity.Result;
  10016. actionResult.Message = resultEntity.Message;
  10017. if (Convert.ToInt32(resultEntity.Result) > 0)
  10018. {
  10019. actionResult.Status = (int)Constant.PDAResult.Success;
  10020. }
  10021. else
  10022. {
  10023. actionResult.Status = (int)Constant.PDAResult.Fail;
  10024. }
  10025. return actionResult;
  10026. }
  10027. // 撤销半检返修
  10028. if (action == "CancelSemiRework")
  10029. {
  10030. SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"] + "");
  10031. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10032. PMModuleLogic.CancelSemiRework(entity, sUserInfo);
  10033. actionResult.Result = resultEntity.Result;
  10034. actionResult.Message = resultEntity.Message;
  10035. if (Convert.ToInt32(resultEntity.Result) > 0)
  10036. {
  10037. actionResult.Status = (int)Constant.PDAResult.Success;
  10038. }
  10039. else
  10040. {
  10041. actionResult.Status = (int)Constant.PDAResult.Fail;
  10042. }
  10043. return actionResult;
  10044. }
  10045. // 获取半检返修数据(PDA编辑用)
  10046. if (action == "GetSemiReworkByID")
  10047. {
  10048. int id = Convert.ToInt32(jsonData);
  10049. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10050. PMModuleLogic.GetSemiReworkByID(id,sUserInfo.UserCode);
  10051. DataTable data1 = resultEntity.Data.Tables[0];
  10052. DataTable data2 = resultEntity.Data.Tables[1];
  10053. DataTable data3 = resultEntity.Data.Tables[2];
  10054. if (data1.Rows.Count == 0)
  10055. {
  10056. actionResult.Status = (int)Constant.PDAResult.Fail;
  10057. actionResult.Message = "半检返修信息不存在";
  10058. return actionResult;
  10059. }
  10060. SemiReworkEntity srEntity = new SemiReworkEntity();
  10061. srEntity.SemiReworkID = id;
  10062. srEntity.BarCode = data1.Rows[0]["BarCode"] + "";
  10063. srEntity.ReworkProcedureID = Convert.ToInt32(data1.Rows[0]["ReworkProcedureID"]);
  10064. srEntity.Remarks = data1.Rows[0]["Remarks"] + "";
  10065. srEntity.SemiReworkDefects = new List<SemiReworkDefectEntity>();
  10066. foreach (DataRow row2 in data2.Rows)
  10067. {
  10068. SemiReworkDefectEntity defectEntity = new SemiReworkDefectEntity();
  10069. srEntity.SemiReworkDefects.Add(defectEntity);
  10070. defectEntity.SemiReworkDefectID = Convert.ToInt32(row2["SemiReworkDefectID"]);
  10071. defectEntity.SemiReworkID = id;
  10072. defectEntity.DefectID = Convert.ToInt32(row2["DefectID"]);
  10073. defectEntity.DefectCode = row2["DefectCode"] + "";
  10074. defectEntity.DefectName = row2["DefectName"] + "";
  10075. defectEntity.DefectPositionID = Convert.ToInt32(row2["DefectPositionID"]);
  10076. defectEntity.DefectPositionCode = row2["DefectPositionCode"] + "";
  10077. defectEntity.DefectPositionName = row2["DefectPositionName"] + "";
  10078. defectEntity.ScrapResponFlag = row2["ScrapResponFlag"] + "";
  10079. defectEntity.DefectProductionDataID = row2["DefectProductionDataID"].ToNullableInt32();
  10080. defectEntity.DefectProcedureID = row2["DefectProcedureID"].ToNullableInt32();
  10081. defectEntity.DefectProcedureCode = row2["DefectProcedureCode"] + "";
  10082. defectEntity.DefectProcedureName = row2["DefectProcedureName"] + "";
  10083. defectEntity.Remarks = row2["Remarks"] + "";
  10084. defectEntity.DefectUserID = Convert.ToInt32(row2["DefectUserID"]);
  10085. defectEntity.DefectUserCode = row2["DefectUserCode"] + "";
  10086. defectEntity.DefectUserName = row2["DefectUserName"] + "";
  10087. defectEntity.DefectResponsibles = new List<SemiReworkRPSEntity>();
  10088. defectEntity.ValueFlag = Convert.ToInt32(row2["ValueFlag"]);
  10089. DataRow[] row3s = data3.Select("SemiReworkDefectID=" + defectEntity.SemiReworkDefectID);
  10090. if (row3s.Length == 0)
  10091. {
  10092. continue;
  10093. }
  10094. foreach (DataRow row3 in row3s)
  10095. {
  10096. SemiReworkRPSEntity semiReworkRPS = new SemiReworkRPSEntity();
  10097. defectEntity.DefectResponsibles.Add(semiReworkRPS);
  10098. semiReworkRPS.SemiReworkDefectID = Convert.ToInt32(row3["SemiReworkDefectID"]);
  10099. semiReworkRPS.StaffID = Convert.ToInt32(row3["StaffID"]);
  10100. semiReworkRPS.StaffName = row3["StaffName"] + "";
  10101. semiReworkRPS.StaffCode = row3["StaffCode"] + "";
  10102. semiReworkRPS.SemiReworkID = Convert.ToInt32(row3["SemiReworkID"]);
  10103. semiReworkRPS.UserID = Convert.ToInt32(row3["UserID"]);
  10104. semiReworkRPS.UserCode = row3["UserCode"] + "";
  10105. semiReworkRPS.UJobsID = Convert.ToInt32(row3["UJobsID"]);
  10106. semiReworkRPS.SJobsID = Convert.ToInt32(row3["SJobsID"]);
  10107. }
  10108. }
  10109. //xuwei note 总单用于显示,信息较全
  10110. actionResult.Message = JsonHelper.ToJson(data1);
  10111. //xuwei note 总单信息不全,但有明细,用于回传保存
  10112. actionResult.Result = JsonHelper.ToJson(srEntity);
  10113. actionResult.Status = (int)Constant.PDAResult.Success;
  10114. }
  10115. }
  10116. #endregion
  10117. #region 窑车漏扫补件
  10118. if (module == "F_PM_0504")
  10119. {
  10120. // 验证窑车编码是否存在
  10121. if (action == "CheckKilnCar")
  10122. {
  10123. ClientRequestEntity cre = new ClientRequestEntity();
  10124. cre.Properties["kilncarcode"] = data["KilnCarCode"];
  10125. cre.Properties["procedureID"] = data["ProcedureID"];
  10126. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.CheckKilnCar(cre, sUserInfo);
  10127. if (sre.Status == Constant.ServiceResultStatus.Success)
  10128. {
  10129. actionResult.Status = (int)Constant.PDAResult.Success;
  10130. actionResult.Result = sre.Result;
  10131. }
  10132. else
  10133. {
  10134. actionResult.Status = (int)Constant.PDAResult.Fail;
  10135. actionResult.Message = sre.Message;
  10136. }
  10137. return actionResult;
  10138. }
  10139. // 验证窑车烧成批次号是否存在 和 是否能补漏扫
  10140. if (action == "CheckKilnCarBatchNo")
  10141. {
  10142. ClientRequestEntity cre = new ClientRequestEntity();
  10143. cre.Properties["KilnID"] = data["KilnID"];
  10144. cre.Properties["KilnCarID"] = data["KilnCarID"];
  10145. cre.Properties["ProcedureID"] = data["ProcedureID"];
  10146. cre.Properties["KilnCarBatchNo"] = data["KilnCarBatchNo"];
  10147. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.CheckKilnCarBatchNo(cre, sUserInfo);
  10148. if (sre.Status == Constant.ServiceResultStatus.Success)
  10149. {
  10150. actionResult.Status = (int)Constant.PDAResult.Success;
  10151. }
  10152. else
  10153. {
  10154. actionResult.Status = (int)Constant.PDAResult.Fail;
  10155. actionResult.Message = sre.Message;
  10156. }
  10157. return actionResult;
  10158. }
  10159. // 窑车漏扫补件
  10160. if (action == "SetKilnCarMissing")
  10161. {
  10162. ClientRequestEntity cre = new ClientRequestEntity();
  10163. cre.Properties["KilnCarBatchNo"] = data["KilnCarBatchNo"];
  10164. string carData = data["CarData"] + "";
  10165. DataTable dataTable = JsonHelper.FromJson<DataTable>(carData);
  10166. cre.Data = new DataSet();
  10167. cre.Data.Tables.Add(dataTable);
  10168. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.SetKilnCarMissing(cre, sUserInfo);
  10169. if (sre.Status == Constant.ServiceResultStatus.Success)
  10170. {
  10171. actionResult.Status = (int)Constant.PDAResult.Success;
  10172. }
  10173. else
  10174. {
  10175. actionResult.Status = (int)Constant.PDAResult.Fail;
  10176. actionResult.Message = sre.Message;
  10177. }
  10178. return actionResult;
  10179. }
  10180. }
  10181. #endregion
  10182. #region 试验留瓷标记
  10183. if (module == "RetainBarcode")
  10184. {
  10185. #region 留瓷
  10186. if (action == "CheckRetainBarcode")
  10187. {
  10188. string barcode = data["Barcode"] + "";
  10189. ServiceResultEntity sre = PDAModuleLogic.CheckRetainBarcode(barcode, sUserInfo, "1");
  10190. if (sre.OtherStatus >= 0)
  10191. {
  10192. actionResult.Status = (int)Constant.PDAResult.Success;
  10193. actionResult.Result = JsonHelper.ToJson(sre.Data);
  10194. }
  10195. else
  10196. {
  10197. actionResult.Status = (int)Constant.PDAResult.Fail;
  10198. actionResult.Result = sre.OtherStatus;
  10199. actionResult.Message = sre.Message;
  10200. }
  10201. return actionResult;
  10202. }
  10203. else if (action == "SaveRetainFlag")
  10204. {
  10205. string[] barcodes = JsonHelper.FromJson<string[]>(data["Barcodes"] + "");
  10206. ServiceResultEntity sre = PDAModuleLogic.SaveRetainFlag(barcodes, "1");
  10207. if (sre.OtherStatus > 0)
  10208. {
  10209. actionResult.Status = (int)Constant.PDAResult.Success;
  10210. }
  10211. else
  10212. {
  10213. actionResult.Status = (int)Constant.PDAResult.Fail;
  10214. actionResult.Message = sre.Message;
  10215. }
  10216. return actionResult;
  10217. }
  10218. #endregion
  10219. #region 撤销留瓷
  10220. if (action == "CheckBackRetainBarcode")
  10221. {
  10222. string barcode = data["Barcode"] + "";
  10223. ServiceResultEntity sre = PDAModuleLogic.CheckRetainBarcode(barcode, sUserInfo, "0");
  10224. if (sre.OtherStatus >= 0)
  10225. {
  10226. actionResult.Status = (int)Constant.PDAResult.Success;
  10227. actionResult.Result = JsonHelper.ToJson(sre.Data);
  10228. }
  10229. else
  10230. {
  10231. actionResult.Status = (int)Constant.PDAResult.Fail;
  10232. actionResult.Result = sre.OtherStatus;
  10233. actionResult.Message = sre.Message;
  10234. }
  10235. return actionResult;
  10236. }
  10237. else if (action == "SaveBackRetainFlag")
  10238. {
  10239. string[] barcodes = JsonHelper.FromJson<string[]>(data["Barcodes"] + "");
  10240. ServiceResultEntity sre = PDAModuleLogic.SaveRetainFlag(barcodes, "0");
  10241. if (sre.OtherStatus > 0)
  10242. {
  10243. actionResult.Status = (int)Constant.PDAResult.Success;
  10244. }
  10245. else
  10246. {
  10247. actionResult.Status = (int)Constant.PDAResult.Fail;
  10248. actionResult.Message = sre.Message;
  10249. }
  10250. return actionResult;
  10251. }
  10252. #endregion
  10253. }
  10254. #endregion
  10255. return actionResult;
  10256. }
  10257. catch (Exception ex)
  10258. {
  10259. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  10260. OutputLog.TraceLog(LogPriority.Error,
  10261. this.ToString(),
  10262. System.Reflection.MethodBase.GetCurrentMethod().Name + System.Environment.NewLine +
  10263. JsonHelper.ToJson(sUserInfo) + System.Environment.NewLine +
  10264. " module:" + module + " action:" + action + " json:" + jsonData,
  10265. ex.ToString(),
  10266. LocalPath.LogExePath);
  10267. actionResult.Status = (int)Constant.PDAResult.Exception;
  10268. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  10269. }
  10270. return actionResult;
  10271. }
  10272. #endregion
  10273. }
  10274. }