PDAModuleService.cs 380 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807
  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)
  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. pdaFunctionChild.MenuCode = newRow["MenuCode"].ToString();
  300. pdaFunctionChild.MenuName = newRow["MenuName"].ToString();
  301. pdaFunctionChild.ProcedureID = intProcedureID;
  302. pdaFunctionChild.ProcedureModel = newRow["ProcedureModel"].ToString();
  303. pdaFunctionChild.ModelType = intModelType;
  304. pdaFunction.PDAFunctions.Add(pdaFunctionChild);
  305. #endregion
  306. InitTreeView(dtPLM, newRow["MenuCode"].ToString(), pdaFunctionChild);
  307. }
  308. //actionResult.Result = JsonHelper.ToJson(dtPLM);
  309. actionResult.Result = JsonHelper.ToJson(pdaFunction);
  310. actionResult.Status = (int)Constant.PDAResult.Success;
  311. }
  312. catch (Exception ex)
  313. {
  314. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  315. OutputLog.TraceLog(LogPriority.Error,
  316. this.ToString(),
  317. System.Reflection.MethodBase.GetCurrentMethod().Name,
  318. ex.ToString(),
  319. LocalPath.LogExePath);
  320. actionResult.Status = (int)Constant.PDAResult.Exception;
  321. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  322. }
  323. return actionResult;
  324. }
  325. /// <summary>
  326. /// 初始化树形控件
  327. /// </summary>
  328. /// <param name="treeTable">菜单数据表</param>
  329. /// <param name="rows">待处理的菜单集合</param>
  330. /// <param name="node">当前树节点</param>
  331. private void InitTreeView(DataTable treeTable, string pFuncCode, PDAFunctionResult pFunctions)
  332. {
  333. string filterExpression = "MenuCode LIKE '" + pFuncCode + "%' AND LEN(MenuCode) = "
  334. + (pFuncCode.Length + Constant.INT_IS_TWO);
  335. DataRow[] subRows = treeTable.Select(filterExpression, "MenuCode ASC");
  336. //DataRow[] subRows = treeTable.Select(filterExpression, "ProcedureCode ASC");
  337. foreach (DataRow newRow in subRows)
  338. {
  339. #region 插入子节点数据
  340. int? intProcedureID = null;
  341. int? intModelType = null;
  342. if (!string.IsNullOrEmpty(newRow["ProcedureID"].ToString()))
  343. {
  344. intProcedureID = Convert.ToInt32(newRow["ProcedureID"]);
  345. }
  346. if (!string.IsNullOrEmpty(newRow["ModelType"].ToString()))
  347. {
  348. intModelType = Convert.ToInt32(newRow["ModelType"]);
  349. }
  350. PDAFunctionResult pdaFunctionChild = new PDAFunctionResult();
  351. pdaFunctionChild.MenuCode = newRow["MenuCode"].ToString();
  352. pdaFunctionChild.MenuName = newRow["MenuName"].ToString();
  353. pdaFunctionChild.ProcedureID = intProcedureID;
  354. pdaFunctionChild.ProcedureModel = newRow["ProcedureModel"].ToString();
  355. pdaFunctionChild.ModelType = intModelType;
  356. pFunctions.PDAFunctions.Add(pdaFunctionChild);
  357. #endregion
  358. // 递归方法
  359. InitTreeView(treeTable, newRow["MenuCode"].ToString(), pdaFunctionChild);
  360. }
  361. }
  362. #endregion
  363. #region 获得工序信息
  364. /// <summary>
  365. /// 获得工序信息
  366. /// </summary>
  367. /// <param name="accountCode">帐套code</param>
  368. /// <param name="userCode">用户code</param>
  369. /// <param name="userPassword">用户密码</param>
  370. /// <param name="sessionKey">本次登陆密钥</param>
  371. /// <param name="procedureID">工序ID</param>
  372. /// <returns></returns>
  373. /// <remarks>
  374. /// 陈冰 2014.09.18 新建
  375. /// </remarks>
  376. public ActionResult GetProcedureByID(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  377. {
  378. ActionResult actionResult = new ActionResult();
  379. try
  380. {
  381. // 验证请求头信息
  382. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  383. // 验证失败
  384. if (actionResult.Status != (int)Constant.PDAResult.Success)
  385. {
  386. return actionResult;
  387. }
  388. ProcedureEntity procedureEntity = ServiceInvoker.Invoke<ProcedureEntity>(this,
  389. () => PMModuleLogic.GetProcedureDataEntityByID(procedureID, sUserInfo));
  390. actionResult.Result = JsonHelper.ToJson(procedureEntity);
  391. actionResult.Status = (int)Constant.PDAResult.Success;
  392. }
  393. catch (Exception ex)
  394. {
  395. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  396. OutputLog.TraceLog(LogPriority.Error,
  397. this.ToString(),
  398. System.Reflection.MethodBase.GetCurrentMethod().Name,
  399. ex.ToString(),
  400. LocalPath.LogExePath);
  401. actionResult.Status = (int)Constant.PDAResult.Exception;
  402. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  403. }
  404. return actionResult;
  405. }
  406. #endregion
  407. #region 校验
  408. /// <summary>
  409. /// 校验产品条码是否可以走到该工序
  410. /// </summary>
  411. /// <param name="accountCode">帐套code</param>
  412. /// <param name="userCode">用户code</param>
  413. /// <param name="userPassword">用户密码</param>
  414. /// <param name="sessionKey">本次登陆密钥</param>
  415. /// <param name="procedureID">工序ID</param>
  416. /// <param name="barcode">条码</param>
  417. /// <returns></returns>
  418. /// <remarks>
  419. /// 陈冰 2014.09.18 新建
  420. /// </remarks>
  421. public ActionResult CheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  422. {
  423. ActionResult actionResult = new ActionResult();
  424. try
  425. {
  426. // 验证请求头信息
  427. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  428. // 验证失败
  429. if (actionResult.Status != (int)Constant.PDAResult.Success)
  430. {
  431. return actionResult;
  432. }
  433. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  434. () => PMModuleLogic.CheckBarcodePDA(procedureID, barcode, sUserInfo));
  435. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  436. {
  437. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  438. actionResult.Status = (int)Constant.PDAResult.Success;
  439. }
  440. else
  441. {
  442. actionResult.Status = (int)Constant.PDAResult.Fail;
  443. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  444. }
  445. }
  446. catch (Exception ex)
  447. {
  448. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  449. OutputLog.TraceLog(LogPriority.Error,
  450. this.ToString(),
  451. System.Reflection.MethodBase.GetCurrentMethod().Name,
  452. ex.ToString(),
  453. LocalPath.LogExePath);
  454. actionResult.Status = (int)Constant.PDAResult.Exception;
  455. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  456. }
  457. return actionResult;
  458. }
  459. /// <summary>
  460. /// 校验产品条码是否可以进行干补
  461. /// </summary>
  462. /// <param name="accountCode">帐套code</param>
  463. /// <param name="userCode">用户code</param>
  464. /// <param name="userPassword">用户密码</param>
  465. /// <param name="sessionKey">本次登陆密钥</param>
  466. /// <param name="procedureID">工序ID</param>
  467. /// <param name="barcode">条码</param>
  468. /// <returns></returns>
  469. /// <remarks>
  470. /// 袁新成 2015.4.1 新建
  471. /// </remarks>
  472. public ActionResult CheckDryRepairBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  473. {
  474. ActionResult actionResult = new ActionResult();
  475. try
  476. {
  477. // 验证请求头信息
  478. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  479. // 验证失败
  480. if (actionResult.Status != (int)Constant.PDAResult.Success)
  481. {
  482. return actionResult;
  483. }
  484. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  485. () => PMModuleLogic.CheckDryRepairBarcode(procedureID, barcode, sUserInfo));
  486. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  487. {
  488. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  489. actionResult.Status = (int)Constant.PDAResult.Success;
  490. }
  491. else
  492. {
  493. actionResult.Status = (int)Constant.PDAResult.Fail;
  494. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  495. }
  496. }
  497. catch (Exception ex)
  498. {
  499. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  500. OutputLog.TraceLog(LogPriority.Error,
  501. this.ToString(),
  502. System.Reflection.MethodBase.GetCurrentMethod().Name,
  503. ex.ToString(),
  504. LocalPath.LogExePath);
  505. actionResult.Status = (int)Constant.PDAResult.Exception;
  506. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  507. }
  508. return actionResult;
  509. }
  510. /// <summary>
  511. /// 检验生产工号
  512. /// </summary>
  513. /// <param name="accountCode">帐套code</param>
  514. /// <param name="userCode">用户code</param>
  515. /// <param name="userPassword">用户密码</param>
  516. /// <param name="sessionKey">本次登陆密钥</param>
  517. /// <param name="procedureID">工序ID</param>
  518. /// <param name="procedureUserCode">生产工号</param>
  519. /// <remarks>
  520. /// 陈冰 2014.09.18 新建
  521. /// </remarks>
  522. public ActionResult CheckProcedureUser(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string procedureUserCode)
  523. {
  524. ActionResult actionResult = new ActionResult();
  525. try
  526. {
  527. // 验证请求头信息
  528. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  529. // 验证失败
  530. if (actionResult.Status != (int)Constant.PDAResult.Success)
  531. {
  532. return actionResult;
  533. }
  534. CheckProcedureUserResult checkProcedureUserResult = ServiceInvoker.Invoke<CheckProcedureUserResult>(this,
  535. () => PMModuleLogic.CheckProcedureUser(procedureID, procedureUserCode, sUserInfo));
  536. actionResult.Result = JsonHelper.ToJson(checkProcedureUserResult);
  537. actionResult.Status = (int)Constant.PDAResult.Success;
  538. }
  539. catch (Exception ex)
  540. {
  541. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  542. OutputLog.TraceLog(LogPriority.Error,
  543. this.ToString(),
  544. System.Reflection.MethodBase.GetCurrentMethod().Name,
  545. ex.ToString(),
  546. LocalPath.LogExePath);
  547. actionResult.Status = (int)Constant.PDAResult.Exception;
  548. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  549. }
  550. return actionResult;
  551. }
  552. /// <summary>
  553. /// 校验窑车是否可装车并返回窑车信息
  554. /// </summary>
  555. /// <param name="accountCode">帐套code</param>
  556. /// <param name="userCode">用户code</param>
  557. /// <param name="userPassword">用户密码</param>
  558. /// <param name="sessionKey">本次登陆密钥</param>
  559. /// <param name="kilnCarCode">窑车号</param>
  560. /// <param name="modelType">工序类别</param>
  561. /// <returns></returns>
  562. /// <remarks>
  563. /// 陈冰 2014.10.04 新建
  564. /// </remarks>
  565. public ActionResult CheckKilnCar(string accountCode, string userCode, string userPassword, string sessionKey, int pProcedureId, string kilnCarCode, int modelType)
  566. {
  567. ActionResult actionResult = new ActionResult();
  568. try
  569. {
  570. // 验证请求头信息
  571. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  572. // 验证失败
  573. if (actionResult.Status != (int)Constant.PDAResult.Success)
  574. {
  575. return actionResult;
  576. }
  577. CheckKilnCarResultEntity checkKilnCarResultEntity = ServiceInvoker.Invoke<CheckKilnCarResultEntity>(this,
  578. () => PMModuleLogic.CheckKilnCar(pProcedureId, kilnCarCode, modelType, sUserInfo));
  579. actionResult.Result = JsonHelper.ToJson(checkKilnCarResultEntity);
  580. actionResult.Status = (int)Constant.PDAResult.Success;
  581. }
  582. catch (Exception ex)
  583. {
  584. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  585. OutputLog.TraceLog(LogPriority.Error,
  586. this.ToString(),
  587. System.Reflection.MethodBase.GetCurrentMethod().Name,
  588. ex.ToString(),
  589. LocalPath.LogExePath);
  590. actionResult.Status = (int)Constant.PDAResult.Exception;
  591. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  592. }
  593. return actionResult;
  594. }
  595. #endregion
  596. #region 保存条码信息
  597. /// <summary>
  598. /// 保存条码信息
  599. /// </summary>
  600. /// <param name="accountCode">帐套code</param>
  601. /// <param name="userCode">用户code</param>
  602. /// <param name="userPassword">用户密码</param>
  603. /// <param name="sessionKey">本次登陆密钥</param>
  604. /// <param name="procedureID">工序ID</param>
  605. /// <param name="productionDataEntitys">条码信息</param>
  606. public ActionResult AddWorkPiece(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, ProductionDataEntity[] productionDataEntitys)
  607. {
  608. ActionResult actionResult = new ActionResult();
  609. try
  610. {
  611. // 验证请求头信息
  612. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  613. // 验证失败
  614. if (actionResult.Status != (int)Constant.PDAResult.Success)
  615. {
  616. return actionResult;
  617. }
  618. DataTable dtProductionData = DataConvert.ObjectConvertToTable<ProductionDataEntity>(productionDataEntitys);
  619. if (!dtProductionData.Columns.Contains("IsPDA"))
  620. {
  621. dtProductionData.Columns.Add("IsPDA");
  622. }
  623. ProcedureEntity procedureInfo = null;
  624. DataTable resultDT = ServiceInvoker.Invoke<DataTable>(this,
  625. () => PMModuleLogicDAL.AddWorkPiece(procedureID, dtProductionData, sUserInfo, out procedureInfo));
  626. actionResult.Result = JsonHelper.ToJson(resultDT);
  627. actionResult.Status = (int)Constant.PDAResult.Success;
  628. if (resultDT != null)
  629. {
  630. DataRow[] drs = resultDT.Select("out_errMsg is not null and out_errMsg <> ''");
  631. if (drs != null && drs.Length > 0)
  632. {
  633. return actionResult;
  634. }
  635. }
  636. #region PDA条码打印
  637. if (procedureInfo != null && procedureInfo.BarCodePrintCopies > 0 &&
  638. procedureInfo.ModelType == (int)Constant.ProcedureModelType.Normal)
  639. {
  640. try
  641. {
  642. if (procedureInfo.CollectType == 1)
  643. {
  644. //foreach (DataRow item in dtProductionData.Rows)
  645. //{
  646. // ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode(item["barcode"].ToString(),
  647. // procedureInfo.BarCodePrintCopies, null, sUserInfo);
  648. // if (sre.Status != Constant.ServiceResultStatus.Success)
  649. // {
  650. // actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  651. // actionResult.Message = sre.Message;
  652. // return actionResult;
  653. // }
  654. //}
  655. }
  656. else
  657. {
  658. //ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode(dtProductionData.Rows[0]["barcode"].ToString(),
  659. // procedureInfo.BarCodePrintCopies, null, sUserInfo);
  660. ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode_3C(dtProductionData.Rows[0]["barcode"].ToString(),
  661. procedureInfo.BarCodePrintCopies, null, sUserInfo, 0);
  662. if (sre.Status != Constant.ServiceResultStatus.Success)
  663. {
  664. actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  665. actionResult.Message = sre.Message;
  666. return actionResult;
  667. }
  668. }
  669. }
  670. catch (Exception ex)
  671. {
  672. OutputLog.TraceLog(LogPriority.Error,
  673. this.ToString(),
  674. System.Reflection.MethodBase.GetCurrentMethod().Name,
  675. ex.ToString(),
  676. LocalPath.LogExePath);
  677. actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  678. actionResult.Message = "条码打印异常";
  679. return actionResult;
  680. }
  681. }
  682. #endregion PDA条码打印
  683. }
  684. catch (Exception ex)
  685. {
  686. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  687. OutputLog.TraceLog(LogPriority.Error,
  688. this.ToString(),
  689. System.Reflection.MethodBase.GetCurrentMethod().Name,
  690. ex.ToString(),
  691. LocalPath.LogExePath);
  692. try
  693. {
  694. string ss = JsonHelper.ToJson(productionDataEntitys);
  695. OutputLog.TraceLog(LogPriority.Error,
  696. this.ToString(),
  697. System.Reflection.MethodBase.GetCurrentMethod().Name,
  698. $" userCode:{userCode} procedureID:{procedureID} " + ss,
  699. LocalPath.LogExePath);
  700. }
  701. catch
  702. {
  703. }
  704. actionResult.Status = (int)Constant.PDAResult.Exception;
  705. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  706. }
  707. return actionResult;
  708. }
  709. #endregion
  710. #region 获得系统/基数数据
  711. /// <summary>
  712. /// 获得数据字典
  713. /// </summary>
  714. /// <param name="accountCode">帐套code</param>
  715. /// <param name="userCode">用户code</param>
  716. /// <param name="userPassword">用户密码</param>
  717. /// <param name="sessionKey">本次登陆密钥</param>
  718. /// <param name="dicType">字典类型</param>
  719. /// <returns></returns>
  720. public ActionResult GetDataDictionaryByType(string accountCode, string userCode, string userPassword, string sessionKey, string dicType)
  721. {
  722. ActionResult actionResult = new ActionResult();
  723. try
  724. {
  725. // 验证请求头信息
  726. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  727. // 验证失败
  728. if (actionResult.Status != (int)Constant.PDAResult.Success)
  729. {
  730. return actionResult;
  731. }
  732. DataTable dicDataTable = ServiceInvoker.Invoke<DataTable>(this,
  733. () => CommonModuleLogic.GetDataDictionaryByType(sUserInfo, dicType));
  734. actionResult.Result = JsonHelper.ToJson(dicDataTable);
  735. actionResult.Status = (int)Constant.PDAResult.Success;
  736. }
  737. catch (Exception ex)
  738. {
  739. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  740. OutputLog.TraceLog(LogPriority.Error,
  741. this.ToString(),
  742. System.Reflection.MethodBase.GetCurrentMethod().Name,
  743. ex.ToString(),
  744. LocalPath.LogExePath);
  745. actionResult.Status = (int)Constant.PDAResult.Exception;
  746. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  747. }
  748. return actionResult;
  749. }
  750. #endregion
  751. #region 检验工序接口
  752. /// <summary>
  753. /// 获得检验标识
  754. /// </summary>
  755. /// <param name="accountCode">帐套code</param>
  756. /// <param name="userCode">用户code</param>
  757. /// <param name="userPassword">用户密码</param>
  758. /// <param name="sessionKey">本次登陆密钥</param>
  759. /// <returns></returns>
  760. /// <remarks>
  761. /// 陈冰 2014.10.04 新建
  762. /// </remarks>
  763. public ActionResult GetDefectFlagData(string accountCode, string userCode, string userPassword, string sessionKey)
  764. {
  765. ActionResult actionResult = new ActionResult();
  766. try
  767. {
  768. // 验证请求头信息
  769. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  770. // 验证失败
  771. if (actionResult.Status != (int)Constant.PDAResult.Success)
  772. {
  773. return actionResult;
  774. }
  775. #region 构造缺陷标识的数据源
  776. DataTable dtDefectFlag = CreateDataSource.GetDefectFlagTable();
  777. #endregion
  778. actionResult.Result = JsonHelper.ToJson(dtDefectFlag);
  779. actionResult.Status = (int)Constant.PDAResult.Success;
  780. }
  781. catch (Exception ex)
  782. {
  783. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  784. OutputLog.TraceLog(LogPriority.Error,
  785. this.ToString(),
  786. System.Reflection.MethodBase.GetCurrentMethod().Name,
  787. ex.ToString(),
  788. LocalPath.LogExePath);
  789. actionResult.Status = (int)Constant.PDAResult.Exception;
  790. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  791. }
  792. return actionResult;
  793. }
  794. /// <summary>
  795. /// 由条码和当前检验工序获取返工工序
  796. /// </summary>
  797. /// <param name="accountCode">帐套code</param>
  798. /// <param name="userCode">用户code</param>
  799. /// <param name="userPassword">用户密码</param>
  800. /// <param name="sessionKey">本次登陆密钥</param>
  801. /// <param name="procedureID">当前检验工序ID</param>
  802. /// <param name="barcode">条码</param>
  803. /// <returns></returns>
  804. /// <remarks>
  805. /// 陈冰 2014.10.04 新建
  806. /// </remarks>
  807. public ActionResult GetReworkProcedureByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  808. {
  809. ActionResult actionResult = new ActionResult();
  810. try
  811. {
  812. // 验证请求头信息
  813. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  814. // 验证失败
  815. if (actionResult.Status != (int)Constant.PDAResult.Success)
  816. {
  817. return actionResult;
  818. }
  819. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  820. () => PMModuleLogic.GetReworkProcedureByBarcode(procedureID, barcode));
  821. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  822. {
  823. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  824. actionResult.Status = (int)Constant.PDAResult.Success;
  825. }
  826. else
  827. {
  828. actionResult.Status = (int)Constant.PDAResult.Fail;
  829. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  830. }
  831. }
  832. catch (Exception ex)
  833. {
  834. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  835. OutputLog.TraceLog(LogPriority.Error,
  836. this.ToString(),
  837. System.Reflection.MethodBase.GetCurrentMethod().Name,
  838. ex.ToString(),
  839. LocalPath.LogExePath);
  840. actionResult.Status = (int)Constant.PDAResult.Exception;
  841. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  842. }
  843. return actionResult;
  844. }
  845. /// <summary>
  846. /// 由当前检验工序获取缺陷列表
  847. /// </summary>
  848. /// <param name="accountCode">帐套code</param>
  849. /// <param name="userCode">用户code</param>
  850. /// <param name="userPassword">用户密码</param>
  851. /// <param name="sessionKey">本次登陆密钥</param>
  852. /// <param name="procedureID">当前检验工序ID</param>
  853. /// <param name="defectCode">缺陷编码</param>
  854. /// <returns></returns>
  855. /// <remarks>
  856. /// 陈冰 2014.10.04 新建
  857. /// </remarks>
  858. public ActionResult GetDefectByProcedureIDAndDefectCode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string defectCode)
  859. {
  860. ActionResult actionResult = new ActionResult();
  861. try
  862. {
  863. // 验证请求头信息
  864. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  865. // 验证失败
  866. if (actionResult.Status != (int)Constant.PDAResult.Success)
  867. {
  868. return actionResult;
  869. }
  870. object defectDs = ServiceInvoker.Invoke<object>(this,
  871. () => PMModuleLogic.GetDefectByProcedureIDAndDefectCode(procedureID, defectCode));
  872. if (defectDs != null)
  873. {
  874. actionResult.Result = JsonHelper.ToJson(defectDs);
  875. actionResult.Status = (int)Constant.PDAResult.Success;
  876. }
  877. else
  878. {
  879. actionResult.Status = (int)Constant.PDAResult.Fail;
  880. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  881. }
  882. }
  883. catch (Exception ex)
  884. {
  885. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  886. OutputLog.TraceLog(LogPriority.Error,
  887. this.ToString(),
  888. System.Reflection.MethodBase.GetCurrentMethod().Name,
  889. ex.ToString(),
  890. LocalPath.LogExePath);
  891. actionResult.Status = (int)Constant.PDAResult.Exception;
  892. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  893. }
  894. return actionResult;
  895. }
  896. /// <summary>
  897. /// 根据产品ID查出缺陷位置
  898. /// </summary>
  899. /// <param name="accountCode">帐套code</param>
  900. /// <param name="userCode">用户code</param>
  901. /// <param name="userPassword">用户密码</param>
  902. /// <param name="sessionKey">本次登陆密钥</param>
  903. /// <param name="goodsID">产品ID</param>
  904. /// <param name="positionCode">位置编码</param>
  905. /// <returns></returns>
  906. /// <remarks>
  907. /// 陈冰 2014.10.04 新建
  908. /// </remarks>
  909. public ActionResult GetDefectPositionByGoodsIDAndPositionCode(string accountCode, string userCode, string userPassword, string sessionKey, int goodsID, string positionCode)
  910. {
  911. ActionResult actionResult = new ActionResult();
  912. try
  913. {
  914. // 验证请求头信息
  915. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  916. // 验证失败
  917. if (actionResult.Status != (int)Constant.PDAResult.Success)
  918. {
  919. return actionResult;
  920. }
  921. // 缺陷位置已经不用在关联产品
  922. //object defectDs = ServiceInvoker.Invoke<object>(this,() => PMModuleLogic.GetDefectPositionByGoodsIDAndPositionCode(goodsID, positionCode));
  923. object defectDs = ServiceInvoker.Invoke<object>(this, () => PMModuleLogic.GetDefectPosition(positionCode, sUserInfo));
  924. if (defectDs != null)
  925. {
  926. actionResult.Result = JsonHelper.ToJson(defectDs);
  927. actionResult.Status = (int)Constant.PDAResult.Success;
  928. }
  929. else
  930. {
  931. actionResult.Status = (int)Constant.PDAResult.Fail;
  932. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  933. }
  934. }
  935. catch (Exception ex)
  936. {
  937. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  938. OutputLog.TraceLog(LogPriority.Error,
  939. this.ToString(),
  940. System.Reflection.MethodBase.GetCurrentMethod().Name,
  941. ex.ToString(),
  942. LocalPath.LogExePath);
  943. actionResult.Status = (int)Constant.PDAResult.Exception;
  944. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  945. }
  946. return actionResult;
  947. }
  948. /// <summary>
  949. /// 通过条码和缺陷查出责任工序
  950. /// </summary>
  951. /// <param name="accountCode">帐套code</param>
  952. /// <param name="userCode">用户code</param>
  953. /// <param name="userPassword">用户密码</param>
  954. /// <param name="sessionKey">本次登陆密钥</param>
  955. /// <param name="barcode">条码</param>
  956. /// <param name="defectid">缺陷ID</param>
  957. /// <returns></returns>
  958. /// <remarks>
  959. /// 陈冰 2014.10.04 新建
  960. /// </remarks>
  961. public ActionResult GetDutyProcedureByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int defectid)
  962. {
  963. ActionResult actionResult = new ActionResult();
  964. try
  965. {
  966. // 验证请求头信息
  967. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  968. // 验证失败
  969. if (actionResult.Status != (int)Constant.PDAResult.Success)
  970. {
  971. return actionResult;
  972. }
  973. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  974. () => PMModuleLogic.GetDutyProcedureByBarCode(barcode, defectid, sUserInfo.AccountID));
  975. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  976. {
  977. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs);
  978. actionResult.Status = (int)Constant.PDAResult.Success;
  979. }
  980. else
  981. {
  982. actionResult.Status = (int)Constant.PDAResult.Fail;
  983. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  984. }
  985. }
  986. catch (Exception ex)
  987. {
  988. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  989. OutputLog.TraceLog(LogPriority.Error,
  990. this.ToString(),
  991. System.Reflection.MethodBase.GetCurrentMethod().Name,
  992. ex.ToString(),
  993. LocalPath.LogExePath);
  994. actionResult.Status = (int)Constant.PDAResult.Exception;
  995. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  996. }
  997. return actionResult;
  998. }
  999. /// <summary>
  1000. /// 通过条码与工序查出责任工号(己废)
  1001. /// </summary>
  1002. /// <param name="accountCode">帐套code</param>
  1003. /// <param name="userCode">用户code</param>
  1004. /// <param name="userPassword">用户密码</param>
  1005. /// <param name="sessionKey">本次登陆密钥</param>
  1006. /// <param name="barcode">条码</param>
  1007. /// <param name="dutyProcedureID">责任工序</param>
  1008. /// <returns></returns>
  1009. /// <remarks>
  1010. /// 陈冰 2014.10.04 新建
  1011. /// </remarks>
  1012. public ActionResult GetDutyProcedureCodeByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int dutyProcedureID)
  1013. {
  1014. ActionResult actionResult = new ActionResult();
  1015. try
  1016. {
  1017. // 验证请求头信息
  1018. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1019. // 验证失败
  1020. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1021. {
  1022. return actionResult;
  1023. }
  1024. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1025. () => PMModuleLogic.GetDutyProcedureCodeByBarCode(barcode, dutyProcedureID));
  1026. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1027. {
  1028. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1029. actionResult.Status = (int)Constant.PDAResult.Success;
  1030. }
  1031. else
  1032. {
  1033. actionResult.Status = (int)Constant.PDAResult.Fail;
  1034. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1035. }
  1036. }
  1037. catch (Exception ex)
  1038. {
  1039. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1040. OutputLog.TraceLog(LogPriority.Error,
  1041. this.ToString(),
  1042. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1043. ex.ToString(),
  1044. LocalPath.LogExePath);
  1045. actionResult.Status = (int)Constant.PDAResult.Exception;
  1046. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1047. }
  1048. return actionResult;
  1049. }
  1050. /// <summary>
  1051. /// 通过条码与工序查出责任工号
  1052. /// </summary>
  1053. /// <param name="accountCode"></param>
  1054. /// <param name="userCode"></param>
  1055. /// <param name="userPassword"></param>
  1056. /// <param name="sessionKey"></param>
  1057. /// <param name="ProductionDataID">生产数据ID</param>
  1058. /// <returns></returns>
  1059. public ActionResult GetDutyProcedureCodeByProductionDataID(string accountCode, string userCode, string userPassword, string sessionKey, int ProductionDataID)
  1060. {
  1061. ActionResult actionResult = new ActionResult();
  1062. try
  1063. {
  1064. // 验证请求头信息
  1065. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1066. // 验证失败
  1067. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1068. {
  1069. return actionResult;
  1070. }
  1071. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1072. () => PMModuleLogic.GetDutyProcedureCodeByProductionDataID(ProductionDataID));
  1073. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1074. {
  1075. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1076. actionResult.Status = (int)Constant.PDAResult.Success;
  1077. }
  1078. else
  1079. {
  1080. actionResult.Status = (int)Constant.PDAResult.Fail;
  1081. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1082. }
  1083. }
  1084. catch (Exception ex)
  1085. {
  1086. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1087. OutputLog.TraceLog(LogPriority.Error,
  1088. this.ToString(),
  1089. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1090. ex.ToString(),
  1091. LocalPath.LogExePath);
  1092. actionResult.Status = (int)Constant.PDAResult.Exception;
  1093. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1094. }
  1095. return actionResult;
  1096. }
  1097. /// <summary>
  1098. /// 通过生产数据与工号ID查询工种
  1099. /// </summary>
  1100. /// <param name="accountCode">帐套code</param>
  1101. /// <param name="userCode">用户code</param>
  1102. /// <param name="userPassword">用户密码</param>
  1103. /// <param name="sessionKey">本次登陆密钥</param>
  1104. /// <param name="productionDataID">生产数据ID</param>
  1105. /// <param name="userID">工号ID</param>
  1106. /// <returns></returns>
  1107. /// <remarks>
  1108. /// 陈冰 2014.10.08 新建
  1109. /// </remarks>
  1110. public ActionResult GetDutyJobsByUserIDAndProductionID(string accountCode, string userCode, string userPassword, string sessionKey,
  1111. //int productionDataID, int userID)
  1112. int classesSettingID, int defectid, int procedureID)
  1113. {
  1114. ActionResult actionResult = new ActionResult();
  1115. try
  1116. {
  1117. // 验证请求头信息
  1118. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1119. // 验证失败
  1120. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1121. {
  1122. return actionResult;
  1123. }
  1124. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1125. //() => PMModuleLogic.GetDutyJobsCodeByUser(userID, productionDataID));
  1126. () => PDAModuleLogic.GetDutyJobsCodeByUser(classesSettingID, defectid, procedureID));
  1127. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1128. {
  1129. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1130. actionResult.Status = (int)Constant.PDAResult.Success;
  1131. }
  1132. else
  1133. {
  1134. actionResult.Status = (int)Constant.PDAResult.Fail;
  1135. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1136. }
  1137. }
  1138. catch (Exception ex)
  1139. {
  1140. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1141. OutputLog.TraceLog(LogPriority.Error,
  1142. this.ToString(),
  1143. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1144. ex.ToString(),
  1145. LocalPath.LogExePath);
  1146. actionResult.Status = (int)Constant.PDAResult.Exception;
  1147. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1148. }
  1149. return actionResult;
  1150. }
  1151. /// <summary>
  1152. /// 根据生产数据ID,用户ID及工种选出责任员工
  1153. /// </summary>
  1154. /// <param name="accountCode">帐套code</param>
  1155. /// <param name="userCode">用户code</param>
  1156. /// <param name="userPassword">用户密码</param>
  1157. /// <param name="sessionKey">本次登陆密钥</param>
  1158. /// <param name="productionDataID">生产数据ID</param>
  1159. /// <param name="userID">工号ID</param>
  1160. /// <param name="jobsID">工种ID</param>
  1161. /// <returns></returns>
  1162. /// <remarks>
  1163. /// 陈冰 2014.10.08 新建
  1164. /// </remarks>
  1165. public ActionResult GetDutyStaffByUserIDAndJobs(string accountCode, string userCode, string userPassword, string sessionKey,
  1166. //int productionDataID, int userID, int jobsID)
  1167. int classesSettingID, int jobsID)
  1168. {
  1169. ActionResult actionResult = new ActionResult();
  1170. try
  1171. {
  1172. // 验证请求头信息
  1173. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1174. // 验证失败
  1175. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1176. {
  1177. return actionResult;
  1178. }
  1179. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1180. //() => PMModuleLogic.GetDutyStaffByUserIDAndJobs(productionDataID, userID, jobsID));
  1181. () => PDAModuleLogic.GetDutyStaffByUserIDAndJobs(classesSettingID, jobsID));
  1182. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1183. {
  1184. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1185. actionResult.Status = (int)Constant.PDAResult.Success;
  1186. }
  1187. else
  1188. {
  1189. actionResult.Status = (int)Constant.PDAResult.Fail;
  1190. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1191. }
  1192. }
  1193. catch (Exception ex)
  1194. {
  1195. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1196. OutputLog.TraceLog(LogPriority.Error,
  1197. this.ToString(),
  1198. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1199. ex.ToString(),
  1200. LocalPath.LogExePath);
  1201. actionResult.Status = (int)Constant.PDAResult.Exception;
  1202. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1203. }
  1204. return actionResult;
  1205. }
  1206. /// <summary>
  1207. /// 获得产品分级
  1208. /// </summary>
  1209. /// <param name="accountCode">帐套code</param>
  1210. /// <param name="userCode">用户code</param>
  1211. /// <param name="userPassword">用户密码</param>
  1212. /// <param name="sessionKey">本次登陆密钥</param>
  1213. /// <returns></returns>
  1214. /// <remarks>
  1215. /// 陈冰 2014.10.08 新建
  1216. /// </remarks>
  1217. public ActionResult GetGoodsGradeData(string accountCode, string userCode, string userPassword, string sessionKey)
  1218. {
  1219. ActionResult actionResult = new ActionResult();
  1220. try
  1221. {
  1222. // 验证请求头信息
  1223. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1224. // 验证失败
  1225. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1226. {
  1227. return actionResult;
  1228. }
  1229. #region 构造产品分级的数据源
  1230. //DataTable dtGrade = CreateDataSource.GetGoodsGradeTable();
  1231. DataSet dsGrade = SystemModuleLogic.GetGoodsLevel(2, sUserInfo);
  1232. if (dsGrade != null && dsGrade.Tables.Count > Constant.INT_IS_ZERO)
  1233. {
  1234. actionResult.Result = JsonHelper.ToJson(dsGrade.Tables[0]);
  1235. actionResult.Status = (int)Constant.PDAResult.Success;
  1236. }
  1237. else
  1238. {
  1239. actionResult.Status = (int)Constant.PDAResult.Fail;
  1240. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1241. }
  1242. #endregion
  1243. }
  1244. catch (Exception ex)
  1245. {
  1246. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1247. OutputLog.TraceLog(LogPriority.Error,
  1248. this.ToString(),
  1249. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1250. ex.ToString(),
  1251. LocalPath.LogExePath);
  1252. OutputLog.TraceLog(LogPriority.Error,
  1253. this.ToString(),
  1254. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1255. ex.ToString(),
  1256. LocalPath.LogExePath);
  1257. actionResult.Status = (int)Constant.PDAResult.Exception;
  1258. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1259. }
  1260. return actionResult;
  1261. }
  1262. #endregion
  1263. #region 保存检验条码
  1264. /// <summary>
  1265. /// 保存检验条码
  1266. /// </summary>
  1267. /// <param name="accountCode">帐套code</param>
  1268. /// <param name="userCode">用户code</param>
  1269. /// <param name="userPassword">用户密码</param>
  1270. /// <param name="sessionKey">本次登陆密钥</param>
  1271. /// <param name="procedureID">工序ID</param>
  1272. /// <param name="productionDataEntitys">条码信息</param>
  1273. /// <returns></returns>
  1274. public ActionResult AddCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, ProductionDataEntity[] productionDataEntitys)
  1275. {
  1276. ActionResult actionResult = new ActionResult();
  1277. try
  1278. {
  1279. // 验证请求头信息
  1280. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1281. // 验证失败
  1282. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1283. {
  1284. return actionResult;
  1285. }
  1286. //if(productionDataEntitys.Length>0)
  1287. //{
  1288. // if(productionDataEntitys[0].ProductionDataID>0)
  1289. // {
  1290. // productionDataEntitys[0].OPTimeStamp = Convert.ToDateTime(productionDataEntitys[0].OPTimeStampPDA.Replace("-","/"));
  1291. // }
  1292. //}
  1293. string err = ServiceInvoker.Invoke<string>(this,
  1294. //() => PMModuleLogicDAL.AddCheckBarcode(procedureID, productionDataEntitys, sUserInfo));
  1295. () => PMModuleLogicDAL.AddCheckBarcodePDA(procedureID, productionDataEntitys, sUserInfo));
  1296. if (err == null)
  1297. {
  1298. err = "";
  1299. }
  1300. //actionResult.Result = JsonHelper.ToJson(err);
  1301. actionResult.Result = err;// JsonHelper.ToJson(err);
  1302. actionResult.Status = (int)Constant.PDAResult.Success;
  1303. }
  1304. catch (Exception ex)
  1305. {
  1306. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1307. OutputLog.TraceLog(LogPriority.Error,
  1308. this.ToString(),
  1309. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1310. ex.ToString(),
  1311. LocalPath.LogExePath);
  1312. actionResult.Status = (int)Constant.PDAResult.Exception;
  1313. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1314. }
  1315. return actionResult;
  1316. }
  1317. #endregion
  1318. #region 文件上传下载
  1319. /// <summary>
  1320. /// 软件更新
  1321. /// </summary>
  1322. /// <param name="accountCode">帐套code</param>
  1323. /// <param name="userCode">用户code</param>
  1324. /// <param name="userPassword">用户密码</param>
  1325. /// <param name="sessionKey">本次登陆密钥</param>
  1326. /// <returns></returns>
  1327. public Stream AutoUpgrade(string accountCode, string userCode, string userPassword, string sessionKey)
  1328. {
  1329. try
  1330. {
  1331. return ServiceInvoker.Invoke<Stream>(this, () => PDAModuleLogic.AutoUpgrade());
  1332. }
  1333. catch (Exception ex)
  1334. {
  1335. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1336. OutputLog.TraceLog(LogPriority.Error,
  1337. this.ToString(),
  1338. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1339. ex.ToString(),
  1340. LocalPath.LogExePath);
  1341. return null;
  1342. }
  1343. }
  1344. /// <summary>
  1345. /// 上传临时文件
  1346. /// </summary>
  1347. /// <param name="imgStream"></param>
  1348. /// <returns></returns>
  1349. public ActionResult SaveImg(Stream mageStream)
  1350. {
  1351. ActionResult actionResult = new ActionResult();
  1352. try
  1353. {
  1354. string err = PDAModuleLogic.SaveImg(mageStream);
  1355. if (err == null)
  1356. {
  1357. err = "";
  1358. }
  1359. actionResult.Result = err;
  1360. actionResult.Status = (int)Constant.PDAResult.Success;
  1361. }
  1362. catch (Exception ex)
  1363. {
  1364. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1365. OutputLog.TraceLog(LogPriority.Error,
  1366. this.ToString(),
  1367. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1368. ex.ToString(),
  1369. LocalPath.LogExePath);
  1370. actionResult.Status = (int)Constant.PDAResult.Exception;
  1371. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1372. }
  1373. return actionResult;
  1374. }
  1375. public Stream GetFileTest(string path)
  1376. {
  1377. return PDAModuleLogic.GetImg(path);
  1378. }
  1379. public Stream GetFileStream()
  1380. {
  1381. FileStream fs = new FileStream("999.apk", FileMode.OpenOrCreate, FileAccess.Read);
  1382. long l = fs.Length;
  1383. return fs;
  1384. }
  1385. public byte[] GetFileTestByte(string path)
  1386. {
  1387. FileStream stream = new FileInfo(path).OpenRead();
  1388. Byte[] buffer = new Byte[stream.Length];
  1389. //从流中读取字节块并将该数据写入给定缓冲区buffer中
  1390. stream.Read(buffer, 0, Convert.ToInt32(stream.Length));
  1391. return buffer;
  1392. }
  1393. public string GetFile(string path)
  1394. {
  1395. string imgFilePath = path;
  1396. System.IO.FileStream fs = new System.IO.FileStream(imgFilePath, System.IO.FileMode.Open);
  1397. int i = (int)fs.Length;
  1398. byte[] content = new byte[i];
  1399. fs.Read(content, 0, i);
  1400. string result = Convert.ToBase64String(content);
  1401. fs.Close();
  1402. FileStream fsTxt = new FileStream("A.txt", FileMode.OpenOrCreate);
  1403. StreamWriter sw = new StreamWriter(fsTxt, System.Text.Encoding.Default);
  1404. sw.Write(result);
  1405. sw.Close();
  1406. fsTxt.Close();
  1407. return result;
  1408. }
  1409. #endregion
  1410. /// <summary>
  1411. /// 获得产品分级
  1412. /// </summary>
  1413. /// <param name="accountCode">帐套code</param>
  1414. /// <param name="userCode">用户code</param>
  1415. /// <param name="userPassword">用户密码</param>
  1416. /// <param name="sessionKey">本次登陆密钥</param>
  1417. /// <param name="procedureID">当前工序ID</param>
  1418. /// <returns></returns>
  1419. /// <remarks>
  1420. /// 陈冰 2014.10.22 新建
  1421. /// </remarks>
  1422. public ActionResult GetReworkProcedureByProcedureID(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  1423. {
  1424. ActionResult actionResult = new ActionResult();
  1425. try
  1426. {
  1427. // 验证请求头信息
  1428. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1429. // 验证失败
  1430. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1431. {
  1432. return actionResult;
  1433. }
  1434. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1435. () => PMModuleLogic.GetReworkProcedureByProcedureID(procedureID));
  1436. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1437. {
  1438. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1439. actionResult.Status = (int)Constant.PDAResult.Success;
  1440. }
  1441. else
  1442. {
  1443. actionResult.Status = (int)Constant.PDAResult.Fail;
  1444. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1445. }
  1446. }
  1447. catch (Exception ex)
  1448. {
  1449. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1450. OutputLog.TraceLog(LogPriority.Error,
  1451. this.ToString(),
  1452. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1453. ex.ToString(),
  1454. LocalPath.LogExePath);
  1455. actionResult.Status = (int)Constant.PDAResult.Exception;
  1456. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1457. }
  1458. return actionResult;
  1459. }
  1460. /// <summary>
  1461. /// 获得产品分级
  1462. /// </summary>
  1463. /// <param name="accountCode">帐套code</param>
  1464. /// <param name="userCode">用户code</param>
  1465. /// <param name="userPassword">用户密码</param>
  1466. /// <param name="sessionKey">本次登陆密钥</param>
  1467. /// <param name="barcode">条码</param>
  1468. /// <returns></returns>
  1469. public ActionResult GetKilnCarByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  1470. {
  1471. ActionResult actionResult = new ActionResult();
  1472. try
  1473. {
  1474. // 验证请求头信息
  1475. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1476. // 验证失败
  1477. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1478. {
  1479. return actionResult;
  1480. }
  1481. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1482. () => PMModuleLogic.GetKilnCarByBarCode(barcode));
  1483. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1484. {
  1485. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1486. actionResult.Status = (int)Constant.PDAResult.Success;
  1487. }
  1488. else
  1489. {
  1490. actionResult.Status = (int)Constant.PDAResult.Fail;
  1491. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1492. }
  1493. }
  1494. catch (Exception ex)
  1495. {
  1496. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1497. OutputLog.TraceLog(LogPriority.Error,
  1498. this.ToString(),
  1499. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1500. ex.ToString(),
  1501. LocalPath.LogExePath);
  1502. actionResult.Status = (int)Constant.PDAResult.Exception;
  1503. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1504. }
  1505. return actionResult;
  1506. }
  1507. #region 统计
  1508. /// <summary>
  1509. /// 统计当日计数数量
  1510. /// </summary>
  1511. /// <param name="accountCode">帐套code</param>
  1512. /// <param name="userCode">用户code</param>
  1513. /// <param name="userPassword">用户密码</param>
  1514. /// <param name="sessionKey">本次登陆密钥</param>
  1515. /// <param name="procedureID">工序ID</param>
  1516. /// <returns></returns>
  1517. public ActionResult StatisticsCollectBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  1518. {
  1519. ActionResult actionResult = new ActionResult();
  1520. try
  1521. {
  1522. // 验证请求头信息
  1523. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1524. // 验证失败
  1525. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1526. {
  1527. return actionResult;
  1528. }
  1529. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1530. () => PDAModuleLogic.StatisticsCollectBarcode(procedureID, sUserInfo));
  1531. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1532. {
  1533. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1534. actionResult.Status = (int)Constant.PDAResult.Success;
  1535. }
  1536. else
  1537. {
  1538. actionResult.Status = (int)Constant.PDAResult.Fail;
  1539. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1540. }
  1541. }
  1542. catch (Exception ex)
  1543. {
  1544. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1545. OutputLog.TraceLog(LogPriority.Error,
  1546. this.ToString(),
  1547. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1548. ex.ToString(),
  1549. LocalPath.LogExePath);
  1550. actionResult.Status = (int)Constant.PDAResult.Exception;
  1551. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1552. }
  1553. return actionResult;
  1554. }
  1555. /// <summary>
  1556. /// 统计当日计数数量
  1557. /// </summary>
  1558. /// <param name="accountCode">帐套code</param>
  1559. /// <param name="userCode">用户code</param>
  1560. /// <param name="userPassword">用户密码</param>
  1561. /// <param name="sessionKey">本次登陆密钥</param>
  1562. /// <param name="procedureID">工序ID</param>
  1563. /// <returns></returns>
  1564. public ActionResult StatisticsKilnCar(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  1565. {
  1566. ActionResult actionResult = new ActionResult();
  1567. try
  1568. {
  1569. // 验证请求头信息
  1570. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1571. // 验证失败
  1572. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1573. {
  1574. return actionResult;
  1575. }
  1576. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1577. () => PDAModuleLogic.StatisticsKilnCar(procedureID, sUserInfo));
  1578. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1579. {
  1580. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1581. actionResult.Status = (int)Constant.PDAResult.Success;
  1582. }
  1583. else
  1584. {
  1585. actionResult.Status = (int)Constant.PDAResult.Fail;
  1586. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1587. }
  1588. }
  1589. catch (Exception ex)
  1590. {
  1591. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1592. OutputLog.TraceLog(LogPriority.Error,
  1593. this.ToString(),
  1594. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1595. ex.ToString(),
  1596. LocalPath.LogExePath);
  1597. actionResult.Status = (int)Constant.PDAResult.Exception;
  1598. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1599. }
  1600. return actionResult;
  1601. }
  1602. /// <summary>
  1603. /// 统计产品跟踪
  1604. /// </summary>
  1605. /// <param name="accountCode">帐套code</param>
  1606. /// <param name="userCode">用户code</param>
  1607. /// <param name="userPassword">用户密码</param>
  1608. /// <param name="sessionKey">本次登陆密钥</param>
  1609. /// <param name="procedureID">工序ID</param>
  1610. /// <returns></returns>
  1611. public ActionResult StatisticsProductTrack(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  1612. {
  1613. ActionResult actionResult = new ActionResult();
  1614. try
  1615. {
  1616. // 验证请求头信息
  1617. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1618. // 验证失败
  1619. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1620. {
  1621. return actionResult;
  1622. }
  1623. RPT020101_SE se = new RPT020101_SE();
  1624. se.Barcode = barcode;
  1625. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  1626. () => Dongke.IBOSS.PRD.Service.ReportModuleLogic.ReportModuleLogic.GetRPT020101SData(sUserInfo, se));
  1627. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  1628. {
  1629. actionResult.Status = (int)Constant.PDAResult.Fail;
  1630. actionResult.Message = Messages.MSG_CMN_I002;
  1631. }
  1632. else
  1633. {
  1634. actionResult.Result = JsonHelper.ToJson(sre.Data);
  1635. actionResult.Status = (int)Constant.PDAResult.Success;
  1636. }
  1637. //ProductionDataEntity productionDataEntity = ServiceInvoker.Invoke<ProductionDataEntity>(this,
  1638. // () => PDAModuleLogic.StatisticsProductTrack(barcode, sUserInfo));
  1639. //if (productionDataEntity != null)
  1640. //{
  1641. // actionResult.Result = JsonHelper.ToJson(productionDataEntity);
  1642. // actionResult.Status = (int)Constant.PDAResult.Success;
  1643. //}
  1644. //else
  1645. //{
  1646. // actionResult.Status = (int)Constant.PDAResult.Fail;
  1647. // actionResult.Message = Messages.MSG_CMN_I002;
  1648. //}
  1649. }
  1650. catch (Exception ex)
  1651. {
  1652. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1653. OutputLog.TraceLog(LogPriority.Error,
  1654. this.ToString(),
  1655. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1656. ex.ToString() + ex.HelpLink,
  1657. LocalPath.LogExePath);
  1658. actionResult.Status = (int)Constant.PDAResult.Exception;
  1659. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1660. }
  1661. return actionResult;
  1662. }
  1663. #endregion
  1664. #region 撤销装车及成检
  1665. /// <summary>
  1666. /// 检验条码是否可以撤销装车
  1667. /// </summary>
  1668. /// <param name="accountCode">帐套code</param>
  1669. /// <param name="userCode">用户code</param>
  1670. /// <param name="userPassword">用户密码</param>
  1671. /// <param name="sessionKey">本次登陆密钥</param>
  1672. /// <param name="procedureID">当前工序ID</param>
  1673. /// <param name="barcode">条码</param>
  1674. /// <returns></returns>
  1675. public ActionResult CheckCancelLoadCar(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  1676. {
  1677. ActionResult actionResult = new ActionResult();
  1678. try
  1679. {
  1680. // 验证请求头信息
  1681. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1682. // 验证失败
  1683. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1684. {
  1685. return actionResult;
  1686. }
  1687. CheckCancelLoadCar checkCancelLoadCar = ServiceInvoker.Invoke<CheckCancelLoadCar>(this,
  1688. () => PMModuleLogic.CheckCancelLoadCar(procedureID, barcode, sUserInfo));
  1689. actionResult.Result = JsonHelper.ToJson(checkCancelLoadCar);
  1690. actionResult.Status = (int)Constant.PDAResult.Success;
  1691. }
  1692. catch (Exception ex)
  1693. {
  1694. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1695. OutputLog.TraceLog(LogPriority.Error,
  1696. this.ToString(),
  1697. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1698. ex.ToString(),
  1699. LocalPath.LogExePath);
  1700. actionResult.Status = (int)Constant.PDAResult.Exception;
  1701. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1702. }
  1703. return actionResult;
  1704. }
  1705. /// <summary>
  1706. /// 保存撤销装车的条码
  1707. /// </summary>
  1708. /// <param name="accountCode">帐套code</param>
  1709. /// <param name="userCode">用户code</param>
  1710. /// <param name="userPassword">用户密码</param>
  1711. /// <param name="sessionKey">本次登陆密钥</param>
  1712. /// <param name="procedureID">当前工序ID</param>
  1713. /// <param name="barcode">条码</param>
  1714. /// <returns></returns>
  1715. public ActionResult AddCancelLoadCar(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  1716. {
  1717. ActionResult actionResult = new ActionResult();
  1718. try
  1719. {
  1720. // 验证请求头信息
  1721. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1722. // 验证失败
  1723. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1724. {
  1725. return actionResult;
  1726. }
  1727. string err = ServiceInvoker.Invoke<string>(this,
  1728. () => PMModuleLogicDAL.AddCancelLoadCar(procedureID, barcode, sUserInfo));
  1729. if (err == null)
  1730. {
  1731. err = "";
  1732. }
  1733. actionResult.Result = JsonHelper.ToJson(err);
  1734. actionResult.Status = (int)Constant.PDAResult.Success;
  1735. }
  1736. catch (Exception ex)
  1737. {
  1738. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1739. OutputLog.TraceLog(LogPriority.Error,
  1740. this.ToString(),
  1741. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1742. ex.ToString(),
  1743. LocalPath.LogExePath);
  1744. actionResult.Status = (int)Constant.PDAResult.Exception;
  1745. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1746. }
  1747. return actionResult;
  1748. }
  1749. /// <summary>
  1750. /// 由产品条码获取注浆信息
  1751. /// </summary>
  1752. /// <param name="barcode"></param>
  1753. /// <returns></returns>
  1754. public ActionResult GetGroutingProducttByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  1755. {
  1756. ActionResult actionResult = new ActionResult();
  1757. try
  1758. {
  1759. // 验证请求头信息
  1760. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1761. // 验证失败
  1762. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1763. {
  1764. return actionResult;
  1765. }
  1766. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1767. () => PDAModuleLogic.GetGroutingProducttByBarCode(barcode));
  1768. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1769. {
  1770. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1771. actionResult.Status = (int)Constant.PDAResult.Success;
  1772. }
  1773. else
  1774. {
  1775. actionResult.Status = (int)Constant.PDAResult.Fail;
  1776. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1777. }
  1778. }
  1779. catch (Exception ex)
  1780. {
  1781. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1782. OutputLog.TraceLog(LogPriority.Error,
  1783. this.ToString(),
  1784. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1785. ex.ToString(),
  1786. LocalPath.LogExePath);
  1787. actionResult.Status = (int)Constant.PDAResult.Exception;
  1788. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1789. }
  1790. return actionResult;
  1791. }
  1792. /// <summary>
  1793. /// 获取工号下的所有工种信息
  1794. /// </summary>
  1795. /// <param name="UserID">工号ID</param>
  1796. /// <returns></returns>
  1797. public ActionResult GetAllJobsByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int UserID)
  1798. {
  1799. ActionResult actionResult = new ActionResult();
  1800. try
  1801. {
  1802. // 验证请求头信息
  1803. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1804. // 验证失败
  1805. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1806. {
  1807. return actionResult;
  1808. }
  1809. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1810. () => PDAModuleLogic.GetAllJobsByUserID(UserID, sUserInfo));
  1811. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1812. {
  1813. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1814. actionResult.Status = (int)Constant.PDAResult.Success;
  1815. }
  1816. else
  1817. {
  1818. actionResult.Status = (int)Constant.PDAResult.Fail;
  1819. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1820. }
  1821. }
  1822. catch (Exception ex)
  1823. {
  1824. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1825. OutputLog.TraceLog(LogPriority.Error,
  1826. this.ToString(),
  1827. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1828. ex.ToString(),
  1829. LocalPath.LogExePath);
  1830. actionResult.Status = (int)Constant.PDAResult.Exception;
  1831. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1832. }
  1833. return actionResult;
  1834. }
  1835. /// <summary>
  1836. /// 根据所选工号对应的工种,查出缺陷责任员工
  1837. /// </summary>
  1838. /// <param name="jobs">工种ID</param>
  1839. /// <returns></returns>
  1840. public ActionResult GetDutyStaffByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int jobs)
  1841. {
  1842. ActionResult actionResult = new ActionResult();
  1843. try
  1844. {
  1845. // 验证请求头信息
  1846. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1847. // 验证失败
  1848. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1849. {
  1850. return actionResult;
  1851. }
  1852. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1853. () => PDAModuleLogic.GetDutyStaffByUserID(jobs, sUserInfo));
  1854. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1855. {
  1856. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1857. actionResult.Status = (int)Constant.PDAResult.Success;
  1858. }
  1859. else
  1860. {
  1861. actionResult.Status = (int)Constant.PDAResult.Fail;
  1862. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1863. }
  1864. }
  1865. catch (Exception ex)
  1866. {
  1867. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1868. OutputLog.TraceLog(LogPriority.Error,
  1869. this.ToString(),
  1870. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1871. ex.ToString(),
  1872. LocalPath.LogExePath);
  1873. actionResult.Status = (int)Constant.PDAResult.Exception;
  1874. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1875. }
  1876. return actionResult;
  1877. }
  1878. /// <summary>
  1879. /// 根据所选工号,查出漏检责任员工
  1880. /// </summary>
  1881. /// <param name="userid">工号</param>
  1882. /// <returns></returns>
  1883. public ActionResult GetMissedStaffByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int userid)
  1884. {
  1885. ActionResult actionResult = new ActionResult();
  1886. try
  1887. {
  1888. // 验证请求头信息
  1889. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1890. // 验证失败
  1891. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1892. {
  1893. return actionResult;
  1894. }
  1895. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1896. () => PDAModuleLogic.GetMissedStaffByUserID(userid, sUserInfo));
  1897. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1898. {
  1899. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1900. actionResult.Status = (int)Constant.PDAResult.Success;
  1901. }
  1902. else
  1903. {
  1904. actionResult.Status = (int)Constant.PDAResult.Fail;
  1905. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1906. }
  1907. }
  1908. catch (Exception ex)
  1909. {
  1910. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1911. OutputLog.TraceLog(LogPriority.Error,
  1912. this.ToString(),
  1913. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1914. ex.ToString(),
  1915. LocalPath.LogExePath);
  1916. actionResult.Status = (int)Constant.PDAResult.Exception;
  1917. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1918. }
  1919. return actionResult;
  1920. }
  1921. /// <summary>
  1922. /// 获取用户列表
  1923. /// </summary>
  1924. /// <param name="requestEntity">用户实体</param>
  1925. /// <returns></returns>
  1926. public ActionResult SearchUserData(string accountCode, string userCode, string userPassword, string sessionKey, byte IsWorker)
  1927. {
  1928. ActionResult actionResult = new ActionResult();
  1929. try
  1930. {
  1931. // 验证请求头信息
  1932. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1933. // 验证失败
  1934. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1935. {
  1936. return actionResult;
  1937. }
  1938. SUserEntity requestEntity = new SUserEntity();
  1939. requestEntity.IsWorker = IsWorker;
  1940. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1941. () => PDAModuleLogic.SearchUserData(requestEntity, sUserInfo));
  1942. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1943. {
  1944. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1945. actionResult.Status = (int)Constant.PDAResult.Success;
  1946. }
  1947. else
  1948. {
  1949. actionResult.Status = (int)Constant.PDAResult.Fail;
  1950. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1951. }
  1952. }
  1953. catch (Exception ex)
  1954. {
  1955. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1956. OutputLog.TraceLog(LogPriority.Error,
  1957. this.ToString(),
  1958. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1959. ex.ToString(),
  1960. LocalPath.LogExePath);
  1961. actionResult.Status = (int)Constant.PDAResult.Exception;
  1962. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1963. }
  1964. return actionResult;
  1965. }
  1966. /// <summary>
  1967. /// 获取数据字典管理的数据
  1968. /// </summary>
  1969. /// <param name="Pvalue">显示停用标识</param>
  1970. /// <param name="dictionaryType">字典类别</param>
  1971. /// <returns></returns>
  1972. /// <remarks>
  1973. /// 2014.12.03 新建
  1974. /// </remarks>
  1975. public ActionResult GetDictionaryData(string accountCode, string userCode, string userPassword, string sessionKey, byte Pvalue, string dictionaryType)
  1976. {
  1977. ActionResult actionResult = new ActionResult();
  1978. try
  1979. {
  1980. // 验证请求头信息
  1981. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1982. // 验证失败
  1983. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1984. {
  1985. return actionResult;
  1986. }
  1987. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1988. () => PDAModuleLogic.GetDictionaryData(Pvalue, dictionaryType, sUserInfo));
  1989. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1990. {
  1991. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1992. actionResult.Status = (int)Constant.PDAResult.Success;
  1993. }
  1994. else
  1995. {
  1996. actionResult.Status = (int)Constant.PDAResult.Fail;
  1997. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1998. }
  1999. }
  2000. catch (Exception ex)
  2001. {
  2002. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2003. OutputLog.TraceLog(LogPriority.Error,
  2004. this.ToString(),
  2005. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2006. ex.ToString(),
  2007. LocalPath.LogExePath);
  2008. actionResult.Status = (int)Constant.PDAResult.Exception;
  2009. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2010. }
  2011. return actionResult;
  2012. }
  2013. #endregion
  2014. #region 保存半检数据
  2015. /// <summary>
  2016. /// 保存半检数据
  2017. /// </summary>
  2018. /// <param name="accountCode">帐套code</param>
  2019. /// <param name="userCode">用户code</param>
  2020. /// <param name="userPassword">用户密码</param>
  2021. /// <param name="sessionKey">本次登陆密钥</param>
  2022. /// <param name="productionDataEntitys">半检信息</param>
  2023. /// <returns></returns>
  2024. public ActionResult AddSemiTest(string accountCode, string userCode, string userPassword, string sessionKey, SemiTestEntity[] semiTestEntitys)
  2025. {
  2026. ActionResult actionResult = new ActionResult();
  2027. try
  2028. {
  2029. // 验证请求头信息
  2030. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2031. // 验证失败
  2032. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2033. {
  2034. return actionResult;
  2035. }
  2036. string err = ServiceInvoker.Invoke<string>(this,
  2037. () => PMModuleLogicDAL.AddSemiTest(semiTestEntitys, sUserInfo));
  2038. if (err == null)
  2039. {
  2040. err = "";
  2041. }
  2042. actionResult.Result = JsonHelper.ToJson(err);
  2043. actionResult.Status = (int)Constant.PDAResult.Success;
  2044. }
  2045. catch (Exception ex)
  2046. {
  2047. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2048. OutputLog.TraceLog(LogPriority.Error,
  2049. this.ToString(),
  2050. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2051. ex.ToString(),
  2052. LocalPath.LogExePath);
  2053. actionResult.Status = (int)Constant.PDAResult.Exception;
  2054. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2055. }
  2056. return actionResult;
  2057. }
  2058. #endregion
  2059. /// <summary>
  2060. /// 获取产品列表
  2061. /// </summary>
  2062. /// <returns></returns>
  2063. public ActionResult SerachGoods(string accountCode, string userCode, string userPassword, string sessionKey, int valueFlag)
  2064. {
  2065. ActionResult actionResult = new ActionResult();
  2066. try
  2067. {
  2068. // 验证请求头信息
  2069. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2070. // 验证失败
  2071. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2072. {
  2073. return actionResult;
  2074. }
  2075. GoodsEntity goodsEntity = new GoodsEntity();
  2076. goodsEntity.ValueFlag = 1;//有效标记
  2077. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2078. () => PDAModuleLogic.SerachGoods(sUserInfo, goodsEntity));
  2079. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2080. {
  2081. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2082. actionResult.Status = (int)Constant.PDAResult.Success;
  2083. }
  2084. else
  2085. {
  2086. actionResult.Status = (int)Constant.PDAResult.Fail;
  2087. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2088. }
  2089. }
  2090. catch (Exception ex)
  2091. {
  2092. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2093. OutputLog.TraceLog(LogPriority.Error,
  2094. this.ToString(),
  2095. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2096. ex.ToString(),
  2097. LocalPath.LogExePath);
  2098. actionResult.Status = (int)Constant.PDAResult.Exception;
  2099. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2100. }
  2101. return actionResult;
  2102. }
  2103. /// <summary>
  2104. /// 使用存储过程PRO_PM_GetProductionData获取生产工序计件数据
  2105. /// </summary>
  2106. /// <param name="searchEntity">生产数据实体类</param>
  2107. /// <returns>DataTable</returns>
  2108. public ActionResult GetProductionData(string accountCode, string userCode, string userPassword, string sessionKey, int ProcedureID, string BarCode)
  2109. {
  2110. ActionResult actionResult = new ActionResult();
  2111. try
  2112. {
  2113. // 验证请求头信息
  2114. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2115. // 验证失败
  2116. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2117. {
  2118. return actionResult;
  2119. }
  2120. SearchProductionDataEntity searchEntity = new SearchProductionDataEntity();
  2121. searchEntity.ProcedureID = ProcedureID;
  2122. searchEntity.BarCode = BarCode;
  2123. DataTable reworkDs = ServiceInvoker.Invoke<DataTable>(this,
  2124. () => PDAModuleLogic.GetProductionData(searchEntity, sUserInfo));
  2125. if (reworkDs != null && reworkDs.Rows.Count > Constant.INT_IS_ZERO)
  2126. {
  2127. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2128. actionResult.Status = (int)Constant.PDAResult.Success;
  2129. }
  2130. else
  2131. {
  2132. actionResult.Status = (int)Constant.PDAResult.Fail;
  2133. actionResult.Message = Constant.PDA_RESULT_ALLOW_ERR;
  2134. }
  2135. }
  2136. catch (Exception ex)
  2137. {
  2138. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2139. OutputLog.TraceLog(LogPriority.Error,
  2140. this.ToString(),
  2141. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2142. ex.ToString(),
  2143. LocalPath.LogExePath);
  2144. actionResult.Status = (int)Constant.PDAResult.Exception;
  2145. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2146. }
  2147. return actionResult;
  2148. }
  2149. /// <summary>
  2150. /// 根据所选生产数据ID,显示成检数据信息
  2151. /// </summary>
  2152. /// <param name="productionDataID">生产数据ID</param>
  2153. /// <returns>DataSet</returns>
  2154. public ActionResult GetProductionDataByID(string accountCode, string userCode, string userPassword, string sessionKey, int productionDataID)
  2155. {
  2156. ActionResult actionResult = new ActionResult();
  2157. try
  2158. {
  2159. // 验证请求头信息
  2160. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2161. // 验证失败
  2162. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2163. {
  2164. return actionResult;
  2165. }
  2166. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2167. () => PDAModuleLogic.GetProductionDataByID(productionDataID));
  2168. PDAProductionDataResult productionDatas = new PDAProductionDataResult();
  2169. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2170. {
  2171. if (reworkDs != null && reworkDs.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  2172. {
  2173. for (int i = 0; i < reworkDs.Tables[0].Rows.Count; i++)
  2174. {
  2175. PDAProductionDataResult productionData = new PDAProductionDataResult();
  2176. productionData.BarCode = reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
  2177. if (reworkDs.Tables[0].Rows[i]["GoodsID"].ToString() != "")
  2178. {
  2179. productionData.GoodsID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsID"].ToString());
  2180. }
  2181. productionData.GoodsCode = reworkDs.Tables[0].Rows[i]["GoodsCode"].ToString();
  2182. productionData.GoodsName = reworkDs.Tables[0].Rows[i]["GoodsName"].ToString();
  2183. if (reworkDs.Tables[0].Rows[0]["DefectFlagID"].ToString() != "")
  2184. {
  2185. productionData.DefectFlagID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["DefectFlagID"].ToString());
  2186. }
  2187. if (reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString() != "")
  2188. {
  2189. productionData.ReworkProcedureID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString());
  2190. }
  2191. productionData.Remarks = reworkDs.Tables[0].Rows[i]["Remarks"].ToString();
  2192. if (reworkDs.Tables[0].Rows[i]["UserID"].ToString() != "")
  2193. {
  2194. productionData.UserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["UserID"].ToString());
  2195. }
  2196. if (reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString() != "")
  2197. {
  2198. productionData.GoodsLevelTypeID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString());
  2199. }
  2200. productionData.UserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
  2201. productionData.UserName = reworkDs.Tables[0].Rows[i]["UserName"].ToString();
  2202. productionData.SpecialRepairflag = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["SpecialRepairflag"]);
  2203. productionData.IsReFire = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["IsReFire"]);
  2204. productionData.KilnCarCode = reworkDs.Tables[0].Rows[i]["KilnCarCode"].ToString();
  2205. productionData.KilnCode = reworkDs.Tables[0].Rows[i]["KilnCode"].ToString();
  2206. if (reworkDs.Tables[0].Rows[i]["logoid"].ToString() != "")
  2207. {
  2208. productionData.LogoID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["logoid"]);
  2209. productionData.LogoCode = reworkDs.Tables[0].Rows[i]["LogoCode"].ToString();
  2210. productionData.LogoName = reworkDs.Tables[0].Rows[i]["LogoName"].ToString();
  2211. }
  2212. productionData.CreateTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["CreateTime"]);
  2213. if (reworkDs.Tables[0].Rows[i]["CheckTime"].ToString() != "")
  2214. {
  2215. productionData.CheckTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["CheckTime"].ToString());
  2216. }
  2217. DataView dvDefect = reworkDs.Tables[1].DefaultView;
  2218. dvDefect.RowFilter = "BarCode=" + reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
  2219. DataTable dtDefect = dvDefect.ToTable();
  2220. for (int row = 0; row < dtDefect.Rows.Count; row++)
  2221. {
  2222. // 产品缺陷
  2223. PDADefectResult defect = new PDADefectResult();
  2224. defect.SpecialDefect = dtDefect.Rows[row]["SpecialDefect"].ToString();
  2225. defect.DefectDeductionNum = Convert.ToDecimal(dtDefect.Rows[row]["DefectDeductionNum"].ToString());
  2226. if (dtDefect.Rows[row]["ProductionDefectID"].ToString() != "")
  2227. {
  2228. defect.ProductionDefectID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDefectID"].ToString());
  2229. }
  2230. defect.BarCode = dtDefect.Rows[row]["BarCode"].ToString();
  2231. if (dtDefect.Rows[row]["DefectID"].ToString() != "")
  2232. {
  2233. defect.DefectID = Convert.ToInt32(dtDefect.Rows[row]["DefectID"].ToString());
  2234. }
  2235. defect.DefectName = dtDefect.Rows[row]["DefectName"].ToString();
  2236. defect.DefectCode = dtDefect.Rows[row]["DefectCode"].ToString();
  2237. if (dtDefect.Rows[row]["DefectPositionID"].ToString() != "")
  2238. {
  2239. defect.DefectPositionID = Convert.ToInt32(dtDefect.Rows[row]["DefectPositionID"].ToString());
  2240. }
  2241. defect.DefectPositionName = dtDefect.Rows[row]["DefectPositionName"].ToString();
  2242. defect.DefectPositionCode = dtDefect.Rows[row]["DefectPositionCode"].ToString();
  2243. if (dtDefect.Rows[row]["DefectProcedureID"].ToString() != "")
  2244. {
  2245. defect.DefectProcedureID = Convert.ToInt32(dtDefect.Rows[row]["DefectProcedureID"].ToString());
  2246. }
  2247. defect.DefectProcedureName = dtDefect.Rows[row]["DefectProcedureName"].ToString();
  2248. defect.DefectProcedureCode = dtDefect.Rows[row]["DefectProcedureCode"].ToString();
  2249. if (dtDefect.Rows[row]["DefectUserID"].ToString() != "")
  2250. {
  2251. defect.DefectUserID = Convert.ToInt32(dtDefect.Rows[row]["DefectUserID"].ToString());
  2252. }
  2253. defect.DefectUserName = dtDefect.Rows[row]["DefectUserName"].ToString();
  2254. defect.DefectUserCode = dtDefect.Rows[row]["DefectUserCode"].ToString();
  2255. if (dtDefect.Rows[row]["Jobs"].ToString() != "")
  2256. {
  2257. defect.Jobs = Convert.ToInt32(dtDefect.Rows[row]["Jobs"].ToString());
  2258. }
  2259. if (dtDefect.Rows[row]["MissedUserID"].ToString() != "")
  2260. {
  2261. defect.MissedUserID = Convert.ToInt32(dtDefect.Rows[row]["MissedUserID"].ToString());
  2262. }
  2263. defect.MissedUserCode = dtDefect.Rows[row]["MissedUserCode"].ToString();
  2264. defect.MissedUserName = dtDefect.Rows[row]["MissedUserName"].ToString();
  2265. defect.JobsText = dtDefect.Rows[row]["JobsText"].ToString();
  2266. defect.DefectRemarks = dtDefect.Rows[row]["DefectRemarks"].ToString();
  2267. if (dtDefect.Rows[row]["ProductionDataID"].ToString() != "")
  2268. {
  2269. defect.ProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDataID"].ToString());
  2270. }
  2271. if (dtDefect.Rows[row]["DefectProductionDataID"].ToString() != "")
  2272. {
  2273. defect.DefectProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["DefectProductionDataID"].ToString());
  2274. }
  2275. if (dtDefect.Rows[row]["DefectFineID"].ToString() != "")
  2276. {
  2277. defect.DefectFineID = Convert.ToInt32(dtDefect.Rows[row]["DefectFineID"].ToString());
  2278. }
  2279. defect.DefectFineValue = dtDefect.Rows[row]["DefectFineValue"].ToString();
  2280. defect.CheckTime = Convert.ToDateTime(dtDefect.Rows[row]["CheckTime"]);
  2281. //--------责任员工-------------------
  2282. DataRow[] drRow = reworkDs.Tables[2].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[row]["ProductionDefectID"]);
  2283. if (drRow.Length > Constant.INT_IS_ZERO)
  2284. {
  2285. foreach (DataRow r in drRow)
  2286. {
  2287. PDADefectResponsibleResult defectResponsible = new PDADefectResponsibleResult();
  2288. if (r["ProductionDefectID"].ToString() != "")
  2289. {
  2290. defectResponsible.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
  2291. }
  2292. if (r["StaffID"].ToString() != "")
  2293. {
  2294. defectResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
  2295. }
  2296. defectResponsible.StaffCode = r["StaffCode"].ToString();
  2297. defectResponsible.StaffName = r["StaffName"].ToString();
  2298. if (r["StaffStatus"].ToString() != "")
  2299. {
  2300. defectResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
  2301. }
  2302. if (r["UJobsID"].ToString() != "")
  2303. {
  2304. defectResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
  2305. }
  2306. if (r["SJobsID"].ToString() != "")
  2307. {
  2308. defectResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
  2309. }
  2310. defect.PDADefectResponsibles.Add(defectResponsible);
  2311. }
  2312. }
  2313. //------------------------------
  2314. //--------漏检员工-------------------
  2315. DataRow[] drMissedRow = reworkDs.Tables[4].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[i]["ProductionDefectID"]);
  2316. if (drMissedRow.Length > Constant.INT_IS_ZERO)
  2317. {
  2318. foreach (DataRow r in drMissedRow)
  2319. {
  2320. PDADefectMissedResponsibleResult defectMissedResponsible = new PDADefectMissedResponsibleResult();
  2321. if (r["ProductionDefectID"].ToString() != "")
  2322. {
  2323. defectMissedResponsible.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
  2324. }
  2325. if (r["StaffID"].ToString() != "")
  2326. {
  2327. defectMissedResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
  2328. }
  2329. defectMissedResponsible.StaffCode = r["StaffCode"].ToString();
  2330. defectMissedResponsible.StaffName = r["StaffName"].ToString();
  2331. if (r["StaffStatus"].ToString() != "")
  2332. {
  2333. defectMissedResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
  2334. }
  2335. if (r["UJobsID"].ToString() != "")
  2336. {
  2337. defectMissedResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
  2338. }
  2339. if (r["SJobsID"].ToString() != "")
  2340. {
  2341. defectMissedResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
  2342. }
  2343. defect.PDADefectMissedResponsibles.Add(defectMissedResponsible);
  2344. }
  2345. }
  2346. //------------------------------
  2347. DataRow[] drImageRow = reworkDs.Tables[3].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[row]["ProductionDefectID"]);
  2348. if (drImageRow.Length > Constant.INT_IS_ZERO)
  2349. {
  2350. foreach (DataRow r in drImageRow)
  2351. {
  2352. PDADefectImageResult defectImage = new PDADefectImageResult();
  2353. if (r["ProductionDefectID"].ToString() != "")
  2354. {
  2355. defectImage.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
  2356. }
  2357. defectImage.Thumbnailpath = r["Thumbnailpath"].ToString();
  2358. //if (File.Exists(System.AppDomain.CurrentDomain.BaseDirectory + r["Imagepath"].ToString()))
  2359. //{
  2360. defectImage.Imagepath = r["Imagepath"].ToString();// r["Imagepath"].ToString();
  2361. //}
  2362. defect.PDADefectImageResults.Add(defectImage);
  2363. }
  2364. }
  2365. productionData.PDADefects.Add(defect);
  2366. }
  2367. if (productionDatas.PDAProductionData == null)
  2368. {
  2369. productionDatas.PDAProductionData = new System.Collections.Generic.List<PDAProductionDataResult>();
  2370. }
  2371. productionDatas.PDAProductionData.Add(productionData);
  2372. //---------------------------------------------------------------------------------
  2373. }
  2374. }
  2375. actionResult.Result = JsonHelper.ToJson(productionDatas);
  2376. actionResult.Status = (int)Constant.PDAResult.Success;
  2377. }
  2378. else
  2379. {
  2380. actionResult.Status = (int)Constant.PDAResult.Fail;
  2381. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2382. }
  2383. }
  2384. catch (Exception ex)
  2385. {
  2386. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2387. OutputLog.TraceLog(LogPriority.Error,
  2388. this.ToString(),
  2389. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2390. ex.ToString(),
  2391. LocalPath.LogExePath);
  2392. actionResult.Status = (int)Constant.PDAResult.Exception;
  2393. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2394. }
  2395. return actionResult;
  2396. }
  2397. /// <summary>
  2398. /// 编辑后删除生产数据
  2399. /// </summary>
  2400. /// <param name="productionDataID">生产数据ID</param>
  2401. /// <returns>int</returns>
  2402. public ActionResult DeleteProductionDataByID(string accountCode, string userCode, string userPassword, string sessionKey, int productionDataID)
  2403. {
  2404. ActionResult actionResult = new ActionResult();
  2405. try
  2406. {
  2407. // 验证请求头信息
  2408. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2409. // 验证失败
  2410. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2411. {
  2412. return actionResult;
  2413. }
  2414. int row = ServiceInvoker.Invoke<int>(this,
  2415. () => PMModuleLogic.DeleteProductionDataByID(productionDataID));
  2416. actionResult.Result = JsonHelper.ToJson(row);
  2417. actionResult.Status = (int)Constant.PDAResult.Success;
  2418. }
  2419. catch (Exception ex)
  2420. {
  2421. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2422. OutputLog.TraceLog(LogPriority.Error,
  2423. this.ToString(),
  2424. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2425. ex.ToString(),
  2426. LocalPath.LogExePath);
  2427. actionResult.Status = (int)Constant.PDAResult.Exception;
  2428. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2429. }
  2430. return actionResult;
  2431. }
  2432. /// <summary>
  2433. /// 获取产品完成工序的ID
  2434. /// </summary>
  2435. /// <param name="barcode">产品条码</param>
  2436. /// <returns>int</returns>
  2437. public ActionResult GetCompleteProcedureID(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  2438. {
  2439. ActionResult actionResult = new ActionResult();
  2440. try
  2441. {
  2442. // 验证请求头信息
  2443. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2444. // 验证失败
  2445. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2446. {
  2447. return actionResult;
  2448. }
  2449. int row = ServiceInvoker.Invoke<int>(this,
  2450. () => PMModuleLogic.GetCompleteProcedureID(barcode));
  2451. actionResult.Result = JsonHelper.ToJson(row);
  2452. actionResult.Status = (int)Constant.PDAResult.Success;
  2453. }
  2454. catch (Exception ex)
  2455. {
  2456. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2457. OutputLog.TraceLog(LogPriority.Error,
  2458. this.ToString(),
  2459. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2460. ex.ToString(),
  2461. LocalPath.LogExePath);
  2462. actionResult.Status = (int)Constant.PDAResult.Exception;
  2463. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2464. }
  2465. return actionResult;
  2466. }
  2467. /// <summary>
  2468. /// 绑定图片
  2469. /// </summary>
  2470. /// <param name="accountCode">帐套code</param>
  2471. /// <param name="userCode">用户code</param>
  2472. /// <param name="userPassword">用户密码</param>
  2473. /// <param name="sessionKey">本次登陆密钥</param>
  2474. /// <param name="imagePath">图片路径</param>
  2475. /// <returns></returns>
  2476. public Stream BindDefectImage(string accountCode, string userCode, string userPassword, string sessionKey, string imagePath)
  2477. {
  2478. try
  2479. {
  2480. return ServiceInvoker.Invoke<Stream>(this, () => PDAModuleLogic.BindDefectImage(imagePath));
  2481. }
  2482. catch (Exception ex)
  2483. {
  2484. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2485. OutputLog.TraceLog(LogPriority.Error,
  2486. this.ToString(),
  2487. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2488. ex.ToString(),
  2489. LocalPath.LogExePath);
  2490. return null;
  2491. }
  2492. }
  2493. /// <summary>
  2494. /// 根据所选工号对应的工种,查出缺陷责任员工
  2495. /// </summary>
  2496. /// <param name="jobs">工种ID</param>
  2497. /// <returns></returns>
  2498. public ActionResult GetDutyStaffByUserJobsID(string accountCode, string userCode, string userPassword, string sessionKey, int jobs, int userid)
  2499. {
  2500. ActionResult actionResult = new ActionResult();
  2501. try
  2502. {
  2503. // 验证请求头信息
  2504. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2505. // 验证失败
  2506. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2507. {
  2508. return actionResult;
  2509. }
  2510. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2511. () => PDAModuleLogic.GetDutyStaffByUserJobsID(jobs, sUserInfo, userid));
  2512. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2513. {
  2514. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2515. actionResult.Status = (int)Constant.PDAResult.Success;
  2516. }
  2517. else
  2518. {
  2519. actionResult.Status = (int)Constant.PDAResult.Fail;
  2520. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2521. }
  2522. }
  2523. catch (Exception ex)
  2524. {
  2525. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2526. OutputLog.TraceLog(LogPriority.Error,
  2527. this.ToString(),
  2528. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2529. ex.ToString(),
  2530. LocalPath.LogExePath);
  2531. actionResult.Status = (int)Constant.PDAResult.Exception;
  2532. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2533. }
  2534. return actionResult;
  2535. }
  2536. #region 产品报废
  2537. /// <summary>
  2538. /// 验证废弃产品唯一性
  2539. /// </summary>
  2540. /// <param name="barcode">产品条码</param>
  2541. /// <returns>int</returns>
  2542. public ActionResult ScrapProductChack(string accountCode, string userCode, string userPassword, string sessionKey, string barCode)
  2543. {
  2544. ActionResult actionResult = new ActionResult();
  2545. try
  2546. {
  2547. // 验证请求头信息
  2548. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2549. // 验证失败
  2550. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2551. {
  2552. return actionResult;
  2553. }
  2554. string row = ServiceInvoker.Invoke<string>(this,
  2555. () => PDAModuleLogic.ScrapProductChack(barCode, sUserInfo));
  2556. string[] rm = row.Split(':');
  2557. actionResult.Result = rm[0];//JsonHelper.ToJson(rm[0]);
  2558. if (rm.Length > 1)
  2559. {
  2560. actionResult.Message = rm[1];
  2561. }
  2562. actionResult.Status = (int)Constant.PDAResult.Success;
  2563. }
  2564. catch (Exception ex)
  2565. {
  2566. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2567. OutputLog.TraceLog(LogPriority.Error,
  2568. this.ToString(),
  2569. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2570. ex.ToString(),
  2571. LocalPath.LogExePath);
  2572. actionResult.Status = (int)Constant.PDAResult.Exception;
  2573. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2574. }
  2575. return actionResult;
  2576. }
  2577. /// <summary>
  2578. /// 根据条码获取该产品的在产信息以及生产数据
  2579. /// </summary>
  2580. /// <param name="Barcode">产品条码</param>
  2581. /// <returns>装有两个DataTable的数据集,第一个是在产信息,第二个是生产数据</returns>
  2582. public ActionResult GetInProductionAndProductionData(string accountCode, string userCode, string userPassword, string sessionKey, string barCode)
  2583. {
  2584. ActionResult actionResult = new ActionResult();
  2585. try
  2586. {
  2587. // 验证请求头信息
  2588. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2589. // 验证失败
  2590. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2591. {
  2592. return actionResult;
  2593. }
  2594. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2595. () => PDAModuleLogic.GetInProductionAndProductionData(barCode, sUserInfo));
  2596. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2597. {
  2598. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2599. actionResult.Status = (int)Constant.PDAResult.Success;
  2600. }
  2601. else
  2602. {
  2603. actionResult.Status = (int)Constant.PDAResult.Fail;
  2604. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2605. }
  2606. }
  2607. catch (Exception ex)
  2608. {
  2609. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2610. OutputLog.TraceLog(LogPriority.Error,
  2611. this.ToString(),
  2612. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2613. ex.ToString(),
  2614. LocalPath.LogExePath);
  2615. actionResult.Status = (int)Constant.PDAResult.Exception;
  2616. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2617. }
  2618. return actionResult;
  2619. }
  2620. /// <summary>
  2621. /// 根据工号查询员工档案信息
  2622. /// </summary>
  2623. /// <param name="accountCode"></param>
  2624. /// <param name="userCode"></param>
  2625. /// <param name="userPassword"></param>
  2626. /// <param name="sessionKey"></param>
  2627. /// <param name="userId"></param>
  2628. /// <returns></returns>
  2629. public ActionResult SearchHrStaffInfo(string accountCode, string userCode, string userPassword, string sessionKey, int userId)
  2630. {
  2631. ActionResult actionResult = new ActionResult();
  2632. try
  2633. {
  2634. // 验证请求头信息
  2635. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2636. // 验证失败
  2637. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2638. {
  2639. return actionResult;
  2640. }
  2641. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2642. () => PDAModuleLogic.SearchHrStaffInfo(userId, sUserInfo));
  2643. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2644. {
  2645. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2646. actionResult.Status = (int)Constant.PDAResult.Success;
  2647. }
  2648. else
  2649. {
  2650. actionResult.Status = (int)Constant.PDAResult.Fail;
  2651. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2652. }
  2653. }
  2654. catch (Exception ex)
  2655. {
  2656. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2657. OutputLog.TraceLog(LogPriority.Error,
  2658. this.ToString(),
  2659. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2660. ex.ToString(),
  2661. LocalPath.LogExePath);
  2662. actionResult.Status = (int)Constant.PDAResult.Exception;
  2663. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2664. }
  2665. return actionResult;
  2666. }
  2667. /// <summary>
  2668. /// 添加废弃产品记录
  2669. /// </summary>
  2670. /// <param name="SProductEntity">废弃产品实体</param>
  2671. /// <param name="RProcedureEntity">废弃责任工序实体</param>
  2672. /// <param name="SResponsibleList">责任者集合</param>
  2673. /// <param name="userInfo">用户基本信息</param>
  2674. /// <returns>int结果返回值</returns>
  2675. /// <remarks>
  2676. /// 庄天威 2014.09.24 新建
  2677. /// </remarks>
  2678. public ActionResult AddScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey,
  2679. ScrapProductEntity SProductEntity, ResponProcedureEntity RProcedureEntity,
  2680. ScrapResponsibleEntity[] SResponsibleList)
  2681. {
  2682. ActionResult actionResult = new ActionResult();
  2683. if (SResponsibleList == null || SResponsibleList.Length == 0)
  2684. {
  2685. actionResult.Status = (int)Constant.PDAResult.Fail;
  2686. actionResult.Message = "没有选择责任人";
  2687. }
  2688. try
  2689. {
  2690. // 验证请求头信息
  2691. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2692. // 验证失败
  2693. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2694. {
  2695. return actionResult;
  2696. }
  2697. int addRow = ServiceInvoker.Invoke<int>(this,
  2698. () => PDAModuleLogic.AddScrapProduct(SProductEntity, RProcedureEntity, SResponsibleList, sUserInfo));
  2699. actionResult.Result = JsonHelper.ToJson(addRow);
  2700. actionResult.Status = (int)Constant.PDAResult.Success;
  2701. }
  2702. catch (Exception ex)
  2703. {
  2704. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2705. OutputLog.TraceLog(LogPriority.Error,
  2706. this.ToString(),
  2707. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2708. ex.ToString(),
  2709. LocalPath.LogExePath);
  2710. actionResult.Status = (int)Constant.PDAResult.Exception;
  2711. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2712. // TODO 空指针异常问题检测
  2713. try
  2714. {
  2715. OutputLog.TraceLog(LogPriority.Error,
  2716. this.ToString(),
  2717. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2718. "accountCode:" + accountCode + "#userCode:" + userCode + "#sessionKey:" + sessionKey,
  2719. LocalPath.LogExePath);
  2720. string json1 = JsonHelper.ToJson(SProductEntity);
  2721. OutputLog.TraceLog(LogPriority.Error,
  2722. this.ToString(),
  2723. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2724. "SProductEntity:" + json1,
  2725. LocalPath.LogExePath);
  2726. string json2 = JsonHelper.ToJson(RProcedureEntity);
  2727. OutputLog.TraceLog(LogPriority.Error,
  2728. this.ToString(),
  2729. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2730. "RProcedureEntity:" + json2,
  2731. LocalPath.LogExePath);
  2732. string json3 = JsonHelper.ToJson(SResponsibleList);
  2733. OutputLog.TraceLog(LogPriority.Error,
  2734. this.ToString(),
  2735. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2736. "SResponsibleList:" + json3,
  2737. LocalPath.LogExePath);
  2738. }
  2739. catch (Exception exc)
  2740. {
  2741. OutputLog.TraceLog(LogPriority.Error,
  2742. this.ToString(),
  2743. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2744. "参数输入异常:" + exc.Message,
  2745. LocalPath.LogExePath);
  2746. }
  2747. }
  2748. return actionResult;
  2749. }
  2750. /// <summary>
  2751. /// 获取产品分级的数据(根据ID)
  2752. /// </summary>
  2753. /// <param name="GoodsLevelTypeID">分类类别ID</param>
  2754. /// <param name="GoodsLevelID">分类ID</param>
  2755. /// <param name="sUserInfo">用户基本信息</param>
  2756. /// <returns>DataSet</returns>
  2757. /// <remarks>
  2758. /// 2014.10.22 庄天威 新建
  2759. public ActionResult GetGoodsLevelDataById(string accountCode, string userCode, string userPassword, string sessionKey, int? GoodsLevelTypeID)
  2760. {
  2761. ActionResult actionResult = new ActionResult();
  2762. try
  2763. {
  2764. // 验证请求头信息
  2765. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2766. // 验证失败
  2767. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2768. {
  2769. return actionResult;
  2770. }
  2771. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2772. () => SystemModuleLogic.GetGoodsLevelDataById(GoodsLevelTypeID, null, sUserInfo));
  2773. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2774. {
  2775. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2776. actionResult.Status = (int)Constant.PDAResult.Success;
  2777. }
  2778. else
  2779. {
  2780. actionResult.Status = (int)Constant.PDAResult.Fail;
  2781. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2782. }
  2783. }
  2784. catch (Exception ex)
  2785. {
  2786. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2787. OutputLog.TraceLog(LogPriority.Error,
  2788. this.ToString(),
  2789. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2790. ex.ToString(),
  2791. LocalPath.LogExePath);
  2792. actionResult.Status = (int)Constant.PDAResult.Exception;
  2793. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2794. }
  2795. return actionResult;
  2796. }
  2797. /// <summary>
  2798. /// 获取账务日期
  2799. /// </summary>
  2800. /// <param name="accountCode"></param>
  2801. /// <param name="userCode"></param>
  2802. /// <param name="userPassword"></param>
  2803. /// <param name="sessionKey"></param>
  2804. /// <returns></returns>
  2805. public ActionResult GetAccountDate(string accountCode, string userCode, string userPassword, string sessionKey)
  2806. {
  2807. ActionResult actionResult = new ActionResult();
  2808. try
  2809. {
  2810. // 验证请求头信息
  2811. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2812. // 验证失败
  2813. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2814. {
  2815. return actionResult;
  2816. }
  2817. DateTime reworkDs = ServiceInvoker.Invoke<DateTime>(this,
  2818. () => CommonModuleLogic.GetAccountDate(sUserInfo));
  2819. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2820. actionResult.Status = (int)Constant.PDAResult.Success;
  2821. }
  2822. catch (Exception ex)
  2823. {
  2824. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2825. OutputLog.TraceLog(LogPriority.Error,
  2826. this.ToString(),
  2827. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2828. ex.ToString(),
  2829. LocalPath.LogExePath);
  2830. actionResult.Status = (int)Constant.PDAResult.Exception;
  2831. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2832. }
  2833. return actionResult;
  2834. }
  2835. /// <summary>
  2836. /// 获取登陆帐户有无报损权限
  2837. /// </summary>
  2838. /// <param name="accountCode"></param>
  2839. /// <param name="userCode"></param>
  2840. /// <param name="userPassword"></param>
  2841. /// <param name="sessionKey"></param>
  2842. /// <param name="usercode">工号编码</param>
  2843. /// <returns></returns>
  2844. public ActionResult GetScrapFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  2845. {
  2846. ActionResult actionResult = new ActionResult();
  2847. try
  2848. {
  2849. // 验证请求头信息
  2850. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2851. // 验证失败
  2852. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2853. {
  2854. return actionResult;
  2855. }
  2856. int returnValue = ServiceInvoker.Invoke<int>(this,
  2857. () => PDAModuleLogic.GetScrapFuntion(userCode, sUserInfo));
  2858. actionResult.Result = JsonHelper.ToJson(returnValue);
  2859. actionResult.Status = (int)Constant.PDAResult.Success;
  2860. }
  2861. catch (Exception ex)
  2862. {
  2863. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2864. OutputLog.TraceLog(LogPriority.Error,
  2865. this.ToString(),
  2866. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2867. ex.ToString(),
  2868. LocalPath.LogExePath);
  2869. actionResult.Status = (int)Constant.PDAResult.Exception;
  2870. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2871. }
  2872. return actionResult;
  2873. }
  2874. #endregion
  2875. /// <summary>
  2876. /// 获取是否存在报损未审核产品
  2877. /// </summary>
  2878. /// <param name="barcode">产品条码</param>
  2879. /// <returns>int</returns>
  2880. public ActionResult GetScrapProductAuditStatus(string accountCode, string userCode, string userPassword, string sessionKey, string barCode)
  2881. {
  2882. ActionResult actionResult = new ActionResult();
  2883. try
  2884. {
  2885. // 验证请求头信息
  2886. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2887. // 验证失败
  2888. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2889. {
  2890. return actionResult;
  2891. }
  2892. int row = ServiceInvoker.Invoke<int>(this,
  2893. () => PDAModuleLogic.GetScrapProductAuditStatus(barCode));
  2894. actionResult.Result = JsonHelper.ToJson(row);
  2895. actionResult.Status = (int)Constant.PDAResult.Success;
  2896. }
  2897. catch (Exception ex)
  2898. {
  2899. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2900. OutputLog.TraceLog(LogPriority.Error,
  2901. this.ToString(),
  2902. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2903. ex.ToString(),
  2904. LocalPath.LogExePath);
  2905. actionResult.Status = (int)Constant.PDAResult.Exception;
  2906. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2907. }
  2908. return actionResult;
  2909. }
  2910. /// <summary>
  2911. /// 查询报废产品信息
  2912. /// </summary>
  2913. /// <param name="accountCode"></param>
  2914. /// <param name="userCode"></param>
  2915. /// <param name="userPassword"></param>
  2916. /// <param name="sessionKey"></param>
  2917. /// <param name="barCode">产品条码</param>
  2918. /// <param name="scrapProductID">报废产品ID</param>
  2919. /// <returns></returns>
  2920. public ActionResult GetScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barCode, int scrapProductID)
  2921. {
  2922. ActionResult actionResult = new ActionResult();
  2923. try
  2924. {
  2925. // 验证请求头信息
  2926. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2927. // 验证失败
  2928. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2929. {
  2930. return actionResult;
  2931. }
  2932. ScrapProductEntity selectProEntity = new ScrapProductEntity();
  2933. selectProEntity.BarCode = barCode;
  2934. selectProEntity.ScrapProductID = scrapProductID;
  2935. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2936. () => PMModuleLogic.GetScrapProduct(selectProEntity, sUserInfo));
  2937. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2938. {
  2939. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2940. actionResult.Status = (int)Constant.PDAResult.Success;
  2941. }
  2942. else
  2943. {
  2944. actionResult.Status = (int)Constant.PDAResult.Fail;
  2945. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2946. }
  2947. }
  2948. catch (Exception ex)
  2949. {
  2950. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2951. OutputLog.TraceLog(LogPriority.Error,
  2952. this.ToString(),
  2953. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2954. ex.ToString(),
  2955. LocalPath.LogExePath);
  2956. actionResult.Status = (int)Constant.PDAResult.Exception;
  2957. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2958. }
  2959. return actionResult;
  2960. }
  2961. /// <summary>
  2962. /// 根据废弃产品ID获取责任工序
  2963. /// </summary>
  2964. /// <param name="accountCode"></param>
  2965. /// <param name="userCode"></param>
  2966. /// <param name="userPassword"></param>
  2967. /// <param name="sessionKey"></param>
  2968. /// <param name="scrapProductID">报废产品ID</param>
  2969. /// <returns></returns>
  2970. public ActionResult GetResponProcedureBySPId(string accountCode, string userCode, string userPassword, string sessionKey, int scrapProductID)
  2971. {
  2972. ActionResult actionResult = new ActionResult();
  2973. try
  2974. {
  2975. // 验证请求头信息
  2976. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2977. // 验证失败
  2978. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2979. {
  2980. return actionResult;
  2981. }
  2982. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2983. () => PMModuleLogic.GetResponProcedureBySPId(scrapProductID));
  2984. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2985. {
  2986. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2987. actionResult.Status = (int)Constant.PDAResult.Success;
  2988. }
  2989. else
  2990. {
  2991. actionResult.Status = (int)Constant.PDAResult.Fail;
  2992. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2993. }
  2994. }
  2995. catch (Exception ex)
  2996. {
  2997. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2998. OutputLog.TraceLog(LogPriority.Error,
  2999. this.ToString(),
  3000. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3001. ex.ToString(),
  3002. LocalPath.LogExePath);
  3003. actionResult.Status = (int)Constant.PDAResult.Exception;
  3004. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3005. }
  3006. return actionResult;
  3007. }
  3008. /// <summary>
  3009. /// 根据废弃产品ID获取责任人列表
  3010. /// </summary>
  3011. /// <param name="accountCode"></param>
  3012. /// <param name="userCode"></param>
  3013. /// <param name="userPassword"></param>
  3014. /// <param name="sessionKey"></param>
  3015. /// <param name="scrapProductID">报废产品ID</param>
  3016. /// <returns></returns>
  3017. public ActionResult GetScrapResponsibleBySPId(string accountCode, string userCode, string userPassword, string sessionKey, int scrapProductID)
  3018. {
  3019. ActionResult actionResult = new ActionResult();
  3020. try
  3021. {
  3022. // 验证请求头信息
  3023. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3024. // 验证失败
  3025. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3026. {
  3027. return actionResult;
  3028. }
  3029. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3030. () => PMModuleLogic.GetScrapResponsibleBySPId(scrapProductID));
  3031. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3032. {
  3033. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3034. actionResult.Status = (int)Constant.PDAResult.Success;
  3035. }
  3036. else
  3037. {
  3038. actionResult.Status = (int)Constant.PDAResult.Fail;
  3039. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3040. }
  3041. }
  3042. catch (Exception ex)
  3043. {
  3044. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3045. OutputLog.TraceLog(LogPriority.Error,
  3046. this.ToString(),
  3047. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3048. ex.ToString(),
  3049. LocalPath.LogExePath);
  3050. actionResult.Status = (int)Constant.PDAResult.Exception;
  3051. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3052. }
  3053. return actionResult;
  3054. }
  3055. /// <summary>
  3056. /// 添加废弃产品记录
  3057. /// </summary>
  3058. /// <param name="SProductEntity">废弃产品实体</param>
  3059. /// <param name="RProcedureEntity">废弃责任工序实体</param>
  3060. /// <param name="SResponsibleList">责任者集合</param>
  3061. /// <param name="userInfo">用户基本信息</param>
  3062. /// <returns>int结果返回值</returns>
  3063. /// <remarks>
  3064. /// 庄天威 2014.09.24 新建
  3065. /// </remarks>
  3066. public ActionResult UpdateScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, ScrapProductEntity UpdateSProductEntity,
  3067. ResponProcedureEntity UpdateRProcedureEntity,
  3068. ScrapResponsibleEntity[] UpdateSResponsibleList, ScrapResponsibleEntity[] YSResponsibleList)
  3069. {
  3070. ActionResult actionResult = new ActionResult();
  3071. try
  3072. {
  3073. // 验证请求头信息
  3074. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3075. // 验证失败
  3076. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3077. {
  3078. return actionResult;
  3079. }
  3080. int addRow = ServiceInvoker.Invoke<int>(this,
  3081. () => PDAModuleLogic.UpdateScrapProduct(UpdateSProductEntity, UpdateRProcedureEntity, UpdateSResponsibleList, YSResponsibleList, sUserInfo));
  3082. actionResult.Result = JsonHelper.ToJson(addRow);
  3083. actionResult.Status = (int)Constant.PDAResult.Success;
  3084. }
  3085. catch (Exception ex)
  3086. {
  3087. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3088. OutputLog.TraceLog(LogPriority.Error,
  3089. this.ToString(),
  3090. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3091. ex.ToString(),
  3092. LocalPath.LogExePath);
  3093. actionResult.Status = (int)Constant.PDAResult.Exception;
  3094. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3095. }
  3096. return actionResult;
  3097. }
  3098. /// <summary>
  3099. /// 获取产品窑炉
  3100. /// </summary>
  3101. /// <param name="accountCode"></param>
  3102. /// <param name="userCode"></param>
  3103. /// <param name="userPassword"></param>
  3104. /// <param name="sessionKey"></param>
  3105. /// <returns>Datase</returns>
  3106. public ActionResult GetAllKilntInfo(string accountCode, string userCode, string userPassword, string sessionKey)
  3107. {
  3108. ActionResult actionResult = new ActionResult();
  3109. try
  3110. {
  3111. // 验证请求头信息
  3112. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3113. // 验证失败
  3114. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3115. {
  3116. return actionResult;
  3117. }
  3118. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3119. () => PDAModuleLogic.GetAllKilntInfo(sUserInfo));
  3120. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3121. {
  3122. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3123. actionResult.Status = (int)Constant.PDAResult.Success;
  3124. }
  3125. else
  3126. {
  3127. actionResult.Status = (int)Constant.PDAResult.Fail;
  3128. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3129. }
  3130. }
  3131. catch (Exception ex)
  3132. {
  3133. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3134. OutputLog.TraceLog(LogPriority.Error,
  3135. this.ToString(),
  3136. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3137. ex.ToString(),
  3138. LocalPath.LogExePath);
  3139. actionResult.Status = (int)Constant.PDAResult.Exception;
  3140. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3141. }
  3142. return actionResult;
  3143. }
  3144. /// <summary>
  3145. /// 获取次品产品条码允许编辑
  3146. /// </summary>
  3147. /// <param name="accountCode"></param>
  3148. /// <param name="userCode"></param>
  3149. /// <param name="userPassword"></param>
  3150. /// <param name="sessionKey"></param>
  3151. /// <param name="barcode">产品条码</param>
  3152. /// <returns>Datase</returns>
  3153. public ActionResult GetSubstandardInfo(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3154. {
  3155. ActionResult actionResult = new ActionResult();
  3156. try
  3157. {
  3158. // 验证请求头信息
  3159. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3160. // 验证失败
  3161. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3162. {
  3163. return actionResult;
  3164. }
  3165. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3166. () => PDAModuleLogic.GetSubstandardInfo(barcode));
  3167. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3168. {
  3169. actionResult.Result = JsonHelper.ToJson(1);
  3170. actionResult.Status = (int)Constant.PDAResult.Success;
  3171. }
  3172. else
  3173. {
  3174. actionResult.Result = JsonHelper.ToJson(0);
  3175. actionResult.Status = (int)Constant.PDAResult.Fail;
  3176. actionResult.Message = "次品条码:" + barcode + "不允许修改";
  3177. }
  3178. }
  3179. catch (Exception ex)
  3180. {
  3181. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3182. OutputLog.TraceLog(LogPriority.Error,
  3183. this.ToString(),
  3184. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3185. ex.ToString(),
  3186. LocalPath.LogExePath);
  3187. actionResult.Status = (int)Constant.PDAResult.Exception;
  3188. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3189. }
  3190. return actionResult;
  3191. }
  3192. /// <summary>
  3193. /// 获取产品条码是否重烧
  3194. /// </summary>
  3195. /// <param name="accountCode"></param>
  3196. /// <param name="userCode"></param>
  3197. /// <param name="userPassword"></param>
  3198. /// <param name="sessionKey"></param>
  3199. /// <param name="barcode">产品条码</param>
  3200. /// <returns>Datase</returns>
  3201. public ActionResult GetReFine(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3202. {
  3203. ActionResult actionResult = new ActionResult();
  3204. try
  3205. {
  3206. // 验证请求头信息
  3207. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3208. // 验证失败
  3209. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3210. {
  3211. return actionResult;
  3212. }
  3213. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3214. () => PDAModuleLogic.GetReFine(barcode));
  3215. if (reworkDs != null && reworkDs.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  3216. {
  3217. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(reworkDs.Tables[0].Rows[0]["IsReFire"]));
  3218. }
  3219. else
  3220. {
  3221. actionResult.Result = JsonHelper.ToJson(0);
  3222. }
  3223. actionResult.Status = (int)Constant.PDAResult.Success;
  3224. }
  3225. catch (Exception ex)
  3226. {
  3227. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3228. OutputLog.TraceLog(LogPriority.Error,
  3229. this.ToString(),
  3230. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3231. ex.ToString(),
  3232. LocalPath.LogExePath);
  3233. actionResult.Status = (int)Constant.PDAResult.Exception;
  3234. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3235. }
  3236. return actionResult;
  3237. }
  3238. /// <summary>
  3239. /// 获取登陆帐户有无成检编辑权限
  3240. /// </summary>
  3241. /// <param name="accountCode"></param>
  3242. /// <param name="userCode"></param>
  3243. /// <param name="userPassword"></param>
  3244. /// <param name="sessionKey"></param>
  3245. /// <param name="usercode">工号编码</param>
  3246. /// <returns></returns>
  3247. public ActionResult GetFinishedProductEditFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  3248. {
  3249. ActionResult actionResult = new ActionResult();
  3250. try
  3251. {
  3252. // 验证请求头信息
  3253. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3254. // 验证失败
  3255. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3256. {
  3257. return actionResult;
  3258. }
  3259. int returnValue = ServiceInvoker.Invoke<int>(this,
  3260. () => PDAModuleLogic.GetFinishedProductEditFuntion(sUserInfo));
  3261. actionResult.Result = JsonHelper.ToJson(returnValue);
  3262. actionResult.Status = (int)Constant.PDAResult.Success;
  3263. }
  3264. catch (Exception ex)
  3265. {
  3266. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3267. OutputLog.TraceLog(LogPriority.Error,
  3268. this.ToString(),
  3269. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3270. ex.ToString(),
  3271. LocalPath.LogExePath);
  3272. actionResult.Status = (int)Constant.PDAResult.Exception;
  3273. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3274. }
  3275. return actionResult;
  3276. }
  3277. /// <summary>
  3278. /// 根据条码及工序判断是否漏扫
  3279. /// </summary>
  3280. /// <param name="accountCode"></param>
  3281. /// <param name="userCode"></param>
  3282. /// <param name="userPassword"></param>
  3283. /// <param name="sessionKey"></param>
  3284. /// <param name="usercode">工号编码</param>
  3285. /// <param name="barcode">产品条码</param>
  3286. /// <param name="produceid">工序ID</param>
  3287. /// <returns></returns>
  3288. public ActionResult AddBarCodeMissing(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int produceid)
  3289. {
  3290. ActionResult actionResult = new ActionResult();
  3291. try
  3292. {
  3293. // 验证请求头信息
  3294. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3295. // 验证失败
  3296. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3297. {
  3298. return actionResult;
  3299. }
  3300. int returnValue = 1;
  3301. //int returnValue = ServiceInvoker.Invoke<int>(this,
  3302. // () => PMModuleLogicDAL.AddBarCodeMissing(barcode, produceid, sUserInfo));
  3303. actionResult.Result = JsonHelper.ToJson(returnValue);
  3304. actionResult.Status = (int)Constant.PDAResult.Success;
  3305. }
  3306. catch (Exception ex)
  3307. {
  3308. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3309. OutputLog.TraceLog(LogPriority.Error,
  3310. this.ToString(),
  3311. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3312. ex.ToString(),
  3313. LocalPath.LogExePath);
  3314. actionResult.Status = (int)Constant.PDAResult.Exception;
  3315. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3316. }
  3317. return actionResult;
  3318. }
  3319. /// <summary>
  3320. /// 获取登陆帐户有无报损审批权限
  3321. /// </summary>
  3322. /// <param name="accountCode"></param>
  3323. /// <param name="userCode"></param>
  3324. /// <param name="userPassword"></param>
  3325. /// <param name="sessionKey"></param>
  3326. /// <param name="usercode">工号编码</param>
  3327. /// <returns></returns>
  3328. public ActionResult GetScrapProductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  3329. {
  3330. ActionResult actionResult = new ActionResult();
  3331. try
  3332. {
  3333. // 验证请求头信息
  3334. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3335. // 验证失败
  3336. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3337. {
  3338. return actionResult;
  3339. }
  3340. int returnValue = ServiceInvoker.Invoke<int>(this,
  3341. () => PDAModuleLogic.GetScrapProductFuntion(sUserInfo));
  3342. actionResult.Result = JsonHelper.ToJson(returnValue);
  3343. actionResult.Status = (int)Constant.PDAResult.Success;
  3344. }
  3345. catch (Exception ex)
  3346. {
  3347. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3348. OutputLog.TraceLog(LogPriority.Error,
  3349. this.ToString(),
  3350. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3351. ex.ToString(),
  3352. LocalPath.LogExePath);
  3353. actionResult.Status = (int)Constant.PDAResult.Exception;
  3354. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3355. }
  3356. return actionResult;
  3357. }
  3358. /// <summary>
  3359. /// 获取登陆帐户有无报损审批权限
  3360. /// </summary>
  3361. /// <param name="accountCode"></param>
  3362. /// <param name="userCode"></param>
  3363. /// <param name="userPassword"></param>
  3364. /// <param name="sessionKey"></param>
  3365. /// <param name="usercode">工号编码</param>
  3366. /// <returns></returns>
  3367. public ActionResult GetSpecialRepairflagByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3368. {
  3369. ActionResult actionResult = new ActionResult();
  3370. try
  3371. {
  3372. // 验证请求头信息
  3373. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3374. // 验证失败
  3375. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3376. {
  3377. return actionResult;
  3378. }
  3379. int returnValue = ServiceInvoker.Invoke<int>(this,
  3380. () => PMModuleLogic.GetSpecialRepairflagByBarcode(barcode, sUserInfo));
  3381. actionResult.Result = JsonHelper.ToJson(returnValue);
  3382. actionResult.Status = (int)Constant.PDAResult.Success;
  3383. }
  3384. catch (Exception ex)
  3385. {
  3386. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3387. OutputLog.TraceLog(LogPriority.Error,
  3388. this.ToString(),
  3389. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3390. ex.ToString(),
  3391. LocalPath.LogExePath);
  3392. actionResult.Status = (int)Constant.PDAResult.Exception;
  3393. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3394. }
  3395. return actionResult;
  3396. }
  3397. /// <summary>
  3398. /// 获取窑车对应产品列表
  3399. /// </summary>
  3400. /// <param name="accountCode"></param>
  3401. /// <param name="userCode"></param>
  3402. /// <param name="userPassword"></param>
  3403. /// <param name="sessionKey"></param>
  3404. /// <param name="KilnCarID">窑车ID</param>
  3405. /// <returns>Dataset</returns>
  3406. public ActionResult GetKilnCarGoodsByKilnCarID(string accountCode, string userCode, string userPassword, string sessionKey, int KilnCarID)
  3407. {
  3408. ActionResult actionResult = new ActionResult();
  3409. try
  3410. {
  3411. // 验证请求头信息
  3412. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3413. // 验证失败
  3414. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3415. {
  3416. return actionResult;
  3417. }
  3418. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3419. () => PMModuleLogic.GetKilnCarGoodsByKilnCarID(KilnCarID));
  3420. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3421. {
  3422. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3423. actionResult.Status = (int)Constant.PDAResult.Success;
  3424. }
  3425. else
  3426. {
  3427. actionResult.Status = (int)Constant.PDAResult.Fail;
  3428. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3429. }
  3430. }
  3431. catch (Exception ex)
  3432. {
  3433. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3434. OutputLog.TraceLog(LogPriority.Error,
  3435. this.ToString(),
  3436. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3437. ex.ToString(),
  3438. LocalPath.LogExePath);
  3439. actionResult.Status = (int)Constant.PDAResult.Exception;
  3440. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3441. }
  3442. return actionResult;
  3443. }
  3444. /// <summary>
  3445. /// 更换条码
  3446. /// </summary>
  3447. /// <param name="accountCode"></param>
  3448. /// <param name="userCode"></param>
  3449. /// <param name="userPassword"></param>
  3450. /// <param name="sessionKey"></param>
  3451. ///<param name="barcode">原条码</param>
  3452. /// <param name="newBarcode">新条码</param>
  3453. /// <param name="remarks">备注</param>
  3454. /// <returns>操作结果</returns>
  3455. public ActionResult SaveBarCodeChange(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, string newBarcode, string remarks, string groutingUserCode, string goodsCode)
  3456. {
  3457. ActionResult actionResult = new ActionResult();
  3458. try
  3459. {
  3460. // 验证请求头信息
  3461. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3462. // 验证失败
  3463. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3464. {
  3465. return actionResult;
  3466. }
  3467. ServiceResultEntity serviceResultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  3468. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SetFPM0201Data(sUserInfo, barcode, newBarcode, remarks, groutingUserCode, goodsCode));
  3469. if (serviceResultEntity.Status == Constant.ServiceResultStatus.Success)
  3470. {
  3471. actionResult.Result = 1;
  3472. actionResult.Status = (int)Constant.PDAResult.Success;
  3473. }
  3474. else
  3475. {
  3476. actionResult.Status = (int)Constant.PDAResult.Fail;
  3477. actionResult.Message = serviceResultEntity.Message;
  3478. }
  3479. }
  3480. catch (Exception ex)
  3481. {
  3482. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3483. OutputLog.TraceLog(LogPriority.Error,
  3484. this.ToString(),
  3485. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3486. ex.ToString(),
  3487. LocalPath.LogExePath);
  3488. actionResult.Status = (int)Constant.PDAResult.Exception;
  3489. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3490. }
  3491. return actionResult;
  3492. }
  3493. /// <summary>
  3494. /// 获取(注浆登记)的查询数据
  3495. /// </summary>
  3496. /// <param name="accountCode"></param>
  3497. /// <param name="userCode"></param>
  3498. /// <param name="userPassword"></param>
  3499. /// <param name="sessionKey"></param>
  3500. /// <param name="se">查询条件</param>
  3501. /// <returns>Dataset</returns>
  3502. public ActionResult GetGroutingList(string accountCode, string userCode, string userPassword, string sessionKey, FPM0202_SE se)
  3503. {
  3504. ActionResult actionResult = new ActionResult();
  3505. try
  3506. {
  3507. // 验证请求头信息
  3508. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3509. // 验证失败
  3510. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3511. {
  3512. return actionResult;
  3513. }
  3514. ServiceResultEntity serviceResultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  3515. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetFPM0202SData(sUserInfo, se));
  3516. if (serviceResultEntity.Status != Constant.ServiceResultStatus.NoSearchResults)
  3517. {
  3518. // PDA不显示的列删除掉
  3519. //serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingDailyDetailID");
  3520. //serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingDailyID");
  3521. serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingLineName");
  3522. serviceResultEntity.Data.Tables[0].Columns.Remove("UserCode");
  3523. serviceResultEntity.Data.Tables[0].Columns.Remove("GoodsName");
  3524. serviceResultEntity.Data.Tables[0].Columns.Remove("GMouldStatusName");
  3525. serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingCount");
  3526. serviceResultEntity.Data.Tables[0].Columns.Remove("Remarks");
  3527. serviceResultEntity.Data.Tables[0].Columns.Remove("GMouldTypeName");
  3528. //serviceResultEntity.Data.Tables[0].Columns.Remove("DMUserCode");
  3529. serviceResultEntity.Data.Tables[0].Columns.Remove("IsPublicBody");
  3530. actionResult.Result = JsonHelper.ToJson(serviceResultEntity.Data.Tables[0]);
  3531. actionResult.Status = (int)Constant.PDAResult.Success;
  3532. }
  3533. else
  3534. {
  3535. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3536. actionResult.Message = "无查询数据";
  3537. }
  3538. }
  3539. catch (Exception ex)
  3540. {
  3541. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3542. OutputLog.TraceLog(LogPriority.Error,
  3543. this.ToString(),
  3544. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3545. ex.ToString(),
  3546. LocalPath.LogExePath);
  3547. actionResult.Status = (int)Constant.PDAResult.Exception;
  3548. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3549. }
  3550. return actionResult;
  3551. }
  3552. /// <summary>
  3553. /// 获取(注浆登记)的查询数据
  3554. /// </summary>
  3555. /// <param name="accountCode"></param>
  3556. /// <param name="userCode"></param>
  3557. /// <param name="userPassword"></param>
  3558. /// <param name="sessionKey"></param>
  3559. /// <param name="se">查询条件</param>
  3560. /// <returns>Dataset</returns>
  3561. public ActionResult GetGroutingListByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3562. {
  3563. ActionResult actionResult = new ActionResult();
  3564. try
  3565. {
  3566. // 验证请求头信息
  3567. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3568. // 验证失败
  3569. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3570. {
  3571. return actionResult;
  3572. }
  3573. ServiceResultEntity serviceResultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  3574. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetFPM0203SData(sUserInfo, barcode));
  3575. if (serviceResultEntity.Status != Constant.ServiceResultStatus.NoSearchResults)
  3576. {
  3577. actionResult.Result = JsonHelper.ToJson(serviceResultEntity.Data.Tables[0]);
  3578. actionResult.Status = (int)Constant.PDAResult.Success;
  3579. }
  3580. else
  3581. {
  3582. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3583. actionResult.Message = "无查询数据";
  3584. }
  3585. }
  3586. catch (Exception ex)
  3587. {
  3588. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3589. OutputLog.TraceLog(LogPriority.Error,
  3590. this.ToString(),
  3591. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3592. ex.ToString(),
  3593. LocalPath.LogExePath);
  3594. actionResult.Status = (int)Constant.PDAResult.Exception;
  3595. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3596. }
  3597. return actionResult;
  3598. }
  3599. /// <summary>
  3600. ///获得成型线信息
  3601. /// </summary>
  3602. /// <param name="accountCode"></param>
  3603. /// <param name="userCode"></param>
  3604. /// <param name="userPassword"></param>
  3605. /// <param name="sessionKey"></param>
  3606. /// <param name="se">查询条件</param>
  3607. /// <returns>Dataset</returns>
  3608. public ActionResult GetGroutingLine(string accountCode, string userCode, string userPassword, string sessionKey, GroutingLineEntity groutingLineEntity)
  3609. {
  3610. ActionResult actionResult = new ActionResult();
  3611. try
  3612. {
  3613. // 验证请求头信息
  3614. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3615. // 验证失败
  3616. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3617. {
  3618. return actionResult;
  3619. }
  3620. DataSet dsReturn = ServiceInvoker.Invoke<DataSet>(this,
  3621. () => Dongke.IBOSS.PRD.Service.PCModuleLogic.PCModuleLogic.GetGroutingLine(groutingLineEntity, sUserInfo));
  3622. if (dsReturn != null && dsReturn.Tables[0].Rows.Count > 0)
  3623. {
  3624. actionResult.Result = JsonHelper.ToJson(dsReturn.Tables[0]);
  3625. actionResult.Status = (int)Constant.PDAResult.Success;
  3626. }
  3627. else
  3628. {
  3629. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3630. actionResult.Message = "无查询数据";
  3631. }
  3632. }
  3633. catch (Exception ex)
  3634. {
  3635. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3636. OutputLog.TraceLog(LogPriority.Error,
  3637. this.ToString(),
  3638. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3639. ex.ToString(),
  3640. LocalPath.LogExePath);
  3641. actionResult.Status = (int)Constant.PDAResult.Exception;
  3642. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3643. }
  3644. return actionResult;
  3645. }
  3646. /// <summary>
  3647. ///获取在产产品的信息标识列表
  3648. /// </summary>
  3649. /// <param name="accountCode"></param>
  3650. /// <param name="userCode"></param>
  3651. /// <param name="userPassword"></param>
  3652. /// <param name="sessionKey"></param>
  3653. /// <param name="barcode">查询条件</param>
  3654. /// <returns>Dataset</returns>
  3655. public ActionResult GetInProductionDataList(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3656. {
  3657. ActionResult actionResult = new ActionResult();
  3658. try
  3659. {
  3660. // 验证请求头信息
  3661. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3662. // 验证失败
  3663. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3664. {
  3665. return actionResult;
  3666. }
  3667. DataSet dsReturn = ServiceInvoker.Invoke<DataSet>(this,
  3668. () => PMModuleLogic.GetInProductionDataList(barcode));
  3669. if (dsReturn != null && dsReturn.Tables[0].Rows.Count > 0)
  3670. {
  3671. actionResult.Result = JsonHelper.ToJson(dsReturn.Tables[0]);
  3672. actionResult.Status = (int)Constant.PDAResult.Success;
  3673. }
  3674. else
  3675. {
  3676. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3677. actionResult.Message = "无查询数据";
  3678. }
  3679. }
  3680. catch (Exception ex)
  3681. {
  3682. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3683. OutputLog.TraceLog(LogPriority.Error,
  3684. this.ToString(),
  3685. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3686. ex.ToString(),
  3687. LocalPath.LogExePath);
  3688. actionResult.Status = (int)Constant.PDAResult.Exception;
  3689. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3690. }
  3691. return actionResult;
  3692. }
  3693. /// <summary>
  3694. ///获取条码是否注浆登记过,0行无效
  3695. /// </summary>
  3696. /// <param name="accountCode"></param>
  3697. /// <param name="userCode"></param>
  3698. /// <param name="userPassword"></param>
  3699. /// <param name="sessionKey"></param>
  3700. /// <param name="barcode">查询条件</param>
  3701. /// <returns>Dataset</returns>
  3702. public ActionResult GetBarCodeInGroutingDailyDetail(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3703. {
  3704. ActionResult actionResult = new ActionResult();
  3705. try
  3706. {
  3707. // 验证请求头信息
  3708. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3709. // 验证失败
  3710. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3711. {
  3712. return actionResult;
  3713. }
  3714. DataSet dsReturn = ServiceInvoker.Invoke<DataSet>(this,
  3715. () => PMModuleLogic.GetBarCodeInGroutingDailyDetail(barcode));
  3716. if (dsReturn != null && dsReturn.Tables[0].Rows.Count > 0)
  3717. {
  3718. actionResult.Result = JsonHelper.ToJson(dsReturn.Tables[0]);
  3719. actionResult.Status = (int)Constant.PDAResult.Success;
  3720. }
  3721. else
  3722. {
  3723. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3724. actionResult.Message = "该产品条码无效,无法报损!";
  3725. }
  3726. }
  3727. catch (Exception ex)
  3728. {
  3729. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3730. OutputLog.TraceLog(LogPriority.Error,
  3731. this.ToString(),
  3732. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3733. ex.ToString(),
  3734. LocalPath.LogExePath);
  3735. actionResult.Status = (int)Constant.PDAResult.Exception;
  3736. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3737. }
  3738. return actionResult;
  3739. }
  3740. /// <summary>
  3741. /// 获取登陆帐户有变更条码权限
  3742. /// </summary>
  3743. /// <param name="accountCode"></param>
  3744. /// <param name="userCode"></param>
  3745. /// <param name="userPassword"></param>
  3746. /// <param name="sessionKey"></param>
  3747. /// <returns></returns>
  3748. public ActionResult GetBarCodeRecordFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  3749. {
  3750. ActionResult actionResult = new ActionResult();
  3751. try
  3752. {
  3753. // 验证请求头信息
  3754. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3755. // 验证失败
  3756. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3757. {
  3758. return actionResult;
  3759. }
  3760. int returnValue = ServiceInvoker.Invoke<int>(this,
  3761. () => PDAModuleLogic.GetBarCodeRecordFuntion(sUserInfo));
  3762. actionResult.Result = JsonHelper.ToJson(returnValue);
  3763. actionResult.Status = (int)Constant.PDAResult.Success;
  3764. }
  3765. catch (Exception ex)
  3766. {
  3767. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3768. OutputLog.TraceLog(LogPriority.Error,
  3769. this.ToString(),
  3770. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3771. ex.ToString(),
  3772. LocalPath.LogExePath);
  3773. actionResult.Status = (int)Constant.PDAResult.Exception;
  3774. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3775. }
  3776. return actionResult;
  3777. }
  3778. /// <summary>
  3779. /// 成检时获取此条码是否报损
  3780. /// </summary>
  3781. /// <param name="accountCode"></param>
  3782. /// <param name="userCode"></param>
  3783. /// <param name="userPassword"></param>
  3784. /// <param name="sessionKey"></param>
  3785. /// <param name="barcode">产品条码</param>
  3786. /// <returns></returns>
  3787. public ActionResult CheckScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3788. {
  3789. ActionResult actionResult = new ActionResult();
  3790. try
  3791. {
  3792. // 验证请求头信息
  3793. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3794. // 验证失败
  3795. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3796. {
  3797. return actionResult;
  3798. }
  3799. int returnValue = ServiceInvoker.Invoke<int>(this,
  3800. () => PMModuleLogic.CheckScrapProduct(barcode));
  3801. if (returnValue == -100)
  3802. {
  3803. actionResult.Result = JsonHelper.ToJson(returnValue);
  3804. actionResult.Status = (int)Constant.PDAResult.Success;
  3805. }
  3806. else
  3807. {
  3808. actionResult.Status = (int)Constant.PDAResult.Fail;
  3809. if (returnValue == 0)
  3810. {
  3811. actionResult.Message = "该条码:" + barcode + "存在报损记录(待审批)";
  3812. }
  3813. else
  3814. {
  3815. actionResult.Message = "该条码:" + barcode + "存在报损记录(审批通过)";
  3816. }
  3817. }
  3818. }
  3819. catch (Exception ex)
  3820. {
  3821. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3822. OutputLog.TraceLog(LogPriority.Error,
  3823. this.ToString(),
  3824. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3825. ex.ToString(),
  3826. LocalPath.LogExePath);
  3827. actionResult.Status = (int)Constant.PDAResult.Exception;
  3828. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3829. }
  3830. return actionResult;
  3831. }
  3832. /// <summary>
  3833. /// 获取产品完成工序的ID(PDA)
  3834. /// </summary>
  3835. /// <param name="barcode">产品条码</param>
  3836. /// <returns>int</returns>
  3837. public ActionResult GetCompleteProcedureIDPDA(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3838. {
  3839. ActionResult actionResult = new ActionResult();
  3840. try
  3841. {
  3842. // 验证请求头信息
  3843. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3844. // 验证失败
  3845. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3846. {
  3847. return actionResult;
  3848. }
  3849. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  3850. () => PMModuleLogic.GetCompleteProcedureIDPDA(barcode));
  3851. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  3852. actionResult.Status = (int)Constant.PDAResult.Success;
  3853. }
  3854. catch (Exception ex)
  3855. {
  3856. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3857. OutputLog.TraceLog(LogPriority.Error,
  3858. this.ToString(),
  3859. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3860. ex.ToString(),
  3861. LocalPath.LogExePath);
  3862. actionResult.Status = (int)Constant.PDAResult.Exception;
  3863. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3864. }
  3865. return actionResult;
  3866. }
  3867. /// <summary>
  3868. /// 获取产品完成工序的ID(PDA)
  3869. /// </summary>
  3870. /// <param name="barcode">产品条码</param>
  3871. /// <returns>int</returns>
  3872. public ActionResult GetGoodsInfoBybarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3873. {
  3874. ActionResult actionResult = new ActionResult();
  3875. try
  3876. {
  3877. // 验证请求头信息
  3878. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3879. // 验证失败
  3880. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3881. {
  3882. return actionResult;
  3883. }
  3884. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  3885. () => PMModuleLogic.GetGoodsInfoBybarcode(barcode));
  3886. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  3887. actionResult.Status = (int)Constant.PDAResult.Success;
  3888. }
  3889. catch (Exception ex)
  3890. {
  3891. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3892. OutputLog.TraceLog(LogPriority.Error,
  3893. this.ToString(),
  3894. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3895. ex.ToString(),
  3896. LocalPath.LogExePath);
  3897. actionResult.Status = (int)Constant.PDAResult.Exception;
  3898. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3899. }
  3900. return actionResult;
  3901. }
  3902. /// <summary>
  3903. /// 成检-校验生产工号
  3904. /// </summary>
  3905. /// <param name="usercode">生产工号</param>
  3906. /// <returns>int</returns>
  3907. public ActionResult GetUserCode(string accountCode, string userCode, string userPassword, string sessionKey, string usercode)
  3908. {
  3909. ActionResult actionResult = new ActionResult();
  3910. try
  3911. {
  3912. // 验证请求头信息
  3913. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3914. // 验证失败
  3915. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3916. {
  3917. return actionResult;
  3918. }
  3919. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  3920. () => PDAModuleLogic.GetUserCode(usercode, sUserInfo));
  3921. actionResult.Result = JsonHelper.ToJson(ds);
  3922. actionResult.Status = (int)Constant.PDAResult.Success;
  3923. }
  3924. catch (Exception ex)
  3925. {
  3926. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3927. OutputLog.TraceLog(LogPriority.Error,
  3928. this.ToString(),
  3929. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3930. ex.ToString(),
  3931. LocalPath.LogExePath);
  3932. actionResult.Status = (int)Constant.PDAResult.Exception;
  3933. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3934. }
  3935. return actionResult;
  3936. }
  3937. /// <summary>
  3938. /// 更新漏扫的成型工号
  3939. /// </summary>
  3940. /// <param name="accountCode"></param>
  3941. /// <param name="userCode"></param>
  3942. /// <param name="userPassword"></param>
  3943. /// <param name="sessionKey"></param>
  3944. /// <param name="groutingUserCode">成型工号</param>
  3945. /// <param name="missingID">漏扫ID</param>
  3946. /// <returns></returns>
  3947. public ActionResult UpdateGroutingUserCodeByMissingID(string accountCode, string userCode, string userPassword, string sessionKey, string groutingUserCode, int missingID)
  3948. {
  3949. ActionResult actionResult = new ActionResult();
  3950. try
  3951. {
  3952. // 验证请求头信息
  3953. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3954. // 验证失败
  3955. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3956. {
  3957. return actionResult;
  3958. }
  3959. int returnValue = ServiceInvoker.Invoke<int>(this,
  3960. () => PMModuleLogicDAL.UpdateGroutingUserCodeByMissingID(groutingUserCode, missingID, sUserInfo));
  3961. if (returnValue != -1)
  3962. {
  3963. actionResult.Result = JsonHelper.ToJson(returnValue);
  3964. actionResult.Status = (int)Constant.PDAResult.Success;
  3965. }
  3966. else
  3967. {
  3968. actionResult.Status = (int)Constant.PDAResult.Fail;
  3969. actionResult.Message = "存在无效的漏扫工号";
  3970. }
  3971. }
  3972. catch (Exception ex)
  3973. {
  3974. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3975. OutputLog.TraceLog(LogPriority.Error,
  3976. this.ToString(),
  3977. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3978. ex.ToString(),
  3979. LocalPath.LogExePath);
  3980. actionResult.Status = (int)Constant.PDAResult.Exception;
  3981. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3982. }
  3983. return actionResult;
  3984. }
  3985. /// <summary>
  3986. /// 在入窑工序检验窑车号是否存在
  3987. /// </summary>
  3988. /// <param name="accountCode"></param>
  3989. /// <param name="userCode"></param>
  3990. /// <param name="userPassword"></param>
  3991. /// <param name="sessionKey"></param>
  3992. /// <param name="kilncarcode">窑车编码</param>
  3993. /// <param name="procedureid">工序ID</param>
  3994. /// <returns></returns>
  3995. public ActionResult CheckKilnCarByIntoCar(string accountCode, string userCode, string userPassword, string sessionKey, string kilncarcode, int procedureid)
  3996. {
  3997. ActionResult actionResult = new ActionResult();
  3998. try
  3999. {
  4000. // 验证请求头信息
  4001. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4002. // 验证失败
  4003. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4004. {
  4005. return actionResult;
  4006. }
  4007. int returnValue = ServiceInvoker.Invoke<int>(this,
  4008. () => PMModuleLogicDAL.CheckKilnCarByIntoCar(kilncarcode, procedureid, sUserInfo));
  4009. if (returnValue == 1)
  4010. {
  4011. actionResult.Result = JsonHelper.ToJson(returnValue);
  4012. actionResult.Status = (int)Constant.PDAResult.Success;
  4013. }
  4014. else
  4015. {
  4016. actionResult.Status = (int)Constant.PDAResult.Fail;
  4017. if (returnValue == -99)
  4018. actionResult.Message = "窑炉车号无效";
  4019. else if (returnValue == -98)
  4020. actionResult.Message = "窑车己无产品";
  4021. else if (returnValue == -97)
  4022. actionResult.Message = "窑车没有入窑,不可以撤销";
  4023. else if (returnValue == -1)
  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="sUserInfo"></param>
  4044. /// <returns></returns>
  4045. public ActionResult GetInCheckedList(string accountCode, string userCode, string userPassword, string sessionKey)
  4046. {
  4047. ActionResult actionResult = new ActionResult();
  4048. try
  4049. {
  4050. // 验证请求头信息
  4051. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4052. // 验证失败
  4053. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4054. {
  4055. return actionResult;
  4056. }
  4057. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4058. () => PMModuleLogic.GetInCheckedList(sUserInfo));
  4059. actionResult.Result = JsonHelper.ToJson(ds);
  4060. actionResult.Status = (int)Constant.PDAResult.Success;
  4061. }
  4062. catch (Exception ex)
  4063. {
  4064. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4065. OutputLog.TraceLog(LogPriority.Error,
  4066. this.ToString(),
  4067. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4068. ex.ToString(),
  4069. LocalPath.LogExePath);
  4070. actionResult.Status = (int)Constant.PDAResult.Exception;
  4071. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4072. }
  4073. return actionResult;
  4074. }
  4075. /// <summary>
  4076. /// 进行盘点操作
  4077. /// </summary>
  4078. /// <param name="accountCode"></param>
  4079. /// <param name="userCode"></param>
  4080. /// <param name="userPassword"></param>
  4081. /// <param name="sessionKey"></param>
  4082. /// <param name="InCheckedID">盘点单ID</param>
  4083. /// <param name="BarCode">产品条码</param>
  4084. /// <returns></returns>
  4085. public ActionResult UpdateInChecked(string accountCode, string userCode, string userPassword, string sessionKey, int InCheckedID, string BarCode)
  4086. {
  4087. ActionResult actionResult = new ActionResult();
  4088. try
  4089. {
  4090. // 验证请求头信息
  4091. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4092. // 验证失败
  4093. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4094. {
  4095. return actionResult;
  4096. }
  4097. int returnValue = ServiceInvoker.Invoke<int>(this,
  4098. () => PMModuleLogicDAL.UpdateInChecked(InCheckedID, BarCode, sUserInfo));
  4099. if (returnValue > 0)
  4100. {
  4101. actionResult.Result = JsonHelper.ToJson(returnValue);
  4102. actionResult.Status = (int)Constant.PDAResult.Success;
  4103. actionResult.Message = "产品" + BarCode + "盘点成功";
  4104. }
  4105. else if (returnValue == 10)
  4106. {
  4107. actionResult.Result = JsonHelper.ToJson(returnValue);
  4108. actionResult.Status = (int)Constant.PDAResult.Success;
  4109. actionResult.Message = "产品" + BarCode + "盘盈成功";
  4110. }
  4111. else
  4112. {
  4113. actionResult.Status = (int)Constant.PDAResult.Fail;
  4114. if (returnValue == -2)
  4115. actionResult.Message = "产品" + BarCode + "不是在产产品";
  4116. //if (returnValue == 10)
  4117. // actionResult.Message = "产品" + BarCode + "盘盈成功";
  4118. //if (returnValue > 0)
  4119. // actionResult.Message = "产品" + BarCode + "盘点成功";
  4120. if (returnValue == -22)
  4121. actionResult.Message = "产品" + BarCode + "己被其他工号盘点";
  4122. if (returnValue == -23)
  4123. actionResult.Message = "产品" + BarCode + "己被其他工号盘盈";
  4124. if (returnValue == -24)
  4125. actionResult.Message = "产品" + BarCode + "己被此工号盘点";
  4126. if (returnValue == -25)
  4127. actionResult.Message = "产品" + BarCode + "己被此工号盘盈";
  4128. else if (returnValue == 0)
  4129. actionResult.Message = "盘点失败";
  4130. }
  4131. }
  4132. catch (Exception ex)
  4133. {
  4134. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4135. OutputLog.TraceLog(LogPriority.Error,
  4136. this.ToString(),
  4137. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4138. ex.ToString(),
  4139. LocalPath.LogExePath);
  4140. actionResult.Status = (int)Constant.PDAResult.Exception;
  4141. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4142. }
  4143. return actionResult;
  4144. }
  4145. #region 班次配置
  4146. /// <summary>
  4147. /// 班次配置-通过工号获取工种列表
  4148. /// </summary>
  4149. /// <param name="userId">工号ID</param>
  4150. /// <returns></returns>
  4151. public ActionResult BindUserJobs(string accountCode, string userCode, string userPassword, string sessionKey, int userId)
  4152. {
  4153. ActionResult actionResult = new ActionResult();
  4154. try
  4155. {
  4156. // 验证请求头信息
  4157. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4158. // 验证失败
  4159. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4160. {
  4161. return actionResult;
  4162. }
  4163. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4164. () => SystemModuleLogic.GetJobByUserId(userId));
  4165. actionResult.Result = JsonHelper.ToJson(ds);
  4166. actionResult.Status = (int)Constant.PDAResult.Success;
  4167. }
  4168. catch (Exception ex)
  4169. {
  4170. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4171. OutputLog.TraceLog(LogPriority.Error,
  4172. this.ToString(),
  4173. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4174. ex.ToString(),
  4175. LocalPath.LogExePath);
  4176. actionResult.Status = (int)Constant.PDAResult.Exception;
  4177. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4178. }
  4179. return actionResult;
  4180. }
  4181. ///// <summary>
  4182. ///// 班次配置-根据工号查询员工档案信息
  4183. ///// </summary>
  4184. ///// <param name="userId">工号ID</param>
  4185. ///// <returns></returns>
  4186. //public ActionResult SearchHrStaffInfo(string accountCode, string userCode, string userPassword, string sessionKey, int userId)
  4187. //{
  4188. // ActionResult actionResult = new ActionResult();
  4189. // try
  4190. // {
  4191. // // 验证请求头信息
  4192. // actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4193. // // 验证失败
  4194. // if (actionResult.Status != (int)Constant.PDAResult.Success)
  4195. // {
  4196. // return actionResult;
  4197. // }
  4198. // DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4199. // () => HRModuleLogic.SearchHrStaffInfo(userId,sUserInfo));
  4200. // actionResult.Result = JsonHelper.ToJson(ds);
  4201. // actionResult.Status = (int)Constant.PDAResult.Success;
  4202. // }
  4203. // catch (Exception ex)
  4204. // {
  4205. // //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4206. // OutputLog.TraceLog(LogPriority.Error,
  4207. // this.ToString(),
  4208. // System.Reflection.MethodBase.GetCurrentMethod().Name,
  4209. // ex.ToString(),
  4210. // LocalPath.LogExePath);
  4211. // actionResult.Status = (int)Constant.PDAResult.Exception;
  4212. // actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4213. // }
  4214. // return actionResult;
  4215. //}
  4216. /// <summary>
  4217. /// 班次配置-根据员工姓名查员工信息
  4218. /// </summary>
  4219. /// <param name="searchStaffEntity"></param>
  4220. /// <returns></returns>
  4221. public ActionResult SearchStaffInfo(string accountCode, string userCode, string userPassword, string sessionKey, SearchStaffEntity searchStaffEntity)
  4222. {
  4223. ActionResult actionResult = new ActionResult();
  4224. try
  4225. {
  4226. // 验证请求头信息
  4227. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4228. // 验证失败
  4229. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4230. {
  4231. return actionResult;
  4232. }
  4233. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4234. () => PDAModuleLogic.SearchStaffInfo(searchStaffEntity, sUserInfo));
  4235. actionResult.Result = JsonHelper.ToJson(ds);
  4236. actionResult.Status = (int)Constant.PDAResult.Success;
  4237. }
  4238. catch (Exception ex)
  4239. {
  4240. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4241. OutputLog.TraceLog(LogPriority.Error,
  4242. this.ToString(),
  4243. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4244. ex.ToString(),
  4245. LocalPath.LogExePath);
  4246. actionResult.Status = (int)Constant.PDAResult.Exception;
  4247. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4248. }
  4249. return actionResult;
  4250. }
  4251. /// <summary>
  4252. /// 获取班次配置信息
  4253. /// </summary>
  4254. /// <param name="searchEntity"></param>
  4255. /// <returns></returns>
  4256. public ActionResult SearchClassesSetting(string accountCode, string userCode, string userPassword, string sessionKey, SearchClassesSettingEntity searchEntity)
  4257. {
  4258. ActionResult actionResult = new ActionResult();
  4259. try
  4260. {
  4261. // 验证请求头信息
  4262. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4263. // 验证失败
  4264. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4265. {
  4266. return actionResult;
  4267. }
  4268. searchEntity.StartAccountDate = Convert.ToDateTime(searchEntity.StartAccountDatePDA);
  4269. searchEntity.EndAccountDate = Convert.ToDateTime(searchEntity.EndAccountDatePDA).AddDays(1).AddMinutes(-1);
  4270. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4271. () => PCModuleLogic.SearchClassesSetting(searchEntity, sUserInfo));
  4272. actionResult.Result = JsonHelper.ToJson(ds);
  4273. actionResult.Status = (int)Constant.PDAResult.Success;
  4274. }
  4275. catch (Exception ex)
  4276. {
  4277. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4278. OutputLog.TraceLog(LogPriority.Error,
  4279. this.ToString(),
  4280. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4281. ex.ToString(),
  4282. LocalPath.LogExePath);
  4283. actionResult.Status = (int)Constant.PDAResult.Exception;
  4284. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4285. }
  4286. return actionResult;
  4287. }
  4288. public ActionResult SaveClassesSetting(string accountCode, string userCode, string userPassword, string sessionKey, ClassesSettingEntity setEntity, ClassesDetailSettingEntity[] setDetailEntity)
  4289. {
  4290. ActionResult actionResult = new ActionResult();
  4291. try
  4292. {
  4293. // 验证请求头信息
  4294. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4295. // 验证失败
  4296. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4297. {
  4298. return actionResult;
  4299. }
  4300. int returnValue = ServiceInvoker.Invoke<int>(this,
  4301. () => PDAModuleLogic.SaveClassesSetting(setEntity, setDetailEntity, sUserInfo));
  4302. if (returnValue > 0)
  4303. {
  4304. actionResult.Result = JsonHelper.ToJson(returnValue);
  4305. actionResult.Status = (int)Constant.PDAResult.Success;
  4306. }
  4307. else
  4308. {
  4309. actionResult.Status = (int)Constant.PDAResult.Fail;
  4310. actionResult.Message = "保存失败";
  4311. }
  4312. }
  4313. catch (Exception ex)
  4314. {
  4315. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4316. OutputLog.TraceLog(LogPriority.Error,
  4317. this.ToString(),
  4318. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4319. ex.ToString(),
  4320. LocalPath.LogExePath);
  4321. actionResult.Status = (int)Constant.PDAResult.Exception;
  4322. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4323. }
  4324. return actionResult;
  4325. }
  4326. /// <summary>
  4327. /// 班次配置--获取详细信息
  4328. /// </summary>
  4329. /// <param name="searchEntity"></param>
  4330. /// <returns></returns>
  4331. public ActionResult SearchClassesDetail(string accountCode, string userCode, string userPassword, string sessionKey, int classesSettingID)
  4332. {
  4333. ActionResult actionResult = new ActionResult();
  4334. try
  4335. {
  4336. // 验证请求头信息
  4337. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4338. // 验证失败
  4339. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4340. {
  4341. return actionResult;
  4342. }
  4343. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4344. () => PCModuleLogic.SearchClassesDetail(classesSettingID, sUserInfo));
  4345. actionResult.Result = JsonHelper.ToJson(ds);
  4346. actionResult.Status = (int)Constant.PDAResult.Success;
  4347. }
  4348. catch (Exception ex)
  4349. {
  4350. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4351. OutputLog.TraceLog(LogPriority.Error,
  4352. this.ToString(),
  4353. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4354. ex.ToString(),
  4355. LocalPath.LogExePath);
  4356. actionResult.Status = (int)Constant.PDAResult.Exception;
  4357. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4358. }
  4359. return actionResult;
  4360. }
  4361. /// <summary>
  4362. /// 获取用户是否有班次配置权限
  4363. /// </summary>
  4364. /// <param name="accountCode"></param>
  4365. /// <param name="userCode"></param>
  4366. /// <param name="userPassword"></param>
  4367. /// <param name="sessionKey"></param>
  4368. /// <returns></returns>
  4369. public ActionResult GetClassesSettingFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  4370. {
  4371. ActionResult actionResult = new ActionResult();
  4372. try
  4373. {
  4374. // 验证请求头信息
  4375. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4376. // 验证失败
  4377. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4378. {
  4379. return actionResult;
  4380. }
  4381. int returnValue = ServiceInvoker.Invoke<int>(this,
  4382. () => PDAModuleLogic.GetClassesSettingFuntion(sUserInfo));
  4383. actionResult.Result = JsonHelper.ToJson(returnValue);
  4384. actionResult.Status = (int)Constant.PDAResult.Success;
  4385. }
  4386. catch (Exception ex)
  4387. {
  4388. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4389. OutputLog.TraceLog(LogPriority.Error,
  4390. this.ToString(),
  4391. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4392. ex.ToString(),
  4393. LocalPath.LogExePath);
  4394. actionResult.Status = (int)Constant.PDAResult.Exception;
  4395. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4396. }
  4397. return actionResult;
  4398. }
  4399. /// <summary>
  4400. /// 获取盘点单列表
  4401. /// </summary>
  4402. /// <param name="sUserInfo"></param>
  4403. /// <returns></returns>
  4404. public ActionResult GetAllInChecked(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity)
  4405. {
  4406. ActionResult actionResult = new ActionResult();
  4407. try
  4408. {
  4409. // 验证请求头信息
  4410. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4411. // 验证失败
  4412. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4413. {
  4414. return actionResult;
  4415. }
  4416. entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA);
  4417. entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1);
  4418. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4419. () => PDAModuleLogic.GetAllInChecked(entity, sUserInfo));
  4420. actionResult.Result = JsonHelper.ToJson(ds);
  4421. actionResult.Status = (int)Constant.PDAResult.Success;
  4422. }
  4423. catch (Exception ex)
  4424. {
  4425. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4426. OutputLog.TraceLog(LogPriority.Error,
  4427. this.ToString(),
  4428. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4429. ex.ToString(),
  4430. LocalPath.LogExePath);
  4431. actionResult.Status = (int)Constant.PDAResult.Exception;
  4432. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4433. }
  4434. return actionResult;
  4435. }
  4436. #endregion
  4437. #region PDA报表
  4438. /// <summary>
  4439. /// 产品质量跟踪
  4440. /// </summary>
  4441. /// <param name="accountCode"></param>
  4442. /// <param name="userCode"></param>
  4443. /// <param name="userPassword"></param>
  4444. /// <param name="sessionKey"></param>
  4445. /// <param name="se"></param>
  4446. /// <returns></returns>
  4447. public ActionResult GetRPT040104SData(string accountCode, string userCode, string userPassword, string sessionKey, RPT040104_SE se)
  4448. {
  4449. ActionResult actionResult = new ActionResult();
  4450. try
  4451. {
  4452. // 验证请求头信息
  4453. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4454. // 验证失败
  4455. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4456. {
  4457. return actionResult;
  4458. }
  4459. se.CreateTimeStart = Convert.ToDateTime(se.CreateTimeStartPDA);
  4460. se.CreateTimeEnd = Convert.ToDateTime(se.CreateTimeEndPDA).AddDays(1);
  4461. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4462. () => PDAModuleLogic.GetRPT040104SData(sUserInfo, se));
  4463. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4464. {
  4465. actionResult.Status = (int)Constant.PDAResult.Fail;
  4466. actionResult.Message = Messages.MSG_CMN_I002;
  4467. }
  4468. else
  4469. {
  4470. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4471. actionResult.Status = (int)Constant.PDAResult.Success;
  4472. }
  4473. }
  4474. catch (Exception ex)
  4475. {
  4476. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4477. OutputLog.TraceLog(LogPriority.Error,
  4478. this.ToString(),
  4479. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4480. ex.ToString(),
  4481. LocalPath.LogExePath);
  4482. actionResult.Status = (int)Constant.PDAResult.Exception;
  4483. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4484. }
  4485. return actionResult;
  4486. }
  4487. /// <summary>
  4488. /// 工号产量质量分析表
  4489. /// </summary>
  4490. /// <param name="accountCode"></param>
  4491. /// <param name="userCode"></param>
  4492. /// <param name="userPassword"></param>
  4493. /// <param name="sessionKey"></param>
  4494. /// <param name="se"></param>
  4495. /// <returns></returns>
  4496. public ActionResult GetFP00002Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4497. int rptSProcedureID, string workcode, string date)
  4498. {
  4499. ActionResult actionResult = new ActionResult();
  4500. try
  4501. {
  4502. // 验证请求头信息
  4503. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4504. // 验证失败
  4505. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4506. {
  4507. return actionResult;
  4508. }
  4509. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4510. () => PDAModuleLogic.GetFP00002Data(sUserInfo, rptSProcedureID, workcode, Convert.ToDateTime(date)));
  4511. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4512. {
  4513. actionResult.Status = (int)Constant.PDAResult.Fail;
  4514. actionResult.Message = Messages.MSG_CMN_I002;
  4515. }
  4516. else
  4517. {
  4518. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4519. actionResult.Status = (int)Constant.PDAResult.Success;
  4520. }
  4521. }
  4522. catch (Exception ex)
  4523. {
  4524. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4525. OutputLog.TraceLog(LogPriority.Error,
  4526. this.ToString(),
  4527. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4528. ex.ToString(),
  4529. LocalPath.LogExePath);
  4530. actionResult.Status = (int)Constant.PDAResult.Exception;
  4531. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4532. }
  4533. return actionResult;
  4534. }
  4535. /// <summary>
  4536. /// 半检数据统计表
  4537. /// </summary>
  4538. /// <param name="accountCode"></param>
  4539. /// <param name="userCode"></param>
  4540. /// <param name="userPassword"></param>
  4541. /// <param name="sessionKey"></param>
  4542. /// <param name="se"></param>
  4543. /// <returns></returns>
  4544. public ActionResult GetPDARPT000001Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4545. string workcode, string datebegin, string dateend)
  4546. {
  4547. ActionResult actionResult = new ActionResult();
  4548. try
  4549. {
  4550. // 验证请求头信息
  4551. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4552. // 验证失败
  4553. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4554. {
  4555. return actionResult;
  4556. }
  4557. DateTime datetimebegin = Convert.ToDateTime(datebegin);
  4558. DateTime datetimeend = Convert.ToDateTime(dateend);
  4559. datetimebegin = datetimebegin.Date;
  4560. datetimeend = datetimeend.Date.AddDays(1).AddSeconds(-1);
  4561. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4562. () => PDAModuleLogic.GetPDARPT000001Data(sUserInfo, workcode, datetimebegin, datetimeend));
  4563. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4564. {
  4565. actionResult.Status = (int)Constant.PDAResult.Fail;
  4566. actionResult.Message = Messages.MSG_CMN_I002;
  4567. }
  4568. else
  4569. {
  4570. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4571. actionResult.Status = (int)Constant.PDAResult.Success;
  4572. }
  4573. }
  4574. catch (Exception ex)
  4575. {
  4576. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4577. OutputLog.TraceLog(LogPriority.Error,
  4578. this.ToString(),
  4579. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4580. ex.ToString(),
  4581. LocalPath.LogExePath);
  4582. actionResult.Status = (int)Constant.PDAResult.Exception;
  4583. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4584. }
  4585. return actionResult;
  4586. }
  4587. /// <summary>
  4588. /// 工号质量统计表
  4589. /// </summary>
  4590. /// <param name="accountCode"></param>
  4591. /// <param name="userCode"></param>
  4592. /// <param name="userPassword"></param>
  4593. /// <param name="sessionKey"></param>
  4594. /// <param name="se"></param>
  4595. /// <returns></returns>
  4596. public ActionResult GetPDARPT000002Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4597. int rptSProcedureID, string workcode, string datebegin, string dateend)
  4598. {
  4599. ActionResult actionResult = new ActionResult();
  4600. try
  4601. {
  4602. // 验证请求头信息
  4603. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4604. // 验证失败
  4605. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4606. {
  4607. return actionResult;
  4608. }
  4609. DateTime datetimebegin = Convert.ToDateTime(datebegin);
  4610. DateTime datetimeend = Convert.ToDateTime(dateend);
  4611. datetimebegin = datetimebegin.Date;
  4612. datetimeend = datetimeend.Date.AddDays(1).AddSeconds(-1);
  4613. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4614. () => PDAModuleLogic.GetPDARPT000002Data(sUserInfo, rptSProcedureID, workcode, datetimebegin, datetimeend));
  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 GetPDARPT000003Data(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.GetPDARPT000003Data(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. #endregion
  4692. /// <summary>
  4693. /// 取得报表数据源数据
  4694. /// </summary>
  4695. /// <param name="accountCode"></param>
  4696. /// <param name="userCode"></param>
  4697. /// <param name="userPassword"></param>
  4698. /// <param name="sessionKey"></param>
  4699. /// <returns></returns>
  4700. public ActionResult GetRptProcedureModule(string accountCode, string userCode, string userPassword, string sessionKey)
  4701. {
  4702. ActionResult actionResult = new ActionResult();
  4703. try
  4704. {
  4705. // 验证请求头信息
  4706. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4707. // 验证失败
  4708. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4709. {
  4710. return actionResult;
  4711. }
  4712. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4713. () => ReportModuleLogic.GetRptProcedureModule(sUserInfo));
  4714. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4715. {
  4716. actionResult.Status = (int)Constant.PDAResult.Fail;
  4717. actionResult.Message = Messages.MSG_CMN_I002;
  4718. }
  4719. else
  4720. {
  4721. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4722. actionResult.Status = (int)Constant.PDAResult.Success;
  4723. }
  4724. }
  4725. catch (Exception ex)
  4726. {
  4727. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4728. OutputLog.TraceLog(LogPriority.Error,
  4729. this.ToString(),
  4730. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4731. ex.ToString(),
  4732. LocalPath.LogExePath);
  4733. actionResult.Status = (int)Constant.PDAResult.Exception;
  4734. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4735. }
  4736. return actionResult;
  4737. }
  4738. /// <summary>
  4739. /// 取得报表的查询数据源统计工序数据
  4740. /// </summary>
  4741. /// <param name="accountCode"></param>
  4742. /// <param name="userCode"></param>
  4743. /// <param name="userPassword"></param>
  4744. /// <param name="sessionKey"></param>
  4745. /// <param name="RptProcedureID"></param>
  4746. /// <returns></returns>
  4747. public ActionResult GetRptSourceProcedureModule(string accountCode, string userCode, string userPassword, string sessionKey, int? RptProcedureID)
  4748. {
  4749. ActionResult actionResult = new ActionResult();
  4750. try
  4751. {
  4752. // 验证请求头信息
  4753. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4754. // 验证失败
  4755. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4756. {
  4757. return actionResult;
  4758. }
  4759. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4760. () => ReportModuleLogic.GetRptSourceProcedureModule(sUserInfo, RptProcedureID));
  4761. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4762. {
  4763. actionResult.Status = (int)Constant.PDAResult.Fail;
  4764. actionResult.Message = Messages.MSG_CMN_I002;
  4765. }
  4766. else
  4767. {
  4768. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4769. actionResult.Status = (int)Constant.PDAResult.Success;
  4770. }
  4771. }
  4772. catch (Exception ex)
  4773. {
  4774. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4775. OutputLog.TraceLog(LogPriority.Error,
  4776. this.ToString(),
  4777. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4778. ex.ToString(),
  4779. LocalPath.LogExePath);
  4780. actionResult.Status = (int)Constant.PDAResult.Exception;
  4781. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4782. }
  4783. return actionResult;
  4784. }
  4785. /// <summary>
  4786. /// 获取用户是否有统计产成品权限
  4787. /// </summary>
  4788. /// <param name="accountCode"></param>
  4789. /// <param name="userCode"></param>
  4790. /// <param name="userPassword"></param>
  4791. /// <param name="sessionKey"></param>
  4792. /// <returns></returns>
  4793. public ActionResult GetStatisticsFinishedProductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  4794. {
  4795. ActionResult actionResult = new ActionResult();
  4796. try
  4797. {
  4798. // 验证请求头信息
  4799. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4800. // 验证失败
  4801. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4802. {
  4803. return actionResult;
  4804. }
  4805. int returnValue = ServiceInvoker.Invoke<int>(this,
  4806. () => PDAModuleLogic.GetStatisticsFinishedProductFuntion(sUserInfo));
  4807. actionResult.Result = JsonHelper.ToJson(returnValue);
  4808. actionResult.Status = (int)Constant.PDAResult.Success;
  4809. }
  4810. catch (Exception ex)
  4811. {
  4812. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4813. OutputLog.TraceLog(LogPriority.Error,
  4814. this.ToString(),
  4815. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4816. ex.ToString(),
  4817. LocalPath.LogExePath);
  4818. actionResult.Status = (int)Constant.PDAResult.Exception;
  4819. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4820. }
  4821. return actionResult;
  4822. }
  4823. /// <summary>
  4824. /// 获取用户是否有盘点权限
  4825. /// </summary>
  4826. /// <param name="accountCode"></param>
  4827. /// <param name="userCode"></param>
  4828. /// <param name="userPassword"></param>
  4829. /// <param name="sessionKey"></param>
  4830. /// <returns></returns>
  4831. public ActionResult GetInCheckedFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  4832. {
  4833. ActionResult actionResult = new ActionResult();
  4834. try
  4835. {
  4836. // 验证请求头信息
  4837. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4838. // 验证失败
  4839. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4840. {
  4841. return actionResult;
  4842. }
  4843. int returnValue = ServiceInvoker.Invoke<int>(this,
  4844. () => PDAModuleLogic.GetInCheckedFuntion(sUserInfo));
  4845. actionResult.Result = JsonHelper.ToJson(returnValue);
  4846. actionResult.Status = (int)Constant.PDAResult.Success;
  4847. }
  4848. catch (Exception ex)
  4849. {
  4850. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4851. OutputLog.TraceLog(LogPriority.Error,
  4852. this.ToString(),
  4853. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4854. ex.ToString(),
  4855. LocalPath.LogExePath);
  4856. actionResult.Status = (int)Constant.PDAResult.Exception;
  4857. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4858. }
  4859. return actionResult;
  4860. }
  4861. /// <summary>
  4862. /// 根据条件查询是否存在班次配置
  4863. /// </summary>
  4864. /// <param name="accountCode"></param>
  4865. /// <param name="userCode"></param>
  4866. /// <param name="userPassword"></param>
  4867. /// <param name="sessionKey"></param>
  4868. /// <param name="userCode">工号编码</param>
  4869. /// <returns></returns>
  4870. public ActionResult GetClassesSetting(string accountCode, string userCode, string userPassword, string sessionKey, string uCode)
  4871. {
  4872. ActionResult actionResult = new ActionResult();
  4873. try
  4874. {
  4875. // 验证请求头信息
  4876. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4877. // 验证失败
  4878. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4879. {
  4880. return actionResult;
  4881. }
  4882. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4883. () => PDAModuleLogic.GetClassesSetting(uCode, sUserInfo));
  4884. actionResult.Result = JsonHelper.ToJson(ds);
  4885. actionResult.Status = (int)Constant.PDAResult.Success;
  4886. }
  4887. catch (Exception ex)
  4888. {
  4889. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4890. OutputLog.TraceLog(LogPriority.Error,
  4891. this.ToString(),
  4892. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4893. ex.ToString(),
  4894. LocalPath.LogExePath);
  4895. actionResult.Status = (int)Constant.PDAResult.Exception;
  4896. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4897. }
  4898. return actionResult;
  4899. }
  4900. /// <summary>
  4901. /// 报损工序查出工号根据生产数据ID
  4902. /// </summary>
  4903. /// <param name="accountCode"></param>
  4904. /// <param name="userCode"></param>
  4905. /// <param name="userPassword"></param>
  4906. /// <param name="sessionKey"></param>
  4907. /// <param name="ProductionDataID">生产数据ID</param>
  4908. /// <returns></returns>
  4909. public ActionResult GetScrapProductUserCodeByProductionDataID(string accountCode, string userCode, string userPassword, string sessionKey, int ProductionDataID)
  4910. {
  4911. ActionResult actionResult = new ActionResult();
  4912. try
  4913. {
  4914. // 验证请求头信息
  4915. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4916. // 验证失败
  4917. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4918. {
  4919. return actionResult;
  4920. }
  4921. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  4922. () => PMModuleLogic.GetScrapProductUserCodeByProductionDataID(ProductionDataID));
  4923. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  4924. {
  4925. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  4926. actionResult.Status = (int)Constant.PDAResult.Success;
  4927. }
  4928. else
  4929. {
  4930. actionResult.Status = (int)Constant.PDAResult.Fail;
  4931. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  4932. }
  4933. }
  4934. catch (Exception ex)
  4935. {
  4936. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4937. OutputLog.TraceLog(LogPriority.Error,
  4938. this.ToString(),
  4939. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4940. ex.ToString(),
  4941. LocalPath.LogExePath);
  4942. actionResult.Status = (int)Constant.PDAResult.Exception;
  4943. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4944. }
  4945. return actionResult;
  4946. }
  4947. /// <summary>
  4948. /// 在入窑工序检验窑车号是否存在
  4949. /// </summary>
  4950. /// <param name="accountCode"></param>
  4951. /// <param name="userCode"></param>
  4952. /// <param name="userPassword"></param>
  4953. /// <param name="sessionKey"></param>
  4954. /// <param name="kilncarcode">窑车编码</param>
  4955. /// <param name="procedureid">工序ID</param>
  4956. /// <returns></returns>
  4957. public ActionResult CheckKilnCarByIntoCar2(string accountCode, string userCode, string userPassword, string sessionKey, string kilncarcode, int procedureid)
  4958. {
  4959. ActionResult actionResult = new ActionResult();
  4960. try
  4961. {
  4962. // 验证请求头信息
  4963. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4964. // 验证失败
  4965. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4966. {
  4967. return actionResult;
  4968. }
  4969. int returnValue = ServiceInvoker.Invoke<int>(this,
  4970. () => PMModuleLogicDAL.CheckKilnCarByIntoCar2(kilncarcode, procedureid, sUserInfo));
  4971. if (returnValue == 1)
  4972. {
  4973. actionResult.Result = JsonHelper.ToJson(returnValue);
  4974. actionResult.Status = (int)Constant.PDAResult.Success;
  4975. }
  4976. else
  4977. {
  4978. actionResult.Status = (int)Constant.PDAResult.Fail;
  4979. if (returnValue == -99)
  4980. actionResult.Message = "窑炉车号无效";
  4981. else if (returnValue == -98)
  4982. actionResult.Message = "窑车己无产品";
  4983. else if (returnValue == -97)
  4984. actionResult.Message = "窑车没有入窑,不可以撤销";
  4985. else if (returnValue == -1)
  4986. actionResult.Message = "保存失败";
  4987. }
  4988. }
  4989. catch (Exception ex)
  4990. {
  4991. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4992. OutputLog.TraceLog(LogPriority.Error,
  4993. this.ToString(),
  4994. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4995. ex.ToString(),
  4996. LocalPath.LogExePath);
  4997. actionResult.Status = (int)Constant.PDAResult.Exception;
  4998. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4999. }
  5000. return actionResult;
  5001. }
  5002. /// <summary>
  5003. /// 撤销包装
  5004. /// </summary>
  5005. /// <param name="accountCode"></param>
  5006. /// <param name="userCode"></param>
  5007. /// <param name="userPassword"></param>
  5008. /// <param name="sessionKey"></param>
  5009. /// <param name="barcode"></param>
  5010. /// <returns></returns>
  5011. public ActionResult AddChancelFinishedproduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5012. {
  5013. ActionResult actionResult = new ActionResult();
  5014. try
  5015. {
  5016. // 验证请求头信息
  5017. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5018. // 验证失败
  5019. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5020. {
  5021. return actionResult;
  5022. }
  5023. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5024. () => PMModuleLogicDAL.AddChancelFinishedproduct(barcode, sUserInfo));
  5025. if (Convert.ToInt32(returnValue.Result) > 0)
  5026. {
  5027. actionResult.Result = JsonHelper.ToJson(returnValue);
  5028. actionResult.Status = (int)Constant.PDAResult.Success;
  5029. }
  5030. else
  5031. {
  5032. actionResult.Status = (int)Constant.PDAResult.Fail;
  5033. if (Convert.ToInt32(returnValue.Result) == -1)
  5034. actionResult.Message = "产品条码不存在包装记录";
  5035. else if (Convert.ToInt32(returnValue.Result) == -200)
  5036. actionResult.Message = returnValue.Message;
  5037. else
  5038. actionResult.Message = "成品撤销失败";
  5039. }
  5040. }
  5041. catch (Exception ex)
  5042. {
  5043. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5044. OutputLog.TraceLog(LogPriority.Error,
  5045. this.ToString(),
  5046. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5047. ex.ToString(),
  5048. LocalPath.LogExePath);
  5049. actionResult.Status = (int)Constant.PDAResult.Exception;
  5050. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5051. }
  5052. return actionResult;
  5053. }
  5054. /*
  5055. /// <summary>
  5056. /// 获取用户是否有撤销包装权限
  5057. /// </summary>
  5058. /// <param name="accountCode"></param>
  5059. /// <param name="userCode"></param>
  5060. /// <param name="userPassword"></param>
  5061. /// <param name="sessionKey"></param>
  5062. /// <returns></returns>
  5063. public ActionResult GetChancelFinishedproductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5064. {
  5065. ActionResult actionResult = new ActionResult();
  5066. try
  5067. {
  5068. // 验证请求头信息
  5069. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5070. // 验证失败
  5071. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5072. {
  5073. return actionResult;
  5074. }
  5075. int returnValue = ServiceInvoker.Invoke<int>(this,
  5076. () => PDAModuleLogic.GetChancelFinishedproductFuntion(sUserInfo));
  5077. actionResult.Result = JsonHelper.ToJson(returnValue);
  5078. actionResult.Status = (int)Constant.PDAResult.Success;
  5079. }
  5080. catch (Exception ex)
  5081. {
  5082. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5083. OutputLog.TraceLog(LogPriority.Error,
  5084. this.ToString(),
  5085. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5086. ex.ToString(),
  5087. LocalPath.LogExePath);
  5088. actionResult.Status = (int)Constant.PDAResult.Exception;
  5089. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5090. }
  5091. return actionResult;
  5092. }
  5093. */
  5094. /// <summary>
  5095. /// 窑车状态明细表查询
  5096. /// </summary>
  5097. /// <param name="accountCode"></param>
  5098. /// <param name="userCode"></param>
  5099. /// <param name="userPassword"></param>
  5100. /// <param name="sessionKey"></param>
  5101. /// <param name="kilnCarCode"></param>
  5102. /// <returns></returns>
  5103. public ActionResult GetKilnCarStatusDetailByCode(string accountCode, string userCode, string userPassword, string sessionKey, string kilnCarCode)
  5104. {
  5105. ActionResult actionResult = new ActionResult();
  5106. try
  5107. {
  5108. // 验证请求头信息
  5109. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5110. // 验证失败
  5111. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5112. {
  5113. return actionResult;
  5114. }
  5115. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5116. () => ReportModuleLogic.GetKilnCarStatusDetailByCode(kilnCarCode, sUserInfo));
  5117. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  5118. {
  5119. actionResult.Status = (int)Constant.PDAResult.Fail;
  5120. actionResult.Message = Messages.MSG_CMN_I002;
  5121. }
  5122. else
  5123. {
  5124. actionResult.Result = JsonHelper.ToJson(sre.Data);
  5125. actionResult.Status = (int)Constant.PDAResult.Success;
  5126. }
  5127. }
  5128. catch (Exception ex)
  5129. {
  5130. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5131. OutputLog.TraceLog(LogPriority.Error,
  5132. this.ToString(),
  5133. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5134. ex.ToString(),
  5135. LocalPath.LogExePath);
  5136. actionResult.Status = (int)Constant.PDAResult.Exception;
  5137. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5138. }
  5139. return actionResult;
  5140. }
  5141. /// <summary>
  5142. /// 损坯撤销
  5143. /// </summary>
  5144. /// <param name="accountCode"></param>
  5145. /// <param name="userCode"></param>
  5146. /// <param name="userPassword"></param>
  5147. /// <param name="sessionKey"></param>
  5148. /// <param name="barcode"></param>
  5149. /// <returns></returns>
  5150. public ActionResult AddCancelScrapProduction(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5151. {
  5152. ActionResult actionResult = new ActionResult();
  5153. try
  5154. {
  5155. // 验证请求头信息
  5156. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5157. // 验证失败
  5158. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5159. {
  5160. return actionResult;
  5161. }
  5162. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5163. () => PMModuleLogicDAL.AddCancelScrapProduction(barcode, sUserInfo));
  5164. if (Convert.ToInt32(returnValue.Result) > 0)
  5165. {
  5166. actionResult.Result = JsonHelper.ToJson(returnValue);
  5167. actionResult.Status = (int)Constant.PDAResult.Success;
  5168. }
  5169. else
  5170. {
  5171. actionResult.Status = (int)Constant.PDAResult.Fail;
  5172. if (Convert.ToInt32(returnValue.Result) == -1)
  5173. actionResult.Message = "此产品没有损坯,不能撤销";
  5174. else if (Convert.ToInt32(returnValue.Result) == -200)
  5175. actionResult.Message = returnValue.Message;
  5176. else
  5177. actionResult.Message = "损坯撤销失败";
  5178. }
  5179. }
  5180. catch (Exception ex)
  5181. {
  5182. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5183. OutputLog.TraceLog(LogPriority.Error,
  5184. this.ToString(),
  5185. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5186. ex.ToString(),
  5187. LocalPath.LogExePath);
  5188. actionResult.Status = (int)Constant.PDAResult.Exception;
  5189. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5190. }
  5191. return actionResult;
  5192. }
  5193. /*
  5194. /// <summary>
  5195. /// 获取用户是否有损坯撤销权限
  5196. /// </summary>
  5197. /// <param name="accountCode"></param>
  5198. /// <param name="userCode"></param>
  5199. /// <param name="userPassword"></param>
  5200. /// <param name="sessionKey"></param>
  5201. /// <returns></returns>
  5202. public ActionResult GetCancelScrapProductionFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5203. {
  5204. ActionResult actionResult = new ActionResult();
  5205. try
  5206. {
  5207. // 验证请求头信息
  5208. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5209. // 验证失败
  5210. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5211. {
  5212. return actionResult;
  5213. }
  5214. int returnValue = ServiceInvoker.Invoke<int>(this,
  5215. () => PDAModuleLogic.GetCancelScrapProductionFuntion(sUserInfo));
  5216. actionResult.Result = JsonHelper.ToJson(returnValue);
  5217. actionResult.Status = (int)Constant.PDAResult.Success;
  5218. }
  5219. catch (Exception ex)
  5220. {
  5221. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5222. OutputLog.TraceLog(LogPriority.Error,
  5223. this.ToString(),
  5224. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5225. ex.ToString(),
  5226. LocalPath.LogExePath);
  5227. actionResult.Status = (int)Constant.PDAResult.Exception;
  5228. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5229. }
  5230. return actionResult;
  5231. }
  5232. */
  5233. /// <summary>
  5234. /// 获取条码注浆信息
  5235. /// </summary>
  5236. /// <param name="accountCode"></param>
  5237. /// <param name="userCode"></param>
  5238. /// <param name="userPassword"></param>
  5239. /// <param name="sessionKey"></param>
  5240. /// <returns></returns>
  5241. public ActionResult GetGroutingInfoBybarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5242. {
  5243. ActionResult actionResult = new ActionResult();
  5244. try
  5245. {
  5246. // 验证请求头信息
  5247. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5248. // 验证失败
  5249. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5250. {
  5251. return actionResult;
  5252. }
  5253. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  5254. () => PMModuleLogic.GetGroutingInfoBybarcode(barcode, sUserInfo));
  5255. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  5256. {
  5257. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  5258. actionResult.Status = (int)Constant.PDAResult.Success;
  5259. }
  5260. else
  5261. {
  5262. actionResult.Status = (int)Constant.PDAResult.Fail;
  5263. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5264. }
  5265. }
  5266. catch (Exception ex)
  5267. {
  5268. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5269. OutputLog.TraceLog(LogPriority.Error,
  5270. this.ToString(),
  5271. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5272. ex.ToString(),
  5273. LocalPath.LogExePath);
  5274. actionResult.Status = (int)Constant.PDAResult.Exception;
  5275. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5276. }
  5277. return actionResult;
  5278. }
  5279. /// <summary>
  5280. /// 获取条码注浆信息
  5281. /// </summary>
  5282. /// <param name="accountCode"></param>
  5283. /// <param name="userCode"></param>
  5284. /// <param name="userPassword"></param>
  5285. /// <param name="sessionKey"></param>
  5286. /// <returns></returns>
  5287. public ActionResult GetFinishedProductGroutingInfoBybarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5288. {
  5289. ActionResult actionResult = new ActionResult();
  5290. try
  5291. {
  5292. // 验证请求头信息
  5293. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5294. // 验证失败
  5295. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5296. {
  5297. return actionResult;
  5298. }
  5299. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  5300. () => PMModuleLogic.GetFinishedProductGroutingInfoBybarcode(barcode, sUserInfo));
  5301. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  5302. {
  5303. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  5304. actionResult.Status = (int)Constant.PDAResult.Success;
  5305. }
  5306. else
  5307. {
  5308. actionResult.Status = (int)Constant.PDAResult.Fail;
  5309. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5310. }
  5311. }
  5312. catch (Exception ex)
  5313. {
  5314. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5315. OutputLog.TraceLog(LogPriority.Error,
  5316. this.ToString(),
  5317. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5318. ex.ToString(),
  5319. LocalPath.LogExePath);
  5320. actionResult.Status = (int)Constant.PDAResult.Exception;
  5321. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5322. }
  5323. return actionResult;
  5324. }
  5325. /// <summary>
  5326. /// 公坯设定
  5327. /// </summary>
  5328. /// <param name="accountCode"></param>
  5329. /// <param name="userCode"></param>
  5330. /// <param name="userPassword"></param>
  5331. /// <param name="sessionKey"></param>
  5332. /// <param name="barcode"></param>
  5333. /// <returns></returns>
  5334. public ActionResult AddPublicBodyProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5335. {
  5336. ActionResult actionResult = new ActionResult();
  5337. try
  5338. {
  5339. // 验证请求头信息
  5340. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5341. // 验证失败
  5342. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5343. {
  5344. return actionResult;
  5345. }
  5346. int returnValue = ServiceInvoker.Invoke<int>(this,
  5347. () => PMModuleLogicDAL.AddPublicBodyProduct(barcode, sUserInfo));
  5348. if (returnValue > 0)
  5349. {
  5350. actionResult.Result = JsonHelper.ToJson(returnValue);
  5351. actionResult.Status = (int)Constant.PDAResult.Success;
  5352. }
  5353. else
  5354. {
  5355. actionResult.Status = (int)Constant.PDAResult.Fail;
  5356. if (returnValue == -1)
  5357. actionResult.Message = "此产品不在生产线上";
  5358. else if (returnValue == -2)
  5359. actionResult.Message = "该产品已经标识为公坯";
  5360. else
  5361. actionResult.Message = "公坯设定失败";
  5362. }
  5363. }
  5364. catch (Exception ex)
  5365. {
  5366. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5367. OutputLog.TraceLog(LogPriority.Error,
  5368. this.ToString(),
  5369. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5370. ex.ToString(),
  5371. LocalPath.LogExePath);
  5372. actionResult.Status = (int)Constant.PDAResult.Exception;
  5373. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5374. }
  5375. return actionResult;
  5376. }
  5377. /*
  5378. /// <summary>
  5379. /// 获取用户是否有公坯设定
  5380. /// </summary>
  5381. /// <param name="accountCode"></param>
  5382. /// <param name="userCode"></param>
  5383. /// <param name="userPassword"></param>
  5384. /// <param name="sessionKey"></param>
  5385. /// <returns></returns>
  5386. public ActionResult GetPublicBodyProductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5387. {
  5388. ActionResult actionResult = new ActionResult();
  5389. try
  5390. {
  5391. // 验证请求头信息
  5392. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5393. // 验证失败
  5394. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5395. {
  5396. return actionResult;
  5397. }
  5398. int returnValue = ServiceInvoker.Invoke<int>(this,
  5399. () => PDAModuleLogic.GetPublicBodyProductFuntion(sUserInfo));
  5400. actionResult.Result = JsonHelper.ToJson(returnValue);
  5401. actionResult.Status = (int)Constant.PDAResult.Success;
  5402. }
  5403. catch (Exception ex)
  5404. {
  5405. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5406. OutputLog.TraceLog(LogPriority.Error,
  5407. this.ToString(),
  5408. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5409. ex.ToString(),
  5410. LocalPath.LogExePath);
  5411. actionResult.Status = (int)Constant.PDAResult.Exception;
  5412. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5413. }
  5414. return actionResult;
  5415. }
  5416. */
  5417. /// <summary>
  5418. /// 校验产品条码是否可以走到该工序
  5419. /// </summary>
  5420. /// <param name="accountCode">帐套code</param>
  5421. /// <param name="userCode">用户code</param>
  5422. /// <param name="userPassword">用户密码</param>
  5423. /// <param name="sessionKey">本次登陆密钥</param>
  5424. /// <param name="procedureID">工序ID</param>
  5425. /// <param name="barcode">条码</param>
  5426. /// <returns></returns>
  5427. /// <remarks>
  5428. /// 陈冰 2014.09.18 新建
  5429. /// </remarks>
  5430. public ActionResult CheckBarcodeDeliverMud(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  5431. {
  5432. ActionResult actionResult = new ActionResult();
  5433. try
  5434. {
  5435. // 验证请求头信息
  5436. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5437. // 验证失败
  5438. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5439. {
  5440. return actionResult;
  5441. }
  5442. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  5443. () => PMModuleLogic.CheckBarcodeDeliverMud(procedureID, barcode, sUserInfo));
  5444. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  5445. {
  5446. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  5447. actionResult.Status = (int)Constant.PDAResult.Success;
  5448. }
  5449. else
  5450. {
  5451. actionResult.Status = (int)Constant.PDAResult.Fail;
  5452. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5453. }
  5454. }
  5455. catch (Exception ex)
  5456. {
  5457. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5458. OutputLog.TraceLog(LogPriority.Error,
  5459. this.ToString(),
  5460. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5461. ex.ToString(),
  5462. LocalPath.LogExePath);
  5463. actionResult.Status = (int)Constant.PDAResult.Exception;
  5464. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5465. }
  5466. return actionResult;
  5467. }
  5468. /// <summary>
  5469. /// 获取用户所有菜单权限
  5470. /// </summary>
  5471. /// <param name="accountCode"></param>
  5472. /// <param name="userCode"></param>
  5473. /// <param name="userPassword"></param>
  5474. /// <param name="sessionKey"></param>
  5475. /// <returns></returns>
  5476. public ActionResult GetUserAllFunction(string accountCode, string userCode, string userPassword, string sessionKey)
  5477. {
  5478. ActionResult actionResult = new ActionResult();
  5479. try
  5480. {
  5481. // 验证请求头信息
  5482. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5483. // 验证失败
  5484. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5485. {
  5486. return actionResult;
  5487. }
  5488. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  5489. () => PDAModuleLogic.GetUserAllFunction(sUserInfo));
  5490. actionResult.Result = JsonHelper.ToJson(returnValue);
  5491. actionResult.Status = (int)Constant.PDAResult.Success;
  5492. }
  5493. catch (Exception ex)
  5494. {
  5495. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5496. OutputLog.TraceLog(LogPriority.Error,
  5497. this.ToString(),
  5498. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5499. ex.ToString(),
  5500. LocalPath.LogExePath);
  5501. actionResult.Status = (int)Constant.PDAResult.Exception;
  5502. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5503. }
  5504. return actionResult;
  5505. }
  5506. public ActionResult AddChancelBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5507. {
  5508. ActionResult actionResult = new ActionResult();
  5509. try
  5510. {
  5511. // 验证请求头信息
  5512. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5513. // 验证失败
  5514. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5515. {
  5516. return actionResult;
  5517. }
  5518. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5519. () => PMModuleLogicDAL.AddChancelBarCode(barcode, sUserInfo));
  5520. if (Convert.ToInt32(returnValue.Result) > 0)
  5521. {
  5522. actionResult.Result = JsonHelper.ToJson(returnValue);
  5523. actionResult.Status = (int)Constant.PDAResult.Success;
  5524. }
  5525. else
  5526. {
  5527. actionResult.Status = (int)Constant.PDAResult.Fail;
  5528. if (Convert.ToInt32(returnValue.Result) == -1)
  5529. actionResult.Message = "无效条码";
  5530. else if (Convert.ToInt32(returnValue.Result) == -2)
  5531. actionResult.Message = "已经生产完成";
  5532. else if (Convert.ToInt32(returnValue.Result) == -3)
  5533. actionResult.Message = "条码已经申请报废";
  5534. else if (Convert.ToInt32(returnValue.Result) == -4)
  5535. actionResult.Message = "此条码当前工序不允许进行撤销";
  5536. else if (Convert.ToInt32(returnValue.Result) == -5)
  5537. actionResult.Message = "此条码没有生产数据";
  5538. else if (Convert.ToInt32(returnValue.Result) == -6)
  5539. actionResult.Message = "没有当前工序权限";
  5540. else if (Convert.ToInt32(returnValue.Result) == -7)
  5541. actionResult.Message = "条码不在生产线上";
  5542. else if (Convert.ToInt32(returnValue.Result) == -8)
  5543. actionResult.Message = "操作用户无此工序的撤销范围权限";
  5544. else if (Convert.ToInt32(returnValue.Result) == -9)
  5545. actionResult.Message = "条码已经是返工状态";
  5546. else if (Convert.ToInt32(returnValue.Result) == -200)
  5547. actionResult.Message = returnValue.Message;
  5548. }
  5549. }
  5550. catch (Exception ex)
  5551. {
  5552. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5553. OutputLog.TraceLog(LogPriority.Error,
  5554. this.ToString(),
  5555. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5556. ex.ToString(),
  5557. LocalPath.LogExePath);
  5558. actionResult.Status = (int)Constant.PDAResult.Exception;
  5559. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5560. }
  5561. return actionResult;
  5562. }
  5563. public ActionResult AddChancelDeliverMudBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5564. {
  5565. ActionResult actionResult = new ActionResult();
  5566. try
  5567. {
  5568. // 验证请求头信息
  5569. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5570. // 验证失败
  5571. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5572. {
  5573. return actionResult;
  5574. }
  5575. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5576. () => PMModuleLogicDAL.AddChancelDeliverMudBarCode(barcode, sUserInfo));
  5577. if (Convert.ToInt32(returnValue.Result) > 0)
  5578. {
  5579. actionResult.Result = JsonHelper.ToJson(returnValue);
  5580. actionResult.Status = (int)Constant.PDAResult.Success;
  5581. }
  5582. else
  5583. {
  5584. actionResult.Status = (int)Constant.PDAResult.Fail;
  5585. if (Convert.ToInt32(returnValue.Result) == -1)
  5586. actionResult.Message = "无效条码";
  5587. else if (Convert.ToInt32(returnValue.Result) == -2)
  5588. actionResult.Message = "已经生产完成";
  5589. else if (Convert.ToInt32(returnValue.Result) == -3)
  5590. actionResult.Message = "条码已经申请报废";
  5591. else if (Convert.ToInt32(returnValue.Result) == -4)
  5592. actionResult.Message = "此条码当前工序不允许进行撤销";
  5593. else if (Convert.ToInt32(returnValue.Result) == -5)
  5594. actionResult.Message = "此条码没有生产数据";
  5595. else if (Convert.ToInt32(returnValue.Result) == -55)
  5596. actionResult.Message = "条码已经不在交坯工序,不允许撤销";
  5597. else if (Convert.ToInt32(returnValue.Result) == -6)
  5598. actionResult.Message = "没有任何影响行";
  5599. else if (Convert.ToInt32(returnValue.Result) == -7)
  5600. actionResult.Message = "条码不在生产线上";
  5601. else if (Convert.ToInt32(returnValue.Result) == -8)
  5602. actionResult.Message = "条码已经是返工状态";
  5603. else if (Convert.ToInt32(returnValue.Result) == -200)
  5604. actionResult.Message = returnValue.Message;
  5605. }
  5606. }
  5607. catch (Exception ex)
  5608. {
  5609. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5610. OutputLog.TraceLog(LogPriority.Error,
  5611. this.ToString(),
  5612. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5613. ex.ToString(),
  5614. LocalPath.LogExePath);
  5615. actionResult.Status = (int)Constant.PDAResult.Exception;
  5616. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5617. }
  5618. return actionResult;
  5619. }
  5620. public ActionResult GetAllLogoInfo(string accountCode, string userCode, string userPassword, string sessionKey)
  5621. {
  5622. ActionResult actionResult = new ActionResult();
  5623. try
  5624. {
  5625. // 验证请求头信息
  5626. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5627. // 验证失败
  5628. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5629. {
  5630. return actionResult;
  5631. }
  5632. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  5633. //() => SystemModuleLogic.GetAllLogoInfo(sUserInfo));
  5634. () => SystemModuleLogic.GetLogoInfo(sUserInfo));
  5635. if (returnValue != null && returnValue.Tables[0].Rows.Count > 0)
  5636. {
  5637. //DataView dv = returnValue.Tables[0].DefaultView;
  5638. //dv.RowFilter = "ValueFlag=1";
  5639. //actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  5640. actionResult.Result = JsonHelper.ToJson(returnValue.Tables[0]);
  5641. actionResult.Status = (int)Constant.PDAResult.Success;
  5642. }
  5643. }
  5644. catch (Exception ex)
  5645. {
  5646. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5647. OutputLog.TraceLog(LogPriority.Error,
  5648. this.ToString(),
  5649. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5650. ex.ToString(),
  5651. LocalPath.LogExePath);
  5652. actionResult.Status = (int)Constant.PDAResult.Exception;
  5653. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5654. }
  5655. return actionResult;
  5656. }
  5657. public ActionResult GetLogoID(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  5658. {
  5659. ActionResult actionResult = new ActionResult();
  5660. try
  5661. {
  5662. // 验证请求头信息
  5663. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5664. // 验证失败
  5665. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5666. {
  5667. return actionResult;
  5668. }
  5669. int returnValue = ServiceInvoker.Invoke<int>(this,
  5670. () => PMModuleLogic.GetLogoID(procedureID, sUserInfo));
  5671. actionResult.Result = JsonHelper.ToJson(returnValue);
  5672. actionResult.Status = (int)Constant.PDAResult.Success;
  5673. }
  5674. catch (Exception ex)
  5675. {
  5676. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5677. OutputLog.TraceLog(LogPriority.Error,
  5678. this.ToString(),
  5679. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5680. ex.ToString(),
  5681. LocalPath.LogExePath);
  5682. actionResult.Status = (int)Constant.PDAResult.Exception;
  5683. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5684. }
  5685. return actionResult;
  5686. }
  5687. public ActionResult SaveBarCodeLogo(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int logoid)
  5688. {
  5689. ActionResult actionResult = new ActionResult();
  5690. try
  5691. {
  5692. // 验证请求头信息
  5693. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5694. // 验证失败
  5695. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5696. {
  5697. return actionResult;
  5698. }
  5699. int returnValue = ServiceInvoker.Invoke<int>(this,
  5700. () => PMModuleLogicDAL.SaveBarCodeLogo(barcode, logoid, sUserInfo));
  5701. actionResult.Result = JsonHelper.ToJson(returnValue);
  5702. actionResult.Status = (int)Constant.PDAResult.Success;
  5703. }
  5704. catch (Exception ex)
  5705. {
  5706. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5707. OutputLog.TraceLog(LogPriority.Error,
  5708. this.ToString(),
  5709. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5710. ex.ToString(),
  5711. LocalPath.LogExePath);
  5712. actionResult.Status = (int)Constant.PDAResult.Exception;
  5713. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5714. }
  5715. return actionResult;
  5716. }
  5717. public ActionResult SaveBarCodeLogoAndGlazetypeid(string accountCode, string userCode, string userPassword, string sessionKey,
  5718. string barcode, int logoid, int glazetypeid)
  5719. {
  5720. ActionResult actionResult = new ActionResult();
  5721. try
  5722. {
  5723. // 验证请求头信息
  5724. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5725. // 验证失败
  5726. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5727. {
  5728. return actionResult;
  5729. }
  5730. int returnValue = ServiceInvoker.Invoke<int>(this,
  5731. () => PMModuleLogicDAL.SaveBarCodeLogoAndGlazetypeid(barcode, logoid, glazetypeid, sUserInfo));
  5732. actionResult.Result = JsonHelper.ToJson(returnValue);
  5733. actionResult.Status = (int)Constant.PDAResult.Success;
  5734. }
  5735. catch (Exception ex)
  5736. {
  5737. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5738. OutputLog.TraceLog(LogPriority.Error,
  5739. this.ToString(),
  5740. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5741. ex.ToString(),
  5742. LocalPath.LogExePath);
  5743. actionResult.Status = (int)Constant.PDAResult.Exception;
  5744. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5745. }
  5746. return actionResult;
  5747. }
  5748. public ActionResult GetBarCodeLogoID(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5749. {
  5750. ActionResult actionResult = new ActionResult();
  5751. try
  5752. {
  5753. // 验证请求头信息
  5754. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5755. // 验证失败
  5756. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5757. {
  5758. return actionResult;
  5759. }
  5760. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  5761. () => PMModuleLogic.GetBarCodeLogoID(barcode, sUserInfo));
  5762. if (returnValue != null && returnValue.Tables[0].Rows.Count > 0)
  5763. {
  5764. actionResult.Result = JsonHelper.ToJson(returnValue.Tables[0]);
  5765. actionResult.Status = (int)Constant.PDAResult.Success;
  5766. }
  5767. }
  5768. catch (Exception ex)
  5769. {
  5770. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5771. OutputLog.TraceLog(LogPriority.Error,
  5772. this.ToString(),
  5773. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5774. ex.ToString(),
  5775. LocalPath.LogExePath);
  5776. actionResult.Status = (int)Constant.PDAResult.Exception;
  5777. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5778. }
  5779. return actionResult;
  5780. }
  5781. /// <summary>
  5782. /// 半检时,入窑前检验获取此条码是否报损为废品
  5783. /// </summary>
  5784. /// <param name="accountCode"></param>
  5785. /// <param name="userCode"></param>
  5786. /// <param name="userPassword"></param>
  5787. /// <param name="sessionKey"></param>
  5788. /// <param name="barcode">产品条码</param>
  5789. /// <returns></returns>
  5790. public ActionResult CheckWasteScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5791. {
  5792. ActionResult actionResult = new ActionResult();
  5793. try
  5794. {
  5795. // 验证请求头信息
  5796. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5797. // 验证失败
  5798. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5799. {
  5800. return actionResult;
  5801. }
  5802. int returnValue = ServiceInvoker.Invoke<int>(this,
  5803. () => PMModuleLogic.CheckWasteScrapProduct(barcode));
  5804. if (returnValue != -100)
  5805. {
  5806. actionResult.Result = JsonHelper.ToJson(returnValue);
  5807. actionResult.Status = (int)Constant.PDAResult.Success;
  5808. }
  5809. else
  5810. {
  5811. actionResult.Status = (int)Constant.PDAResult.Fail;
  5812. actionResult.Message = "条码[" + barcode + "]不是废品,不能进行编辑";
  5813. }
  5814. }
  5815. catch (Exception ex)
  5816. {
  5817. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5818. OutputLog.TraceLog(LogPriority.Error,
  5819. this.ToString(),
  5820. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5821. ex.ToString(),
  5822. LocalPath.LogExePath);
  5823. actionResult.Status = (int)Constant.PDAResult.Exception;
  5824. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5825. }
  5826. return actionResult;
  5827. }
  5828. /// <summary>
  5829. /// 获取登陆帐户有无入窑前检验数据编辑权限
  5830. /// </summary>
  5831. /// <param name="accountCode"></param>
  5832. /// <param name="userCode"></param>
  5833. /// <param name="userPassword"></param>
  5834. /// <param name="sessionKey"></param>
  5835. /// <param name="usercode">工号编码</param>
  5836. /// <returns></returns>
  5837. public ActionResult GetIntoKilnCheckEditFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5838. {
  5839. ActionResult actionResult = new ActionResult();
  5840. try
  5841. {
  5842. // 验证请求头信息
  5843. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5844. // 验证失败
  5845. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5846. {
  5847. return actionResult;
  5848. }
  5849. int returnValue = ServiceInvoker.Invoke<int>(this,
  5850. () => PDAModuleLogic.GetIntoKilnCheckEditFuntion(sUserInfo));
  5851. actionResult.Result = JsonHelper.ToJson(returnValue);
  5852. actionResult.Status = (int)Constant.PDAResult.Success;
  5853. }
  5854. catch (Exception ex)
  5855. {
  5856. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5857. OutputLog.TraceLog(LogPriority.Error,
  5858. this.ToString(),
  5859. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5860. ex.ToString(),
  5861. LocalPath.LogExePath);
  5862. actionResult.Status = (int)Constant.PDAResult.Exception;
  5863. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5864. }
  5865. return actionResult;
  5866. }
  5867. /// <summary>
  5868. /// 获取登陆帐户有无半检验数据编辑权限
  5869. /// </summary>
  5870. /// <param name="accountCode"></param>
  5871. /// <param name="userCode"></param>
  5872. /// <param name="userPassword"></param>
  5873. /// <param name="sessionKey"></param>
  5874. /// <param name="usercode">工号编码</param>
  5875. /// <returns></returns>
  5876. public ActionResult GetNormalCheckEditFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5877. {
  5878. ActionResult actionResult = new ActionResult();
  5879. try
  5880. {
  5881. // 验证请求头信息
  5882. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5883. // 验证失败
  5884. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5885. {
  5886. return actionResult;
  5887. }
  5888. int returnValue = ServiceInvoker.Invoke<int>(this,
  5889. () => PDAModuleLogic.GetNormalCheckEditFuntion(sUserInfo));
  5890. actionResult.Result = JsonHelper.ToJson(returnValue);
  5891. actionResult.Status = (int)Constant.PDAResult.Success;
  5892. }
  5893. catch (Exception ex)
  5894. {
  5895. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5896. OutputLog.TraceLog(LogPriority.Error,
  5897. this.ToString(),
  5898. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5899. ex.ToString(),
  5900. LocalPath.LogExePath);
  5901. actionResult.Status = (int)Constant.PDAResult.Exception;
  5902. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5903. }
  5904. return actionResult;
  5905. }
  5906. /// <summary>
  5907. /// 获取缺陷扣罚管理的全部数据
  5908. /// </summary>
  5909. /// <param name="accountCode"></param>
  5910. /// <param name="userCode"></param>
  5911. /// <param name="userPassword"></param>
  5912. /// <param name="sessionKey"></param>
  5913. /// <returns></returns>
  5914. public ActionResult GetAllDefectFine(string accountCode, string userCode, string userPassword, string sessionKey)
  5915. {
  5916. ActionResult actionResult = new ActionResult();
  5917. try
  5918. {
  5919. // 验证请求头信息
  5920. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5921. // 验证失败
  5922. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5923. {
  5924. return actionResult;
  5925. }
  5926. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  5927. () => SystemModuleLogic.GetAllDefectFine(sUserInfo));
  5928. if (ds != null && ds.Tables[0].Rows.Count > 0)
  5929. {
  5930. DataView dv = ds.Tables[0].DefaultView;
  5931. dv.RowFilter = "valueflag=1";
  5932. actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  5933. actionResult.Status = (int)Constant.PDAResult.Success;
  5934. }
  5935. else
  5936. {
  5937. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  5938. actionResult.Status = (int)Constant.PDAResult.Success;
  5939. }
  5940. }
  5941. catch (Exception ex)
  5942. {
  5943. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5944. OutputLog.TraceLog(LogPriority.Error,
  5945. this.ToString(),
  5946. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5947. ex.ToString(),
  5948. LocalPath.LogExePath);
  5949. actionResult.Status = (int)Constant.PDAResult.Exception;
  5950. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5951. }
  5952. return actionResult;
  5953. }
  5954. /// <summary>
  5955. /// 获取缺陷扣除数管理的全部数据
  5956. /// </summary>
  5957. /// <param name="accountCode"></param>
  5958. /// <param name="userCode"></param>
  5959. /// <param name="userPassword"></param>
  5960. /// <param name="sessionKey"></param>
  5961. /// <returns></returns>
  5962. public ActionResult GetAllDefectDeduction(string accountCode, string userCode, string userPassword, string sessionKey)
  5963. {
  5964. ActionResult actionResult = new ActionResult();
  5965. try
  5966. {
  5967. // 验证请求头信息
  5968. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5969. // 验证失败
  5970. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5971. {
  5972. return actionResult;
  5973. }
  5974. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  5975. () => SystemModuleLogic.GetAllDefectDeduction(sUserInfo));
  5976. if (ds != null && ds.Tables[0].Rows.Count > 0)
  5977. {
  5978. DataView dv = ds.Tables[0].DefaultView;
  5979. dv.RowFilter = "valueflag=1";
  5980. actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  5981. actionResult.Status = (int)Constant.PDAResult.Success;
  5982. }
  5983. else
  5984. {
  5985. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  5986. actionResult.Status = (int)Constant.PDAResult.Success;
  5987. }
  5988. }
  5989. catch (Exception ex)
  5990. {
  5991. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5992. OutputLog.TraceLog(LogPriority.Error,
  5993. this.ToString(),
  5994. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5995. ex.ToString(),
  5996. LocalPath.LogExePath);
  5997. actionResult.Status = (int)Constant.PDAResult.Exception;
  5998. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5999. }
  6000. return actionResult;
  6001. }
  6002. /// <summary>
  6003. /// 获取缺陷扣罚关系管理的全部数据
  6004. /// </summary>
  6005. /// <param name="accountCode"></param>
  6006. /// <param name="userCode"></param>
  6007. /// <param name="userPassword"></param>
  6008. /// <param name="sessionKey"></param>
  6009. /// <returns></returns>
  6010. public ActionResult GetAllDefectFineRelation(string accountCode, string userCode, string userPassword, string sessionKey)
  6011. {
  6012. ActionResult actionResult = new ActionResult();
  6013. try
  6014. {
  6015. // 验证请求头信息
  6016. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6017. // 验证失败
  6018. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6019. {
  6020. return actionResult;
  6021. }
  6022. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6023. () => SystemModuleLogic.GetAllDefectFineRelation(sUserInfo));
  6024. DataTable dt = new DataTable();
  6025. dt.Columns.Add("DefectID");
  6026. dt.Columns.Add("DefectFineID");
  6027. DataView dv = ds.Tables[0].DefaultView;
  6028. DataTable dtFor = dv.ToTable("defectid", true);
  6029. for (int i = 0; i < dtFor.Rows.Count; i++)
  6030. {
  6031. DataRow[] r = ds.Tables[0].Select("defectid=" + dtFor.Rows[i]["defectid"]);
  6032. string substring = "";
  6033. foreach (DataRow r1 in r)
  6034. {
  6035. substring += r1["DefectFineID"].ToString() + "-" + r1["DEFECTFINECODE"].ToString() + ",";
  6036. }
  6037. if (substring != "")
  6038. {
  6039. DataRow drnew = dt.NewRow();
  6040. drnew["DefectID"] = dtFor.Rows[i]["defectid"];
  6041. drnew["DefectFineID"] = substring.TrimEnd(',');
  6042. dt.Rows.Add(drnew);
  6043. }
  6044. }
  6045. actionResult.Result = JsonHelper.ToJson(dt);//ds.Tables[0]
  6046. actionResult.Status = (int)Constant.PDAResult.Success;
  6047. }
  6048. catch (Exception ex)
  6049. {
  6050. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6051. OutputLog.TraceLog(LogPriority.Error,
  6052. this.ToString(),
  6053. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6054. ex.ToString(),
  6055. LocalPath.LogExePath);
  6056. actionResult.Status = (int)Constant.PDAResult.Exception;
  6057. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6058. }
  6059. return actionResult;
  6060. }
  6061. /// <summary>
  6062. /// 获取缺陷扣除数关系管理的全部数据
  6063. /// </summary>
  6064. /// <param name="accountCode"></param>
  6065. /// <param name="userCode"></param>
  6066. /// <param name="userPassword"></param>
  6067. /// <param name="sessionKey"></param>
  6068. /// <returns></returns>
  6069. public ActionResult GetAllDefectDeductionRelation(string accountCode, string userCode, string userPassword, string sessionKey)
  6070. {
  6071. ActionResult actionResult = new ActionResult();
  6072. try
  6073. {
  6074. // 验证请求头信息
  6075. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6076. // 验证失败
  6077. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6078. {
  6079. return actionResult;
  6080. }
  6081. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6082. () => SystemModuleLogic.GetAllDefectDeductionRelation(sUserInfo));
  6083. DataTable dt = new DataTable();
  6084. dt.Columns.Add("DefectID");
  6085. dt.Columns.Add("DefectDeductionNum");
  6086. DataView dv = ds.Tables[0].DefaultView;
  6087. DataTable dtFor = dv.ToTable("defectid", true);
  6088. for (int i = 0; i < dtFor.Rows.Count; i++)
  6089. {
  6090. DataRow[] r = ds.Tables[0].Select("defectid=" + dtFor.Rows[i]["defectid"]);
  6091. string substring = "";
  6092. foreach (DataRow r1 in r)
  6093. {
  6094. substring += r1["DefectDeductionID"].ToString() + "-" + r1["DefectDeductionNum"].ToString() + ",";
  6095. }
  6096. if (substring != "")
  6097. {
  6098. DataRow drnew = dt.NewRow();
  6099. drnew["DefectID"] = dtFor.Rows[i]["defectid"];
  6100. drnew["DefectDeductionNum"] = substring.TrimEnd(',');
  6101. dt.Rows.Add(drnew);
  6102. }
  6103. }
  6104. actionResult.Result = JsonHelper.ToJson(dt);//ds.Tables[0]
  6105. actionResult.Status = (int)Constant.PDAResult.Success;
  6106. }
  6107. catch (Exception ex)
  6108. {
  6109. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6110. OutputLog.TraceLog(LogPriority.Error,
  6111. this.ToString(),
  6112. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6113. ex.ToString(),
  6114. LocalPath.LogExePath);
  6115. actionResult.Status = (int)Constant.PDAResult.Exception;
  6116. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6117. }
  6118. return actionResult;
  6119. }
  6120. /// <summary>
  6121. /// 获取盘点单明细
  6122. /// </summary>
  6123. /// <param name="sUserInfo"></param>
  6124. /// <returns></returns>
  6125. public ActionResult GetUpdateInCheckedInfo(string accountCode, string userCode, string userPassword, string sessionKey, string incheckedno)
  6126. {
  6127. ActionResult actionResult = new ActionResult();
  6128. try
  6129. {
  6130. // 验证请求头信息
  6131. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6132. // 验证失败
  6133. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6134. {
  6135. return actionResult;
  6136. }
  6137. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6138. () => PMModuleLogic.GetUpdateInCheckedInfo(incheckedno, sUserInfo));
  6139. actionResult.Result = JsonHelper.ToJson(ds);
  6140. actionResult.Status = (int)Constant.PDAResult.Success;
  6141. }
  6142. catch (Exception ex)
  6143. {
  6144. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6145. OutputLog.TraceLog(LogPriority.Error,
  6146. this.ToString(),
  6147. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6148. ex.ToString(),
  6149. LocalPath.LogExePath);
  6150. actionResult.Status = (int)Constant.PDAResult.Exception;
  6151. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6152. }
  6153. return actionResult;
  6154. }
  6155. /// <summary>
  6156. /// 半检检验条码
  6157. /// </summary>
  6158. /// <param name="sUserInfo"></param>
  6159. /// <returns></returns>
  6160. public ActionResult SemiCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6161. {
  6162. ActionResult actionResult = new ActionResult();
  6163. try
  6164. {
  6165. // 验证请求头信息
  6166. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6167. // 验证失败
  6168. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6169. {
  6170. return actionResult;
  6171. }
  6172. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6173. () => PMModuleLogic.SemiCheckBarcode(barcode, sUserInfo));
  6174. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6175. if (Convert.ToInt32(resultEntity.Result) < 0)
  6176. {
  6177. actionResult.Status = (int)Constant.PDAResult.Fail;
  6178. }
  6179. else
  6180. {
  6181. actionResult.Status = (int)Constant.PDAResult.Success;
  6182. }
  6183. actionResult.Message = resultEntity.Message;
  6184. }
  6185. catch (Exception ex)
  6186. {
  6187. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6188. OutputLog.TraceLog(LogPriority.Error,
  6189. this.ToString(),
  6190. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6191. ex.ToString(),
  6192. LocalPath.LogExePath);
  6193. actionResult.Status = (int)Constant.PDAResult.Exception;
  6194. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6195. }
  6196. return actionResult;
  6197. }
  6198. /// <summary>
  6199. /// 根据条码获取经过的工序,用于绑定返工工序
  6200. /// </summary>
  6201. /// <param name="sUserInfo"></param>
  6202. /// <returns></returns>
  6203. public ActionResult GetSemiCheckPassProcedure(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6204. {
  6205. ActionResult actionResult = new ActionResult();
  6206. try
  6207. {
  6208. // 验证请求头信息
  6209. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6210. // 验证失败
  6211. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6212. {
  6213. return actionResult;
  6214. }
  6215. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6216. () => PMModuleLogic.GetSemiCheckPassProcedure(barcode));
  6217. actionResult.Result = JsonHelper.ToJson(resultEntity);
  6218. actionResult.Status = (int)Constant.PDAResult.Success;
  6219. }
  6220. catch (Exception ex)
  6221. {
  6222. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6223. OutputLog.TraceLog(LogPriority.Error,
  6224. this.ToString(),
  6225. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6226. ex.ToString(),
  6227. LocalPath.LogExePath);
  6228. actionResult.Status = (int)Constant.PDAResult.Exception;
  6229. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6230. }
  6231. return actionResult;
  6232. }
  6233. /// <summary>
  6234. /// 获取登陆帐户有无半检状态权限
  6235. /// </summary>
  6236. /// <param name="sUserInfo"></param>
  6237. /// <returns></returns>
  6238. public ActionResult GetSemiCheckStatusFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  6239. {
  6240. ActionResult actionResult = new ActionResult();
  6241. try
  6242. {
  6243. // 验证请求头信息
  6244. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6245. // 验证失败
  6246. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6247. {
  6248. return actionResult;
  6249. }
  6250. int resultEntity = ServiceInvoker.Invoke<int>(this,
  6251. () => PMModuleLogic.GetSemiCheckStatusFuntion(sUserInfo));
  6252. actionResult.Result = JsonHelper.ToJson(resultEntity);
  6253. actionResult.Status = (int)Constant.PDAResult.Success;
  6254. }
  6255. catch (Exception ex)
  6256. {
  6257. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6258. OutputLog.TraceLog(LogPriority.Error,
  6259. this.ToString(),
  6260. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6261. ex.ToString(),
  6262. LocalPath.LogExePath);
  6263. actionResult.Status = (int)Constant.PDAResult.Exception;
  6264. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6265. }
  6266. return actionResult;
  6267. }
  6268. /// <summary>
  6269. /// 复检状态数据源
  6270. /// </summary>
  6271. /// <param name="sUserInfo"></param>
  6272. /// <returns></returns>
  6273. public ActionResult GetSemiCheckType(string accountCode, string userCode, string userPassword, string sessionKey)
  6274. {
  6275. ActionResult actionResult = new ActionResult();
  6276. try
  6277. {
  6278. // 验证请求头信息
  6279. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6280. // 验证失败
  6281. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6282. {
  6283. return actionResult;
  6284. }
  6285. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6286. () => SystemModuleLogic.GetSemiCheckType());
  6287. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6288. actionResult.Status = (int)Constant.PDAResult.Success;
  6289. }
  6290. catch (Exception ex)
  6291. {
  6292. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6293. OutputLog.TraceLog(LogPriority.Error,
  6294. this.ToString(),
  6295. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6296. ex.ToString(),
  6297. LocalPath.LogExePath);
  6298. actionResult.Status = (int)Constant.PDAResult.Exception;
  6299. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6300. }
  6301. return actionResult;
  6302. }
  6303. /// <summary>
  6304. /// 根据半成品检验数据ID,显示半成品数据信息
  6305. /// </summary>
  6306. /// <param name="sUserInfo"></param>
  6307. /// <returns></returns>
  6308. public ActionResult GetSemiCheckByID(string accountCode, string userCode, string userPassword, string sessionKey, int semiCheckID)
  6309. {
  6310. ActionResult actionResult = new ActionResult();
  6311. try
  6312. {
  6313. // 验证请求头信息
  6314. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6315. // 验证失败
  6316. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6317. {
  6318. return actionResult;
  6319. }
  6320. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  6321. () => PMModuleLogic.GetSemiCheckByID(semiCheckID));
  6322. SemiCheckEntity[] productionDatas = new SemiCheckEntity[1];
  6323. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  6324. {
  6325. if (reworkDs != null && reworkDs.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  6326. {
  6327. for (int i = 0; i < reworkDs.Tables[0].Rows.Count; i++)
  6328. {
  6329. SemiCheckEntity productionData = new SemiCheckEntity();
  6330. productionData.BarCode = reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
  6331. if (reworkDs.Tables[0].Rows[i]["GoodsID"].ToString() != "")
  6332. {
  6333. productionData.GoodsID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsID"].ToString());
  6334. }
  6335. productionData.SemiCheckID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["SemiCheckID"].ToString());
  6336. productionData.GoodsCode = reworkDs.Tables[0].Rows[i]["GoodsCode"].ToString();
  6337. productionData.GoodsName = reworkDs.Tables[0].Rows[i]["GoodsName"].ToString();
  6338. productionData.SemiCheckType = reworkDs.Tables[0].Rows[i]["SemiCheckType"].ToString();
  6339. productionData.ReFine = 0;
  6340. if (reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString() != "")
  6341. {
  6342. productionData.ReworkProcedureID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString());
  6343. }
  6344. productionData.ReSemiCheckType = reworkDs.Tables[0].Rows[i]["ReSemiCheckType"].ToString();
  6345. productionData.ReworkProcedureCode = reworkDs.Tables[0].Rows[i]["ReworkProcedureCode"].ToString();
  6346. productionData.ReworkProcedureName = reworkDs.Tables[0].Rows[i]["ReworkProcedureName"].ToString();
  6347. productionData.Remarks = reworkDs.Tables[0].Rows[i]["Remarks"].ToString();
  6348. if (reworkDs.Tables[0].Rows[i]["UserID"].ToString() != "")
  6349. {
  6350. productionData.SemiCheckUserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["UserID"].ToString());
  6351. productionData.SemiCheckUserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
  6352. }
  6353. if (reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString() != "")
  6354. {
  6355. productionData.GoodsLevelTypeID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString());
  6356. }
  6357. //productionData.UserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
  6358. //productionData.UserName = reworkDs.Tables[0].Rows[i]["UserName"].ToString();
  6359. productionData.SpecialRepairFlag = reworkDs.Tables[0].Rows[i]["SpecialRepairFlag"].ToString();
  6360. productionData.GroutingUserCode = reworkDs.Tables[0].Rows[i]["GroutingUserCode"].ToString();
  6361. productionData.GroutingNum = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GroutingNum"]);
  6362. productionData.IsPublicBody = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["IsPublicBody"]);
  6363. productionData.MouldCode = reworkDs.Tables[0].Rows[i]["MouldCode"].ToString();
  6364. productionData.GroutingDate = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["GroutingDate"]);
  6365. if (reworkDs.Tables[0].Rows[i]["ReworkUserID"].ToString() != "")
  6366. {
  6367. productionData.ReworkUserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkUserID"].ToString());
  6368. productionData.ReworkUserCode = reworkDs.Tables[0].Rows[i]["ReworkUserCode"].ToString();
  6369. }
  6370. productionData.ReSemiCheckUserCode = reworkDs.Tables[0].Rows[i]["ReSemiCheckUserCode"].ToString();
  6371. if (reworkDs.Tables[0].Rows[i]["logoid"].ToString() != "")
  6372. {
  6373. productionData.Logoid = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["Logoid"]);
  6374. productionData.LogoCode = reworkDs.Tables[0].Rows[i]["LogoCode"].ToString();
  6375. productionData.LogoName = reworkDs.Tables[0].Rows[i]["LogoName"].ToString();
  6376. }
  6377. productionData.SemiCheckTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["SemiCheckTime"]);
  6378. if (reworkDs.Tables[0].Rows[i]["ReSemiCheckTime"] != DBNull.Value)
  6379. {
  6380. productionData.ReSemiCheckDateTimeStart = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["ReSemiCheckTime"]);
  6381. }
  6382. DataView dvDefect = reworkDs.Tables[1].DefaultView;
  6383. dvDefect.RowFilter = "SemiCheckID=" + reworkDs.Tables[0].Rows[i]["SemiCheckID"].ToString();
  6384. DataTable dtDefect = dvDefect.ToTable();
  6385. for (int row = 0; row < dtDefect.Rows.Count; row++)
  6386. {
  6387. // 产品缺陷
  6388. SemiCheckDefectEntity defect = new SemiCheckDefectEntity();
  6389. //defect.SpecialDefect = dtDefect.Rows[row]["SpecialDefect"].ToString();
  6390. //defect.DefectDeductionNum = Convert.ToDecimal(dtDefect.Rows[row]["DefectDeductionNum"].ToString());
  6391. //if (dtDefect.Rows[row]["ProductionDefectID"].ToString() != "")
  6392. //{
  6393. // defect.ProductionDefectID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDefectID"].ToString());
  6394. //}
  6395. //defect.BarCode = dtDefect.Rows[row]["BarCode"].ToString();
  6396. if (dtDefect.Rows[row]["DefectID"].ToString() != "")
  6397. {
  6398. defect.DefectID = Convert.ToInt32(dtDefect.Rows[row]["DefectID"].ToString());
  6399. }
  6400. defect.DefectName = dtDefect.Rows[row]["DefectName"].ToString();
  6401. defect.DefectCode = dtDefect.Rows[row]["DefectCode"].ToString();
  6402. if (dtDefect.Rows[row]["DefectPositionID"].ToString() != "")
  6403. {
  6404. defect.DefectPositionID = Convert.ToInt32(dtDefect.Rows[row]["DefectPositionID"].ToString());
  6405. }
  6406. defect.DefectPositionName = dtDefect.Rows[row]["DefectPositionName"].ToString();
  6407. defect.DefectPositionCode = dtDefect.Rows[row]["DefectPositionCode"].ToString();
  6408. if (dtDefect.Rows[row]["DefectProcedureID"].ToString() != "")
  6409. {
  6410. defect.DefectProcedureID = Convert.ToInt32(dtDefect.Rows[row]["DefectProcedureID"].ToString());
  6411. }
  6412. defect.DefectProcedureName = dtDefect.Rows[row]["DefectProcedureName"].ToString();
  6413. defect.DefectProcedureCode = dtDefect.Rows[row]["DefectProcedureCode"].ToString();
  6414. if (dtDefect.Rows[row]["DefectUserID"].ToString() != "")
  6415. {
  6416. defect.DefectUserID = Convert.ToInt32(dtDefect.Rows[row]["DefectUserID"].ToString());
  6417. }
  6418. defect.DefectUserName = dtDefect.Rows[row]["DefectUserName"].ToString();
  6419. defect.DefectUserCode = dtDefect.Rows[row]["DefectUserCode"].ToString();
  6420. //if (dtDefect.Rows[row]["Jobs"].ToString() != "")
  6421. //{
  6422. // defect.Jobs = Convert.ToInt32(dtDefect.Rows[row]["Jobs"].ToString());
  6423. //}
  6424. //if (dtDefect.Rows[row]["MissedUserID"].ToString() != "")
  6425. //{
  6426. // defect.MissedUserID = Convert.ToInt32(dtDefect.Rows[row]["MissedUserID"].ToString());
  6427. //}
  6428. //defect.MissedUserCode = dtDefect.Rows[row]["MissedUserCode"].ToString();
  6429. //defect.MissedUserName = dtDefect.Rows[row]["MissedUserName"].ToString();
  6430. //defect.JobsText = dtDefect.Rows[row]["JobsText"].ToString();
  6431. defect.Remarks = dtDefect.Rows[row]["remarks"].ToString();
  6432. if (dtDefect.Rows[row]["semicheckid"].ToString() != "")
  6433. {
  6434. defect.SemiCheckID = Convert.ToInt32(dtDefect.Rows[row]["semicheckid"].ToString());
  6435. }
  6436. if (dtDefect.Rows[row]["DefectProductionDataID"].ToString() != "")
  6437. {
  6438. defect.DefectProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["DefectProductionDataID"].ToString());
  6439. }
  6440. //if (dtDefect.Rows[row]["DefectFineID"].ToString() != "")
  6441. //{
  6442. // defect.DefectFineID = Convert.ToInt32(dtDefect.Rows[row]["DefectFineID"].ToString());
  6443. //}
  6444. //defect.DefectFineValue = dtDefect.Rows[row]["DefectFineValue"].ToString();
  6445. //--------责任员工-------------------
  6446. DataRow[] drRow = reworkDs.Tables[2].Select("SemiCheckDefectID=" + reworkDs.Tables[1].Rows[row]["SemiCheckDefectID"]);
  6447. if (drRow.Length > Constant.INT_IS_ZERO)
  6448. {
  6449. if (defect.DefectResponsibles == null)
  6450. {
  6451. defect.DefectResponsibles = new List<SemiCheckResponsibleEntity>();
  6452. }
  6453. foreach (DataRow r in drRow)
  6454. {
  6455. SemiCheckResponsibleEntity defectResponsible = new SemiCheckResponsibleEntity();
  6456. if (r["SemiCheckDefectID"].ToString() != "")
  6457. {
  6458. defectResponsible.SemiCheckDefectID = Convert.ToInt32(r["SemiCheckDefectID"]);
  6459. }
  6460. if (r["StaffID"].ToString() != "")
  6461. {
  6462. defectResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
  6463. }
  6464. defectResponsible.StaffCode = r["StaffCode"].ToString();
  6465. defectResponsible.StaffName = r["StaffName"].ToString();
  6466. if (r["StaffStatus"].ToString() != "")
  6467. {
  6468. defectResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
  6469. }
  6470. if (r["UJobsID"].ToString() != "")
  6471. {
  6472. defectResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
  6473. }
  6474. if (r["SJobsID"].ToString() != "")
  6475. {
  6476. defectResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
  6477. }
  6478. defect.DefectResponsibles.Add(defectResponsible);
  6479. }
  6480. }
  6481. //------------------------------
  6482. if (productionData.SemiCheckDefects == null)
  6483. {
  6484. productionData.SemiCheckDefects = new List<SemiCheckDefectEntity>();
  6485. }
  6486. productionData.SemiCheckDefects.Add(defect);
  6487. }
  6488. //if (productionDatas.PDAProductionData == null)
  6489. //{
  6490. // productionDatas.PDAProductionData = new System.Collections.Generic.List<PDAProductionDataResult>();
  6491. //}
  6492. productionDatas[0] = productionData;
  6493. //---------------------------------------------------------------------------------
  6494. }
  6495. }
  6496. }
  6497. actionResult.Result = JsonHelper.ToJson(productionDatas);
  6498. actionResult.Status = (int)Constant.PDAResult.Success;
  6499. }
  6500. catch (Exception ex)
  6501. {
  6502. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6503. OutputLog.TraceLog(LogPriority.Error,
  6504. this.ToString(),
  6505. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6506. ex.ToString(),
  6507. LocalPath.LogExePath);
  6508. actionResult.Status = (int)Constant.PDAResult.Exception;
  6509. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6510. }
  6511. return actionResult;
  6512. }
  6513. /// <summary>
  6514. /// 保存半检登记
  6515. /// </summary>
  6516. /// <param name="accountCode">帐套code</param>
  6517. /// <param name="userCode">用户code</param>
  6518. /// <param name="userPassword">用户密码</param>
  6519. /// <param name="sessionKey">本次登陆密钥</param>
  6520. /// <param name="entity">半检实体类</param>
  6521. /// <param name="sUserInfo">用户基本信息</param>
  6522. /// <returns></returns>
  6523. public ActionResult AddSemiCheck(string accountCode, string userCode, string userPassword, string sessionKey, SemiCheckEntity[] entityobj)
  6524. {
  6525. ActionResult actionResult = new ActionResult();
  6526. try
  6527. {
  6528. // 验证请求头信息
  6529. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6530. // 验证失败
  6531. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6532. {
  6533. return actionResult;
  6534. }
  6535. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6536. () => PMModuleLogicDAL.AddSemiCheck(entityobj, sUserInfo));
  6537. string err = string.Empty;
  6538. err = resultEntity.Message;
  6539. if (err == null)
  6540. {
  6541. err = "";
  6542. }
  6543. SemiCheckEntity entity = entityobj[0];
  6544. if (entity.SemiCheckCategory == 1) // 半检登记
  6545. {
  6546. }
  6547. else if (entity.SemiCheckCategory == 2)// 复检登记
  6548. {
  6549. err = JsonHelper.ToJson(err);
  6550. }
  6551. else if (entity.SemiCheckCategory == 3)// 撤销复检
  6552. {
  6553. err = JsonHelper.ToJson(err);
  6554. }
  6555. //actionResult.Result = JsonHelper.ToJson(err);
  6556. actionResult.Result = err;//JsonHelper.ToJson(err);
  6557. actionResult.Status = (int)Constant.PDAResult.Success;
  6558. }
  6559. catch (Exception ex)
  6560. {
  6561. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6562. OutputLog.TraceLog(LogPriority.Error,
  6563. this.ToString(),
  6564. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6565. ex.ToString(),
  6566. LocalPath.LogExePath);
  6567. actionResult.Status = (int)Constant.PDAResult.Exception;
  6568. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6569. }
  6570. return actionResult;
  6571. }
  6572. /// <summary>
  6573. /// 根据所选工号,查出缺陷责任员工
  6574. /// </summary>
  6575. /// <param name="sUserInfo"></param>
  6576. /// <returns></returns>
  6577. public ActionResult GetSemiCheckDefectStaffByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int userid)
  6578. {
  6579. ActionResult actionResult = new ActionResult();
  6580. try
  6581. {
  6582. // 验证请求头信息
  6583. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6584. // 验证失败
  6585. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6586. {
  6587. return actionResult;
  6588. }
  6589. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6590. () => PMModuleLogic.GetSemiCheckDefectStaffByUserID(sUserInfo, userid));
  6591. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6592. actionResult.Status = (int)Constant.PDAResult.Success;
  6593. }
  6594. catch (Exception ex)
  6595. {
  6596. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6597. OutputLog.TraceLog(LogPriority.Error,
  6598. this.ToString(),
  6599. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6600. ex.ToString(),
  6601. LocalPath.LogExePath);
  6602. actionResult.Status = (int)Constant.PDAResult.Exception;
  6603. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6604. }
  6605. return actionResult;
  6606. }
  6607. /// <summary>
  6608. /// 获取半成品缺陷管理的全部数据
  6609. /// </summary>
  6610. /// <param name="sUserInfo"></param>
  6611. /// <returns></returns>
  6612. public ActionResult GetAllSemicheckDefect(string accountCode, string userCode, string userPassword, string sessionKey)
  6613. {
  6614. ActionResult actionResult = new ActionResult();
  6615. try
  6616. {
  6617. // 验证请求头信息
  6618. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6619. // 验证失败
  6620. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6621. {
  6622. return actionResult;
  6623. }
  6624. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6625. () => SystemModuleLogic.GetAllSemicheckDefect(sUserInfo));
  6626. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6627. actionResult.Status = (int)Constant.PDAResult.Success;
  6628. }
  6629. catch (Exception ex)
  6630. {
  6631. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6632. OutputLog.TraceLog(LogPriority.Error,
  6633. this.ToString(),
  6634. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6635. ex.ToString(),
  6636. LocalPath.LogExePath);
  6637. actionResult.Status = (int)Constant.PDAResult.Exception;
  6638. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6639. }
  6640. return actionResult;
  6641. }
  6642. /// <summary>
  6643. /// 获取半成品缺陷位置管理的全部数据
  6644. /// </summary>
  6645. /// <param name="sUserInfo"></param>
  6646. /// <returns></returns>
  6647. public ActionResult GetAllScdefectPosition(string accountCode, string userCode, string userPassword, string sessionKey)
  6648. {
  6649. ActionResult actionResult = new ActionResult();
  6650. try
  6651. {
  6652. // 验证请求头信息
  6653. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6654. // 验证失败
  6655. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6656. {
  6657. return actionResult;
  6658. }
  6659. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6660. () => SystemModuleLogic.GetAllScdefectPosition(sUserInfo));
  6661. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6662. actionResult.Status = (int)Constant.PDAResult.Success;
  6663. }
  6664. catch (Exception ex)
  6665. {
  6666. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6667. OutputLog.TraceLog(LogPriority.Error,
  6668. this.ToString(),
  6669. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6670. ex.ToString(),
  6671. LocalPath.LogExePath);
  6672. actionResult.Status = (int)Constant.PDAResult.Exception;
  6673. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6674. }
  6675. return actionResult;
  6676. }
  6677. /// <summary>
  6678. /// 复检验条码
  6679. /// </summary>
  6680. /// <param name="sUserInfo"></param>
  6681. /// <returns></returns>
  6682. public ActionResult ReSemiCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6683. {
  6684. ActionResult actionResult = new ActionResult();
  6685. try
  6686. {
  6687. // 验证请求头信息
  6688. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6689. // 验证失败
  6690. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6691. {
  6692. return actionResult;
  6693. }
  6694. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6695. () => PMModuleLogic.ReSemiCheckBarcode(barcode, sUserInfo));
  6696. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6697. if (Convert.ToInt32(resultEntity.Result) < 0)
  6698. {
  6699. actionResult.Status = (int)Constant.PDAResult.Fail;
  6700. }
  6701. else
  6702. {
  6703. actionResult.Status = (int)Constant.PDAResult.Success;
  6704. }
  6705. actionResult.Message = resultEntity.Message;
  6706. }
  6707. catch (Exception ex)
  6708. {
  6709. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6710. OutputLog.TraceLog(LogPriority.Error,
  6711. this.ToString(),
  6712. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6713. ex.ToString(),
  6714. LocalPath.LogExePath);
  6715. actionResult.Status = (int)Constant.PDAResult.Exception;
  6716. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6717. }
  6718. return actionResult;
  6719. }
  6720. /// <summary>
  6721. /// 撤销复检验条码
  6722. /// </summary>
  6723. /// <param name="sUserInfo"></param>
  6724. /// <returns></returns>
  6725. public ActionResult CancelSemiCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6726. {
  6727. ActionResult actionResult = new ActionResult();
  6728. try
  6729. {
  6730. // 验证请求头信息
  6731. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6732. // 验证失败
  6733. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6734. {
  6735. return actionResult;
  6736. }
  6737. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6738. () => PMModuleLogic.CancelSemiCheckBarcode(barcode, sUserInfo));
  6739. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6740. if (Convert.ToInt32(resultEntity.Result) < 0)
  6741. {
  6742. actionResult.Status = (int)Constant.PDAResult.Fail;
  6743. }
  6744. else
  6745. {
  6746. actionResult.Status = (int)Constant.PDAResult.Success;
  6747. }
  6748. actionResult.Message = resultEntity.Message;
  6749. }
  6750. catch (Exception ex)
  6751. {
  6752. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6753. OutputLog.TraceLog(LogPriority.Error,
  6754. this.ToString(),
  6755. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6756. ex.ToString(),
  6757. LocalPath.LogExePath);
  6758. actionResult.Status = (int)Constant.PDAResult.Exception;
  6759. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6760. }
  6761. return actionResult;
  6762. }
  6763. /// <summary>
  6764. /// 恢复数据
  6765. /// </summary>
  6766. /// <param name="sUserInfo"></param>
  6767. /// <returns></returns>
  6768. public ActionResult ResetBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6769. {
  6770. ActionResult actionResult = new ActionResult();
  6771. try
  6772. {
  6773. // 验证请求头信息
  6774. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6775. // 验证失败
  6776. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6777. {
  6778. return actionResult;
  6779. }
  6780. int resultEntity = ServiceInvoker.Invoke<int>(this,
  6781. () => PMModuleLogicDAL.ResetBarCode(barcode));
  6782. if (resultEntity > 0)
  6783. {
  6784. actionResult.Status = (int)Constant.PDAResult.Success;
  6785. actionResult.Message = "恢复数据成功";
  6786. }
  6787. else
  6788. {
  6789. actionResult.Status = (int)Constant.PDAResult.Fail;
  6790. if (resultEntity == -1)
  6791. {
  6792. actionResult.Message = "此条码没有清除,不能恢复";
  6793. }
  6794. else if (resultEntity == 0)
  6795. {
  6796. actionResult.Message = "没有可恢复的数据";
  6797. }
  6798. }
  6799. }
  6800. catch (Exception ex)
  6801. {
  6802. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6803. OutputLog.TraceLog(LogPriority.Error,
  6804. this.ToString(),
  6805. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6806. ex.ToString(),
  6807. LocalPath.LogExePath);
  6808. actionResult.Status = (int)Constant.PDAResult.Exception;
  6809. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6810. }
  6811. return actionResult;
  6812. }
  6813. /// <summary>
  6814. /// 通过SettingCode获取系统参数管理的数据
  6815. /// </summary>
  6816. /// <param name="accountCode"></param>
  6817. /// <param name="userCode"></param>
  6818. /// <param name="userPassword"></param>
  6819. /// <param name="sessionKey"></param>
  6820. /// <param name="settingcode">设置编码</param>
  6821. /// <returns></returns>
  6822. public ActionResult GetSystemSettingDataByCode(string accountCode, string userCode, string userPassword, string sessionKey, string settingcode)
  6823. {
  6824. ActionResult actionResult = new ActionResult();
  6825. try
  6826. {
  6827. // 验证请求头信息
  6828. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6829. // 验证失败
  6830. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6831. {
  6832. return actionResult;
  6833. }
  6834. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6835. () => SystemModuleLogic.GetSystemSettingDataByCode(settingcode, sUserInfo));
  6836. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6837. actionResult.Status = (int)Constant.PDAResult.Success;
  6838. }
  6839. catch (Exception ex)
  6840. {
  6841. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6842. OutputLog.TraceLog(LogPriority.Error,
  6843. this.ToString(),
  6844. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6845. ex.ToString(),
  6846. LocalPath.LogExePath);
  6847. actionResult.Status = (int)Constant.PDAResult.Exception;
  6848. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6849. }
  6850. return actionResult;
  6851. }
  6852. /// <summary>
  6853. /// 校验条码是否允许撤销,如果不允许提示错误消息
  6854. /// </summary>
  6855. /// <param name="accountCode"></param>
  6856. /// <param name="userCode"></param>
  6857. /// <param name="userPassword"></param>
  6858. /// <param name="sessionKey"></param>
  6859. /// <param name="orgTime">原时间</param>
  6860. /// <param name="days">允许撤销天数</param>
  6861. /// <param name="settingCode">设置code,用于返回不同错误消息</param>
  6862. /// <returns></returns>
  6863. public ActionResult BarcodeAllowCancel(string accountCode, string userCode, string userPassword, string sessionKey, string orgTime, int days, string settingCode)
  6864. {
  6865. ActionResult actionResult = new ActionResult();
  6866. try
  6867. {
  6868. // 验证请求头信息
  6869. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6870. // 验证失败
  6871. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6872. {
  6873. return actionResult;
  6874. }
  6875. string[] subOrgTime = orgTime.Split('-');
  6876. DateTime newOrgTime = new DateTime(Convert.ToInt32(subOrgTime[0]), Convert.ToInt32(subOrgTime[1]), Convert.ToInt32(subOrgTime[2]));
  6877. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6878. () => PMModuleLogic.BarcodeAllowCancel(newOrgTime, days, settingCode, sUserInfo));
  6879. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6880. if (Convert.ToInt32(resultEntity.Result) < 0)
  6881. {
  6882. actionResult.Status = (int)Constant.PDAResult.Fail;
  6883. }
  6884. else
  6885. {
  6886. actionResult.Status = (int)Constant.PDAResult.Success;
  6887. }
  6888. actionResult.Message = resultEntity.Message;
  6889. }
  6890. catch (Exception ex)
  6891. {
  6892. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6893. OutputLog.TraceLog(LogPriority.Error,
  6894. this.ToString(),
  6895. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6896. ex.ToString(),
  6897. LocalPath.LogExePath);
  6898. actionResult.Status = (int)Constant.PDAResult.Exception;
  6899. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6900. }
  6901. return actionResult;
  6902. }
  6903. /// <summary>
  6904. /// 获取生产订单管理的全部数据
  6905. /// </summary>
  6906. /// <param name="sUserInfo"></param>
  6907. /// <returns></returns>
  6908. public ActionResult GetOrderList(string accountCode, string userCode, string userPassword, string sessionKey, OrderEntity order)
  6909. {
  6910. ActionResult actionResult = new ActionResult();
  6911. try
  6912. {
  6913. // 验证请求头信息
  6914. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6915. // 验证失败
  6916. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6917. {
  6918. return actionResult;
  6919. }
  6920. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6921. () => PMModuleLogic.GetOrderList(order, sUserInfo));
  6922. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6923. actionResult.Status = (int)Constant.PDAResult.Success;
  6924. }
  6925. catch (Exception ex)
  6926. {
  6927. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6928. OutputLog.TraceLog(LogPriority.Error,
  6929. this.ToString(),
  6930. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6931. ex.ToString(),
  6932. LocalPath.LogExePath);
  6933. actionResult.Status = (int)Constant.PDAResult.Exception;
  6934. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6935. }
  6936. return actionResult;
  6937. }
  6938. public ActionResult FinishedHandoverBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6939. {
  6940. ActionResult actionResult = new ActionResult();
  6941. try
  6942. {
  6943. // 验证请求头信息
  6944. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6945. // 验证失败
  6946. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6947. {
  6948. return actionResult;
  6949. }
  6950. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6951. () => PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo));
  6952. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6953. if (Convert.ToInt32(resultEntity.Result) < 0)
  6954. {
  6955. actionResult.Status = (int)Constant.PDAResult.Fail;
  6956. actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
  6957. }
  6958. else
  6959. {
  6960. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  6961. actionResult.Status = (int)Constant.PDAResult.Success;
  6962. }
  6963. actionResult.Message = resultEntity.Message;
  6964. }
  6965. catch (Exception ex)
  6966. {
  6967. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6968. OutputLog.TraceLog(LogPriority.Error,
  6969. this.ToString(),
  6970. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6971. ex.ToString(),
  6972. LocalPath.LogExePath);
  6973. actionResult.Status = (int)Constant.PDAResult.Exception;
  6974. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6975. }
  6976. return actionResult;
  6977. }
  6978. public ActionResult GetSystemData(string accountCode, string userCode, string userPassword, string sessionKey)
  6979. {
  6980. ActionResult actionResult = new ActionResult();
  6981. try
  6982. {
  6983. // 验证请求头信息
  6984. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6985. // 验证失败
  6986. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6987. {
  6988. return actionResult;
  6989. }
  6990. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6991. () => SystemModuleLogic.GetSystemData(sUserInfo));
  6992. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6993. actionResult.Status = (int)Constant.PDAResult.Success;
  6994. }
  6995. catch (Exception ex)
  6996. {
  6997. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6998. OutputLog.TraceLog(LogPriority.Error,
  6999. this.ToString(),
  7000. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7001. ex.ToString(),
  7002. LocalPath.LogExePath);
  7003. actionResult.Status = (int)Constant.PDAResult.Exception;
  7004. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7005. }
  7006. return actionResult;
  7007. }
  7008. public ActionResult SaveFinishedHandover(string accountCode, string userCode, string userPassword, string sessionKey, int orderid, OrderEntity[] orderEntity)
  7009. {
  7010. ActionResult actionResult = new ActionResult();
  7011. try
  7012. {
  7013. // 验证请求头信息
  7014. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7015. // 验证失败
  7016. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7017. {
  7018. return actionResult;
  7019. }
  7020. DataTable dtOrderData = DataConvert.ObjectConvertToTable<OrderEntity>(orderEntity);
  7021. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7022. () => PMModuleLogicDAL.SaveFinishedHandover(orderid, dtOrderData, sUserInfo));
  7023. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7024. if (Convert.ToInt32(resultEntity.Result) < 0)
  7025. {
  7026. actionResult.Status = (int)Constant.PDAResult.Fail;
  7027. }
  7028. else
  7029. {
  7030. actionResult.Status = (int)Constant.PDAResult.Success;
  7031. }
  7032. actionResult.Message = resultEntity.Message;
  7033. }
  7034. catch (Exception ex)
  7035. {
  7036. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7037. OutputLog.TraceLog(LogPriority.Error,
  7038. this.ToString(),
  7039. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7040. ex.ToString(),
  7041. LocalPath.LogExePath);
  7042. actionResult.Status = (int)Constant.PDAResult.Exception;
  7043. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7044. }
  7045. return actionResult;
  7046. }
  7047. public ActionResult CancelFinishedHandoverBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7048. {
  7049. ActionResult actionResult = new ActionResult();
  7050. try
  7051. {
  7052. // 验证请求头信息
  7053. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7054. // 验证失败
  7055. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7056. {
  7057. return actionResult;
  7058. }
  7059. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7060. () => PMModuleLogic.CancelFinishedHandoverBarcode(barcode, sUserInfo));
  7061. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7062. if (Convert.ToInt32(resultEntity.Result) < 0)
  7063. {
  7064. actionResult.Status = (int)Constant.PDAResult.Fail;
  7065. }
  7066. else
  7067. {
  7068. actionResult.Result = JsonHelper.ToJson(resultEntity.Data.Tables[0]);
  7069. actionResult.Status = (int)Constant.PDAResult.Success;
  7070. }
  7071. actionResult.Message = resultEntity.Message;
  7072. }
  7073. catch (Exception ex)
  7074. {
  7075. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7076. OutputLog.TraceLog(LogPriority.Error,
  7077. this.ToString(),
  7078. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7079. ex.ToString(),
  7080. LocalPath.LogExePath);
  7081. actionResult.Status = (int)Constant.PDAResult.Exception;
  7082. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7083. }
  7084. return actionResult;
  7085. }
  7086. public ActionResult SaveCancelFinishedHandoverByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7087. {
  7088. ActionResult actionResult = new ActionResult();
  7089. try
  7090. {
  7091. // 验证请求头信息
  7092. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7093. // 验证失败
  7094. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7095. {
  7096. return actionResult;
  7097. }
  7098. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7099. () => PMModuleLogicDAL.SaveCancelFinishedHandoverByBarcode(barcode, sUserInfo));
  7100. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7101. if (Convert.ToInt32(resultEntity.Result) < 0)
  7102. {
  7103. actionResult.Status = (int)Constant.PDAResult.Fail;
  7104. }
  7105. else
  7106. {
  7107. actionResult.Status = (int)Constant.PDAResult.Success;
  7108. }
  7109. actionResult.Message = resultEntity.Message;
  7110. }
  7111. catch (Exception ex)
  7112. {
  7113. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7114. OutputLog.TraceLog(LogPriority.Error,
  7115. this.ToString(),
  7116. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7117. ex.ToString(),
  7118. LocalPath.LogExePath);
  7119. actionResult.Status = (int)Constant.PDAResult.Exception;
  7120. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7121. }
  7122. return actionResult;
  7123. }
  7124. public ActionResult SaveChangeFinishedHandoverByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int orderid)
  7125. {
  7126. ActionResult actionResult = new ActionResult();
  7127. try
  7128. {
  7129. // 验证请求头信息
  7130. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7131. // 验证失败
  7132. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7133. {
  7134. return actionResult;
  7135. }
  7136. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7137. () => PMModuleLogicDAL.SaveChangeFinishedHandoverByBarcode(barcode, orderid, sUserInfo));
  7138. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7139. if (Convert.ToInt32(resultEntity.Result) < 0)
  7140. {
  7141. actionResult.Status = (int)Constant.PDAResult.Fail;
  7142. }
  7143. else
  7144. {
  7145. actionResult.Status = (int)Constant.PDAResult.Success;
  7146. }
  7147. actionResult.Message = resultEntity.Message;
  7148. }
  7149. catch (Exception ex)
  7150. {
  7151. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7152. OutputLog.TraceLog(LogPriority.Error,
  7153. this.ToString(),
  7154. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7155. ex.ToString(),
  7156. LocalPath.LogExePath);
  7157. actionResult.Status = (int)Constant.PDAResult.Exception;
  7158. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7159. }
  7160. return actionResult;
  7161. }
  7162. #region PDA条码打印
  7163. /// <summary>
  7164. /// 获取条码打印机
  7165. /// </summary>
  7166. /// <param name="accountCode"></param>
  7167. /// <param name="userCode"></param>
  7168. /// <param name="userPassword"></param>
  7169. /// <param name="sessionKey"></param>
  7170. /// <returns></returns>
  7171. public ActionResult GetBarcodePrinter(string accountCode, string userCode, string userPassword, string sessionKey, int printType=0)
  7172. {
  7173. ActionResult actionResult = new ActionResult();
  7174. try
  7175. {
  7176. // 验证请求头信息
  7177. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7178. // 验证失败
  7179. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7180. {
  7181. return actionResult;
  7182. }
  7183. DataSet resultEntity = BarcodePrintLogic.GetBarcodePrinter(sUserInfo, printType);
  7184. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7185. actionResult.Status = (int)Constant.PDAResult.Success;
  7186. }
  7187. catch (Exception ex)
  7188. {
  7189. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7190. OutputLog.TraceLog(LogPriority.Error,
  7191. this.ToString(),
  7192. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7193. ex.ToString(),
  7194. LocalPath.LogExePath);
  7195. actionResult.Status = (int)Constant.PDAResult.Exception;
  7196. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7197. }
  7198. return actionResult;
  7199. }
  7200. /// <summary>
  7201. /// 打印条码样式(补打)
  7202. /// </summary>
  7203. /// <param name="accountCode"></param>
  7204. /// <param name="userCode"></param>
  7205. /// <param name="userPassword"></param>
  7206. /// <param name="sessionKey"></param>
  7207. /// <returns></returns>
  7208. public ActionResult PrintBarcodeLayout(string accountCode, string userCode, string userPassword, string sessionKey,
  7209. string barcode, int copies, int printerID, int printWay=2)
  7210. {
  7211. ActionResult actionResult = new ActionResult();
  7212. try
  7213. {
  7214. // 验证请求头信息
  7215. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7216. // 验证失败
  7217. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7218. {
  7219. return actionResult;
  7220. }
  7221. //ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode(barcode,
  7222. // copies, printerID, sUserInfo);
  7223. ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode_3C(barcode,
  7224. copies, printerID, sUserInfo, printWay);
  7225. if (sre.Status != Constant.ServiceResultStatus.Success)
  7226. {
  7227. actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  7228. actionResult.Message = sre.Message;
  7229. return actionResult;
  7230. }
  7231. actionResult.Result = JsonHelper.ToJson(sre.Result as DataTable);
  7232. actionResult.Status = (int)Constant.PDAResult.Success;
  7233. }
  7234. catch (Exception ex)
  7235. {
  7236. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7237. OutputLog.TraceLog(LogPriority.Error,
  7238. this.ToString(),
  7239. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7240. ex.ToString(),
  7241. LocalPath.LogExePath);
  7242. actionResult.Status = (int)Constant.PDAResult.Exception;
  7243. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7244. }
  7245. return actionResult;
  7246. }
  7247. #endregion PDA条码打印
  7248. #region 统计报表
  7249. /// <summary>
  7250. /// 成型结算报表
  7251. /// </summary>
  7252. /// <param name="accountCode"></param>
  7253. /// <param name="userCode"></param>
  7254. /// <param name="userPassword"></param>
  7255. /// <param name="sessionKey"></param>
  7256. /// <returns></returns>
  7257. public ActionResult GetGroutingSettlementInfo(string accountCode, string userCode, string userPassword, string sessionKey,
  7258. int currentMonth)
  7259. {
  7260. ActionResult actionResult = new ActionResult();
  7261. try
  7262. {
  7263. // 验证请求头信息
  7264. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7265. // 验证失败
  7266. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7267. {
  7268. return actionResult;
  7269. }
  7270. DateTime date = DateTime.Now;
  7271. if (currentMonth != 1)
  7272. {
  7273. date = date.AddMonths(-1);
  7274. }
  7275. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7276. () => PublicModuleLogic.GetFP00002Data(sUserInfo.AccountID, userCode, date));
  7277. if (resultEntity == null || resultEntity.Data == null)
  7278. {
  7279. actionResult.Status = (int)Constant.PDAResult.Fail;
  7280. actionResult.Message = "查询失败";
  7281. return actionResult;
  7282. }
  7283. if (resultEntity.Status == Constant.ServiceResultStatus.Other)
  7284. {
  7285. actionResult.Status = (int)Constant.PDAResult.Fail;
  7286. actionResult.Message = resultEntity.Message;
  7287. return actionResult;
  7288. }
  7289. actionResult.Result = JsonHelper.ToJson(resultEntity.Data.Tables["DataM"]);
  7290. actionResult.Status = (int)Constant.PDAResult.Success;
  7291. }
  7292. catch (Exception ex)
  7293. {
  7294. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7295. OutputLog.TraceLog(LogPriority.Error,
  7296. this.ToString(),
  7297. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7298. ex.ToString(),
  7299. LocalPath.LogExePath);
  7300. actionResult.Status = (int)Constant.PDAResult.Exception;
  7301. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7302. }
  7303. return actionResult;
  7304. }
  7305. #endregion
  7306. #region 设置当期用户默认打印机配置
  7307. /// <summary>
  7308. /// 设置当期用户默认打印机配置
  7309. /// </summary>
  7310. /// <param name="accountCode"></param>
  7311. /// <param name="userCode"></param>
  7312. /// <param name="userPassword"></param>
  7313. /// <param name="sessionKey"></param>
  7314. /// <param name="printerID"></param>
  7315. /// <returns></returns>
  7316. public ActionResult SetCurrentUserPrinter(string accountCode, string userCode, string userPassword, string sessionKey,
  7317. int printerID)
  7318. {
  7319. ActionResult actionResult = new ActionResult();
  7320. try
  7321. {
  7322. // 验证请求头信息
  7323. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7324. // 验证失败
  7325. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7326. {
  7327. return actionResult;
  7328. }
  7329. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7330. () => BarcodePrintLogic.SetCurrentUserPrinter(printerID, sUserInfo));
  7331. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7332. if (resultEntity.Status == Constant.ServiceResultStatus.Other || Convert.ToInt32(resultEntity.Result) < 0)
  7333. {
  7334. actionResult.Status = (int)Constant.PDAResult.Fail;
  7335. }
  7336. else
  7337. {
  7338. actionResult.Status = (int)Constant.PDAResult.Success;
  7339. }
  7340. actionResult.Message = resultEntity.Message;
  7341. }
  7342. catch (Exception ex)
  7343. {
  7344. OutputLog.TraceLog(LogPriority.Error,
  7345. this.ToString(),
  7346. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7347. ex.ToString(),
  7348. LocalPath.LogExePath);
  7349. actionResult.Status = (int)Constant.PDAResult.Exception;
  7350. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7351. }
  7352. return actionResult;
  7353. }
  7354. /// <summary>
  7355. /// 校验产品条码是否可以进行回收
  7356. /// </summary>
  7357. /// <param name="accountCode">帐套code</param>
  7358. /// <param name="userCode">用户code</param>
  7359. /// <param name="userPassword">用户密码</param>
  7360. /// <param name="sessionKey">本次登陆密钥</param>
  7361. /// <param name="procedureID">工序ID</param>
  7362. /// <param name="barcode">条码</param>
  7363. /// <returns></returns>
  7364. /// <remarks>
  7365. /// 王鑫 2017.7.21 新建
  7366. /// </remarks>
  7367. public ActionResult CheckRecydingFlagBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  7368. {
  7369. ActionResult actionResult = new ActionResult();
  7370. try
  7371. {
  7372. // 验证请求头信息
  7373. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7374. // 验证失败
  7375. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7376. {
  7377. return actionResult;
  7378. }
  7379. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  7380. () => PMModuleLogic.CheckRecydingFlagBarcode(procedureID, barcode, sUserInfo));
  7381. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  7382. {
  7383. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  7384. actionResult.Status = (int)Constant.PDAResult.Success;
  7385. }
  7386. else
  7387. {
  7388. actionResult.Status = (int)Constant.PDAResult.Fail;
  7389. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  7390. }
  7391. }
  7392. catch (Exception ex)
  7393. {
  7394. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7395. OutputLog.TraceLog(LogPriority.Error,
  7396. this.ToString(),
  7397. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7398. ex.ToString(),
  7399. LocalPath.LogExePath);
  7400. actionResult.Status = (int)Constant.PDAResult.Exception;
  7401. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7402. }
  7403. return actionResult;
  7404. }
  7405. /// <summary>
  7406. /// 获取回收标识
  7407. /// </summary>
  7408. /// <param name="accountCode"></param>
  7409. /// <param name="userCode"></param>
  7410. /// <param name="userPassword"></param>
  7411. /// <param name="sessionKey"></param>
  7412. /// <param name="usercode">工号编码</param>
  7413. /// <returns></returns>
  7414. public ActionResult GetRecyclingflagByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7415. {
  7416. ActionResult actionResult = new ActionResult();
  7417. try
  7418. {
  7419. // 验证请求头信息
  7420. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7421. // 验证失败
  7422. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7423. {
  7424. return actionResult;
  7425. }
  7426. int returnValue = ServiceInvoker.Invoke<int>(this,
  7427. () => PMModuleLogic.GetRecyclingflagByBarcode(barcode, sUserInfo));
  7428. actionResult.Result = JsonHelper.ToJson(returnValue);
  7429. actionResult.Status = (int)Constant.PDAResult.Success;
  7430. }
  7431. catch (Exception ex)
  7432. {
  7433. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7434. OutputLog.TraceLog(LogPriority.Error,
  7435. this.ToString(),
  7436. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7437. ex.ToString(),
  7438. LocalPath.LogExePath);
  7439. actionResult.Status = (int)Constant.PDAResult.Exception;
  7440. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7441. }
  7442. return actionResult;
  7443. }
  7444. #endregion
  7445. #region 注浆盘点
  7446. /// <summary>
  7447. /// 获取注浆盘点单列表
  7448. /// </summary>
  7449. /// <param name="sUserInfo"></param>
  7450. /// <returns></returns>
  7451. public ActionResult GetAllGBChecked(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity)
  7452. {
  7453. ActionResult actionResult = new ActionResult();
  7454. try
  7455. {
  7456. // 验证请求头信息
  7457. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7458. // 验证失败
  7459. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7460. {
  7461. return actionResult;
  7462. }
  7463. entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA);
  7464. entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1);
  7465. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  7466. () => PDAModuleLogic.GetAllGBChecked(entity, sUserInfo));
  7467. actionResult.Result = JsonHelper.ToJson(ds);
  7468. actionResult.Status = (int)Constant.PDAResult.Success;
  7469. }
  7470. catch (Exception ex)
  7471. {
  7472. string json = JsonHelper.ToJson(entity);
  7473. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7474. OutputLog.TraceLog(LogPriority.Error,
  7475. this.ToString(),
  7476. System.Reflection.MethodBase.GetCurrentMethod().Name + "\r\n" + json,
  7477. ex.ToString(),
  7478. LocalPath.LogExePath);
  7479. actionResult.Status = (int)Constant.PDAResult.Exception;
  7480. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7481. }
  7482. return actionResult;
  7483. }
  7484. /// <summary>
  7485. /// 进行盘点操作
  7486. /// </summary>
  7487. /// <param name="accountCode"></param>
  7488. /// <param name="userCode"></param>
  7489. /// <param name="userPassword"></param>
  7490. /// <param name="sessionKey"></param>
  7491. /// <param name="InCheckedID">盘点单ID</param>
  7492. /// <param name="BarCode">产品条码</param>
  7493. /// <returns></returns>
  7494. public ActionResult UpdateGBChecked(string accountCode, string userCode, string userPassword, string sessionKey, int CheckedID, string BarCode)
  7495. {
  7496. ActionResult actionResult = new ActionResult();
  7497. try
  7498. {
  7499. // 验证请求头信息
  7500. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7501. // 验证失败
  7502. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7503. {
  7504. return actionResult;
  7505. }
  7506. ClientRequestEntity cre = new ClientRequestEntity();
  7507. cre.Properties["CheckedID"] = CheckedID;
  7508. cre.Properties["Barcode"] = BarCode;
  7509. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7510. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.UpdateGBChecked(sUserInfo, cre));
  7511. if (returnValue.Status == Constant.ServiceResultStatus.Success)
  7512. {
  7513. //actionResult.Result = JsonHelper.ToJson(returnValue);
  7514. actionResult.Status = (int)Constant.PDAResult.Success;
  7515. actionResult.Message = "产品【" + BarCode + "】盘点成功";
  7516. }
  7517. else
  7518. {
  7519. //actionResult.Result = JsonHelper.ToJson(returnValue);
  7520. actionResult.Status = (int)Constant.PDAResult.Fail;
  7521. actionResult.Message = returnValue.Message;
  7522. }
  7523. }
  7524. catch (Exception ex)
  7525. {
  7526. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7527. OutputLog.TraceLog(LogPriority.Error,
  7528. this.ToString(),
  7529. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7530. ex.ToString(),
  7531. LocalPath.LogExePath);
  7532. actionResult.Status = (int)Constant.PDAResult.Exception;
  7533. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7534. }
  7535. return actionResult;
  7536. }
  7537. /// <summary>
  7538. /// 获取盘点单明细
  7539. /// </summary>
  7540. /// <param name="sUserInfo"></param>
  7541. /// <returns></returns>
  7542. public ActionResult GetUpdateGBCheckedInfo(string accountCode, string userCode, string userPassword, string sessionKey, int checkedID)
  7543. {
  7544. ActionResult actionResult = new ActionResult();
  7545. try
  7546. {
  7547. // 验证请求头信息
  7548. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7549. // 验证失败
  7550. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7551. {
  7552. return actionResult;
  7553. }
  7554. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  7555. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.
  7556. GetUpdateGBCheckedInfo(checkedID, sUserInfo));
  7557. actionResult.Result = JsonHelper.ToJson(ds);
  7558. actionResult.Status = (int)Constant.PDAResult.Success;
  7559. }
  7560. catch (Exception ex)
  7561. {
  7562. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7563. OutputLog.TraceLog(LogPriority.Error,
  7564. this.ToString(),
  7565. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7566. ex.ToString(),
  7567. LocalPath.LogExePath);
  7568. actionResult.Status = (int)Constant.PDAResult.Exception;
  7569. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7570. }
  7571. return actionResult;
  7572. }
  7573. #endregion
  7574. #region 模具盘点
  7575. /// <summary>
  7576. /// 获取模具盘点单列表
  7577. /// </summary>
  7578. /// <param name="sUserInfo"></param>
  7579. /// <returns></returns>
  7580. public ActionResult GetAllMouldChecked(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity)
  7581. {
  7582. ActionResult actionResult = new ActionResult();
  7583. try
  7584. {
  7585. // 验证请求头信息
  7586. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7587. // 验证失败
  7588. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7589. {
  7590. return actionResult;
  7591. }
  7592. entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA);
  7593. entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1);
  7594. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  7595. () => PDAModuleLogic.GetAllMouldChecked(entity, sUserInfo));
  7596. actionResult.Result = JsonHelper.ToJson(ds);
  7597. actionResult.Status = (int)Constant.PDAResult.Success;
  7598. }
  7599. catch (Exception ex)
  7600. {
  7601. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7602. OutputLog.TraceLog(LogPriority.Error,
  7603. this.ToString(),
  7604. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7605. ex.ToString(),
  7606. LocalPath.LogExePath);
  7607. actionResult.Status = (int)Constant.PDAResult.Exception;
  7608. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7609. }
  7610. return actionResult;
  7611. }
  7612. /// <summary>
  7613. /// 进行盘点操作
  7614. /// </summary>
  7615. /// <param name="accountCode"></param>
  7616. /// <param name="userCode"></param>
  7617. /// <param name="userPassword"></param>
  7618. /// <param name="sessionKey"></param>
  7619. /// <param name="InCheckedID">盘点单ID</param>
  7620. /// <param name="BarCode">产品条码</param>
  7621. /// <returns></returns>
  7622. public ActionResult UpdateMouldChecked(string accountCode, string userCode, string userPassword, string sessionKey, int CheckedID, string BarCode)
  7623. {
  7624. ActionResult actionResult = new ActionResult();
  7625. try
  7626. {
  7627. // 验证请求头信息
  7628. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7629. // 验证失败
  7630. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7631. {
  7632. return actionResult;
  7633. }
  7634. ClientRequestEntity cre = new ClientRequestEntity();
  7635. cre.Properties["CheckedID"] = CheckedID;
  7636. cre.Properties["Barcode"] = BarCode;
  7637. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7638. () => Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.UpdateMouldChecked(sUserInfo, cre));
  7639. if (returnValue.Status == Constant.ServiceResultStatus.Success)
  7640. {
  7641. //actionResult.Result = JsonHelper.ToJson(returnValue);
  7642. actionResult.Status = (int)Constant.PDAResult.Success;
  7643. actionResult.Message = "产品【" + BarCode + "】盘点成功";
  7644. }
  7645. else
  7646. {
  7647. //actionResult.Result = JsonHelper.ToJson(returnValue);
  7648. actionResult.Status = (int)Constant.PDAResult.Fail;
  7649. actionResult.Message = returnValue.Message;
  7650. }
  7651. }
  7652. catch (Exception ex)
  7653. {
  7654. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7655. OutputLog.TraceLog(LogPriority.Error,
  7656. this.ToString(),
  7657. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7658. ex.ToString(),
  7659. LocalPath.LogExePath);
  7660. actionResult.Status = (int)Constant.PDAResult.Exception;
  7661. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7662. }
  7663. return actionResult;
  7664. }
  7665. /// <summary>
  7666. /// 获取盘点单明细
  7667. /// </summary>
  7668. /// <param name="sUserInfo"></param>
  7669. /// <returns></returns>
  7670. public ActionResult GetUpdateMouldCheckedInfo(string accountCode, string userCode, string userPassword, string sessionKey, int checkedID)
  7671. {
  7672. ActionResult actionResult = new ActionResult();
  7673. try
  7674. {
  7675. // 验证请求头信息
  7676. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7677. // 验证失败
  7678. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7679. {
  7680. return actionResult;
  7681. }
  7682. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  7683. () => Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.
  7684. GetUpdateMouldCheckedInfo(checkedID, sUserInfo));
  7685. actionResult.Result = JsonHelper.ToJson(ds);
  7686. actionResult.Status = (int)Constant.PDAResult.Success;
  7687. }
  7688. catch (Exception ex)
  7689. {
  7690. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7691. OutputLog.TraceLog(LogPriority.Error,
  7692. this.ToString(),
  7693. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7694. ex.ToString(),
  7695. LocalPath.LogExePath);
  7696. actionResult.Status = (int)Constant.PDAResult.Exception;
  7697. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7698. }
  7699. return actionResult;
  7700. }
  7701. #endregion
  7702. #region 通用接口
  7703. /// <summary>
  7704. /// PDA调用通用接口
  7705. /// </summary>
  7706. /// <param name="accountCode"></param>
  7707. /// <param name="userCode"></param>
  7708. /// <param name="userPassword"></param>
  7709. /// <param name="sessionKey"></param>
  7710. /// <param name="module"></param>
  7711. /// <param name="action"></param>
  7712. /// <param name="data"></param>
  7713. /// <returns></returns>
  7714. public ActionResult DoAction(string accountCode, string userCode, string userPassword, string sessionKey,
  7715. string module, string action, string jsonData)
  7716. {
  7717. ActionResult actionResult = null;
  7718. try
  7719. {
  7720. // 验证请求头信息
  7721. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7722. // 验证失败
  7723. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7724. {
  7725. return actionResult;
  7726. }
  7727. actionResult.Status = (int)Constant.PDAResult.Fail;
  7728. Dictionary<string, object> data = null;
  7729. if (!string.IsNullOrEmpty(jsonData) && jsonData[0] == '{')
  7730. {
  7731. data = JsonHelper.FromJson<Dictionary<string, object>>(jsonData);
  7732. }
  7733. #region PDA报表
  7734. if (module == "Report")
  7735. {
  7736. // 成型月度结算
  7737. if (action == "GetGroutingSettlementInfo")
  7738. {
  7739. DateTime month = DateTime.Now;
  7740. month = new DateTime(month.Year, month.Month, 1);
  7741. //month = new DateTime(2017, 6, 1);
  7742. int currentMonth = Convert.ToInt32(data["CurrentMonth"]);
  7743. if (currentMonth != 1)
  7744. {
  7745. month = month.AddMonths(-1);
  7746. }
  7747. ServiceResultEntity sre = PDAModuleLogic.GetGroutingSettlementInfo(sUserInfo, month);
  7748. if (sre.Status == Constant.ServiceResultStatus.Success)
  7749. {
  7750. actionResult.Status = (int)Constant.PDAResult.Success;
  7751. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  7752. }
  7753. else
  7754. {
  7755. actionResult.Status = (int)Constant.PDAResult.Fail;
  7756. actionResult.Message = sre.Message;
  7757. }
  7758. return actionResult;
  7759. }
  7760. // 成型月度结算-明细
  7761. if (action == "GetGroutingSettlementDetail")
  7762. {
  7763. DateTime month = DateTime.Now;
  7764. month = new DateTime(month.Year, month.Month, 1);
  7765. //month = new DateTime(2017, 6, 1);
  7766. int currentMonth = Convert.ToInt32(data["CurrentMonth"]);
  7767. if (currentMonth != 1)
  7768. {
  7769. month = month.AddMonths(-1);
  7770. }
  7771. string goodsCode = data["GoodsCode"].ToString();
  7772. string detailDate = data["DetailDate"].ToString();
  7773. DateTime? date = null;
  7774. if (detailDate != "合计")
  7775. {
  7776. date = DateTime.Parse(detailDate);
  7777. }
  7778. ServiceResultEntity sre = PDAModuleLogic.GetGroutingSettlementDetail(sUserInfo, month, goodsCode, date);
  7779. if (sre.Status == Constant.ServiceResultStatus.Success)
  7780. {
  7781. actionResult.Status = (int)Constant.PDAResult.Success;
  7782. actionResult.Result = JsonHelper.ToJson(sre.Data);
  7783. }
  7784. else
  7785. {
  7786. actionResult.Status = (int)Constant.PDAResult.Fail;
  7787. actionResult.Message = sre.Message;
  7788. }
  7789. return actionResult;
  7790. }
  7791. // 产成品交接汇总
  7792. if (action == "GetFinishedProductHandoverSum")
  7793. {
  7794. DateTime date = DateTime.Parse(data["date"].ToString());
  7795. ServiceResultEntity sre = ReportModuleLogic.GetRPT0030112NPDAData(date,
  7796. data["goodscode"] as string, sUserInfo);
  7797. if (sre.Status == Constant.ServiceResultStatus.Success)
  7798. {
  7799. actionResult.Status = (int)Constant.PDAResult.Success;
  7800. actionResult.Result = JsonHelper.ToJson(sre.Data);
  7801. }
  7802. else if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  7803. {
  7804. actionResult.Status = (int)Constant.PDAResult.Success;
  7805. }
  7806. else
  7807. {
  7808. actionResult.Status = (int)Constant.PDAResult.Fail;
  7809. actionResult.Message = sre.Message;
  7810. }
  7811. return actionResult;
  7812. }
  7813. //xuwei add 2019-10-21
  7814. //统计当前工号,当日,按产品编码分组统计半检返修数据数量
  7815. if (action == "GetSemiReworkDayCount")
  7816. {
  7817. //不指定参数查询当天
  7818. string dateStr = DateTime.Now.ToString("yyyy-MM-dd");
  7819. //dateStr = "2019-10-17";
  7820. //指定参数查询特定日期
  7821. if(data.ContainsKey("SemiReworkDate")) dateStr = data["SemiReworkDate"].ToString();
  7822. ServiceResultEntity sre = ReportModuleLogic.GetSemiReworkDayCount(sUserInfo, dateStr);
  7823. if (sre.Status == Constant.ServiceResultStatus.Success)
  7824. {
  7825. actionResult.Status = (int)Constant.PDAResult.Success;
  7826. actionResult.Result = JsonHelper.ToJson(sre.Data);
  7827. }
  7828. else
  7829. {
  7830. actionResult.Status = (int)Constant.PDAResult.Fail;
  7831. actionResult.Message = sre.Message;
  7832. }
  7833. return actionResult;
  7834. }
  7835. //xuwe end
  7836. return actionResult;
  7837. }
  7838. #endregion
  7839. #region 模具管理
  7840. if (module == "PC_Mould")
  7841. {
  7842. #region 模具新建画面数据初始化
  7843. if (action == "GetMouldAddInit")
  7844. {
  7845. ClientRequestEntity cre = new ClientRequestEntity();
  7846. cre.Properties["MouldID"] = 0;
  7847. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1002LoadData(sUserInfo, cre);
  7848. if (sre.Status == Constant.ServiceResultStatus.Success)
  7849. {
  7850. actionResult.Status = (int)Constant.PDAResult.Success;
  7851. actionResult.Result = JsonHelper.ToJson(sre.Data);
  7852. }
  7853. else
  7854. {
  7855. actionResult.Status = (int)Constant.PDAResult.Fail;
  7856. actionResult.Message = sre.Message;
  7857. }
  7858. return actionResult;
  7859. }
  7860. #endregion
  7861. #region 验证模具产品型号
  7862. if (action == "CheckGoodsCodeOnMould")
  7863. {
  7864. ClientRequestEntity cre = new ClientRequestEntity();
  7865. cre.Properties["GoodsCode"] = data["GoodsCode"];
  7866. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1002GoodsData(sUserInfo, cre);
  7867. if (sre.Status == Constant.ServiceResultStatus.Success &&
  7868. sre.Data.Tables[0].Rows.Count > 0)
  7869. {
  7870. actionResult.Status = (int)Constant.PDAResult.Success;
  7871. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  7872. }
  7873. else
  7874. {
  7875. actionResult.Status = (int)Constant.PDAResult.Fail;
  7876. actionResult.Message = "无效产品型号";
  7877. }
  7878. return actionResult;
  7879. }
  7880. #endregion
  7881. #region 验证模具生产工号
  7882. if (action == "CheckUserCodeOnMould")
  7883. {
  7884. DataTable sre = PDAModuleLogic.GetUserCodeOnMould(sUserInfo, data["UserCode"].ToString());
  7885. if (sre != null && sre.Rows.Count > 0)
  7886. {
  7887. actionResult.Status = (int)Constant.PDAResult.Success;
  7888. actionResult.Result = JsonHelper.ToJson(sre);
  7889. }
  7890. else
  7891. {
  7892. actionResult.Status = (int)Constant.PDAResult.Fail;
  7893. actionResult.Message = "无效生产工号";
  7894. }
  7895. return actionResult;
  7896. }
  7897. #endregion
  7898. #region 新建保存
  7899. if (action == "SetMouldAdd" || action == "SetMouldEdit")
  7900. {
  7901. ClientRequestEntity cre = new ClientRequestEntity();
  7902. foreach (string item in data.Keys)
  7903. {
  7904. if (item == "ProductionDate")
  7905. {
  7906. cre.Properties.Add(item, Convert.ToDateTime(data[item]));
  7907. }
  7908. else
  7909. {
  7910. cre.Properties.Add(item, data[item]);
  7911. }
  7912. }
  7913. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1002Data(sUserInfo, cre);
  7914. if (sre.Status == Constant.ServiceResultStatus.Success)
  7915. {
  7916. actionResult.Status = (int)Constant.PDAResult.Success;
  7917. }
  7918. else
  7919. {
  7920. actionResult.Status = (int)Constant.PDAResult.Fail;
  7921. actionResult.Result = sre.OtherStatus;
  7922. actionResult.Message = sre.Message;
  7923. }
  7924. return actionResult;
  7925. }
  7926. #endregion
  7927. #region 模具编辑画面数据初始化
  7928. if (action == "GetMouldEditInfo")
  7929. {
  7930. DataTable sre = PDAModuleLogic.GetMouldEditInfo(sUserInfo, data["MouldBarcode"].ToString());
  7931. if (sre != null && sre.Rows.Count > 0)
  7932. {
  7933. actionResult.Status = (int)Constant.PDAResult.Success;
  7934. actionResult.Result = JsonHelper.ToJson(sre);
  7935. }
  7936. else
  7937. {
  7938. actionResult.Status = (int)Constant.PDAResult.Fail;
  7939. actionResult.Message = "无效模具条码";
  7940. }
  7941. return actionResult;
  7942. }
  7943. #endregion
  7944. #region 模具操作-画面初始化
  7945. if (action == "GetMouldOperationInit")
  7946. {
  7947. ClientRequestEntity cre = new ClientRequestEntity();
  7948. cre.Properties["MouldOperationType"] = data["MouldOperationType"];
  7949. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1004LoadData(sUserInfo, cre);
  7950. if (sre.Status == Constant.ServiceResultStatus.Success)
  7951. {
  7952. actionResult.Status = (int)Constant.PDAResult.Success;
  7953. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  7954. }
  7955. else
  7956. {
  7957. actionResult.Status = (int)Constant.PDAResult.Fail;
  7958. actionResult.Result = sre.OtherStatus;
  7959. actionResult.Message = sre.Message;
  7960. }
  7961. return actionResult;
  7962. }
  7963. #endregion
  7964. #region 模具操作-验证模具条码
  7965. if (action == "CheckMouldBarcode")
  7966. {
  7967. ClientRequestEntity cre = new ClientRequestEntity();
  7968. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  7969. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetMouldData(sUserInfo, cre);
  7970. if (sre.Status == Constant.ServiceResultStatus.Success)
  7971. {
  7972. if (sre.Data.Tables[0].Rows.Count == 0)
  7973. {
  7974. actionResult.Status = (int)Constant.PDAResult.Fail;
  7975. actionResult.Result = -1;
  7976. actionResult.Message = "模具【" + data["MouldBarcode"] + "】不存在";
  7977. return actionResult;
  7978. }
  7979. int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
  7980. int mouldStatusID = Convert.ToInt32(sre.Data.Tables[0].Rows[0]["MouldStatus"]);
  7981. string mouldStatusName = sre.Data.Tables[0].Rows[0]["MouldStatusName"].ToString();
  7982. #region 报损
  7983. if (mouldOperationType == 2)
  7984. {
  7985. if (mouldStatusID == 1 || mouldStatusID == 3)
  7986. {
  7987. actionResult.Status = (int)Constant.PDAResult.Success;
  7988. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  7989. }
  7990. else
  7991. {
  7992. actionResult.Status = (int)Constant.PDAResult.Fail;
  7993. actionResult.Result = -2;
  7994. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行报损操作";
  7995. }
  7996. return actionResult;
  7997. }
  7998. #endregion
  7999. #region 撤销
  8000. if (mouldOperationType == 3)
  8001. {
  8002. if (mouldStatusID == 4)
  8003. {
  8004. actionResult.Status = (int)Constant.PDAResult.Success;
  8005. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8006. }
  8007. else
  8008. {
  8009. actionResult.Status = (int)Constant.PDAResult.Fail;
  8010. actionResult.Result = -2;
  8011. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行撤销报损操作";
  8012. }
  8013. return actionResult;
  8014. }
  8015. #endregion
  8016. #region 领用
  8017. if (mouldOperationType == 4)
  8018. {
  8019. if (mouldStatusID == 1)
  8020. {
  8021. actionResult.Status = (int)Constant.PDAResult.Success;
  8022. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8023. }
  8024. else
  8025. {
  8026. actionResult.Status = (int)Constant.PDAResult.Fail;
  8027. actionResult.Result = -2;
  8028. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行领用操作";
  8029. }
  8030. return actionResult;
  8031. }
  8032. #endregion
  8033. #region 回收
  8034. if (mouldOperationType == 5)
  8035. {
  8036. if (mouldStatusID == 3)
  8037. {
  8038. actionResult.Status = (int)Constant.PDAResult.Success;
  8039. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8040. }
  8041. else
  8042. {
  8043. actionResult.Status = (int)Constant.PDAResult.Fail;
  8044. actionResult.Result = -2;
  8045. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行回收操作";
  8046. }
  8047. return actionResult;
  8048. }
  8049. #endregion
  8050. #region 变更型号
  8051. if (mouldOperationType == -1)
  8052. {
  8053. if (mouldStatusID != 4)
  8054. {
  8055. actionResult.Status = (int)Constant.PDAResult.Success;
  8056. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8057. }
  8058. else
  8059. {
  8060. actionResult.Status = (int)Constant.PDAResult.Fail;
  8061. actionResult.Result = -2;
  8062. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行变更型号操作";
  8063. }
  8064. return actionResult;
  8065. }
  8066. #endregion
  8067. #region 替换条码
  8068. if (mouldOperationType == -2)
  8069. {
  8070. actionResult.Status = (int)Constant.PDAResult.Success;
  8071. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8072. return actionResult;
  8073. }
  8074. #endregion
  8075. return actionResult;
  8076. }
  8077. }
  8078. #endregion
  8079. #region 模具操作-保存
  8080. if (action == "SetMouldOperation")
  8081. {
  8082. ClientRequestEntity cre = new ClientRequestEntity();
  8083. cre.Properties["MouldIDs"] = string.Join(",", JsonHelper.FromJson<int[]>(data["MouldIDs"].ToString()));
  8084. cre.Properties["MouldOperationType"] = data["MouldOperationType"];
  8085. cre.Properties["Remarks"] = data["Remarks"];
  8086. int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
  8087. if (mouldOperationType == (int)Constant.MouldOperationType.ChangeGoodsCode)
  8088. {
  8089. cre.Properties["GoodsID"] = data["GoodsID"];
  8090. cre.Properties["GoodsCode"] = data["GoodsCode"];
  8091. }
  8092. else if (mouldOperationType == (int)Constant.MouldOperationType.InvToScrap)
  8093. {
  8094. cre.Properties["ScrapReason"] = data["ScrapReason"];
  8095. cre.Properties["ScrapResponsibility"] = data["ScrapRemarks"];
  8096. }
  8097. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1004Data(sUserInfo, cre);
  8098. if (sre.Status == Constant.ServiceResultStatus.Success)
  8099. {
  8100. actionResult.Status = (int)Constant.PDAResult.Success;
  8101. }
  8102. else
  8103. {
  8104. actionResult.Status = (int)Constant.PDAResult.Fail;
  8105. }
  8106. return actionResult;
  8107. }
  8108. #endregion
  8109. #region 模具操作-替换条码
  8110. if (action == "ChangedMouldBarcode")
  8111. {
  8112. ClientRequestEntity cre = new ClientRequestEntity();
  8113. cre.Properties["MouldID"] = data["MouldID"];
  8114. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8115. cre.Properties["NewMouldBarcode"] = data["NewMouldBarcode"];
  8116. cre.Properties["Remarks"] = data["Remarks"];
  8117. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1003Data(sUserInfo, cre);
  8118. if (sre.Status == Constant.ServiceResultStatus.Success)
  8119. {
  8120. actionResult.Status = (int)Constant.PDAResult.Success;
  8121. }
  8122. else
  8123. {
  8124. actionResult.Status = (int)Constant.PDAResult.Fail;
  8125. actionResult.Result = sre.OtherStatus;
  8126. actionResult.Message = sre.Message;
  8127. }
  8128. return actionResult;
  8129. }
  8130. #endregion
  8131. #region 模具跟踪表
  8132. if (action == "GetMoldTracking")
  8133. {
  8134. ClientRequestEntity cre = new ClientRequestEntity();
  8135. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8136. ServiceResultEntity sre = ReportModuleLogic.GetRPT020105Data(cre, sUserInfo);
  8137. if (sre.Status == Constant.ServiceResultStatus.Success)
  8138. {
  8139. actionResult.Status = (int)Constant.PDAResult.Success;
  8140. actionResult.Result = JsonHelper.ToJson(sre.Data);
  8141. }
  8142. else
  8143. {
  8144. actionResult.Status = (int)Constant.PDAResult.Fail;
  8145. actionResult.Message = "此模具条码不存在";
  8146. }
  8147. return actionResult;
  8148. }
  8149. #endregion
  8150. return actionResult;
  8151. }
  8152. #endregion
  8153. #region 成型线模具管理
  8154. if (module == "PC_GroutingLineMould")
  8155. {
  8156. #region 获取当前用户成型线模具管理权限
  8157. if (action == "GetGMouldStatusRight")
  8158. {
  8159. DataTable right = PDAModuleLogic.GetGMouldStatusRight(sUserInfo);
  8160. actionResult.Status = (int)Constant.PDAResult.Success;
  8161. if (right != null && right.Rows.Count > 0)
  8162. {
  8163. actionResult.Result = JsonHelper.ToJson(right);
  8164. }
  8165. return actionResult;
  8166. }
  8167. #endregion
  8168. #region 获取成型线状态等信息,和成型模具信息
  8169. if (action == "GetGroutingLineMould")
  8170. {
  8171. int? groutingLineID = null;
  8172. string groutingLineCode = null;
  8173. if (data.ContainsKey("GroutingLineID"))
  8174. {
  8175. groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8176. }
  8177. else
  8178. {
  8179. groutingLineCode = data["GroutingLineCode"] + "";
  8180. }
  8181. DataSet lineInfo = PDAModuleLogic.GetGroutingLineMould(sUserInfo, groutingLineCode, groutingLineID);
  8182. if (lineInfo == null)
  8183. {
  8184. actionResult.Status = (int)Constant.PDAResult.Fail;
  8185. actionResult.Message = "成型线【" + groutingLineCode + "】不存在或是停用状态";
  8186. }
  8187. else
  8188. {
  8189. actionResult.Status = (int)Constant.PDAResult.Success;
  8190. actionResult.Result = JsonHelper.ToJson(lineInfo);
  8191. }
  8192. return actionResult;
  8193. }
  8194. #endregion
  8195. #region 模具操作-画面初始化
  8196. if (action == "GetMouldOperationInit")
  8197. {
  8198. ClientRequestEntity cre = new ClientRequestEntity();
  8199. cre.Properties["MouldOperationType"] = 2;
  8200. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1004LoadData(sUserInfo, cre);
  8201. if (sre.Status == Constant.ServiceResultStatus.Success)
  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 = sre.OtherStatus;
  8210. actionResult.Message = sre.Message;
  8211. }
  8212. return actionResult;
  8213. }
  8214. #endregion
  8215. #region 成型模具操作-画面初始化
  8216. if (action == "GetGroutingMouldOperationInit")
  8217. {
  8218. DataTable initData = PDAModuleLogic.GetGroutingMouldOperationInit(sUserInfo, 6);
  8219. if (initData != null && initData.Rows.Count > 0)
  8220. {
  8221. actionResult.Status = (int)Constant.PDAResult.Success;
  8222. Dictionary<string, string> syssetting = new Dictionary<string, string>();
  8223. foreach (DataRow item in initData.Rows)
  8224. {
  8225. syssetting.Add(item["settingcode"].ToString(), item["settingvalue"].ToString());
  8226. }
  8227. actionResult.Result = JsonHelper.ToJson(syssetting);
  8228. }
  8229. else
  8230. {
  8231. actionResult.Status = (int)Constant.PDAResult.Fail;
  8232. }
  8233. return actionResult;
  8234. }
  8235. #endregion
  8236. #region 模具操作-验证模具条码
  8237. if (action == "CheckMouldBarcode")
  8238. {
  8239. ClientRequestEntity cre = new ClientRequestEntity();
  8240. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8241. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetMouldData(sUserInfo, cre);
  8242. if (sre.Status == Constant.ServiceResultStatus.Success)
  8243. {
  8244. if (sre.Data.Tables[0].Rows.Count == 0)
  8245. {
  8246. actionResult.Status = (int)Constant.PDAResult.Fail;
  8247. actionResult.Result = -1;
  8248. actionResult.Message = "模具【" + data["MouldBarcode"] + "】不存在";
  8249. return actionResult;
  8250. }
  8251. int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
  8252. int mouldStatusID = Convert.ToInt32(sre.Data.Tables[0].Rows[0]["MouldStatus"]);
  8253. string mouldStatusName = sre.Data.Tables[0].Rows[0]["MouldStatusName"].ToString();
  8254. #region 上线
  8255. if (mouldOperationType == 6)
  8256. {
  8257. if (mouldStatusID == 1 || mouldStatusID == 3)
  8258. {
  8259. if (data.ContainsKey("GoodsID"))
  8260. {
  8261. if (sre.Data.Tables[0].Rows[0]["GoodsID"] + "" != data["GoodsID"] + "")
  8262. {
  8263. actionResult.Status = (int)Constant.PDAResult.Fail;
  8264. actionResult.Result = -3;
  8265. actionResult.Message =
  8266. "模具【" + data["MouldBarcode"] + "】的产品型号为【" +
  8267. sre.Data.Tables[0].Rows[0]["GoodsCode"] +
  8268. "】与当前不一致";
  8269. return actionResult;
  8270. }
  8271. }
  8272. actionResult.Status = (int)Constant.PDAResult.Success;
  8273. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8274. }
  8275. else
  8276. {
  8277. actionResult.Status = (int)Constant.PDAResult.Fail;
  8278. actionResult.Result = -2;
  8279. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行报损操作";
  8280. }
  8281. return actionResult;
  8282. }
  8283. #endregion
  8284. return actionResult;
  8285. }
  8286. }
  8287. #endregion
  8288. #region 停用
  8289. if (action == "StopGroutingLineDetail")
  8290. {
  8291. if (data == null || !data.ContainsKey("Details"))
  8292. {
  8293. actionResult.Status = (int)Constant.PDAResult.Fail;
  8294. actionResult.Message = "参数错误";
  8295. return actionResult;
  8296. }
  8297. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8298. DataTable gTable = new DataTable();
  8299. gTable.Columns.Add("GroutingLineID", typeof(int));
  8300. gTable.Columns.Add("GroutingLineCode");
  8301. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8302. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8303. gTable.Columns.Add("GroutingMouldCode");
  8304. gTable.Columns.Add("RecordRemarks");
  8305. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8306. gTable.Columns.Add("MouldID", typeof(int));
  8307. gTable.Columns.Add("MouldCode");
  8308. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8309. string groutingLineCode = data["GroutingLineCode"] + "";
  8310. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8311. foreach (Dictionary<string, object> item in details)
  8312. {
  8313. int? mouldID = null;
  8314. if (item.ContainsKey("MouldID"))
  8315. {
  8316. mouldID = Convert.ToInt32(item["MouldID"]);
  8317. if (mouldID == 0)
  8318. {
  8319. mouldID = null;
  8320. }
  8321. }
  8322. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8323. item["GLineDetailID"], item["GLineDetailCode"],
  8324. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8325. mouldID, item["MouldCode"]);
  8326. }
  8327. int result = PCModuleLogicDAL.StopGroutingLineDetail(gTable, sUserInfo);
  8328. if (result > 0)
  8329. {
  8330. actionResult.Status = (int)Constant.PDAResult.Success;
  8331. }
  8332. else
  8333. {
  8334. actionResult.Status = (int)Constant.PDAResult.Fail;
  8335. actionResult.Result = result;
  8336. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8337. return actionResult;
  8338. }
  8339. return actionResult;
  8340. }
  8341. #endregion
  8342. #region 启用
  8343. if (action == "StartGroutingLineDetail")
  8344. {
  8345. if (data == null || !data.ContainsKey("Details"))
  8346. {
  8347. actionResult.Status = (int)Constant.PDAResult.Fail;
  8348. actionResult.Message = "参数错误";
  8349. return actionResult;
  8350. }
  8351. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8352. DataTable gTable = new DataTable();
  8353. gTable.Columns.Add("GroutingLineID", typeof(int));
  8354. gTable.Columns.Add("GroutingLineCode");
  8355. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8356. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8357. gTable.Columns.Add("GroutingMouldCode");
  8358. gTable.Columns.Add("RecordRemarks");
  8359. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8360. gTable.Columns.Add("MouldID", typeof(int));
  8361. gTable.Columns.Add("MouldCode");
  8362. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8363. string groutingLineCode = data["GroutingLineCode"] + "";
  8364. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8365. foreach (Dictionary<string, object> item in details)
  8366. {
  8367. int? mouldID = null;
  8368. if (item.ContainsKey("MouldID"))
  8369. {
  8370. mouldID = Convert.ToInt32(item["MouldID"]);
  8371. if (mouldID == 0)
  8372. {
  8373. mouldID = null;
  8374. }
  8375. }
  8376. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8377. item["GLineDetailID"], item["GLineDetailCode"],
  8378. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8379. mouldID, item["MouldCode"]);
  8380. }
  8381. int result = PCModuleLogicDAL.StartGroutingLineDetail(gTable, sUserInfo);
  8382. if (result > 0)
  8383. {
  8384. actionResult.Status = (int)Constant.PDAResult.Success;
  8385. }
  8386. else
  8387. {
  8388. actionResult.Status = (int)Constant.PDAResult.Fail;
  8389. actionResult.Result = result;
  8390. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8391. return actionResult;
  8392. }
  8393. return actionResult;
  8394. }
  8395. #endregion
  8396. #region 维修
  8397. if (action == "RepairStartGroutingLineDetail")
  8398. {
  8399. if (data == null || !data.ContainsKey("Details"))
  8400. {
  8401. actionResult.Status = (int)Constant.PDAResult.Fail;
  8402. actionResult.Message = "参数错误";
  8403. return actionResult;
  8404. }
  8405. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8406. DataTable gTable = new DataTable();
  8407. gTable.Columns.Add("GroutingLineID", typeof(int));
  8408. gTable.Columns.Add("GroutingLineCode");
  8409. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8410. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8411. gTable.Columns.Add("GroutingMouldCode");
  8412. gTable.Columns.Add("RecordRemarks");
  8413. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8414. gTable.Columns.Add("MouldID", typeof(int));
  8415. gTable.Columns.Add("MouldCode");
  8416. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8417. string groutingLineCode = data["GroutingLineCode"] + "";
  8418. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8419. foreach (Dictionary<string, object> item in details)
  8420. {
  8421. int? mouldID = null;
  8422. if (item.ContainsKey("MouldID"))
  8423. {
  8424. mouldID = Convert.ToInt32(item["MouldID"]);
  8425. if (mouldID == 0)
  8426. {
  8427. mouldID = null;
  8428. }
  8429. }
  8430. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8431. item["GLineDetailID"], item["GLineDetailCode"],
  8432. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8433. mouldID, item["MouldCode"]);
  8434. }
  8435. int result = PCModuleLogicDAL.RepairStartGroutingLineDetail(gTable, sUserInfo);
  8436. if (result > 0)
  8437. {
  8438. actionResult.Status = (int)Constant.PDAResult.Success;
  8439. }
  8440. else
  8441. {
  8442. actionResult.Status = (int)Constant.PDAResult.Fail;
  8443. actionResult.Result = result;
  8444. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8445. return actionResult;
  8446. }
  8447. return actionResult;
  8448. }
  8449. #endregion
  8450. #region 结束维修
  8451. if (action == "RepairEndGroutingLineDetail")
  8452. {
  8453. if (data == null || !data.ContainsKey("Details"))
  8454. {
  8455. actionResult.Status = (int)Constant.PDAResult.Fail;
  8456. actionResult.Message = "参数错误";
  8457. return actionResult;
  8458. }
  8459. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8460. DataTable gTable = new DataTable();
  8461. gTable.Columns.Add("GroutingLineID", typeof(int));
  8462. gTable.Columns.Add("GroutingLineCode");
  8463. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8464. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8465. gTable.Columns.Add("GroutingMouldCode");
  8466. gTable.Columns.Add("RecordRemarks");
  8467. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8468. gTable.Columns.Add("MouldID", typeof(int));
  8469. gTable.Columns.Add("MouldCode");
  8470. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8471. string groutingLineCode = data["GroutingLineCode"] + "";
  8472. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8473. foreach (Dictionary<string, object> item in details)
  8474. {
  8475. int? mouldID = null;
  8476. if (item.ContainsKey("MouldID"))
  8477. {
  8478. mouldID = Convert.ToInt32(item["MouldID"]);
  8479. if (mouldID == 0)
  8480. {
  8481. mouldID = null;
  8482. }
  8483. }
  8484. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8485. item["GLineDetailID"], item["GLineDetailCode"],
  8486. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8487. mouldID, item["MouldCode"]);
  8488. }
  8489. int result = PCModuleLogicDAL.RepairEndGroutingLineDetail(gTable, sUserInfo);
  8490. if (result > 0)
  8491. {
  8492. actionResult.Status = (int)Constant.PDAResult.Success;
  8493. }
  8494. else
  8495. {
  8496. actionResult.Status = (int)Constant.PDAResult.Fail;
  8497. actionResult.Result = result;
  8498. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8499. return actionResult;
  8500. }
  8501. return actionResult;
  8502. }
  8503. #endregion
  8504. #region 换模
  8505. if (action == "ChangeGMouldStartGroutingLineDetail")
  8506. {
  8507. if (data == null || !data.ContainsKey("Details"))
  8508. {
  8509. actionResult.Status = (int)Constant.PDAResult.Fail;
  8510. actionResult.Message = "参数错误";
  8511. return actionResult;
  8512. }
  8513. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8514. DataTable gTable = new DataTable();
  8515. gTable.Columns.Add("GroutingLineID", typeof(int));
  8516. gTable.Columns.Add("GroutingLineCode");
  8517. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8518. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8519. gTable.Columns.Add("GroutingMouldCode");
  8520. gTable.Columns.Add("RecordRemarks");
  8521. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8522. gTable.Columns.Add("MouldID", typeof(int));
  8523. gTable.Columns.Add("MouldCode");
  8524. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8525. gTable.Columns.Add("MouldStatus", typeof(int));
  8526. gTable.Columns.Add("ScrapReason", typeof(int));
  8527. gTable.Columns.Add("ScrapResponsibility");
  8528. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8529. string groutingLineCode = data["GroutingLineCode"] + "";
  8530. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8531. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  8532. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  8533. string scrapResponsibility = data["ScrapRemarks"] + "";
  8534. foreach (Dictionary<string, object> item in details)
  8535. {
  8536. int? mouldID = null;
  8537. if (item.ContainsKey("MouldID"))
  8538. {
  8539. mouldID = Convert.ToInt32(item["MouldID"]);
  8540. if (mouldID == 0)
  8541. {
  8542. mouldID = null;
  8543. }
  8544. }
  8545. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8546. item["GLineDetailID"], item["GLineDetailCode"],
  8547. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8548. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  8549. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  8550. }
  8551. int result = PCModuleLogicDAL.ChangeGMouldStartGroutingLineDetail(gTable, sUserInfo);
  8552. if (result > 0)
  8553. {
  8554. actionResult.Status = (int)Constant.PDAResult.Success;
  8555. }
  8556. else
  8557. {
  8558. actionResult.Status = (int)Constant.PDAResult.Fail;
  8559. actionResult.Result = result;
  8560. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8561. return actionResult;
  8562. }
  8563. return actionResult;
  8564. }
  8565. #endregion
  8566. #region 变产
  8567. if (action == "UpdateLineStartGroutingLineDetail")
  8568. {
  8569. if (data == null || !data.ContainsKey("Details"))
  8570. {
  8571. actionResult.Status = (int)Constant.PDAResult.Fail;
  8572. actionResult.Message = "参数错误";
  8573. return actionResult;
  8574. }
  8575. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8576. DataTable gTable = new DataTable();
  8577. gTable.Columns.Add("GroutingLineID", typeof(int));
  8578. gTable.Columns.Add("GroutingLineCode");
  8579. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8580. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8581. gTable.Columns.Add("GroutingMouldCode");
  8582. gTable.Columns.Add("RecordRemarks");
  8583. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8584. gTable.Columns.Add("MouldID", typeof(int));
  8585. gTable.Columns.Add("MouldCode");
  8586. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8587. gTable.Columns.Add("MouldStatus", typeof(int));
  8588. gTable.Columns.Add("ScrapReason", typeof(int));
  8589. gTable.Columns.Add("ScrapResponsibility");
  8590. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8591. string groutingLineCode = data["GroutingLineCode"] + "";
  8592. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8593. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  8594. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  8595. string scrapResponsibility = data["ScrapRemarks"] + "";
  8596. foreach (Dictionary<string, object> item in details)
  8597. {
  8598. int? mouldID = null;
  8599. if (item.ContainsKey("MouldID"))
  8600. {
  8601. mouldID = Convert.ToInt32(item["MouldID"]);
  8602. if (mouldID == 0)
  8603. {
  8604. mouldID = null;
  8605. }
  8606. }
  8607. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8608. item["GLineDetailID"], item["GLineDetailCode"],
  8609. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8610. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  8611. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  8612. }
  8613. int result = PCModuleLogicDAL.UpdateLineStartGroutingLineDetail(gTable, sUserInfo);
  8614. if (result > 0)
  8615. {
  8616. actionResult.Status = (int)Constant.PDAResult.Success;
  8617. }
  8618. else
  8619. {
  8620. actionResult.Status = (int)Constant.PDAResult.Fail;
  8621. actionResult.Result = result;
  8622. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8623. return actionResult;
  8624. }
  8625. return actionResult;
  8626. }
  8627. #endregion
  8628. #region 整线变产
  8629. if (action == "UpdateAllLineStartGroutingLineDetail")
  8630. {
  8631. if (data == null || !data.ContainsKey("Details"))
  8632. {
  8633. actionResult.Status = (int)Constant.PDAResult.Fail;
  8634. actionResult.Message = "参数错误";
  8635. return actionResult;
  8636. }
  8637. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8638. DataTable gTable = new DataTable();
  8639. gTable.Columns.Add("GroutingLineID", typeof(int));
  8640. gTable.Columns.Add("GroutingLineCode");
  8641. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8642. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8643. gTable.Columns.Add("GroutingMouldCode");
  8644. gTable.Columns.Add("RecordRemarks");
  8645. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8646. gTable.Columns.Add("MouldID", typeof(int));
  8647. gTable.Columns.Add("MouldCode");
  8648. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8649. gTable.Columns.Add("MouldStatus", typeof(int));
  8650. gTable.Columns.Add("ScrapReason", typeof(int));
  8651. gTable.Columns.Add("ScrapResponsibility");
  8652. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8653. string groutingLineCode = data["GroutingLineCode"] + "";
  8654. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8655. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  8656. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  8657. string scrapResponsibility = data["ScrapRemarks"] + "";
  8658. foreach (Dictionary<string, object> item in details)
  8659. {
  8660. int? mouldID = null;
  8661. if (item.ContainsKey("MouldID"))
  8662. {
  8663. mouldID = Convert.ToInt32(item["MouldID"]);
  8664. if (mouldID == 0)
  8665. {
  8666. mouldID = null;
  8667. }
  8668. }
  8669. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8670. item["GLineDetailID"], item["GLineDetailCode"],
  8671. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8672. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  8673. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  8674. }
  8675. int result = PCModuleLogicDAL.UpdateAllLineStartGroutingLineDetail(gTable, groutingLineID, lineOPTimeStamp, sUserInfo);
  8676. if (result > 0)
  8677. {
  8678. actionResult.Status = (int)Constant.PDAResult.Success;
  8679. }
  8680. else
  8681. {
  8682. actionResult.Status = (int)Constant.PDAResult.Fail;
  8683. actionResult.Result = result;
  8684. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8685. return actionResult;
  8686. }
  8687. return actionResult;
  8688. }
  8689. #endregion
  8690. #region 卸模
  8691. if (action == "UnloadGroutingLineDetail")
  8692. {
  8693. if (data == null || !data.ContainsKey("Details"))
  8694. {
  8695. actionResult.Status = (int)Constant.PDAResult.Fail;
  8696. actionResult.Message = "参数错误";
  8697. return actionResult;
  8698. }
  8699. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8700. DataTable gTable = new DataTable();
  8701. gTable.Columns.Add("GroutingLineID", typeof(int));
  8702. gTable.Columns.Add("GroutingLineCode");
  8703. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8704. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8705. gTable.Columns.Add("GroutingMouldCode");
  8706. gTable.Columns.Add("RecordRemarks");
  8707. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8708. gTable.Columns.Add("MouldID", typeof(int));
  8709. gTable.Columns.Add("MouldCode");
  8710. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8711. gTable.Columns.Add("MouldStatus", typeof(int));
  8712. gTable.Columns.Add("ScrapReason", typeof(int));
  8713. gTable.Columns.Add("ScrapResponsibility");
  8714. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8715. string groutingLineCode = data["GroutingLineCode"] + "";
  8716. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8717. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  8718. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  8719. string scrapResponsibility = data["ScrapRemarks"] + "";
  8720. foreach (Dictionary<string, object> item in details)
  8721. {
  8722. int? mouldID = null;
  8723. if (item.ContainsKey("MouldID"))
  8724. {
  8725. mouldID = Convert.ToInt32(item["MouldID"]);
  8726. if (mouldID == 0)
  8727. {
  8728. mouldID = null;
  8729. }
  8730. }
  8731. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8732. item["GLineDetailID"], item["GLineDetailCode"],
  8733. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8734. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  8735. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  8736. }
  8737. int result = PCModuleLogicDAL.UnloadGroutingLineDetail(gTable, sUserInfo);
  8738. if (result > 0)
  8739. {
  8740. actionResult.Status = (int)Constant.PDAResult.Success;
  8741. }
  8742. else
  8743. {
  8744. actionResult.Status = (int)Constant.PDAResult.Fail;
  8745. actionResult.Result = result;
  8746. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8747. return actionResult;
  8748. }
  8749. return actionResult;
  8750. }
  8751. #endregion
  8752. #region 结束换模
  8753. if (action == "ChangeGMouldEndGroutingLineDetail")
  8754. {
  8755. if (data == null || !data.ContainsKey("Details"))
  8756. {
  8757. actionResult.Status = (int)Constant.PDAResult.Fail;
  8758. actionResult.Message = "参数错误";
  8759. return actionResult;
  8760. }
  8761. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8762. DataTable gTable = new DataTable();
  8763. gTable.Columns.Add("GroutingLineID", typeof(int));
  8764. gTable.Columns.Add("GroutingLineCode");
  8765. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8766. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8767. gTable.Columns.Add("GroutingMouldCode");
  8768. gTable.Columns.Add("RreasonRemarks");
  8769. gTable.Columns.Add("RecordRemarks");
  8770. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8771. gTable.Columns.Add("MouldID", typeof(int));
  8772. gTable.Columns.Add("MouldCode");
  8773. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8774. gTable.Columns.Add("GoodsID", typeof(int));
  8775. gTable.Columns.Add("GoodsCode");
  8776. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  8777. gTable.Columns.Add("GroutingCount", typeof(int));
  8778. gTable.Columns.Add("MouldSource");
  8779. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8780. string groutingLineCode = data["GroutingLineCode"] + "";
  8781. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8782. foreach (Dictionary<string, object> item in details)
  8783. {
  8784. int? mouldID = null;
  8785. if (item.ContainsKey("MouldID"))
  8786. {
  8787. mouldID = Convert.ToInt32(item["MouldID"]);
  8788. if (mouldID == 0)
  8789. {
  8790. mouldID = null;
  8791. }
  8792. }
  8793. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8794. item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"],
  8795. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8796. mouldID, item["MouldCode"], item["MouldOutputNo"],
  8797. item["GoodsID"], item["GoodsCode"],
  8798. item["StandardGroutingCount"], item["GroutingCount"],
  8799. (mouldID == null ? "0" : "1"));
  8800. }
  8801. ServiceResultEntity result = PCModuleLogicDAL.ChangeGMouldEndGroutingLineDetail(gTable, sUserInfo);
  8802. if (result.Status == Constant.ServiceResultStatus.Success)
  8803. {
  8804. actionResult.Status = (int)Constant.PDAResult.Success;
  8805. }
  8806. else if (result.OtherStatus == -100)
  8807. {
  8808. actionResult.Status = (int)Constant.PDAResult.Fail;
  8809. actionResult.Result = -100;
  8810. actionResult.Message = result.Message;
  8811. return actionResult;
  8812. }
  8813. else
  8814. {
  8815. actionResult.Status = (int)Constant.PDAResult.Fail;
  8816. actionResult.Result = -500;
  8817. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8818. return actionResult;
  8819. }
  8820. return actionResult;
  8821. }
  8822. #endregion
  8823. #region 结束变产
  8824. if (action == "UpdateLineEndGroutingLineDetail")
  8825. {
  8826. if (data == null || !data.ContainsKey("Details"))
  8827. {
  8828. actionResult.Status = (int)Constant.PDAResult.Fail;
  8829. actionResult.Message = "参数错误";
  8830. return actionResult;
  8831. }
  8832. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8833. DataTable gTable = new DataTable();
  8834. gTable.Columns.Add("GroutingLineID", typeof(int));
  8835. gTable.Columns.Add("GroutingLineCode");
  8836. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8837. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8838. gTable.Columns.Add("GroutingMouldCode");
  8839. gTable.Columns.Add("RreasonRemarks");
  8840. gTable.Columns.Add("RecordRemarks");
  8841. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8842. gTable.Columns.Add("MouldID", typeof(int));
  8843. gTable.Columns.Add("MouldCode");
  8844. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8845. gTable.Columns.Add("GoodsID", typeof(int));
  8846. gTable.Columns.Add("GoodsCode");
  8847. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  8848. gTable.Columns.Add("GroutingCount", typeof(int));
  8849. gTable.Columns.Add("MouldSource");
  8850. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8851. string groutingLineCode = data["GroutingLineCode"] + "";
  8852. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8853. foreach (Dictionary<string, object> item in details)
  8854. {
  8855. int? mouldID = null;
  8856. if (item.ContainsKey("MouldID"))
  8857. {
  8858. mouldID = Convert.ToInt32(item["MouldID"]);
  8859. if (mouldID == 0)
  8860. {
  8861. mouldID = null;
  8862. }
  8863. }
  8864. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8865. item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"],
  8866. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8867. mouldID, item["MouldCode"], item["MouldOutputNo"],
  8868. item["GoodsID"], item["GoodsCode"],
  8869. item["StandardGroutingCount"], item["GroutingCount"],
  8870. (mouldID == null ? "0" : "1"));
  8871. }
  8872. ServiceResultEntity result = PCModuleLogicDAL.UpdateLineEndGroutingLineDetail(gTable, 0, sUserInfo);
  8873. if (result.Status == Constant.ServiceResultStatus.Success)
  8874. {
  8875. actionResult.Status = (int)Constant.PDAResult.Success;
  8876. }
  8877. else if (result.OtherStatus == -100)
  8878. {
  8879. actionResult.Status = (int)Constant.PDAResult.Fail;
  8880. actionResult.Result = -100;
  8881. actionResult.Message = result.Message;
  8882. return actionResult;
  8883. }
  8884. else
  8885. {
  8886. actionResult.Status = (int)Constant.PDAResult.Fail;
  8887. actionResult.Result = -500;
  8888. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8889. return actionResult;
  8890. }
  8891. return actionResult;
  8892. }
  8893. #endregion
  8894. #region 结束整线变产
  8895. if (action == "UpdateAllLineEndGroutingLineDetail")
  8896. {
  8897. if (data == null || !data.ContainsKey("Details"))
  8898. {
  8899. actionResult.Status = (int)Constant.PDAResult.Fail;
  8900. actionResult.Message = "参数错误";
  8901. return actionResult;
  8902. }
  8903. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8904. DataTable gTable = new DataTable();
  8905. gTable.Columns.Add("GroutingLineID", typeof(int));
  8906. gTable.Columns.Add("GroutingLineCode");
  8907. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8908. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8909. gTable.Columns.Add("GroutingMouldCode");
  8910. gTable.Columns.Add("Remarks");
  8911. gTable.Columns.Add("RecordRemarks");
  8912. //gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8913. gTable.Columns.Add("MouldID", typeof(int));
  8914. gTable.Columns.Add("MouldCode");
  8915. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8916. gTable.Columns.Add("GoodsID", typeof(int));
  8917. gTable.Columns.Add("GoodsCode");
  8918. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  8919. gTable.Columns.Add("GroutingCount", typeof(int));
  8920. gTable.Columns.Add("MouldSource");
  8921. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8922. string groutingLineCode = data["GroutingLineCode"] + "";
  8923. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8924. foreach (Dictionary<string, object> item in details)
  8925. {
  8926. int? mouldID = null;
  8927. if (item.ContainsKey("MouldID"))
  8928. {
  8929. mouldID = Convert.ToInt32(item["MouldID"]);
  8930. if (mouldID == 0)
  8931. {
  8932. mouldID = null;
  8933. }
  8934. }
  8935. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8936. item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"],
  8937. item["RecordRemarks"], //Convert.ToDateTime(item["OPTimeStamp"]),
  8938. mouldID, item["MouldCode"], item["MouldOutputNo"],
  8939. item["GoodsID"], item["GoodsCode"],
  8940. item["StandardGroutingCount"], item["GroutingCount"],
  8941. (mouldID == null ? "0" : "1"));
  8942. }
  8943. ServiceResultEntity result = PCModuleLogicDAL.UpdateAllLineEndGroutingLineDetail(gTable, null, groutingLineID, lineOPTimeStamp, sUserInfo);
  8944. if (result.Status == Constant.ServiceResultStatus.Success)
  8945. {
  8946. actionResult.Status = (int)Constant.PDAResult.Success;
  8947. }
  8948. else if (result.OtherStatus == -100)
  8949. {
  8950. actionResult.Status = (int)Constant.PDAResult.Fail;
  8951. actionResult.Result = -100;
  8952. actionResult.Message = result.Message;
  8953. return actionResult;
  8954. }
  8955. else
  8956. {
  8957. actionResult.Status = (int)Constant.PDAResult.Fail;
  8958. actionResult.Result = -500;
  8959. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8960. return actionResult;
  8961. }
  8962. return actionResult;
  8963. }
  8964. #endregion
  8965. #region 上模
  8966. if (action == "UpdateGroutingLine_AddMould")
  8967. {
  8968. if (data == null || !data.ContainsKey("Details"))
  8969. {
  8970. actionResult.Status = (int)Constant.PDAResult.Fail;
  8971. actionResult.Message = "参数错误";
  8972. return actionResult;
  8973. }
  8974. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8975. DataTable gTable = new DataTable();
  8976. gTable.Columns.Add("GroutingLineID", typeof(int));
  8977. gTable.Columns.Add("GroutingLineCode");
  8978. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8979. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8980. gTable.Columns.Add("GroutingMouldCode");
  8981. gTable.Columns.Add("Remarks");
  8982. gTable.Columns.Add("RecordRemarks");
  8983. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8984. gTable.Columns.Add("MouldID", typeof(int));
  8985. gTable.Columns.Add("MouldCode");
  8986. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8987. gTable.Columns.Add("GoodsID", typeof(int));
  8988. gTable.Columns.Add("GoodsCode");
  8989. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  8990. gTable.Columns.Add("GroutingCount", typeof(int));
  8991. gTable.Columns.Add("MouldSource");
  8992. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8993. string groutingLineCode = data["GroutingLineCode"] + "";
  8994. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8995. foreach (Dictionary<string, object> item in details)
  8996. {
  8997. int? mouldID = null;
  8998. if (item.ContainsKey("MouldID"))
  8999. {
  9000. mouldID = Convert.ToInt32(item["MouldID"]);
  9001. if (mouldID == 0)
  9002. {
  9003. mouldID = null;
  9004. }
  9005. }
  9006. int gldID = Convert.ToInt32(item["GLineDetailID"]);
  9007. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9008. gldID, item["GLineDetailCode"],
  9009. item["DetailRemarks"], item["RecordRemarks"],
  9010. (gldID > 0 ? (object)Convert.ToDateTime(item["OPTimeStamp"]) : null),
  9011. mouldID, item["MouldCode"], item["MouldOutputNo"],
  9012. item["GoodsID"], item["GoodsCode"],
  9013. item["StandardGroutingCount"], item["GroutingCount"],
  9014. (mouldID == null ? "0" : "1"));
  9015. }
  9016. ServiceResultEntity result = PCModuleLogicDAL.UpdateGroutingLine_AddMould(groutingLineID, groutingLineCode, lineOPTimeStamp, gTable, sUserInfo);
  9017. if (result.Status == Constant.ServiceResultStatus.Success)
  9018. {
  9019. actionResult.Status = (int)Constant.PDAResult.Success;
  9020. }
  9021. else if (result.OtherStatus == -2 || result.OtherStatus == -100)
  9022. {
  9023. actionResult.Status = (int)Constant.PDAResult.Fail;
  9024. actionResult.Result = result.OtherStatus;
  9025. actionResult.Message = result.Message;
  9026. return actionResult;
  9027. }
  9028. else
  9029. {
  9030. actionResult.Status = (int)Constant.PDAResult.Fail;
  9031. actionResult.Result = -500;
  9032. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9033. return actionResult;
  9034. }
  9035. return actionResult;
  9036. }
  9037. #endregion
  9038. return actionResult;
  9039. }
  9040. #endregion
  9041. #region 包装装板限制
  9042. if (module == "FinishedLoadingCar")
  9043. {
  9044. if (action == "GetSetting")
  9045. {
  9046. ClientRequestEntity cre = new ClientRequestEntity();
  9047. cre.Properties["GoodsID"] = data["GoodsID"];
  9048. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetFinishedLoadingCarSetting(sUserInfo, cre);
  9049. if (sre.Status == Constant.ServiceResultStatus.Success)
  9050. {
  9051. actionResult.Status = (int)Constant.PDAResult.Success;
  9052. foreach (DataRow item in sre.Data.Tables[0].Rows)
  9053. {
  9054. if (item["settingcode"].ToString() == "S_PM_011")
  9055. {
  9056. cre.Properties["S_PM_011"] = item["settingvalue"];
  9057. }
  9058. else if (item["settingcode"].ToString() == "S_PM_012")
  9059. {
  9060. cre.Properties["S_PM_012"] = item["settingvalue"];
  9061. }
  9062. else if (item["settingcode"].ToString() == "S_PM_013")
  9063. {
  9064. cre.Properties["S_PM_013"] = item["settingvalue"];
  9065. }
  9066. }
  9067. cre.Properties["PlatelitNum"] = sre.Result;
  9068. actionResult.Result = JsonHelper.ToJson(cre.Properties);
  9069. }
  9070. else
  9071. {
  9072. actionResult.Status = (int)Constant.PDAResult.Fail;
  9073. actionResult.Message = "";
  9074. }
  9075. return actionResult;
  9076. }
  9077. }
  9078. #endregion
  9079. #region 成型报损
  9080. if (module == "GroutingScrapProduct")
  9081. {
  9082. // 查询注浆日报明细表
  9083. if ("GetGroutingDailyDetail" == action)
  9084. {
  9085. ClientRequestEntity cre = new ClientRequestEntity();
  9086. cre.NameSpace = module;
  9087. cre.Name = action;
  9088. if (!string.IsNullOrEmpty(jsonData))
  9089. {
  9090. cre.Properties["BarCode"] = data["BarCode"];
  9091. }
  9092. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetGroutingDailyDetail(cre, sUserInfo);
  9093. //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9094. actionResult.Status = (int)Constant.PDAResult.Success;
  9095. if (sre == null || sre.Data == null || sre.Data.Tables.Count == 0
  9096. || sre.Data.Tables[0].Rows.Count == 0)
  9097. {
  9098. actionResult.Message = "未查询到该产品信息,请确认该产品是否已经进行注浆!";
  9099. actionResult.Status = (int)Constant.PDAResult.Fail;
  9100. }
  9101. else
  9102. {
  9103. DataRow _barCodeRow = sre.Data.Tables[0].Rows[0];
  9104. // 判断是否进行了注浆
  9105. if ("0".Equals(_barCodeRow["GroutingFlag"]))
  9106. {
  9107. actionResult.Message = "该产品还未进行注浆!";
  9108. actionResult.Status = (int)Constant.PDAResult.Fail;
  9109. }
  9110. // 判断是否进行了交坯
  9111. if ("1".Equals(_barCodeRow["DeliverFlag"]))
  9112. {
  9113. actionResult.Message = "该产品已经交坯!";
  9114. actionResult.Status = (int)Constant.PDAResult.Fail;
  9115. }
  9116. // 判断是否已经报损
  9117. if ("1".Equals(_barCodeRow["ScrapFlag"]))
  9118. {
  9119. actionResult.Message = "该产品已经报损!";
  9120. actionResult.Status = (int)Constant.PDAResult.Fail;
  9121. }
  9122. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9123. }
  9124. }
  9125. // 获取成型报损原因
  9126. else if ("GetScrapReasonData" == action)
  9127. {
  9128. ClientRequestEntity cre = new ClientRequestEntity();
  9129. cre.NameSpace = module;
  9130. cre.Name = action;
  9131. ServiceResultEntity sre = SystemModuleLogic.GetScrapReasonData(cre, sUserInfo);
  9132. actionResult.Status = (int)Constant.PDAResult.Success;
  9133. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9134. }
  9135. // 保存成型报损
  9136. else if ("SaveGroutingScrapProduct" == action)
  9137. {
  9138. ClientRequestEntity cre = new ClientRequestEntity();
  9139. cre.NameSpace = module;
  9140. cre.Name = action;
  9141. if (!string.IsNullOrEmpty(jsonData))
  9142. {
  9143. // DataSet returnData = JsonHelper.FromJson<DataSet>(jsonData);
  9144. DataTable dt = JsonHelper.FromJson<DataTable>(data["Table"] + "");
  9145. DataTable dtResponsible = JsonHelper.FromJson<DataTable>(data["Table1"] + "");
  9146. if (dt != null && dt.Rows.Count > 0)
  9147. {
  9148. // 总单信息
  9149. DataRow properties = dt.Rows[0];
  9150. cre.Properties["BarCode"] = properties["BarCode"]; // 产品条码
  9151. cre.Properties["GoodsID"] = properties["GoodsID"]; // 产品ID
  9152. cre.Properties["GoodsCode"] = properties["GoodsCode"]; // 产品编码
  9153. cre.Properties["GoodsName"] = properties["GoodsName"]; // 产品名称
  9154. cre.Properties["GroutingDailyID"] = properties["GroutingDailyID"]; // 注浆日报ID
  9155. cre.Properties["GroutingDailyDetailID"] = properties["GroutingDailyDetailID"]; // 注浆日报明细ID
  9156. cre.Properties["GroutingDate"] = properties["GroutingDate"]; // 注浆日期
  9157. cre.Properties["GroutingLineID"] = properties["GroutingLineID"]; // 成型生产线ID
  9158. cre.Properties["GroutingLineCode"] = properties["GroutingLineCode"]; // 成型生产线编码
  9159. cre.Properties["GroutingLineName"] = properties["GroutingLineName"]; // 成型生产线名称
  9160. cre.Properties["GMouldTypeID"] = properties["GMouldTypeID"]; // 成型线类型ID
  9161. cre.Properties["GroutingLineDetailID"] = properties["GroutingLineDetailID"]; // 成型生产线明细ID
  9162. cre.Properties["GroutingMouldCode"] = properties["GroutingMouldCode"]; // 注浆模具编号
  9163. cre.Properties["MouldCode"] = properties["MouldCode"]; // 模具编号
  9164. cre.Properties["GroutingUserID"] = properties["GroutingUserID"]; // 注浆工号ID
  9165. cre.Properties["GroutingUserCode"] = properties["GroutingUserCode"]; // 注浆工号编码
  9166. cre.Properties["GroutingNum"] = properties["GroutingNum"]; // 注浆次数
  9167. cre.Properties["ScrapType"] = properties["ScrapType"]; // 损坯类型
  9168. cre.Properties["ScrapDate"] = properties["ScrapDate"]; // 报损日期
  9169. cre.Properties["ScrapRreasonID"] = properties["ScrapRreasonID"]; // 报损日期
  9170. cre.Properties["ResponUserID"] = properties["ResponUserID"]; // 损坯工号
  9171. cre.Properties["ResponUserCode"] = properties["ResponUserCode"];
  9172. cre.Properties["Remarks"] = properties["Remarks"]; // 备注
  9173. cre.Properties["AuditStatus"] = properties["AuditStatus"]; // 审批状态
  9174. // 责任员工
  9175. cre.Data = new DataSet();
  9176. //DataTable returnTable = returnData.Tables[1].Copy();
  9177. cre.Data.Tables.Add(dtResponsible);
  9178. }
  9179. }
  9180. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveGroutingScrapProduct(cre, sUserInfo);
  9181. if (sre.Status == Constant.ServiceResultStatus.Success)
  9182. {
  9183. actionResult.Status = (int)Constant.PDAResult.Success;
  9184. actionResult.Result = sre.Result;
  9185. }
  9186. else
  9187. {
  9188. actionResult.Status = (int)Constant.PDAResult.Fail;
  9189. actionResult.Result = sre.OtherStatus;
  9190. actionResult.Message = sre.Message;
  9191. }
  9192. }
  9193. // 获取成型报损信息 用于撤销使用
  9194. else if ("GetGroutingScrapProduct" == action)
  9195. {
  9196. ClientRequestEntity cre = new ClientRequestEntity();
  9197. cre.NameSpace = module;
  9198. cre.Name = action;
  9199. if (!string.IsNullOrEmpty(jsonData))
  9200. {
  9201. cre.Properties["BarCode"] = data["BarCode"];
  9202. }
  9203. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetGroutingScrapProduct(cre, sUserInfo);
  9204. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9205. actionResult.Status = (int)Constant.PDAResult.Success;
  9206. }
  9207. // 撤销成型报损
  9208. else if ("ReverseGroutingScrapProduct" == action)
  9209. {
  9210. ClientRequestEntity cre = new ClientRequestEntity();
  9211. cre.NameSpace = module;
  9212. cre.Name = action;
  9213. if (!string.IsNullOrEmpty(jsonData))
  9214. {
  9215. cre.Properties["BarCode"] = data["BarCode"];
  9216. }
  9217. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.ReverseGroutingScrapProduct(cre, sUserInfo);
  9218. if (sre.Status == Constant.ServiceResultStatus.Success)
  9219. {
  9220. actionResult.Status = (int)Constant.PDAResult.Success;
  9221. actionResult.Result = sre.Result;
  9222. }
  9223. else
  9224. {
  9225. actionResult.Status = (int)Constant.PDAResult.Fail;
  9226. actionResult.Result = sre.OtherStatus;
  9227. actionResult.Message = sre.Message;
  9228. }
  9229. }
  9230. }
  9231. #endregion
  9232. #region 产品挂起
  9233. if (module == "ProductSuspend")
  9234. {
  9235. // 获取可以挂起的工序(干补、装车、入窑、出窑)工序不能挂起
  9236. if (action == "GetSuspendProcedure")
  9237. {
  9238. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetSuspendProcedure(sUserInfo);
  9239. if (sre.Status == Constant.ServiceResultStatus.Success)
  9240. {
  9241. actionResult.Status = (int)Constant.PDAResult.Success;
  9242. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9243. }
  9244. else
  9245. {
  9246. actionResult.Status = (int)Constant.PDAResult.Fail;
  9247. actionResult.Message = sre.Message;
  9248. }
  9249. return actionResult;
  9250. }
  9251. // 验证挂起条码
  9252. if (action == "CheckSuspendBarcode")
  9253. {
  9254. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.CheckSuspendBarcode(sUserInfo, data["barcode"] + "");
  9255. if (sre.Status == Constant.ServiceResultStatus.Success)
  9256. {
  9257. actionResult.Status = (int)Constant.PDAResult.Success;
  9258. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9259. }
  9260. else
  9261. {
  9262. actionResult.Status = (int)Constant.PDAResult.Fail;
  9263. actionResult.Message = sre.Message;
  9264. }
  9265. return actionResult;
  9266. }
  9267. // 挂起条码
  9268. if (action == "SaveSuspendProduct")
  9269. {
  9270. int[] gids = JsonHelper.FromJson<int[]>(data["groutingdailydetailids"] + "");
  9271. int[] pids = JsonHelper.FromJson<int[]>(data["procedureids"] + "");
  9272. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveSuspendProduct(sUserInfo, pids, gids, data["remarks"] + "");
  9273. if (sre.Status == Constant.ServiceResultStatus.Success)
  9274. {
  9275. actionResult.Status = (int)Constant.PDAResult.Success;
  9276. //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9277. }
  9278. else
  9279. {
  9280. actionResult.Status = (int)Constant.PDAResult.Fail;
  9281. actionResult.Message = sre.Message;
  9282. }
  9283. return actionResult;
  9284. }
  9285. // 撤销挂起条码
  9286. if (action == "DeleteSuspendProduct")
  9287. {
  9288. int[] gids = JsonHelper.FromJson<int[]>(data["groutingdailydetailids"] + "");
  9289. int[] pids = JsonHelper.FromJson<int[]>(data["procedureids"] + "");
  9290. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.DeleteSuspendProduct(sUserInfo, pids, gids);
  9291. if (sre.Status == Constant.ServiceResultStatus.Success)
  9292. {
  9293. actionResult.Status = (int)Constant.PDAResult.Success;
  9294. //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9295. }
  9296. else
  9297. {
  9298. actionResult.Status = (int)Constant.PDAResult.Fail;
  9299. actionResult.Message = sre.Message;
  9300. }
  9301. return actionResult;
  9302. }
  9303. // 查询挂起条码
  9304. if (action == "GetSuspendProduct")
  9305. {
  9306. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetSuspendProduct(sUserInfo, data["barcode"] + "");
  9307. if (sre.Status == Constant.ServiceResultStatus.Success)
  9308. {
  9309. if (sre.Data.Tables[0].Rows.Count == 0)
  9310. {
  9311. actionResult.Status = (int)Constant.PDAResult.Fail;
  9312. actionResult.Message = "此条码没有可撤销的挂起信息";
  9313. }
  9314. else
  9315. {
  9316. actionResult.Status = (int)Constant.PDAResult.Success;
  9317. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9318. }
  9319. }
  9320. else
  9321. {
  9322. actionResult.Status = (int)Constant.PDAResult.Fail;
  9323. actionResult.Message = sre.Message;
  9324. }
  9325. return actionResult;
  9326. }
  9327. }
  9328. #endregion
  9329. #region 品保抽查
  9330. if (module == "QASpotCheck")
  9331. {
  9332. if (action == "GetAllQASpotCheck")
  9333. {
  9334. ClientRequestEntity cre = new ClientRequestEntity();
  9335. cre.NameSpace = module;
  9336. cre.Name = action;
  9337. if (data != null && data.Count > 0)
  9338. {
  9339. foreach (string item in data.Keys)
  9340. {
  9341. if (item.StartsWith("checktime"))
  9342. {
  9343. cre.Properties.Add(item, DateTime.ParseExact(data[item] + "", "yyyy-MM-dd", null));
  9344. }
  9345. else
  9346. {
  9347. cre.Properties.Add(item, data[item]);
  9348. }
  9349. }
  9350. }
  9351. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetAllQASpotCheck(sUserInfo, cre));
  9352. if (sre.Status == Constant.ServiceResultStatus.Success)
  9353. {
  9354. actionResult.Status = (int)Constant.PDAResult.Success;
  9355. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9356. }
  9357. else if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  9358. {
  9359. actionResult.Status = (int)Constant.PDAResult.Success;
  9360. }
  9361. else
  9362. {
  9363. actionResult.Status = (int)Constant.PDAResult.Fail;
  9364. actionResult.Message = sre.Message;
  9365. }
  9366. return actionResult;
  9367. }
  9368. if (action == "AutoSaveQASpotCheck")
  9369. {
  9370. string barcode = data["barcode"] + "";
  9371. string remarks = data["remarks"] + "";
  9372. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.AutoSaveQASpotCheck(sUserInfo, barcode, remarks));
  9373. if (sre.Status == Constant.ServiceResultStatus.Success)
  9374. {
  9375. actionResult.Status = (int)Constant.PDAResult.Success;
  9376. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9377. }
  9378. else
  9379. {
  9380. actionResult.Status = (int)Constant.PDAResult.Fail;
  9381. actionResult.Message = sre.Message;
  9382. }
  9383. return actionResult;
  9384. }
  9385. if (action == "CheckQASpotCheck")
  9386. {
  9387. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.CheckQASpotCheck(sUserInfo, jsonData));
  9388. if (sre.Status == Constant.ServiceResultStatus.Success)
  9389. {
  9390. actionResult.Status = (int)Constant.PDAResult.Success;
  9391. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9392. }
  9393. else
  9394. {
  9395. actionResult.Status = (int)Constant.PDAResult.Fail;
  9396. actionResult.Message = sre.Message;
  9397. }
  9398. return actionResult;
  9399. }
  9400. if (action == "SaveQASpotCheck")
  9401. {
  9402. data["CheckTime"] = DateTime.ParseExact(data["CheckTime"] + "", "yyyy-MM-dd HH:mm:ss", null);
  9403. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveQASpotCheck(sUserInfo, data));
  9404. if (sre.Status == Constant.ServiceResultStatus.Success)
  9405. {
  9406. actionResult.Status = (int)Constant.PDAResult.Success;
  9407. }
  9408. else
  9409. {
  9410. actionResult.Status = (int)Constant.PDAResult.Fail;
  9411. actionResult.Message = sre.Message;
  9412. }
  9413. return actionResult;
  9414. }
  9415. return null;
  9416. }
  9417. #endregion
  9418. #region 产成品交接
  9419. if (module == "FinishedProduct")
  9420. {
  9421. // 设定商标
  9422. if (action == "GetFinishedBarcode")
  9423. {
  9424. string barcode = data["barcode"].ToString();
  9425. ServiceResultEntity resultEntity = PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo, 2);
  9426. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9427. if (Convert.ToInt32(resultEntity.Result) < 0)
  9428. {
  9429. actionResult.Status = (int)Constant.PDAResult.Fail;
  9430. actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
  9431. actionResult.Message = resultEntity.Message;
  9432. }
  9433. else
  9434. {
  9435. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9436. actionResult.Status = (int)Constant.PDAResult.Success;
  9437. actionResult.Message = resultEntity.Message;
  9438. }
  9439. return actionResult;
  9440. }
  9441. if (action == "GetHandoveredBarcode")
  9442. {
  9443. string barcode = data["barcode"].ToString();
  9444. ServiceResultEntity resultEntity = PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo, 1);
  9445. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9446. if (Convert.ToInt32(resultEntity.Result) < 0)
  9447. {
  9448. actionResult.Status = (int)Constant.PDAResult.Fail;
  9449. actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
  9450. actionResult.Message = resultEntity.Message;
  9451. }
  9452. else
  9453. {
  9454. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9455. actionResult.Status = (int)Constant.PDAResult.Success;
  9456. actionResult.Message = resultEntity.Message;
  9457. }
  9458. return actionResult;
  9459. }
  9460. if (action == "SetFinishedLogo")
  9461. {
  9462. int logoid = Convert.ToInt32(data["logoid"]);
  9463. string[] barcodes = data["barcodes"].ToString().Split(',');
  9464. int result = PMModuleLogicDAL.SetFinishedLogo(barcodes, logoid, sUserInfo);
  9465. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9466. if (result < 0)
  9467. {
  9468. actionResult.Status = (int)Constant.PDAResult.Fail;
  9469. }
  9470. else
  9471. {
  9472. actionResult.Status = (int)Constant.PDAResult.Success;
  9473. }
  9474. return actionResult;
  9475. }
  9476. if (action == "SetHandoveredOrder")
  9477. {
  9478. int orderID = Convert.ToInt32(data["orderID"]);
  9479. string[] barcodes = data["barcodes"].ToString().Split(',');
  9480. int result = PMModuleLogicDAL.SetHandoveredOrder(barcodes, orderID, sUserInfo);
  9481. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9482. if (result < 0)
  9483. {
  9484. actionResult.Status = (int)Constant.PDAResult.Fail;
  9485. }
  9486. else
  9487. {
  9488. actionResult.Status = (int)Constant.PDAResult.Success;
  9489. }
  9490. return actionResult;
  9491. }
  9492. }
  9493. #endregion
  9494. #region 产成品装车
  9495. /*
  9496. if (module == "FinishedLoading")
  9497. {
  9498. // 设定商标
  9499. if (action == "GetMaxLoadingNo")
  9500. {
  9501. int no = Service.PMModuleService.PMModuleLogic.GetMaxLoadingNo(sUserInfo);
  9502. actionResult.Status = (int)Constant.PDAResult.Success;
  9503. actionResult.Result = no;
  9504. return actionResult;
  9505. }
  9506. if (action == "CheckFinishedLaodingBarcode")
  9507. {
  9508. string barcode = data["barcode"].ToString();
  9509. ServiceResultEntity resultEntity = Service.PMModuleService.PMModuleLogic.CheckFinishedLaodingBarcode(sUserInfo, barcode);
  9510. if (resultEntity.Status == Constant.ServiceResultStatus.Success)
  9511. {
  9512. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9513. actionResult.Status = (int)Constant.PDAResult.Success;
  9514. actionResult.Message = resultEntity.Message;
  9515. }
  9516. else
  9517. {
  9518. actionResult.Status = (int)Constant.PDAResult.Fail;
  9519. actionResult.Result = resultEntity.OtherStatus;
  9520. actionResult.Message = resultEntity.Message;
  9521. }
  9522. return actionResult;
  9523. }
  9524. if (action == "SaveFinishedLoading")
  9525. {
  9526. int loadingNo = Convert.ToInt32(data["loadingNo"]);
  9527. string carLicense = data["carLicense"] + "";
  9528. int palletNum = Convert.ToInt32(data["palletNum"]);
  9529. int goodsNum = Convert.ToInt32(data["goodsNum"]);
  9530. string remarks = data["remarks"] + "";
  9531. Dictionary<string, object>[] details =
  9532. JsonHelper.FromJson<Dictionary<string, object>[]>(data["details"] + "");
  9533. //"[{\"A\":1,\"B\":\"V\"},{\"A\":2,\"B\":\"V1\"}]"
  9534. ServiceResultEntity result = Service.PMModuleService.PMModuleLogic.SaveFinishedLoading(sUserInfo,
  9535. loadingNo, carLicense, palletNum, goodsNum, remarks, details);
  9536. if (result.Status == Constant.ServiceResultStatus.Success)
  9537. {
  9538. actionResult.Status = (int)Constant.PDAResult.Success;
  9539. actionResult.Message = result.Message;
  9540. }
  9541. else
  9542. {
  9543. actionResult.Status = (int)Constant.PDAResult.Fail;
  9544. actionResult.Result = result.OtherStatus;
  9545. actionResult.Message = result.Message;
  9546. }
  9547. return actionResult;
  9548. }
  9549. }
  9550. */
  9551. #endregion
  9552. #region 产成品质量改判
  9553. if (module == "FinishedProductTamper")
  9554. {
  9555. // 获取产成品信息及缺陷数据
  9556. if (action == "GetDefectData")
  9557. {
  9558. string barcode = data["barcode"].ToString();
  9559. ServiceResultEntity sre = PDAModuleLogic.GetDefectData(barcode, sUserInfo);
  9560. if (sre.Status == Constant.ServiceResultStatus.Success)
  9561. {
  9562. actionResult.Status = (int)Constant.PDAResult.Success;
  9563. actionResult.Result = JsonHelper.ToJson(sre.Result);
  9564. actionResult.Message = sre.Message;
  9565. }
  9566. else
  9567. {
  9568. actionResult.Status = (int)Constant.PDAResult.Fail;
  9569. actionResult.Result = sre.OtherStatus;
  9570. actionResult.Message = sre.Message;
  9571. }
  9572. return actionResult;
  9573. }
  9574. // 获取产成品信息及缺陷数据
  9575. if (action == "SaveDefectData")
  9576. {
  9577. ProductionDataEntity productionDataEntity = JsonHelper.FromJson<ProductionDataEntity>(data["ProductionDataEntity"] + "");
  9578. ServiceResultEntity sre = PDAModuleLogic.SaveDefectData(productionDataEntity, sUserInfo);
  9579. if (sre.Status == Constant.ServiceResultStatus.Success)
  9580. {
  9581. actionResult.Status = (int)Constant.PDAResult.Success;
  9582. actionResult.Message = sre.Message;
  9583. }
  9584. else
  9585. {
  9586. actionResult.Status = (int)Constant.PDAResult.Fail;
  9587. actionResult.Message = sre.Message;
  9588. }
  9589. return actionResult;
  9590. }
  9591. // 通过条码查出责任工序(成品改判用)
  9592. if (action == "GetDutyProcedureByBarCodeForTamper")
  9593. {
  9594. string barcode = data["barcode"] + "";
  9595. int defectid = int.Parse(data["defectid"] + "");
  9596. ServiceResultEntity sre = PDAModuleLogic.GetDutyProcedureByBarCodeForTamper(barcode, defectid, sUserInfo.AccountID);
  9597. if (sre.Status == Constant.ServiceResultStatus.Success)
  9598. {
  9599. actionResult.Status = (int)Constant.PDAResult.Success;
  9600. actionResult.Result = JsonHelper.ToJson(sre.Data);
  9601. actionResult.Message = sre.Message;
  9602. }
  9603. else
  9604. {
  9605. actionResult.Status = (int)Constant.PDAResult.Fail;
  9606. actionResult.Result = sre.OtherStatus;
  9607. actionResult.Message = sre.Message;
  9608. }
  9609. return actionResult;
  9610. }
  9611. }
  9612. #endregion
  9613. #region PDA独立功能
  9614. #region 水效标识
  9615. if (module == "WaterEffect")
  9616. {
  9617. // 获取产成品信息及水效标识
  9618. if (action == "GetGoodsByBarCode")
  9619. {
  9620. string barcode = data["barcode"].ToString();
  9621. ServiceResultEntity sre = PDAModuleLogic.GetGoodsByBarCode(barcode, sUserInfo);
  9622. if (sre.Status == Constant.ServiceResultStatus.Success)
  9623. {
  9624. actionResult.Status = (int)Constant.PDAResult.Success;
  9625. actionResult.Result = JsonHelper.ToJson(sre.Result);
  9626. actionResult.Message = sre.Message;
  9627. }
  9628. else
  9629. {
  9630. actionResult.Status = (int)Constant.PDAResult.Fail;
  9631. actionResult.Result = sre.OtherStatus;
  9632. actionResult.Message = sre.Message;
  9633. }
  9634. return actionResult;
  9635. }
  9636. }
  9637. #endregion
  9638. #region 盖板型号
  9639. if (module == "SeatCoverType")
  9640. {
  9641. // 获取产成品信息及水效标识
  9642. if (action == "SendGoodsCodeToPLC")
  9643. {
  9644. string barcode = data["barcode"].ToString();
  9645. int sre = PLCModuleLogic.SendGoodsCodeToPLCBySeatCover(barcode, sUserInfo);
  9646. if (sre == 0)
  9647. {
  9648. actionResult.Status = (int)Constant.PDAResult.Success;
  9649. }
  9650. else
  9651. {
  9652. actionResult.Status = (int)Constant.PDAResult.Fail;
  9653. actionResult.Result = sre;
  9654. switch (sre)
  9655. {
  9656. case 1:
  9657. case 2:
  9658. actionResult.Message = "无效条码";
  9659. break;
  9660. case 3:
  9661. actionResult.Message = "此产品型号没有设置盖板标识码";
  9662. break;
  9663. case 4:
  9664. actionResult.Message = "当前用户没有设置PLC参数";
  9665. break;
  9666. case 5:
  9667. actionResult.Message = "PLC参数设置不全";
  9668. break;
  9669. default:
  9670. actionResult.Message = "PLC通信异常";
  9671. break;
  9672. }
  9673. }
  9674. return actionResult;
  9675. }
  9676. }
  9677. #endregion
  9678. #region PDA PLC 相关功能
  9679. if (module == "PDA_FUN_PLC")
  9680. {
  9681. // PDA扫码发送到PLCServer
  9682. if (action == "SendBarcodeToPLCServer")
  9683. {
  9684. string barcode = data["barcode"].ToString();
  9685. int sre = PLCModuleLogic.SendBarcodeToPLCServer(barcode, sUserInfo);
  9686. if (sre == 0)
  9687. {
  9688. actionResult.Status = (int)Constant.PDAResult.Success;
  9689. }
  9690. else
  9691. {
  9692. actionResult.Status = (int)Constant.PDAResult.Fail;
  9693. actionResult.Result = sre;
  9694. switch (sre)
  9695. {
  9696. case 1:
  9697. case 2:
  9698. actionResult.Message = "无效条码";
  9699. break;
  9700. case 3:
  9701. actionResult.Message = "PLC通信异常";
  9702. break;
  9703. case 4:
  9704. actionResult.Message = "当前用户没有设置PLC参数";
  9705. break;
  9706. case 5:
  9707. actionResult.Message = "PLC参数设置不全";
  9708. break;
  9709. default:
  9710. actionResult.Message = "PLC通信异常";
  9711. break;
  9712. }
  9713. }
  9714. return actionResult;
  9715. }
  9716. }
  9717. #endregion
  9718. #endregion
  9719. #region 半检返修
  9720. if (module == "SemiRework")
  9721. {
  9722. // 验证半检返修条码
  9723. if (action == "CheckSemiReworkBarcode")
  9724. {
  9725. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9726. PMModuleLogic.CheckSemiReworkBarcode(jsonData);
  9727. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9728. if (Convert.ToInt32(resultEntity.Result) < 0)
  9729. {
  9730. actionResult.Status = (int)Constant.PDAResult.Fail;
  9731. }
  9732. else
  9733. {
  9734. actionResult.Status = (int)Constant.PDAResult.Success;
  9735. }
  9736. actionResult.Message = resultEntity.Message;
  9737. return actionResult;
  9738. }
  9739. // 可以返修的工序
  9740. if (action == "GetSemiReworkProcedure")
  9741. {
  9742. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9743. PMModuleLogic.GetSemiReworkProcedure(jsonData, sUserInfo);
  9744. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9745. actionResult.Status = (int)Constant.PDAResult.Success;
  9746. return actionResult;
  9747. }
  9748. // 根据条码获取经过的工序,用于责任工序
  9749. if (action == "GetSemiReworkPassProcedure")
  9750. {
  9751. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9752. PMModuleLogic.GetSemiReworkPassProcedure(jsonData);
  9753. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9754. actionResult.Status = (int)Constant.PDAResult.Success;
  9755. return actionResult;
  9756. }
  9757. // 根据所选生产工序(生产数据ID)查询责任员工
  9758. if (action == "GetSemiReworkDefectStaffByProductionDataID")
  9759. {
  9760. int productionDataID = Convert.ToInt32(jsonData);
  9761. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9762. PMModuleLogic.GetSemiReworkDefectStaffByProductionDataID(productionDataID);
  9763. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9764. actionResult.Status = (int)Constant.PDAResult.Success;
  9765. return actionResult;
  9766. }
  9767. // 根据所选工号,查出缺陷责任员工
  9768. if (action == "GetSemiReworkDefectStaffByUserID")
  9769. {
  9770. int userID = Convert.ToInt32(jsonData);
  9771. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9772. PMModuleLogic.GetSemiReworkDefectStaffByUserID(userID);
  9773. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9774. actionResult.Status = (int)Constant.PDAResult.Success;
  9775. return actionResult;
  9776. }
  9777. // 新建半检返修
  9778. if (action == "AddSemiRework")
  9779. {
  9780. SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"]+"");
  9781. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9782. PMModuleLogic.AddSemiRework(entity, sUserInfo);
  9783. actionResult.Result = resultEntity.Result;
  9784. actionResult.Message = resultEntity.Message;
  9785. if (Convert.ToInt32(resultEntity.Result) > 0)
  9786. {
  9787. actionResult.Status = (int)Constant.PDAResult.Success;
  9788. }
  9789. else
  9790. {
  9791. actionResult.Status = (int)Constant.PDAResult.Fail;
  9792. }
  9793. return actionResult;
  9794. }
  9795. // 编辑半检返修
  9796. if (action == "EditSemiRework")
  9797. {
  9798. SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"] + "");
  9799. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9800. PMModuleLogic.EditSemiRework(entity, sUserInfo);
  9801. actionResult.Result = resultEntity.Result;
  9802. actionResult.Message = resultEntity.Message;
  9803. if (Convert.ToInt32(resultEntity.Result) > 0)
  9804. {
  9805. actionResult.Status = (int)Constant.PDAResult.Success;
  9806. }
  9807. else
  9808. {
  9809. actionResult.Status = (int)Constant.PDAResult.Fail;
  9810. }
  9811. return actionResult;
  9812. }
  9813. // 撤销半检返修
  9814. if (action == "CancelSemiRework")
  9815. {
  9816. SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"] + "");
  9817. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9818. PMModuleLogic.CancelSemiRework(entity, sUserInfo);
  9819. actionResult.Result = resultEntity.Result;
  9820. actionResult.Message = resultEntity.Message;
  9821. if (Convert.ToInt32(resultEntity.Result) > 0)
  9822. {
  9823. actionResult.Status = (int)Constant.PDAResult.Success;
  9824. }
  9825. else
  9826. {
  9827. actionResult.Status = (int)Constant.PDAResult.Fail;
  9828. }
  9829. return actionResult;
  9830. }
  9831. // 获取半检返修数据(PDA编辑用)
  9832. if (action == "GetSemiReworkByID")
  9833. {
  9834. int id = Convert.ToInt32(jsonData);
  9835. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9836. PMModuleLogic.GetSemiReworkByID(id,sUserInfo.UserCode);
  9837. DataTable data1 = resultEntity.Data.Tables[0];
  9838. DataTable data2 = resultEntity.Data.Tables[1];
  9839. DataTable data3 = resultEntity.Data.Tables[2];
  9840. if (data1.Rows.Count == 0)
  9841. {
  9842. actionResult.Status = (int)Constant.PDAResult.Fail;
  9843. actionResult.Message = "半检返修信息不存在";
  9844. return actionResult;
  9845. }
  9846. SemiReworkEntity srEntity = new SemiReworkEntity();
  9847. srEntity.SemiReworkID = id;
  9848. srEntity.BarCode = data1.Rows[0]["BarCode"] + "";
  9849. srEntity.ReworkProcedureID = Convert.ToInt32(data1.Rows[0]["ReworkProcedureID"]);
  9850. srEntity.Remarks = data1.Rows[0]["Remarks"] + "";
  9851. srEntity.SemiReworkDefects = new List<SemiReworkDefectEntity>();
  9852. foreach (DataRow row2 in data2.Rows)
  9853. {
  9854. SemiReworkDefectEntity defectEntity = new SemiReworkDefectEntity();
  9855. srEntity.SemiReworkDefects.Add(defectEntity);
  9856. defectEntity.SemiReworkDefectID = Convert.ToInt32(row2["SemiReworkDefectID"]);
  9857. defectEntity.SemiReworkID = id;
  9858. defectEntity.DefectID = Convert.ToInt32(row2["DefectID"]);
  9859. defectEntity.DefectCode = row2["DefectCode"] + "";
  9860. defectEntity.DefectName = row2["DefectName"] + "";
  9861. defectEntity.DefectPositionID = Convert.ToInt32(row2["DefectPositionID"]);
  9862. defectEntity.DefectPositionCode = row2["DefectPositionCode"] + "";
  9863. defectEntity.DefectPositionName = row2["DefectPositionName"] + "";
  9864. defectEntity.ScrapResponFlag = row2["ScrapResponFlag"] + "";
  9865. defectEntity.DefectProductionDataID = row2["DefectProductionDataID"].ToNullableInt32();
  9866. defectEntity.DefectProcedureID = row2["DefectProcedureID"].ToNullableInt32();
  9867. defectEntity.DefectProcedureCode = row2["DefectProcedureCode"] + "";
  9868. defectEntity.DefectProcedureName = row2["DefectProcedureName"] + "";
  9869. defectEntity.Remarks = row2["Remarks"] + "";
  9870. defectEntity.DefectUserID = Convert.ToInt32(row2["DefectUserID"]);
  9871. defectEntity.DefectUserCode = row2["DefectUserCode"] + "";
  9872. defectEntity.DefectUserName = row2["DefectUserName"] + "";
  9873. defectEntity.DefectResponsibles = new List<SemiReworkRPSEntity>();
  9874. defectEntity.ValueFlag = Convert.ToInt32(row2["ValueFlag"]);
  9875. DataRow[] row3s = data3.Select("SemiReworkDefectID=" + defectEntity.SemiReworkDefectID);
  9876. if (row3s.Length == 0)
  9877. {
  9878. continue;
  9879. }
  9880. foreach (DataRow row3 in row3s)
  9881. {
  9882. SemiReworkRPSEntity semiReworkRPS = new SemiReworkRPSEntity();
  9883. defectEntity.DefectResponsibles.Add(semiReworkRPS);
  9884. semiReworkRPS.SemiReworkDefectID = Convert.ToInt32(row3["SemiReworkDefectID"]);
  9885. semiReworkRPS.StaffID = Convert.ToInt32(row3["StaffID"]);
  9886. semiReworkRPS.StaffName = row3["StaffName"] + "";
  9887. semiReworkRPS.StaffCode = row3["StaffCode"] + "";
  9888. semiReworkRPS.SemiReworkID = Convert.ToInt32(row3["SemiReworkID"]);
  9889. semiReworkRPS.UserID = Convert.ToInt32(row3["UserID"]);
  9890. semiReworkRPS.UserCode = row3["UserCode"] + "";
  9891. semiReworkRPS.UJobsID = Convert.ToInt32(row3["UJobsID"]);
  9892. semiReworkRPS.SJobsID = Convert.ToInt32(row3["SJobsID"]);
  9893. }
  9894. }
  9895. //xuwei note 总单用于显示,信息较全
  9896. actionResult.Message = JsonHelper.ToJson(data1);
  9897. //xuwei note 总单信息不全,但有明细,用于回传保存
  9898. actionResult.Result = JsonHelper.ToJson(srEntity);
  9899. actionResult.Status = (int)Constant.PDAResult.Success;
  9900. }
  9901. }
  9902. #endregion
  9903. #region 窑车漏扫补件
  9904. if (module == "F_PM_0504")
  9905. {
  9906. // 验证窑车编码是否存在
  9907. if (action == "CheckKilnCar")
  9908. {
  9909. ClientRequestEntity cre = new ClientRequestEntity();
  9910. cre.Properties["kilncarcode"] = data["KilnCarCode"];
  9911. cre.Properties["procedureID"] = data["ProcedureID"];
  9912. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.CheckKilnCar(cre, sUserInfo);
  9913. if (sre.Status == Constant.ServiceResultStatus.Success)
  9914. {
  9915. actionResult.Status = (int)Constant.PDAResult.Success;
  9916. actionResult.Result = sre.Result;
  9917. }
  9918. else
  9919. {
  9920. actionResult.Status = (int)Constant.PDAResult.Fail;
  9921. actionResult.Message = sre.Message;
  9922. }
  9923. return actionResult;
  9924. }
  9925. // 验证窑车烧成批次号是否存在 和 是否能补漏扫
  9926. if (action == "CheckKilnCarBatchNo")
  9927. {
  9928. ClientRequestEntity cre = new ClientRequestEntity();
  9929. cre.Properties["KilnID"] = data["KilnID"];
  9930. cre.Properties["KilnCarID"] = data["KilnCarID"];
  9931. cre.Properties["ProcedureID"] = data["ProcedureID"];
  9932. cre.Properties["KilnCarBatchNo"] = data["KilnCarBatchNo"];
  9933. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.CheckKilnCarBatchNo(cre, sUserInfo);
  9934. if (sre.Status == Constant.ServiceResultStatus.Success)
  9935. {
  9936. actionResult.Status = (int)Constant.PDAResult.Success;
  9937. }
  9938. else
  9939. {
  9940. actionResult.Status = (int)Constant.PDAResult.Fail;
  9941. actionResult.Message = sre.Message;
  9942. }
  9943. return actionResult;
  9944. }
  9945. // 窑车漏扫补件
  9946. if (action == "SetKilnCarMissing")
  9947. {
  9948. ClientRequestEntity cre = new ClientRequestEntity();
  9949. cre.Properties["KilnCarBatchNo"] = data["KilnCarBatchNo"];
  9950. string carData = data["CarData"] + "";
  9951. DataTable dataTable = JsonHelper.FromJson<DataTable>(carData);
  9952. cre.Data = new DataSet();
  9953. cre.Data.Tables.Add(dataTable);
  9954. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.SetKilnCarMissing(cre, sUserInfo);
  9955. if (sre.Status == Constant.ServiceResultStatus.Success)
  9956. {
  9957. actionResult.Status = (int)Constant.PDAResult.Success;
  9958. }
  9959. else
  9960. {
  9961. actionResult.Status = (int)Constant.PDAResult.Fail;
  9962. actionResult.Message = sre.Message;
  9963. }
  9964. return actionResult;
  9965. }
  9966. }
  9967. #endregion
  9968. return actionResult;
  9969. }
  9970. catch (Exception ex)
  9971. {
  9972. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  9973. OutputLog.TraceLog(LogPriority.Error,
  9974. this.ToString(),
  9975. System.Reflection.MethodBase.GetCurrentMethod().Name + System.Environment.NewLine +
  9976. JsonHelper.ToJson(sUserInfo) + System.Environment.NewLine +
  9977. " module:" + module + " action:" + action + " json:" + jsonData,
  9978. ex.ToString(),
  9979. LocalPath.LogExePath);
  9980. actionResult.Status = (int)Constant.PDAResult.Exception;
  9981. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  9982. }
  9983. return actionResult;
  9984. }
  9985. #endregion
  9986. }
  9987. }