PDAModuleService.cs 396 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242
  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. /// <summary>
  255. /// 获取Apk信息
  256. /// </summary>
  257. /// <returns></returns>
  258. public string GetApkInfo()
  259. {
  260. try
  261. {
  262. ServiceResultEntity sre = PDAModuleLogic.GetApkInfo();
  263. return JsonHelper.ToJson(sre);
  264. }
  265. catch (Exception ex)
  266. {
  267. OutputLog.TraceLog(LogPriority.Error,
  268. this.ToString(),
  269. System.Reflection.MethodBase.GetCurrentMethod().Name,
  270. ex.ToString(),
  271. LocalPath.LogExePath);
  272. return null;
  273. }
  274. }
  275. #endregion
  276. #region 取得展示数据
  277. /// <summary>
  278. /// 获得生产线菜单
  279. /// </summary>
  280. /// <param name="accountCode">帐套code</param>
  281. /// <param name="userCode">用户code</param>
  282. /// <param name="userPassword">用户密码</param>
  283. /// <param name="sessionKey">本次登陆密钥</param>
  284. /// <returns></returns>
  285. /// <remarks>
  286. /// 陈冰 2014.09.18 新建
  287. /// </remarks>
  288. public ActionResult GetProductionLineMenu(string accountCode, string userCode, string userPassword, string sessionKey)
  289. {
  290. ActionResult actionResult = new ActionResult();
  291. try
  292. {
  293. // 验证请求头信息
  294. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  295. // 验证失败
  296. if (actionResult.Status != (int)Constant.PDAResult.Success)
  297. {
  298. return actionResult;
  299. }
  300. // 查询菜单
  301. DataTable dtPLM = ServiceInvoker.Invoke<DataTable>(this,
  302. () => PDAModuleLogic.GetProductionLineMenu(sUserInfo));
  303. PDAFunctionResult pdaFunction = new PDAFunctionResult();
  304. pdaFunction.MenuCode = "Root";
  305. DataRow[] navigationRows = dtPLM.Select("LEN(MenuCode) = " + Constant.INT_IS_TWO.ToString(), "MenuCode ASC"); // 编号2为一级菜单
  306. foreach (DataRow newRow in navigationRows)
  307. {
  308. #region 插入子节点数据
  309. int? intProcedureID = null;
  310. int? intModelType = null;
  311. if (!string.IsNullOrEmpty(newRow["ProcedureID"].ToString()))
  312. {
  313. intProcedureID = Convert.ToInt32(newRow["ProcedureID"]);
  314. }
  315. if (!string.IsNullOrEmpty(newRow["ModelType"].ToString()))
  316. {
  317. intModelType = Convert.ToInt32(newRow["ModelType"]);
  318. }
  319. PDAFunctionResult pdaFunctionChild = new PDAFunctionResult();
  320. //xuwei add 2020-01-02
  321. pdaFunctionChild.IsGlazeChange = string.IsNullOrEmpty(newRow["IsGlazeChange"].ToString()) ? 0 : Convert.ToInt32(newRow["IsGlazeChange"].ToString());
  322. //pdaFunctionChild.IsGlazeChange = 0;
  323. pdaFunctionChild.MenuCode = newRow["MenuCode"].ToString();
  324. pdaFunctionChild.MenuName = newRow["MenuName"].ToString();
  325. pdaFunctionChild.ProcedureID = intProcedureID;
  326. pdaFunctionChild.ProcedureModel = newRow["ProcedureModel"].ToString();
  327. pdaFunctionChild.ModelType = intModelType;
  328. pdaFunction.PDAFunctions.Add(pdaFunctionChild);
  329. #endregion
  330. InitTreeView(dtPLM, newRow["MenuCode"].ToString(), pdaFunctionChild);
  331. }
  332. //actionResult.Result = JsonHelper.ToJson(dtPLM);
  333. actionResult.Result = JsonHelper.ToJson(pdaFunction);
  334. actionResult.Status = (int)Constant.PDAResult.Success;
  335. }
  336. catch (Exception ex)
  337. {
  338. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  339. OutputLog.TraceLog(LogPriority.Error,
  340. this.ToString(),
  341. System.Reflection.MethodBase.GetCurrentMethod().Name,
  342. ex.ToString(),
  343. LocalPath.LogExePath);
  344. actionResult.Status = (int)Constant.PDAResult.Exception;
  345. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  346. }
  347. return actionResult;
  348. }
  349. /// <summary>
  350. /// 初始化树形控件
  351. /// </summary>
  352. /// <param name="treeTable">菜单数据表</param>
  353. /// <param name="rows">待处理的菜单集合</param>
  354. /// <param name="node">当前树节点</param>
  355. private void InitTreeView(DataTable treeTable, string pFuncCode, PDAFunctionResult pFunctions)
  356. {
  357. string filterExpression = "MenuCode LIKE '" + pFuncCode + "%' AND LEN(MenuCode) = "
  358. + (pFuncCode.Length + Constant.INT_IS_TWO);
  359. DataRow[] subRows = treeTable.Select(filterExpression, "MenuCode ASC");
  360. //DataRow[] subRows = treeTable.Select(filterExpression, "ProcedureCode ASC");
  361. foreach (DataRow newRow in subRows)
  362. {
  363. #region 插入子节点数据
  364. int? intProcedureID = null;
  365. int? intModelType = null;
  366. if (!string.IsNullOrEmpty(newRow["ProcedureID"].ToString()))
  367. {
  368. intProcedureID = Convert.ToInt32(newRow["ProcedureID"]);
  369. }
  370. if (!string.IsNullOrEmpty(newRow["ModelType"].ToString()))
  371. {
  372. intModelType = Convert.ToInt32(newRow["ModelType"]);
  373. }
  374. PDAFunctionResult pdaFunctionChild = new PDAFunctionResult();
  375. //xuwei add 2020-01-02
  376. pdaFunctionChild.IsGlazeChange = string.IsNullOrEmpty(newRow["IsGlazeChange"].ToString()) ? 0 : Convert.ToInt32(newRow["IsGlazeChange"].ToString());
  377. //pdaFunctionChild.IsGlazeChange = 0;
  378. pdaFunctionChild.MenuCode = newRow["MenuCode"].ToString();
  379. pdaFunctionChild.MenuName = newRow["MenuName"].ToString();
  380. pdaFunctionChild.ProcedureID = intProcedureID;
  381. pdaFunctionChild.ProcedureModel = newRow["ProcedureModel"].ToString();
  382. pdaFunctionChild.ModelType = intModelType;
  383. pFunctions.PDAFunctions.Add(pdaFunctionChild);
  384. #endregion
  385. // 递归方法
  386. InitTreeView(treeTable, newRow["MenuCode"].ToString(), pdaFunctionChild);
  387. }
  388. }
  389. #endregion
  390. #region 获得工序信息
  391. /// <summary>
  392. /// 获得工序信息
  393. /// </summary>
  394. /// <param name="accountCode">帐套code</param>
  395. /// <param name="userCode">用户code</param>
  396. /// <param name="userPassword">用户密码</param>
  397. /// <param name="sessionKey">本次登陆密钥</param>
  398. /// <param name="procedureID">工序ID</param>
  399. /// <returns></returns>
  400. /// <remarks>
  401. /// 陈冰 2014.09.18 新建
  402. /// </remarks>
  403. public ActionResult GetProcedureByID(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  404. {
  405. ActionResult actionResult = new ActionResult();
  406. try
  407. {
  408. // 验证请求头信息
  409. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  410. // 验证失败
  411. if (actionResult.Status != (int)Constant.PDAResult.Success)
  412. {
  413. return actionResult;
  414. }
  415. ProcedureEntity procedureEntity = ServiceInvoker.Invoke<ProcedureEntity>(this,
  416. () => PMModuleLogic.GetProcedureDataEntityByID(procedureID, sUserInfo));
  417. actionResult.Result = JsonHelper.ToJson(procedureEntity);
  418. actionResult.Status = (int)Constant.PDAResult.Success;
  419. }
  420. catch (Exception ex)
  421. {
  422. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  423. OutputLog.TraceLog(LogPriority.Error,
  424. this.ToString(),
  425. System.Reflection.MethodBase.GetCurrentMethod().Name,
  426. ex.ToString(),
  427. LocalPath.LogExePath);
  428. actionResult.Status = (int)Constant.PDAResult.Exception;
  429. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  430. }
  431. return actionResult;
  432. }
  433. #endregion
  434. #region 校验
  435. /// <summary>
  436. /// 校验产品条码是否可以走到该工序
  437. /// </summary>
  438. /// <param name="accountCode">帐套code</param>
  439. /// <param name="userCode">用户code</param>
  440. /// <param name="userPassword">用户密码</param>
  441. /// <param name="sessionKey">本次登陆密钥</param>
  442. /// <param name="procedureID">工序ID</param>
  443. /// <param name="barcode">条码</param>
  444. /// <returns></returns>
  445. /// <remarks>
  446. /// 陈冰 2014.09.18 新建
  447. /// </remarks>
  448. public ActionResult CheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  449. {
  450. ActionResult actionResult = new ActionResult();
  451. try
  452. {
  453. // 验证请求头信息
  454. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  455. // 验证失败
  456. if (actionResult.Status != (int)Constant.PDAResult.Success)
  457. {
  458. return actionResult;
  459. }
  460. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  461. () => PMModuleLogic.CheckBarcodePDA(procedureID, barcode, sUserInfo));
  462. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  463. {
  464. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  465. actionResult.Status = (int)Constant.PDAResult.Success;
  466. }
  467. else
  468. {
  469. actionResult.Status = (int)Constant.PDAResult.Fail;
  470. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  471. }
  472. }
  473. catch (Exception ex)
  474. {
  475. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  476. OutputLog.TraceLog(LogPriority.Error,
  477. this.ToString(),
  478. System.Reflection.MethodBase.GetCurrentMethod().Name,
  479. ex.ToString(),
  480. LocalPath.LogExePath);
  481. actionResult.Status = (int)Constant.PDAResult.Exception;
  482. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  483. }
  484. return actionResult;
  485. }
  486. /// <summary>
  487. /// 校验产品条码是否可以进行干补
  488. /// </summary>
  489. /// <param name="accountCode">帐套code</param>
  490. /// <param name="userCode">用户code</param>
  491. /// <param name="userPassword">用户密码</param>
  492. /// <param name="sessionKey">本次登陆密钥</param>
  493. /// <param name="procedureID">工序ID</param>
  494. /// <param name="barcode">条码</param>
  495. /// <returns></returns>
  496. /// <remarks>
  497. /// 袁新成 2015.4.1 新建
  498. /// </remarks>
  499. public ActionResult CheckDryRepairBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  500. {
  501. ActionResult actionResult = new ActionResult();
  502. try
  503. {
  504. // 验证请求头信息
  505. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  506. // 验证失败
  507. if (actionResult.Status != (int)Constant.PDAResult.Success)
  508. {
  509. return actionResult;
  510. }
  511. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  512. () => PMModuleLogic.CheckDryRepairBarcode(procedureID, barcode, sUserInfo));
  513. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  514. {
  515. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  516. actionResult.Status = (int)Constant.PDAResult.Success;
  517. }
  518. else
  519. {
  520. actionResult.Status = (int)Constant.PDAResult.Fail;
  521. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  522. }
  523. }
  524. catch (Exception ex)
  525. {
  526. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  527. OutputLog.TraceLog(LogPriority.Error,
  528. this.ToString(),
  529. System.Reflection.MethodBase.GetCurrentMethod().Name,
  530. ex.ToString(),
  531. LocalPath.LogExePath);
  532. actionResult.Status = (int)Constant.PDAResult.Exception;
  533. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  534. }
  535. return actionResult;
  536. }
  537. /// <summary>
  538. /// 检验生产工号
  539. /// </summary>
  540. /// <param name="accountCode">帐套code</param>
  541. /// <param name="userCode">用户code</param>
  542. /// <param name="userPassword">用户密码</param>
  543. /// <param name="sessionKey">本次登陆密钥</param>
  544. /// <param name="procedureID">工序ID</param>
  545. /// <param name="procedureUserCode">生产工号</param>
  546. /// <remarks>
  547. /// 陈冰 2014.09.18 新建
  548. /// </remarks>
  549. public ActionResult CheckProcedureUser(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string procedureUserCode)
  550. {
  551. ActionResult actionResult = new ActionResult();
  552. try
  553. {
  554. // 验证请求头信息
  555. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  556. // 验证失败
  557. if (actionResult.Status != (int)Constant.PDAResult.Success)
  558. {
  559. return actionResult;
  560. }
  561. CheckProcedureUserResult checkProcedureUserResult = ServiceInvoker.Invoke<CheckProcedureUserResult>(this,
  562. () => PMModuleLogic.CheckProcedureUser(procedureID, procedureUserCode, sUserInfo));
  563. actionResult.Result = JsonHelper.ToJson(checkProcedureUserResult);
  564. actionResult.Status = (int)Constant.PDAResult.Success;
  565. }
  566. catch (Exception ex)
  567. {
  568. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  569. OutputLog.TraceLog(LogPriority.Error,
  570. this.ToString(),
  571. System.Reflection.MethodBase.GetCurrentMethod().Name,
  572. ex.ToString(),
  573. LocalPath.LogExePath);
  574. actionResult.Status = (int)Constant.PDAResult.Exception;
  575. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  576. }
  577. return actionResult;
  578. }
  579. /// <summary>
  580. /// 校验窑车是否可装车并返回窑车信息
  581. /// </summary>
  582. /// <param name="accountCode">帐套code</param>
  583. /// <param name="userCode">用户code</param>
  584. /// <param name="userPassword">用户密码</param>
  585. /// <param name="sessionKey">本次登陆密钥</param>
  586. /// <param name="kilnCarCode">窑车号</param>
  587. /// <param name="modelType">工序类别</param>
  588. /// <returns></returns>
  589. /// <remarks>
  590. /// 陈冰 2014.10.04 新建
  591. /// </remarks>
  592. public ActionResult CheckKilnCar(string accountCode, string userCode, string userPassword, string sessionKey, int pProcedureId, string kilnCarCode, int modelType)
  593. {
  594. ActionResult actionResult = new ActionResult();
  595. try
  596. {
  597. // 验证请求头信息
  598. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  599. // 验证失败
  600. if (actionResult.Status != (int)Constant.PDAResult.Success)
  601. {
  602. return actionResult;
  603. }
  604. CheckKilnCarResultEntity checkKilnCarResultEntity = ServiceInvoker.Invoke<CheckKilnCarResultEntity>(this,
  605. () => PMModuleLogic.CheckKilnCar(pProcedureId, kilnCarCode, modelType, sUserInfo));
  606. actionResult.Result = JsonHelper.ToJson(checkKilnCarResultEntity);
  607. actionResult.Status = (int)Constant.PDAResult.Success;
  608. }
  609. catch (Exception ex)
  610. {
  611. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  612. OutputLog.TraceLog(LogPriority.Error,
  613. this.ToString(),
  614. System.Reflection.MethodBase.GetCurrentMethod().Name,
  615. ex.ToString(),
  616. LocalPath.LogExePath);
  617. actionResult.Status = (int)Constant.PDAResult.Exception;
  618. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  619. }
  620. return actionResult;
  621. }
  622. #endregion
  623. #region 保存条码信息
  624. /// <summary>
  625. /// 保存条码信息
  626. /// </summary>
  627. /// <param name="accountCode">帐套code</param>
  628. /// <param name="userCode">用户code</param>
  629. /// <param name="userPassword">用户密码</param>
  630. /// <param name="sessionKey">本次登陆密钥</param>
  631. /// <param name="procedureID">工序ID</param>
  632. /// <param name="productionDataEntitys">条码信息</param>
  633. public ActionResult AddWorkPiece(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, ProductionDataEntity[] productionDataEntitys)
  634. {
  635. ActionResult actionResult = new ActionResult();
  636. try
  637. {
  638. // 验证请求头信息
  639. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  640. // 验证失败
  641. if (actionResult.Status != (int)Constant.PDAResult.Success)
  642. {
  643. return actionResult;
  644. }
  645. DataTable dtProductionData = DataConvert.ObjectConvertToTable<ProductionDataEntity>(productionDataEntitys);
  646. if (!dtProductionData.Columns.Contains("IsPDA"))
  647. {
  648. dtProductionData.Columns.Add("IsPDA");
  649. }
  650. ProcedureEntity procedureInfo = null;
  651. DataTable resultDT = ServiceInvoker.Invoke<DataTable>(this,
  652. () => PMModuleLogicDAL.AddWorkPiece(procedureID, dtProductionData, sUserInfo, out procedureInfo));
  653. actionResult.Result = JsonHelper.ToJson(resultDT);
  654. actionResult.Status = (int)Constant.PDAResult.Success;
  655. if (resultDT != null)
  656. {
  657. DataRow[] drs = resultDT.Select("out_errMsg is not null and out_errMsg <> ''");
  658. if (drs != null && drs.Length > 0)
  659. {
  660. return actionResult;
  661. }
  662. }
  663. #region PDA条码打印
  664. if (procedureInfo != null && procedureInfo.BarCodePrintCopies > 0 &&
  665. procedureInfo.ModelType == (int)Constant.ProcedureModelType.Normal)
  666. {
  667. try
  668. {
  669. if (procedureInfo.CollectType == 1)
  670. {
  671. //foreach (DataRow item in dtProductionData.Rows)
  672. //{
  673. // ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode(item["barcode"].ToString(),
  674. // procedureInfo.BarCodePrintCopies, null, sUserInfo);
  675. // if (sre.Status != Constant.ServiceResultStatus.Success)
  676. // {
  677. // actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  678. // actionResult.Message = sre.Message;
  679. // return actionResult;
  680. // }
  681. //}
  682. }
  683. else
  684. {
  685. //ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode(dtProductionData.Rows[0]["barcode"].ToString(),
  686. // procedureInfo.BarCodePrintCopies, null, sUserInfo);
  687. ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode_3C(dtProductionData.Rows[0]["barcode"].ToString(),
  688. procedureInfo.BarCodePrintCopies, null, sUserInfo, 0);
  689. if (sre.Status != Constant.ServiceResultStatus.Success)
  690. {
  691. actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  692. actionResult.Message = sre.Message;
  693. return actionResult;
  694. }
  695. }
  696. }
  697. catch (Exception ex)
  698. {
  699. OutputLog.TraceLog(LogPriority.Error,
  700. this.ToString(),
  701. System.Reflection.MethodBase.GetCurrentMethod().Name,
  702. ex.ToString(),
  703. LocalPath.LogExePath);
  704. actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  705. actionResult.Message = "条码打印异常";
  706. return actionResult;
  707. }
  708. }
  709. #endregion PDA条码打印
  710. }
  711. catch (Exception ex)
  712. {
  713. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  714. OutputLog.TraceLog(LogPriority.Error,
  715. this.ToString(),
  716. System.Reflection.MethodBase.GetCurrentMethod().Name,
  717. ex.ToString(),
  718. LocalPath.LogExePath);
  719. try
  720. {
  721. string ss = JsonHelper.ToJson(productionDataEntitys);
  722. OutputLog.TraceLog(LogPriority.Error,
  723. this.ToString(),
  724. System.Reflection.MethodBase.GetCurrentMethod().Name,
  725. $" userCode:{userCode} procedureID:{procedureID} " + ss,
  726. LocalPath.LogExePath);
  727. }
  728. catch
  729. {
  730. }
  731. actionResult.Status = (int)Constant.PDAResult.Exception;
  732. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  733. }
  734. return actionResult;
  735. }
  736. #endregion
  737. #region 获得系统/基数数据
  738. /// <summary>
  739. /// 获得数据字典
  740. /// </summary>
  741. /// <param name="accountCode">帐套code</param>
  742. /// <param name="userCode">用户code</param>
  743. /// <param name="userPassword">用户密码</param>
  744. /// <param name="sessionKey">本次登陆密钥</param>
  745. /// <param name="dicType">字典类型</param>
  746. /// <returns></returns>
  747. public ActionResult GetDataDictionaryByType(string accountCode, string userCode, string userPassword, string sessionKey, string dicType)
  748. {
  749. ActionResult actionResult = new ActionResult();
  750. try
  751. {
  752. // 验证请求头信息
  753. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  754. // 验证失败
  755. if (actionResult.Status != (int)Constant.PDAResult.Success)
  756. {
  757. return actionResult;
  758. }
  759. DataTable dicDataTable = ServiceInvoker.Invoke<DataTable>(this,
  760. () => CommonModuleLogic.GetDataDictionaryByType(sUserInfo, dicType));
  761. actionResult.Result = JsonHelper.ToJson(dicDataTable);
  762. actionResult.Status = (int)Constant.PDAResult.Success;
  763. }
  764. catch (Exception ex)
  765. {
  766. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  767. OutputLog.TraceLog(LogPriority.Error,
  768. this.ToString(),
  769. System.Reflection.MethodBase.GetCurrentMethod().Name,
  770. ex.ToString(),
  771. LocalPath.LogExePath);
  772. actionResult.Status = (int)Constant.PDAResult.Exception;
  773. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  774. }
  775. return actionResult;
  776. }
  777. #endregion
  778. #region 检验工序接口
  779. /// <summary>
  780. /// 获得检验标识
  781. /// </summary>
  782. /// <param name="accountCode">帐套code</param>
  783. /// <param name="userCode">用户code</param>
  784. /// <param name="userPassword">用户密码</param>
  785. /// <param name="sessionKey">本次登陆密钥</param>
  786. /// <returns></returns>
  787. /// <remarks>
  788. /// 陈冰 2014.10.04 新建
  789. /// </remarks>
  790. public ActionResult GetDefectFlagData(string accountCode, string userCode, string userPassword, string sessionKey)
  791. {
  792. ActionResult actionResult = new ActionResult();
  793. try
  794. {
  795. // 验证请求头信息
  796. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  797. // 验证失败
  798. if (actionResult.Status != (int)Constant.PDAResult.Success)
  799. {
  800. return actionResult;
  801. }
  802. #region 构造缺陷标识的数据源
  803. DataTable dtDefectFlag = CreateDataSource.GetDefectFlagTable();
  804. #endregion
  805. actionResult.Result = JsonHelper.ToJson(dtDefectFlag);
  806. actionResult.Status = (int)Constant.PDAResult.Success;
  807. }
  808. catch (Exception ex)
  809. {
  810. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  811. OutputLog.TraceLog(LogPriority.Error,
  812. this.ToString(),
  813. System.Reflection.MethodBase.GetCurrentMethod().Name,
  814. ex.ToString(),
  815. LocalPath.LogExePath);
  816. actionResult.Status = (int)Constant.PDAResult.Exception;
  817. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  818. }
  819. return actionResult;
  820. }
  821. /// <summary>
  822. /// 由条码和当前检验工序获取返工工序
  823. /// </summary>
  824. /// <param name="accountCode">帐套code</param>
  825. /// <param name="userCode">用户code</param>
  826. /// <param name="userPassword">用户密码</param>
  827. /// <param name="sessionKey">本次登陆密钥</param>
  828. /// <param name="procedureID">当前检验工序ID</param>
  829. /// <param name="barcode">条码</param>
  830. /// <returns></returns>
  831. /// <remarks>
  832. /// 陈冰 2014.10.04 新建
  833. /// </remarks>
  834. public ActionResult GetReworkProcedureByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  835. {
  836. ActionResult actionResult = new ActionResult();
  837. try
  838. {
  839. // 验证请求头信息
  840. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  841. // 验证失败
  842. if (actionResult.Status != (int)Constant.PDAResult.Success)
  843. {
  844. return actionResult;
  845. }
  846. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  847. () => PMModuleLogic.GetReworkProcedureByBarcode(procedureID, barcode));
  848. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  849. {
  850. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  851. actionResult.Status = (int)Constant.PDAResult.Success;
  852. }
  853. else
  854. {
  855. actionResult.Status = (int)Constant.PDAResult.Fail;
  856. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  857. }
  858. }
  859. catch (Exception ex)
  860. {
  861. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  862. OutputLog.TraceLog(LogPriority.Error,
  863. this.ToString(),
  864. System.Reflection.MethodBase.GetCurrentMethod().Name,
  865. ex.ToString(),
  866. LocalPath.LogExePath);
  867. actionResult.Status = (int)Constant.PDAResult.Exception;
  868. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  869. }
  870. return actionResult;
  871. }
  872. /// <summary>
  873. /// 由当前检验工序获取缺陷列表
  874. /// </summary>
  875. /// <param name="accountCode">帐套code</param>
  876. /// <param name="userCode">用户code</param>
  877. /// <param name="userPassword">用户密码</param>
  878. /// <param name="sessionKey">本次登陆密钥</param>
  879. /// <param name="procedureID">当前检验工序ID</param>
  880. /// <param name="defectCode">缺陷编码</param>
  881. /// <returns></returns>
  882. /// <remarks>
  883. /// 陈冰 2014.10.04 新建
  884. /// </remarks>
  885. public ActionResult GetDefectByProcedureIDAndDefectCode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string defectCode)
  886. {
  887. ActionResult actionResult = new ActionResult();
  888. try
  889. {
  890. // 验证请求头信息
  891. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  892. // 验证失败
  893. if (actionResult.Status != (int)Constant.PDAResult.Success)
  894. {
  895. return actionResult;
  896. }
  897. object defectDs = ServiceInvoker.Invoke<object>(this,
  898. () => PMModuleLogic.GetDefectByProcedureIDAndDefectCode(procedureID, defectCode));
  899. if (defectDs != null)
  900. {
  901. actionResult.Result = JsonHelper.ToJson(defectDs);
  902. actionResult.Status = (int)Constant.PDAResult.Success;
  903. }
  904. else
  905. {
  906. actionResult.Status = (int)Constant.PDAResult.Fail;
  907. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  908. }
  909. }
  910. catch (Exception ex)
  911. {
  912. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  913. OutputLog.TraceLog(LogPriority.Error,
  914. this.ToString(),
  915. System.Reflection.MethodBase.GetCurrentMethod().Name,
  916. ex.ToString(),
  917. LocalPath.LogExePath);
  918. actionResult.Status = (int)Constant.PDAResult.Exception;
  919. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  920. }
  921. return actionResult;
  922. }
  923. /// <summary>
  924. /// 根据产品ID查出缺陷位置
  925. /// </summary>
  926. /// <param name="accountCode">帐套code</param>
  927. /// <param name="userCode">用户code</param>
  928. /// <param name="userPassword">用户密码</param>
  929. /// <param name="sessionKey">本次登陆密钥</param>
  930. /// <param name="goodsID">产品ID</param>
  931. /// <param name="positionCode">位置编码</param>
  932. /// <returns></returns>
  933. /// <remarks>
  934. /// 陈冰 2014.10.04 新建
  935. /// </remarks>
  936. public ActionResult GetDefectPositionByGoodsIDAndPositionCode(string accountCode, string userCode, string userPassword, string sessionKey, int goodsID, string positionCode)
  937. {
  938. ActionResult actionResult = new ActionResult();
  939. try
  940. {
  941. // 验证请求头信息
  942. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  943. // 验证失败
  944. if (actionResult.Status != (int)Constant.PDAResult.Success)
  945. {
  946. return actionResult;
  947. }
  948. // 缺陷位置已经不用在关联产品
  949. //object defectDs = ServiceInvoker.Invoke<object>(this,() => PMModuleLogic.GetDefectPositionByGoodsIDAndPositionCode(goodsID, positionCode));
  950. object defectDs = ServiceInvoker.Invoke<object>(this, () => PMModuleLogic.GetDefectPosition(positionCode, sUserInfo));
  951. if (defectDs != null)
  952. {
  953. actionResult.Result = JsonHelper.ToJson(defectDs);
  954. actionResult.Status = (int)Constant.PDAResult.Success;
  955. }
  956. else
  957. {
  958. actionResult.Status = (int)Constant.PDAResult.Fail;
  959. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  960. }
  961. }
  962. catch (Exception ex)
  963. {
  964. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  965. OutputLog.TraceLog(LogPriority.Error,
  966. this.ToString(),
  967. System.Reflection.MethodBase.GetCurrentMethod().Name,
  968. ex.ToString(),
  969. LocalPath.LogExePath);
  970. actionResult.Status = (int)Constant.PDAResult.Exception;
  971. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  972. }
  973. return actionResult;
  974. }
  975. /// <summary>
  976. /// 通过条码和缺陷查出责任工序
  977. /// </summary>
  978. /// <param name="accountCode">帐套code</param>
  979. /// <param name="userCode">用户code</param>
  980. /// <param name="userPassword">用户密码</param>
  981. /// <param name="sessionKey">本次登陆密钥</param>
  982. /// <param name="barcode">条码</param>
  983. /// <param name="defectid">缺陷ID</param>
  984. /// <returns></returns>
  985. /// <remarks>
  986. /// 陈冰 2014.10.04 新建
  987. /// </remarks>
  988. public ActionResult GetDutyProcedureByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int defectid)
  989. {
  990. ActionResult actionResult = new ActionResult();
  991. try
  992. {
  993. // 验证请求头信息
  994. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  995. // 验证失败
  996. if (actionResult.Status != (int)Constant.PDAResult.Success)
  997. {
  998. return actionResult;
  999. }
  1000. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1001. () => PMModuleLogic.GetDutyProcedureByBarCode(barcode, defectid, sUserInfo.AccountID));
  1002. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1003. {
  1004. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs);
  1005. actionResult.Status = (int)Constant.PDAResult.Success;
  1006. }
  1007. else
  1008. {
  1009. actionResult.Status = (int)Constant.PDAResult.Fail;
  1010. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1011. }
  1012. }
  1013. catch (Exception ex)
  1014. {
  1015. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1016. OutputLog.TraceLog(LogPriority.Error,
  1017. this.ToString(),
  1018. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1019. ex.ToString(),
  1020. LocalPath.LogExePath);
  1021. actionResult.Status = (int)Constant.PDAResult.Exception;
  1022. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1023. }
  1024. return actionResult;
  1025. }
  1026. /// <summary>
  1027. /// 通过条码与工序查出责任工号(己废)
  1028. /// </summary>
  1029. /// <param name="accountCode">帐套code</param>
  1030. /// <param name="userCode">用户code</param>
  1031. /// <param name="userPassword">用户密码</param>
  1032. /// <param name="sessionKey">本次登陆密钥</param>
  1033. /// <param name="barcode">条码</param>
  1034. /// <param name="dutyProcedureID">责任工序</param>
  1035. /// <returns></returns>
  1036. /// <remarks>
  1037. /// 陈冰 2014.10.04 新建
  1038. /// </remarks>
  1039. public ActionResult GetDutyProcedureCodeByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int dutyProcedureID)
  1040. {
  1041. ActionResult actionResult = new ActionResult();
  1042. try
  1043. {
  1044. // 验证请求头信息
  1045. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1046. // 验证失败
  1047. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1048. {
  1049. return actionResult;
  1050. }
  1051. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1052. () => PMModuleLogic.GetDutyProcedureCodeByBarCode(barcode, dutyProcedureID));
  1053. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1054. {
  1055. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1056. actionResult.Status = (int)Constant.PDAResult.Success;
  1057. }
  1058. else
  1059. {
  1060. actionResult.Status = (int)Constant.PDAResult.Fail;
  1061. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1062. }
  1063. }
  1064. catch (Exception ex)
  1065. {
  1066. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1067. OutputLog.TraceLog(LogPriority.Error,
  1068. this.ToString(),
  1069. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1070. ex.ToString(),
  1071. LocalPath.LogExePath);
  1072. actionResult.Status = (int)Constant.PDAResult.Exception;
  1073. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1074. }
  1075. return actionResult;
  1076. }
  1077. /// <summary>
  1078. /// 通过条码与工序查出责任工号
  1079. /// </summary>
  1080. /// <param name="accountCode"></param>
  1081. /// <param name="userCode"></param>
  1082. /// <param name="userPassword"></param>
  1083. /// <param name="sessionKey"></param>
  1084. /// <param name="ProductionDataID">生产数据ID</param>
  1085. /// <returns></returns>
  1086. public ActionResult GetDutyProcedureCodeByProductionDataID(string accountCode, string userCode, string userPassword, string sessionKey, int ProductionDataID)
  1087. {
  1088. ActionResult actionResult = new ActionResult();
  1089. try
  1090. {
  1091. // 验证请求头信息
  1092. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1093. // 验证失败
  1094. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1095. {
  1096. return actionResult;
  1097. }
  1098. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1099. () => PMModuleLogic.GetDutyProcedureCodeByProductionDataID(ProductionDataID));
  1100. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1101. {
  1102. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1103. actionResult.Status = (int)Constant.PDAResult.Success;
  1104. }
  1105. else
  1106. {
  1107. actionResult.Status = (int)Constant.PDAResult.Fail;
  1108. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1109. }
  1110. }
  1111. catch (Exception ex)
  1112. {
  1113. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1114. OutputLog.TraceLog(LogPriority.Error,
  1115. this.ToString(),
  1116. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1117. ex.ToString(),
  1118. LocalPath.LogExePath);
  1119. actionResult.Status = (int)Constant.PDAResult.Exception;
  1120. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1121. }
  1122. return actionResult;
  1123. }
  1124. /// <summary>
  1125. /// 通过生产数据与工号ID查询工种
  1126. /// </summary>
  1127. /// <param name="accountCode">帐套code</param>
  1128. /// <param name="userCode">用户code</param>
  1129. /// <param name="userPassword">用户密码</param>
  1130. /// <param name="sessionKey">本次登陆密钥</param>
  1131. /// <param name="productionDataID">生产数据ID</param>
  1132. /// <param name="userID">工号ID</param>
  1133. /// <returns></returns>
  1134. /// <remarks>
  1135. /// 陈冰 2014.10.08 新建
  1136. /// </remarks>
  1137. public ActionResult GetDutyJobsByUserIDAndProductionID(string accountCode, string userCode, string userPassword, string sessionKey,
  1138. //int productionDataID, int userID)
  1139. int classesSettingID, int defectid, int procedureID)
  1140. {
  1141. ActionResult actionResult = new ActionResult();
  1142. try
  1143. {
  1144. // 验证请求头信息
  1145. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1146. // 验证失败
  1147. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1148. {
  1149. return actionResult;
  1150. }
  1151. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1152. //() => PMModuleLogic.GetDutyJobsCodeByUser(userID, productionDataID));
  1153. () => PDAModuleLogic.GetDutyJobsCodeByUser(classesSettingID, defectid, procedureID));
  1154. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1155. {
  1156. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1157. actionResult.Status = (int)Constant.PDAResult.Success;
  1158. }
  1159. else
  1160. {
  1161. actionResult.Status = (int)Constant.PDAResult.Fail;
  1162. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1163. }
  1164. }
  1165. catch (Exception ex)
  1166. {
  1167. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1168. OutputLog.TraceLog(LogPriority.Error,
  1169. this.ToString(),
  1170. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1171. ex.ToString(),
  1172. LocalPath.LogExePath);
  1173. actionResult.Status = (int)Constant.PDAResult.Exception;
  1174. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1175. }
  1176. return actionResult;
  1177. }
  1178. /// <summary>
  1179. /// 根据生产数据ID,用户ID及工种选出责任员工
  1180. /// </summary>
  1181. /// <param name="accountCode">帐套code</param>
  1182. /// <param name="userCode">用户code</param>
  1183. /// <param name="userPassword">用户密码</param>
  1184. /// <param name="sessionKey">本次登陆密钥</param>
  1185. /// <param name="productionDataID">生产数据ID</param>
  1186. /// <param name="userID">工号ID</param>
  1187. /// <param name="jobsID">工种ID</param>
  1188. /// <returns></returns>
  1189. /// <remarks>
  1190. /// 陈冰 2014.10.08 新建
  1191. /// </remarks>
  1192. public ActionResult GetDutyStaffByUserIDAndJobs(string accountCode, string userCode, string userPassword, string sessionKey,
  1193. //int productionDataID, int userID, int jobsID)
  1194. int classesSettingID, int jobsID)
  1195. {
  1196. ActionResult actionResult = new ActionResult();
  1197. try
  1198. {
  1199. // 验证请求头信息
  1200. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1201. // 验证失败
  1202. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1203. {
  1204. return actionResult;
  1205. }
  1206. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1207. //() => PMModuleLogic.GetDutyStaffByUserIDAndJobs(productionDataID, userID, jobsID));
  1208. () => PDAModuleLogic.GetDutyStaffByUserIDAndJobs(classesSettingID, jobsID));
  1209. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1210. {
  1211. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1212. actionResult.Status = (int)Constant.PDAResult.Success;
  1213. }
  1214. else
  1215. {
  1216. actionResult.Status = (int)Constant.PDAResult.Fail;
  1217. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1218. }
  1219. }
  1220. catch (Exception ex)
  1221. {
  1222. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1223. OutputLog.TraceLog(LogPriority.Error,
  1224. this.ToString(),
  1225. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1226. ex.ToString(),
  1227. LocalPath.LogExePath);
  1228. actionResult.Status = (int)Constant.PDAResult.Exception;
  1229. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1230. }
  1231. return actionResult;
  1232. }
  1233. /// <summary>
  1234. /// 获得产品分级
  1235. /// </summary>
  1236. /// <param name="accountCode">帐套code</param>
  1237. /// <param name="userCode">用户code</param>
  1238. /// <param name="userPassword">用户密码</param>
  1239. /// <param name="sessionKey">本次登陆密钥</param>
  1240. /// <returns></returns>
  1241. /// <remarks>
  1242. /// 陈冰 2014.10.08 新建
  1243. /// xuwei 2019-12-4 添加参数type 默认为2成检 为1时 半检
  1244. /// </remarks>
  1245. public ActionResult GetGoodsGradeData(string accountCode, string userCode, string userPassword, string sessionKey, int type = 2)
  1246. {
  1247. ActionResult actionResult = new ActionResult();
  1248. try
  1249. {
  1250. // 验证请求头信息
  1251. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1252. // 验证失败
  1253. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1254. {
  1255. return actionResult;
  1256. }
  1257. #region 构造产品分级的数据源
  1258. //DataTable dtGrade = CreateDataSource.GetGoodsGradeTable();
  1259. //xuwei modify 2019-12-04 支持半检 没传参数 type=0
  1260. //DataSet dsGrade = SystemModuleLogic.GetGoodsLevel(2 , sUserInfo);
  1261. DataSet dsGrade = SystemModuleLogic.GetGoodsLevel(type == 0 ? 2 : type, sUserInfo);
  1262. if (dsGrade != null && dsGrade.Tables.Count > Constant.INT_IS_ZERO)
  1263. {
  1264. actionResult.Result = JsonHelper.ToJson(dsGrade.Tables[0]);
  1265. actionResult.Status = (int)Constant.PDAResult.Success;
  1266. }
  1267. else
  1268. {
  1269. actionResult.Status = (int)Constant.PDAResult.Fail;
  1270. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1271. }
  1272. #endregion
  1273. }
  1274. catch (Exception ex)
  1275. {
  1276. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1277. OutputLog.TraceLog(LogPriority.Error,
  1278. this.ToString(),
  1279. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1280. ex.ToString(),
  1281. LocalPath.LogExePath);
  1282. OutputLog.TraceLog(LogPriority.Error,
  1283. this.ToString(),
  1284. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1285. ex.ToString(),
  1286. LocalPath.LogExePath);
  1287. actionResult.Status = (int)Constant.PDAResult.Exception;
  1288. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1289. }
  1290. return actionResult;
  1291. }
  1292. #endregion
  1293. #region 保存检验条码
  1294. /// <summary>
  1295. /// 保存检验条码
  1296. /// </summary>
  1297. /// <param name="accountCode">帐套code</param>
  1298. /// <param name="userCode">用户code</param>
  1299. /// <param name="userPassword">用户密码</param>
  1300. /// <param name="sessionKey">本次登陆密钥</param>
  1301. /// <param name="procedureID">工序ID</param>
  1302. /// <param name="productionDataEntitys">条码信息</param>
  1303. /// <returns></returns>
  1304. public ActionResult AddCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, ProductionDataEntity[] productionDataEntitys)
  1305. {
  1306. ActionResult actionResult = new ActionResult();
  1307. try
  1308. {
  1309. // 验证请求头信息
  1310. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1311. // 验证失败
  1312. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1313. {
  1314. return actionResult;
  1315. }
  1316. //if(productionDataEntitys.Length>0)
  1317. //{
  1318. // if(productionDataEntitys[0].ProductionDataID>0)
  1319. // {
  1320. // productionDataEntitys[0].OPTimeStamp = Convert.ToDateTime(productionDataEntitys[0].OPTimeStampPDA.Replace("-","/"));
  1321. // }
  1322. //}
  1323. string err = ServiceInvoker.Invoke<string>(this,
  1324. //() => PMModuleLogicDAL.AddCheckBarcode(procedureID, productionDataEntitys, sUserInfo));
  1325. () => PMModuleLogicDAL.AddCheckBarcodePDA(procedureID, productionDataEntitys, sUserInfo));
  1326. if (err == null)
  1327. {
  1328. err = "";
  1329. }
  1330. //actionResult.Result = JsonHelper.ToJson(err);
  1331. actionResult.Result = err;// JsonHelper.ToJson(err);
  1332. actionResult.Status = (int)Constant.PDAResult.Success;
  1333. }
  1334. catch (Exception ex)
  1335. {
  1336. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1337. OutputLog.TraceLog(LogPriority.Error,
  1338. this.ToString(),
  1339. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1340. ex.ToString(),
  1341. LocalPath.LogExePath);
  1342. actionResult.Status = (int)Constant.PDAResult.Exception;
  1343. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1344. }
  1345. return actionResult;
  1346. }
  1347. #endregion
  1348. #region 文件上传下载
  1349. /// <summary>
  1350. /// 软件更新
  1351. /// </summary>
  1352. /// <param name="accountCode">帐套code</param>
  1353. /// <param name="userCode">用户code</param>
  1354. /// <param name="userPassword">用户密码</param>
  1355. /// <param name="sessionKey">本次登陆密钥</param>
  1356. /// <returns></returns>
  1357. public Stream AutoUpgrade(string accountCode, string userCode, string userPassword, string sessionKey)
  1358. {
  1359. try
  1360. {
  1361. return ServiceInvoker.Invoke<Stream>(this, () => PDAModuleLogic.AutoUpgrade());
  1362. }
  1363. catch (Exception ex)
  1364. {
  1365. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1366. OutputLog.TraceLog(LogPriority.Error,
  1367. this.ToString(),
  1368. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1369. ex.ToString(),
  1370. LocalPath.LogExePath);
  1371. return null;
  1372. }
  1373. }
  1374. /// <summary>
  1375. /// 上传临时文件
  1376. /// </summary>
  1377. /// <param name="imgStream"></param>
  1378. /// <returns></returns>
  1379. public ActionResult SaveImg(Stream mageStream)
  1380. {
  1381. ActionResult actionResult = new ActionResult();
  1382. try
  1383. {
  1384. string err = PDAModuleLogic.SaveImg(mageStream);
  1385. if (err == null)
  1386. {
  1387. err = "";
  1388. }
  1389. actionResult.Result = err;
  1390. actionResult.Status = (int)Constant.PDAResult.Success;
  1391. }
  1392. catch (Exception ex)
  1393. {
  1394. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1395. OutputLog.TraceLog(LogPriority.Error,
  1396. this.ToString(),
  1397. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1398. ex.ToString(),
  1399. LocalPath.LogExePath);
  1400. actionResult.Status = (int)Constant.PDAResult.Exception;
  1401. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1402. }
  1403. return actionResult;
  1404. }
  1405. public Stream GetFileTest(string path)
  1406. {
  1407. return PDAModuleLogic.GetImg(path);
  1408. }
  1409. public Stream GetFileStream()
  1410. {
  1411. FileStream fs = new FileStream("999.apk", FileMode.OpenOrCreate, FileAccess.Read);
  1412. long l = fs.Length;
  1413. return fs;
  1414. }
  1415. public byte[] GetFileTestByte(string path)
  1416. {
  1417. FileStream stream = new FileInfo(path).OpenRead();
  1418. Byte[] buffer = new Byte[stream.Length];
  1419. //从流中读取字节块并将该数据写入给定缓冲区buffer中
  1420. stream.Read(buffer, 0, Convert.ToInt32(stream.Length));
  1421. return buffer;
  1422. }
  1423. public string GetFile(string path)
  1424. {
  1425. string imgFilePath = path;
  1426. System.IO.FileStream fs = new System.IO.FileStream(imgFilePath, System.IO.FileMode.Open);
  1427. int i = (int)fs.Length;
  1428. byte[] content = new byte[i];
  1429. fs.Read(content, 0, i);
  1430. string result = Convert.ToBase64String(content);
  1431. fs.Close();
  1432. FileStream fsTxt = new FileStream("A.txt", FileMode.OpenOrCreate);
  1433. StreamWriter sw = new StreamWriter(fsTxt, System.Text.Encoding.Default);
  1434. sw.Write(result);
  1435. sw.Close();
  1436. fsTxt.Close();
  1437. return result;
  1438. }
  1439. #endregion
  1440. /// <summary>
  1441. /// 获得产品分级
  1442. /// </summary>
  1443. /// <param name="accountCode">帐套code</param>
  1444. /// <param name="userCode">用户code</param>
  1445. /// <param name="userPassword">用户密码</param>
  1446. /// <param name="sessionKey">本次登陆密钥</param>
  1447. /// <param name="procedureID">当前工序ID</param>
  1448. /// <returns></returns>
  1449. /// <remarks>
  1450. /// 陈冰 2014.10.22 新建
  1451. /// </remarks>
  1452. public ActionResult GetReworkProcedureByProcedureID(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  1453. {
  1454. ActionResult actionResult = new ActionResult();
  1455. try
  1456. {
  1457. // 验证请求头信息
  1458. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1459. // 验证失败
  1460. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1461. {
  1462. return actionResult;
  1463. }
  1464. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1465. () => PMModuleLogic.GetReworkProcedureByProcedureID(procedureID));
  1466. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1467. {
  1468. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1469. actionResult.Status = (int)Constant.PDAResult.Success;
  1470. }
  1471. else
  1472. {
  1473. actionResult.Status = (int)Constant.PDAResult.Fail;
  1474. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1475. }
  1476. }
  1477. catch (Exception ex)
  1478. {
  1479. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1480. OutputLog.TraceLog(LogPriority.Error,
  1481. this.ToString(),
  1482. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1483. ex.ToString(),
  1484. LocalPath.LogExePath);
  1485. actionResult.Status = (int)Constant.PDAResult.Exception;
  1486. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1487. }
  1488. return actionResult;
  1489. }
  1490. /// <summary>
  1491. /// 获得产品分级
  1492. /// </summary>
  1493. /// <param name="accountCode">帐套code</param>
  1494. /// <param name="userCode">用户code</param>
  1495. /// <param name="userPassword">用户密码</param>
  1496. /// <param name="sessionKey">本次登陆密钥</param>
  1497. /// <param name="barcode">条码</param>
  1498. /// <returns></returns>
  1499. public ActionResult GetKilnCarByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  1500. {
  1501. ActionResult actionResult = new ActionResult();
  1502. try
  1503. {
  1504. // 验证请求头信息
  1505. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1506. // 验证失败
  1507. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1508. {
  1509. return actionResult;
  1510. }
  1511. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1512. () => PMModuleLogic.GetKilnCarByBarCode(barcode));
  1513. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1514. {
  1515. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1516. actionResult.Status = (int)Constant.PDAResult.Success;
  1517. }
  1518. else
  1519. {
  1520. actionResult.Status = (int)Constant.PDAResult.Fail;
  1521. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1522. }
  1523. }
  1524. catch (Exception ex)
  1525. {
  1526. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1527. OutputLog.TraceLog(LogPriority.Error,
  1528. this.ToString(),
  1529. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1530. ex.ToString(),
  1531. LocalPath.LogExePath);
  1532. actionResult.Status = (int)Constant.PDAResult.Exception;
  1533. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1534. }
  1535. return actionResult;
  1536. }
  1537. #region 统计
  1538. /// <summary>
  1539. /// 统计当日计数数量
  1540. /// </summary>
  1541. /// <param name="accountCode">帐套code</param>
  1542. /// <param name="userCode">用户code</param>
  1543. /// <param name="userPassword">用户密码</param>
  1544. /// <param name="sessionKey">本次登陆密钥</param>
  1545. /// <param name="procedureID">工序ID</param>
  1546. /// <returns></returns>
  1547. public ActionResult StatisticsCollectBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  1548. {
  1549. ActionResult actionResult = new ActionResult();
  1550. try
  1551. {
  1552. // 验证请求头信息
  1553. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1554. // 验证失败
  1555. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1556. {
  1557. return actionResult;
  1558. }
  1559. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1560. () => PDAModuleLogic.StatisticsCollectBarcode(procedureID, sUserInfo));
  1561. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1562. {
  1563. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1564. actionResult.Status = (int)Constant.PDAResult.Success;
  1565. }
  1566. else
  1567. {
  1568. actionResult.Status = (int)Constant.PDAResult.Fail;
  1569. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1570. }
  1571. }
  1572. catch (Exception ex)
  1573. {
  1574. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1575. OutputLog.TraceLog(LogPriority.Error,
  1576. this.ToString(),
  1577. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1578. ex.ToString(),
  1579. LocalPath.LogExePath);
  1580. actionResult.Status = (int)Constant.PDAResult.Exception;
  1581. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1582. }
  1583. return actionResult;
  1584. }
  1585. /// <summary>
  1586. /// 统计当日计数数量
  1587. /// </summary>
  1588. /// <param name="accountCode">帐套code</param>
  1589. /// <param name="userCode">用户code</param>
  1590. /// <param name="userPassword">用户密码</param>
  1591. /// <param name="sessionKey">本次登陆密钥</param>
  1592. /// <param name="procedureID">工序ID</param>
  1593. /// <returns></returns>
  1594. public ActionResult StatisticsKilnCar(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  1595. {
  1596. ActionResult actionResult = new ActionResult();
  1597. try
  1598. {
  1599. // 验证请求头信息
  1600. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1601. // 验证失败
  1602. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1603. {
  1604. return actionResult;
  1605. }
  1606. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1607. () => PDAModuleLogic.StatisticsKilnCar(procedureID, sUserInfo));
  1608. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1609. {
  1610. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1611. actionResult.Status = (int)Constant.PDAResult.Success;
  1612. }
  1613. else
  1614. {
  1615. actionResult.Status = (int)Constant.PDAResult.Fail;
  1616. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1617. }
  1618. }
  1619. catch (Exception ex)
  1620. {
  1621. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1622. OutputLog.TraceLog(LogPriority.Error,
  1623. this.ToString(),
  1624. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1625. ex.ToString(),
  1626. LocalPath.LogExePath);
  1627. actionResult.Status = (int)Constant.PDAResult.Exception;
  1628. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1629. }
  1630. return actionResult;
  1631. }
  1632. /// <summary>
  1633. /// 统计产品跟踪
  1634. /// </summary>
  1635. /// <param name="accountCode">帐套code</param>
  1636. /// <param name="userCode">用户code</param>
  1637. /// <param name="userPassword">用户密码</param>
  1638. /// <param name="sessionKey">本次登陆密钥</param>
  1639. /// <param name="procedureID">工序ID</param>
  1640. /// <returns></returns>
  1641. public ActionResult StatisticsProductTrack(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  1642. {
  1643. ActionResult actionResult = new ActionResult();
  1644. try
  1645. {
  1646. // 验证请求头信息
  1647. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1648. // 验证失败
  1649. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1650. {
  1651. return actionResult;
  1652. }
  1653. RPT020101_SE se = new RPT020101_SE();
  1654. se.Barcode = barcode;
  1655. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  1656. () => Dongke.IBOSS.PRD.Service.ReportModuleLogic.ReportModuleLogic.GetRPT020101SData(sUserInfo, se));
  1657. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  1658. {
  1659. actionResult.Status = (int)Constant.PDAResult.Fail;
  1660. actionResult.Message = Messages.MSG_CMN_I002;
  1661. }
  1662. else
  1663. {
  1664. actionResult.Result = JsonHelper.ToJson(sre.Data);
  1665. actionResult.Status = (int)Constant.PDAResult.Success;
  1666. }
  1667. //ProductionDataEntity productionDataEntity = ServiceInvoker.Invoke<ProductionDataEntity>(this,
  1668. // () => PDAModuleLogic.StatisticsProductTrack(barcode, sUserInfo));
  1669. //if (productionDataEntity != null)
  1670. //{
  1671. // actionResult.Result = JsonHelper.ToJson(productionDataEntity);
  1672. // actionResult.Status = (int)Constant.PDAResult.Success;
  1673. //}
  1674. //else
  1675. //{
  1676. // actionResult.Status = (int)Constant.PDAResult.Fail;
  1677. // actionResult.Message = Messages.MSG_CMN_I002;
  1678. //}
  1679. }
  1680. catch (Exception ex)
  1681. {
  1682. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1683. OutputLog.TraceLog(LogPriority.Error,
  1684. this.ToString(),
  1685. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1686. ex.ToString() + ex.HelpLink,
  1687. LocalPath.LogExePath);
  1688. actionResult.Status = (int)Constant.PDAResult.Exception;
  1689. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1690. }
  1691. return actionResult;
  1692. }
  1693. #endregion
  1694. #region 撤销装车及成检
  1695. /// <summary>
  1696. /// 检验条码是否可以撤销装车
  1697. /// </summary>
  1698. /// <param name="accountCode">帐套code</param>
  1699. /// <param name="userCode">用户code</param>
  1700. /// <param name="userPassword">用户密码</param>
  1701. /// <param name="sessionKey">本次登陆密钥</param>
  1702. /// <param name="procedureID">当前工序ID</param>
  1703. /// <param name="barcode">条码</param>
  1704. /// <returns></returns>
  1705. public ActionResult CheckCancelLoadCar(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  1706. {
  1707. ActionResult actionResult = new ActionResult();
  1708. try
  1709. {
  1710. // 验证请求头信息
  1711. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1712. // 验证失败
  1713. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1714. {
  1715. return actionResult;
  1716. }
  1717. CheckCancelLoadCar checkCancelLoadCar = ServiceInvoker.Invoke<CheckCancelLoadCar>(this,
  1718. () => PMModuleLogic.CheckCancelLoadCar(procedureID, barcode, sUserInfo));
  1719. actionResult.Result = JsonHelper.ToJson(checkCancelLoadCar);
  1720. actionResult.Status = (int)Constant.PDAResult.Success;
  1721. }
  1722. catch (Exception ex)
  1723. {
  1724. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1725. OutputLog.TraceLog(LogPriority.Error,
  1726. this.ToString(),
  1727. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1728. ex.ToString(),
  1729. LocalPath.LogExePath);
  1730. actionResult.Status = (int)Constant.PDAResult.Exception;
  1731. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1732. }
  1733. return actionResult;
  1734. }
  1735. /// <summary>
  1736. /// 保存撤销装车的条码
  1737. /// </summary>
  1738. /// <param name="accountCode">帐套code</param>
  1739. /// <param name="userCode">用户code</param>
  1740. /// <param name="userPassword">用户密码</param>
  1741. /// <param name="sessionKey">本次登陆密钥</param>
  1742. /// <param name="procedureID">当前工序ID</param>
  1743. /// <param name="barcode">条码</param>
  1744. /// <returns></returns>
  1745. public ActionResult AddCancelLoadCar(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  1746. {
  1747. ActionResult actionResult = new ActionResult();
  1748. try
  1749. {
  1750. // 验证请求头信息
  1751. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1752. // 验证失败
  1753. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1754. {
  1755. return actionResult;
  1756. }
  1757. string err = ServiceInvoker.Invoke<string>(this,
  1758. () => PMModuleLogicDAL.AddCancelLoadCar(procedureID, barcode, sUserInfo));
  1759. if (err == null)
  1760. {
  1761. err = "";
  1762. }
  1763. actionResult.Result = JsonHelper.ToJson(err);
  1764. actionResult.Status = (int)Constant.PDAResult.Success;
  1765. }
  1766. catch (Exception ex)
  1767. {
  1768. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1769. OutputLog.TraceLog(LogPriority.Error,
  1770. this.ToString(),
  1771. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1772. ex.ToString(),
  1773. LocalPath.LogExePath);
  1774. actionResult.Status = (int)Constant.PDAResult.Exception;
  1775. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1776. }
  1777. return actionResult;
  1778. }
  1779. /// <summary>
  1780. /// 由产品条码获取注浆信息
  1781. /// </summary>
  1782. /// <param name="barcode"></param>
  1783. /// <returns></returns>
  1784. public ActionResult GetGroutingProducttByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  1785. {
  1786. ActionResult actionResult = new ActionResult();
  1787. try
  1788. {
  1789. // 验证请求头信息
  1790. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1791. // 验证失败
  1792. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1793. {
  1794. return actionResult;
  1795. }
  1796. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1797. () => PDAModuleLogic.GetGroutingProducttByBarCode(barcode));
  1798. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1799. {
  1800. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1801. actionResult.Status = (int)Constant.PDAResult.Success;
  1802. }
  1803. else
  1804. {
  1805. actionResult.Status = (int)Constant.PDAResult.Fail;
  1806. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1807. }
  1808. }
  1809. catch (Exception ex)
  1810. {
  1811. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1812. OutputLog.TraceLog(LogPriority.Error,
  1813. this.ToString(),
  1814. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1815. ex.ToString(),
  1816. LocalPath.LogExePath);
  1817. actionResult.Status = (int)Constant.PDAResult.Exception;
  1818. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1819. }
  1820. return actionResult;
  1821. }
  1822. /// <summary>
  1823. /// 获取工号下的所有工种信息
  1824. /// </summary>
  1825. /// <param name="UserID">工号ID</param>
  1826. /// <returns></returns>
  1827. public ActionResult GetAllJobsByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int UserID)
  1828. {
  1829. ActionResult actionResult = new ActionResult();
  1830. try
  1831. {
  1832. // 验证请求头信息
  1833. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1834. // 验证失败
  1835. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1836. {
  1837. return actionResult;
  1838. }
  1839. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1840. () => PDAModuleLogic.GetAllJobsByUserID(UserID, sUserInfo));
  1841. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1842. {
  1843. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1844. actionResult.Status = (int)Constant.PDAResult.Success;
  1845. }
  1846. else
  1847. {
  1848. actionResult.Status = (int)Constant.PDAResult.Fail;
  1849. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1850. }
  1851. }
  1852. catch (Exception ex)
  1853. {
  1854. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1855. OutputLog.TraceLog(LogPriority.Error,
  1856. this.ToString(),
  1857. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1858. ex.ToString(),
  1859. LocalPath.LogExePath);
  1860. actionResult.Status = (int)Constant.PDAResult.Exception;
  1861. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1862. }
  1863. return actionResult;
  1864. }
  1865. /// <summary>
  1866. /// 根据所选工号对应的工种,查出缺陷责任员工
  1867. /// </summary>
  1868. /// <param name="jobs">工种ID</param>
  1869. /// <returns></returns>
  1870. public ActionResult GetDutyStaffByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int jobs)
  1871. {
  1872. ActionResult actionResult = new ActionResult();
  1873. try
  1874. {
  1875. // 验证请求头信息
  1876. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1877. // 验证失败
  1878. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1879. {
  1880. return actionResult;
  1881. }
  1882. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1883. () => PDAModuleLogic.GetDutyStaffByUserID(jobs, sUserInfo));
  1884. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1885. {
  1886. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1887. actionResult.Status = (int)Constant.PDAResult.Success;
  1888. }
  1889. else
  1890. {
  1891. actionResult.Status = (int)Constant.PDAResult.Fail;
  1892. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1893. }
  1894. }
  1895. catch (Exception ex)
  1896. {
  1897. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1898. OutputLog.TraceLog(LogPriority.Error,
  1899. this.ToString(),
  1900. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1901. ex.ToString(),
  1902. LocalPath.LogExePath);
  1903. actionResult.Status = (int)Constant.PDAResult.Exception;
  1904. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1905. }
  1906. return actionResult;
  1907. }
  1908. /// <summary>
  1909. /// 根据所选工号,查出漏检责任员工
  1910. /// </summary>
  1911. /// <param name="userid">工号</param>
  1912. /// <returns></returns>
  1913. public ActionResult GetMissedStaffByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int userid)
  1914. {
  1915. ActionResult actionResult = new ActionResult();
  1916. try
  1917. {
  1918. // 验证请求头信息
  1919. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1920. // 验证失败
  1921. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1922. {
  1923. return actionResult;
  1924. }
  1925. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1926. () => PDAModuleLogic.GetMissedStaffByUserID(userid, sUserInfo));
  1927. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1928. {
  1929. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1930. actionResult.Status = (int)Constant.PDAResult.Success;
  1931. }
  1932. else
  1933. {
  1934. actionResult.Status = (int)Constant.PDAResult.Fail;
  1935. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1936. }
  1937. }
  1938. catch (Exception ex)
  1939. {
  1940. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1941. OutputLog.TraceLog(LogPriority.Error,
  1942. this.ToString(),
  1943. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1944. ex.ToString(),
  1945. LocalPath.LogExePath);
  1946. actionResult.Status = (int)Constant.PDAResult.Exception;
  1947. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1948. }
  1949. return actionResult;
  1950. }
  1951. /// <summary>
  1952. /// 获取用户列表
  1953. /// </summary>
  1954. /// <param name="requestEntity">用户实体</param>
  1955. /// <returns></returns>
  1956. public ActionResult SearchUserData(string accountCode, string userCode, string userPassword, string sessionKey, byte IsWorker)
  1957. {
  1958. ActionResult actionResult = new ActionResult();
  1959. try
  1960. {
  1961. // 验证请求头信息
  1962. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1963. // 验证失败
  1964. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1965. {
  1966. return actionResult;
  1967. }
  1968. SUserEntity requestEntity = new SUserEntity();
  1969. requestEntity.IsWorker = IsWorker;
  1970. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1971. () => PDAModuleLogic.SearchUserData(requestEntity, sUserInfo));
  1972. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1973. {
  1974. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1975. actionResult.Status = (int)Constant.PDAResult.Success;
  1976. }
  1977. else
  1978. {
  1979. actionResult.Status = (int)Constant.PDAResult.Fail;
  1980. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1981. }
  1982. }
  1983. catch (Exception ex)
  1984. {
  1985. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1986. OutputLog.TraceLog(LogPriority.Error,
  1987. this.ToString(),
  1988. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1989. ex.ToString(),
  1990. LocalPath.LogExePath);
  1991. actionResult.Status = (int)Constant.PDAResult.Exception;
  1992. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1993. }
  1994. return actionResult;
  1995. }
  1996. /// <summary>
  1997. /// 获取数据字典管理的数据
  1998. /// </summary>
  1999. /// <param name="Pvalue">显示停用标识</param>
  2000. /// <param name="dictionaryType">字典类别</param>
  2001. /// <returns></returns>
  2002. /// <remarks>
  2003. /// 2014.12.03 新建
  2004. /// </remarks>
  2005. public ActionResult GetDictionaryData(string accountCode, string userCode, string userPassword, string sessionKey, byte Pvalue, string dictionaryType)
  2006. {
  2007. ActionResult actionResult = new ActionResult();
  2008. try
  2009. {
  2010. // 验证请求头信息
  2011. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2012. // 验证失败
  2013. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2014. {
  2015. return actionResult;
  2016. }
  2017. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2018. () => PDAModuleLogic.GetDictionaryData(Pvalue, dictionaryType, sUserInfo));
  2019. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2020. {
  2021. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2022. actionResult.Status = (int)Constant.PDAResult.Success;
  2023. }
  2024. else
  2025. {
  2026. actionResult.Status = (int)Constant.PDAResult.Fail;
  2027. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2028. }
  2029. }
  2030. catch (Exception ex)
  2031. {
  2032. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2033. OutputLog.TraceLog(LogPriority.Error,
  2034. this.ToString(),
  2035. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2036. ex.ToString(),
  2037. LocalPath.LogExePath);
  2038. actionResult.Status = (int)Constant.PDAResult.Exception;
  2039. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2040. }
  2041. return actionResult;
  2042. }
  2043. #endregion
  2044. #region 保存半检数据
  2045. /// <summary>
  2046. /// 保存半检数据
  2047. /// </summary>
  2048. /// <param name="accountCode">帐套code</param>
  2049. /// <param name="userCode">用户code</param>
  2050. /// <param name="userPassword">用户密码</param>
  2051. /// <param name="sessionKey">本次登陆密钥</param>
  2052. /// <param name="productionDataEntitys">半检信息</param>
  2053. /// <returns></returns>
  2054. public ActionResult AddSemiTest(string accountCode, string userCode, string userPassword, string sessionKey, SemiTestEntity[] semiTestEntitys)
  2055. {
  2056. ActionResult actionResult = new ActionResult();
  2057. try
  2058. {
  2059. // 验证请求头信息
  2060. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2061. // 验证失败
  2062. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2063. {
  2064. return actionResult;
  2065. }
  2066. string err = ServiceInvoker.Invoke<string>(this,
  2067. () => PMModuleLogicDAL.AddSemiTest(semiTestEntitys, sUserInfo));
  2068. if (err == null)
  2069. {
  2070. err = "";
  2071. }
  2072. actionResult.Result = JsonHelper.ToJson(err);
  2073. actionResult.Status = (int)Constant.PDAResult.Success;
  2074. }
  2075. catch (Exception ex)
  2076. {
  2077. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2078. OutputLog.TraceLog(LogPriority.Error,
  2079. this.ToString(),
  2080. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2081. ex.ToString(),
  2082. LocalPath.LogExePath);
  2083. actionResult.Status = (int)Constant.PDAResult.Exception;
  2084. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2085. }
  2086. return actionResult;
  2087. }
  2088. #endregion
  2089. /// <summary>
  2090. /// 获取产品列表
  2091. /// </summary>
  2092. /// <returns></returns>
  2093. public ActionResult SerachGoods(string accountCode, string userCode, string userPassword, string sessionKey, int valueFlag)
  2094. {
  2095. ActionResult actionResult = new ActionResult();
  2096. try
  2097. {
  2098. // 验证请求头信息
  2099. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2100. // 验证失败
  2101. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2102. {
  2103. return actionResult;
  2104. }
  2105. GoodsEntity goodsEntity = new GoodsEntity();
  2106. goodsEntity.ValueFlag = 1;//有效标记
  2107. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2108. () => PDAModuleLogic.SerachGoods(sUserInfo, goodsEntity));
  2109. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2110. {
  2111. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2112. actionResult.Status = (int)Constant.PDAResult.Success;
  2113. }
  2114. else
  2115. {
  2116. actionResult.Status = (int)Constant.PDAResult.Fail;
  2117. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2118. }
  2119. }
  2120. catch (Exception ex)
  2121. {
  2122. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2123. OutputLog.TraceLog(LogPriority.Error,
  2124. this.ToString(),
  2125. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2126. ex.ToString(),
  2127. LocalPath.LogExePath);
  2128. actionResult.Status = (int)Constant.PDAResult.Exception;
  2129. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2130. }
  2131. return actionResult;
  2132. }
  2133. /// <summary>
  2134. /// 使用存储过程PRO_PM_GetProductionData获取生产工序计件数据
  2135. /// </summary>
  2136. /// <param name="searchEntity">生产数据实体类</param>
  2137. /// <returns>DataTable</returns>
  2138. public ActionResult GetProductionData(string accountCode, string userCode, string userPassword, string sessionKey, int ProcedureID, string BarCode)
  2139. {
  2140. ActionResult actionResult = new ActionResult();
  2141. try
  2142. {
  2143. // 验证请求头信息
  2144. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2145. // 验证失败
  2146. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2147. {
  2148. return actionResult;
  2149. }
  2150. SearchProductionDataEntity searchEntity = new SearchProductionDataEntity();
  2151. searchEntity.ProcedureID = ProcedureID;
  2152. searchEntity.BarCode = BarCode;
  2153. DataTable reworkDs = ServiceInvoker.Invoke<DataTable>(this,
  2154. () => PDAModuleLogic.GetProductionData(searchEntity, sUserInfo));
  2155. if (reworkDs != null && reworkDs.Rows.Count > Constant.INT_IS_ZERO)
  2156. {
  2157. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2158. actionResult.Status = (int)Constant.PDAResult.Success;
  2159. }
  2160. else
  2161. {
  2162. actionResult.Status = (int)Constant.PDAResult.Fail;
  2163. actionResult.Message = Constant.PDA_RESULT_ALLOW_ERR;
  2164. }
  2165. }
  2166. catch (Exception ex)
  2167. {
  2168. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2169. OutputLog.TraceLog(LogPriority.Error,
  2170. this.ToString(),
  2171. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2172. ex.ToString(),
  2173. LocalPath.LogExePath);
  2174. actionResult.Status = (int)Constant.PDAResult.Exception;
  2175. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2176. }
  2177. return actionResult;
  2178. }
  2179. /// <summary>
  2180. /// xuwei add 2020-03-23 此方法用于成检后 回收 再次成检 获取正确ID
  2181. /// </summary>
  2182. /// <param name="searchEntity">生产数据实体类</param>
  2183. /// <returns>DataTable</returns>
  2184. public ActionResult GetProductionDataCheckID(string accountCode, string userCode, string userPassword, string sessionKey, string BarCode)
  2185. {
  2186. ActionResult actionResult = new ActionResult();
  2187. try
  2188. {
  2189. // 验证请求头信息
  2190. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2191. // 验证失败
  2192. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2193. {
  2194. return actionResult;
  2195. }
  2196. SearchProductionDataEntity searchEntity = new SearchProductionDataEntity();
  2197. searchEntity.BarCode = BarCode;
  2198. DataTable reworkDs = ServiceInvoker.Invoke<DataTable>(this,
  2199. () => PDAModuleLogic.GetProductionDataCheckID(searchEntity, sUserInfo));
  2200. if (reworkDs != null && reworkDs.Rows.Count > Constant.INT_IS_ZERO)
  2201. {
  2202. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2203. actionResult.Status = (int)Constant.PDAResult.Success;
  2204. }
  2205. else
  2206. {
  2207. actionResult.Status = (int)Constant.PDAResult.Fail;
  2208. actionResult.Message = Constant.PDA_RESULT_ALLOW_ERR;
  2209. }
  2210. }
  2211. catch (Exception ex)
  2212. {
  2213. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2214. OutputLog.TraceLog(LogPriority.Error,
  2215. this.ToString(),
  2216. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2217. ex.ToString(),
  2218. LocalPath.LogExePath);
  2219. actionResult.Status = (int)Constant.PDAResult.Exception;
  2220. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2221. }
  2222. return actionResult;
  2223. }
  2224. /// <summary>
  2225. /// 根据所选生产数据ID,显示成检数据信息
  2226. /// </summary>
  2227. /// <param name="productionDataID">生产数据ID</param>
  2228. /// <returns>DataSet</returns>
  2229. public ActionResult GetProductionDataByID(string accountCode, string userCode, string userPassword, string sessionKey, int productionDataID)
  2230. {
  2231. ActionResult actionResult = new ActionResult();
  2232. try
  2233. {
  2234. // 验证请求头信息
  2235. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2236. // 验证失败
  2237. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2238. {
  2239. return actionResult;
  2240. }
  2241. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2242. () => PDAModuleLogic.GetProductionDataByID(productionDataID));
  2243. PDAProductionDataResult productionDatas = new PDAProductionDataResult();
  2244. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2245. {
  2246. if (reworkDs != null && reworkDs.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  2247. {
  2248. for (int i = 0; i < reworkDs.Tables[0].Rows.Count; i++)
  2249. {
  2250. PDAProductionDataResult productionData = new PDAProductionDataResult();
  2251. productionData.BarCode = reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
  2252. if (reworkDs.Tables[0].Rows[i]["GoodsID"].ToString() != "")
  2253. {
  2254. productionData.GoodsID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsID"].ToString());
  2255. }
  2256. productionData.GoodsCode = reworkDs.Tables[0].Rows[i]["GoodsCode"].ToString();
  2257. productionData.GoodsName = reworkDs.Tables[0].Rows[i]["GoodsName"].ToString();
  2258. if (reworkDs.Tables[0].Rows[0]["DefectFlagID"].ToString() != "")
  2259. {
  2260. productionData.DefectFlagID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["DefectFlagID"].ToString());
  2261. }
  2262. if (reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString() != "")
  2263. {
  2264. productionData.ReworkProcedureID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString());
  2265. }
  2266. productionData.Remarks = reworkDs.Tables[0].Rows[i]["Remarks"].ToString();
  2267. if (reworkDs.Tables[0].Rows[i]["UserID"].ToString() != "")
  2268. {
  2269. productionData.UserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["UserID"].ToString());
  2270. }
  2271. if (reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString() != "")
  2272. {
  2273. productionData.GoodsLevelTypeID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString());
  2274. }
  2275. productionData.UserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
  2276. productionData.UserName = reworkDs.Tables[0].Rows[i]["UserName"].ToString();
  2277. productionData.SpecialRepairflag = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["SpecialRepairflag"]);
  2278. productionData.IsReFire = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["IsReFire"]);
  2279. productionData.KilnCarCode = reworkDs.Tables[0].Rows[i]["KilnCarCode"].ToString();
  2280. productionData.KilnCode = reworkDs.Tables[0].Rows[i]["KilnCode"].ToString();
  2281. productionData.GlazeName = reworkDs.Tables[0].Rows[i]["GlazeName"].ToString();
  2282. if (reworkDs.Tables[0].Rows[i]["logoid"].ToString() != "")
  2283. {
  2284. productionData.LogoID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["logoid"]);
  2285. productionData.LogoCode = reworkDs.Tables[0].Rows[i]["LogoCode"].ToString();
  2286. productionData.LogoName = reworkDs.Tables[0].Rows[i]["LogoName"].ToString();
  2287. }
  2288. productionData.CreateTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["CreateTime"]);
  2289. if (reworkDs.Tables[0].Rows[i]["CheckTime"].ToString() != "")
  2290. {
  2291. productionData.CheckTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["CheckTime"].ToString());
  2292. }
  2293. DataView dvDefect = reworkDs.Tables[1].DefaultView;
  2294. dvDefect.RowFilter = "BarCode=" + reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
  2295. DataTable dtDefect = dvDefect.ToTable();
  2296. for (int row = 0; row < dtDefect.Rows.Count; row++)
  2297. {
  2298. // 产品缺陷
  2299. PDADefectResult defect = new PDADefectResult();
  2300. defect.SpecialDefect = dtDefect.Rows[row]["SpecialDefect"].ToString();
  2301. defect.DefectDeductionNum = Convert.ToDecimal(dtDefect.Rows[row]["DefectDeductionNum"].ToString());
  2302. if (dtDefect.Rows[row]["ProductionDefectID"].ToString() != "")
  2303. {
  2304. defect.ProductionDefectID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDefectID"].ToString());
  2305. }
  2306. defect.BarCode = dtDefect.Rows[row]["BarCode"].ToString();
  2307. if (dtDefect.Rows[row]["DefectID"].ToString() != "")
  2308. {
  2309. defect.DefectID = Convert.ToInt32(dtDefect.Rows[row]["DefectID"].ToString());
  2310. }
  2311. defect.DefectName = dtDefect.Rows[row]["DefectName"].ToString();
  2312. defect.DefectCode = dtDefect.Rows[row]["DefectCode"].ToString();
  2313. if (dtDefect.Rows[row]["DefectPositionID"].ToString() != "")
  2314. {
  2315. defect.DefectPositionID = Convert.ToInt32(dtDefect.Rows[row]["DefectPositionID"].ToString());
  2316. }
  2317. defect.DefectPositionName = dtDefect.Rows[row]["DefectPositionName"].ToString();
  2318. defect.DefectPositionCode = dtDefect.Rows[row]["DefectPositionCode"].ToString();
  2319. if (dtDefect.Rows[row]["DefectProcedureID"].ToString() != "")
  2320. {
  2321. defect.DefectProcedureID = Convert.ToInt32(dtDefect.Rows[row]["DefectProcedureID"].ToString());
  2322. }
  2323. defect.DefectProcedureName = dtDefect.Rows[row]["DefectProcedureName"].ToString();
  2324. defect.DefectProcedureCode = dtDefect.Rows[row]["DefectProcedureCode"].ToString();
  2325. if (dtDefect.Rows[row]["DefectUserID"].ToString() != "")
  2326. {
  2327. defect.DefectUserID = Convert.ToInt32(dtDefect.Rows[row]["DefectUserID"].ToString());
  2328. }
  2329. defect.DefectUserName = dtDefect.Rows[row]["DefectUserName"].ToString();
  2330. defect.DefectUserCode = dtDefect.Rows[row]["DefectUserCode"].ToString();
  2331. if (dtDefect.Rows[row]["Jobs"].ToString() != "")
  2332. {
  2333. defect.Jobs = Convert.ToInt32(dtDefect.Rows[row]["Jobs"].ToString());
  2334. }
  2335. if (dtDefect.Rows[row]["MissedUserID"].ToString() != "")
  2336. {
  2337. defect.MissedUserID = Convert.ToInt32(dtDefect.Rows[row]["MissedUserID"].ToString());
  2338. }
  2339. defect.MissedUserCode = dtDefect.Rows[row]["MissedUserCode"].ToString();
  2340. defect.MissedUserName = dtDefect.Rows[row]["MissedUserName"].ToString();
  2341. defect.JobsText = dtDefect.Rows[row]["JobsText"].ToString();
  2342. defect.DefectRemarks = dtDefect.Rows[row]["DefectRemarks"].ToString();
  2343. if (dtDefect.Rows[row]["ProductionDataID"].ToString() != "")
  2344. {
  2345. defect.ProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDataID"].ToString());
  2346. }
  2347. if (dtDefect.Rows[row]["DefectProductionDataID"].ToString() != "")
  2348. {
  2349. defect.DefectProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["DefectProductionDataID"].ToString());
  2350. }
  2351. if (dtDefect.Rows[row]["DefectFineID"].ToString() != "")
  2352. {
  2353. defect.DefectFineID = Convert.ToInt32(dtDefect.Rows[row]["DefectFineID"].ToString());
  2354. }
  2355. defect.DefectFineValue = dtDefect.Rows[row]["DefectFineValue"].ToString();
  2356. defect.CheckTime = Convert.ToDateTime(dtDefect.Rows[row]["CheckTime"]);
  2357. //--------责任员工-------------------
  2358. DataRow[] drRow = reworkDs.Tables[2].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[row]["ProductionDefectID"]);
  2359. if (drRow.Length > Constant.INT_IS_ZERO)
  2360. {
  2361. foreach (DataRow r in drRow)
  2362. {
  2363. PDADefectResponsibleResult defectResponsible = new PDADefectResponsibleResult();
  2364. if (r["ProductionDefectID"].ToString() != "")
  2365. {
  2366. defectResponsible.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
  2367. }
  2368. if (r["StaffID"].ToString() != "")
  2369. {
  2370. defectResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
  2371. }
  2372. defectResponsible.StaffCode = r["StaffCode"].ToString();
  2373. defectResponsible.StaffName = r["StaffName"].ToString();
  2374. if (r["StaffStatus"].ToString() != "")
  2375. {
  2376. defectResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
  2377. }
  2378. if (r["UJobsID"].ToString() != "")
  2379. {
  2380. defectResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
  2381. }
  2382. if (r["SJobsID"].ToString() != "")
  2383. {
  2384. defectResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
  2385. }
  2386. defect.PDADefectResponsibles.Add(defectResponsible);
  2387. }
  2388. }
  2389. //------------------------------
  2390. //--------漏检员工-------------------
  2391. DataRow[] drMissedRow = reworkDs.Tables[4].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[i]["ProductionDefectID"]);
  2392. if (drMissedRow.Length > Constant.INT_IS_ZERO)
  2393. {
  2394. foreach (DataRow r in drMissedRow)
  2395. {
  2396. PDADefectMissedResponsibleResult defectMissedResponsible = new PDADefectMissedResponsibleResult();
  2397. if (r["ProductionDefectID"].ToString() != "")
  2398. {
  2399. defectMissedResponsible.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
  2400. }
  2401. if (r["StaffID"].ToString() != "")
  2402. {
  2403. defectMissedResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
  2404. }
  2405. defectMissedResponsible.StaffCode = r["StaffCode"].ToString();
  2406. defectMissedResponsible.StaffName = r["StaffName"].ToString();
  2407. if (r["StaffStatus"].ToString() != "")
  2408. {
  2409. defectMissedResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
  2410. }
  2411. if (r["UJobsID"].ToString() != "")
  2412. {
  2413. defectMissedResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
  2414. }
  2415. if (r["SJobsID"].ToString() != "")
  2416. {
  2417. defectMissedResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
  2418. }
  2419. defect.PDADefectMissedResponsibles.Add(defectMissedResponsible);
  2420. }
  2421. }
  2422. //------------------------------
  2423. DataRow[] drImageRow = reworkDs.Tables[3].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[row]["ProductionDefectID"]);
  2424. if (drImageRow.Length > Constant.INT_IS_ZERO)
  2425. {
  2426. foreach (DataRow r in drImageRow)
  2427. {
  2428. PDADefectImageResult defectImage = new PDADefectImageResult();
  2429. if (r["ProductionDefectID"].ToString() != "")
  2430. {
  2431. defectImage.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
  2432. }
  2433. defectImage.Thumbnailpath = r["Thumbnailpath"].ToString();
  2434. //if (File.Exists(System.AppDomain.CurrentDomain.BaseDirectory + r["Imagepath"].ToString()))
  2435. //{
  2436. defectImage.Imagepath = r["Imagepath"].ToString();// r["Imagepath"].ToString();
  2437. //}
  2438. defect.PDADefectImageResults.Add(defectImage);
  2439. }
  2440. }
  2441. productionData.PDADefects.Add(defect);
  2442. }
  2443. if (productionDatas.PDAProductionData == null)
  2444. {
  2445. productionDatas.PDAProductionData = new System.Collections.Generic.List<PDAProductionDataResult>();
  2446. }
  2447. productionDatas.PDAProductionData.Add(productionData);
  2448. //---------------------------------------------------------------------------------
  2449. }
  2450. }
  2451. actionResult.Result = JsonHelper.ToJson(productionDatas);
  2452. actionResult.Status = (int)Constant.PDAResult.Success;
  2453. }
  2454. else
  2455. {
  2456. actionResult.Status = (int)Constant.PDAResult.Fail;
  2457. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2458. }
  2459. }
  2460. catch (Exception ex)
  2461. {
  2462. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2463. OutputLog.TraceLog(LogPriority.Error,
  2464. this.ToString(),
  2465. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2466. ex.ToString(),
  2467. LocalPath.LogExePath);
  2468. actionResult.Status = (int)Constant.PDAResult.Exception;
  2469. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2470. }
  2471. return actionResult;
  2472. }
  2473. /// <summary>
  2474. /// 编辑后删除生产数据
  2475. /// </summary>
  2476. /// <param name="productionDataID">生产数据ID</param>
  2477. /// <returns>int</returns>
  2478. public ActionResult DeleteProductionDataByID(string accountCode, string userCode, string userPassword, string sessionKey, int productionDataID)
  2479. {
  2480. ActionResult actionResult = new ActionResult();
  2481. try
  2482. {
  2483. // 验证请求头信息
  2484. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2485. // 验证失败
  2486. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2487. {
  2488. return actionResult;
  2489. }
  2490. int row = ServiceInvoker.Invoke<int>(this,
  2491. () => PMModuleLogic.DeleteProductionDataByID(productionDataID));
  2492. actionResult.Result = JsonHelper.ToJson(row);
  2493. actionResult.Status = (int)Constant.PDAResult.Success;
  2494. }
  2495. catch (Exception ex)
  2496. {
  2497. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2498. OutputLog.TraceLog(LogPriority.Error,
  2499. this.ToString(),
  2500. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2501. ex.ToString(),
  2502. LocalPath.LogExePath);
  2503. actionResult.Status = (int)Constant.PDAResult.Exception;
  2504. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2505. }
  2506. return actionResult;
  2507. }
  2508. /// <summary>
  2509. /// 获取产品完成工序的ID
  2510. /// </summary>
  2511. /// <param name="barcode">产品条码</param>
  2512. /// <returns>int</returns>
  2513. public ActionResult GetCompleteProcedureID(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  2514. {
  2515. ActionResult actionResult = new ActionResult();
  2516. try
  2517. {
  2518. // 验证请求头信息
  2519. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2520. // 验证失败
  2521. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2522. {
  2523. return actionResult;
  2524. }
  2525. int row = ServiceInvoker.Invoke<int>(this,
  2526. () => PMModuleLogic.GetCompleteProcedureID(barcode));
  2527. actionResult.Result = JsonHelper.ToJson(row);
  2528. actionResult.Status = (int)Constant.PDAResult.Success;
  2529. }
  2530. catch (Exception ex)
  2531. {
  2532. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2533. OutputLog.TraceLog(LogPriority.Error,
  2534. this.ToString(),
  2535. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2536. ex.ToString(),
  2537. LocalPath.LogExePath);
  2538. actionResult.Status = (int)Constant.PDAResult.Exception;
  2539. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2540. }
  2541. return actionResult;
  2542. }
  2543. /// <summary>
  2544. /// 绑定图片
  2545. /// </summary>
  2546. /// <param name="accountCode">帐套code</param>
  2547. /// <param name="userCode">用户code</param>
  2548. /// <param name="userPassword">用户密码</param>
  2549. /// <param name="sessionKey">本次登陆密钥</param>
  2550. /// <param name="imagePath">图片路径</param>
  2551. /// <returns></returns>
  2552. public Stream BindDefectImage(string accountCode, string userCode, string userPassword, string sessionKey, string imagePath)
  2553. {
  2554. try
  2555. {
  2556. return ServiceInvoker.Invoke<Stream>(this, () => PDAModuleLogic.BindDefectImage(imagePath));
  2557. }
  2558. catch (Exception ex)
  2559. {
  2560. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2561. OutputLog.TraceLog(LogPriority.Error,
  2562. this.ToString(),
  2563. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2564. ex.ToString(),
  2565. LocalPath.LogExePath);
  2566. return null;
  2567. }
  2568. }
  2569. /// <summary>
  2570. /// 根据所选工号对应的工种,查出缺陷责任员工
  2571. /// </summary>
  2572. /// <param name="jobs">工种ID</param>
  2573. /// <returns></returns>
  2574. public ActionResult GetDutyStaffByUserJobsID(string accountCode, string userCode, string userPassword, string sessionKey, int jobs, int userid)
  2575. {
  2576. ActionResult actionResult = new ActionResult();
  2577. try
  2578. {
  2579. // 验证请求头信息
  2580. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2581. // 验证失败
  2582. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2583. {
  2584. return actionResult;
  2585. }
  2586. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2587. () => PDAModuleLogic.GetDutyStaffByUserJobsID(jobs, sUserInfo, userid));
  2588. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2589. {
  2590. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2591. actionResult.Status = (int)Constant.PDAResult.Success;
  2592. }
  2593. else
  2594. {
  2595. actionResult.Status = (int)Constant.PDAResult.Fail;
  2596. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2597. }
  2598. }
  2599. catch (Exception ex)
  2600. {
  2601. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2602. OutputLog.TraceLog(LogPriority.Error,
  2603. this.ToString(),
  2604. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2605. ex.ToString(),
  2606. LocalPath.LogExePath);
  2607. actionResult.Status = (int)Constant.PDAResult.Exception;
  2608. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2609. }
  2610. return actionResult;
  2611. }
  2612. #region 产品报废
  2613. /// <summary>
  2614. /// 验证废弃产品唯一性
  2615. /// </summary>
  2616. /// <param name="barcode">产品条码</param>
  2617. /// <returns>int</returns>
  2618. public ActionResult ScrapProductChack(string accountCode, string userCode, string userPassword, string sessionKey, string barCode)
  2619. {
  2620. ActionResult actionResult = new ActionResult();
  2621. try
  2622. {
  2623. // 验证请求头信息
  2624. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2625. // 验证失败
  2626. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2627. {
  2628. return actionResult;
  2629. }
  2630. string row = ServiceInvoker.Invoke<string>(this,
  2631. () => PDAModuleLogic.ScrapProductChack(barCode, sUserInfo));
  2632. string[] rm = row.Split(':');
  2633. actionResult.Result = rm[0];//JsonHelper.ToJson(rm[0]);
  2634. if (rm.Length > 1)
  2635. {
  2636. actionResult.Message = rm[1];
  2637. }
  2638. actionResult.Status = (int)Constant.PDAResult.Success;
  2639. }
  2640. catch (Exception ex)
  2641. {
  2642. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2643. OutputLog.TraceLog(LogPriority.Error,
  2644. this.ToString(),
  2645. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2646. ex.ToString(),
  2647. LocalPath.LogExePath);
  2648. actionResult.Status = (int)Constant.PDAResult.Exception;
  2649. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2650. }
  2651. return actionResult;
  2652. }
  2653. /// <summary>
  2654. /// 根据条码获取该产品的在产信息以及生产数据
  2655. /// </summary>
  2656. /// <param name="Barcode">产品条码</param>
  2657. /// <returns>装有两个DataTable的数据集,第一个是在产信息,第二个是生产数据</returns>
  2658. public ActionResult GetInProductionAndProductionData(string accountCode, string userCode, string userPassword, string sessionKey, string barCode)
  2659. {
  2660. ActionResult actionResult = new ActionResult();
  2661. try
  2662. {
  2663. // 验证请求头信息
  2664. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2665. // 验证失败
  2666. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2667. {
  2668. return actionResult;
  2669. }
  2670. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2671. () => PDAModuleLogic.GetInProductionAndProductionData(barCode, sUserInfo));
  2672. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2673. {
  2674. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2675. actionResult.Status = (int)Constant.PDAResult.Success;
  2676. }
  2677. else
  2678. {
  2679. actionResult.Status = (int)Constant.PDAResult.Fail;
  2680. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2681. }
  2682. }
  2683. catch (Exception ex)
  2684. {
  2685. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2686. OutputLog.TraceLog(LogPriority.Error,
  2687. this.ToString(),
  2688. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2689. ex.ToString(),
  2690. LocalPath.LogExePath);
  2691. actionResult.Status = (int)Constant.PDAResult.Exception;
  2692. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2693. }
  2694. return actionResult;
  2695. }
  2696. /// <summary>
  2697. /// 根据工号查询员工档案信息
  2698. /// </summary>
  2699. /// <param name="accountCode"></param>
  2700. /// <param name="userCode"></param>
  2701. /// <param name="userPassword"></param>
  2702. /// <param name="sessionKey"></param>
  2703. /// <param name="userId"></param>
  2704. /// <returns></returns>
  2705. public ActionResult SearchHrStaffInfo(string accountCode, string userCode, string userPassword, string sessionKey, int userId)
  2706. {
  2707. ActionResult actionResult = new ActionResult();
  2708. try
  2709. {
  2710. // 验证请求头信息
  2711. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2712. // 验证失败
  2713. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2714. {
  2715. return actionResult;
  2716. }
  2717. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2718. () => PDAModuleLogic.SearchHrStaffInfo(userId, sUserInfo));
  2719. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2720. {
  2721. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2722. actionResult.Status = (int)Constant.PDAResult.Success;
  2723. }
  2724. else
  2725. {
  2726. actionResult.Status = (int)Constant.PDAResult.Fail;
  2727. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2728. }
  2729. }
  2730. catch (Exception ex)
  2731. {
  2732. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2733. OutputLog.TraceLog(LogPriority.Error,
  2734. this.ToString(),
  2735. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2736. ex.ToString(),
  2737. LocalPath.LogExePath);
  2738. actionResult.Status = (int)Constant.PDAResult.Exception;
  2739. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2740. }
  2741. return actionResult;
  2742. }
  2743. /// <summary>
  2744. /// 添加废弃产品记录
  2745. /// </summary>
  2746. /// <param name="SProductEntity">废弃产品实体</param>
  2747. /// <param name="RProcedureEntity">废弃责任工序实体</param>
  2748. /// <param name="SResponsibleList">责任者集合</param>
  2749. /// <param name="userInfo">用户基本信息</param>
  2750. /// <returns>int结果返回值</returns>
  2751. /// <remarks>
  2752. /// 庄天威 2014.09.24 新建
  2753. /// </remarks>
  2754. public ActionResult AddScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey,
  2755. ScrapProductEntity SProductEntity, ResponProcedureEntity RProcedureEntity,
  2756. ScrapResponsibleEntity[] SResponsibleList)
  2757. {
  2758. ActionResult actionResult = new ActionResult();
  2759. if (SResponsibleList == null || SResponsibleList.Length == 0)
  2760. {
  2761. actionResult.Status = (int)Constant.PDAResult.Fail;
  2762. actionResult.Message = "没有选择责任人";
  2763. }
  2764. try
  2765. {
  2766. // 验证请求头信息
  2767. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2768. // 验证失败
  2769. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2770. {
  2771. return actionResult;
  2772. }
  2773. int addRow = ServiceInvoker.Invoke<int>(this,
  2774. () => PDAModuleLogic.AddScrapProduct(SProductEntity, RProcedureEntity, SResponsibleList, sUserInfo));
  2775. actionResult.Result = JsonHelper.ToJson(addRow);
  2776. actionResult.Status = (int)Constant.PDAResult.Success;
  2777. }
  2778. catch (Exception ex)
  2779. {
  2780. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2781. OutputLog.TraceLog(LogPriority.Error,
  2782. this.ToString(),
  2783. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2784. ex.ToString(),
  2785. LocalPath.LogExePath);
  2786. actionResult.Status = (int)Constant.PDAResult.Exception;
  2787. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2788. // TODO 空指针异常问题检测
  2789. try
  2790. {
  2791. OutputLog.TraceLog(LogPriority.Error,
  2792. this.ToString(),
  2793. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2794. "accountCode:" + accountCode + "#userCode:" + userCode + "#sessionKey:" + sessionKey,
  2795. LocalPath.LogExePath);
  2796. string json1 = JsonHelper.ToJson(SProductEntity);
  2797. OutputLog.TraceLog(LogPriority.Error,
  2798. this.ToString(),
  2799. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2800. "SProductEntity:" + json1,
  2801. LocalPath.LogExePath);
  2802. string json2 = JsonHelper.ToJson(RProcedureEntity);
  2803. OutputLog.TraceLog(LogPriority.Error,
  2804. this.ToString(),
  2805. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2806. "RProcedureEntity:" + json2,
  2807. LocalPath.LogExePath);
  2808. string json3 = JsonHelper.ToJson(SResponsibleList);
  2809. OutputLog.TraceLog(LogPriority.Error,
  2810. this.ToString(),
  2811. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2812. "SResponsibleList:" + json3,
  2813. LocalPath.LogExePath);
  2814. }
  2815. catch (Exception exc)
  2816. {
  2817. OutputLog.TraceLog(LogPriority.Error,
  2818. this.ToString(),
  2819. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2820. "参数输入异常:" + exc.Message,
  2821. LocalPath.LogExePath);
  2822. }
  2823. }
  2824. return actionResult;
  2825. }
  2826. /// <summary>
  2827. /// 获取产品分级的数据(根据ID)
  2828. /// </summary>
  2829. /// <param name="GoodsLevelTypeID">分类类别ID</param>
  2830. /// <param name="GoodsLevelID">分类ID</param>
  2831. /// <param name="sUserInfo">用户基本信息</param>
  2832. /// <returns>DataSet</returns>
  2833. /// <remarks>
  2834. /// 2014.10.22 庄天威 新建
  2835. public ActionResult GetGoodsLevelDataById(string accountCode, string userCode, string userPassword, string sessionKey, int? GoodsLevelTypeID)
  2836. {
  2837. ActionResult actionResult = new ActionResult();
  2838. try
  2839. {
  2840. // 验证请求头信息
  2841. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2842. // 验证失败
  2843. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2844. {
  2845. return actionResult;
  2846. }
  2847. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2848. () => SystemModuleLogic.GetGoodsLevelDataById(GoodsLevelTypeID, null, sUserInfo));
  2849. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2850. {
  2851. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2852. actionResult.Status = (int)Constant.PDAResult.Success;
  2853. }
  2854. else
  2855. {
  2856. actionResult.Status = (int)Constant.PDAResult.Fail;
  2857. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2858. }
  2859. }
  2860. catch (Exception ex)
  2861. {
  2862. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2863. OutputLog.TraceLog(LogPriority.Error,
  2864. this.ToString(),
  2865. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2866. ex.ToString(),
  2867. LocalPath.LogExePath);
  2868. actionResult.Status = (int)Constant.PDAResult.Exception;
  2869. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2870. }
  2871. return actionResult;
  2872. }
  2873. /// <summary>
  2874. /// 获取账务日期
  2875. /// </summary>
  2876. /// <param name="accountCode"></param>
  2877. /// <param name="userCode"></param>
  2878. /// <param name="userPassword"></param>
  2879. /// <param name="sessionKey"></param>
  2880. /// <returns></returns>
  2881. public ActionResult GetAccountDate(string accountCode, string userCode, string userPassword, string sessionKey)
  2882. {
  2883. ActionResult actionResult = new ActionResult();
  2884. try
  2885. {
  2886. // 验证请求头信息
  2887. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2888. // 验证失败
  2889. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2890. {
  2891. return actionResult;
  2892. }
  2893. DateTime reworkDs = ServiceInvoker.Invoke<DateTime>(this,
  2894. () => CommonModuleLogic.GetAccountDate(sUserInfo));
  2895. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2896. actionResult.Status = (int)Constant.PDAResult.Success;
  2897. }
  2898. catch (Exception ex)
  2899. {
  2900. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2901. OutputLog.TraceLog(LogPriority.Error,
  2902. this.ToString(),
  2903. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2904. ex.ToString(),
  2905. LocalPath.LogExePath);
  2906. actionResult.Status = (int)Constant.PDAResult.Exception;
  2907. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2908. }
  2909. return actionResult;
  2910. }
  2911. /// <summary>
  2912. /// 获取登陆帐户有无报损权限
  2913. /// </summary>
  2914. /// <param name="accountCode"></param>
  2915. /// <param name="userCode"></param>
  2916. /// <param name="userPassword"></param>
  2917. /// <param name="sessionKey"></param>
  2918. /// <param name="usercode">工号编码</param>
  2919. /// <returns></returns>
  2920. public ActionResult GetScrapFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  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. int returnValue = ServiceInvoker.Invoke<int>(this,
  2933. () => PDAModuleLogic.GetScrapFuntion(userCode, sUserInfo));
  2934. actionResult.Result = JsonHelper.ToJson(returnValue);
  2935. actionResult.Status = (int)Constant.PDAResult.Success;
  2936. }
  2937. catch (Exception ex)
  2938. {
  2939. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2940. OutputLog.TraceLog(LogPriority.Error,
  2941. this.ToString(),
  2942. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2943. ex.ToString(),
  2944. LocalPath.LogExePath);
  2945. actionResult.Status = (int)Constant.PDAResult.Exception;
  2946. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2947. }
  2948. return actionResult;
  2949. }
  2950. #endregion
  2951. /// <summary>
  2952. /// 获取是否存在报损未审核产品
  2953. /// </summary>
  2954. /// <param name="barcode">产品条码</param>
  2955. /// <returns>int</returns>
  2956. public ActionResult GetScrapProductAuditStatus(string accountCode, string userCode, string userPassword, string sessionKey, string barCode)
  2957. {
  2958. ActionResult actionResult = new ActionResult();
  2959. try
  2960. {
  2961. // 验证请求头信息
  2962. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2963. // 验证失败
  2964. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2965. {
  2966. return actionResult;
  2967. }
  2968. int row = ServiceInvoker.Invoke<int>(this,
  2969. () => PDAModuleLogic.GetScrapProductAuditStatus(barCode));
  2970. actionResult.Result = JsonHelper.ToJson(row);
  2971. actionResult.Status = (int)Constant.PDAResult.Success;
  2972. }
  2973. catch (Exception ex)
  2974. {
  2975. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2976. OutputLog.TraceLog(LogPriority.Error,
  2977. this.ToString(),
  2978. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2979. ex.ToString(),
  2980. LocalPath.LogExePath);
  2981. actionResult.Status = (int)Constant.PDAResult.Exception;
  2982. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2983. }
  2984. return actionResult;
  2985. }
  2986. /// <summary>
  2987. /// 查询报废产品信息
  2988. /// </summary>
  2989. /// <param name="accountCode"></param>
  2990. /// <param name="userCode"></param>
  2991. /// <param name="userPassword"></param>
  2992. /// <param name="sessionKey"></param>
  2993. /// <param name="barCode">产品条码</param>
  2994. /// <param name="scrapProductID">报废产品ID</param>
  2995. /// <returns></returns>
  2996. public ActionResult GetScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barCode, int scrapProductID)
  2997. {
  2998. ActionResult actionResult = new ActionResult();
  2999. try
  3000. {
  3001. // 验证请求头信息
  3002. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3003. // 验证失败
  3004. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3005. {
  3006. return actionResult;
  3007. }
  3008. ScrapProductEntity selectProEntity = new ScrapProductEntity();
  3009. selectProEntity.BarCode = barCode;
  3010. selectProEntity.ScrapProductID = scrapProductID;
  3011. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3012. () => PMModuleLogic.GetScrapProduct(selectProEntity, sUserInfo));
  3013. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3014. {
  3015. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3016. actionResult.Status = (int)Constant.PDAResult.Success;
  3017. }
  3018. else
  3019. {
  3020. actionResult.Status = (int)Constant.PDAResult.Fail;
  3021. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3022. }
  3023. }
  3024. catch (Exception ex)
  3025. {
  3026. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3027. OutputLog.TraceLog(LogPriority.Error,
  3028. this.ToString(),
  3029. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3030. ex.ToString(),
  3031. LocalPath.LogExePath);
  3032. actionResult.Status = (int)Constant.PDAResult.Exception;
  3033. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3034. }
  3035. return actionResult;
  3036. }
  3037. /// <summary>
  3038. /// 根据废弃产品ID获取责任工序
  3039. /// </summary>
  3040. /// <param name="accountCode"></param>
  3041. /// <param name="userCode"></param>
  3042. /// <param name="userPassword"></param>
  3043. /// <param name="sessionKey"></param>
  3044. /// <param name="scrapProductID">报废产品ID</param>
  3045. /// <returns></returns>
  3046. public ActionResult GetResponProcedureBySPId(string accountCode, string userCode, string userPassword, string sessionKey, int scrapProductID)
  3047. {
  3048. ActionResult actionResult = new ActionResult();
  3049. try
  3050. {
  3051. // 验证请求头信息
  3052. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3053. // 验证失败
  3054. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3055. {
  3056. return actionResult;
  3057. }
  3058. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3059. () => PMModuleLogic.GetResponProcedureBySPId(scrapProductID));
  3060. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3061. {
  3062. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3063. actionResult.Status = (int)Constant.PDAResult.Success;
  3064. }
  3065. else
  3066. {
  3067. actionResult.Status = (int)Constant.PDAResult.Fail;
  3068. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3069. }
  3070. }
  3071. catch (Exception ex)
  3072. {
  3073. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3074. OutputLog.TraceLog(LogPriority.Error,
  3075. this.ToString(),
  3076. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3077. ex.ToString(),
  3078. LocalPath.LogExePath);
  3079. actionResult.Status = (int)Constant.PDAResult.Exception;
  3080. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3081. }
  3082. return actionResult;
  3083. }
  3084. /// <summary>
  3085. /// 根据废弃产品ID获取责任人列表
  3086. /// </summary>
  3087. /// <param name="accountCode"></param>
  3088. /// <param name="userCode"></param>
  3089. /// <param name="userPassword"></param>
  3090. /// <param name="sessionKey"></param>
  3091. /// <param name="scrapProductID">报废产品ID</param>
  3092. /// <returns></returns>
  3093. public ActionResult GetScrapResponsibleBySPId(string accountCode, string userCode, string userPassword, string sessionKey, int scrapProductID)
  3094. {
  3095. ActionResult actionResult = new ActionResult();
  3096. try
  3097. {
  3098. // 验证请求头信息
  3099. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3100. // 验证失败
  3101. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3102. {
  3103. return actionResult;
  3104. }
  3105. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3106. () => PMModuleLogic.GetScrapResponsibleBySPId(scrapProductID));
  3107. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3108. {
  3109. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3110. actionResult.Status = (int)Constant.PDAResult.Success;
  3111. }
  3112. else
  3113. {
  3114. actionResult.Status = (int)Constant.PDAResult.Fail;
  3115. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3116. }
  3117. }
  3118. catch (Exception ex)
  3119. {
  3120. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3121. OutputLog.TraceLog(LogPriority.Error,
  3122. this.ToString(),
  3123. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3124. ex.ToString(),
  3125. LocalPath.LogExePath);
  3126. actionResult.Status = (int)Constant.PDAResult.Exception;
  3127. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3128. }
  3129. return actionResult;
  3130. }
  3131. /// <summary>
  3132. /// 添加废弃产品记录
  3133. /// </summary>
  3134. /// <param name="SProductEntity">废弃产品实体</param>
  3135. /// <param name="RProcedureEntity">废弃责任工序实体</param>
  3136. /// <param name="SResponsibleList">责任者集合</param>
  3137. /// <param name="userInfo">用户基本信息</param>
  3138. /// <returns>int结果返回值</returns>
  3139. /// <remarks>
  3140. /// 庄天威 2014.09.24 新建
  3141. /// </remarks>
  3142. public ActionResult UpdateScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, ScrapProductEntity UpdateSProductEntity,
  3143. ResponProcedureEntity UpdateRProcedureEntity,
  3144. ScrapResponsibleEntity[] UpdateSResponsibleList, ScrapResponsibleEntity[] YSResponsibleList)
  3145. {
  3146. ActionResult actionResult = new ActionResult();
  3147. try
  3148. {
  3149. // 验证请求头信息
  3150. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3151. // 验证失败
  3152. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3153. {
  3154. return actionResult;
  3155. }
  3156. int addRow = ServiceInvoker.Invoke<int>(this,
  3157. () => PDAModuleLogic.UpdateScrapProduct(UpdateSProductEntity, UpdateRProcedureEntity, UpdateSResponsibleList, YSResponsibleList, sUserInfo));
  3158. actionResult.Result = JsonHelper.ToJson(addRow);
  3159. actionResult.Status = (int)Constant.PDAResult.Success;
  3160. }
  3161. catch (Exception ex)
  3162. {
  3163. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3164. OutputLog.TraceLog(LogPriority.Error,
  3165. this.ToString(),
  3166. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3167. ex.ToString(),
  3168. LocalPath.LogExePath);
  3169. actionResult.Status = (int)Constant.PDAResult.Exception;
  3170. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3171. }
  3172. return actionResult;
  3173. }
  3174. /// <summary>
  3175. /// 获取产品窑炉
  3176. /// </summary>
  3177. /// <param name="accountCode"></param>
  3178. /// <param name="userCode"></param>
  3179. /// <param name="userPassword"></param>
  3180. /// <param name="sessionKey"></param>
  3181. /// <returns>Datase</returns>
  3182. public ActionResult GetAllKilntInfo(string accountCode, string userCode, string userPassword, string sessionKey)
  3183. {
  3184. ActionResult actionResult = new ActionResult();
  3185. try
  3186. {
  3187. // 验证请求头信息
  3188. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3189. // 验证失败
  3190. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3191. {
  3192. return actionResult;
  3193. }
  3194. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3195. () => PDAModuleLogic.GetAllKilntInfo(sUserInfo));
  3196. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3197. {
  3198. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3199. actionResult.Status = (int)Constant.PDAResult.Success;
  3200. }
  3201. else
  3202. {
  3203. actionResult.Status = (int)Constant.PDAResult.Fail;
  3204. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3205. }
  3206. }
  3207. catch (Exception ex)
  3208. {
  3209. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3210. OutputLog.TraceLog(LogPriority.Error,
  3211. this.ToString(),
  3212. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3213. ex.ToString(),
  3214. LocalPath.LogExePath);
  3215. actionResult.Status = (int)Constant.PDAResult.Exception;
  3216. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3217. }
  3218. return actionResult;
  3219. }
  3220. /// <summary>
  3221. /// 获取次品产品条码允许编辑
  3222. /// </summary>
  3223. /// <param name="accountCode"></param>
  3224. /// <param name="userCode"></param>
  3225. /// <param name="userPassword"></param>
  3226. /// <param name="sessionKey"></param>
  3227. /// <param name="barcode">产品条码</param>
  3228. /// <returns>Datase</returns>
  3229. public ActionResult GetSubstandardInfo(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3230. {
  3231. ActionResult actionResult = new ActionResult();
  3232. try
  3233. {
  3234. // 验证请求头信息
  3235. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3236. // 验证失败
  3237. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3238. {
  3239. return actionResult;
  3240. }
  3241. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3242. () => PDAModuleLogic.GetSubstandardInfo(barcode));
  3243. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3244. {
  3245. actionResult.Result = JsonHelper.ToJson(1);
  3246. actionResult.Status = (int)Constant.PDAResult.Success;
  3247. }
  3248. else
  3249. {
  3250. actionResult.Result = JsonHelper.ToJson(0);
  3251. actionResult.Status = (int)Constant.PDAResult.Fail;
  3252. actionResult.Message = "次品条码:" + barcode + "不允许修改";
  3253. }
  3254. }
  3255. catch (Exception ex)
  3256. {
  3257. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3258. OutputLog.TraceLog(LogPriority.Error,
  3259. this.ToString(),
  3260. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3261. ex.ToString(),
  3262. LocalPath.LogExePath);
  3263. actionResult.Status = (int)Constant.PDAResult.Exception;
  3264. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3265. }
  3266. return actionResult;
  3267. }
  3268. /// <summary>
  3269. /// 获取产品条码是否重烧
  3270. /// </summary>
  3271. /// <param name="accountCode"></param>
  3272. /// <param name="userCode"></param>
  3273. /// <param name="userPassword"></param>
  3274. /// <param name="sessionKey"></param>
  3275. /// <param name="barcode">产品条码</param>
  3276. /// <returns>Datase</returns>
  3277. public ActionResult GetReFine(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3278. {
  3279. ActionResult actionResult = new ActionResult();
  3280. try
  3281. {
  3282. // 验证请求头信息
  3283. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3284. // 验证失败
  3285. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3286. {
  3287. return actionResult;
  3288. }
  3289. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3290. () => PDAModuleLogic.GetReFine(barcode));
  3291. if (reworkDs != null && reworkDs.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  3292. {
  3293. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(reworkDs.Tables[0].Rows[0]["IsReFire"]));
  3294. }
  3295. else
  3296. {
  3297. actionResult.Result = JsonHelper.ToJson(0);
  3298. }
  3299. actionResult.Status = (int)Constant.PDAResult.Success;
  3300. }
  3301. catch (Exception ex)
  3302. {
  3303. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3304. OutputLog.TraceLog(LogPriority.Error,
  3305. this.ToString(),
  3306. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3307. ex.ToString(),
  3308. LocalPath.LogExePath);
  3309. actionResult.Status = (int)Constant.PDAResult.Exception;
  3310. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3311. }
  3312. return actionResult;
  3313. }
  3314. /// <summary>
  3315. /// 获取登陆帐户有无成检编辑权限
  3316. /// </summary>
  3317. /// <param name="accountCode"></param>
  3318. /// <param name="userCode"></param>
  3319. /// <param name="userPassword"></param>
  3320. /// <param name="sessionKey"></param>
  3321. /// <param name="usercode">工号编码</param>
  3322. /// <returns></returns>
  3323. public ActionResult GetFinishedProductEditFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  3324. {
  3325. ActionResult actionResult = new ActionResult();
  3326. try
  3327. {
  3328. // 验证请求头信息
  3329. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3330. // 验证失败
  3331. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3332. {
  3333. return actionResult;
  3334. }
  3335. int returnValue = ServiceInvoker.Invoke<int>(this,
  3336. () => PDAModuleLogic.GetFinishedProductEditFuntion(sUserInfo));
  3337. actionResult.Result = JsonHelper.ToJson(returnValue);
  3338. actionResult.Status = (int)Constant.PDAResult.Success;
  3339. }
  3340. catch (Exception ex)
  3341. {
  3342. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3343. OutputLog.TraceLog(LogPriority.Error,
  3344. this.ToString(),
  3345. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3346. ex.ToString(),
  3347. LocalPath.LogExePath);
  3348. actionResult.Status = (int)Constant.PDAResult.Exception;
  3349. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3350. }
  3351. return actionResult;
  3352. }
  3353. /// <summary>
  3354. /// 根据条码及工序判断是否漏扫
  3355. /// </summary>
  3356. /// <param name="accountCode"></param>
  3357. /// <param name="userCode"></param>
  3358. /// <param name="userPassword"></param>
  3359. /// <param name="sessionKey"></param>
  3360. /// <param name="usercode">工号编码</param>
  3361. /// <param name="barcode">产品条码</param>
  3362. /// <param name="produceid">工序ID</param>
  3363. /// <returns></returns>
  3364. public ActionResult AddBarCodeMissing(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int produceid)
  3365. {
  3366. ActionResult actionResult = new ActionResult();
  3367. try
  3368. {
  3369. // 验证请求头信息
  3370. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3371. // 验证失败
  3372. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3373. {
  3374. return actionResult;
  3375. }
  3376. int returnValue = 1;
  3377. //int returnValue = ServiceInvoker.Invoke<int>(this,
  3378. // () => PMModuleLogicDAL.AddBarCodeMissing(barcode, produceid, sUserInfo));
  3379. actionResult.Result = JsonHelper.ToJson(returnValue);
  3380. actionResult.Status = (int)Constant.PDAResult.Success;
  3381. }
  3382. catch (Exception ex)
  3383. {
  3384. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3385. OutputLog.TraceLog(LogPriority.Error,
  3386. this.ToString(),
  3387. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3388. ex.ToString(),
  3389. LocalPath.LogExePath);
  3390. actionResult.Status = (int)Constant.PDAResult.Exception;
  3391. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3392. }
  3393. return actionResult;
  3394. }
  3395. /// <summary>
  3396. /// 获取登陆帐户有无报损审批权限
  3397. /// </summary>
  3398. /// <param name="accountCode"></param>
  3399. /// <param name="userCode"></param>
  3400. /// <param name="userPassword"></param>
  3401. /// <param name="sessionKey"></param>
  3402. /// <param name="usercode">工号编码</param>
  3403. /// <returns></returns>
  3404. public ActionResult GetScrapProductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  3405. {
  3406. ActionResult actionResult = new ActionResult();
  3407. try
  3408. {
  3409. // 验证请求头信息
  3410. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3411. // 验证失败
  3412. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3413. {
  3414. return actionResult;
  3415. }
  3416. int returnValue = ServiceInvoker.Invoke<int>(this,
  3417. () => PDAModuleLogic.GetScrapProductFuntion(sUserInfo));
  3418. actionResult.Result = JsonHelper.ToJson(returnValue);
  3419. actionResult.Status = (int)Constant.PDAResult.Success;
  3420. }
  3421. catch (Exception ex)
  3422. {
  3423. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3424. OutputLog.TraceLog(LogPriority.Error,
  3425. this.ToString(),
  3426. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3427. ex.ToString(),
  3428. LocalPath.LogExePath);
  3429. actionResult.Status = (int)Constant.PDAResult.Exception;
  3430. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3431. }
  3432. return actionResult;
  3433. }
  3434. /// <summary>
  3435. /// 获取登陆帐户有无报损审批权限
  3436. /// </summary>
  3437. /// <param name="accountCode"></param>
  3438. /// <param name="userCode"></param>
  3439. /// <param name="userPassword"></param>
  3440. /// <param name="sessionKey"></param>
  3441. /// <param name="usercode">工号编码</param>
  3442. /// <returns></returns>
  3443. public ActionResult GetSpecialRepairflagByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3444. {
  3445. ActionResult actionResult = new ActionResult();
  3446. try
  3447. {
  3448. // 验证请求头信息
  3449. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3450. // 验证失败
  3451. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3452. {
  3453. return actionResult;
  3454. }
  3455. int returnValue = ServiceInvoker.Invoke<int>(this,
  3456. () => PMModuleLogic.GetSpecialRepairflagByBarcode(barcode, sUserInfo));
  3457. actionResult.Result = JsonHelper.ToJson(returnValue);
  3458. actionResult.Status = (int)Constant.PDAResult.Success;
  3459. }
  3460. catch (Exception ex)
  3461. {
  3462. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3463. OutputLog.TraceLog(LogPriority.Error,
  3464. this.ToString(),
  3465. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3466. ex.ToString(),
  3467. LocalPath.LogExePath);
  3468. actionResult.Status = (int)Constant.PDAResult.Exception;
  3469. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3470. }
  3471. return actionResult;
  3472. }
  3473. /// <summary>
  3474. /// 获取窑车对应产品列表
  3475. /// </summary>
  3476. /// <param name="accountCode"></param>
  3477. /// <param name="userCode"></param>
  3478. /// <param name="userPassword"></param>
  3479. /// <param name="sessionKey"></param>
  3480. /// <param name="KilnCarID">窑车ID</param>
  3481. /// <returns>Dataset</returns>
  3482. public ActionResult GetKilnCarGoodsByKilnCarID(string accountCode, string userCode, string userPassword, string sessionKey, int KilnCarID)
  3483. {
  3484. ActionResult actionResult = new ActionResult();
  3485. try
  3486. {
  3487. // 验证请求头信息
  3488. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3489. // 验证失败
  3490. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3491. {
  3492. return actionResult;
  3493. }
  3494. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3495. () => PMModuleLogic.GetKilnCarGoodsByKilnCarID(KilnCarID));
  3496. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3497. {
  3498. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3499. actionResult.Status = (int)Constant.PDAResult.Success;
  3500. }
  3501. else
  3502. {
  3503. actionResult.Status = (int)Constant.PDAResult.Fail;
  3504. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3505. }
  3506. }
  3507. catch (Exception ex)
  3508. {
  3509. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3510. OutputLog.TraceLog(LogPriority.Error,
  3511. this.ToString(),
  3512. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3513. ex.ToString(),
  3514. LocalPath.LogExePath);
  3515. actionResult.Status = (int)Constant.PDAResult.Exception;
  3516. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3517. }
  3518. return actionResult;
  3519. }
  3520. /// <summary>
  3521. /// 更换条码
  3522. /// </summary>
  3523. /// <param name="accountCode"></param>
  3524. /// <param name="userCode"></param>
  3525. /// <param name="userPassword"></param>
  3526. /// <param name="sessionKey"></param>
  3527. ///<param name="barcode">原条码</param>
  3528. /// <param name="newBarcode">新条码</param>
  3529. /// <param name="remarks">备注</param>
  3530. /// <returns>操作结果</returns>
  3531. public ActionResult SaveBarCodeChange(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, string newBarcode, string remarks, string groutingUserCode, string goodsCode)
  3532. {
  3533. ActionResult actionResult = new ActionResult();
  3534. try
  3535. {
  3536. // 验证请求头信息
  3537. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3538. // 验证失败
  3539. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3540. {
  3541. return actionResult;
  3542. }
  3543. ServiceResultEntity serviceResultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  3544. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SetFPM0201Data(sUserInfo, barcode, newBarcode, remarks, groutingUserCode, goodsCode));
  3545. if (serviceResultEntity.Status == Constant.ServiceResultStatus.Success)
  3546. {
  3547. actionResult.Result = 1;
  3548. actionResult.Status = (int)Constant.PDAResult.Success;
  3549. }
  3550. else
  3551. {
  3552. actionResult.Status = (int)Constant.PDAResult.Fail;
  3553. actionResult.Message = serviceResultEntity.Message;
  3554. }
  3555. }
  3556. catch (Exception ex)
  3557. {
  3558. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3559. OutputLog.TraceLog(LogPriority.Error,
  3560. this.ToString(),
  3561. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3562. ex.ToString(),
  3563. LocalPath.LogExePath);
  3564. actionResult.Status = (int)Constant.PDAResult.Exception;
  3565. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3566. }
  3567. return actionResult;
  3568. }
  3569. /// <summary>
  3570. /// 获取(注浆登记)的查询数据
  3571. /// </summary>
  3572. /// <param name="accountCode"></param>
  3573. /// <param name="userCode"></param>
  3574. /// <param name="userPassword"></param>
  3575. /// <param name="sessionKey"></param>
  3576. /// <param name="se">查询条件</param>
  3577. /// <returns>Dataset</returns>
  3578. public ActionResult GetGroutingList(string accountCode, string userCode, string userPassword, string sessionKey, FPM0202_SE se)
  3579. {
  3580. ActionResult actionResult = new ActionResult();
  3581. try
  3582. {
  3583. // 验证请求头信息
  3584. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3585. // 验证失败
  3586. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3587. {
  3588. return actionResult;
  3589. }
  3590. ServiceResultEntity serviceResultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  3591. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetFPM0202SData(sUserInfo, se));
  3592. if (serviceResultEntity.Status != Constant.ServiceResultStatus.NoSearchResults)
  3593. {
  3594. // PDA不显示的列删除掉
  3595. //serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingDailyDetailID");
  3596. //serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingDailyID");
  3597. serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingLineName");
  3598. serviceResultEntity.Data.Tables[0].Columns.Remove("UserCode");
  3599. serviceResultEntity.Data.Tables[0].Columns.Remove("GoodsName");
  3600. serviceResultEntity.Data.Tables[0].Columns.Remove("GMouldStatusName");
  3601. serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingCount");
  3602. serviceResultEntity.Data.Tables[0].Columns.Remove("Remarks");
  3603. serviceResultEntity.Data.Tables[0].Columns.Remove("GMouldTypeName");
  3604. //serviceResultEntity.Data.Tables[0].Columns.Remove("DMUserCode");
  3605. serviceResultEntity.Data.Tables[0].Columns.Remove("IsPublicBody");
  3606. actionResult.Result = JsonHelper.ToJson(serviceResultEntity.Data.Tables[0]);
  3607. actionResult.Status = (int)Constant.PDAResult.Success;
  3608. }
  3609. else
  3610. {
  3611. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3612. actionResult.Message = "无查询数据";
  3613. }
  3614. }
  3615. catch (Exception ex)
  3616. {
  3617. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3618. OutputLog.TraceLog(LogPriority.Error,
  3619. this.ToString(),
  3620. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3621. ex.ToString(),
  3622. LocalPath.LogExePath);
  3623. actionResult.Status = (int)Constant.PDAResult.Exception;
  3624. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3625. }
  3626. return actionResult;
  3627. }
  3628. /// <summary>
  3629. /// 获取(注浆登记)的查询数据
  3630. /// </summary>
  3631. /// <param name="accountCode"></param>
  3632. /// <param name="userCode"></param>
  3633. /// <param name="userPassword"></param>
  3634. /// <param name="sessionKey"></param>
  3635. /// <param name="se">查询条件</param>
  3636. /// <returns>Dataset</returns>
  3637. public ActionResult GetGroutingListByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3638. {
  3639. ActionResult actionResult = new ActionResult();
  3640. try
  3641. {
  3642. // 验证请求头信息
  3643. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3644. // 验证失败
  3645. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3646. {
  3647. return actionResult;
  3648. }
  3649. ServiceResultEntity serviceResultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  3650. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetFPM0203SData(sUserInfo, barcode));
  3651. if (serviceResultEntity.Status != Constant.ServiceResultStatus.NoSearchResults)
  3652. {
  3653. actionResult.Result = JsonHelper.ToJson(serviceResultEntity.Data.Tables[0]);
  3654. actionResult.Status = (int)Constant.PDAResult.Success;
  3655. }
  3656. else
  3657. {
  3658. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3659. actionResult.Message = "无查询数据";
  3660. }
  3661. }
  3662. catch (Exception ex)
  3663. {
  3664. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3665. OutputLog.TraceLog(LogPriority.Error,
  3666. this.ToString(),
  3667. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3668. ex.ToString(),
  3669. LocalPath.LogExePath);
  3670. actionResult.Status = (int)Constant.PDAResult.Exception;
  3671. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3672. }
  3673. return actionResult;
  3674. }
  3675. /// <summary>
  3676. ///获得成型线信息
  3677. /// </summary>
  3678. /// <param name="accountCode"></param>
  3679. /// <param name="userCode"></param>
  3680. /// <param name="userPassword"></param>
  3681. /// <param name="sessionKey"></param>
  3682. /// <param name="se">查询条件</param>
  3683. /// <returns>Dataset</returns>
  3684. public ActionResult GetGroutingLine(string accountCode, string userCode, string userPassword, string sessionKey, GroutingLineEntity groutingLineEntity)
  3685. {
  3686. ActionResult actionResult = new ActionResult();
  3687. try
  3688. {
  3689. // 验证请求头信息
  3690. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3691. // 验证失败
  3692. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3693. {
  3694. return actionResult;
  3695. }
  3696. DataSet dsReturn = ServiceInvoker.Invoke<DataSet>(this,
  3697. () => Dongke.IBOSS.PRD.Service.PCModuleLogic.PCModuleLogic.GetGroutingLine(groutingLineEntity, sUserInfo));
  3698. if (dsReturn != null && dsReturn.Tables[0].Rows.Count > 0)
  3699. {
  3700. actionResult.Result = JsonHelper.ToJson(dsReturn.Tables[0]);
  3701. actionResult.Status = (int)Constant.PDAResult.Success;
  3702. }
  3703. else
  3704. {
  3705. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3706. actionResult.Message = "无查询数据";
  3707. }
  3708. }
  3709. catch (Exception ex)
  3710. {
  3711. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3712. OutputLog.TraceLog(LogPriority.Error,
  3713. this.ToString(),
  3714. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3715. ex.ToString(),
  3716. LocalPath.LogExePath);
  3717. actionResult.Status = (int)Constant.PDAResult.Exception;
  3718. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3719. }
  3720. return actionResult;
  3721. }
  3722. /// <summary>
  3723. ///获取在产产品的信息标识列表
  3724. /// </summary>
  3725. /// <param name="accountCode"></param>
  3726. /// <param name="userCode"></param>
  3727. /// <param name="userPassword"></param>
  3728. /// <param name="sessionKey"></param>
  3729. /// <param name="barcode">查询条件</param>
  3730. /// <returns>Dataset</returns>
  3731. public ActionResult GetInProductionDataList(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3732. {
  3733. ActionResult actionResult = new ActionResult();
  3734. try
  3735. {
  3736. // 验证请求头信息
  3737. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3738. // 验证失败
  3739. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3740. {
  3741. return actionResult;
  3742. }
  3743. DataSet dsReturn = ServiceInvoker.Invoke<DataSet>(this,
  3744. () => PMModuleLogic.GetInProductionDataList(barcode));
  3745. if (dsReturn != null && dsReturn.Tables[0].Rows.Count > 0)
  3746. {
  3747. actionResult.Result = JsonHelper.ToJson(dsReturn.Tables[0]);
  3748. actionResult.Status = (int)Constant.PDAResult.Success;
  3749. }
  3750. else
  3751. {
  3752. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3753. actionResult.Message = "无查询数据";
  3754. }
  3755. }
  3756. catch (Exception ex)
  3757. {
  3758. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3759. OutputLog.TraceLog(LogPriority.Error,
  3760. this.ToString(),
  3761. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3762. ex.ToString(),
  3763. LocalPath.LogExePath);
  3764. actionResult.Status = (int)Constant.PDAResult.Exception;
  3765. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3766. }
  3767. return actionResult;
  3768. }
  3769. /// <summary>
  3770. ///获取条码是否注浆登记过,0行无效
  3771. /// </summary>
  3772. /// <param name="accountCode"></param>
  3773. /// <param name="userCode"></param>
  3774. /// <param name="userPassword"></param>
  3775. /// <param name="sessionKey"></param>
  3776. /// <param name="barcode">查询条件</param>
  3777. /// <returns>Dataset</returns>
  3778. public ActionResult GetBarCodeInGroutingDailyDetail(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3779. {
  3780. ActionResult actionResult = new ActionResult();
  3781. try
  3782. {
  3783. // 验证请求头信息
  3784. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3785. // 验证失败
  3786. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3787. {
  3788. return actionResult;
  3789. }
  3790. DataSet dsReturn = ServiceInvoker.Invoke<DataSet>(this,
  3791. () => PMModuleLogic.GetBarCodeInGroutingDailyDetail(barcode));
  3792. if (dsReturn != null && dsReturn.Tables[0].Rows.Count > 0)
  3793. {
  3794. actionResult.Result = JsonHelper.ToJson(dsReturn.Tables[0]);
  3795. actionResult.Status = (int)Constant.PDAResult.Success;
  3796. }
  3797. else
  3798. {
  3799. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3800. actionResult.Message = "该产品条码无效,无法报损!";
  3801. }
  3802. }
  3803. catch (Exception ex)
  3804. {
  3805. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3806. OutputLog.TraceLog(LogPriority.Error,
  3807. this.ToString(),
  3808. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3809. ex.ToString(),
  3810. LocalPath.LogExePath);
  3811. actionResult.Status = (int)Constant.PDAResult.Exception;
  3812. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3813. }
  3814. return actionResult;
  3815. }
  3816. /// <summary>
  3817. /// 获取登陆帐户有变更条码权限
  3818. /// </summary>
  3819. /// <param name="accountCode"></param>
  3820. /// <param name="userCode"></param>
  3821. /// <param name="userPassword"></param>
  3822. /// <param name="sessionKey"></param>
  3823. /// <returns></returns>
  3824. public ActionResult GetBarCodeRecordFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  3825. {
  3826. ActionResult actionResult = new ActionResult();
  3827. try
  3828. {
  3829. // 验证请求头信息
  3830. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3831. // 验证失败
  3832. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3833. {
  3834. return actionResult;
  3835. }
  3836. int returnValue = ServiceInvoker.Invoke<int>(this,
  3837. () => PDAModuleLogic.GetBarCodeRecordFuntion(sUserInfo));
  3838. actionResult.Result = JsonHelper.ToJson(returnValue);
  3839. actionResult.Status = (int)Constant.PDAResult.Success;
  3840. }
  3841. catch (Exception ex)
  3842. {
  3843. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3844. OutputLog.TraceLog(LogPriority.Error,
  3845. this.ToString(),
  3846. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3847. ex.ToString(),
  3848. LocalPath.LogExePath);
  3849. actionResult.Status = (int)Constant.PDAResult.Exception;
  3850. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3851. }
  3852. return actionResult;
  3853. }
  3854. /// <summary>
  3855. /// 成检时获取此条码是否报损
  3856. /// </summary>
  3857. /// <param name="accountCode"></param>
  3858. /// <param name="userCode"></param>
  3859. /// <param name="userPassword"></param>
  3860. /// <param name="sessionKey"></param>
  3861. /// <param name="barcode">产品条码</param>
  3862. /// <returns></returns>
  3863. public ActionResult CheckScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3864. {
  3865. ActionResult actionResult = new ActionResult();
  3866. try
  3867. {
  3868. // 验证请求头信息
  3869. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3870. // 验证失败
  3871. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3872. {
  3873. return actionResult;
  3874. }
  3875. int returnValue = ServiceInvoker.Invoke<int>(this,
  3876. () => PMModuleLogic.CheckScrapProduct(barcode));
  3877. if (returnValue == -100)
  3878. {
  3879. actionResult.Result = JsonHelper.ToJson(returnValue);
  3880. actionResult.Status = (int)Constant.PDAResult.Success;
  3881. }
  3882. else
  3883. {
  3884. actionResult.Status = (int)Constant.PDAResult.Fail;
  3885. if (returnValue == 0)
  3886. {
  3887. actionResult.Message = "该条码:" + barcode + "存在报损记录(待审批)";
  3888. }
  3889. else
  3890. {
  3891. actionResult.Message = "该条码:" + barcode + "存在报损记录(审批通过)";
  3892. }
  3893. }
  3894. }
  3895. catch (Exception ex)
  3896. {
  3897. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3898. OutputLog.TraceLog(LogPriority.Error,
  3899. this.ToString(),
  3900. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3901. ex.ToString(),
  3902. LocalPath.LogExePath);
  3903. actionResult.Status = (int)Constant.PDAResult.Exception;
  3904. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3905. }
  3906. return actionResult;
  3907. }
  3908. /// <summary>
  3909. /// 获取产品完成工序的ID(PDA)
  3910. /// </summary>
  3911. /// <param name="barcode">产品条码</param>
  3912. /// <returns>int</returns>
  3913. public ActionResult GetCompleteProcedureIDPDA(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3914. {
  3915. ActionResult actionResult = new ActionResult();
  3916. try
  3917. {
  3918. // 验证请求头信息
  3919. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3920. // 验证失败
  3921. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3922. {
  3923. return actionResult;
  3924. }
  3925. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  3926. () => PMModuleLogic.GetCompleteProcedureIDPDA(barcode));
  3927. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  3928. actionResult.Status = (int)Constant.PDAResult.Success;
  3929. }
  3930. catch (Exception ex)
  3931. {
  3932. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3933. OutputLog.TraceLog(LogPriority.Error,
  3934. this.ToString(),
  3935. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3936. ex.ToString(),
  3937. LocalPath.LogExePath);
  3938. actionResult.Status = (int)Constant.PDAResult.Exception;
  3939. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3940. }
  3941. return actionResult;
  3942. }
  3943. /// <summary>
  3944. /// 获取产品完成工序的ID(PDA)
  3945. /// </summary>
  3946. /// <param name="barcode">产品条码</param>
  3947. /// <returns>int</returns>
  3948. public ActionResult GetGoodsInfoBybarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3949. {
  3950. ActionResult actionResult = new ActionResult();
  3951. try
  3952. {
  3953. // 验证请求头信息
  3954. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3955. // 验证失败
  3956. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3957. {
  3958. return actionResult;
  3959. }
  3960. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  3961. () => PMModuleLogic.GetGoodsInfoBybarcode(barcode));
  3962. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  3963. actionResult.Status = (int)Constant.PDAResult.Success;
  3964. }
  3965. catch (Exception ex)
  3966. {
  3967. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3968. OutputLog.TraceLog(LogPriority.Error,
  3969. this.ToString(),
  3970. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3971. ex.ToString(),
  3972. LocalPath.LogExePath);
  3973. actionResult.Status = (int)Constant.PDAResult.Exception;
  3974. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3975. }
  3976. return actionResult;
  3977. }
  3978. /// <summary>
  3979. /// 成检-校验生产工号
  3980. /// </summary>
  3981. /// <param name="usercode">生产工号</param>
  3982. /// <returns>int</returns>
  3983. public ActionResult GetUserCode(string accountCode, string userCode, string userPassword, string sessionKey, string usercode)
  3984. {
  3985. ActionResult actionResult = new ActionResult();
  3986. try
  3987. {
  3988. // 验证请求头信息
  3989. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3990. // 验证失败
  3991. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3992. {
  3993. return actionResult;
  3994. }
  3995. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  3996. () => PDAModuleLogic.GetUserCode(usercode, sUserInfo));
  3997. actionResult.Result = JsonHelper.ToJson(ds);
  3998. actionResult.Status = (int)Constant.PDAResult.Success;
  3999. }
  4000. catch (Exception ex)
  4001. {
  4002. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4003. OutputLog.TraceLog(LogPriority.Error,
  4004. this.ToString(),
  4005. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4006. ex.ToString(),
  4007. LocalPath.LogExePath);
  4008. actionResult.Status = (int)Constant.PDAResult.Exception;
  4009. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4010. }
  4011. return actionResult;
  4012. }
  4013. /// <summary>
  4014. /// 更新漏扫的成型工号
  4015. /// </summary>
  4016. /// <param name="accountCode"></param>
  4017. /// <param name="userCode"></param>
  4018. /// <param name="userPassword"></param>
  4019. /// <param name="sessionKey"></param>
  4020. /// <param name="groutingUserCode">成型工号</param>
  4021. /// <param name="missingID">漏扫ID</param>
  4022. /// <returns></returns>
  4023. public ActionResult UpdateGroutingUserCodeByMissingID(string accountCode, string userCode, string userPassword, string sessionKey, string groutingUserCode, int missingID)
  4024. {
  4025. ActionResult actionResult = new ActionResult();
  4026. try
  4027. {
  4028. // 验证请求头信息
  4029. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4030. // 验证失败
  4031. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4032. {
  4033. return actionResult;
  4034. }
  4035. int returnValue = ServiceInvoker.Invoke<int>(this,
  4036. () => PMModuleLogicDAL.UpdateGroutingUserCodeByMissingID(groutingUserCode, missingID, sUserInfo));
  4037. if (returnValue != -1)
  4038. {
  4039. actionResult.Result = JsonHelper.ToJson(returnValue);
  4040. actionResult.Status = (int)Constant.PDAResult.Success;
  4041. }
  4042. else
  4043. {
  4044. actionResult.Status = (int)Constant.PDAResult.Fail;
  4045. actionResult.Message = "存在无效的漏扫工号";
  4046. }
  4047. }
  4048. catch (Exception ex)
  4049. {
  4050. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4051. OutputLog.TraceLog(LogPriority.Error,
  4052. this.ToString(),
  4053. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4054. ex.ToString(),
  4055. LocalPath.LogExePath);
  4056. actionResult.Status = (int)Constant.PDAResult.Exception;
  4057. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4058. }
  4059. return actionResult;
  4060. }
  4061. /// <summary>
  4062. /// 在入窑工序检验窑车号是否存在
  4063. /// </summary>
  4064. /// <param name="accountCode"></param>
  4065. /// <param name="userCode"></param>
  4066. /// <param name="userPassword"></param>
  4067. /// <param name="sessionKey"></param>
  4068. /// <param name="kilncarcode">窑车编码</param>
  4069. /// <param name="procedureid">工序ID</param>
  4070. /// <returns></returns>
  4071. public ActionResult CheckKilnCarByIntoCar(string accountCode, string userCode, string userPassword, string sessionKey, string kilncarcode, int procedureid)
  4072. {
  4073. ActionResult actionResult = new ActionResult();
  4074. try
  4075. {
  4076. // 验证请求头信息
  4077. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4078. // 验证失败
  4079. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4080. {
  4081. return actionResult;
  4082. }
  4083. int returnValue = ServiceInvoker.Invoke<int>(this,
  4084. () => PMModuleLogicDAL.CheckKilnCarByIntoCar(kilncarcode, procedureid, sUserInfo));
  4085. if (returnValue == 1)
  4086. {
  4087. actionResult.Result = JsonHelper.ToJson(returnValue);
  4088. actionResult.Status = (int)Constant.PDAResult.Success;
  4089. }
  4090. else
  4091. {
  4092. actionResult.Status = (int)Constant.PDAResult.Fail;
  4093. if (returnValue == -99)
  4094. actionResult.Message = "窑炉车号无效";
  4095. else if (returnValue == -98)
  4096. actionResult.Message = "窑车己无产品";
  4097. else if (returnValue == -97)
  4098. actionResult.Message = "窑车没有入窑,不可以撤销";
  4099. else if (returnValue == -1)
  4100. actionResult.Message = "保存失败";
  4101. }
  4102. }
  4103. catch (Exception ex)
  4104. {
  4105. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4106. OutputLog.TraceLog(LogPriority.Error,
  4107. this.ToString(),
  4108. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4109. ex.ToString(),
  4110. LocalPath.LogExePath);
  4111. actionResult.Status = (int)Constant.PDAResult.Exception;
  4112. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4113. }
  4114. return actionResult;
  4115. }
  4116. /// <summary>
  4117. /// 获取盘点单列表
  4118. /// </summary>
  4119. /// <param name="sUserInfo"></param>
  4120. /// <returns></returns>
  4121. public ActionResult GetInCheckedList(string accountCode, string userCode, string userPassword, string sessionKey)
  4122. {
  4123. ActionResult actionResult = new ActionResult();
  4124. try
  4125. {
  4126. // 验证请求头信息
  4127. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4128. // 验证失败
  4129. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4130. {
  4131. return actionResult;
  4132. }
  4133. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4134. () => PMModuleLogic.GetInCheckedList(sUserInfo));
  4135. actionResult.Result = JsonHelper.ToJson(ds);
  4136. actionResult.Status = (int)Constant.PDAResult.Success;
  4137. }
  4138. catch (Exception ex)
  4139. {
  4140. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4141. OutputLog.TraceLog(LogPriority.Error,
  4142. this.ToString(),
  4143. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4144. ex.ToString(),
  4145. LocalPath.LogExePath);
  4146. actionResult.Status = (int)Constant.PDAResult.Exception;
  4147. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4148. }
  4149. return actionResult;
  4150. }
  4151. /// <summary>
  4152. /// 进行盘点操作
  4153. /// </summary>
  4154. /// <param name="accountCode"></param>
  4155. /// <param name="userCode"></param>
  4156. /// <param name="userPassword"></param>
  4157. /// <param name="sessionKey"></param>
  4158. /// <param name="InCheckedID">盘点单ID</param>
  4159. /// <param name="BarCode">产品条码</param>
  4160. /// <returns></returns>
  4161. public ActionResult UpdateInChecked(string accountCode, string userCode, string userPassword, string sessionKey, int InCheckedID, string BarCode)
  4162. {
  4163. ActionResult actionResult = new ActionResult();
  4164. try
  4165. {
  4166. // 验证请求头信息
  4167. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4168. // 验证失败
  4169. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4170. {
  4171. return actionResult;
  4172. }
  4173. int returnValue = ServiceInvoker.Invoke<int>(this,
  4174. () => PMModuleLogicDAL.UpdateInChecked(InCheckedID, BarCode, sUserInfo));
  4175. if (returnValue > 0)
  4176. {
  4177. actionResult.Result = JsonHelper.ToJson(returnValue);
  4178. actionResult.Status = (int)Constant.PDAResult.Success;
  4179. actionResult.Message = "产品" + BarCode + "盘点成功";
  4180. }
  4181. else if (returnValue == 10)
  4182. {
  4183. actionResult.Result = JsonHelper.ToJson(returnValue);
  4184. actionResult.Status = (int)Constant.PDAResult.Success;
  4185. actionResult.Message = "产品" + BarCode + "盘盈成功";
  4186. }
  4187. else
  4188. {
  4189. actionResult.Status = (int)Constant.PDAResult.Fail;
  4190. if (returnValue == -2)
  4191. actionResult.Message = "产品" + BarCode + "不是在产产品";
  4192. //if (returnValue == 10)
  4193. // actionResult.Message = "产品" + BarCode + "盘盈成功";
  4194. //if (returnValue > 0)
  4195. // actionResult.Message = "产品" + BarCode + "盘点成功";
  4196. if (returnValue == -22)
  4197. actionResult.Message = "产品" + BarCode + "己被其他工号盘点";
  4198. if (returnValue == -23)
  4199. actionResult.Message = "产品" + BarCode + "己被其他工号盘盈";
  4200. if (returnValue == -24)
  4201. actionResult.Message = "产品" + BarCode + "己被此工号盘点";
  4202. if (returnValue == -25)
  4203. actionResult.Message = "产品" + BarCode + "己被此工号盘盈";
  4204. else if (returnValue == 0)
  4205. actionResult.Message = "盘点失败";
  4206. }
  4207. }
  4208. catch (Exception ex)
  4209. {
  4210. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4211. OutputLog.TraceLog(LogPriority.Error,
  4212. this.ToString(),
  4213. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4214. ex.ToString(),
  4215. LocalPath.LogExePath);
  4216. actionResult.Status = (int)Constant.PDAResult.Exception;
  4217. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4218. }
  4219. return actionResult;
  4220. }
  4221. #region 班次配置
  4222. /// <summary>
  4223. /// 班次配置-通过工号获取工种列表
  4224. /// </summary>
  4225. /// <param name="userId">工号ID</param>
  4226. /// <returns></returns>
  4227. public ActionResult BindUserJobs(string accountCode, string userCode, string userPassword, string sessionKey, int userId)
  4228. {
  4229. ActionResult actionResult = new ActionResult();
  4230. try
  4231. {
  4232. // 验证请求头信息
  4233. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4234. // 验证失败
  4235. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4236. {
  4237. return actionResult;
  4238. }
  4239. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4240. () => SystemModuleLogic.GetJobByUserId(userId));
  4241. actionResult.Result = JsonHelper.ToJson(ds);
  4242. actionResult.Status = (int)Constant.PDAResult.Success;
  4243. }
  4244. catch (Exception ex)
  4245. {
  4246. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4247. OutputLog.TraceLog(LogPriority.Error,
  4248. this.ToString(),
  4249. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4250. ex.ToString(),
  4251. LocalPath.LogExePath);
  4252. actionResult.Status = (int)Constant.PDAResult.Exception;
  4253. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4254. }
  4255. return actionResult;
  4256. }
  4257. ///// <summary>
  4258. ///// 班次配置-根据工号查询员工档案信息
  4259. ///// </summary>
  4260. ///// <param name="userId">工号ID</param>
  4261. ///// <returns></returns>
  4262. //public ActionResult SearchHrStaffInfo(string accountCode, string userCode, string userPassword, string sessionKey, int userId)
  4263. //{
  4264. // ActionResult actionResult = new ActionResult();
  4265. // try
  4266. // {
  4267. // // 验证请求头信息
  4268. // actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4269. // // 验证失败
  4270. // if (actionResult.Status != (int)Constant.PDAResult.Success)
  4271. // {
  4272. // return actionResult;
  4273. // }
  4274. // DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4275. // () => HRModuleLogic.SearchHrStaffInfo(userId,sUserInfo));
  4276. // actionResult.Result = JsonHelper.ToJson(ds);
  4277. // actionResult.Status = (int)Constant.PDAResult.Success;
  4278. // }
  4279. // catch (Exception ex)
  4280. // {
  4281. // //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4282. // OutputLog.TraceLog(LogPriority.Error,
  4283. // this.ToString(),
  4284. // System.Reflection.MethodBase.GetCurrentMethod().Name,
  4285. // ex.ToString(),
  4286. // LocalPath.LogExePath);
  4287. // actionResult.Status = (int)Constant.PDAResult.Exception;
  4288. // actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4289. // }
  4290. // return actionResult;
  4291. //}
  4292. /// <summary>
  4293. /// 班次配置-根据员工姓名查员工信息
  4294. /// </summary>
  4295. /// <param name="searchStaffEntity"></param>
  4296. /// <returns></returns>
  4297. public ActionResult SearchStaffInfo(string accountCode, string userCode, string userPassword, string sessionKey, SearchStaffEntity searchStaffEntity)
  4298. {
  4299. ActionResult actionResult = new ActionResult();
  4300. try
  4301. {
  4302. // 验证请求头信息
  4303. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4304. // 验证失败
  4305. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4306. {
  4307. return actionResult;
  4308. }
  4309. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4310. () => PDAModuleLogic.SearchStaffInfo(searchStaffEntity, sUserInfo));
  4311. actionResult.Result = JsonHelper.ToJson(ds);
  4312. actionResult.Status = (int)Constant.PDAResult.Success;
  4313. }
  4314. catch (Exception ex)
  4315. {
  4316. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4317. OutputLog.TraceLog(LogPriority.Error,
  4318. this.ToString(),
  4319. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4320. ex.ToString(),
  4321. LocalPath.LogExePath);
  4322. actionResult.Status = (int)Constant.PDAResult.Exception;
  4323. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4324. }
  4325. return actionResult;
  4326. }
  4327. /// <summary>
  4328. /// 获取班次配置信息
  4329. /// </summary>
  4330. /// <param name="searchEntity"></param>
  4331. /// <returns></returns>
  4332. public ActionResult SearchClassesSetting(string accountCode, string userCode, string userPassword, string sessionKey, SearchClassesSettingEntity searchEntity)
  4333. {
  4334. ActionResult actionResult = new ActionResult();
  4335. try
  4336. {
  4337. // 验证请求头信息
  4338. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4339. // 验证失败
  4340. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4341. {
  4342. return actionResult;
  4343. }
  4344. searchEntity.StartAccountDate = Convert.ToDateTime(searchEntity.StartAccountDatePDA);
  4345. searchEntity.EndAccountDate = Convert.ToDateTime(searchEntity.EndAccountDatePDA).AddDays(1).AddMinutes(-1);
  4346. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4347. () => PCModuleLogic.SearchClassesSetting(searchEntity, sUserInfo));
  4348. actionResult.Result = JsonHelper.ToJson(ds);
  4349. actionResult.Status = (int)Constant.PDAResult.Success;
  4350. }
  4351. catch (Exception ex)
  4352. {
  4353. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4354. OutputLog.TraceLog(LogPriority.Error,
  4355. this.ToString(),
  4356. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4357. ex.ToString(),
  4358. LocalPath.LogExePath);
  4359. actionResult.Status = (int)Constant.PDAResult.Exception;
  4360. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4361. }
  4362. return actionResult;
  4363. }
  4364. public ActionResult SaveClassesSetting(string accountCode, string userCode, string userPassword, string sessionKey, ClassesSettingEntity setEntity, ClassesDetailSettingEntity[] setDetailEntity)
  4365. {
  4366. ActionResult actionResult = new ActionResult();
  4367. try
  4368. {
  4369. // 验证请求头信息
  4370. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4371. // 验证失败
  4372. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4373. {
  4374. return actionResult;
  4375. }
  4376. int returnValue = ServiceInvoker.Invoke<int>(this,
  4377. () => PDAModuleLogic.SaveClassesSetting(setEntity, setDetailEntity, sUserInfo));
  4378. if (returnValue > 0)
  4379. {
  4380. actionResult.Result = JsonHelper.ToJson(returnValue);
  4381. actionResult.Status = (int)Constant.PDAResult.Success;
  4382. }
  4383. else
  4384. {
  4385. actionResult.Status = (int)Constant.PDAResult.Fail;
  4386. actionResult.Message = "保存失败";
  4387. }
  4388. }
  4389. catch (Exception ex)
  4390. {
  4391. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4392. OutputLog.TraceLog(LogPriority.Error,
  4393. this.ToString(),
  4394. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4395. ex.ToString(),
  4396. LocalPath.LogExePath);
  4397. actionResult.Status = (int)Constant.PDAResult.Exception;
  4398. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4399. }
  4400. return actionResult;
  4401. }
  4402. /// <summary>
  4403. /// 班次配置--获取详细信息
  4404. /// </summary>
  4405. /// <param name="searchEntity"></param>
  4406. /// <returns></returns>
  4407. public ActionResult SearchClassesDetail(string accountCode, string userCode, string userPassword, string sessionKey, int classesSettingID)
  4408. {
  4409. ActionResult actionResult = new ActionResult();
  4410. try
  4411. {
  4412. // 验证请求头信息
  4413. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4414. // 验证失败
  4415. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4416. {
  4417. return actionResult;
  4418. }
  4419. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4420. () => PCModuleLogic.SearchClassesDetail(classesSettingID, sUserInfo));
  4421. actionResult.Result = JsonHelper.ToJson(ds);
  4422. actionResult.Status = (int)Constant.PDAResult.Success;
  4423. }
  4424. catch (Exception ex)
  4425. {
  4426. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4427. OutputLog.TraceLog(LogPriority.Error,
  4428. this.ToString(),
  4429. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4430. ex.ToString(),
  4431. LocalPath.LogExePath);
  4432. actionResult.Status = (int)Constant.PDAResult.Exception;
  4433. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4434. }
  4435. return actionResult;
  4436. }
  4437. /// <summary>
  4438. /// 获取用户是否有班次配置权限
  4439. /// </summary>
  4440. /// <param name="accountCode"></param>
  4441. /// <param name="userCode"></param>
  4442. /// <param name="userPassword"></param>
  4443. /// <param name="sessionKey"></param>
  4444. /// <returns></returns>
  4445. public ActionResult GetClassesSettingFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  4446. {
  4447. ActionResult actionResult = new ActionResult();
  4448. try
  4449. {
  4450. // 验证请求头信息
  4451. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4452. // 验证失败
  4453. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4454. {
  4455. return actionResult;
  4456. }
  4457. int returnValue = ServiceInvoker.Invoke<int>(this,
  4458. () => PDAModuleLogic.GetClassesSettingFuntion(sUserInfo));
  4459. actionResult.Result = JsonHelper.ToJson(returnValue);
  4460. actionResult.Status = (int)Constant.PDAResult.Success;
  4461. }
  4462. catch (Exception ex)
  4463. {
  4464. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4465. OutputLog.TraceLog(LogPriority.Error,
  4466. this.ToString(),
  4467. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4468. ex.ToString(),
  4469. LocalPath.LogExePath);
  4470. actionResult.Status = (int)Constant.PDAResult.Exception;
  4471. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4472. }
  4473. return actionResult;
  4474. }
  4475. /// <summary>
  4476. /// 获取盘点单列表
  4477. /// </summary>
  4478. /// <param name="sUserInfo"></param>
  4479. /// <returns></returns>
  4480. public ActionResult GetAllInChecked(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity)
  4481. {
  4482. ActionResult actionResult = new ActionResult();
  4483. try
  4484. {
  4485. // 验证请求头信息
  4486. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4487. // 验证失败
  4488. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4489. {
  4490. return actionResult;
  4491. }
  4492. entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA);
  4493. entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1);
  4494. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4495. () => PDAModuleLogic.GetAllInChecked(entity, sUserInfo));
  4496. actionResult.Result = JsonHelper.ToJson(ds);
  4497. actionResult.Status = (int)Constant.PDAResult.Success;
  4498. }
  4499. catch (Exception ex)
  4500. {
  4501. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4502. OutputLog.TraceLog(LogPriority.Error,
  4503. this.ToString(),
  4504. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4505. ex.ToString(),
  4506. LocalPath.LogExePath);
  4507. actionResult.Status = (int)Constant.PDAResult.Exception;
  4508. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4509. }
  4510. return actionResult;
  4511. }
  4512. #endregion
  4513. #region PDA报表
  4514. /// <summary>
  4515. /// 产品质量跟踪
  4516. /// </summary>
  4517. /// <param name="accountCode"></param>
  4518. /// <param name="userCode"></param>
  4519. /// <param name="userPassword"></param>
  4520. /// <param name="sessionKey"></param>
  4521. /// <param name="se"></param>
  4522. /// <returns></returns>
  4523. public ActionResult GetRPT040104SData(string accountCode, string userCode, string userPassword, string sessionKey, RPT040104_SE se)
  4524. {
  4525. ActionResult actionResult = new ActionResult();
  4526. try
  4527. {
  4528. // 验证请求头信息
  4529. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4530. // 验证失败
  4531. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4532. {
  4533. return actionResult;
  4534. }
  4535. se.CreateTimeStart = Convert.ToDateTime(se.CreateTimeStartPDA);
  4536. se.CreateTimeEnd = Convert.ToDateTime(se.CreateTimeEndPDA).AddDays(1);
  4537. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4538. () => PDAModuleLogic.GetRPT040104SData(sUserInfo, se));
  4539. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4540. {
  4541. actionResult.Status = (int)Constant.PDAResult.Fail;
  4542. actionResult.Message = Messages.MSG_CMN_I002;
  4543. }
  4544. else
  4545. {
  4546. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4547. actionResult.Status = (int)Constant.PDAResult.Success;
  4548. }
  4549. }
  4550. catch (Exception ex)
  4551. {
  4552. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4553. OutputLog.TraceLog(LogPriority.Error,
  4554. this.ToString(),
  4555. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4556. ex.ToString(),
  4557. LocalPath.LogExePath);
  4558. actionResult.Status = (int)Constant.PDAResult.Exception;
  4559. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4560. }
  4561. return actionResult;
  4562. }
  4563. /// <summary>
  4564. /// 工号产量质量分析表
  4565. /// </summary>
  4566. /// <param name="accountCode"></param>
  4567. /// <param name="userCode"></param>
  4568. /// <param name="userPassword"></param>
  4569. /// <param name="sessionKey"></param>
  4570. /// <param name="se"></param>
  4571. /// <returns></returns>
  4572. public ActionResult GetFP00002Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4573. int rptSProcedureID, string workcode, string date)
  4574. {
  4575. ActionResult actionResult = new ActionResult();
  4576. try
  4577. {
  4578. // 验证请求头信息
  4579. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4580. // 验证失败
  4581. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4582. {
  4583. return actionResult;
  4584. }
  4585. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4586. () => PDAModuleLogic.GetFP00002Data(sUserInfo, rptSProcedureID, workcode, Convert.ToDateTime(date)));
  4587. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4588. {
  4589. actionResult.Status = (int)Constant.PDAResult.Fail;
  4590. actionResult.Message = Messages.MSG_CMN_I002;
  4591. }
  4592. else
  4593. {
  4594. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4595. actionResult.Status = (int)Constant.PDAResult.Success;
  4596. }
  4597. }
  4598. catch (Exception ex)
  4599. {
  4600. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4601. OutputLog.TraceLog(LogPriority.Error,
  4602. this.ToString(),
  4603. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4604. ex.ToString(),
  4605. LocalPath.LogExePath);
  4606. actionResult.Status = (int)Constant.PDAResult.Exception;
  4607. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4608. }
  4609. return actionResult;
  4610. }
  4611. /// <summary>
  4612. /// 工号产量质量分析表(中陶)
  4613. /// </summary>
  4614. /// <param name="accountCode"></param>
  4615. /// <param name="userCode"></param>
  4616. /// <param name="userPassword"></param>
  4617. /// <param name="sessionKey"></param>
  4618. /// <param name="se"></param>
  4619. /// <returns></returns>
  4620. public ActionResult GetFP00002_1Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4621. int rptSProcedureID, string workcode, string date, string goodscode)
  4622. {
  4623. ActionResult actionResult = new ActionResult();
  4624. try
  4625. {
  4626. // 验证请求头信息
  4627. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4628. // 验证失败
  4629. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4630. {
  4631. return actionResult;
  4632. }
  4633. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4634. () => PDAModuleLogic.GetFP00002_1Data(sUserInfo, rptSProcedureID, workcode,
  4635. Convert.ToDateTime(date), goodscode));
  4636. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4637. {
  4638. actionResult.Status = (int)Constant.PDAResult.Fail;
  4639. actionResult.Message = Messages.MSG_CMN_I002;
  4640. }
  4641. else
  4642. {
  4643. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4644. actionResult.Status = (int)Constant.PDAResult.Success;
  4645. }
  4646. }
  4647. catch (Exception ex)
  4648. {
  4649. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4650. OutputLog.TraceLog(LogPriority.Error,
  4651. this.ToString(),
  4652. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4653. ex.ToString(),
  4654. LocalPath.LogExePath);
  4655. actionResult.Status = (int)Constant.PDAResult.Exception;
  4656. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4657. }
  4658. return actionResult;
  4659. }
  4660. /// <summary>
  4661. /// 半检数据统计表
  4662. /// </summary>
  4663. /// <param name="accountCode"></param>
  4664. /// <param name="userCode"></param>
  4665. /// <param name="userPassword"></param>
  4666. /// <param name="sessionKey"></param>
  4667. /// <param name="se"></param>
  4668. /// <returns></returns>
  4669. public ActionResult GetPDARPT000001Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4670. string workcode, string datebegin, string dateend)
  4671. {
  4672. ActionResult actionResult = new ActionResult();
  4673. try
  4674. {
  4675. // 验证请求头信息
  4676. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4677. // 验证失败
  4678. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4679. {
  4680. return actionResult;
  4681. }
  4682. DateTime datetimebegin = Convert.ToDateTime(datebegin);
  4683. DateTime datetimeend = Convert.ToDateTime(dateend);
  4684. datetimebegin = datetimebegin.Date;
  4685. datetimeend = datetimeend.Date.AddDays(1).AddSeconds(-1);
  4686. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4687. () => PDAModuleLogic.GetPDARPT000001Data(sUserInfo, workcode, datetimebegin, datetimeend));
  4688. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4689. {
  4690. actionResult.Status = (int)Constant.PDAResult.Fail;
  4691. actionResult.Message = Messages.MSG_CMN_I002;
  4692. }
  4693. else
  4694. {
  4695. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4696. actionResult.Status = (int)Constant.PDAResult.Success;
  4697. }
  4698. }
  4699. catch (Exception ex)
  4700. {
  4701. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4702. OutputLog.TraceLog(LogPriority.Error,
  4703. this.ToString(),
  4704. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4705. ex.ToString(),
  4706. LocalPath.LogExePath);
  4707. actionResult.Status = (int)Constant.PDAResult.Exception;
  4708. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4709. }
  4710. return actionResult;
  4711. }
  4712. /// <summary>
  4713. /// 工号质量统计表
  4714. /// </summary>
  4715. /// <param name="accountCode"></param>
  4716. /// <param name="userCode"></param>
  4717. /// <param name="userPassword"></param>
  4718. /// <param name="sessionKey"></param>
  4719. /// <param name="se"></param>
  4720. /// <returns></returns>
  4721. public ActionResult GetPDARPT000002Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4722. int rptSProcedureID, string workcode, string datebegin, string dateend)
  4723. {
  4724. ActionResult actionResult = new ActionResult();
  4725. try
  4726. {
  4727. // 验证请求头信息
  4728. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4729. // 验证失败
  4730. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4731. {
  4732. return actionResult;
  4733. }
  4734. DateTime datetimebegin = Convert.ToDateTime(datebegin);
  4735. DateTime datetimeend = Convert.ToDateTime(dateend);
  4736. datetimebegin = datetimebegin.Date;
  4737. datetimeend = datetimeend.Date.AddDays(1).AddSeconds(-1);
  4738. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4739. () => PDAModuleLogic.GetPDARPT000002Data(sUserInfo, rptSProcedureID, workcode, datetimebegin, datetimeend));
  4740. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4741. {
  4742. actionResult.Status = (int)Constant.PDAResult.Fail;
  4743. actionResult.Message = Messages.MSG_CMN_I002;
  4744. }
  4745. else
  4746. {
  4747. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4748. actionResult.Status = (int)Constant.PDAResult.Success;
  4749. }
  4750. }
  4751. catch (Exception ex)
  4752. {
  4753. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4754. OutputLog.TraceLog(LogPriority.Error,
  4755. this.ToString(),
  4756. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4757. ex.ToString(),
  4758. LocalPath.LogExePath);
  4759. actionResult.Status = (int)Constant.PDAResult.Exception;
  4760. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4761. }
  4762. return actionResult;
  4763. }
  4764. /// <summary>
  4765. /// 损坯数据统计表
  4766. /// </summary>
  4767. /// <param name="accountCode"></param>
  4768. /// <param name="userCode"></param>
  4769. /// <param name="userPassword"></param>
  4770. /// <param name="sessionKey"></param>
  4771. /// <param name="se"></param>
  4772. /// <returns></returns>
  4773. public ActionResult GetPDARPT000003Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4774. string workcode, string datebegin, string dateend)
  4775. {
  4776. ActionResult actionResult = new ActionResult();
  4777. try
  4778. {
  4779. // 验证请求头信息
  4780. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4781. // 验证失败
  4782. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4783. {
  4784. return actionResult;
  4785. }
  4786. DateTime datetimebegin = Convert.ToDateTime(datebegin);
  4787. DateTime datetimeend = Convert.ToDateTime(dateend);
  4788. datetimebegin = datetimebegin.Date;
  4789. datetimeend = datetimeend.Date.AddDays(1).AddSeconds(-1);
  4790. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4791. () => PDAModuleLogic.GetPDARPT000003Data(sUserInfo, workcode, datetimebegin, datetimeend));
  4792. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4793. {
  4794. actionResult.Status = (int)Constant.PDAResult.Fail;
  4795. actionResult.Message = Messages.MSG_CMN_I002;
  4796. }
  4797. else
  4798. {
  4799. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4800. actionResult.Status = (int)Constant.PDAResult.Success;
  4801. }
  4802. }
  4803. catch (Exception ex)
  4804. {
  4805. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4806. OutputLog.TraceLog(LogPriority.Error,
  4807. this.ToString(),
  4808. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4809. ex.ToString(),
  4810. LocalPath.LogExePath);
  4811. actionResult.Status = (int)Constant.PDAResult.Exception;
  4812. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4813. }
  4814. return actionResult;
  4815. }
  4816. #endregion
  4817. /// <summary>
  4818. /// 取得报表数据源数据
  4819. /// </summary>
  4820. /// <param name="accountCode"></param>
  4821. /// <param name="userCode"></param>
  4822. /// <param name="userPassword"></param>
  4823. /// <param name="sessionKey"></param>
  4824. /// <returns></returns>
  4825. public ActionResult GetRptProcedureModule(string accountCode, string userCode, string userPassword, string sessionKey)
  4826. {
  4827. ActionResult actionResult = new ActionResult();
  4828. try
  4829. {
  4830. // 验证请求头信息
  4831. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4832. // 验证失败
  4833. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4834. {
  4835. return actionResult;
  4836. }
  4837. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4838. () => ReportModuleLogic.GetRptProcedureModule(sUserInfo));
  4839. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4840. {
  4841. actionResult.Status = (int)Constant.PDAResult.Fail;
  4842. actionResult.Message = Messages.MSG_CMN_I002;
  4843. }
  4844. else
  4845. {
  4846. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4847. actionResult.Status = (int)Constant.PDAResult.Success;
  4848. }
  4849. }
  4850. catch (Exception ex)
  4851. {
  4852. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4853. OutputLog.TraceLog(LogPriority.Error,
  4854. this.ToString(),
  4855. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4856. ex.ToString(),
  4857. LocalPath.LogExePath);
  4858. actionResult.Status = (int)Constant.PDAResult.Exception;
  4859. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4860. }
  4861. return actionResult;
  4862. }
  4863. /// <summary>
  4864. /// 取得报表的查询数据源统计工序数据
  4865. /// </summary>
  4866. /// <param name="accountCode"></param>
  4867. /// <param name="userCode"></param>
  4868. /// <param name="userPassword"></param>
  4869. /// <param name="sessionKey"></param>
  4870. /// <param name="RptProcedureID"></param>
  4871. /// <returns></returns>
  4872. public ActionResult GetRptSourceProcedureModule(string accountCode, string userCode, string userPassword, string sessionKey, int? RptProcedureID)
  4873. {
  4874. ActionResult actionResult = new ActionResult();
  4875. try
  4876. {
  4877. // 验证请求头信息
  4878. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4879. // 验证失败
  4880. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4881. {
  4882. return actionResult;
  4883. }
  4884. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4885. () => ReportModuleLogic.GetRptSourceProcedureModule(sUserInfo, RptProcedureID));
  4886. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4887. {
  4888. actionResult.Status = (int)Constant.PDAResult.Fail;
  4889. actionResult.Message = Messages.MSG_CMN_I002;
  4890. }
  4891. else
  4892. {
  4893. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4894. actionResult.Status = (int)Constant.PDAResult.Success;
  4895. }
  4896. }
  4897. catch (Exception ex)
  4898. {
  4899. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4900. OutputLog.TraceLog(LogPriority.Error,
  4901. this.ToString(),
  4902. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4903. ex.ToString(),
  4904. LocalPath.LogExePath);
  4905. actionResult.Status = (int)Constant.PDAResult.Exception;
  4906. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4907. }
  4908. return actionResult;
  4909. }
  4910. /// <summary>
  4911. /// 获取用户是否有统计产成品权限
  4912. /// </summary>
  4913. /// <param name="accountCode"></param>
  4914. /// <param name="userCode"></param>
  4915. /// <param name="userPassword"></param>
  4916. /// <param name="sessionKey"></param>
  4917. /// <returns></returns>
  4918. public ActionResult GetStatisticsFinishedProductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  4919. {
  4920. ActionResult actionResult = new ActionResult();
  4921. try
  4922. {
  4923. // 验证请求头信息
  4924. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4925. // 验证失败
  4926. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4927. {
  4928. return actionResult;
  4929. }
  4930. int returnValue = ServiceInvoker.Invoke<int>(this,
  4931. () => PDAModuleLogic.GetStatisticsFinishedProductFuntion(sUserInfo));
  4932. actionResult.Result = JsonHelper.ToJson(returnValue);
  4933. actionResult.Status = (int)Constant.PDAResult.Success;
  4934. }
  4935. catch (Exception ex)
  4936. {
  4937. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4938. OutputLog.TraceLog(LogPriority.Error,
  4939. this.ToString(),
  4940. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4941. ex.ToString(),
  4942. LocalPath.LogExePath);
  4943. actionResult.Status = (int)Constant.PDAResult.Exception;
  4944. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4945. }
  4946. return actionResult;
  4947. }
  4948. /// <summary>
  4949. /// 获取用户是否有盘点权限
  4950. /// </summary>
  4951. /// <param name="accountCode"></param>
  4952. /// <param name="userCode"></param>
  4953. /// <param name="userPassword"></param>
  4954. /// <param name="sessionKey"></param>
  4955. /// <returns></returns>
  4956. public ActionResult GetInCheckedFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  4957. {
  4958. ActionResult actionResult = new ActionResult();
  4959. try
  4960. {
  4961. // 验证请求头信息
  4962. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4963. // 验证失败
  4964. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4965. {
  4966. return actionResult;
  4967. }
  4968. int returnValue = ServiceInvoker.Invoke<int>(this,
  4969. () => PDAModuleLogic.GetInCheckedFuntion(sUserInfo));
  4970. actionResult.Result = JsonHelper.ToJson(returnValue);
  4971. actionResult.Status = (int)Constant.PDAResult.Success;
  4972. }
  4973. catch (Exception ex)
  4974. {
  4975. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4976. OutputLog.TraceLog(LogPriority.Error,
  4977. this.ToString(),
  4978. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4979. ex.ToString(),
  4980. LocalPath.LogExePath);
  4981. actionResult.Status = (int)Constant.PDAResult.Exception;
  4982. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4983. }
  4984. return actionResult;
  4985. }
  4986. /// <summary>
  4987. /// 根据条件查询是否存在班次配置
  4988. /// </summary>
  4989. /// <param name="accountCode"></param>
  4990. /// <param name="userCode"></param>
  4991. /// <param name="userPassword"></param>
  4992. /// <param name="sessionKey"></param>
  4993. /// <param name="userCode">工号编码</param>
  4994. /// <returns></returns>
  4995. public ActionResult GetClassesSetting(string accountCode, string userCode, string userPassword, string sessionKey, string uCode)
  4996. {
  4997. ActionResult actionResult = new ActionResult();
  4998. try
  4999. {
  5000. // 验证请求头信息
  5001. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5002. // 验证失败
  5003. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5004. {
  5005. return actionResult;
  5006. }
  5007. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  5008. () => PDAModuleLogic.GetClassesSetting(uCode, sUserInfo));
  5009. actionResult.Result = JsonHelper.ToJson(ds);
  5010. actionResult.Status = (int)Constant.PDAResult.Success;
  5011. }
  5012. catch (Exception ex)
  5013. {
  5014. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5015. OutputLog.TraceLog(LogPriority.Error,
  5016. this.ToString(),
  5017. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5018. ex.ToString(),
  5019. LocalPath.LogExePath);
  5020. actionResult.Status = (int)Constant.PDAResult.Exception;
  5021. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5022. }
  5023. return actionResult;
  5024. }
  5025. /// <summary>
  5026. /// 报损工序查出工号根据生产数据ID
  5027. /// </summary>
  5028. /// <param name="accountCode"></param>
  5029. /// <param name="userCode"></param>
  5030. /// <param name="userPassword"></param>
  5031. /// <param name="sessionKey"></param>
  5032. /// <param name="ProductionDataID">生产数据ID</param>
  5033. /// <returns></returns>
  5034. public ActionResult GetScrapProductUserCodeByProductionDataID(string accountCode, string userCode, string userPassword, string sessionKey, int ProductionDataID)
  5035. {
  5036. ActionResult actionResult = new ActionResult();
  5037. try
  5038. {
  5039. // 验证请求头信息
  5040. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5041. // 验证失败
  5042. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5043. {
  5044. return actionResult;
  5045. }
  5046. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  5047. () => PMModuleLogic.GetScrapProductUserCodeByProductionDataID(ProductionDataID));
  5048. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  5049. {
  5050. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  5051. actionResult.Status = (int)Constant.PDAResult.Success;
  5052. }
  5053. else
  5054. {
  5055. actionResult.Status = (int)Constant.PDAResult.Fail;
  5056. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5057. }
  5058. }
  5059. catch (Exception ex)
  5060. {
  5061. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5062. OutputLog.TraceLog(LogPriority.Error,
  5063. this.ToString(),
  5064. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5065. ex.ToString(),
  5066. LocalPath.LogExePath);
  5067. actionResult.Status = (int)Constant.PDAResult.Exception;
  5068. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5069. }
  5070. return actionResult;
  5071. }
  5072. /// <summary>
  5073. /// 在入窑工序检验窑车号是否存在
  5074. /// </summary>
  5075. /// <param name="accountCode"></param>
  5076. /// <param name="userCode"></param>
  5077. /// <param name="userPassword"></param>
  5078. /// <param name="sessionKey"></param>
  5079. /// <param name="kilncarcode">窑车编码</param>
  5080. /// <param name="procedureid">工序ID</param>
  5081. /// <returns></returns>
  5082. public ActionResult CheckKilnCarByIntoCar2(string accountCode, string userCode, string userPassword, string sessionKey, string kilncarcode, int procedureid)
  5083. {
  5084. ActionResult actionResult = new ActionResult();
  5085. try
  5086. {
  5087. // 验证请求头信息
  5088. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5089. // 验证失败
  5090. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5091. {
  5092. return actionResult;
  5093. }
  5094. int returnValue = ServiceInvoker.Invoke<int>(this,
  5095. () => PMModuleLogicDAL.CheckKilnCarByIntoCar2(kilncarcode, procedureid, sUserInfo));
  5096. if (returnValue == 1)
  5097. {
  5098. actionResult.Result = JsonHelper.ToJson(returnValue);
  5099. actionResult.Status = (int)Constant.PDAResult.Success;
  5100. }
  5101. else
  5102. {
  5103. actionResult.Status = (int)Constant.PDAResult.Fail;
  5104. if (returnValue == -99)
  5105. actionResult.Message = "窑炉车号无效";
  5106. else if (returnValue == -98)
  5107. actionResult.Message = "窑车己无产品";
  5108. else if (returnValue == -97)
  5109. actionResult.Message = "窑车没有入窑,不可以撤销";
  5110. else if (returnValue == -1)
  5111. actionResult.Message = "保存失败";
  5112. }
  5113. }
  5114. catch (Exception ex)
  5115. {
  5116. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5117. OutputLog.TraceLog(LogPriority.Error,
  5118. this.ToString(),
  5119. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5120. ex.ToString(),
  5121. LocalPath.LogExePath);
  5122. actionResult.Status = (int)Constant.PDAResult.Exception;
  5123. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5124. }
  5125. return actionResult;
  5126. }
  5127. /// <summary>
  5128. /// 撤销包装
  5129. /// </summary>
  5130. /// <param name="accountCode"></param>
  5131. /// <param name="userCode"></param>
  5132. /// <param name="userPassword"></param>
  5133. /// <param name="sessionKey"></param>
  5134. /// <param name="barcode"></param>
  5135. /// <returns></returns>
  5136. public ActionResult AddChancelFinishedproduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5137. {
  5138. ActionResult actionResult = new ActionResult();
  5139. try
  5140. {
  5141. // 验证请求头信息
  5142. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5143. // 验证失败
  5144. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5145. {
  5146. return actionResult;
  5147. }
  5148. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5149. () => PMModuleLogicDAL.AddChancelFinishedproduct(barcode, sUserInfo));
  5150. if (Convert.ToInt32(returnValue.Result) > 0)
  5151. {
  5152. actionResult.Result = JsonHelper.ToJson(returnValue);
  5153. actionResult.Status = (int)Constant.PDAResult.Success;
  5154. }
  5155. else
  5156. {
  5157. actionResult.Status = (int)Constant.PDAResult.Fail;
  5158. if (Convert.ToInt32(returnValue.Result) == -1)
  5159. actionResult.Message = "产品条码不存在包装记录";
  5160. else if (Convert.ToInt32(returnValue.Result) == -200)
  5161. actionResult.Message = returnValue.Message;
  5162. else
  5163. actionResult.Message = "成品撤销失败";
  5164. }
  5165. }
  5166. catch (Exception ex)
  5167. {
  5168. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5169. OutputLog.TraceLog(LogPriority.Error,
  5170. this.ToString(),
  5171. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5172. ex.ToString(),
  5173. LocalPath.LogExePath);
  5174. actionResult.Status = (int)Constant.PDAResult.Exception;
  5175. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5176. }
  5177. return actionResult;
  5178. }
  5179. /*
  5180. /// <summary>
  5181. /// 获取用户是否有撤销包装权限
  5182. /// </summary>
  5183. /// <param name="accountCode"></param>
  5184. /// <param name="userCode"></param>
  5185. /// <param name="userPassword"></param>
  5186. /// <param name="sessionKey"></param>
  5187. /// <returns></returns>
  5188. public ActionResult GetChancelFinishedproductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5189. {
  5190. ActionResult actionResult = new ActionResult();
  5191. try
  5192. {
  5193. // 验证请求头信息
  5194. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5195. // 验证失败
  5196. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5197. {
  5198. return actionResult;
  5199. }
  5200. int returnValue = ServiceInvoker.Invoke<int>(this,
  5201. () => PDAModuleLogic.GetChancelFinishedproductFuntion(sUserInfo));
  5202. actionResult.Result = JsonHelper.ToJson(returnValue);
  5203. actionResult.Status = (int)Constant.PDAResult.Success;
  5204. }
  5205. catch (Exception ex)
  5206. {
  5207. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5208. OutputLog.TraceLog(LogPriority.Error,
  5209. this.ToString(),
  5210. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5211. ex.ToString(),
  5212. LocalPath.LogExePath);
  5213. actionResult.Status = (int)Constant.PDAResult.Exception;
  5214. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5215. }
  5216. return actionResult;
  5217. }
  5218. */
  5219. /// <summary>
  5220. /// 窑车状态明细表查询
  5221. /// </summary>
  5222. /// <param name="accountCode"></param>
  5223. /// <param name="userCode"></param>
  5224. /// <param name="userPassword"></param>
  5225. /// <param name="sessionKey"></param>
  5226. /// <param name="kilnCarCode"></param>
  5227. /// <returns></returns>
  5228. public ActionResult GetKilnCarStatusDetailByCode(string accountCode, string userCode, string userPassword, string sessionKey, string kilnCarCode)
  5229. {
  5230. ActionResult actionResult = new ActionResult();
  5231. try
  5232. {
  5233. // 验证请求头信息
  5234. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5235. // 验证失败
  5236. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5237. {
  5238. return actionResult;
  5239. }
  5240. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5241. () => ReportModuleLogic.GetKilnCarStatusDetailByCode(kilnCarCode, sUserInfo));
  5242. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  5243. {
  5244. actionResult.Status = (int)Constant.PDAResult.Fail;
  5245. actionResult.Message = Messages.MSG_CMN_I002;
  5246. }
  5247. else
  5248. {
  5249. actionResult.Result = JsonHelper.ToJson(sre.Data);
  5250. actionResult.Status = (int)Constant.PDAResult.Success;
  5251. }
  5252. }
  5253. catch (Exception ex)
  5254. {
  5255. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5256. OutputLog.TraceLog(LogPriority.Error,
  5257. this.ToString(),
  5258. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5259. ex.ToString(),
  5260. LocalPath.LogExePath);
  5261. actionResult.Status = (int)Constant.PDAResult.Exception;
  5262. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5263. }
  5264. return actionResult;
  5265. }
  5266. /// <summary>
  5267. /// 损坯撤销
  5268. /// </summary>
  5269. /// <param name="accountCode"></param>
  5270. /// <param name="userCode"></param>
  5271. /// <param name="userPassword"></param>
  5272. /// <param name="sessionKey"></param>
  5273. /// <param name="barcode"></param>
  5274. /// <returns></returns>
  5275. public ActionResult AddCancelScrapProduction(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5276. {
  5277. ActionResult actionResult = new ActionResult();
  5278. try
  5279. {
  5280. // 验证请求头信息
  5281. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5282. // 验证失败
  5283. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5284. {
  5285. return actionResult;
  5286. }
  5287. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5288. () => PMModuleLogicDAL.AddCancelScrapProduction(barcode, sUserInfo));
  5289. if (Convert.ToInt32(returnValue.Result) > 0)
  5290. {
  5291. actionResult.Result = JsonHelper.ToJson(returnValue);
  5292. actionResult.Status = (int)Constant.PDAResult.Success;
  5293. }
  5294. else
  5295. {
  5296. actionResult.Status = (int)Constant.PDAResult.Fail;
  5297. if (Convert.ToInt32(returnValue.Result) == -1)
  5298. actionResult.Message = "此产品没有损坯,不能撤销";
  5299. else if (Convert.ToInt32(returnValue.Result) == -200)
  5300. actionResult.Message = returnValue.Message;
  5301. else
  5302. actionResult.Message = "损坯撤销失败";
  5303. }
  5304. }
  5305. catch (Exception ex)
  5306. {
  5307. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5308. OutputLog.TraceLog(LogPriority.Error,
  5309. this.ToString(),
  5310. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5311. ex.ToString(),
  5312. LocalPath.LogExePath);
  5313. actionResult.Status = (int)Constant.PDAResult.Exception;
  5314. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5315. }
  5316. return actionResult;
  5317. }
  5318. /*
  5319. /// <summary>
  5320. /// 获取用户是否有损坯撤销权限
  5321. /// </summary>
  5322. /// <param name="accountCode"></param>
  5323. /// <param name="userCode"></param>
  5324. /// <param name="userPassword"></param>
  5325. /// <param name="sessionKey"></param>
  5326. /// <returns></returns>
  5327. public ActionResult GetCancelScrapProductionFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5328. {
  5329. ActionResult actionResult = new ActionResult();
  5330. try
  5331. {
  5332. // 验证请求头信息
  5333. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5334. // 验证失败
  5335. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5336. {
  5337. return actionResult;
  5338. }
  5339. int returnValue = ServiceInvoker.Invoke<int>(this,
  5340. () => PDAModuleLogic.GetCancelScrapProductionFuntion(sUserInfo));
  5341. actionResult.Result = JsonHelper.ToJson(returnValue);
  5342. actionResult.Status = (int)Constant.PDAResult.Success;
  5343. }
  5344. catch (Exception ex)
  5345. {
  5346. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5347. OutputLog.TraceLog(LogPriority.Error,
  5348. this.ToString(),
  5349. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5350. ex.ToString(),
  5351. LocalPath.LogExePath);
  5352. actionResult.Status = (int)Constant.PDAResult.Exception;
  5353. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5354. }
  5355. return actionResult;
  5356. }
  5357. */
  5358. /// <summary>
  5359. /// 获取条码注浆信息
  5360. /// </summary>
  5361. /// <param name="accountCode"></param>
  5362. /// <param name="userCode"></param>
  5363. /// <param name="userPassword"></param>
  5364. /// <param name="sessionKey"></param>
  5365. /// <returns></returns>
  5366. public ActionResult GetGroutingInfoBybarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5367. {
  5368. ActionResult actionResult = new ActionResult();
  5369. try
  5370. {
  5371. // 验证请求头信息
  5372. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5373. // 验证失败
  5374. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5375. {
  5376. return actionResult;
  5377. }
  5378. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  5379. () => PMModuleLogic.GetGroutingInfoBybarcode(barcode, sUserInfo));
  5380. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  5381. {
  5382. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  5383. actionResult.Status = (int)Constant.PDAResult.Success;
  5384. }
  5385. else
  5386. {
  5387. actionResult.Status = (int)Constant.PDAResult.Fail;
  5388. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5389. }
  5390. }
  5391. catch (Exception ex)
  5392. {
  5393. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5394. OutputLog.TraceLog(LogPriority.Error,
  5395. this.ToString(),
  5396. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5397. ex.ToString(),
  5398. LocalPath.LogExePath);
  5399. actionResult.Status = (int)Constant.PDAResult.Exception;
  5400. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5401. }
  5402. return actionResult;
  5403. }
  5404. /// <summary>
  5405. /// 获取条码注浆信息
  5406. /// </summary>
  5407. /// <param name="accountCode"></param>
  5408. /// <param name="userCode"></param>
  5409. /// <param name="userPassword"></param>
  5410. /// <param name="sessionKey"></param>
  5411. /// <returns></returns>
  5412. public ActionResult GetFinishedProductGroutingInfoBybarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5413. {
  5414. ActionResult actionResult = new ActionResult();
  5415. try
  5416. {
  5417. // 验证请求头信息
  5418. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5419. // 验证失败
  5420. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5421. {
  5422. return actionResult;
  5423. }
  5424. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  5425. () => PMModuleLogic.GetFinishedProductGroutingInfoBybarcode(barcode, sUserInfo));
  5426. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  5427. {
  5428. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  5429. actionResult.Status = (int)Constant.PDAResult.Success;
  5430. }
  5431. else
  5432. {
  5433. actionResult.Status = (int)Constant.PDAResult.Fail;
  5434. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5435. }
  5436. }
  5437. catch (Exception ex)
  5438. {
  5439. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5440. OutputLog.TraceLog(LogPriority.Error,
  5441. this.ToString(),
  5442. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5443. ex.ToString(),
  5444. LocalPath.LogExePath);
  5445. actionResult.Status = (int)Constant.PDAResult.Exception;
  5446. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5447. }
  5448. return actionResult;
  5449. }
  5450. /// <summary>
  5451. /// 公坯设定
  5452. /// </summary>
  5453. /// <param name="accountCode"></param>
  5454. /// <param name="userCode"></param>
  5455. /// <param name="userPassword"></param>
  5456. /// <param name="sessionKey"></param>
  5457. /// <param name="barcode"></param>
  5458. /// <returns></returns>
  5459. public ActionResult AddPublicBodyProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5460. {
  5461. ActionResult actionResult = new ActionResult();
  5462. try
  5463. {
  5464. // 验证请求头信息
  5465. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5466. // 验证失败
  5467. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5468. {
  5469. return actionResult;
  5470. }
  5471. int returnValue = ServiceInvoker.Invoke<int>(this,
  5472. () => PMModuleLogicDAL.AddPublicBodyProduct(barcode, sUserInfo));
  5473. if (returnValue > 0)
  5474. {
  5475. actionResult.Result = JsonHelper.ToJson(returnValue);
  5476. actionResult.Status = (int)Constant.PDAResult.Success;
  5477. }
  5478. else
  5479. {
  5480. actionResult.Status = (int)Constant.PDAResult.Fail;
  5481. if (returnValue == -1)
  5482. actionResult.Message = "此产品不在生产线上";
  5483. else if (returnValue == -2)
  5484. actionResult.Message = "该产品已经标识为公坯";
  5485. else
  5486. actionResult.Message = "公坯设定失败";
  5487. }
  5488. }
  5489. catch (Exception ex)
  5490. {
  5491. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5492. OutputLog.TraceLog(LogPriority.Error,
  5493. this.ToString(),
  5494. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5495. ex.ToString(),
  5496. LocalPath.LogExePath);
  5497. actionResult.Status = (int)Constant.PDAResult.Exception;
  5498. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5499. }
  5500. return actionResult;
  5501. }
  5502. /*
  5503. /// <summary>
  5504. /// 获取用户是否有公坯设定
  5505. /// </summary>
  5506. /// <param name="accountCode"></param>
  5507. /// <param name="userCode"></param>
  5508. /// <param name="userPassword"></param>
  5509. /// <param name="sessionKey"></param>
  5510. /// <returns></returns>
  5511. public ActionResult GetPublicBodyProductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5512. {
  5513. ActionResult actionResult = new ActionResult();
  5514. try
  5515. {
  5516. // 验证请求头信息
  5517. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5518. // 验证失败
  5519. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5520. {
  5521. return actionResult;
  5522. }
  5523. int returnValue = ServiceInvoker.Invoke<int>(this,
  5524. () => PDAModuleLogic.GetPublicBodyProductFuntion(sUserInfo));
  5525. actionResult.Result = JsonHelper.ToJson(returnValue);
  5526. actionResult.Status = (int)Constant.PDAResult.Success;
  5527. }
  5528. catch (Exception ex)
  5529. {
  5530. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5531. OutputLog.TraceLog(LogPriority.Error,
  5532. this.ToString(),
  5533. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5534. ex.ToString(),
  5535. LocalPath.LogExePath);
  5536. actionResult.Status = (int)Constant.PDAResult.Exception;
  5537. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5538. }
  5539. return actionResult;
  5540. }
  5541. */
  5542. /// <summary>
  5543. /// 校验产品条码是否可以走到该工序
  5544. /// </summary>
  5545. /// <param name="accountCode">帐套code</param>
  5546. /// <param name="userCode">用户code</param>
  5547. /// <param name="userPassword">用户密码</param>
  5548. /// <param name="sessionKey">本次登陆密钥</param>
  5549. /// <param name="procedureID">工序ID</param>
  5550. /// <param name="barcode">条码</param>
  5551. /// <returns></returns>
  5552. /// <remarks>
  5553. /// 陈冰 2014.09.18 新建
  5554. /// </remarks>
  5555. public ActionResult CheckBarcodeDeliverMud(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  5556. {
  5557. ActionResult actionResult = new ActionResult();
  5558. try
  5559. {
  5560. // 验证请求头信息
  5561. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5562. // 验证失败
  5563. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5564. {
  5565. return actionResult;
  5566. }
  5567. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  5568. () => PMModuleLogic.CheckBarcodeDeliverMud(procedureID, barcode, sUserInfo));
  5569. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  5570. {
  5571. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  5572. actionResult.Status = (int)Constant.PDAResult.Success;
  5573. }
  5574. else
  5575. {
  5576. actionResult.Status = (int)Constant.PDAResult.Fail;
  5577. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5578. }
  5579. }
  5580. catch (Exception ex)
  5581. {
  5582. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5583. OutputLog.TraceLog(LogPriority.Error,
  5584. this.ToString(),
  5585. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5586. ex.ToString(),
  5587. LocalPath.LogExePath);
  5588. actionResult.Status = (int)Constant.PDAResult.Exception;
  5589. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5590. }
  5591. return actionResult;
  5592. }
  5593. /// <summary>
  5594. /// 获取用户所有菜单权限
  5595. /// </summary>
  5596. /// <param name="accountCode"></param>
  5597. /// <param name="userCode"></param>
  5598. /// <param name="userPassword"></param>
  5599. /// <param name="sessionKey"></param>
  5600. /// <returns></returns>
  5601. public ActionResult GetUserAllFunction(string accountCode, string userCode, string userPassword, string sessionKey)
  5602. {
  5603. ActionResult actionResult = new ActionResult();
  5604. try
  5605. {
  5606. // 验证请求头信息
  5607. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5608. // 验证失败
  5609. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5610. {
  5611. return actionResult;
  5612. }
  5613. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  5614. () => PDAModuleLogic.GetUserAllFunction(sUserInfo));
  5615. actionResult.Result = JsonHelper.ToJson(returnValue);
  5616. actionResult.Status = (int)Constant.PDAResult.Success;
  5617. }
  5618. catch (Exception ex)
  5619. {
  5620. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5621. OutputLog.TraceLog(LogPriority.Error,
  5622. this.ToString(),
  5623. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5624. ex.ToString(),
  5625. LocalPath.LogExePath);
  5626. actionResult.Status = (int)Constant.PDAResult.Exception;
  5627. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5628. }
  5629. return actionResult;
  5630. }
  5631. public ActionResult AddChancelBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5632. {
  5633. ActionResult actionResult = new ActionResult();
  5634. try
  5635. {
  5636. // 验证请求头信息
  5637. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5638. // 验证失败
  5639. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5640. {
  5641. return actionResult;
  5642. }
  5643. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5644. () => PMModuleLogicDAL.AddChancelBarCode(barcode, sUserInfo));
  5645. if (Convert.ToInt32(returnValue.Result) > 0)
  5646. {
  5647. actionResult.Result = JsonHelper.ToJson(returnValue);
  5648. actionResult.Status = (int)Constant.PDAResult.Success;
  5649. }
  5650. else
  5651. {
  5652. actionResult.Status = (int)Constant.PDAResult.Fail;
  5653. if (Convert.ToInt32(returnValue.Result) == -1)
  5654. actionResult.Message = "无效条码";
  5655. else if (Convert.ToInt32(returnValue.Result) == -2)
  5656. actionResult.Message = "已经生产完成";
  5657. else if (Convert.ToInt32(returnValue.Result) == -3)
  5658. actionResult.Message = "条码已经申请报废";
  5659. else if (Convert.ToInt32(returnValue.Result) == -4)
  5660. actionResult.Message = "此条码当前工序不允许进行撤销";
  5661. else if (Convert.ToInt32(returnValue.Result) == -5)
  5662. actionResult.Message = "此条码没有生产数据";
  5663. else if (Convert.ToInt32(returnValue.Result) == -6)
  5664. actionResult.Message = "没有当前工序权限";
  5665. else if (Convert.ToInt32(returnValue.Result) == -7)
  5666. actionResult.Message = "条码不在生产线上";
  5667. else if (Convert.ToInt32(returnValue.Result) == -8)
  5668. actionResult.Message = "操作用户无此工序的撤销范围权限";
  5669. else if (Convert.ToInt32(returnValue.Result) == -9)
  5670. actionResult.Message = "条码已经是返工状态";
  5671. else if (Convert.ToInt32(returnValue.Result) == -200)
  5672. actionResult.Message = returnValue.Message;
  5673. }
  5674. }
  5675. catch (Exception ex)
  5676. {
  5677. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5678. OutputLog.TraceLog(LogPriority.Error,
  5679. this.ToString(),
  5680. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5681. ex.ToString(),
  5682. LocalPath.LogExePath);
  5683. actionResult.Status = (int)Constant.PDAResult.Exception;
  5684. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5685. }
  5686. return actionResult;
  5687. }
  5688. public ActionResult AddChancelDeliverMudBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5689. {
  5690. ActionResult actionResult = new ActionResult();
  5691. try
  5692. {
  5693. // 验证请求头信息
  5694. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5695. // 验证失败
  5696. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5697. {
  5698. return actionResult;
  5699. }
  5700. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5701. () => PMModuleLogicDAL.AddChancelDeliverMudBarCode(barcode, sUserInfo));
  5702. if (Convert.ToInt32(returnValue.Result) > 0)
  5703. {
  5704. actionResult.Result = JsonHelper.ToJson(returnValue);
  5705. actionResult.Status = (int)Constant.PDAResult.Success;
  5706. }
  5707. else
  5708. {
  5709. actionResult.Status = (int)Constant.PDAResult.Fail;
  5710. if (Convert.ToInt32(returnValue.Result) == -1)
  5711. actionResult.Message = "无效条码";
  5712. else if (Convert.ToInt32(returnValue.Result) == -2)
  5713. actionResult.Message = "已经生产完成";
  5714. else if (Convert.ToInt32(returnValue.Result) == -3)
  5715. actionResult.Message = "条码已经申请报废";
  5716. else if (Convert.ToInt32(returnValue.Result) == -4)
  5717. actionResult.Message = "此条码当前工序不允许进行撤销";
  5718. else if (Convert.ToInt32(returnValue.Result) == -5)
  5719. actionResult.Message = "此条码没有生产数据";
  5720. else if (Convert.ToInt32(returnValue.Result) == -55)
  5721. actionResult.Message = "条码已经不在交坯工序,不允许撤销";
  5722. else if (Convert.ToInt32(returnValue.Result) == -6)
  5723. actionResult.Message = "没有任何影响行";
  5724. else if (Convert.ToInt32(returnValue.Result) == -7)
  5725. actionResult.Message = "条码不在生产线上";
  5726. else if (Convert.ToInt32(returnValue.Result) == -8)
  5727. actionResult.Message = "条码已经是返工状态";
  5728. else if (Convert.ToInt32(returnValue.Result) == -200)
  5729. actionResult.Message = returnValue.Message;
  5730. }
  5731. }
  5732. catch (Exception ex)
  5733. {
  5734. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5735. OutputLog.TraceLog(LogPriority.Error,
  5736. this.ToString(),
  5737. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5738. ex.ToString(),
  5739. LocalPath.LogExePath);
  5740. actionResult.Status = (int)Constant.PDAResult.Exception;
  5741. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5742. }
  5743. return actionResult;
  5744. }
  5745. public ActionResult GetAllLogoInfo(string accountCode, string userCode, string userPassword, string sessionKey)
  5746. {
  5747. ActionResult actionResult = new ActionResult();
  5748. try
  5749. {
  5750. // 验证请求头信息
  5751. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5752. // 验证失败
  5753. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5754. {
  5755. return actionResult;
  5756. }
  5757. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  5758. //() => SystemModuleLogic.GetAllLogoInfo(sUserInfo));
  5759. () => SystemModuleLogic.GetLogoInfo(sUserInfo));
  5760. if (returnValue != null && returnValue.Tables[0].Rows.Count > 0)
  5761. {
  5762. //DataView dv = returnValue.Tables[0].DefaultView;
  5763. //dv.RowFilter = "ValueFlag=1";
  5764. //actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  5765. actionResult.Result = JsonHelper.ToJson(returnValue.Tables[0]);
  5766. actionResult.Status = (int)Constant.PDAResult.Success;
  5767. }
  5768. }
  5769. catch (Exception ex)
  5770. {
  5771. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5772. OutputLog.TraceLog(LogPriority.Error,
  5773. this.ToString(),
  5774. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5775. ex.ToString(),
  5776. LocalPath.LogExePath);
  5777. actionResult.Status = (int)Constant.PDAResult.Exception;
  5778. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5779. }
  5780. return actionResult;
  5781. }
  5782. /// <summary>
  5783. /// 变更产品商标用
  5784. /// </summary>
  5785. /// <param name="accountCode"></param>
  5786. /// <param name="userCode"></param>
  5787. /// <param name="userPassword"></param>
  5788. /// <param name="sessionKey"></param>
  5789. /// <param name="goodsid"></param>
  5790. /// <returns></returns>
  5791. public ActionResult GetLogoInfoForChange(string accountCode, string userCode, string userPassword, string sessionKey
  5792. , int goodsid)
  5793. {
  5794. ActionResult actionResult = new ActionResult();
  5795. try
  5796. {
  5797. // 验证请求头信息
  5798. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5799. // 验证失败
  5800. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5801. {
  5802. return actionResult;
  5803. }
  5804. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  5805. //() => SystemModuleLogic.GetAllLogoInfo(sUserInfo));
  5806. //() => SystemModuleLogic.GetLogoInfo(sUserInfo));
  5807. () => SystemModuleLogic.GetLogoInfoForChange(sUserInfo, goodsid));
  5808. if (returnValue != null && returnValue.Tables[0].Rows.Count > 0)
  5809. {
  5810. //DataView dv = returnValue.Tables[0].DefaultView;
  5811. //dv.RowFilter = "ValueFlag=1";
  5812. //actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  5813. actionResult.Result = JsonHelper.ToJson(returnValue.Tables[0]);
  5814. actionResult.Status = (int)Constant.PDAResult.Success;
  5815. }
  5816. }
  5817. catch (Exception ex)
  5818. {
  5819. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5820. OutputLog.TraceLog(LogPriority.Error,
  5821. this.ToString(),
  5822. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5823. ex.ToString(),
  5824. LocalPath.LogExePath);
  5825. actionResult.Status = (int)Constant.PDAResult.Exception;
  5826. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5827. }
  5828. return actionResult;
  5829. }
  5830. public ActionResult GetLogoID(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  5831. {
  5832. ActionResult actionResult = new ActionResult();
  5833. try
  5834. {
  5835. // 验证请求头信息
  5836. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5837. // 验证失败
  5838. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5839. {
  5840. return actionResult;
  5841. }
  5842. int returnValue = ServiceInvoker.Invoke<int>(this,
  5843. () => PMModuleLogic.GetLogoID(procedureID, sUserInfo));
  5844. actionResult.Result = JsonHelper.ToJson(returnValue);
  5845. actionResult.Status = (int)Constant.PDAResult.Success;
  5846. }
  5847. catch (Exception ex)
  5848. {
  5849. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5850. OutputLog.TraceLog(LogPriority.Error,
  5851. this.ToString(),
  5852. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5853. ex.ToString(),
  5854. LocalPath.LogExePath);
  5855. actionResult.Status = (int)Constant.PDAResult.Exception;
  5856. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5857. }
  5858. return actionResult;
  5859. }
  5860. public ActionResult SaveBarCodeLogo(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int logoid)
  5861. {
  5862. ActionResult actionResult = new ActionResult();
  5863. try
  5864. {
  5865. // 验证请求头信息
  5866. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5867. // 验证失败
  5868. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5869. {
  5870. return actionResult;
  5871. }
  5872. int returnValue = ServiceInvoker.Invoke<int>(this,
  5873. () => PMModuleLogicDAL.SaveBarCodeLogo(barcode, logoid, sUserInfo));
  5874. actionResult.Result = JsonHelper.ToJson(returnValue);
  5875. actionResult.Status = (int)Constant.PDAResult.Success;
  5876. }
  5877. catch (Exception ex)
  5878. {
  5879. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5880. OutputLog.TraceLog(LogPriority.Error,
  5881. this.ToString(),
  5882. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5883. ex.ToString(),
  5884. LocalPath.LogExePath);
  5885. actionResult.Status = (int)Constant.PDAResult.Exception;
  5886. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5887. }
  5888. return actionResult;
  5889. }
  5890. public ActionResult SaveBarCodeLogoAndGlazetype(string accountCode, string userCode, string userPassword, string sessionKey,
  5891. string barcode, int logoid, int glazetypeid)
  5892. {
  5893. ActionResult actionResult = new ActionResult();
  5894. try
  5895. {
  5896. // 验证请求头信息
  5897. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5898. // 验证失败
  5899. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5900. {
  5901. return actionResult;
  5902. }
  5903. int returnValue = ServiceInvoker.Invoke<int>(this,
  5904. () => PMModuleLogicDAL.SaveBarCodeLogoAndGlazetype(barcode, logoid, glazetypeid, sUserInfo));
  5905. actionResult.Result = JsonHelper.ToJson(returnValue);
  5906. if (returnValue > 0)
  5907. {
  5908. actionResult.Status = (int)Constant.PDAResult.Success;
  5909. }
  5910. else
  5911. {
  5912. actionResult.Status = (int)Constant.PDAResult.Fail;
  5913. actionResult.Message = "条码不存在";
  5914. }
  5915. }
  5916. catch (Exception ex)
  5917. {
  5918. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5919. OutputLog.TraceLog(LogPriority.Error,
  5920. this.ToString(),
  5921. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5922. ex.ToString(),
  5923. LocalPath.LogExePath);
  5924. actionResult.Status = (int)Constant.PDAResult.Exception;
  5925. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5926. }
  5927. return actionResult;
  5928. }
  5929. public ActionResult SaveBarCodesLogoAndGlazetype(string accountCode, string userCode, string userPassword, string sessionKey,
  5930. string barcodes, int logoid, int glazetypeid, int procedureID)
  5931. {
  5932. ActionResult actionResult = new ActionResult();
  5933. try
  5934. {
  5935. // 验证请求头信息
  5936. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5937. // 验证失败
  5938. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5939. {
  5940. return actionResult;
  5941. }
  5942. int returnValue = ServiceInvoker.Invoke<int>(this,
  5943. () => PMModuleLogicDAL.SaveBarCodesLogoAndGlazetype(barcodes, logoid, glazetypeid, procedureID, sUserInfo));
  5944. actionResult.Result = JsonHelper.ToJson(returnValue);
  5945. if (returnValue > 0)
  5946. {
  5947. actionResult.Status = (int)Constant.PDAResult.Success;
  5948. }
  5949. else
  5950. {
  5951. actionResult.Status = (int)Constant.PDAResult.Fail;
  5952. actionResult.Message = "条码不存在";
  5953. }
  5954. }
  5955. catch (Exception ex)
  5956. {
  5957. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5958. OutputLog.TraceLog(LogPriority.Error,
  5959. this.ToString(),
  5960. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5961. ex.ToString(),
  5962. LocalPath.LogExePath);
  5963. actionResult.Status = (int)Constant.PDAResult.Exception;
  5964. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5965. }
  5966. return actionResult;
  5967. }
  5968. public ActionResult GetBarCodeLogoID(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5969. {
  5970. ActionResult actionResult = new ActionResult();
  5971. try
  5972. {
  5973. // 验证请求头信息
  5974. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5975. // 验证失败
  5976. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5977. {
  5978. return actionResult;
  5979. }
  5980. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  5981. () => PMModuleLogic.GetBarCodeLogoID(barcode, sUserInfo));
  5982. if (returnValue != null && returnValue.Tables[0].Rows.Count > 0)
  5983. {
  5984. actionResult.Result = JsonHelper.ToJson(returnValue.Tables[0]);
  5985. actionResult.Status = (int)Constant.PDAResult.Success;
  5986. }
  5987. }
  5988. catch (Exception ex)
  5989. {
  5990. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5991. OutputLog.TraceLog(LogPriority.Error,
  5992. this.ToString(),
  5993. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5994. ex.ToString(),
  5995. LocalPath.LogExePath);
  5996. actionResult.Status = (int)Constant.PDAResult.Exception;
  5997. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5998. }
  5999. return actionResult;
  6000. }
  6001. /// <summary>
  6002. /// 半检时,入窑前检验获取此条码是否报损为废品
  6003. /// </summary>
  6004. /// <param name="accountCode"></param>
  6005. /// <param name="userCode"></param>
  6006. /// <param name="userPassword"></param>
  6007. /// <param name="sessionKey"></param>
  6008. /// <param name="barcode">产品条码</param>
  6009. /// <returns></returns>
  6010. public ActionResult CheckWasteScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  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. int returnValue = ServiceInvoker.Invoke<int>(this,
  6023. () => PMModuleLogic.CheckWasteScrapProduct(barcode));
  6024. if (returnValue != -100)
  6025. {
  6026. actionResult.Result = JsonHelper.ToJson(returnValue);
  6027. actionResult.Status = (int)Constant.PDAResult.Success;
  6028. }
  6029. else
  6030. {
  6031. actionResult.Status = (int)Constant.PDAResult.Fail;
  6032. actionResult.Message = "条码[" + barcode + "]不是废品,不能进行编辑";
  6033. }
  6034. }
  6035. catch (Exception ex)
  6036. {
  6037. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6038. OutputLog.TraceLog(LogPriority.Error,
  6039. this.ToString(),
  6040. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6041. ex.ToString(),
  6042. LocalPath.LogExePath);
  6043. actionResult.Status = (int)Constant.PDAResult.Exception;
  6044. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6045. }
  6046. return actionResult;
  6047. }
  6048. /// <summary>
  6049. /// 获取登陆帐户有无入窑前检验数据编辑权限
  6050. /// </summary>
  6051. /// <param name="accountCode"></param>
  6052. /// <param name="userCode"></param>
  6053. /// <param name="userPassword"></param>
  6054. /// <param name="sessionKey"></param>
  6055. /// <param name="usercode">工号编码</param>
  6056. /// <returns></returns>
  6057. public ActionResult GetIntoKilnCheckEditFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  6058. {
  6059. ActionResult actionResult = new ActionResult();
  6060. try
  6061. {
  6062. // 验证请求头信息
  6063. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6064. // 验证失败
  6065. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6066. {
  6067. return actionResult;
  6068. }
  6069. int returnValue = ServiceInvoker.Invoke<int>(this,
  6070. () => PDAModuleLogic.GetIntoKilnCheckEditFuntion(sUserInfo));
  6071. actionResult.Result = JsonHelper.ToJson(returnValue);
  6072. actionResult.Status = (int)Constant.PDAResult.Success;
  6073. }
  6074. catch (Exception ex)
  6075. {
  6076. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6077. OutputLog.TraceLog(LogPriority.Error,
  6078. this.ToString(),
  6079. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6080. ex.ToString(),
  6081. LocalPath.LogExePath);
  6082. actionResult.Status = (int)Constant.PDAResult.Exception;
  6083. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6084. }
  6085. return actionResult;
  6086. }
  6087. /// <summary>
  6088. /// 获取登陆帐户有无半检验数据编辑权限
  6089. /// </summary>
  6090. /// <param name="accountCode"></param>
  6091. /// <param name="userCode"></param>
  6092. /// <param name="userPassword"></param>
  6093. /// <param name="sessionKey"></param>
  6094. /// <param name="usercode">工号编码</param>
  6095. /// <returns></returns>
  6096. public ActionResult GetNormalCheckEditFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  6097. {
  6098. ActionResult actionResult = new ActionResult();
  6099. try
  6100. {
  6101. // 验证请求头信息
  6102. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6103. // 验证失败
  6104. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6105. {
  6106. return actionResult;
  6107. }
  6108. int returnValue = ServiceInvoker.Invoke<int>(this,
  6109. () => PDAModuleLogic.GetNormalCheckEditFuntion(sUserInfo));
  6110. actionResult.Result = JsonHelper.ToJson(returnValue);
  6111. actionResult.Status = (int)Constant.PDAResult.Success;
  6112. }
  6113. catch (Exception ex)
  6114. {
  6115. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6116. OutputLog.TraceLog(LogPriority.Error,
  6117. this.ToString(),
  6118. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6119. ex.ToString(),
  6120. LocalPath.LogExePath);
  6121. actionResult.Status = (int)Constant.PDAResult.Exception;
  6122. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6123. }
  6124. return actionResult;
  6125. }
  6126. /// <summary>
  6127. /// 获取缺陷扣罚管理的全部数据
  6128. /// </summary>
  6129. /// <param name="accountCode"></param>
  6130. /// <param name="userCode"></param>
  6131. /// <param name="userPassword"></param>
  6132. /// <param name="sessionKey"></param>
  6133. /// <returns></returns>
  6134. public ActionResult GetAllDefectFine(string accountCode, string userCode, string userPassword, string sessionKey)
  6135. {
  6136. ActionResult actionResult = new ActionResult();
  6137. try
  6138. {
  6139. // 验证请求头信息
  6140. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6141. // 验证失败
  6142. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6143. {
  6144. return actionResult;
  6145. }
  6146. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6147. () => SystemModuleLogic.GetAllDefectFine(sUserInfo));
  6148. if (ds != null && ds.Tables[0].Rows.Count > 0)
  6149. {
  6150. DataView dv = ds.Tables[0].DefaultView;
  6151. dv.RowFilter = "valueflag=1";
  6152. actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  6153. actionResult.Status = (int)Constant.PDAResult.Success;
  6154. }
  6155. else
  6156. {
  6157. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  6158. actionResult.Status = (int)Constant.PDAResult.Success;
  6159. }
  6160. }
  6161. catch (Exception ex)
  6162. {
  6163. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6164. OutputLog.TraceLog(LogPriority.Error,
  6165. this.ToString(),
  6166. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6167. ex.ToString(),
  6168. LocalPath.LogExePath);
  6169. actionResult.Status = (int)Constant.PDAResult.Exception;
  6170. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6171. }
  6172. return actionResult;
  6173. }
  6174. /// <summary>
  6175. /// 获取缺陷扣除数管理的全部数据
  6176. /// </summary>
  6177. /// <param name="accountCode"></param>
  6178. /// <param name="userCode"></param>
  6179. /// <param name="userPassword"></param>
  6180. /// <param name="sessionKey"></param>
  6181. /// <returns></returns>
  6182. public ActionResult GetAllDefectDeduction(string accountCode, string userCode, string userPassword, string sessionKey)
  6183. {
  6184. ActionResult actionResult = new ActionResult();
  6185. try
  6186. {
  6187. // 验证请求头信息
  6188. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6189. // 验证失败
  6190. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6191. {
  6192. return actionResult;
  6193. }
  6194. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6195. () => SystemModuleLogic.GetAllDefectDeduction(sUserInfo));
  6196. if (ds != null && ds.Tables[0].Rows.Count > 0)
  6197. {
  6198. DataView dv = ds.Tables[0].DefaultView;
  6199. dv.RowFilter = "valueflag=1";
  6200. actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  6201. actionResult.Status = (int)Constant.PDAResult.Success;
  6202. }
  6203. else
  6204. {
  6205. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  6206. actionResult.Status = (int)Constant.PDAResult.Success;
  6207. }
  6208. }
  6209. catch (Exception ex)
  6210. {
  6211. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6212. OutputLog.TraceLog(LogPriority.Error,
  6213. this.ToString(),
  6214. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6215. ex.ToString(),
  6216. LocalPath.LogExePath);
  6217. actionResult.Status = (int)Constant.PDAResult.Exception;
  6218. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6219. }
  6220. return actionResult;
  6221. }
  6222. /// <summary>
  6223. /// 获取缺陷扣罚关系管理的全部数据
  6224. /// </summary>
  6225. /// <param name="accountCode"></param>
  6226. /// <param name="userCode"></param>
  6227. /// <param name="userPassword"></param>
  6228. /// <param name="sessionKey"></param>
  6229. /// <returns></returns>
  6230. public ActionResult GetAllDefectFineRelation(string accountCode, string userCode, string userPassword, string sessionKey)
  6231. {
  6232. ActionResult actionResult = new ActionResult();
  6233. try
  6234. {
  6235. // 验证请求头信息
  6236. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6237. // 验证失败
  6238. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6239. {
  6240. return actionResult;
  6241. }
  6242. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6243. () => SystemModuleLogic.GetAllDefectFineRelation(sUserInfo));
  6244. DataTable dt = new DataTable();
  6245. dt.Columns.Add("DefectID");
  6246. dt.Columns.Add("DefectFineID");
  6247. DataView dv = ds.Tables[0].DefaultView;
  6248. DataTable dtFor = dv.ToTable("defectid", true);
  6249. for (int i = 0; i < dtFor.Rows.Count; i++)
  6250. {
  6251. DataRow[] r = ds.Tables[0].Select("defectid=" + dtFor.Rows[i]["defectid"]);
  6252. string substring = "";
  6253. foreach (DataRow r1 in r)
  6254. {
  6255. substring += r1["DefectFineID"].ToString() + "-" + r1["DEFECTFINECODE"].ToString() + ",";
  6256. }
  6257. if (substring != "")
  6258. {
  6259. DataRow drnew = dt.NewRow();
  6260. drnew["DefectID"] = dtFor.Rows[i]["defectid"];
  6261. drnew["DefectFineID"] = substring.TrimEnd(',');
  6262. dt.Rows.Add(drnew);
  6263. }
  6264. }
  6265. actionResult.Result = JsonHelper.ToJson(dt);//ds.Tables[0]
  6266. actionResult.Status = (int)Constant.PDAResult.Success;
  6267. }
  6268. catch (Exception ex)
  6269. {
  6270. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6271. OutputLog.TraceLog(LogPriority.Error,
  6272. this.ToString(),
  6273. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6274. ex.ToString(),
  6275. LocalPath.LogExePath);
  6276. actionResult.Status = (int)Constant.PDAResult.Exception;
  6277. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6278. }
  6279. return actionResult;
  6280. }
  6281. /// <summary>
  6282. /// 获取缺陷扣除数关系管理的全部数据
  6283. /// </summary>
  6284. /// <param name="accountCode"></param>
  6285. /// <param name="userCode"></param>
  6286. /// <param name="userPassword"></param>
  6287. /// <param name="sessionKey"></param>
  6288. /// <returns></returns>
  6289. public ActionResult GetAllDefectDeductionRelation(string accountCode, string userCode, string userPassword, string sessionKey)
  6290. {
  6291. ActionResult actionResult = new ActionResult();
  6292. try
  6293. {
  6294. // 验证请求头信息
  6295. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6296. // 验证失败
  6297. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6298. {
  6299. return actionResult;
  6300. }
  6301. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6302. () => SystemModuleLogic.GetAllDefectDeductionRelation(sUserInfo));
  6303. DataTable dt = new DataTable();
  6304. dt.Columns.Add("DefectID");
  6305. dt.Columns.Add("DefectDeductionNum");
  6306. DataView dv = ds.Tables[0].DefaultView;
  6307. DataTable dtFor = dv.ToTable("defectid", true);
  6308. for (int i = 0; i < dtFor.Rows.Count; i++)
  6309. {
  6310. DataRow[] r = ds.Tables[0].Select("defectid=" + dtFor.Rows[i]["defectid"]);
  6311. string substring = "";
  6312. foreach (DataRow r1 in r)
  6313. {
  6314. substring += r1["DefectDeductionID"].ToString() + "-" + r1["DefectDeductionNum"].ToString() + ",";
  6315. }
  6316. if (substring != "")
  6317. {
  6318. DataRow drnew = dt.NewRow();
  6319. drnew["DefectID"] = dtFor.Rows[i]["defectid"];
  6320. drnew["DefectDeductionNum"] = substring.TrimEnd(',');
  6321. dt.Rows.Add(drnew);
  6322. }
  6323. }
  6324. actionResult.Result = JsonHelper.ToJson(dt);//ds.Tables[0]
  6325. actionResult.Status = (int)Constant.PDAResult.Success;
  6326. }
  6327. catch (Exception ex)
  6328. {
  6329. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6330. OutputLog.TraceLog(LogPriority.Error,
  6331. this.ToString(),
  6332. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6333. ex.ToString(),
  6334. LocalPath.LogExePath);
  6335. actionResult.Status = (int)Constant.PDAResult.Exception;
  6336. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6337. }
  6338. return actionResult;
  6339. }
  6340. /// <summary>
  6341. /// 获取盘点单明细
  6342. /// </summary>
  6343. /// <param name="sUserInfo"></param>
  6344. /// <returns></returns>
  6345. public ActionResult GetUpdateInCheckedInfo(string accountCode, string userCode, string userPassword, string sessionKey, string incheckedno)
  6346. {
  6347. ActionResult actionResult = new ActionResult();
  6348. try
  6349. {
  6350. // 验证请求头信息
  6351. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6352. // 验证失败
  6353. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6354. {
  6355. return actionResult;
  6356. }
  6357. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6358. () => PMModuleLogic.GetUpdateInCheckedInfo(incheckedno, sUserInfo));
  6359. actionResult.Result = JsonHelper.ToJson(ds);
  6360. actionResult.Status = (int)Constant.PDAResult.Success;
  6361. }
  6362. catch (Exception ex)
  6363. {
  6364. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6365. OutputLog.TraceLog(LogPriority.Error,
  6366. this.ToString(),
  6367. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6368. ex.ToString(),
  6369. LocalPath.LogExePath);
  6370. actionResult.Status = (int)Constant.PDAResult.Exception;
  6371. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6372. }
  6373. return actionResult;
  6374. }
  6375. /// <summary>
  6376. /// 半检检验条码
  6377. /// </summary>
  6378. /// <param name="sUserInfo"></param>
  6379. /// <returns></returns>
  6380. public ActionResult SemiCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6381. {
  6382. ActionResult actionResult = new ActionResult();
  6383. try
  6384. {
  6385. // 验证请求头信息
  6386. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6387. // 验证失败
  6388. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6389. {
  6390. return actionResult;
  6391. }
  6392. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6393. () => PMModuleLogic.SemiCheckBarcode(barcode, sUserInfo));
  6394. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6395. if (Convert.ToInt32(resultEntity.Result) < 0)
  6396. {
  6397. actionResult.Status = (int)Constant.PDAResult.Fail;
  6398. }
  6399. else
  6400. {
  6401. actionResult.Status = (int)Constant.PDAResult.Success;
  6402. }
  6403. actionResult.Message = resultEntity.Message;
  6404. }
  6405. catch (Exception ex)
  6406. {
  6407. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6408. OutputLog.TraceLog(LogPriority.Error,
  6409. this.ToString(),
  6410. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6411. ex.ToString(),
  6412. LocalPath.LogExePath);
  6413. actionResult.Status = (int)Constant.PDAResult.Exception;
  6414. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6415. }
  6416. return actionResult;
  6417. }
  6418. /// <summary>
  6419. /// 根据条码获取经过的工序,用于绑定返工工序
  6420. /// </summary>
  6421. /// <param name="sUserInfo"></param>
  6422. /// <returns></returns>
  6423. public ActionResult GetSemiCheckPassProcedure(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6424. {
  6425. ActionResult actionResult = new ActionResult();
  6426. try
  6427. {
  6428. // 验证请求头信息
  6429. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6430. // 验证失败
  6431. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6432. {
  6433. return actionResult;
  6434. }
  6435. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6436. () => PMModuleLogic.GetSemiCheckPassProcedure(barcode));
  6437. actionResult.Result = JsonHelper.ToJson(resultEntity);
  6438. actionResult.Status = (int)Constant.PDAResult.Success;
  6439. }
  6440. catch (Exception ex)
  6441. {
  6442. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6443. OutputLog.TraceLog(LogPriority.Error,
  6444. this.ToString(),
  6445. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6446. ex.ToString(),
  6447. LocalPath.LogExePath);
  6448. actionResult.Status = (int)Constant.PDAResult.Exception;
  6449. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6450. }
  6451. return actionResult;
  6452. }
  6453. /// <summary>
  6454. /// 获取登陆帐户有无半检状态权限
  6455. /// </summary>
  6456. /// <param name="sUserInfo"></param>
  6457. /// <returns></returns>
  6458. public ActionResult GetSemiCheckStatusFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  6459. {
  6460. ActionResult actionResult = new ActionResult();
  6461. try
  6462. {
  6463. // 验证请求头信息
  6464. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6465. // 验证失败
  6466. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6467. {
  6468. return actionResult;
  6469. }
  6470. int resultEntity = ServiceInvoker.Invoke<int>(this,
  6471. () => PMModuleLogic.GetSemiCheckStatusFuntion(sUserInfo));
  6472. actionResult.Result = JsonHelper.ToJson(resultEntity);
  6473. actionResult.Status = (int)Constant.PDAResult.Success;
  6474. }
  6475. catch (Exception ex)
  6476. {
  6477. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6478. OutputLog.TraceLog(LogPriority.Error,
  6479. this.ToString(),
  6480. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6481. ex.ToString(),
  6482. LocalPath.LogExePath);
  6483. actionResult.Status = (int)Constant.PDAResult.Exception;
  6484. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6485. }
  6486. return actionResult;
  6487. }
  6488. /// <summary>
  6489. /// 复检状态数据源
  6490. /// </summary>
  6491. /// <param name="sUserInfo"></param>
  6492. /// <returns></returns>
  6493. public ActionResult GetSemiCheckType(string accountCode, string userCode, string userPassword, string sessionKey)
  6494. {
  6495. ActionResult actionResult = new ActionResult();
  6496. try
  6497. {
  6498. // 验证请求头信息
  6499. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6500. // 验证失败
  6501. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6502. {
  6503. return actionResult;
  6504. }
  6505. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6506. () => SystemModuleLogic.GetSemiCheckType());
  6507. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6508. actionResult.Status = (int)Constant.PDAResult.Success;
  6509. }
  6510. catch (Exception ex)
  6511. {
  6512. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6513. OutputLog.TraceLog(LogPriority.Error,
  6514. this.ToString(),
  6515. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6516. ex.ToString(),
  6517. LocalPath.LogExePath);
  6518. actionResult.Status = (int)Constant.PDAResult.Exception;
  6519. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6520. }
  6521. return actionResult;
  6522. }
  6523. /// <summary>
  6524. /// 根据半成品检验数据ID,显示半成品数据信息
  6525. /// </summary>
  6526. /// <param name="sUserInfo"></param>
  6527. /// <returns></returns>
  6528. public ActionResult GetSemiCheckByID(string accountCode, string userCode, string userPassword, string sessionKey, int semiCheckID)
  6529. {
  6530. ActionResult actionResult = new ActionResult();
  6531. try
  6532. {
  6533. // 验证请求头信息
  6534. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6535. // 验证失败
  6536. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6537. {
  6538. return actionResult;
  6539. }
  6540. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  6541. () => PMModuleLogic.GetSemiCheckByID(semiCheckID));
  6542. SemiCheckEntity[] productionDatas = new SemiCheckEntity[1];
  6543. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  6544. {
  6545. if (reworkDs != null && reworkDs.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  6546. {
  6547. for (int i = 0; i < reworkDs.Tables[0].Rows.Count; i++)
  6548. {
  6549. SemiCheckEntity productionData = new SemiCheckEntity();
  6550. productionData.BarCode = reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
  6551. if (reworkDs.Tables[0].Rows[i]["GoodsID"].ToString() != "")
  6552. {
  6553. productionData.GoodsID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsID"].ToString());
  6554. }
  6555. productionData.SemiCheckID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["SemiCheckID"].ToString());
  6556. productionData.GoodsCode = reworkDs.Tables[0].Rows[i]["GoodsCode"].ToString();
  6557. productionData.GoodsName = reworkDs.Tables[0].Rows[i]["GoodsName"].ToString();
  6558. productionData.SemiCheckType = reworkDs.Tables[0].Rows[i]["SemiCheckType"].ToString();
  6559. productionData.ReFine = 0;
  6560. if (reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString() != "")
  6561. {
  6562. productionData.ReworkProcedureID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString());
  6563. }
  6564. productionData.ReSemiCheckType = reworkDs.Tables[0].Rows[i]["ReSemiCheckType"].ToString();
  6565. productionData.ReworkProcedureCode = reworkDs.Tables[0].Rows[i]["ReworkProcedureCode"].ToString();
  6566. productionData.ReworkProcedureName = reworkDs.Tables[0].Rows[i]["ReworkProcedureName"].ToString();
  6567. productionData.Remarks = reworkDs.Tables[0].Rows[i]["Remarks"].ToString();
  6568. if (reworkDs.Tables[0].Rows[i]["UserID"].ToString() != "")
  6569. {
  6570. productionData.SemiCheckUserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["UserID"].ToString());
  6571. productionData.SemiCheckUserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
  6572. }
  6573. if (reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString() != "")
  6574. {
  6575. productionData.GoodsLevelTypeID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString());
  6576. }
  6577. //productionData.UserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
  6578. //productionData.UserName = reworkDs.Tables[0].Rows[i]["UserName"].ToString();
  6579. productionData.SpecialRepairFlag = reworkDs.Tables[0].Rows[i]["SpecialRepairFlag"].ToString();
  6580. productionData.GroutingUserCode = reworkDs.Tables[0].Rows[i]["GroutingUserCode"].ToString();
  6581. productionData.GroutingNum = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GroutingNum"]);
  6582. productionData.IsPublicBody = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["IsPublicBody"]);
  6583. productionData.MouldCode = reworkDs.Tables[0].Rows[i]["MouldCode"].ToString();
  6584. productionData.GroutingDate = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["GroutingDate"]);
  6585. if (reworkDs.Tables[0].Rows[i]["ReworkUserID"].ToString() != "")
  6586. {
  6587. productionData.ReworkUserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkUserID"].ToString());
  6588. productionData.ReworkUserCode = reworkDs.Tables[0].Rows[i]["ReworkUserCode"].ToString();
  6589. }
  6590. productionData.ReSemiCheckUserCode = reworkDs.Tables[0].Rows[i]["ReSemiCheckUserCode"].ToString();
  6591. if (reworkDs.Tables[0].Rows[i]["logoid"].ToString() != "")
  6592. {
  6593. productionData.Logoid = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["Logoid"]);
  6594. productionData.LogoCode = reworkDs.Tables[0].Rows[i]["LogoCode"].ToString();
  6595. productionData.LogoName = reworkDs.Tables[0].Rows[i]["LogoName"].ToString();
  6596. }
  6597. productionData.SemiCheckTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["SemiCheckTime"]);
  6598. if (reworkDs.Tables[0].Rows[i]["ReSemiCheckTime"] != DBNull.Value)
  6599. {
  6600. productionData.ReSemiCheckDateTimeStart = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["ReSemiCheckTime"]);
  6601. }
  6602. DataView dvDefect = reworkDs.Tables[1].DefaultView;
  6603. dvDefect.RowFilter = "SemiCheckID=" + reworkDs.Tables[0].Rows[i]["SemiCheckID"].ToString();
  6604. DataTable dtDefect = dvDefect.ToTable();
  6605. for (int row = 0; row < dtDefect.Rows.Count; row++)
  6606. {
  6607. // 产品缺陷
  6608. SemiCheckDefectEntity defect = new SemiCheckDefectEntity();
  6609. //defect.SpecialDefect = dtDefect.Rows[row]["SpecialDefect"].ToString();
  6610. //defect.DefectDeductionNum = Convert.ToDecimal(dtDefect.Rows[row]["DefectDeductionNum"].ToString());
  6611. //if (dtDefect.Rows[row]["ProductionDefectID"].ToString() != "")
  6612. //{
  6613. // defect.ProductionDefectID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDefectID"].ToString());
  6614. //}
  6615. //defect.BarCode = dtDefect.Rows[row]["BarCode"].ToString();
  6616. if (dtDefect.Rows[row]["DefectID"].ToString() != "")
  6617. {
  6618. defect.DefectID = Convert.ToInt32(dtDefect.Rows[row]["DefectID"].ToString());
  6619. }
  6620. defect.DefectName = dtDefect.Rows[row]["DefectName"].ToString();
  6621. defect.DefectCode = dtDefect.Rows[row]["DefectCode"].ToString();
  6622. if (dtDefect.Rows[row]["DefectPositionID"].ToString() != "")
  6623. {
  6624. defect.DefectPositionID = Convert.ToInt32(dtDefect.Rows[row]["DefectPositionID"].ToString());
  6625. }
  6626. defect.DefectPositionName = dtDefect.Rows[row]["DefectPositionName"].ToString();
  6627. defect.DefectPositionCode = dtDefect.Rows[row]["DefectPositionCode"].ToString();
  6628. if (dtDefect.Rows[row]["DefectProcedureID"].ToString() != "")
  6629. {
  6630. defect.DefectProcedureID = Convert.ToInt32(dtDefect.Rows[row]["DefectProcedureID"].ToString());
  6631. }
  6632. defect.DefectProcedureName = dtDefect.Rows[row]["DefectProcedureName"].ToString();
  6633. defect.DefectProcedureCode = dtDefect.Rows[row]["DefectProcedureCode"].ToString();
  6634. if (dtDefect.Rows[row]["DefectUserID"].ToString() != "")
  6635. {
  6636. defect.DefectUserID = Convert.ToInt32(dtDefect.Rows[row]["DefectUserID"].ToString());
  6637. }
  6638. defect.DefectUserName = dtDefect.Rows[row]["DefectUserName"].ToString();
  6639. defect.DefectUserCode = dtDefect.Rows[row]["DefectUserCode"].ToString();
  6640. //if (dtDefect.Rows[row]["Jobs"].ToString() != "")
  6641. //{
  6642. // defect.Jobs = Convert.ToInt32(dtDefect.Rows[row]["Jobs"].ToString());
  6643. //}
  6644. //if (dtDefect.Rows[row]["MissedUserID"].ToString() != "")
  6645. //{
  6646. // defect.MissedUserID = Convert.ToInt32(dtDefect.Rows[row]["MissedUserID"].ToString());
  6647. //}
  6648. //defect.MissedUserCode = dtDefect.Rows[row]["MissedUserCode"].ToString();
  6649. //defect.MissedUserName = dtDefect.Rows[row]["MissedUserName"].ToString();
  6650. //defect.JobsText = dtDefect.Rows[row]["JobsText"].ToString();
  6651. defect.Remarks = dtDefect.Rows[row]["remarks"].ToString();
  6652. if (dtDefect.Rows[row]["semicheckid"].ToString() != "")
  6653. {
  6654. defect.SemiCheckID = Convert.ToInt32(dtDefect.Rows[row]["semicheckid"].ToString());
  6655. }
  6656. if (dtDefect.Rows[row]["DefectProductionDataID"].ToString() != "")
  6657. {
  6658. defect.DefectProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["DefectProductionDataID"].ToString());
  6659. }
  6660. //if (dtDefect.Rows[row]["DefectFineID"].ToString() != "")
  6661. //{
  6662. // defect.DefectFineID = Convert.ToInt32(dtDefect.Rows[row]["DefectFineID"].ToString());
  6663. //}
  6664. //defect.DefectFineValue = dtDefect.Rows[row]["DefectFineValue"].ToString();
  6665. //--------责任员工-------------------
  6666. DataRow[] drRow = reworkDs.Tables[2].Select("SemiCheckDefectID=" + reworkDs.Tables[1].Rows[row]["SemiCheckDefectID"]);
  6667. if (drRow.Length > Constant.INT_IS_ZERO)
  6668. {
  6669. if (defect.DefectResponsibles == null)
  6670. {
  6671. defect.DefectResponsibles = new List<SemiCheckResponsibleEntity>();
  6672. }
  6673. foreach (DataRow r in drRow)
  6674. {
  6675. SemiCheckResponsibleEntity defectResponsible = new SemiCheckResponsibleEntity();
  6676. if (r["SemiCheckDefectID"].ToString() != "")
  6677. {
  6678. defectResponsible.SemiCheckDefectID = Convert.ToInt32(r["SemiCheckDefectID"]);
  6679. }
  6680. if (r["StaffID"].ToString() != "")
  6681. {
  6682. defectResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
  6683. }
  6684. defectResponsible.StaffCode = r["StaffCode"].ToString();
  6685. defectResponsible.StaffName = r["StaffName"].ToString();
  6686. if (r["StaffStatus"].ToString() != "")
  6687. {
  6688. defectResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
  6689. }
  6690. if (r["UJobsID"].ToString() != "")
  6691. {
  6692. defectResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
  6693. }
  6694. if (r["SJobsID"].ToString() != "")
  6695. {
  6696. defectResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
  6697. }
  6698. defect.DefectResponsibles.Add(defectResponsible);
  6699. }
  6700. }
  6701. //------------------------------
  6702. if (productionData.SemiCheckDefects == null)
  6703. {
  6704. productionData.SemiCheckDefects = new List<SemiCheckDefectEntity>();
  6705. }
  6706. productionData.SemiCheckDefects.Add(defect);
  6707. }
  6708. //if (productionDatas.PDAProductionData == null)
  6709. //{
  6710. // productionDatas.PDAProductionData = new System.Collections.Generic.List<PDAProductionDataResult>();
  6711. //}
  6712. productionDatas[0] = productionData;
  6713. //---------------------------------------------------------------------------------
  6714. }
  6715. }
  6716. }
  6717. actionResult.Result = JsonHelper.ToJson(productionDatas);
  6718. actionResult.Status = (int)Constant.PDAResult.Success;
  6719. }
  6720. catch (Exception ex)
  6721. {
  6722. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6723. OutputLog.TraceLog(LogPriority.Error,
  6724. this.ToString(),
  6725. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6726. ex.ToString(),
  6727. LocalPath.LogExePath);
  6728. actionResult.Status = (int)Constant.PDAResult.Exception;
  6729. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6730. }
  6731. return actionResult;
  6732. }
  6733. /// <summary>
  6734. /// 保存半检登记
  6735. /// </summary>
  6736. /// <param name="accountCode">帐套code</param>
  6737. /// <param name="userCode">用户code</param>
  6738. /// <param name="userPassword">用户密码</param>
  6739. /// <param name="sessionKey">本次登陆密钥</param>
  6740. /// <param name="entity">半检实体类</param>
  6741. /// <param name="sUserInfo">用户基本信息</param>
  6742. /// <returns></returns>
  6743. public ActionResult AddSemiCheck(string accountCode, string userCode, string userPassword, string sessionKey, SemiCheckEntity[] entityobj)
  6744. {
  6745. ActionResult actionResult = new ActionResult();
  6746. try
  6747. {
  6748. // 验证请求头信息
  6749. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6750. // 验证失败
  6751. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6752. {
  6753. return actionResult;
  6754. }
  6755. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6756. () => PMModuleLogicDAL.AddSemiCheck(entityobj, sUserInfo));
  6757. string err = string.Empty;
  6758. err = resultEntity.Message;
  6759. if (err == null)
  6760. {
  6761. err = "";
  6762. }
  6763. SemiCheckEntity entity = entityobj[0];
  6764. if (entity.SemiCheckCategory == 1) // 半检登记
  6765. {
  6766. }
  6767. else if (entity.SemiCheckCategory == 2)// 复检登记
  6768. {
  6769. err = JsonHelper.ToJson(err);
  6770. }
  6771. else if (entity.SemiCheckCategory == 3)// 撤销复检
  6772. {
  6773. err = JsonHelper.ToJson(err);
  6774. }
  6775. //actionResult.Result = JsonHelper.ToJson(err);
  6776. actionResult.Result = err;//JsonHelper.ToJson(err);
  6777. actionResult.Status = (int)Constant.PDAResult.Success;
  6778. }
  6779. catch (Exception ex)
  6780. {
  6781. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6782. OutputLog.TraceLog(LogPriority.Error,
  6783. this.ToString(),
  6784. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6785. ex.ToString(),
  6786. LocalPath.LogExePath);
  6787. actionResult.Status = (int)Constant.PDAResult.Exception;
  6788. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6789. }
  6790. return actionResult;
  6791. }
  6792. /// <summary>
  6793. /// 根据所选工号,查出缺陷责任员工
  6794. /// </summary>
  6795. /// <param name="sUserInfo"></param>
  6796. /// <returns></returns>
  6797. public ActionResult GetSemiCheckDefectStaffByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int userid)
  6798. {
  6799. ActionResult actionResult = new ActionResult();
  6800. try
  6801. {
  6802. // 验证请求头信息
  6803. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6804. // 验证失败
  6805. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6806. {
  6807. return actionResult;
  6808. }
  6809. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6810. () => PMModuleLogic.GetSemiCheckDefectStaffByUserID(sUserInfo, userid));
  6811. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6812. actionResult.Status = (int)Constant.PDAResult.Success;
  6813. }
  6814. catch (Exception ex)
  6815. {
  6816. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6817. OutputLog.TraceLog(LogPriority.Error,
  6818. this.ToString(),
  6819. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6820. ex.ToString(),
  6821. LocalPath.LogExePath);
  6822. actionResult.Status = (int)Constant.PDAResult.Exception;
  6823. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6824. }
  6825. return actionResult;
  6826. }
  6827. /// <summary>
  6828. /// 获取半成品缺陷管理的全部数据
  6829. /// </summary>
  6830. /// <param name="sUserInfo"></param>
  6831. /// <returns></returns>
  6832. public ActionResult GetAllSemicheckDefect(string accountCode, string userCode, string userPassword, string sessionKey)
  6833. {
  6834. ActionResult actionResult = new ActionResult();
  6835. try
  6836. {
  6837. // 验证请求头信息
  6838. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6839. // 验证失败
  6840. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6841. {
  6842. return actionResult;
  6843. }
  6844. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6845. () => SystemModuleLogic.GetAllSemicheckDefect(sUserInfo));
  6846. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6847. actionResult.Status = (int)Constant.PDAResult.Success;
  6848. }
  6849. catch (Exception ex)
  6850. {
  6851. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6852. OutputLog.TraceLog(LogPriority.Error,
  6853. this.ToString(),
  6854. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6855. ex.ToString(),
  6856. LocalPath.LogExePath);
  6857. actionResult.Status = (int)Constant.PDAResult.Exception;
  6858. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6859. }
  6860. return actionResult;
  6861. }
  6862. /// <summary>
  6863. /// 获取半成品缺陷位置管理的全部数据
  6864. /// </summary>
  6865. /// <param name="sUserInfo"></param>
  6866. /// <returns></returns>
  6867. public ActionResult GetAllScdefectPosition(string accountCode, string userCode, string userPassword, string sessionKey)
  6868. {
  6869. ActionResult actionResult = new ActionResult();
  6870. try
  6871. {
  6872. // 验证请求头信息
  6873. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6874. // 验证失败
  6875. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6876. {
  6877. return actionResult;
  6878. }
  6879. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6880. () => SystemModuleLogic.GetAllScdefectPosition(sUserInfo));
  6881. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6882. actionResult.Status = (int)Constant.PDAResult.Success;
  6883. }
  6884. catch (Exception ex)
  6885. {
  6886. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6887. OutputLog.TraceLog(LogPriority.Error,
  6888. this.ToString(),
  6889. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6890. ex.ToString(),
  6891. LocalPath.LogExePath);
  6892. actionResult.Status = (int)Constant.PDAResult.Exception;
  6893. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6894. }
  6895. return actionResult;
  6896. }
  6897. /// <summary>
  6898. /// 复检验条码
  6899. /// </summary>
  6900. /// <param name="sUserInfo"></param>
  6901. /// <returns></returns>
  6902. public ActionResult ReSemiCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6903. {
  6904. ActionResult actionResult = new ActionResult();
  6905. try
  6906. {
  6907. // 验证请求头信息
  6908. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6909. // 验证失败
  6910. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6911. {
  6912. return actionResult;
  6913. }
  6914. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6915. () => PMModuleLogic.ReSemiCheckBarcode(barcode, sUserInfo));
  6916. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6917. if (Convert.ToInt32(resultEntity.Result) < 0)
  6918. {
  6919. actionResult.Status = (int)Constant.PDAResult.Fail;
  6920. }
  6921. else
  6922. {
  6923. actionResult.Status = (int)Constant.PDAResult.Success;
  6924. }
  6925. actionResult.Message = resultEntity.Message;
  6926. }
  6927. catch (Exception ex)
  6928. {
  6929. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6930. OutputLog.TraceLog(LogPriority.Error,
  6931. this.ToString(),
  6932. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6933. ex.ToString(),
  6934. LocalPath.LogExePath);
  6935. actionResult.Status = (int)Constant.PDAResult.Exception;
  6936. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6937. }
  6938. return actionResult;
  6939. }
  6940. /// <summary>
  6941. /// 撤销复检验条码
  6942. /// </summary>
  6943. /// <param name="sUserInfo"></param>
  6944. /// <returns></returns>
  6945. public ActionResult CancelSemiCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6946. {
  6947. ActionResult actionResult = new ActionResult();
  6948. try
  6949. {
  6950. // 验证请求头信息
  6951. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6952. // 验证失败
  6953. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6954. {
  6955. return actionResult;
  6956. }
  6957. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6958. () => PMModuleLogic.CancelSemiCheckBarcode(barcode, sUserInfo));
  6959. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6960. if (Convert.ToInt32(resultEntity.Result) < 0)
  6961. {
  6962. actionResult.Status = (int)Constant.PDAResult.Fail;
  6963. }
  6964. else
  6965. {
  6966. actionResult.Status = (int)Constant.PDAResult.Success;
  6967. }
  6968. actionResult.Message = resultEntity.Message;
  6969. }
  6970. catch (Exception ex)
  6971. {
  6972. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6973. OutputLog.TraceLog(LogPriority.Error,
  6974. this.ToString(),
  6975. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6976. ex.ToString(),
  6977. LocalPath.LogExePath);
  6978. actionResult.Status = (int)Constant.PDAResult.Exception;
  6979. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6980. }
  6981. return actionResult;
  6982. }
  6983. /// <summary>
  6984. /// 恢复数据
  6985. /// </summary>
  6986. /// <param name="sUserInfo"></param>
  6987. /// <returns></returns>
  6988. public ActionResult ResetBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6989. {
  6990. ActionResult actionResult = new ActionResult();
  6991. try
  6992. {
  6993. // 验证请求头信息
  6994. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6995. // 验证失败
  6996. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6997. {
  6998. return actionResult;
  6999. }
  7000. int resultEntity = ServiceInvoker.Invoke<int>(this,
  7001. () => PMModuleLogicDAL.ResetBarCode(barcode));
  7002. if (resultEntity > 0)
  7003. {
  7004. actionResult.Status = (int)Constant.PDAResult.Success;
  7005. actionResult.Message = "恢复数据成功";
  7006. }
  7007. else
  7008. {
  7009. actionResult.Status = (int)Constant.PDAResult.Fail;
  7010. if (resultEntity == -1)
  7011. {
  7012. actionResult.Message = "此条码没有清除,不能恢复";
  7013. }
  7014. else if (resultEntity == 0)
  7015. {
  7016. actionResult.Message = "没有可恢复的数据";
  7017. }
  7018. }
  7019. }
  7020. catch (Exception ex)
  7021. {
  7022. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7023. OutputLog.TraceLog(LogPriority.Error,
  7024. this.ToString(),
  7025. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7026. ex.ToString(),
  7027. LocalPath.LogExePath);
  7028. actionResult.Status = (int)Constant.PDAResult.Exception;
  7029. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7030. }
  7031. return actionResult;
  7032. }
  7033. /// <summary>
  7034. /// 通过SettingCode获取系统参数管理的数据
  7035. /// </summary>
  7036. /// <param name="accountCode"></param>
  7037. /// <param name="userCode"></param>
  7038. /// <param name="userPassword"></param>
  7039. /// <param name="sessionKey"></param>
  7040. /// <param name="settingcode">设置编码</param>
  7041. /// <returns></returns>
  7042. public ActionResult GetSystemSettingDataByCode(string accountCode, string userCode, string userPassword, string sessionKey, string settingcode)
  7043. {
  7044. ActionResult actionResult = new ActionResult();
  7045. try
  7046. {
  7047. // 验证请求头信息
  7048. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7049. // 验证失败
  7050. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7051. {
  7052. return actionResult;
  7053. }
  7054. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  7055. () => SystemModuleLogic.GetSystemSettingDataByCode(settingcode, sUserInfo));
  7056. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7057. actionResult.Status = (int)Constant.PDAResult.Success;
  7058. }
  7059. catch (Exception ex)
  7060. {
  7061. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7062. OutputLog.TraceLog(LogPriority.Error,
  7063. this.ToString(),
  7064. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7065. ex.ToString(),
  7066. LocalPath.LogExePath);
  7067. actionResult.Status = (int)Constant.PDAResult.Exception;
  7068. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7069. }
  7070. return actionResult;
  7071. }
  7072. /// <summary>
  7073. /// 校验条码是否允许撤销,如果不允许提示错误消息
  7074. /// </summary>
  7075. /// <param name="accountCode"></param>
  7076. /// <param name="userCode"></param>
  7077. /// <param name="userPassword"></param>
  7078. /// <param name="sessionKey"></param>
  7079. /// <param name="orgTime">原时间</param>
  7080. /// <param name="days">允许撤销天数</param>
  7081. /// <param name="settingCode">设置code,用于返回不同错误消息</param>
  7082. /// <returns></returns>
  7083. public ActionResult BarcodeAllowCancel(string accountCode, string userCode, string userPassword, string sessionKey, string orgTime, int days, string settingCode)
  7084. {
  7085. ActionResult actionResult = new ActionResult();
  7086. try
  7087. {
  7088. // 验证请求头信息
  7089. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7090. // 验证失败
  7091. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7092. {
  7093. return actionResult;
  7094. }
  7095. string[] subOrgTime = orgTime.Split('-');
  7096. DateTime newOrgTime = new DateTime(Convert.ToInt32(subOrgTime[0]), Convert.ToInt32(subOrgTime[1]), Convert.ToInt32(subOrgTime[2]));
  7097. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7098. () => PMModuleLogic.BarcodeAllowCancel(newOrgTime, days, settingCode, sUserInfo));
  7099. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7100. if (Convert.ToInt32(resultEntity.Result) < 0)
  7101. {
  7102. actionResult.Status = (int)Constant.PDAResult.Fail;
  7103. }
  7104. else
  7105. {
  7106. actionResult.Status = (int)Constant.PDAResult.Success;
  7107. }
  7108. actionResult.Message = resultEntity.Message;
  7109. }
  7110. catch (Exception ex)
  7111. {
  7112. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7113. OutputLog.TraceLog(LogPriority.Error,
  7114. this.ToString(),
  7115. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7116. ex.ToString(),
  7117. LocalPath.LogExePath);
  7118. actionResult.Status = (int)Constant.PDAResult.Exception;
  7119. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7120. }
  7121. return actionResult;
  7122. }
  7123. /// <summary>
  7124. /// 获取生产订单管理的全部数据
  7125. /// </summary>
  7126. /// <param name="sUserInfo"></param>
  7127. /// <returns></returns>
  7128. public ActionResult GetOrderList(string accountCode, string userCode, string userPassword, string sessionKey, OrderEntity order)
  7129. {
  7130. ActionResult actionResult = new ActionResult();
  7131. try
  7132. {
  7133. // 验证请求头信息
  7134. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7135. // 验证失败
  7136. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7137. {
  7138. return actionResult;
  7139. }
  7140. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  7141. () => PMModuleLogic.GetOrderList(order, sUserInfo));
  7142. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7143. actionResult.Status = (int)Constant.PDAResult.Success;
  7144. }
  7145. catch (Exception ex)
  7146. {
  7147. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7148. OutputLog.TraceLog(LogPriority.Error,
  7149. this.ToString(),
  7150. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7151. ex.ToString(),
  7152. LocalPath.LogExePath);
  7153. actionResult.Status = (int)Constant.PDAResult.Exception;
  7154. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7155. }
  7156. return actionResult;
  7157. }
  7158. public ActionResult FinishedHandoverBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7159. {
  7160. ActionResult actionResult = new ActionResult();
  7161. try
  7162. {
  7163. // 验证请求头信息
  7164. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7165. // 验证失败
  7166. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7167. {
  7168. return actionResult;
  7169. }
  7170. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7171. () => PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo));
  7172. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7173. if (Convert.ToInt32(resultEntity.Result) < 0)
  7174. {
  7175. actionResult.Status = (int)Constant.PDAResult.Fail;
  7176. actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
  7177. }
  7178. else
  7179. {
  7180. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  7181. actionResult.Status = (int)Constant.PDAResult.Success;
  7182. }
  7183. actionResult.Message = resultEntity.Message;
  7184. }
  7185. catch (Exception ex)
  7186. {
  7187. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7188. OutputLog.TraceLog(LogPriority.Error,
  7189. this.ToString(),
  7190. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7191. ex.ToString(),
  7192. LocalPath.LogExePath);
  7193. actionResult.Status = (int)Constant.PDAResult.Exception;
  7194. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7195. }
  7196. return actionResult;
  7197. }
  7198. public ActionResult GetSystemData(string accountCode, string userCode, string userPassword, string sessionKey)
  7199. {
  7200. ActionResult actionResult = new ActionResult();
  7201. try
  7202. {
  7203. // 验证请求头信息
  7204. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7205. // 验证失败
  7206. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7207. {
  7208. return actionResult;
  7209. }
  7210. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  7211. () => SystemModuleLogic.GetSystemData(sUserInfo));
  7212. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7213. actionResult.Status = (int)Constant.PDAResult.Success;
  7214. }
  7215. catch (Exception ex)
  7216. {
  7217. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7218. OutputLog.TraceLog(LogPriority.Error,
  7219. this.ToString(),
  7220. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7221. ex.ToString(),
  7222. LocalPath.LogExePath);
  7223. actionResult.Status = (int)Constant.PDAResult.Exception;
  7224. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7225. }
  7226. return actionResult;
  7227. }
  7228. public ActionResult SaveFinishedHandover(string accountCode, string userCode, string userPassword, string sessionKey, int orderid, OrderEntity[] orderEntity)
  7229. {
  7230. ActionResult actionResult = new ActionResult();
  7231. try
  7232. {
  7233. // 验证请求头信息
  7234. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7235. // 验证失败
  7236. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7237. {
  7238. return actionResult;
  7239. }
  7240. DataTable dtOrderData = DataConvert.ObjectConvertToTable<OrderEntity>(orderEntity);
  7241. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7242. () => PMModuleLogicDAL.SaveFinishedHandover(orderid, dtOrderData, sUserInfo));
  7243. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7244. if (Convert.ToInt32(resultEntity.Result) < 0)
  7245. {
  7246. actionResult.Status = (int)Constant.PDAResult.Fail;
  7247. }
  7248. else
  7249. {
  7250. actionResult.Status = (int)Constant.PDAResult.Success;
  7251. }
  7252. actionResult.Message = resultEntity.Message;
  7253. }
  7254. catch (Exception ex)
  7255. {
  7256. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7257. OutputLog.TraceLog(LogPriority.Error,
  7258. this.ToString(),
  7259. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7260. ex.ToString(),
  7261. LocalPath.LogExePath);
  7262. actionResult.Status = (int)Constant.PDAResult.Exception;
  7263. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7264. }
  7265. return actionResult;
  7266. }
  7267. public ActionResult CancelFinishedHandoverBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7268. {
  7269. ActionResult actionResult = new ActionResult();
  7270. try
  7271. {
  7272. // 验证请求头信息
  7273. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7274. // 验证失败
  7275. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7276. {
  7277. return actionResult;
  7278. }
  7279. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7280. () => PMModuleLogic.CancelFinishedHandoverBarcode(barcode, sUserInfo));
  7281. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7282. if (Convert.ToInt32(resultEntity.Result) < 0)
  7283. {
  7284. actionResult.Status = (int)Constant.PDAResult.Fail;
  7285. }
  7286. else
  7287. {
  7288. actionResult.Result = JsonHelper.ToJson(resultEntity.Data.Tables[0]);
  7289. actionResult.Status = (int)Constant.PDAResult.Success;
  7290. }
  7291. actionResult.Message = resultEntity.Message;
  7292. }
  7293. catch (Exception ex)
  7294. {
  7295. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7296. OutputLog.TraceLog(LogPriority.Error,
  7297. this.ToString(),
  7298. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7299. ex.ToString(),
  7300. LocalPath.LogExePath);
  7301. actionResult.Status = (int)Constant.PDAResult.Exception;
  7302. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7303. }
  7304. return actionResult;
  7305. }
  7306. public ActionResult SaveCancelFinishedHandoverByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7307. {
  7308. ActionResult actionResult = new ActionResult();
  7309. try
  7310. {
  7311. // 验证请求头信息
  7312. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7313. // 验证失败
  7314. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7315. {
  7316. return actionResult;
  7317. }
  7318. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7319. () => PMModuleLogicDAL.SaveCancelFinishedHandoverByBarcode(barcode, sUserInfo));
  7320. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7321. if (Convert.ToInt32(resultEntity.Result) < 0)
  7322. {
  7323. actionResult.Status = (int)Constant.PDAResult.Fail;
  7324. }
  7325. else
  7326. {
  7327. actionResult.Status = (int)Constant.PDAResult.Success;
  7328. }
  7329. actionResult.Message = resultEntity.Message;
  7330. }
  7331. catch (Exception ex)
  7332. {
  7333. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7334. OutputLog.TraceLog(LogPriority.Error,
  7335. this.ToString(),
  7336. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7337. ex.ToString(),
  7338. LocalPath.LogExePath);
  7339. actionResult.Status = (int)Constant.PDAResult.Exception;
  7340. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7341. }
  7342. return actionResult;
  7343. }
  7344. public ActionResult SaveChangeFinishedHandoverByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int orderid)
  7345. {
  7346. ActionResult actionResult = new ActionResult();
  7347. try
  7348. {
  7349. // 验证请求头信息
  7350. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7351. // 验证失败
  7352. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7353. {
  7354. return actionResult;
  7355. }
  7356. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7357. () => PMModuleLogicDAL.SaveChangeFinishedHandoverByBarcode(barcode, orderid, sUserInfo));
  7358. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7359. if (Convert.ToInt32(resultEntity.Result) < 0)
  7360. {
  7361. actionResult.Status = (int)Constant.PDAResult.Fail;
  7362. }
  7363. else
  7364. {
  7365. actionResult.Status = (int)Constant.PDAResult.Success;
  7366. }
  7367. actionResult.Message = resultEntity.Message;
  7368. }
  7369. catch (Exception ex)
  7370. {
  7371. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7372. OutputLog.TraceLog(LogPriority.Error,
  7373. this.ToString(),
  7374. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7375. ex.ToString(),
  7376. LocalPath.LogExePath);
  7377. actionResult.Status = (int)Constant.PDAResult.Exception;
  7378. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7379. }
  7380. return actionResult;
  7381. }
  7382. #region PDA条码打印
  7383. /// <summary>
  7384. /// 获取条码打印机
  7385. /// </summary>
  7386. /// <param name="accountCode"></param>
  7387. /// <param name="userCode"></param>
  7388. /// <param name="userPassword"></param>
  7389. /// <param name="sessionKey"></param>
  7390. /// <returns></returns>
  7391. public ActionResult GetBarcodePrinter(string accountCode, string userCode, string userPassword, string sessionKey, int printType=0)
  7392. {
  7393. ActionResult actionResult = new ActionResult();
  7394. try
  7395. {
  7396. // 验证请求头信息
  7397. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7398. // 验证失败
  7399. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7400. {
  7401. return actionResult;
  7402. }
  7403. DataSet resultEntity = BarcodePrintLogic.GetBarcodePrinter(sUserInfo, printType);
  7404. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7405. actionResult.Status = (int)Constant.PDAResult.Success;
  7406. }
  7407. catch (Exception ex)
  7408. {
  7409. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7410. OutputLog.TraceLog(LogPriority.Error,
  7411. this.ToString(),
  7412. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7413. ex.ToString(),
  7414. LocalPath.LogExePath);
  7415. actionResult.Status = (int)Constant.PDAResult.Exception;
  7416. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7417. }
  7418. return actionResult;
  7419. }
  7420. /// <summary>
  7421. /// 打印条码样式(补打)
  7422. /// </summary>
  7423. /// <param name="accountCode"></param>
  7424. /// <param name="userCode"></param>
  7425. /// <param name="userPassword"></param>
  7426. /// <param name="sessionKey"></param>
  7427. /// <returns></returns>
  7428. public ActionResult PrintBarcodeLayout(string accountCode, string userCode, string userPassword, string sessionKey,
  7429. string barcode, int copies, int printerID, int printWay=2)
  7430. {
  7431. ActionResult actionResult = new ActionResult();
  7432. try
  7433. {
  7434. // 验证请求头信息
  7435. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7436. // 验证失败
  7437. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7438. {
  7439. return actionResult;
  7440. }
  7441. //ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode(barcode,
  7442. // copies, printerID, sUserInfo);
  7443. ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode_3C(barcode,
  7444. copies, printerID, sUserInfo, printWay);
  7445. if (sre.Status != Constant.ServiceResultStatus.Success)
  7446. {
  7447. actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  7448. actionResult.Message = sre.Message;
  7449. return actionResult;
  7450. }
  7451. actionResult.Result = JsonHelper.ToJson(sre.Result as DataTable);
  7452. actionResult.Status = (int)Constant.PDAResult.Success;
  7453. }
  7454. catch (Exception ex)
  7455. {
  7456. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7457. OutputLog.TraceLog(LogPriority.Error,
  7458. this.ToString(),
  7459. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7460. ex.ToString(),
  7461. LocalPath.LogExePath);
  7462. actionResult.Status = (int)Constant.PDAResult.Exception;
  7463. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7464. }
  7465. return actionResult;
  7466. }
  7467. #endregion PDA条码打印
  7468. #region 统计报表
  7469. /// <summary>
  7470. /// 成型结算报表
  7471. /// </summary>
  7472. /// <param name="accountCode"></param>
  7473. /// <param name="userCode"></param>
  7474. /// <param name="userPassword"></param>
  7475. /// <param name="sessionKey"></param>
  7476. /// <returns></returns>
  7477. public ActionResult GetGroutingSettlementInfo(string accountCode, string userCode, string userPassword, string sessionKey,
  7478. int currentMonth)
  7479. {
  7480. ActionResult actionResult = new ActionResult();
  7481. try
  7482. {
  7483. // 验证请求头信息
  7484. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7485. // 验证失败
  7486. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7487. {
  7488. return actionResult;
  7489. }
  7490. DateTime date = DateTime.Now;
  7491. if (currentMonth != 1)
  7492. {
  7493. date = date.AddMonths(-1);
  7494. }
  7495. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7496. () => PublicModuleLogic.GetFP00002Data(sUserInfo.AccountID, userCode, date));
  7497. if (resultEntity == null || resultEntity.Data == null)
  7498. {
  7499. actionResult.Status = (int)Constant.PDAResult.Fail;
  7500. actionResult.Message = "查询失败";
  7501. return actionResult;
  7502. }
  7503. if (resultEntity.Status == Constant.ServiceResultStatus.Other)
  7504. {
  7505. actionResult.Status = (int)Constant.PDAResult.Fail;
  7506. actionResult.Message = resultEntity.Message;
  7507. return actionResult;
  7508. }
  7509. actionResult.Result = JsonHelper.ToJson(resultEntity.Data.Tables["DataM"]);
  7510. actionResult.Status = (int)Constant.PDAResult.Success;
  7511. }
  7512. catch (Exception ex)
  7513. {
  7514. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7515. OutputLog.TraceLog(LogPriority.Error,
  7516. this.ToString(),
  7517. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7518. ex.ToString(),
  7519. LocalPath.LogExePath);
  7520. actionResult.Status = (int)Constant.PDAResult.Exception;
  7521. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7522. }
  7523. return actionResult;
  7524. }
  7525. #endregion
  7526. #region 设置当期用户默认打印机配置
  7527. /// <summary>
  7528. /// 设置当期用户默认打印机配置
  7529. /// </summary>
  7530. /// <param name="accountCode"></param>
  7531. /// <param name="userCode"></param>
  7532. /// <param name="userPassword"></param>
  7533. /// <param name="sessionKey"></param>
  7534. /// <param name="printerID"></param>
  7535. /// <returns></returns>
  7536. public ActionResult SetCurrentUserPrinter(string accountCode, string userCode, string userPassword, string sessionKey,
  7537. int printerID)
  7538. {
  7539. ActionResult actionResult = new ActionResult();
  7540. try
  7541. {
  7542. // 验证请求头信息
  7543. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7544. // 验证失败
  7545. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7546. {
  7547. return actionResult;
  7548. }
  7549. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7550. () => BarcodePrintLogic.SetCurrentUserPrinter(printerID, sUserInfo));
  7551. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7552. if (resultEntity.Status == Constant.ServiceResultStatus.Other || Convert.ToInt32(resultEntity.Result) < 0)
  7553. {
  7554. actionResult.Status = (int)Constant.PDAResult.Fail;
  7555. }
  7556. else
  7557. {
  7558. actionResult.Status = (int)Constant.PDAResult.Success;
  7559. }
  7560. actionResult.Message = resultEntity.Message;
  7561. }
  7562. catch (Exception ex)
  7563. {
  7564. OutputLog.TraceLog(LogPriority.Error,
  7565. this.ToString(),
  7566. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7567. ex.ToString(),
  7568. LocalPath.LogExePath);
  7569. actionResult.Status = (int)Constant.PDAResult.Exception;
  7570. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7571. }
  7572. return actionResult;
  7573. }
  7574. /// <summary>
  7575. /// 校验产品条码是否可以进行回收
  7576. /// </summary>
  7577. /// <param name="accountCode">帐套code</param>
  7578. /// <param name="userCode">用户code</param>
  7579. /// <param name="userPassword">用户密码</param>
  7580. /// <param name="sessionKey">本次登陆密钥</param>
  7581. /// <param name="procedureID">工序ID</param>
  7582. /// <param name="barcode">条码</param>
  7583. /// <returns></returns>
  7584. /// <remarks>
  7585. /// 王鑫 2017.7.21 新建
  7586. /// </remarks>
  7587. public ActionResult CheckRecydingFlagBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  7588. {
  7589. ActionResult actionResult = new ActionResult();
  7590. try
  7591. {
  7592. // 验证请求头信息
  7593. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7594. // 验证失败
  7595. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7596. {
  7597. return actionResult;
  7598. }
  7599. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  7600. () => PMModuleLogic.CheckRecydingFlagBarcode(procedureID, barcode, sUserInfo));
  7601. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  7602. {
  7603. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  7604. actionResult.Status = (int)Constant.PDAResult.Success;
  7605. }
  7606. else
  7607. {
  7608. actionResult.Status = (int)Constant.PDAResult.Fail;
  7609. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  7610. }
  7611. }
  7612. catch (Exception ex)
  7613. {
  7614. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7615. OutputLog.TraceLog(LogPriority.Error,
  7616. this.ToString(),
  7617. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7618. ex.ToString(),
  7619. LocalPath.LogExePath);
  7620. actionResult.Status = (int)Constant.PDAResult.Exception;
  7621. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7622. }
  7623. return actionResult;
  7624. }
  7625. /// <summary>
  7626. /// 获取回收标识
  7627. /// </summary>
  7628. /// <param name="accountCode"></param>
  7629. /// <param name="userCode"></param>
  7630. /// <param name="userPassword"></param>
  7631. /// <param name="sessionKey"></param>
  7632. /// <param name="usercode">工号编码</param>
  7633. /// <returns></returns>
  7634. public ActionResult GetRecyclingflagByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7635. {
  7636. ActionResult actionResult = new ActionResult();
  7637. try
  7638. {
  7639. // 验证请求头信息
  7640. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7641. // 验证失败
  7642. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7643. {
  7644. return actionResult;
  7645. }
  7646. int returnValue = ServiceInvoker.Invoke<int>(this,
  7647. () => PMModuleLogic.GetRecyclingflagByBarcode(barcode, sUserInfo));
  7648. actionResult.Result = JsonHelper.ToJson(returnValue);
  7649. actionResult.Status = (int)Constant.PDAResult.Success;
  7650. }
  7651. catch (Exception ex)
  7652. {
  7653. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7654. OutputLog.TraceLog(LogPriority.Error,
  7655. this.ToString(),
  7656. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7657. ex.ToString(),
  7658. LocalPath.LogExePath);
  7659. actionResult.Status = (int)Constant.PDAResult.Exception;
  7660. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7661. }
  7662. return actionResult;
  7663. }
  7664. #endregion
  7665. #region 注浆盘点
  7666. /// <summary>
  7667. /// 获取注浆盘点单列表
  7668. /// </summary>
  7669. /// <param name="sUserInfo"></param>
  7670. /// <returns></returns>
  7671. public ActionResult GetAllGBChecked(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity)
  7672. {
  7673. ActionResult actionResult = new ActionResult();
  7674. try
  7675. {
  7676. // 验证请求头信息
  7677. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7678. // 验证失败
  7679. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7680. {
  7681. return actionResult;
  7682. }
  7683. entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA);
  7684. entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1);
  7685. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  7686. () => PDAModuleLogic.GetAllGBChecked(entity, sUserInfo));
  7687. actionResult.Result = JsonHelper.ToJson(ds);
  7688. actionResult.Status = (int)Constant.PDAResult.Success;
  7689. }
  7690. catch (Exception ex)
  7691. {
  7692. string json = JsonHelper.ToJson(entity);
  7693. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7694. OutputLog.TraceLog(LogPriority.Error,
  7695. this.ToString(),
  7696. System.Reflection.MethodBase.GetCurrentMethod().Name + "\r\n" + json,
  7697. ex.ToString(),
  7698. LocalPath.LogExePath);
  7699. actionResult.Status = (int)Constant.PDAResult.Exception;
  7700. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7701. }
  7702. return actionResult;
  7703. }
  7704. /// <summary>
  7705. /// 进行盘点操作
  7706. /// </summary>
  7707. /// <param name="accountCode"></param>
  7708. /// <param name="userCode"></param>
  7709. /// <param name="userPassword"></param>
  7710. /// <param name="sessionKey"></param>
  7711. /// <param name="InCheckedID">盘点单ID</param>
  7712. /// <param name="BarCode">产品条码</param>
  7713. /// <returns></returns>
  7714. public ActionResult UpdateGBChecked(string accountCode, string userCode, string userPassword, string sessionKey, int CheckedID, string BarCode)
  7715. {
  7716. ActionResult actionResult = new ActionResult();
  7717. try
  7718. {
  7719. // 验证请求头信息
  7720. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7721. // 验证失败
  7722. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7723. {
  7724. return actionResult;
  7725. }
  7726. ClientRequestEntity cre = new ClientRequestEntity();
  7727. cre.Properties["CheckedID"] = CheckedID;
  7728. cre.Properties["Barcode"] = BarCode;
  7729. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7730. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.UpdateGBChecked(sUserInfo, cre));
  7731. if (returnValue.Status == Constant.ServiceResultStatus.Success)
  7732. {
  7733. //actionResult.Result = JsonHelper.ToJson(returnValue);
  7734. actionResult.Status = (int)Constant.PDAResult.Success;
  7735. actionResult.Message = "产品【" + BarCode + "】盘点成功";
  7736. }
  7737. else
  7738. {
  7739. //actionResult.Result = JsonHelper.ToJson(returnValue);
  7740. actionResult.Status = (int)Constant.PDAResult.Fail;
  7741. actionResult.Message = returnValue.Message;
  7742. }
  7743. }
  7744. catch (Exception ex)
  7745. {
  7746. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7747. OutputLog.TraceLog(LogPriority.Error,
  7748. this.ToString(),
  7749. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7750. ex.ToString(),
  7751. LocalPath.LogExePath);
  7752. actionResult.Status = (int)Constant.PDAResult.Exception;
  7753. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7754. }
  7755. return actionResult;
  7756. }
  7757. /// <summary>
  7758. /// 获取盘点单明细
  7759. /// </summary>
  7760. /// <param name="sUserInfo"></param>
  7761. /// <returns></returns>
  7762. public ActionResult GetUpdateGBCheckedInfo(string accountCode, string userCode, string userPassword, string sessionKey, int checkedID)
  7763. {
  7764. ActionResult actionResult = new ActionResult();
  7765. try
  7766. {
  7767. // 验证请求头信息
  7768. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7769. // 验证失败
  7770. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7771. {
  7772. return actionResult;
  7773. }
  7774. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  7775. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.
  7776. GetUpdateGBCheckedInfo(checkedID, sUserInfo));
  7777. actionResult.Result = JsonHelper.ToJson(ds);
  7778. actionResult.Status = (int)Constant.PDAResult.Success;
  7779. }
  7780. catch (Exception ex)
  7781. {
  7782. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7783. OutputLog.TraceLog(LogPriority.Error,
  7784. this.ToString(),
  7785. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7786. ex.ToString(),
  7787. LocalPath.LogExePath);
  7788. actionResult.Status = (int)Constant.PDAResult.Exception;
  7789. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7790. }
  7791. return actionResult;
  7792. }
  7793. #endregion
  7794. #region 模具盘点
  7795. /// <summary>
  7796. /// 获取模具盘点单列表
  7797. /// </summary>
  7798. /// <param name="sUserInfo"></param>
  7799. /// <returns></returns>
  7800. public ActionResult GetAllMouldChecked(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity)
  7801. {
  7802. ActionResult actionResult = new ActionResult();
  7803. try
  7804. {
  7805. // 验证请求头信息
  7806. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7807. // 验证失败
  7808. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7809. {
  7810. return actionResult;
  7811. }
  7812. entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA);
  7813. entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1);
  7814. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  7815. () => PDAModuleLogic.GetAllMouldChecked(entity, sUserInfo));
  7816. actionResult.Result = JsonHelper.ToJson(ds);
  7817. actionResult.Status = (int)Constant.PDAResult.Success;
  7818. }
  7819. catch (Exception ex)
  7820. {
  7821. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7822. OutputLog.TraceLog(LogPriority.Error,
  7823. this.ToString(),
  7824. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7825. ex.ToString(),
  7826. LocalPath.LogExePath);
  7827. actionResult.Status = (int)Constant.PDAResult.Exception;
  7828. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7829. }
  7830. return actionResult;
  7831. }
  7832. /// <summary>
  7833. /// 进行盘点操作
  7834. /// </summary>
  7835. /// <param name="accountCode"></param>
  7836. /// <param name="userCode"></param>
  7837. /// <param name="userPassword"></param>
  7838. /// <param name="sessionKey"></param>
  7839. /// <param name="InCheckedID">盘点单ID</param>
  7840. /// <param name="BarCode">产品条码</param>
  7841. /// <returns></returns>
  7842. public ActionResult UpdateMouldChecked(string accountCode, string userCode, string userPassword, string sessionKey, int CheckedID, string BarCode)
  7843. {
  7844. ActionResult actionResult = new ActionResult();
  7845. try
  7846. {
  7847. // 验证请求头信息
  7848. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7849. // 验证失败
  7850. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7851. {
  7852. return actionResult;
  7853. }
  7854. ClientRequestEntity cre = new ClientRequestEntity();
  7855. cre.Properties["CheckedID"] = CheckedID;
  7856. cre.Properties["Barcode"] = BarCode;
  7857. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7858. () => Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.UpdateMouldChecked(sUserInfo, cre));
  7859. if (returnValue.Status == Constant.ServiceResultStatus.Success)
  7860. {
  7861. //actionResult.Result = JsonHelper.ToJson(returnValue);
  7862. actionResult.Status = (int)Constant.PDAResult.Success;
  7863. actionResult.Message = "产品【" + BarCode + "】盘点成功";
  7864. }
  7865. else
  7866. {
  7867. //actionResult.Result = JsonHelper.ToJson(returnValue);
  7868. actionResult.Status = (int)Constant.PDAResult.Fail;
  7869. actionResult.Message = returnValue.Message;
  7870. }
  7871. }
  7872. catch (Exception ex)
  7873. {
  7874. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7875. OutputLog.TraceLog(LogPriority.Error,
  7876. this.ToString(),
  7877. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7878. ex.ToString(),
  7879. LocalPath.LogExePath);
  7880. actionResult.Status = (int)Constant.PDAResult.Exception;
  7881. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7882. }
  7883. return actionResult;
  7884. }
  7885. /// <summary>
  7886. /// 获取盘点单明细
  7887. /// </summary>
  7888. /// <param name="sUserInfo"></param>
  7889. /// <returns></returns>
  7890. public ActionResult GetUpdateMouldCheckedInfo(string accountCode, string userCode, string userPassword, string sessionKey, int checkedID)
  7891. {
  7892. ActionResult actionResult = new ActionResult();
  7893. try
  7894. {
  7895. // 验证请求头信息
  7896. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7897. // 验证失败
  7898. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7899. {
  7900. return actionResult;
  7901. }
  7902. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  7903. () => Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.
  7904. GetUpdateMouldCheckedInfo(checkedID, sUserInfo));
  7905. actionResult.Result = JsonHelper.ToJson(ds);
  7906. actionResult.Status = (int)Constant.PDAResult.Success;
  7907. }
  7908. catch (Exception ex)
  7909. {
  7910. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7911. OutputLog.TraceLog(LogPriority.Error,
  7912. this.ToString(),
  7913. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7914. ex.ToString(),
  7915. LocalPath.LogExePath);
  7916. actionResult.Status = (int)Constant.PDAResult.Exception;
  7917. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7918. }
  7919. return actionResult;
  7920. }
  7921. #endregion
  7922. #region 通用接口
  7923. /// <summary>
  7924. /// PDA调用通用接口
  7925. /// </summary>
  7926. /// <param name="accountCode"></param>
  7927. /// <param name="userCode"></param>
  7928. /// <param name="userPassword"></param>
  7929. /// <param name="sessionKey"></param>
  7930. /// <param name="module"></param>
  7931. /// <param name="action"></param>
  7932. /// <param name="data"></param>
  7933. /// <returns></returns>
  7934. public ActionResult DoAction(string accountCode, string userCode, string userPassword, string sessionKey,
  7935. string module, string action, string jsonData)
  7936. {
  7937. ActionResult actionResult = null;
  7938. try
  7939. {
  7940. // 验证请求头信息
  7941. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7942. // 验证失败
  7943. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7944. {
  7945. return actionResult;
  7946. }
  7947. actionResult.Status = (int)Constant.PDAResult.Fail;
  7948. Dictionary<string, object> data = null;
  7949. if (!string.IsNullOrEmpty(jsonData) && jsonData[0] == '{')
  7950. {
  7951. data = JsonHelper.FromJson<Dictionary<string, object>>(jsonData);
  7952. }
  7953. #region PDA报表
  7954. if (module == "Report")
  7955. {
  7956. // 成型月度结算
  7957. if (action == "GetGroutingSettlementInfo")
  7958. {
  7959. DateTime month = DateTime.Now;
  7960. month = new DateTime(month.Year, month.Month, 1);
  7961. //month = new DateTime(2017, 6, 1);
  7962. int currentMonth = Convert.ToInt32(data["CurrentMonth"]);
  7963. if (currentMonth != 1)
  7964. {
  7965. month = month.AddMonths(-1);
  7966. }
  7967. ServiceResultEntity sre = PDAModuleLogic.GetGroutingSettlementInfo(sUserInfo, month);
  7968. if (sre.Status == Constant.ServiceResultStatus.Success)
  7969. {
  7970. actionResult.Status = (int)Constant.PDAResult.Success;
  7971. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  7972. }
  7973. else
  7974. {
  7975. actionResult.Status = (int)Constant.PDAResult.Fail;
  7976. actionResult.Message = sre.Message;
  7977. }
  7978. return actionResult;
  7979. }
  7980. // 成型月度结算-明细
  7981. if (action == "GetGroutingSettlementDetail")
  7982. {
  7983. DateTime month = DateTime.Now;
  7984. month = new DateTime(month.Year, month.Month, 1);
  7985. //month = new DateTime(2017, 6, 1);
  7986. int currentMonth = Convert.ToInt32(data["CurrentMonth"]);
  7987. if (currentMonth != 1)
  7988. {
  7989. month = month.AddMonths(-1);
  7990. }
  7991. string goodsCode = data["GoodsCode"].ToString();
  7992. string detailDate = data["DetailDate"].ToString();
  7993. DateTime? date = null;
  7994. if (detailDate != "合计")
  7995. {
  7996. date = DateTime.Parse(detailDate);
  7997. }
  7998. ServiceResultEntity sre = PDAModuleLogic.GetGroutingSettlementDetail(sUserInfo, month, goodsCode, date);
  7999. if (sre.Status == Constant.ServiceResultStatus.Success)
  8000. {
  8001. actionResult.Status = (int)Constant.PDAResult.Success;
  8002. actionResult.Result = JsonHelper.ToJson(sre.Data);
  8003. }
  8004. else
  8005. {
  8006. actionResult.Status = (int)Constant.PDAResult.Fail;
  8007. actionResult.Message = sre.Message;
  8008. }
  8009. return actionResult;
  8010. }
  8011. // 产成品交接汇总
  8012. if (action == "GetFinishedProductHandoverSum")
  8013. {
  8014. DateTime date = DateTime.Parse(data["date"].ToString());
  8015. ServiceResultEntity sre = ReportModuleLogic.GetRPT0030112NPDAData(date,
  8016. data["goodscode"] as string, sUserInfo);
  8017. if (sre.Status == Constant.ServiceResultStatus.Success)
  8018. {
  8019. actionResult.Status = (int)Constant.PDAResult.Success;
  8020. actionResult.Result = JsonHelper.ToJson(sre.Data);
  8021. }
  8022. else if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  8023. {
  8024. actionResult.Status = (int)Constant.PDAResult.Success;
  8025. }
  8026. else
  8027. {
  8028. actionResult.Status = (int)Constant.PDAResult.Fail;
  8029. actionResult.Message = sre.Message;
  8030. }
  8031. return actionResult;
  8032. }
  8033. //xuwei add 2019-10-21
  8034. //统计当前工号,当日,按产品编码分组统计半检返修数据数量
  8035. if (action == "GetSemiReworkDayCount")
  8036. {
  8037. //不指定参数查询当天
  8038. string dateStr = DateTime.Now.ToString("yyyy-MM-dd");
  8039. //dateStr = "2019-10-17";
  8040. //指定参数查询特定日期
  8041. if(data.ContainsKey("SemiReworkDate")) dateStr = data["SemiReworkDate"].ToString();
  8042. ServiceResultEntity sre = ReportModuleLogic.GetSemiReworkDayCount(sUserInfo, dateStr);
  8043. if (sre.Status == Constant.ServiceResultStatus.Success)
  8044. {
  8045. actionResult.Status = (int)Constant.PDAResult.Success;
  8046. actionResult.Result = JsonHelper.ToJson(sre.Data);
  8047. }
  8048. else
  8049. {
  8050. actionResult.Status = (int)Constant.PDAResult.Fail;
  8051. actionResult.Message = sre.Message;
  8052. }
  8053. return actionResult;
  8054. }
  8055. //xuwe end
  8056. return actionResult;
  8057. }
  8058. #endregion
  8059. #region 模具管理
  8060. if (module == "PC_Mould")
  8061. {
  8062. #region 模具新建画面数据初始化
  8063. if (action == "GetMouldAddInit")
  8064. {
  8065. ClientRequestEntity cre = new ClientRequestEntity();
  8066. cre.Properties["MouldID"] = 0;
  8067. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1002LoadData(sUserInfo, cre);
  8068. if (sre.Status == Constant.ServiceResultStatus.Success)
  8069. {
  8070. actionResult.Status = (int)Constant.PDAResult.Success;
  8071. actionResult.Result = JsonHelper.ToJson(sre.Data);
  8072. }
  8073. else
  8074. {
  8075. actionResult.Status = (int)Constant.PDAResult.Fail;
  8076. actionResult.Message = sre.Message;
  8077. }
  8078. return actionResult;
  8079. }
  8080. #endregion
  8081. #region 验证模具产品型号
  8082. if (action == "CheckGoodsCodeOnMould")
  8083. {
  8084. ClientRequestEntity cre = new ClientRequestEntity();
  8085. cre.Properties["GoodsCode"] = data["GoodsCode"];
  8086. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1002GoodsData(sUserInfo, cre);
  8087. if (sre.Status == Constant.ServiceResultStatus.Success &&
  8088. sre.Data.Tables[0].Rows.Count > 0)
  8089. {
  8090. actionResult.Status = (int)Constant.PDAResult.Success;
  8091. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8092. }
  8093. else
  8094. {
  8095. actionResult.Status = (int)Constant.PDAResult.Fail;
  8096. actionResult.Message = "无效产品型号";
  8097. }
  8098. return actionResult;
  8099. }
  8100. #endregion
  8101. #region 验证模具生产工号
  8102. if (action == "CheckUserCodeOnMould")
  8103. {
  8104. DataTable sre = PDAModuleLogic.GetUserCodeOnMould(sUserInfo, data["UserCode"].ToString());
  8105. if (sre != null && sre.Rows.Count > 0)
  8106. {
  8107. actionResult.Status = (int)Constant.PDAResult.Success;
  8108. actionResult.Result = JsonHelper.ToJson(sre);
  8109. }
  8110. else
  8111. {
  8112. actionResult.Status = (int)Constant.PDAResult.Fail;
  8113. actionResult.Message = "无效生产工号";
  8114. }
  8115. return actionResult;
  8116. }
  8117. #endregion
  8118. #region 新建保存
  8119. if (action == "SetMouldAdd" || action == "SetMouldEdit")
  8120. {
  8121. ClientRequestEntity cre = new ClientRequestEntity();
  8122. foreach (string item in data.Keys)
  8123. {
  8124. if (item == "ProductionDate")
  8125. {
  8126. cre.Properties.Add(item, Convert.ToDateTime(data[item]));
  8127. }
  8128. else
  8129. {
  8130. cre.Properties.Add(item, data[item]);
  8131. }
  8132. }
  8133. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1002Data(sUserInfo, cre);
  8134. if (sre.Status == Constant.ServiceResultStatus.Success)
  8135. {
  8136. actionResult.Status = (int)Constant.PDAResult.Success;
  8137. }
  8138. else
  8139. {
  8140. actionResult.Status = (int)Constant.PDAResult.Fail;
  8141. actionResult.Result = sre.OtherStatus;
  8142. actionResult.Message = sre.Message;
  8143. }
  8144. return actionResult;
  8145. }
  8146. #endregion
  8147. #region 模具编辑画面数据初始化
  8148. if (action == "GetMouldEditInfo")
  8149. {
  8150. DataTable sre = PDAModuleLogic.GetMouldEditInfo(sUserInfo, data["MouldBarcode"].ToString());
  8151. if (sre != null && sre.Rows.Count > 0)
  8152. {
  8153. actionResult.Status = (int)Constant.PDAResult.Success;
  8154. actionResult.Result = JsonHelper.ToJson(sre);
  8155. }
  8156. else
  8157. {
  8158. actionResult.Status = (int)Constant.PDAResult.Fail;
  8159. actionResult.Message = "无效模具条码";
  8160. }
  8161. return actionResult;
  8162. }
  8163. #endregion
  8164. #region 模具操作-画面初始化
  8165. if (action == "GetMouldOperationInit")
  8166. {
  8167. ClientRequestEntity cre = new ClientRequestEntity();
  8168. cre.Properties["MouldOperationType"] = data["MouldOperationType"];
  8169. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1004LoadData(sUserInfo, cre);
  8170. if (sre.Status == Constant.ServiceResultStatus.Success)
  8171. {
  8172. actionResult.Status = (int)Constant.PDAResult.Success;
  8173. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8174. }
  8175. else
  8176. {
  8177. actionResult.Status = (int)Constant.PDAResult.Fail;
  8178. actionResult.Result = sre.OtherStatus;
  8179. actionResult.Message = sre.Message;
  8180. }
  8181. return actionResult;
  8182. }
  8183. #endregion
  8184. #region 模具操作-验证模具条码
  8185. if (action == "CheckMouldBarcode")
  8186. {
  8187. ClientRequestEntity cre = new ClientRequestEntity();
  8188. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8189. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetMouldData(sUserInfo, cre);
  8190. if (sre.Status == Constant.ServiceResultStatus.Success)
  8191. {
  8192. if (sre.Data.Tables[0].Rows.Count == 0)
  8193. {
  8194. actionResult.Status = (int)Constant.PDAResult.Fail;
  8195. actionResult.Result = -1;
  8196. actionResult.Message = "模具【" + data["MouldBarcode"] + "】不存在";
  8197. return actionResult;
  8198. }
  8199. int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
  8200. int mouldStatusID = Convert.ToInt32(sre.Data.Tables[0].Rows[0]["MouldStatus"]);
  8201. string mouldStatusName = sre.Data.Tables[0].Rows[0]["MouldStatusName"].ToString();
  8202. #region 报损
  8203. if (mouldOperationType == 2)
  8204. {
  8205. if (mouldStatusID == 1 || mouldStatusID == 3)
  8206. {
  8207. actionResult.Status = (int)Constant.PDAResult.Success;
  8208. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8209. }
  8210. else
  8211. {
  8212. actionResult.Status = (int)Constant.PDAResult.Fail;
  8213. actionResult.Result = -2;
  8214. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行报损操作";
  8215. }
  8216. return actionResult;
  8217. }
  8218. #endregion
  8219. #region 撤销
  8220. if (mouldOperationType == 3)
  8221. {
  8222. if (mouldStatusID == 4)
  8223. {
  8224. actionResult.Status = (int)Constant.PDAResult.Success;
  8225. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8226. }
  8227. else
  8228. {
  8229. actionResult.Status = (int)Constant.PDAResult.Fail;
  8230. actionResult.Result = -2;
  8231. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行撤销报损操作";
  8232. }
  8233. return actionResult;
  8234. }
  8235. #endregion
  8236. #region 领用
  8237. if (mouldOperationType == 4)
  8238. {
  8239. if (mouldStatusID == 1)
  8240. {
  8241. actionResult.Status = (int)Constant.PDAResult.Success;
  8242. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8243. }
  8244. else
  8245. {
  8246. actionResult.Status = (int)Constant.PDAResult.Fail;
  8247. actionResult.Result = -2;
  8248. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行领用操作";
  8249. }
  8250. return actionResult;
  8251. }
  8252. #endregion
  8253. #region 回收
  8254. if (mouldOperationType == 5)
  8255. {
  8256. if (mouldStatusID == 3)
  8257. {
  8258. actionResult.Status = (int)Constant.PDAResult.Success;
  8259. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8260. }
  8261. else
  8262. {
  8263. actionResult.Status = (int)Constant.PDAResult.Fail;
  8264. actionResult.Result = -2;
  8265. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行回收操作";
  8266. }
  8267. return actionResult;
  8268. }
  8269. #endregion
  8270. #region 变更型号
  8271. if (mouldOperationType == -1)
  8272. {
  8273. if (mouldStatusID != 4)
  8274. {
  8275. actionResult.Status = (int)Constant.PDAResult.Success;
  8276. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8277. }
  8278. else
  8279. {
  8280. actionResult.Status = (int)Constant.PDAResult.Fail;
  8281. actionResult.Result = -2;
  8282. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行变更型号操作";
  8283. }
  8284. return actionResult;
  8285. }
  8286. #endregion
  8287. #region 替换条码
  8288. if (mouldOperationType == -2)
  8289. {
  8290. actionResult.Status = (int)Constant.PDAResult.Success;
  8291. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8292. return actionResult;
  8293. }
  8294. #endregion
  8295. return actionResult;
  8296. }
  8297. }
  8298. #endregion
  8299. #region 模具操作-保存
  8300. if (action == "SetMouldOperation")
  8301. {
  8302. ClientRequestEntity cre = new ClientRequestEntity();
  8303. cre.Properties["MouldIDs"] = string.Join(",", JsonHelper.FromJson<int[]>(data["MouldIDs"].ToString()));
  8304. cre.Properties["MouldOperationType"] = data["MouldOperationType"];
  8305. cre.Properties["Remarks"] = data["Remarks"];
  8306. int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
  8307. if (mouldOperationType == (int)Constant.MouldOperationType.ChangeGoodsCode)
  8308. {
  8309. cre.Properties["GoodsID"] = data["GoodsID"];
  8310. cre.Properties["GoodsCode"] = data["GoodsCode"];
  8311. }
  8312. else if (mouldOperationType == (int)Constant.MouldOperationType.InvToScrap)
  8313. {
  8314. cre.Properties["ScrapReason"] = data["ScrapReason"];
  8315. cre.Properties["ScrapResponsibility"] = data["ScrapRemarks"];
  8316. }
  8317. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1004Data(sUserInfo, cre);
  8318. if (sre.Status == Constant.ServiceResultStatus.Success)
  8319. {
  8320. actionResult.Status = (int)Constant.PDAResult.Success;
  8321. }
  8322. else
  8323. {
  8324. actionResult.Status = (int)Constant.PDAResult.Fail;
  8325. }
  8326. return actionResult;
  8327. }
  8328. #endregion
  8329. #region 模具操作-替换条码
  8330. if (action == "ChangedMouldBarcode")
  8331. {
  8332. ClientRequestEntity cre = new ClientRequestEntity();
  8333. cre.Properties["MouldID"] = data["MouldID"];
  8334. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8335. cre.Properties["NewMouldBarcode"] = data["NewMouldBarcode"];
  8336. cre.Properties["Remarks"] = data["Remarks"];
  8337. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1003Data(sUserInfo, cre);
  8338. if (sre.Status == Constant.ServiceResultStatus.Success)
  8339. {
  8340. actionResult.Status = (int)Constant.PDAResult.Success;
  8341. }
  8342. else
  8343. {
  8344. actionResult.Status = (int)Constant.PDAResult.Fail;
  8345. actionResult.Result = sre.OtherStatus;
  8346. actionResult.Message = sre.Message;
  8347. }
  8348. return actionResult;
  8349. }
  8350. #endregion
  8351. #region 模具跟踪表
  8352. if (action == "GetMoldTracking")
  8353. {
  8354. ClientRequestEntity cre = new ClientRequestEntity();
  8355. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8356. ServiceResultEntity sre = ReportModuleLogic.GetRPT020105Data(cre, sUserInfo);
  8357. if (sre.Status == Constant.ServiceResultStatus.Success)
  8358. {
  8359. actionResult.Status = (int)Constant.PDAResult.Success;
  8360. actionResult.Result = JsonHelper.ToJson(sre.Data);
  8361. }
  8362. else
  8363. {
  8364. actionResult.Status = (int)Constant.PDAResult.Fail;
  8365. actionResult.Message = "此模具条码不存在";
  8366. }
  8367. return actionResult;
  8368. }
  8369. #endregion
  8370. return actionResult;
  8371. }
  8372. #endregion
  8373. #region 成型线模具管理
  8374. if (module == "PC_GroutingLineMould")
  8375. {
  8376. #region 获取当前用户成型线模具管理权限
  8377. if (action == "GetGMouldStatusRight")
  8378. {
  8379. DataTable right = PDAModuleLogic.GetGMouldStatusRight(sUserInfo);
  8380. actionResult.Status = (int)Constant.PDAResult.Success;
  8381. if (right != null && right.Rows.Count > 0)
  8382. {
  8383. actionResult.Result = JsonHelper.ToJson(right);
  8384. }
  8385. return actionResult;
  8386. }
  8387. #endregion
  8388. #region 获取成型线状态等信息,和成型模具信息
  8389. if (action == "GetGroutingLineMould")
  8390. {
  8391. int? groutingLineID = null;
  8392. string groutingLineCode = null;
  8393. if (data.ContainsKey("GroutingLineID"))
  8394. {
  8395. groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8396. }
  8397. else
  8398. {
  8399. groutingLineCode = data["GroutingLineCode"] + "";
  8400. }
  8401. DataSet lineInfo = PDAModuleLogic.GetGroutingLineMould(sUserInfo, groutingLineCode, groutingLineID);
  8402. if (lineInfo == null)
  8403. {
  8404. actionResult.Status = (int)Constant.PDAResult.Fail;
  8405. actionResult.Message = "成型线【" + groutingLineCode + "】不存在或是停用状态";
  8406. }
  8407. else
  8408. {
  8409. actionResult.Status = (int)Constant.PDAResult.Success;
  8410. actionResult.Result = JsonHelper.ToJson(lineInfo);
  8411. }
  8412. return actionResult;
  8413. }
  8414. #endregion
  8415. #region 模具操作-画面初始化
  8416. if (action == "GetMouldOperationInit")
  8417. {
  8418. ClientRequestEntity cre = new ClientRequestEntity();
  8419. cre.Properties["MouldOperationType"] = 2;
  8420. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1004LoadData(sUserInfo, cre);
  8421. if (sre.Status == Constant.ServiceResultStatus.Success)
  8422. {
  8423. actionResult.Status = (int)Constant.PDAResult.Success;
  8424. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8425. }
  8426. else
  8427. {
  8428. actionResult.Status = (int)Constant.PDAResult.Fail;
  8429. actionResult.Result = sre.OtherStatus;
  8430. actionResult.Message = sre.Message;
  8431. }
  8432. return actionResult;
  8433. }
  8434. #endregion
  8435. #region 成型模具操作-画面初始化
  8436. if (action == "GetGroutingMouldOperationInit")
  8437. {
  8438. DataTable initData = PDAModuleLogic.GetGroutingMouldOperationInit(sUserInfo, 6);
  8439. if (initData != null && initData.Rows.Count > 0)
  8440. {
  8441. actionResult.Status = (int)Constant.PDAResult.Success;
  8442. Dictionary<string, string> syssetting = new Dictionary<string, string>();
  8443. foreach (DataRow item in initData.Rows)
  8444. {
  8445. syssetting.Add(item["settingcode"].ToString(), item["settingvalue"].ToString());
  8446. }
  8447. actionResult.Result = JsonHelper.ToJson(syssetting);
  8448. }
  8449. else
  8450. {
  8451. actionResult.Status = (int)Constant.PDAResult.Fail;
  8452. }
  8453. return actionResult;
  8454. }
  8455. #endregion
  8456. #region 模具操作-验证模具条码
  8457. if (action == "CheckMouldBarcode")
  8458. {
  8459. ClientRequestEntity cre = new ClientRequestEntity();
  8460. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8461. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetMouldData(sUserInfo, cre);
  8462. if (sre.Status == Constant.ServiceResultStatus.Success)
  8463. {
  8464. if (sre.Data.Tables[0].Rows.Count == 0)
  8465. {
  8466. actionResult.Status = (int)Constant.PDAResult.Fail;
  8467. actionResult.Result = -1;
  8468. actionResult.Message = "模具【" + data["MouldBarcode"] + "】不存在";
  8469. return actionResult;
  8470. }
  8471. int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
  8472. int mouldStatusID = Convert.ToInt32(sre.Data.Tables[0].Rows[0]["MouldStatus"]);
  8473. string mouldStatusName = sre.Data.Tables[0].Rows[0]["MouldStatusName"].ToString();
  8474. #region 上线
  8475. if (mouldOperationType == 6)
  8476. {
  8477. if (mouldStatusID == 1 || mouldStatusID == 3)
  8478. {
  8479. if (data.ContainsKey("GoodsID"))
  8480. {
  8481. if (sre.Data.Tables[0].Rows[0]["GoodsID"] + "" != data["GoodsID"] + "")
  8482. {
  8483. actionResult.Status = (int)Constant.PDAResult.Fail;
  8484. actionResult.Result = -3;
  8485. actionResult.Message =
  8486. "模具【" + data["MouldBarcode"] + "】的产品型号为【" +
  8487. sre.Data.Tables[0].Rows[0]["GoodsCode"] +
  8488. "】与当前不一致";
  8489. return actionResult;
  8490. }
  8491. }
  8492. actionResult.Status = (int)Constant.PDAResult.Success;
  8493. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8494. }
  8495. else
  8496. {
  8497. actionResult.Status = (int)Constant.PDAResult.Fail;
  8498. actionResult.Result = -2;
  8499. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行报损操作";
  8500. }
  8501. return actionResult;
  8502. }
  8503. #endregion
  8504. return actionResult;
  8505. }
  8506. }
  8507. #endregion
  8508. #region 停用
  8509. if (action == "StopGroutingLineDetail")
  8510. {
  8511. if (data == null || !data.ContainsKey("Details"))
  8512. {
  8513. actionResult.Status = (int)Constant.PDAResult.Fail;
  8514. actionResult.Message = "参数错误";
  8515. return actionResult;
  8516. }
  8517. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8518. DataTable gTable = new DataTable();
  8519. gTable.Columns.Add("GroutingLineID", typeof(int));
  8520. gTable.Columns.Add("GroutingLineCode");
  8521. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8522. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8523. gTable.Columns.Add("GroutingMouldCode");
  8524. gTable.Columns.Add("RecordRemarks");
  8525. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8526. gTable.Columns.Add("MouldID", typeof(int));
  8527. gTable.Columns.Add("MouldCode");
  8528. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8529. string groutingLineCode = data["GroutingLineCode"] + "";
  8530. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8531. foreach (Dictionary<string, object> item in details)
  8532. {
  8533. int? mouldID = null;
  8534. if (item.ContainsKey("MouldID"))
  8535. {
  8536. mouldID = Convert.ToInt32(item["MouldID"]);
  8537. if (mouldID == 0)
  8538. {
  8539. mouldID = null;
  8540. }
  8541. }
  8542. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8543. item["GLineDetailID"], item["GLineDetailCode"],
  8544. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8545. mouldID, item["MouldCode"]);
  8546. }
  8547. int result = PCModuleLogicDAL.StopGroutingLineDetail(gTable, sUserInfo);
  8548. if (result > 0)
  8549. {
  8550. actionResult.Status = (int)Constant.PDAResult.Success;
  8551. }
  8552. else
  8553. {
  8554. actionResult.Status = (int)Constant.PDAResult.Fail;
  8555. actionResult.Result = result;
  8556. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8557. return actionResult;
  8558. }
  8559. return actionResult;
  8560. }
  8561. #endregion
  8562. #region 启用
  8563. if (action == "StartGroutingLineDetail")
  8564. {
  8565. if (data == null || !data.ContainsKey("Details"))
  8566. {
  8567. actionResult.Status = (int)Constant.PDAResult.Fail;
  8568. actionResult.Message = "参数错误";
  8569. return actionResult;
  8570. }
  8571. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8572. DataTable gTable = new DataTable();
  8573. gTable.Columns.Add("GroutingLineID", typeof(int));
  8574. gTable.Columns.Add("GroutingLineCode");
  8575. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8576. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8577. gTable.Columns.Add("GroutingMouldCode");
  8578. gTable.Columns.Add("RecordRemarks");
  8579. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8580. gTable.Columns.Add("MouldID", typeof(int));
  8581. gTable.Columns.Add("MouldCode");
  8582. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8583. string groutingLineCode = data["GroutingLineCode"] + "";
  8584. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8585. foreach (Dictionary<string, object> item in details)
  8586. {
  8587. int? mouldID = null;
  8588. if (item.ContainsKey("MouldID"))
  8589. {
  8590. mouldID = Convert.ToInt32(item["MouldID"]);
  8591. if (mouldID == 0)
  8592. {
  8593. mouldID = null;
  8594. }
  8595. }
  8596. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8597. item["GLineDetailID"], item["GLineDetailCode"],
  8598. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8599. mouldID, item["MouldCode"]);
  8600. }
  8601. int result = PCModuleLogicDAL.StartGroutingLineDetail(gTable, sUserInfo);
  8602. if (result > 0)
  8603. {
  8604. actionResult.Status = (int)Constant.PDAResult.Success;
  8605. }
  8606. else
  8607. {
  8608. actionResult.Status = (int)Constant.PDAResult.Fail;
  8609. actionResult.Result = result;
  8610. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8611. return actionResult;
  8612. }
  8613. return actionResult;
  8614. }
  8615. #endregion
  8616. #region 维修
  8617. if (action == "RepairStartGroutingLineDetail")
  8618. {
  8619. if (data == null || !data.ContainsKey("Details"))
  8620. {
  8621. actionResult.Status = (int)Constant.PDAResult.Fail;
  8622. actionResult.Message = "参数错误";
  8623. return actionResult;
  8624. }
  8625. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8626. DataTable gTable = new DataTable();
  8627. gTable.Columns.Add("GroutingLineID", typeof(int));
  8628. gTable.Columns.Add("GroutingLineCode");
  8629. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8630. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8631. gTable.Columns.Add("GroutingMouldCode");
  8632. gTable.Columns.Add("RecordRemarks");
  8633. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8634. gTable.Columns.Add("MouldID", typeof(int));
  8635. gTable.Columns.Add("MouldCode");
  8636. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8637. string groutingLineCode = data["GroutingLineCode"] + "";
  8638. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8639. foreach (Dictionary<string, object> item in details)
  8640. {
  8641. int? mouldID = null;
  8642. if (item.ContainsKey("MouldID"))
  8643. {
  8644. mouldID = Convert.ToInt32(item["MouldID"]);
  8645. if (mouldID == 0)
  8646. {
  8647. mouldID = null;
  8648. }
  8649. }
  8650. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8651. item["GLineDetailID"], item["GLineDetailCode"],
  8652. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8653. mouldID, item["MouldCode"]);
  8654. }
  8655. int result = PCModuleLogicDAL.RepairStartGroutingLineDetail(gTable, sUserInfo);
  8656. if (result > 0)
  8657. {
  8658. actionResult.Status = (int)Constant.PDAResult.Success;
  8659. }
  8660. else
  8661. {
  8662. actionResult.Status = (int)Constant.PDAResult.Fail;
  8663. actionResult.Result = result;
  8664. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8665. return actionResult;
  8666. }
  8667. return actionResult;
  8668. }
  8669. #endregion
  8670. #region 结束维修
  8671. if (action == "RepairEndGroutingLineDetail")
  8672. {
  8673. if (data == null || !data.ContainsKey("Details"))
  8674. {
  8675. actionResult.Status = (int)Constant.PDAResult.Fail;
  8676. actionResult.Message = "参数错误";
  8677. return actionResult;
  8678. }
  8679. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8680. DataTable gTable = new DataTable();
  8681. gTable.Columns.Add("GroutingLineID", typeof(int));
  8682. gTable.Columns.Add("GroutingLineCode");
  8683. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8684. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8685. gTable.Columns.Add("GroutingMouldCode");
  8686. gTable.Columns.Add("RecordRemarks");
  8687. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8688. gTable.Columns.Add("MouldID", typeof(int));
  8689. gTable.Columns.Add("MouldCode");
  8690. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8691. string groutingLineCode = data["GroutingLineCode"] + "";
  8692. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8693. foreach (Dictionary<string, object> item in details)
  8694. {
  8695. int? mouldID = null;
  8696. if (item.ContainsKey("MouldID"))
  8697. {
  8698. mouldID = Convert.ToInt32(item["MouldID"]);
  8699. if (mouldID == 0)
  8700. {
  8701. mouldID = null;
  8702. }
  8703. }
  8704. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8705. item["GLineDetailID"], item["GLineDetailCode"],
  8706. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8707. mouldID, item["MouldCode"]);
  8708. }
  8709. int result = PCModuleLogicDAL.RepairEndGroutingLineDetail(gTable, sUserInfo);
  8710. if (result > 0)
  8711. {
  8712. actionResult.Status = (int)Constant.PDAResult.Success;
  8713. }
  8714. else
  8715. {
  8716. actionResult.Status = (int)Constant.PDAResult.Fail;
  8717. actionResult.Result = result;
  8718. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8719. return actionResult;
  8720. }
  8721. return actionResult;
  8722. }
  8723. #endregion
  8724. #region 换模
  8725. if (action == "ChangeGMouldStartGroutingLineDetail")
  8726. {
  8727. if (data == null || !data.ContainsKey("Details"))
  8728. {
  8729. actionResult.Status = (int)Constant.PDAResult.Fail;
  8730. actionResult.Message = "参数错误";
  8731. return actionResult;
  8732. }
  8733. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8734. DataTable gTable = new DataTable();
  8735. gTable.Columns.Add("GroutingLineID", typeof(int));
  8736. gTable.Columns.Add("GroutingLineCode");
  8737. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8738. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8739. gTable.Columns.Add("GroutingMouldCode");
  8740. gTable.Columns.Add("RecordRemarks");
  8741. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8742. gTable.Columns.Add("MouldID", typeof(int));
  8743. gTable.Columns.Add("MouldCode");
  8744. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8745. gTable.Columns.Add("MouldStatus", typeof(int));
  8746. gTable.Columns.Add("ScrapReason", typeof(int));
  8747. gTable.Columns.Add("ScrapResponsibility");
  8748. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8749. string groutingLineCode = data["GroutingLineCode"] + "";
  8750. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8751. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  8752. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  8753. string scrapResponsibility = data["ScrapRemarks"] + "";
  8754. foreach (Dictionary<string, object> item in details)
  8755. {
  8756. int? mouldID = null;
  8757. if (item.ContainsKey("MouldID"))
  8758. {
  8759. mouldID = Convert.ToInt32(item["MouldID"]);
  8760. if (mouldID == 0)
  8761. {
  8762. mouldID = null;
  8763. }
  8764. }
  8765. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8766. item["GLineDetailID"], item["GLineDetailCode"],
  8767. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8768. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  8769. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  8770. }
  8771. int result = PCModuleLogicDAL.ChangeGMouldStartGroutingLineDetail(gTable, sUserInfo);
  8772. if (result > 0)
  8773. {
  8774. actionResult.Status = (int)Constant.PDAResult.Success;
  8775. }
  8776. else
  8777. {
  8778. actionResult.Status = (int)Constant.PDAResult.Fail;
  8779. actionResult.Result = result;
  8780. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8781. return actionResult;
  8782. }
  8783. return actionResult;
  8784. }
  8785. #endregion
  8786. #region 变产
  8787. if (action == "UpdateLineStartGroutingLineDetail")
  8788. {
  8789. if (data == null || !data.ContainsKey("Details"))
  8790. {
  8791. actionResult.Status = (int)Constant.PDAResult.Fail;
  8792. actionResult.Message = "参数错误";
  8793. return actionResult;
  8794. }
  8795. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8796. DataTable gTable = new DataTable();
  8797. gTable.Columns.Add("GroutingLineID", typeof(int));
  8798. gTable.Columns.Add("GroutingLineCode");
  8799. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8800. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8801. gTable.Columns.Add("GroutingMouldCode");
  8802. gTable.Columns.Add("RecordRemarks");
  8803. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8804. gTable.Columns.Add("MouldID", typeof(int));
  8805. gTable.Columns.Add("MouldCode");
  8806. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8807. gTable.Columns.Add("MouldStatus", typeof(int));
  8808. gTable.Columns.Add("ScrapReason", typeof(int));
  8809. gTable.Columns.Add("ScrapResponsibility");
  8810. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8811. string groutingLineCode = data["GroutingLineCode"] + "";
  8812. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8813. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  8814. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  8815. string scrapResponsibility = data["ScrapRemarks"] + "";
  8816. foreach (Dictionary<string, object> item in details)
  8817. {
  8818. int? mouldID = null;
  8819. if (item.ContainsKey("MouldID"))
  8820. {
  8821. mouldID = Convert.ToInt32(item["MouldID"]);
  8822. if (mouldID == 0)
  8823. {
  8824. mouldID = null;
  8825. }
  8826. }
  8827. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8828. item["GLineDetailID"], item["GLineDetailCode"],
  8829. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8830. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  8831. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  8832. }
  8833. int result = PCModuleLogicDAL.UpdateLineStartGroutingLineDetail(gTable, sUserInfo);
  8834. if (result > 0)
  8835. {
  8836. actionResult.Status = (int)Constant.PDAResult.Success;
  8837. }
  8838. else
  8839. {
  8840. actionResult.Status = (int)Constant.PDAResult.Fail;
  8841. actionResult.Result = result;
  8842. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8843. return actionResult;
  8844. }
  8845. return actionResult;
  8846. }
  8847. #endregion
  8848. #region 整线变产
  8849. if (action == "UpdateAllLineStartGroutingLineDetail")
  8850. {
  8851. if (data == null || !data.ContainsKey("Details"))
  8852. {
  8853. actionResult.Status = (int)Constant.PDAResult.Fail;
  8854. actionResult.Message = "参数错误";
  8855. return actionResult;
  8856. }
  8857. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8858. DataTable gTable = new DataTable();
  8859. gTable.Columns.Add("GroutingLineID", typeof(int));
  8860. gTable.Columns.Add("GroutingLineCode");
  8861. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8862. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8863. gTable.Columns.Add("GroutingMouldCode");
  8864. gTable.Columns.Add("RecordRemarks");
  8865. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8866. gTable.Columns.Add("MouldID", typeof(int));
  8867. gTable.Columns.Add("MouldCode");
  8868. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8869. gTable.Columns.Add("MouldStatus", typeof(int));
  8870. gTable.Columns.Add("ScrapReason", typeof(int));
  8871. gTable.Columns.Add("ScrapResponsibility");
  8872. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8873. string groutingLineCode = data["GroutingLineCode"] + "";
  8874. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8875. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  8876. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  8877. string scrapResponsibility = data["ScrapRemarks"] + "";
  8878. foreach (Dictionary<string, object> item in details)
  8879. {
  8880. int? mouldID = null;
  8881. if (item.ContainsKey("MouldID"))
  8882. {
  8883. mouldID = Convert.ToInt32(item["MouldID"]);
  8884. if (mouldID == 0)
  8885. {
  8886. mouldID = null;
  8887. }
  8888. }
  8889. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8890. item["GLineDetailID"], item["GLineDetailCode"],
  8891. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8892. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  8893. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  8894. }
  8895. int result = PCModuleLogicDAL.UpdateAllLineStartGroutingLineDetail(gTable, groutingLineID, lineOPTimeStamp, sUserInfo);
  8896. if (result > 0)
  8897. {
  8898. actionResult.Status = (int)Constant.PDAResult.Success;
  8899. }
  8900. else
  8901. {
  8902. actionResult.Status = (int)Constant.PDAResult.Fail;
  8903. actionResult.Result = result;
  8904. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8905. return actionResult;
  8906. }
  8907. return actionResult;
  8908. }
  8909. #endregion
  8910. #region 卸模
  8911. if (action == "UnloadGroutingLineDetail")
  8912. {
  8913. if (data == null || !data.ContainsKey("Details"))
  8914. {
  8915. actionResult.Status = (int)Constant.PDAResult.Fail;
  8916. actionResult.Message = "参数错误";
  8917. return actionResult;
  8918. }
  8919. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8920. DataTable gTable = new DataTable();
  8921. gTable.Columns.Add("GroutingLineID", typeof(int));
  8922. gTable.Columns.Add("GroutingLineCode");
  8923. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8924. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8925. gTable.Columns.Add("GroutingMouldCode");
  8926. gTable.Columns.Add("RecordRemarks");
  8927. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8928. gTable.Columns.Add("MouldID", typeof(int));
  8929. gTable.Columns.Add("MouldCode");
  8930. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8931. gTable.Columns.Add("MouldStatus", typeof(int));
  8932. gTable.Columns.Add("ScrapReason", typeof(int));
  8933. gTable.Columns.Add("ScrapResponsibility");
  8934. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8935. string groutingLineCode = data["GroutingLineCode"] + "";
  8936. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8937. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  8938. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  8939. string scrapResponsibility = data["ScrapRemarks"] + "";
  8940. foreach (Dictionary<string, object> item in details)
  8941. {
  8942. int? mouldID = null;
  8943. if (item.ContainsKey("MouldID"))
  8944. {
  8945. mouldID = Convert.ToInt32(item["MouldID"]);
  8946. if (mouldID == 0)
  8947. {
  8948. mouldID = null;
  8949. }
  8950. }
  8951. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8952. item["GLineDetailID"], item["GLineDetailCode"],
  8953. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8954. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  8955. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  8956. }
  8957. int result = PCModuleLogicDAL.UnloadGroutingLineDetail(gTable, sUserInfo);
  8958. if (result > 0)
  8959. {
  8960. actionResult.Status = (int)Constant.PDAResult.Success;
  8961. }
  8962. else
  8963. {
  8964. actionResult.Status = (int)Constant.PDAResult.Fail;
  8965. actionResult.Result = result;
  8966. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8967. return actionResult;
  8968. }
  8969. return actionResult;
  8970. }
  8971. #endregion
  8972. #region 结束换模
  8973. if (action == "ChangeGMouldEndGroutingLineDetail")
  8974. {
  8975. if (data == null || !data.ContainsKey("Details"))
  8976. {
  8977. actionResult.Status = (int)Constant.PDAResult.Fail;
  8978. actionResult.Message = "参数错误";
  8979. return actionResult;
  8980. }
  8981. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8982. DataTable gTable = new DataTable();
  8983. gTable.Columns.Add("GroutingLineID", typeof(int));
  8984. gTable.Columns.Add("GroutingLineCode");
  8985. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8986. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8987. gTable.Columns.Add("GroutingMouldCode");
  8988. gTable.Columns.Add("RreasonRemarks");
  8989. gTable.Columns.Add("RecordRemarks");
  8990. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8991. gTable.Columns.Add("MouldID", typeof(int));
  8992. gTable.Columns.Add("MouldCode");
  8993. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8994. gTable.Columns.Add("GoodsID", typeof(int));
  8995. gTable.Columns.Add("GoodsCode");
  8996. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  8997. gTable.Columns.Add("GroutingCount", typeof(int));
  8998. gTable.Columns.Add("MouldSource");
  8999. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9000. string groutingLineCode = data["GroutingLineCode"] + "";
  9001. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9002. foreach (Dictionary<string, object> item in details)
  9003. {
  9004. int? mouldID = null;
  9005. if (item.ContainsKey("MouldID"))
  9006. {
  9007. mouldID = Convert.ToInt32(item["MouldID"]);
  9008. if (mouldID == 0)
  9009. {
  9010. mouldID = null;
  9011. }
  9012. }
  9013. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9014. item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"],
  9015. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  9016. mouldID, item["MouldCode"], item["MouldOutputNo"],
  9017. item["GoodsID"], item["GoodsCode"],
  9018. item["StandardGroutingCount"], item["GroutingCount"],
  9019. (mouldID == null ? "0" : "1"));
  9020. }
  9021. ServiceResultEntity result = PCModuleLogicDAL.ChangeGMouldEndGroutingLineDetail(gTable, sUserInfo);
  9022. if (result.Status == Constant.ServiceResultStatus.Success)
  9023. {
  9024. actionResult.Status = (int)Constant.PDAResult.Success;
  9025. }
  9026. else if (result.OtherStatus == -100)
  9027. {
  9028. actionResult.Status = (int)Constant.PDAResult.Fail;
  9029. actionResult.Result = -100;
  9030. actionResult.Message = result.Message;
  9031. return actionResult;
  9032. }
  9033. else
  9034. {
  9035. actionResult.Status = (int)Constant.PDAResult.Fail;
  9036. actionResult.Result = -500;
  9037. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9038. return actionResult;
  9039. }
  9040. return actionResult;
  9041. }
  9042. #endregion
  9043. #region 结束变产
  9044. if (action == "UpdateLineEndGroutingLineDetail")
  9045. {
  9046. if (data == null || !data.ContainsKey("Details"))
  9047. {
  9048. actionResult.Status = (int)Constant.PDAResult.Fail;
  9049. actionResult.Message = "参数错误";
  9050. return actionResult;
  9051. }
  9052. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9053. DataTable gTable = new DataTable();
  9054. gTable.Columns.Add("GroutingLineID", typeof(int));
  9055. gTable.Columns.Add("GroutingLineCode");
  9056. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9057. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9058. gTable.Columns.Add("GroutingMouldCode");
  9059. gTable.Columns.Add("RreasonRemarks");
  9060. gTable.Columns.Add("RecordRemarks");
  9061. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9062. gTable.Columns.Add("MouldID", typeof(int));
  9063. gTable.Columns.Add("MouldCode");
  9064. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9065. gTable.Columns.Add("GoodsID", typeof(int));
  9066. gTable.Columns.Add("GoodsCode");
  9067. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  9068. gTable.Columns.Add("GroutingCount", typeof(int));
  9069. gTable.Columns.Add("MouldSource");
  9070. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9071. string groutingLineCode = data["GroutingLineCode"] + "";
  9072. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9073. foreach (Dictionary<string, object> item in details)
  9074. {
  9075. int? mouldID = null;
  9076. if (item.ContainsKey("MouldID"))
  9077. {
  9078. mouldID = Convert.ToInt32(item["MouldID"]);
  9079. if (mouldID == 0)
  9080. {
  9081. mouldID = null;
  9082. }
  9083. }
  9084. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9085. item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"],
  9086. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  9087. mouldID, item["MouldCode"], item["MouldOutputNo"],
  9088. item["GoodsID"], item["GoodsCode"],
  9089. item["StandardGroutingCount"], item["GroutingCount"],
  9090. (mouldID == null ? "0" : "1"));
  9091. }
  9092. ServiceResultEntity result = PCModuleLogicDAL.UpdateLineEndGroutingLineDetail(gTable, 0, sUserInfo);
  9093. if (result.Status == Constant.ServiceResultStatus.Success)
  9094. {
  9095. actionResult.Status = (int)Constant.PDAResult.Success;
  9096. }
  9097. else if (result.OtherStatus == -100)
  9098. {
  9099. actionResult.Status = (int)Constant.PDAResult.Fail;
  9100. actionResult.Result = -100;
  9101. actionResult.Message = result.Message;
  9102. return actionResult;
  9103. }
  9104. else
  9105. {
  9106. actionResult.Status = (int)Constant.PDAResult.Fail;
  9107. actionResult.Result = -500;
  9108. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9109. return actionResult;
  9110. }
  9111. return actionResult;
  9112. }
  9113. #endregion
  9114. #region 结束整线变产
  9115. if (action == "UpdateAllLineEndGroutingLineDetail")
  9116. {
  9117. if (data == null || !data.ContainsKey("Details"))
  9118. {
  9119. actionResult.Status = (int)Constant.PDAResult.Fail;
  9120. actionResult.Message = "参数错误";
  9121. return actionResult;
  9122. }
  9123. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9124. DataTable gTable = new DataTable();
  9125. gTable.Columns.Add("GroutingLineID", typeof(int));
  9126. gTable.Columns.Add("GroutingLineCode");
  9127. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9128. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9129. gTable.Columns.Add("GroutingMouldCode");
  9130. gTable.Columns.Add("Remarks");
  9131. gTable.Columns.Add("RecordRemarks");
  9132. //gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9133. gTable.Columns.Add("MouldID", typeof(int));
  9134. gTable.Columns.Add("MouldCode");
  9135. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9136. gTable.Columns.Add("GoodsID", typeof(int));
  9137. gTable.Columns.Add("GoodsCode");
  9138. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  9139. gTable.Columns.Add("GroutingCount", typeof(int));
  9140. gTable.Columns.Add("MouldSource");
  9141. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9142. string groutingLineCode = data["GroutingLineCode"] + "";
  9143. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9144. foreach (Dictionary<string, object> item in details)
  9145. {
  9146. int? mouldID = null;
  9147. if (item.ContainsKey("MouldID"))
  9148. {
  9149. mouldID = Convert.ToInt32(item["MouldID"]);
  9150. if (mouldID == 0)
  9151. {
  9152. mouldID = null;
  9153. }
  9154. }
  9155. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9156. item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"],
  9157. item["RecordRemarks"], //Convert.ToDateTime(item["OPTimeStamp"]),
  9158. mouldID, item["MouldCode"], item["MouldOutputNo"],
  9159. item["GoodsID"], item["GoodsCode"],
  9160. item["StandardGroutingCount"], item["GroutingCount"],
  9161. (mouldID == null ? "0" : "1"));
  9162. }
  9163. ServiceResultEntity result = PCModuleLogicDAL.UpdateAllLineEndGroutingLineDetail(gTable, null, groutingLineID, lineOPTimeStamp, sUserInfo);
  9164. if (result.Status == Constant.ServiceResultStatus.Success)
  9165. {
  9166. actionResult.Status = (int)Constant.PDAResult.Success;
  9167. }
  9168. else if (result.OtherStatus == -100)
  9169. {
  9170. actionResult.Status = (int)Constant.PDAResult.Fail;
  9171. actionResult.Result = -100;
  9172. actionResult.Message = result.Message;
  9173. return actionResult;
  9174. }
  9175. else
  9176. {
  9177. actionResult.Status = (int)Constant.PDAResult.Fail;
  9178. actionResult.Result = -500;
  9179. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9180. return actionResult;
  9181. }
  9182. return actionResult;
  9183. }
  9184. #endregion
  9185. #region 上模
  9186. if (action == "UpdateGroutingLine_AddMould")
  9187. {
  9188. if (data == null || !data.ContainsKey("Details"))
  9189. {
  9190. actionResult.Status = (int)Constant.PDAResult.Fail;
  9191. actionResult.Message = "参数错误";
  9192. return actionResult;
  9193. }
  9194. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9195. DataTable gTable = new DataTable();
  9196. gTable.Columns.Add("GroutingLineID", typeof(int));
  9197. gTable.Columns.Add("GroutingLineCode");
  9198. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9199. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9200. gTable.Columns.Add("GroutingMouldCode");
  9201. gTable.Columns.Add("Remarks");
  9202. gTable.Columns.Add("RecordRemarks");
  9203. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9204. gTable.Columns.Add("MouldID", typeof(int));
  9205. gTable.Columns.Add("MouldCode");
  9206. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9207. gTable.Columns.Add("GoodsID", typeof(int));
  9208. gTable.Columns.Add("GoodsCode");
  9209. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  9210. gTable.Columns.Add("GroutingCount", typeof(int));
  9211. gTable.Columns.Add("MouldSource");
  9212. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9213. string groutingLineCode = data["GroutingLineCode"] + "";
  9214. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9215. foreach (Dictionary<string, object> item in details)
  9216. {
  9217. int? mouldID = null;
  9218. if (item.ContainsKey("MouldID"))
  9219. {
  9220. mouldID = Convert.ToInt32(item["MouldID"]);
  9221. if (mouldID == 0)
  9222. {
  9223. mouldID = null;
  9224. }
  9225. }
  9226. int gldID = Convert.ToInt32(item["GLineDetailID"]);
  9227. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9228. gldID, item["GLineDetailCode"],
  9229. item["DetailRemarks"], item["RecordRemarks"],
  9230. (gldID > 0 ? (object)Convert.ToDateTime(item["OPTimeStamp"]) : null),
  9231. mouldID, item["MouldCode"], item["MouldOutputNo"],
  9232. item["GoodsID"], item["GoodsCode"],
  9233. item["StandardGroutingCount"], item["GroutingCount"],
  9234. (mouldID == null ? "0" : "1"));
  9235. }
  9236. ServiceResultEntity result = PCModuleLogicDAL.UpdateGroutingLine_AddMould(groutingLineID, groutingLineCode, lineOPTimeStamp, gTable, sUserInfo);
  9237. if (result.Status == Constant.ServiceResultStatus.Success)
  9238. {
  9239. actionResult.Status = (int)Constant.PDAResult.Success;
  9240. }
  9241. else if (result.OtherStatus == -2 || result.OtherStatus == -100)
  9242. {
  9243. actionResult.Status = (int)Constant.PDAResult.Fail;
  9244. actionResult.Result = result.OtherStatus;
  9245. actionResult.Message = result.Message;
  9246. return actionResult;
  9247. }
  9248. else
  9249. {
  9250. actionResult.Status = (int)Constant.PDAResult.Fail;
  9251. actionResult.Result = -500;
  9252. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9253. return actionResult;
  9254. }
  9255. return actionResult;
  9256. }
  9257. #endregion
  9258. return actionResult;
  9259. }
  9260. #endregion
  9261. #region 包装装板限制
  9262. if (module == "FinishedLoadingCar")
  9263. {
  9264. if (action == "GetSetting")
  9265. {
  9266. ClientRequestEntity cre = new ClientRequestEntity();
  9267. cre.Properties["GoodsID"] = data["GoodsID"];
  9268. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetFinishedLoadingCarSetting(sUserInfo, cre);
  9269. if (sre.Status == Constant.ServiceResultStatus.Success)
  9270. {
  9271. actionResult.Status = (int)Constant.PDAResult.Success;
  9272. foreach (DataRow item in sre.Data.Tables[0].Rows)
  9273. {
  9274. if (item["settingcode"].ToString() == "S_PM_011")
  9275. {
  9276. cre.Properties["S_PM_011"] = item["settingvalue"];
  9277. }
  9278. else if (item["settingcode"].ToString() == "S_PM_012")
  9279. {
  9280. cre.Properties["S_PM_012"] = item["settingvalue"];
  9281. }
  9282. else if (item["settingcode"].ToString() == "S_PM_013")
  9283. {
  9284. cre.Properties["S_PM_013"] = item["settingvalue"];
  9285. }
  9286. }
  9287. cre.Properties["PlatelitNum"] = sre.Result;
  9288. actionResult.Result = JsonHelper.ToJson(cre.Properties);
  9289. }
  9290. else
  9291. {
  9292. actionResult.Status = (int)Constant.PDAResult.Fail;
  9293. actionResult.Message = "";
  9294. }
  9295. return actionResult;
  9296. }
  9297. }
  9298. #endregion
  9299. #region 成型报损
  9300. if (module == "GroutingScrapProduct")
  9301. {
  9302. // 查询注浆日报明细表
  9303. if ("GetGroutingDailyDetail" == action)
  9304. {
  9305. ClientRequestEntity cre = new ClientRequestEntity();
  9306. cre.NameSpace = module;
  9307. cre.Name = action;
  9308. if (!string.IsNullOrEmpty(jsonData))
  9309. {
  9310. cre.Properties["BarCode"] = data["BarCode"];
  9311. }
  9312. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetGroutingDailyDetail(cre, sUserInfo);
  9313. //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9314. actionResult.Status = (int)Constant.PDAResult.Success;
  9315. if (sre == null || sre.Data == null || sre.Data.Tables.Count == 0
  9316. || sre.Data.Tables[0].Rows.Count == 0)
  9317. {
  9318. actionResult.Message = "未查询到该产品信息,请确认该产品是否已经进行注浆!";
  9319. actionResult.Status = (int)Constant.PDAResult.Fail;
  9320. }
  9321. else
  9322. {
  9323. DataRow _barCodeRow = sre.Data.Tables[0].Rows[0];
  9324. // 判断是否进行了注浆
  9325. if ("0".Equals(_barCodeRow["GroutingFlag"]))
  9326. {
  9327. actionResult.Message = "该产品还未进行注浆!";
  9328. actionResult.Status = (int)Constant.PDAResult.Fail;
  9329. }
  9330. // 判断是否进行了交坯
  9331. if ("1".Equals(_barCodeRow["DeliverFlag"]))
  9332. {
  9333. actionResult.Message = "该产品已经交坯!";
  9334. actionResult.Status = (int)Constant.PDAResult.Fail;
  9335. }
  9336. // 判断是否已经报损
  9337. if ("1".Equals(_barCodeRow["ScrapFlag"]))
  9338. {
  9339. actionResult.Message = "该产品已经报损!";
  9340. actionResult.Status = (int)Constant.PDAResult.Fail;
  9341. }
  9342. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9343. }
  9344. }
  9345. // 获取成型报损原因
  9346. else if ("GetScrapReasonData" == action)
  9347. {
  9348. ClientRequestEntity cre = new ClientRequestEntity();
  9349. cre.NameSpace = module;
  9350. cre.Name = action;
  9351. ServiceResultEntity sre = SystemModuleLogic.GetScrapReasonData(cre, sUserInfo);
  9352. actionResult.Status = (int)Constant.PDAResult.Success;
  9353. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9354. }
  9355. // 保存成型报损
  9356. else if ("SaveGroutingScrapProduct" == action)
  9357. {
  9358. ClientRequestEntity cre = new ClientRequestEntity();
  9359. cre.NameSpace = module;
  9360. cre.Name = action;
  9361. if (!string.IsNullOrEmpty(jsonData))
  9362. {
  9363. // DataSet returnData = JsonHelper.FromJson<DataSet>(jsonData);
  9364. DataTable dt = JsonHelper.FromJson<DataTable>(data["Table"] + "");
  9365. DataTable dtResponsible = JsonHelper.FromJson<DataTable>(data["Table1"] + "");
  9366. if (dt != null && dt.Rows.Count > 0)
  9367. {
  9368. // 总单信息
  9369. DataRow properties = dt.Rows[0];
  9370. cre.Properties["BarCode"] = properties["BarCode"]; // 产品条码
  9371. cre.Properties["GoodsID"] = properties["GoodsID"]; // 产品ID
  9372. cre.Properties["GoodsCode"] = properties["GoodsCode"]; // 产品编码
  9373. cre.Properties["GoodsName"] = properties["GoodsName"]; // 产品名称
  9374. cre.Properties["GroutingDailyID"] = properties["GroutingDailyID"]; // 注浆日报ID
  9375. cre.Properties["GroutingDailyDetailID"] = properties["GroutingDailyDetailID"]; // 注浆日报明细ID
  9376. cre.Properties["GroutingDate"] = properties["GroutingDate"]; // 注浆日期
  9377. cre.Properties["GroutingLineID"] = properties["GroutingLineID"]; // 成型生产线ID
  9378. cre.Properties["GroutingLineCode"] = properties["GroutingLineCode"]; // 成型生产线编码
  9379. cre.Properties["GroutingLineName"] = properties["GroutingLineName"]; // 成型生产线名称
  9380. cre.Properties["GMouldTypeID"] = properties["GMouldTypeID"]; // 成型线类型ID
  9381. cre.Properties["GroutingLineDetailID"] = properties["GroutingLineDetailID"]; // 成型生产线明细ID
  9382. cre.Properties["GroutingMouldCode"] = properties["GroutingMouldCode"]; // 注浆模具编号
  9383. cre.Properties["MouldCode"] = properties["MouldCode"]; // 模具编号
  9384. cre.Properties["GroutingUserID"] = properties["GroutingUserID"]; // 注浆工号ID
  9385. cre.Properties["GroutingUserCode"] = properties["GroutingUserCode"]; // 注浆工号编码
  9386. cre.Properties["GroutingNum"] = properties["GroutingNum"]; // 注浆次数
  9387. cre.Properties["ScrapType"] = properties["ScrapType"]; // 损坯类型
  9388. cre.Properties["ScrapDate"] = properties["ScrapDate"]; // 报损日期
  9389. cre.Properties["ScrapRreasonID"] = properties["ScrapRreasonID"]; // 报损日期
  9390. cre.Properties["ResponUserID"] = properties["ResponUserID"]; // 损坯工号
  9391. cre.Properties["ResponUserCode"] = properties["ResponUserCode"];
  9392. cre.Properties["Remarks"] = properties["Remarks"]; // 备注
  9393. cre.Properties["AuditStatus"] = properties["AuditStatus"]; // 审批状态
  9394. // 责任员工
  9395. cre.Data = new DataSet();
  9396. //DataTable returnTable = returnData.Tables[1].Copy();
  9397. cre.Data.Tables.Add(dtResponsible);
  9398. }
  9399. }
  9400. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveGroutingScrapProduct(cre, sUserInfo);
  9401. if (sre.Status == Constant.ServiceResultStatus.Success)
  9402. {
  9403. actionResult.Status = (int)Constant.PDAResult.Success;
  9404. actionResult.Result = sre.Result;
  9405. }
  9406. else
  9407. {
  9408. actionResult.Status = (int)Constant.PDAResult.Fail;
  9409. actionResult.Result = sre.OtherStatus;
  9410. actionResult.Message = sre.Message;
  9411. }
  9412. }
  9413. // 获取成型报损信息 用于撤销使用
  9414. else if ("GetGroutingScrapProduct" == action)
  9415. {
  9416. ClientRequestEntity cre = new ClientRequestEntity();
  9417. cre.NameSpace = module;
  9418. cre.Name = action;
  9419. if (!string.IsNullOrEmpty(jsonData))
  9420. {
  9421. cre.Properties["BarCode"] = data["BarCode"];
  9422. }
  9423. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetGroutingScrapProduct(cre, sUserInfo);
  9424. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9425. actionResult.Status = (int)Constant.PDAResult.Success;
  9426. }
  9427. //xuwei add 2020-03-23
  9428. //获取成型报损信息 用于撤销使用 支持 浆日报直接报损
  9429. else if ("GetGroutingScrap" == action)
  9430. {
  9431. ClientRequestEntity cre = new ClientRequestEntity();
  9432. cre.NameSpace = module;
  9433. cre.Name = action;
  9434. if (!string.IsNullOrEmpty(jsonData))
  9435. {
  9436. cre.Properties["BarCode"] = data["BarCode"];
  9437. }
  9438. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetGroutingScrap(cre, sUserInfo);
  9439. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9440. actionResult.Status = (int)Constant.PDAResult.Success;
  9441. }
  9442. // 撤销成型报损
  9443. else if ("ReverseGroutingScrapProduct" == action)
  9444. {
  9445. ClientRequestEntity cre = new ClientRequestEntity();
  9446. cre.NameSpace = module;
  9447. cre.Name = action;
  9448. if (!string.IsNullOrEmpty(jsonData))
  9449. {
  9450. cre.Properties["BarCode"] = data["BarCode"];
  9451. }
  9452. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.ReverseGroutingScrapProduct(cre, sUserInfo);
  9453. if (sre.Status == Constant.ServiceResultStatus.Success)
  9454. {
  9455. actionResult.Status = (int)Constant.PDAResult.Success;
  9456. actionResult.Result = sre.Result;
  9457. }
  9458. else
  9459. {
  9460. actionResult.Status = (int)Constant.PDAResult.Fail;
  9461. actionResult.Result = sre.OtherStatus;
  9462. actionResult.Message = sre.Message;
  9463. }
  9464. }
  9465. }
  9466. #endregion
  9467. #region 产品挂起
  9468. if (module == "ProductSuspend")
  9469. {
  9470. // 获取可以挂起的工序(干补、装车、入窑、出窑)工序不能挂起
  9471. if (action == "GetSuspendProcedure")
  9472. {
  9473. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetSuspendProcedure(sUserInfo);
  9474. if (sre.Status == Constant.ServiceResultStatus.Success)
  9475. {
  9476. actionResult.Status = (int)Constant.PDAResult.Success;
  9477. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9478. }
  9479. else
  9480. {
  9481. actionResult.Status = (int)Constant.PDAResult.Fail;
  9482. actionResult.Message = sre.Message;
  9483. }
  9484. return actionResult;
  9485. }
  9486. // 验证挂起条码
  9487. if (action == "CheckSuspendBarcode")
  9488. {
  9489. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.CheckSuspendBarcode(sUserInfo, data["barcode"] + "");
  9490. if (sre.Status == Constant.ServiceResultStatus.Success)
  9491. {
  9492. actionResult.Status = (int)Constant.PDAResult.Success;
  9493. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9494. }
  9495. else
  9496. {
  9497. actionResult.Status = (int)Constant.PDAResult.Fail;
  9498. actionResult.Message = sre.Message;
  9499. }
  9500. return actionResult;
  9501. }
  9502. // 挂起条码
  9503. if (action == "SaveSuspendProduct")
  9504. {
  9505. int[] gids = JsonHelper.FromJson<int[]>(data["groutingdailydetailids"] + "");
  9506. int[] pids = JsonHelper.FromJson<int[]>(data["procedureids"] + "");
  9507. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveSuspendProduct(sUserInfo, pids, gids, data["remarks"] + "");
  9508. if (sre.Status == Constant.ServiceResultStatus.Success)
  9509. {
  9510. actionResult.Status = (int)Constant.PDAResult.Success;
  9511. //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9512. }
  9513. else
  9514. {
  9515. actionResult.Status = (int)Constant.PDAResult.Fail;
  9516. actionResult.Message = sre.Message;
  9517. }
  9518. return actionResult;
  9519. }
  9520. // 撤销挂起条码
  9521. if (action == "DeleteSuspendProduct")
  9522. {
  9523. int[] gids = JsonHelper.FromJson<int[]>(data["groutingdailydetailids"] + "");
  9524. int[] pids = JsonHelper.FromJson<int[]>(data["procedureids"] + "");
  9525. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.DeleteSuspendProduct(sUserInfo, pids, gids);
  9526. if (sre.Status == Constant.ServiceResultStatus.Success)
  9527. {
  9528. actionResult.Status = (int)Constant.PDAResult.Success;
  9529. //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9530. }
  9531. else
  9532. {
  9533. actionResult.Status = (int)Constant.PDAResult.Fail;
  9534. actionResult.Message = sre.Message;
  9535. }
  9536. return actionResult;
  9537. }
  9538. // 查询挂起条码
  9539. if (action == "GetSuspendProduct")
  9540. {
  9541. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetSuspendProduct(sUserInfo, data["barcode"] + "");
  9542. if (sre.Status == Constant.ServiceResultStatus.Success)
  9543. {
  9544. if (sre.Data.Tables[0].Rows.Count == 0)
  9545. {
  9546. actionResult.Status = (int)Constant.PDAResult.Fail;
  9547. actionResult.Message = "此条码没有可撤销的挂起信息";
  9548. }
  9549. else
  9550. {
  9551. actionResult.Status = (int)Constant.PDAResult.Success;
  9552. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9553. }
  9554. }
  9555. else
  9556. {
  9557. actionResult.Status = (int)Constant.PDAResult.Fail;
  9558. actionResult.Message = sre.Message;
  9559. }
  9560. return actionResult;
  9561. }
  9562. }
  9563. #endregion
  9564. #region 品保抽查
  9565. if (module == "QASpotCheck")
  9566. {
  9567. if (action == "GetAllQASpotCheck")
  9568. {
  9569. ClientRequestEntity cre = new ClientRequestEntity();
  9570. cre.NameSpace = module;
  9571. cre.Name = action;
  9572. if (data != null && data.Count > 0)
  9573. {
  9574. foreach (string item in data.Keys)
  9575. {
  9576. if (item.StartsWith("checktime"))
  9577. {
  9578. cre.Properties.Add(item, DateTime.ParseExact(data[item] + "", "yyyy-MM-dd", null));
  9579. }
  9580. else
  9581. {
  9582. cre.Properties.Add(item, data[item]);
  9583. }
  9584. }
  9585. }
  9586. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetAllQASpotCheck(sUserInfo, cre));
  9587. if (sre.Status == Constant.ServiceResultStatus.Success)
  9588. {
  9589. actionResult.Status = (int)Constant.PDAResult.Success;
  9590. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9591. }
  9592. else if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  9593. {
  9594. actionResult.Status = (int)Constant.PDAResult.Success;
  9595. }
  9596. else
  9597. {
  9598. actionResult.Status = (int)Constant.PDAResult.Fail;
  9599. actionResult.Message = sre.Message;
  9600. }
  9601. return actionResult;
  9602. }
  9603. if (action == "AutoSaveQASpotCheck")
  9604. {
  9605. string barcode = data["barcode"] + "";
  9606. string remarks = data["remarks"] + "";
  9607. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.AutoSaveQASpotCheck(sUserInfo, barcode, remarks));
  9608. if (sre.Status == Constant.ServiceResultStatus.Success)
  9609. {
  9610. actionResult.Status = (int)Constant.PDAResult.Success;
  9611. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9612. }
  9613. else
  9614. {
  9615. actionResult.Status = (int)Constant.PDAResult.Fail;
  9616. actionResult.Message = sre.Message;
  9617. }
  9618. return actionResult;
  9619. }
  9620. if (action == "CheckQASpotCheck")
  9621. {
  9622. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.CheckQASpotCheck(sUserInfo, jsonData));
  9623. if (sre.Status == Constant.ServiceResultStatus.Success)
  9624. {
  9625. actionResult.Status = (int)Constant.PDAResult.Success;
  9626. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9627. }
  9628. else
  9629. {
  9630. actionResult.Status = (int)Constant.PDAResult.Fail;
  9631. actionResult.Message = sre.Message;
  9632. }
  9633. return actionResult;
  9634. }
  9635. if (action == "SaveQASpotCheck")
  9636. {
  9637. data["CheckTime"] = DateTime.ParseExact(data["CheckTime"] + "", "yyyy-MM-dd HH:mm:ss", null);
  9638. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveQASpotCheck(sUserInfo, data));
  9639. if (sre.Status == Constant.ServiceResultStatus.Success)
  9640. {
  9641. actionResult.Status = (int)Constant.PDAResult.Success;
  9642. }
  9643. else
  9644. {
  9645. actionResult.Status = (int)Constant.PDAResult.Fail;
  9646. actionResult.Message = sre.Message;
  9647. }
  9648. return actionResult;
  9649. }
  9650. return null;
  9651. }
  9652. #endregion
  9653. #region 产成品交接
  9654. if (module == "FinishedProduct")
  9655. {
  9656. #region 产成品交接、整板撤销 by fubin 20200824
  9657. // 交接验证
  9658. if (action == "FinishedHandoverBarcode")
  9659. {
  9660. string barcode = data["Barcode"] + "";
  9661. ServiceResultEntity sre = PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo);
  9662. if (sre.Data != null && sre.Data.Tables.Count > 0)
  9663. {
  9664. actionResult.Status = (int)Constant.PDAResult.Success;
  9665. actionResult.Result = JsonHelper.ToJson(sre.Data);
  9666. actionResult.Message = sre.Message;
  9667. }
  9668. else
  9669. {
  9670. actionResult.Status = (int)Constant.PDAResult.Fail;
  9671. actionResult.Message = sre.Message;
  9672. }
  9673. return actionResult;
  9674. }
  9675. // 交接操作
  9676. if (action == "SaveFinishedHandover")
  9677. {
  9678. int orderID = Convert.ToInt32(data["OrderID"]);
  9679. DataTable dt = JsonHelper.FromJson<DataTable>(data["Table"] + "");
  9680. ServiceResultEntity sre = PMModuleLogicDAL.SaveFinishedHandover(orderID, dt, sUserInfo);
  9681. if (Convert.ToInt32(sre.Result) > 0)
  9682. {
  9683. actionResult.Status = (int)Constant.PDAResult.Success;
  9684. actionResult.Message = "产成品交接成功";
  9685. }
  9686. else
  9687. {
  9688. actionResult.Status = (int)Constant.PDAResult.Fail;
  9689. actionResult.Message = sre.Message;
  9690. }
  9691. return actionResult;
  9692. }
  9693. // 撤销交接验证
  9694. if (action == "BackFinishedHandoverCheck")
  9695. {
  9696. string barcode = data["Barcode"] + "";
  9697. ServiceResultEntity sre = PMModuleLogic.BackFinishedHandoverCheck(barcode, sUserInfo);
  9698. if (sre.Data != null && sre.Data.Tables.Count > 0)
  9699. {
  9700. actionResult.Status = (int)Constant.PDAResult.Success;
  9701. actionResult.Result = JsonHelper.ToJson(sre.Data);
  9702. actionResult.Message = sre.Message;
  9703. }
  9704. else
  9705. {
  9706. actionResult.Status = (int)Constant.PDAResult.Fail;
  9707. actionResult.Message = sre.Message;
  9708. }
  9709. return actionResult;
  9710. }
  9711. // 撤销交接操作
  9712. if (action == "BackFinishedHandover")
  9713. {
  9714. DataTable dt = JsonHelper.FromJson<DataTable>(data["Table"] + "");
  9715. ServiceResultEntity sre = PMModuleLogicDAL.BackFinishedHandover(dt, sUserInfo);
  9716. if (Convert.ToInt32(sre.Result) > 0)
  9717. {
  9718. actionResult.Status = (int)Constant.PDAResult.Success;
  9719. actionResult.Message = "产成品撤销交接成功";
  9720. }
  9721. else
  9722. {
  9723. actionResult.Status = (int)Constant.PDAResult.Fail;
  9724. actionResult.Message = sre.Message;
  9725. }
  9726. return actionResult;
  9727. }
  9728. #endregion
  9729. // 设定商标
  9730. if (action == "GetFinishedBarcode")
  9731. {
  9732. string barcode = data["barcode"].ToString();
  9733. ServiceResultEntity resultEntity = PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo, 2);
  9734. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9735. if (Convert.ToInt32(resultEntity.Result) < 0)
  9736. {
  9737. actionResult.Status = (int)Constant.PDAResult.Fail;
  9738. actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
  9739. actionResult.Message = resultEntity.Message;
  9740. }
  9741. else
  9742. {
  9743. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9744. actionResult.Status = (int)Constant.PDAResult.Success;
  9745. actionResult.Message = resultEntity.Message;
  9746. }
  9747. return actionResult;
  9748. }
  9749. if (action == "GetHandoveredBarcode")
  9750. {
  9751. string barcode = data["barcode"].ToString();
  9752. ServiceResultEntity resultEntity = PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo, 1);
  9753. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9754. if (Convert.ToInt32(resultEntity.Result) < 0)
  9755. {
  9756. actionResult.Status = (int)Constant.PDAResult.Fail;
  9757. actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
  9758. actionResult.Message = resultEntity.Message;
  9759. }
  9760. else
  9761. {
  9762. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9763. actionResult.Status = (int)Constant.PDAResult.Success;
  9764. actionResult.Message = resultEntity.Message;
  9765. }
  9766. return actionResult;
  9767. }
  9768. if (action == "SetFinishedLogo")
  9769. {
  9770. int logoid = Convert.ToInt32(data["logoid"]);
  9771. string[] barcodes = data["barcodes"].ToString().Split(',');
  9772. int result = PMModuleLogicDAL.SetFinishedLogo(barcodes, logoid, sUserInfo);
  9773. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9774. if (result < 0)
  9775. {
  9776. actionResult.Status = (int)Constant.PDAResult.Fail;
  9777. }
  9778. else
  9779. {
  9780. actionResult.Status = (int)Constant.PDAResult.Success;
  9781. }
  9782. return actionResult;
  9783. }
  9784. if (action == "SetHandoveredOrder")
  9785. {
  9786. int orderID = Convert.ToInt32(data["orderID"]);
  9787. string[] barcodes = data["barcodes"].ToString().Split(',');
  9788. int result = PMModuleLogicDAL.SetHandoveredOrder(barcodes, orderID, sUserInfo);
  9789. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9790. if (result < 0)
  9791. {
  9792. actionResult.Status = (int)Constant.PDAResult.Fail;
  9793. }
  9794. else
  9795. {
  9796. actionResult.Status = (int)Constant.PDAResult.Success;
  9797. }
  9798. return actionResult;
  9799. }
  9800. }
  9801. #endregion
  9802. #region 产成品装车
  9803. /*
  9804. if (module == "FinishedLoading")
  9805. {
  9806. // 设定商标
  9807. if (action == "GetMaxLoadingNo")
  9808. {
  9809. int no = Service.PMModuleService.PMModuleLogic.GetMaxLoadingNo(sUserInfo);
  9810. actionResult.Status = (int)Constant.PDAResult.Success;
  9811. actionResult.Result = no;
  9812. return actionResult;
  9813. }
  9814. if (action == "CheckFinishedLaodingBarcode")
  9815. {
  9816. string barcode = data["barcode"].ToString();
  9817. ServiceResultEntity resultEntity = Service.PMModuleService.PMModuleLogic.CheckFinishedLaodingBarcode(sUserInfo, barcode);
  9818. if (resultEntity.Status == Constant.ServiceResultStatus.Success)
  9819. {
  9820. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9821. actionResult.Status = (int)Constant.PDAResult.Success;
  9822. actionResult.Message = resultEntity.Message;
  9823. }
  9824. else
  9825. {
  9826. actionResult.Status = (int)Constant.PDAResult.Fail;
  9827. actionResult.Result = resultEntity.OtherStatus;
  9828. actionResult.Message = resultEntity.Message;
  9829. }
  9830. return actionResult;
  9831. }
  9832. if (action == "SaveFinishedLoading")
  9833. {
  9834. int loadingNo = Convert.ToInt32(data["loadingNo"]);
  9835. string carLicense = data["carLicense"] + "";
  9836. int palletNum = Convert.ToInt32(data["palletNum"]);
  9837. int goodsNum = Convert.ToInt32(data["goodsNum"]);
  9838. string remarks = data["remarks"] + "";
  9839. Dictionary<string, object>[] details =
  9840. JsonHelper.FromJson<Dictionary<string, object>[]>(data["details"] + "");
  9841. //"[{\"A\":1,\"B\":\"V\"},{\"A\":2,\"B\":\"V1\"}]"
  9842. ServiceResultEntity result = Service.PMModuleService.PMModuleLogic.SaveFinishedLoading(sUserInfo,
  9843. loadingNo, carLicense, palletNum, goodsNum, remarks, details);
  9844. if (result.Status == Constant.ServiceResultStatus.Success)
  9845. {
  9846. actionResult.Status = (int)Constant.PDAResult.Success;
  9847. actionResult.Message = result.Message;
  9848. }
  9849. else
  9850. {
  9851. actionResult.Status = (int)Constant.PDAResult.Fail;
  9852. actionResult.Result = result.OtherStatus;
  9853. actionResult.Message = result.Message;
  9854. }
  9855. return actionResult;
  9856. }
  9857. }
  9858. */
  9859. #endregion
  9860. #region 产成品质量改判
  9861. if (module == "FinishedProductTamper")
  9862. {
  9863. // 获取产成品信息及缺陷数据
  9864. if (action == "GetDefectData")
  9865. {
  9866. string barcode = data["barcode"].ToString();
  9867. ServiceResultEntity sre = PDAModuleLogic.GetDefectData(barcode, sUserInfo);
  9868. if (sre.Status == Constant.ServiceResultStatus.Success)
  9869. {
  9870. actionResult.Status = (int)Constant.PDAResult.Success;
  9871. actionResult.Result = JsonHelper.ToJson(sre.Result);
  9872. actionResult.Message = sre.Message;
  9873. }
  9874. else
  9875. {
  9876. actionResult.Status = (int)Constant.PDAResult.Fail;
  9877. actionResult.Result = sre.OtherStatus;
  9878. actionResult.Message = sre.Message;
  9879. }
  9880. return actionResult;
  9881. }
  9882. // 获取产成品信息及缺陷数据
  9883. if (action == "SaveDefectData")
  9884. {
  9885. ProductionDataEntity productionDataEntity = JsonHelper.FromJson<ProductionDataEntity>(data["ProductionDataEntity"] + "");
  9886. ServiceResultEntity sre = PDAModuleLogic.SaveDefectData(productionDataEntity, sUserInfo);
  9887. if (sre.Status == Constant.ServiceResultStatus.Success)
  9888. {
  9889. actionResult.Status = (int)Constant.PDAResult.Success;
  9890. actionResult.Message = sre.Message;
  9891. }
  9892. else
  9893. {
  9894. actionResult.Status = (int)Constant.PDAResult.Fail;
  9895. actionResult.Message = sre.Message;
  9896. }
  9897. return actionResult;
  9898. }
  9899. // 通过条码查出责任工序(成品改判用)
  9900. if (action == "GetDutyProcedureByBarCodeForTamper")
  9901. {
  9902. string barcode = data["barcode"] + "";
  9903. int defectid = int.Parse(data["defectid"] + "");
  9904. ServiceResultEntity sre = PDAModuleLogic.GetDutyProcedureByBarCodeForTamper(barcode, defectid, sUserInfo.AccountID);
  9905. if (sre.Status == Constant.ServiceResultStatus.Success)
  9906. {
  9907. actionResult.Status = (int)Constant.PDAResult.Success;
  9908. actionResult.Result = JsonHelper.ToJson(sre.Data);
  9909. actionResult.Message = sre.Message;
  9910. }
  9911. else
  9912. {
  9913. actionResult.Status = (int)Constant.PDAResult.Fail;
  9914. actionResult.Result = sre.OtherStatus;
  9915. actionResult.Message = sre.Message;
  9916. }
  9917. return actionResult;
  9918. }
  9919. }
  9920. #endregion
  9921. #region PDA独立功能
  9922. #region 水效标识
  9923. if (module == "WaterEffect")
  9924. {
  9925. // 获取产成品信息及水效标识
  9926. if (action == "GetGoodsByBarCode")
  9927. {
  9928. string barcode = data["barcode"].ToString();
  9929. ServiceResultEntity sre = PDAModuleLogic.GetGoodsByBarCode(barcode, sUserInfo);
  9930. if (sre.Status == Constant.ServiceResultStatus.Success)
  9931. {
  9932. actionResult.Status = (int)Constant.PDAResult.Success;
  9933. actionResult.Result = JsonHelper.ToJson(sre.Result);
  9934. actionResult.Message = sre.Message;
  9935. }
  9936. else
  9937. {
  9938. actionResult.Status = (int)Constant.PDAResult.Fail;
  9939. actionResult.Result = sre.OtherStatus;
  9940. actionResult.Message = sre.Message;
  9941. }
  9942. return actionResult;
  9943. }
  9944. }
  9945. #endregion
  9946. #region 盖板型号
  9947. if (module == "SeatCoverType")
  9948. {
  9949. // 获取产成品信息及水效标识
  9950. if (action == "SendGoodsCodeToPLC")
  9951. {
  9952. string barcode = data["barcode"].ToString();
  9953. int sre = PLCModuleLogic.SendGoodsCodeToPLCBySeatCover(barcode, sUserInfo);
  9954. if (sre == 0)
  9955. {
  9956. actionResult.Status = (int)Constant.PDAResult.Success;
  9957. }
  9958. else
  9959. {
  9960. actionResult.Status = (int)Constant.PDAResult.Fail;
  9961. actionResult.Result = sre;
  9962. switch (sre)
  9963. {
  9964. case 1:
  9965. case 2:
  9966. actionResult.Message = "无效条码";
  9967. break;
  9968. case 3:
  9969. actionResult.Message = "此产品型号没有设置盖板标识码";
  9970. break;
  9971. case 4:
  9972. actionResult.Message = "当前用户没有设置PLC参数";
  9973. break;
  9974. case 5:
  9975. actionResult.Message = "PLC参数设置不全";
  9976. break;
  9977. default:
  9978. actionResult.Message = "PLC通信异常";
  9979. break;
  9980. }
  9981. }
  9982. return actionResult;
  9983. }
  9984. }
  9985. #endregion
  9986. #region PDA PLC 相关功能
  9987. if (module == "PDA_FUN_PLC")
  9988. {
  9989. // PDA扫码发送到PLCServer
  9990. if (action == "SendBarcodeToPLCServer")
  9991. {
  9992. string barcode = data["barcode"].ToString();
  9993. int sre = PLCModuleLogic.SendBarcodeToPLCServer(barcode, sUserInfo);
  9994. if (sre == 0)
  9995. {
  9996. actionResult.Status = (int)Constant.PDAResult.Success;
  9997. }
  9998. else
  9999. {
  10000. actionResult.Status = (int)Constant.PDAResult.Fail;
  10001. actionResult.Result = sre;
  10002. switch (sre)
  10003. {
  10004. case 1:
  10005. case 2:
  10006. actionResult.Message = "无效条码";
  10007. break;
  10008. case 3:
  10009. actionResult.Message = "PLC通信异常";
  10010. break;
  10011. case 4:
  10012. actionResult.Message = "当前用户没有设置PLC参数";
  10013. break;
  10014. case 5:
  10015. actionResult.Message = "PLC参数设置不全";
  10016. break;
  10017. default:
  10018. actionResult.Message = "PLC通信异常";
  10019. break;
  10020. }
  10021. }
  10022. return actionResult;
  10023. }
  10024. }
  10025. #endregion
  10026. #endregion
  10027. #region 半检返修
  10028. if (module == "SemiRework")
  10029. {
  10030. // 验证半检返修条码
  10031. if (action == "CheckSemiReworkBarcode")
  10032. {
  10033. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10034. PMModuleLogic.CheckSemiReworkBarcode(jsonData);
  10035. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  10036. if (Convert.ToInt32(resultEntity.Result) < 0)
  10037. {
  10038. actionResult.Status = (int)Constant.PDAResult.Fail;
  10039. }
  10040. else
  10041. {
  10042. actionResult.Status = (int)Constant.PDAResult.Success;
  10043. }
  10044. actionResult.Message = resultEntity.Message;
  10045. return actionResult;
  10046. }
  10047. // 可以返修的工序
  10048. if (action == "GetSemiReworkProcedure")
  10049. {
  10050. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10051. PMModuleLogic.GetSemiReworkProcedure(jsonData, sUserInfo);
  10052. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  10053. actionResult.Status = (int)Constant.PDAResult.Success;
  10054. return actionResult;
  10055. }
  10056. // 根据条码获取经过的工序,用于责任工序
  10057. if (action == "GetSemiReworkPassProcedure")
  10058. {
  10059. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10060. PMModuleLogic.GetSemiReworkPassProcedure(jsonData);
  10061. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  10062. actionResult.Status = (int)Constant.PDAResult.Success;
  10063. return actionResult;
  10064. }
  10065. // 根据所选生产工序(生产数据ID)查询责任员工
  10066. if (action == "GetSemiReworkDefectStaffByProductionDataID")
  10067. {
  10068. int productionDataID = Convert.ToInt32(jsonData);
  10069. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10070. PMModuleLogic.GetSemiReworkDefectStaffByProductionDataID(productionDataID);
  10071. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  10072. actionResult.Status = (int)Constant.PDAResult.Success;
  10073. return actionResult;
  10074. }
  10075. // 根据所选工号,查出缺陷责任员工
  10076. if (action == "GetSemiReworkDefectStaffByUserID")
  10077. {
  10078. int userID = Convert.ToInt32(jsonData);
  10079. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10080. PMModuleLogic.GetSemiReworkDefectStaffByUserID(userID);
  10081. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  10082. actionResult.Status = (int)Constant.PDAResult.Success;
  10083. return actionResult;
  10084. }
  10085. // 新建半检返修
  10086. if (action == "AddSemiRework")
  10087. {
  10088. SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"]+"");
  10089. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10090. PMModuleLogic.AddSemiRework(entity, sUserInfo);
  10091. actionResult.Result = resultEntity.Result;
  10092. actionResult.Message = resultEntity.Message;
  10093. if (Convert.ToInt32(resultEntity.Result) > 0)
  10094. {
  10095. actionResult.Status = (int)Constant.PDAResult.Success;
  10096. }
  10097. else
  10098. {
  10099. actionResult.Status = (int)Constant.PDAResult.Fail;
  10100. }
  10101. return actionResult;
  10102. }
  10103. // 编辑半检返修
  10104. if (action == "EditSemiRework")
  10105. {
  10106. SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"] + "");
  10107. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10108. PMModuleLogic.EditSemiRework(entity, sUserInfo);
  10109. actionResult.Result = resultEntity.Result;
  10110. actionResult.Message = resultEntity.Message;
  10111. if (Convert.ToInt32(resultEntity.Result) > 0)
  10112. {
  10113. actionResult.Status = (int)Constant.PDAResult.Success;
  10114. }
  10115. else
  10116. {
  10117. actionResult.Status = (int)Constant.PDAResult.Fail;
  10118. }
  10119. return actionResult;
  10120. }
  10121. // 撤销半检返修
  10122. if (action == "CancelSemiRework")
  10123. {
  10124. SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"] + "");
  10125. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10126. PMModuleLogic.CancelSemiRework(entity, sUserInfo);
  10127. actionResult.Result = resultEntity.Result;
  10128. actionResult.Message = resultEntity.Message;
  10129. if (Convert.ToInt32(resultEntity.Result) > 0)
  10130. {
  10131. actionResult.Status = (int)Constant.PDAResult.Success;
  10132. }
  10133. else
  10134. {
  10135. actionResult.Status = (int)Constant.PDAResult.Fail;
  10136. }
  10137. return actionResult;
  10138. }
  10139. // 获取半检返修数据(PDA编辑用)
  10140. if (action == "GetSemiReworkByID")
  10141. {
  10142. int id = Convert.ToInt32(jsonData);
  10143. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10144. PMModuleLogic.GetSemiReworkByID(id,sUserInfo.UserCode);
  10145. DataTable data1 = resultEntity.Data.Tables[0];
  10146. DataTable data2 = resultEntity.Data.Tables[1];
  10147. DataTable data3 = resultEntity.Data.Tables[2];
  10148. if (data1.Rows.Count == 0)
  10149. {
  10150. actionResult.Status = (int)Constant.PDAResult.Fail;
  10151. actionResult.Message = "半检返修信息不存在";
  10152. return actionResult;
  10153. }
  10154. SemiReworkEntity srEntity = new SemiReworkEntity();
  10155. srEntity.SemiReworkID = id;
  10156. srEntity.BarCode = data1.Rows[0]["BarCode"] + "";
  10157. srEntity.ReworkProcedureID = Convert.ToInt32(data1.Rows[0]["ReworkProcedureID"]);
  10158. srEntity.Remarks = data1.Rows[0]["Remarks"] + "";
  10159. srEntity.SemiReworkDefects = new List<SemiReworkDefectEntity>();
  10160. foreach (DataRow row2 in data2.Rows)
  10161. {
  10162. SemiReworkDefectEntity defectEntity = new SemiReworkDefectEntity();
  10163. srEntity.SemiReworkDefects.Add(defectEntity);
  10164. defectEntity.SemiReworkDefectID = Convert.ToInt32(row2["SemiReworkDefectID"]);
  10165. defectEntity.SemiReworkID = id;
  10166. defectEntity.DefectID = Convert.ToInt32(row2["DefectID"]);
  10167. defectEntity.DefectCode = row2["DefectCode"] + "";
  10168. defectEntity.DefectName = row2["DefectName"] + "";
  10169. defectEntity.DefectPositionID = Convert.ToInt32(row2["DefectPositionID"]);
  10170. defectEntity.DefectPositionCode = row2["DefectPositionCode"] + "";
  10171. defectEntity.DefectPositionName = row2["DefectPositionName"] + "";
  10172. defectEntity.ScrapResponFlag = row2["ScrapResponFlag"] + "";
  10173. defectEntity.DefectProductionDataID = row2["DefectProductionDataID"].ToNullableInt32();
  10174. defectEntity.DefectProcedureID = row2["DefectProcedureID"].ToNullableInt32();
  10175. defectEntity.DefectProcedureCode = row2["DefectProcedureCode"] + "";
  10176. defectEntity.DefectProcedureName = row2["DefectProcedureName"] + "";
  10177. defectEntity.Remarks = row2["Remarks"] + "";
  10178. defectEntity.DefectUserID = Convert.ToInt32(row2["DefectUserID"]);
  10179. defectEntity.DefectUserCode = row2["DefectUserCode"] + "";
  10180. defectEntity.DefectUserName = row2["DefectUserName"] + "";
  10181. defectEntity.DefectResponsibles = new List<SemiReworkRPSEntity>();
  10182. defectEntity.ValueFlag = Convert.ToInt32(row2["ValueFlag"]);
  10183. DataRow[] row3s = data3.Select("SemiReworkDefectID=" + defectEntity.SemiReworkDefectID);
  10184. if (row3s.Length == 0)
  10185. {
  10186. continue;
  10187. }
  10188. foreach (DataRow row3 in row3s)
  10189. {
  10190. SemiReworkRPSEntity semiReworkRPS = new SemiReworkRPSEntity();
  10191. defectEntity.DefectResponsibles.Add(semiReworkRPS);
  10192. semiReworkRPS.SemiReworkDefectID = Convert.ToInt32(row3["SemiReworkDefectID"]);
  10193. semiReworkRPS.StaffID = Convert.ToInt32(row3["StaffID"]);
  10194. semiReworkRPS.StaffName = row3["StaffName"] + "";
  10195. semiReworkRPS.StaffCode = row3["StaffCode"] + "";
  10196. semiReworkRPS.SemiReworkID = Convert.ToInt32(row3["SemiReworkID"]);
  10197. semiReworkRPS.UserID = Convert.ToInt32(row3["UserID"]);
  10198. semiReworkRPS.UserCode = row3["UserCode"] + "";
  10199. semiReworkRPS.UJobsID = Convert.ToInt32(row3["UJobsID"]);
  10200. semiReworkRPS.SJobsID = Convert.ToInt32(row3["SJobsID"]);
  10201. }
  10202. }
  10203. //xuwei note 总单用于显示,信息较全
  10204. actionResult.Message = JsonHelper.ToJson(data1);
  10205. //xuwei note 总单信息不全,但有明细,用于回传保存
  10206. actionResult.Result = JsonHelper.ToJson(srEntity);
  10207. actionResult.Status = (int)Constant.PDAResult.Success;
  10208. }
  10209. }
  10210. #endregion
  10211. #region 窑车漏扫补件
  10212. if (module == "F_PM_0504")
  10213. {
  10214. // 验证窑车编码是否存在
  10215. if (action == "CheckKilnCar")
  10216. {
  10217. ClientRequestEntity cre = new ClientRequestEntity();
  10218. cre.Properties["kilncarcode"] = data["KilnCarCode"];
  10219. cre.Properties["procedureID"] = data["ProcedureID"];
  10220. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.CheckKilnCar(cre, sUserInfo);
  10221. if (sre.Status == Constant.ServiceResultStatus.Success)
  10222. {
  10223. actionResult.Status = (int)Constant.PDAResult.Success;
  10224. actionResult.Result = sre.Result;
  10225. }
  10226. else
  10227. {
  10228. actionResult.Status = (int)Constant.PDAResult.Fail;
  10229. actionResult.Message = sre.Message;
  10230. }
  10231. return actionResult;
  10232. }
  10233. // 验证窑车烧成批次号是否存在 和 是否能补漏扫
  10234. if (action == "CheckKilnCarBatchNo")
  10235. {
  10236. ClientRequestEntity cre = new ClientRequestEntity();
  10237. cre.Properties["KilnID"] = data["KilnID"];
  10238. cre.Properties["KilnCarID"] = data["KilnCarID"];
  10239. cre.Properties["ProcedureID"] = data["ProcedureID"];
  10240. cre.Properties["KilnCarBatchNo"] = data["KilnCarBatchNo"];
  10241. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.CheckKilnCarBatchNo(cre, sUserInfo);
  10242. if (sre.Status == Constant.ServiceResultStatus.Success)
  10243. {
  10244. actionResult.Status = (int)Constant.PDAResult.Success;
  10245. }
  10246. else
  10247. {
  10248. actionResult.Status = (int)Constant.PDAResult.Fail;
  10249. actionResult.Message = sre.Message;
  10250. }
  10251. return actionResult;
  10252. }
  10253. // 窑车漏扫补件
  10254. if (action == "SetKilnCarMissing")
  10255. {
  10256. ClientRequestEntity cre = new ClientRequestEntity();
  10257. cre.Properties["KilnCarBatchNo"] = data["KilnCarBatchNo"];
  10258. string carData = data["CarData"] + "";
  10259. DataTable dataTable = JsonHelper.FromJson<DataTable>(carData);
  10260. cre.Data = new DataSet();
  10261. cre.Data.Tables.Add(dataTable);
  10262. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.SetKilnCarMissing(cre, sUserInfo);
  10263. if (sre.Status == Constant.ServiceResultStatus.Success)
  10264. {
  10265. actionResult.Status = (int)Constant.PDAResult.Success;
  10266. }
  10267. else
  10268. {
  10269. actionResult.Status = (int)Constant.PDAResult.Fail;
  10270. actionResult.Message = sre.Message;
  10271. }
  10272. return actionResult;
  10273. }
  10274. }
  10275. #endregion
  10276. #region 工厂调出功能
  10277. if (module == "F_PM_3302")
  10278. {
  10279. // 工厂调出条码验证
  10280. if (action == "CheckAllocateOut")
  10281. {
  10282. ServiceResultEntity sre = PDAModuleLogic.CheckAllocateOut(
  10283. data["Barcode"] + "", Convert.ToInt32(data["OutFlag"]), sUserInfo);
  10284. if (sre.Data != null)
  10285. {
  10286. actionResult.Status = (int)Constant.PDAResult.Success;
  10287. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  10288. }
  10289. else{
  10290. actionResult.Status = (int)Constant.PDAResult.Fail;
  10291. actionResult.Message = sre.Message;
  10292. }
  10293. return actionResult;
  10294. }
  10295. // 保存工厂调出
  10296. if (action == "SaveAllocateOut")
  10297. {
  10298. ClientRequestEntity cre = new ClientRequestEntity();
  10299. cre.Properties["rreason"] = data["Rreason"];
  10300. cre.Properties["remarks"] = data["Remarks"];
  10301. DataTable dtAllocateOutData = JsonHelper.FromJson<DataTable>(data["AllocateOutData"] + "");
  10302. cre.Data = new DataSet();
  10303. cre.Data.Tables.Add(dtAllocateOutData);
  10304. ServiceResultEntity sre = PDAModuleLogic.SaveAllocateOut(cre, sUserInfo);
  10305. if (sre.OtherStatus > 0)
  10306. {
  10307. actionResult.Status = (int)Constant.PDAResult.Success;
  10308. }
  10309. else
  10310. {
  10311. actionResult.Status = (int)Constant.PDAResult.Fail;
  10312. actionResult.Message = sre.Message;
  10313. }
  10314. return actionResult;
  10315. }
  10316. // 撤销工厂调出
  10317. if (action == "CancelAllocateOut")
  10318. {
  10319. ClientRequestEntity cre = new ClientRequestEntity();
  10320. DataTable dtAllocateOutData = JsonHelper.FromJson<DataTable>(data["AllocateOutData"] + "");
  10321. cre.Data = new DataSet();
  10322. cre.Data.Tables.Add(dtAllocateOutData);
  10323. ServiceResultEntity sre = PDAModuleLogic.CancelAllocateOut(cre, sUserInfo);
  10324. if (sre.OtherStatus > 0)
  10325. {
  10326. actionResult.Status = (int)Constant.PDAResult.Success;
  10327. }
  10328. else
  10329. {
  10330. actionResult.Status = (int)Constant.PDAResult.Fail;
  10331. actionResult.Message = sre.Message;
  10332. }
  10333. return actionResult;
  10334. }
  10335. }
  10336. #endregion
  10337. #region 工位打卡
  10338. if (module == "01020601")
  10339. {
  10340. // 获取工号工位
  10341. if (action == "GetUserWorkStation")
  10342. {
  10343. ServiceResultEntity sre = SystemModuleLogic.GetUserWorkStation(sUserInfo);
  10344. if (!string.IsNullOrEmpty(sre.Message))
  10345. {
  10346. actionResult.Status = (int)Constant.PDAResult.Fail;
  10347. actionResult.Message = sre.Message;
  10348. }
  10349. else
  10350. {
  10351. actionResult.Status = (int)Constant.PDAResult.Success;
  10352. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  10353. }
  10354. return actionResult;
  10355. }
  10356. // 工号工位打卡
  10357. if (action == "SaveUserWorkStation")
  10358. {
  10359. ServiceResultEntity sre = SystemModuleLogic.SaveUserWorkStation(Convert.ToInt32(data["WorkStationID"]), sUserInfo);
  10360. if (sre.OtherStatus > 0)
  10361. {
  10362. actionResult.Status = (int)Constant.PDAResult.Success;
  10363. }
  10364. else
  10365. {
  10366. actionResult.Status = (int)Constant.PDAResult.Fail;
  10367. actionResult.Message = sre.Message;
  10368. }
  10369. return actionResult;
  10370. }
  10371. }
  10372. #endregion
  10373. return actionResult;
  10374. }
  10375. catch (Exception ex)
  10376. {
  10377. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  10378. OutputLog.TraceLog(LogPriority.Error,
  10379. this.ToString(),
  10380. System.Reflection.MethodBase.GetCurrentMethod().Name + System.Environment.NewLine +
  10381. JsonHelper.ToJson(sUserInfo) + System.Environment.NewLine +
  10382. " module:" + module + " action:" + action + " json:" + jsonData,
  10383. ex.ToString(),
  10384. LocalPath.LogExePath);
  10385. actionResult.Status = (int)Constant.PDAResult.Exception;
  10386. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  10387. }
  10388. return actionResult;
  10389. }
  10390. #endregion
  10391. }
  10392. }