PDAModuleService.cs 398 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317
  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. long ddd = DateTime.Now.Ticks;
  688. OutputLog.TraceLog(LogPriority.Information,
  689. this.ToString(),
  690. System.Reflection.MethodBase.GetCurrentMethod().Name,
  691. string.Format("PDA工序打印开始{0}:barcode {1}, userCode {2}, printWay {3}, copies {4} ProcedureID {5}",
  692. ddd,
  693. dtProductionData.Rows[0]["barcode"].ToString(),
  694. sUserInfo.UserCode, 0, procedureInfo.BarCodePrintCopies, procedureInfo.ProcedureID),
  695. LocalPath.LogExePath + "PrintBarcode\\");
  696. ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode_3C(dtProductionData.Rows[0]["barcode"].ToString(),
  697. procedureInfo.BarCodePrintCopies, null, sUserInfo, 0);
  698. OutputLog.TraceLog(LogPriority.Information,
  699. this.ToString(),
  700. System.Reflection.MethodBase.GetCurrentMethod().Name,
  701. string.Format("PDA工序打印结束{0}:Status {1}", ddd, sre.Status),
  702. LocalPath.LogExePath + "PrintBarcode\\");
  703. if (sre.Status != Constant.ServiceResultStatus.Success)
  704. {
  705. actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  706. actionResult.Message = sre.Message;
  707. return actionResult;
  708. }
  709. }
  710. }
  711. catch (Exception ex)
  712. {
  713. OutputLog.TraceLog(LogPriority.Error,
  714. this.ToString(),
  715. System.Reflection.MethodBase.GetCurrentMethod().Name,
  716. ex.ToString(),
  717. LocalPath.LogExePath);
  718. actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  719. actionResult.Message = "条码打印异常";
  720. return actionResult;
  721. }
  722. }
  723. #endregion PDA条码打印
  724. }
  725. catch (Exception ex)
  726. {
  727. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  728. OutputLog.TraceLog(LogPriority.Error,
  729. this.ToString(),
  730. System.Reflection.MethodBase.GetCurrentMethod().Name,
  731. ex.ToString(),
  732. LocalPath.LogExePath);
  733. try
  734. {
  735. string ss = JsonHelper.ToJson(productionDataEntitys);
  736. OutputLog.TraceLog(LogPriority.Error,
  737. this.ToString(),
  738. System.Reflection.MethodBase.GetCurrentMethod().Name,
  739. $" userCode:{userCode} procedureID:{procedureID} " + ss,
  740. LocalPath.LogExePath);
  741. }
  742. catch
  743. {
  744. }
  745. actionResult.Status = (int)Constant.PDAResult.Exception;
  746. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  747. }
  748. return actionResult;
  749. }
  750. #endregion
  751. #region 获得系统/基数数据
  752. /// <summary>
  753. /// 获得数据字典
  754. /// </summary>
  755. /// <param name="accountCode">帐套code</param>
  756. /// <param name="userCode">用户code</param>
  757. /// <param name="userPassword">用户密码</param>
  758. /// <param name="sessionKey">本次登陆密钥</param>
  759. /// <param name="dicType">字典类型</param>
  760. /// <returns></returns>
  761. public ActionResult GetDataDictionaryByType(string accountCode, string userCode, string userPassword, string sessionKey, string dicType)
  762. {
  763. ActionResult actionResult = new ActionResult();
  764. try
  765. {
  766. // 验证请求头信息
  767. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  768. // 验证失败
  769. if (actionResult.Status != (int)Constant.PDAResult.Success)
  770. {
  771. return actionResult;
  772. }
  773. DataTable dicDataTable = ServiceInvoker.Invoke<DataTable>(this,
  774. () => CommonModuleLogic.GetDataDictionaryByType(sUserInfo, dicType));
  775. actionResult.Result = JsonHelper.ToJson(dicDataTable);
  776. actionResult.Status = (int)Constant.PDAResult.Success;
  777. }
  778. catch (Exception ex)
  779. {
  780. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  781. OutputLog.TraceLog(LogPriority.Error,
  782. this.ToString(),
  783. System.Reflection.MethodBase.GetCurrentMethod().Name,
  784. ex.ToString(),
  785. LocalPath.LogExePath);
  786. actionResult.Status = (int)Constant.PDAResult.Exception;
  787. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  788. }
  789. return actionResult;
  790. }
  791. #endregion
  792. #region 检验工序接口
  793. /// <summary>
  794. /// 获得检验标识
  795. /// </summary>
  796. /// <param name="accountCode">帐套code</param>
  797. /// <param name="userCode">用户code</param>
  798. /// <param name="userPassword">用户密码</param>
  799. /// <param name="sessionKey">本次登陆密钥</param>
  800. /// <returns></returns>
  801. /// <remarks>
  802. /// 陈冰 2014.10.04 新建
  803. /// </remarks>
  804. public ActionResult GetDefectFlagData(string accountCode, string userCode, string userPassword, string sessionKey)
  805. {
  806. ActionResult actionResult = new ActionResult();
  807. try
  808. {
  809. // 验证请求头信息
  810. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  811. // 验证失败
  812. if (actionResult.Status != (int)Constant.PDAResult.Success)
  813. {
  814. return actionResult;
  815. }
  816. #region 构造缺陷标识的数据源
  817. DataTable dtDefectFlag = CreateDataSource.GetDefectFlagTable();
  818. #endregion
  819. actionResult.Result = JsonHelper.ToJson(dtDefectFlag);
  820. actionResult.Status = (int)Constant.PDAResult.Success;
  821. }
  822. catch (Exception ex)
  823. {
  824. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  825. OutputLog.TraceLog(LogPriority.Error,
  826. this.ToString(),
  827. System.Reflection.MethodBase.GetCurrentMethod().Name,
  828. ex.ToString(),
  829. LocalPath.LogExePath);
  830. actionResult.Status = (int)Constant.PDAResult.Exception;
  831. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  832. }
  833. return actionResult;
  834. }
  835. /// <summary>
  836. /// 由条码和当前检验工序获取返工工序
  837. /// </summary>
  838. /// <param name="accountCode">帐套code</param>
  839. /// <param name="userCode">用户code</param>
  840. /// <param name="userPassword">用户密码</param>
  841. /// <param name="sessionKey">本次登陆密钥</param>
  842. /// <param name="procedureID">当前检验工序ID</param>
  843. /// <param name="barcode">条码</param>
  844. /// <returns></returns>
  845. /// <remarks>
  846. /// 陈冰 2014.10.04 新建
  847. /// </remarks>
  848. public ActionResult GetReworkProcedureByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  849. {
  850. ActionResult actionResult = new ActionResult();
  851. try
  852. {
  853. // 验证请求头信息
  854. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  855. // 验证失败
  856. if (actionResult.Status != (int)Constant.PDAResult.Success)
  857. {
  858. return actionResult;
  859. }
  860. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  861. () => PMModuleLogic.GetReworkProcedureByBarcode(procedureID, barcode));
  862. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  863. {
  864. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  865. actionResult.Status = (int)Constant.PDAResult.Success;
  866. }
  867. else
  868. {
  869. actionResult.Status = (int)Constant.PDAResult.Fail;
  870. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  871. }
  872. }
  873. catch (Exception ex)
  874. {
  875. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  876. OutputLog.TraceLog(LogPriority.Error,
  877. this.ToString(),
  878. System.Reflection.MethodBase.GetCurrentMethod().Name,
  879. ex.ToString(),
  880. LocalPath.LogExePath);
  881. actionResult.Status = (int)Constant.PDAResult.Exception;
  882. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  883. }
  884. return actionResult;
  885. }
  886. /// <summary>
  887. /// 由当前检验工序获取缺陷列表
  888. /// </summary>
  889. /// <param name="accountCode">帐套code</param>
  890. /// <param name="userCode">用户code</param>
  891. /// <param name="userPassword">用户密码</param>
  892. /// <param name="sessionKey">本次登陆密钥</param>
  893. /// <param name="procedureID">当前检验工序ID</param>
  894. /// <param name="defectCode">缺陷编码</param>
  895. /// <returns></returns>
  896. /// <remarks>
  897. /// 陈冰 2014.10.04 新建
  898. /// </remarks>
  899. public ActionResult GetDefectByProcedureIDAndDefectCode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string defectCode)
  900. {
  901. ActionResult actionResult = new ActionResult();
  902. try
  903. {
  904. // 验证请求头信息
  905. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  906. // 验证失败
  907. if (actionResult.Status != (int)Constant.PDAResult.Success)
  908. {
  909. return actionResult;
  910. }
  911. object defectDs = ServiceInvoker.Invoke<object>(this,
  912. () => PMModuleLogic.GetDefectByProcedureIDAndDefectCode(procedureID, defectCode));
  913. if (defectDs != null)
  914. {
  915. actionResult.Result = JsonHelper.ToJson(defectDs);
  916. actionResult.Status = (int)Constant.PDAResult.Success;
  917. }
  918. else
  919. {
  920. actionResult.Status = (int)Constant.PDAResult.Fail;
  921. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  922. }
  923. }
  924. catch (Exception ex)
  925. {
  926. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  927. OutputLog.TraceLog(LogPriority.Error,
  928. this.ToString(),
  929. System.Reflection.MethodBase.GetCurrentMethod().Name,
  930. ex.ToString(),
  931. LocalPath.LogExePath);
  932. actionResult.Status = (int)Constant.PDAResult.Exception;
  933. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  934. }
  935. return actionResult;
  936. }
  937. /// <summary>
  938. /// 根据产品ID查出缺陷位置
  939. /// </summary>
  940. /// <param name="accountCode">帐套code</param>
  941. /// <param name="userCode">用户code</param>
  942. /// <param name="userPassword">用户密码</param>
  943. /// <param name="sessionKey">本次登陆密钥</param>
  944. /// <param name="goodsID">产品ID</param>
  945. /// <param name="positionCode">位置编码</param>
  946. /// <returns></returns>
  947. /// <remarks>
  948. /// 陈冰 2014.10.04 新建
  949. /// </remarks>
  950. public ActionResult GetDefectPositionByGoodsIDAndPositionCode(string accountCode, string userCode, string userPassword, string sessionKey, int goodsID, string positionCode)
  951. {
  952. ActionResult actionResult = new ActionResult();
  953. try
  954. {
  955. // 验证请求头信息
  956. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  957. // 验证失败
  958. if (actionResult.Status != (int)Constant.PDAResult.Success)
  959. {
  960. return actionResult;
  961. }
  962. // 缺陷位置已经不用在关联产品
  963. //object defectDs = ServiceInvoker.Invoke<object>(this,() => PMModuleLogic.GetDefectPositionByGoodsIDAndPositionCode(goodsID, positionCode));
  964. object defectDs = ServiceInvoker.Invoke<object>(this, () => PMModuleLogic.GetDefectPosition(positionCode, sUserInfo));
  965. if (defectDs != null)
  966. {
  967. actionResult.Result = JsonHelper.ToJson(defectDs);
  968. actionResult.Status = (int)Constant.PDAResult.Success;
  969. }
  970. else
  971. {
  972. actionResult.Status = (int)Constant.PDAResult.Fail;
  973. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  974. }
  975. }
  976. catch (Exception ex)
  977. {
  978. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  979. OutputLog.TraceLog(LogPriority.Error,
  980. this.ToString(),
  981. System.Reflection.MethodBase.GetCurrentMethod().Name,
  982. ex.ToString(),
  983. LocalPath.LogExePath);
  984. actionResult.Status = (int)Constant.PDAResult.Exception;
  985. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  986. }
  987. return actionResult;
  988. }
  989. /// <summary>
  990. /// 通过条码和缺陷查出责任工序
  991. /// </summary>
  992. /// <param name="accountCode">帐套code</param>
  993. /// <param name="userCode">用户code</param>
  994. /// <param name="userPassword">用户密码</param>
  995. /// <param name="sessionKey">本次登陆密钥</param>
  996. /// <param name="barcode">条码</param>
  997. /// <param name="defectid">缺陷ID</param>
  998. /// <returns></returns>
  999. /// <remarks>
  1000. /// 陈冰 2014.10.04 新建
  1001. /// </remarks>
  1002. public ActionResult GetDutyProcedureByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int defectid)
  1003. {
  1004. ActionResult actionResult = new ActionResult();
  1005. try
  1006. {
  1007. // 验证请求头信息
  1008. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1009. // 验证失败
  1010. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1011. {
  1012. return actionResult;
  1013. }
  1014. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1015. () => PMModuleLogic.GetDutyProcedureByBarCode(barcode, defectid, sUserInfo.AccountID));
  1016. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1017. {
  1018. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs);
  1019. actionResult.Status = (int)Constant.PDAResult.Success;
  1020. }
  1021. else
  1022. {
  1023. actionResult.Status = (int)Constant.PDAResult.Fail;
  1024. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1025. }
  1026. }
  1027. catch (Exception ex)
  1028. {
  1029. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1030. OutputLog.TraceLog(LogPriority.Error,
  1031. this.ToString(),
  1032. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1033. ex.ToString(),
  1034. LocalPath.LogExePath);
  1035. actionResult.Status = (int)Constant.PDAResult.Exception;
  1036. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1037. }
  1038. return actionResult;
  1039. }
  1040. /// <summary>
  1041. /// 通过条码与工序查出责任工号(己废)
  1042. /// </summary>
  1043. /// <param name="accountCode">帐套code</param>
  1044. /// <param name="userCode">用户code</param>
  1045. /// <param name="userPassword">用户密码</param>
  1046. /// <param name="sessionKey">本次登陆密钥</param>
  1047. /// <param name="barcode">条码</param>
  1048. /// <param name="dutyProcedureID">责任工序</param>
  1049. /// <returns></returns>
  1050. /// <remarks>
  1051. /// 陈冰 2014.10.04 新建
  1052. /// </remarks>
  1053. public ActionResult GetDutyProcedureCodeByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int dutyProcedureID)
  1054. {
  1055. ActionResult actionResult = new ActionResult();
  1056. try
  1057. {
  1058. // 验证请求头信息
  1059. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1060. // 验证失败
  1061. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1062. {
  1063. return actionResult;
  1064. }
  1065. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1066. () => PMModuleLogic.GetDutyProcedureCodeByBarCode(barcode, dutyProcedureID));
  1067. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1068. {
  1069. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1070. actionResult.Status = (int)Constant.PDAResult.Success;
  1071. }
  1072. else
  1073. {
  1074. actionResult.Status = (int)Constant.PDAResult.Fail;
  1075. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1076. }
  1077. }
  1078. catch (Exception ex)
  1079. {
  1080. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1081. OutputLog.TraceLog(LogPriority.Error,
  1082. this.ToString(),
  1083. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1084. ex.ToString(),
  1085. LocalPath.LogExePath);
  1086. actionResult.Status = (int)Constant.PDAResult.Exception;
  1087. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1088. }
  1089. return actionResult;
  1090. }
  1091. /// <summary>
  1092. /// 通过条码与工序查出责任工号
  1093. /// </summary>
  1094. /// <param name="accountCode"></param>
  1095. /// <param name="userCode"></param>
  1096. /// <param name="userPassword"></param>
  1097. /// <param name="sessionKey"></param>
  1098. /// <param name="ProductionDataID">生产数据ID</param>
  1099. /// <returns></returns>
  1100. public ActionResult GetDutyProcedureCodeByProductionDataID(string accountCode, string userCode, string userPassword, string sessionKey, int ProductionDataID)
  1101. {
  1102. ActionResult actionResult = new ActionResult();
  1103. try
  1104. {
  1105. // 验证请求头信息
  1106. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1107. // 验证失败
  1108. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1109. {
  1110. return actionResult;
  1111. }
  1112. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1113. () => PMModuleLogic.GetDutyProcedureCodeByProductionDataID(ProductionDataID));
  1114. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1115. {
  1116. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1117. actionResult.Status = (int)Constant.PDAResult.Success;
  1118. }
  1119. else
  1120. {
  1121. actionResult.Status = (int)Constant.PDAResult.Fail;
  1122. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1123. }
  1124. }
  1125. catch (Exception ex)
  1126. {
  1127. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1128. OutputLog.TraceLog(LogPriority.Error,
  1129. this.ToString(),
  1130. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1131. ex.ToString(),
  1132. LocalPath.LogExePath);
  1133. actionResult.Status = (int)Constant.PDAResult.Exception;
  1134. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1135. }
  1136. return actionResult;
  1137. }
  1138. /// <summary>
  1139. /// 通过生产数据与工号ID查询工种
  1140. /// </summary>
  1141. /// <param name="accountCode">帐套code</param>
  1142. /// <param name="userCode">用户code</param>
  1143. /// <param name="userPassword">用户密码</param>
  1144. /// <param name="sessionKey">本次登陆密钥</param>
  1145. /// <param name="productionDataID">生产数据ID</param>
  1146. /// <param name="userID">工号ID</param>
  1147. /// <returns></returns>
  1148. /// <remarks>
  1149. /// 陈冰 2014.10.08 新建
  1150. /// </remarks>
  1151. public ActionResult GetDutyJobsByUserIDAndProductionID(string accountCode, string userCode, string userPassword, string sessionKey,
  1152. //int productionDataID, int userID)
  1153. int classesSettingID, int defectid, int procedureID)
  1154. {
  1155. ActionResult actionResult = new ActionResult();
  1156. try
  1157. {
  1158. // 验证请求头信息
  1159. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1160. // 验证失败
  1161. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1162. {
  1163. return actionResult;
  1164. }
  1165. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1166. //() => PMModuleLogic.GetDutyJobsCodeByUser(userID, productionDataID));
  1167. () => PDAModuleLogic.GetDutyJobsCodeByUser(classesSettingID, defectid, procedureID));
  1168. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1169. {
  1170. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1171. actionResult.Status = (int)Constant.PDAResult.Success;
  1172. }
  1173. else
  1174. {
  1175. actionResult.Status = (int)Constant.PDAResult.Fail;
  1176. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1177. }
  1178. }
  1179. catch (Exception ex)
  1180. {
  1181. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1182. OutputLog.TraceLog(LogPriority.Error,
  1183. this.ToString(),
  1184. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1185. ex.ToString(),
  1186. LocalPath.LogExePath);
  1187. actionResult.Status = (int)Constant.PDAResult.Exception;
  1188. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1189. }
  1190. return actionResult;
  1191. }
  1192. /// <summary>
  1193. /// 根据生产数据ID,用户ID及工种选出责任员工
  1194. /// </summary>
  1195. /// <param name="accountCode">帐套code</param>
  1196. /// <param name="userCode">用户code</param>
  1197. /// <param name="userPassword">用户密码</param>
  1198. /// <param name="sessionKey">本次登陆密钥</param>
  1199. /// <param name="productionDataID">生产数据ID</param>
  1200. /// <param name="userID">工号ID</param>
  1201. /// <param name="jobsID">工种ID</param>
  1202. /// <returns></returns>
  1203. /// <remarks>
  1204. /// 陈冰 2014.10.08 新建
  1205. /// </remarks>
  1206. public ActionResult GetDutyStaffByUserIDAndJobs(string accountCode, string userCode, string userPassword, string sessionKey,
  1207. //int productionDataID, int userID, int jobsID)
  1208. int classesSettingID, int jobsID)
  1209. {
  1210. ActionResult actionResult = new ActionResult();
  1211. try
  1212. {
  1213. // 验证请求头信息
  1214. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1215. // 验证失败
  1216. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1217. {
  1218. return actionResult;
  1219. }
  1220. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1221. //() => PMModuleLogic.GetDutyStaffByUserIDAndJobs(productionDataID, userID, jobsID));
  1222. () => PDAModuleLogic.GetDutyStaffByUserIDAndJobs(classesSettingID, jobsID));
  1223. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1224. {
  1225. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1226. actionResult.Status = (int)Constant.PDAResult.Success;
  1227. }
  1228. else
  1229. {
  1230. actionResult.Status = (int)Constant.PDAResult.Fail;
  1231. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1232. }
  1233. }
  1234. catch (Exception ex)
  1235. {
  1236. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1237. OutputLog.TraceLog(LogPriority.Error,
  1238. this.ToString(),
  1239. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1240. ex.ToString(),
  1241. LocalPath.LogExePath);
  1242. actionResult.Status = (int)Constant.PDAResult.Exception;
  1243. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1244. }
  1245. return actionResult;
  1246. }
  1247. /// <summary>
  1248. /// 获得产品分级
  1249. /// </summary>
  1250. /// <param name="accountCode">帐套code</param>
  1251. /// <param name="userCode">用户code</param>
  1252. /// <param name="userPassword">用户密码</param>
  1253. /// <param name="sessionKey">本次登陆密钥</param>
  1254. /// <returns></returns>
  1255. /// <remarks>
  1256. /// 陈冰 2014.10.08 新建
  1257. /// xuwei 2019-12-4 添加参数type 默认为2成检 为1时 半检
  1258. /// </remarks>
  1259. public ActionResult GetGoodsGradeData(string accountCode, string userCode, string userPassword, string sessionKey, int type = 2)
  1260. {
  1261. ActionResult actionResult = new ActionResult();
  1262. try
  1263. {
  1264. // 验证请求头信息
  1265. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1266. // 验证失败
  1267. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1268. {
  1269. return actionResult;
  1270. }
  1271. #region 构造产品分级的数据源
  1272. //DataTable dtGrade = CreateDataSource.GetGoodsGradeTable();
  1273. //xuwei modify 2019-12-04 支持半检 没传参数 type=0
  1274. //DataSet dsGrade = SystemModuleLogic.GetGoodsLevel(2 , sUserInfo);
  1275. DataSet dsGrade = SystemModuleLogic.GetGoodsLevel(type == 0 ? 2 : type, sUserInfo);
  1276. if (dsGrade != null && dsGrade.Tables.Count > Constant.INT_IS_ZERO)
  1277. {
  1278. actionResult.Result = JsonHelper.ToJson(dsGrade.Tables[0]);
  1279. actionResult.Status = (int)Constant.PDAResult.Success;
  1280. }
  1281. else
  1282. {
  1283. actionResult.Status = (int)Constant.PDAResult.Fail;
  1284. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1285. }
  1286. #endregion
  1287. }
  1288. catch (Exception ex)
  1289. {
  1290. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1291. OutputLog.TraceLog(LogPriority.Error,
  1292. this.ToString(),
  1293. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1294. ex.ToString(),
  1295. LocalPath.LogExePath);
  1296. OutputLog.TraceLog(LogPriority.Error,
  1297. this.ToString(),
  1298. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1299. ex.ToString(),
  1300. LocalPath.LogExePath);
  1301. actionResult.Status = (int)Constant.PDAResult.Exception;
  1302. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1303. }
  1304. return actionResult;
  1305. }
  1306. #endregion
  1307. #region 保存检验条码
  1308. /// <summary>
  1309. /// 保存检验条码
  1310. /// </summary>
  1311. /// <param name="accountCode">帐套code</param>
  1312. /// <param name="userCode">用户code</param>
  1313. /// <param name="userPassword">用户密码</param>
  1314. /// <param name="sessionKey">本次登陆密钥</param>
  1315. /// <param name="procedureID">工序ID</param>
  1316. /// <param name="productionDataEntitys">条码信息</param>
  1317. /// <returns></returns>
  1318. public ActionResult AddCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, ProductionDataEntity[] productionDataEntitys)
  1319. {
  1320. ActionResult actionResult = new ActionResult();
  1321. try
  1322. {
  1323. // 验证请求头信息
  1324. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1325. // 验证失败
  1326. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1327. {
  1328. return actionResult;
  1329. }
  1330. //if(productionDataEntitys.Length>0)
  1331. //{
  1332. // if(productionDataEntitys[0].ProductionDataID>0)
  1333. // {
  1334. // productionDataEntitys[0].OPTimeStamp = Convert.ToDateTime(productionDataEntitys[0].OPTimeStampPDA.Replace("-","/"));
  1335. // }
  1336. //}
  1337. string err = ServiceInvoker.Invoke<string>(this,
  1338. //() => PMModuleLogicDAL.AddCheckBarcode(procedureID, productionDataEntitys, sUserInfo));
  1339. () => PMModuleLogicDAL.AddCheckBarcodePDA(procedureID, productionDataEntitys, sUserInfo));
  1340. if (err == null)
  1341. {
  1342. err = "";
  1343. }
  1344. //actionResult.Result = JsonHelper.ToJson(err);
  1345. actionResult.Result = err;// JsonHelper.ToJson(err);
  1346. actionResult.Status = (int)Constant.PDAResult.Success;
  1347. }
  1348. catch (Exception ex)
  1349. {
  1350. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1351. OutputLog.TraceLog(LogPriority.Error,
  1352. this.ToString(),
  1353. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1354. ex.ToString(),
  1355. LocalPath.LogExePath);
  1356. actionResult.Status = (int)Constant.PDAResult.Exception;
  1357. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1358. }
  1359. return actionResult;
  1360. }
  1361. #endregion
  1362. #region 文件上传下载
  1363. /// <summary>
  1364. /// 软件更新
  1365. /// </summary>
  1366. /// <param name="accountCode">帐套code</param>
  1367. /// <param name="userCode">用户code</param>
  1368. /// <param name="userPassword">用户密码</param>
  1369. /// <param name="sessionKey">本次登陆密钥</param>
  1370. /// <returns></returns>
  1371. public Stream AutoUpgrade(string accountCode, string userCode, string userPassword, string sessionKey)
  1372. {
  1373. try
  1374. {
  1375. return ServiceInvoker.Invoke<Stream>(this, () => PDAModuleLogic.AutoUpgrade());
  1376. }
  1377. catch (Exception ex)
  1378. {
  1379. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1380. OutputLog.TraceLog(LogPriority.Error,
  1381. this.ToString(),
  1382. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1383. ex.ToString(),
  1384. LocalPath.LogExePath);
  1385. return null;
  1386. }
  1387. }
  1388. /// <summary>
  1389. /// 上传临时文件
  1390. /// </summary>
  1391. /// <param name="imgStream"></param>
  1392. /// <returns></returns>
  1393. public ActionResult SaveImg(Stream mageStream)
  1394. {
  1395. ActionResult actionResult = new ActionResult();
  1396. try
  1397. {
  1398. string err = PDAModuleLogic.SaveImg(mageStream);
  1399. if (err == null)
  1400. {
  1401. err = "";
  1402. }
  1403. actionResult.Result = err;
  1404. actionResult.Status = (int)Constant.PDAResult.Success;
  1405. }
  1406. catch (Exception ex)
  1407. {
  1408. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1409. OutputLog.TraceLog(LogPriority.Error,
  1410. this.ToString(),
  1411. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1412. ex.ToString(),
  1413. LocalPath.LogExePath);
  1414. actionResult.Status = (int)Constant.PDAResult.Exception;
  1415. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1416. }
  1417. return actionResult;
  1418. }
  1419. public Stream GetFileTest(string path)
  1420. {
  1421. return PDAModuleLogic.GetImg(path);
  1422. }
  1423. public Stream GetFileStream()
  1424. {
  1425. FileStream fs = new FileStream("999.apk", FileMode.OpenOrCreate, FileAccess.Read);
  1426. long l = fs.Length;
  1427. return fs;
  1428. }
  1429. public byte[] GetFileTestByte(string path)
  1430. {
  1431. FileStream stream = new FileInfo(path).OpenRead();
  1432. Byte[] buffer = new Byte[stream.Length];
  1433. //从流中读取字节块并将该数据写入给定缓冲区buffer中
  1434. stream.Read(buffer, 0, Convert.ToInt32(stream.Length));
  1435. return buffer;
  1436. }
  1437. public string GetFile(string path)
  1438. {
  1439. string imgFilePath = path;
  1440. System.IO.FileStream fs = new System.IO.FileStream(imgFilePath, System.IO.FileMode.Open);
  1441. int i = (int)fs.Length;
  1442. byte[] content = new byte[i];
  1443. fs.Read(content, 0, i);
  1444. string result = Convert.ToBase64String(content);
  1445. fs.Close();
  1446. FileStream fsTxt = new FileStream("A.txt", FileMode.OpenOrCreate);
  1447. StreamWriter sw = new StreamWriter(fsTxt, System.Text.Encoding.Default);
  1448. sw.Write(result);
  1449. sw.Close();
  1450. fsTxt.Close();
  1451. return result;
  1452. }
  1453. #endregion
  1454. /// <summary>
  1455. /// 获得产品分级
  1456. /// </summary>
  1457. /// <param name="accountCode">帐套code</param>
  1458. /// <param name="userCode">用户code</param>
  1459. /// <param name="userPassword">用户密码</param>
  1460. /// <param name="sessionKey">本次登陆密钥</param>
  1461. /// <param name="procedureID">当前工序ID</param>
  1462. /// <returns></returns>
  1463. /// <remarks>
  1464. /// 陈冰 2014.10.22 新建
  1465. /// </remarks>
  1466. public ActionResult GetReworkProcedureByProcedureID(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  1467. {
  1468. ActionResult actionResult = new ActionResult();
  1469. try
  1470. {
  1471. // 验证请求头信息
  1472. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1473. // 验证失败
  1474. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1475. {
  1476. return actionResult;
  1477. }
  1478. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1479. () => PMModuleLogic.GetReworkProcedureByProcedureID(procedureID));
  1480. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1481. {
  1482. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1483. actionResult.Status = (int)Constant.PDAResult.Success;
  1484. }
  1485. else
  1486. {
  1487. actionResult.Status = (int)Constant.PDAResult.Fail;
  1488. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1489. }
  1490. }
  1491. catch (Exception ex)
  1492. {
  1493. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1494. OutputLog.TraceLog(LogPriority.Error,
  1495. this.ToString(),
  1496. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1497. ex.ToString(),
  1498. LocalPath.LogExePath);
  1499. actionResult.Status = (int)Constant.PDAResult.Exception;
  1500. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1501. }
  1502. return actionResult;
  1503. }
  1504. /// <summary>
  1505. /// 获得产品分级
  1506. /// </summary>
  1507. /// <param name="accountCode">帐套code</param>
  1508. /// <param name="userCode">用户code</param>
  1509. /// <param name="userPassword">用户密码</param>
  1510. /// <param name="sessionKey">本次登陆密钥</param>
  1511. /// <param name="barcode">条码</param>
  1512. /// <returns></returns>
  1513. public ActionResult GetKilnCarByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  1514. {
  1515. ActionResult actionResult = new ActionResult();
  1516. try
  1517. {
  1518. // 验证请求头信息
  1519. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1520. // 验证失败
  1521. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1522. {
  1523. return actionResult;
  1524. }
  1525. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1526. () => PMModuleLogic.GetKilnCarByBarCode(barcode));
  1527. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1528. {
  1529. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1530. actionResult.Status = (int)Constant.PDAResult.Success;
  1531. }
  1532. else
  1533. {
  1534. actionResult.Status = (int)Constant.PDAResult.Fail;
  1535. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1536. }
  1537. }
  1538. catch (Exception ex)
  1539. {
  1540. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1541. OutputLog.TraceLog(LogPriority.Error,
  1542. this.ToString(),
  1543. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1544. ex.ToString(),
  1545. LocalPath.LogExePath);
  1546. actionResult.Status = (int)Constant.PDAResult.Exception;
  1547. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1548. }
  1549. return actionResult;
  1550. }
  1551. #region 统计
  1552. /// <summary>
  1553. /// 统计当日计数数量
  1554. /// </summary>
  1555. /// <param name="accountCode">帐套code</param>
  1556. /// <param name="userCode">用户code</param>
  1557. /// <param name="userPassword">用户密码</param>
  1558. /// <param name="sessionKey">本次登陆密钥</param>
  1559. /// <param name="procedureID">工序ID</param>
  1560. /// <returns></returns>
  1561. public ActionResult StatisticsCollectBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  1562. {
  1563. ActionResult actionResult = new ActionResult();
  1564. try
  1565. {
  1566. // 验证请求头信息
  1567. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1568. // 验证失败
  1569. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1570. {
  1571. return actionResult;
  1572. }
  1573. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1574. () => PDAModuleLogic.StatisticsCollectBarcode(procedureID, sUserInfo));
  1575. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1576. {
  1577. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1578. actionResult.Status = (int)Constant.PDAResult.Success;
  1579. }
  1580. else
  1581. {
  1582. actionResult.Status = (int)Constant.PDAResult.Fail;
  1583. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1584. }
  1585. }
  1586. catch (Exception ex)
  1587. {
  1588. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1589. OutputLog.TraceLog(LogPriority.Error,
  1590. this.ToString(),
  1591. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1592. ex.ToString(),
  1593. LocalPath.LogExePath);
  1594. actionResult.Status = (int)Constant.PDAResult.Exception;
  1595. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1596. }
  1597. return actionResult;
  1598. }
  1599. /// <summary>
  1600. /// 统计当日计数数量
  1601. /// </summary>
  1602. /// <param name="accountCode">帐套code</param>
  1603. /// <param name="userCode">用户code</param>
  1604. /// <param name="userPassword">用户密码</param>
  1605. /// <param name="sessionKey">本次登陆密钥</param>
  1606. /// <param name="procedureID">工序ID</param>
  1607. /// <returns></returns>
  1608. public ActionResult StatisticsKilnCar(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  1609. {
  1610. ActionResult actionResult = new ActionResult();
  1611. try
  1612. {
  1613. // 验证请求头信息
  1614. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1615. // 验证失败
  1616. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1617. {
  1618. return actionResult;
  1619. }
  1620. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1621. () => PDAModuleLogic.StatisticsKilnCar(procedureID, sUserInfo));
  1622. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1623. {
  1624. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1625. actionResult.Status = (int)Constant.PDAResult.Success;
  1626. }
  1627. else
  1628. {
  1629. actionResult.Status = (int)Constant.PDAResult.Fail;
  1630. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1631. }
  1632. }
  1633. catch (Exception ex)
  1634. {
  1635. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1636. OutputLog.TraceLog(LogPriority.Error,
  1637. this.ToString(),
  1638. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1639. ex.ToString(),
  1640. LocalPath.LogExePath);
  1641. actionResult.Status = (int)Constant.PDAResult.Exception;
  1642. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1643. }
  1644. return actionResult;
  1645. }
  1646. /// <summary>
  1647. /// 统计产品跟踪
  1648. /// </summary>
  1649. /// <param name="accountCode">帐套code</param>
  1650. /// <param name="userCode">用户code</param>
  1651. /// <param name="userPassword">用户密码</param>
  1652. /// <param name="sessionKey">本次登陆密钥</param>
  1653. /// <param name="procedureID">工序ID</param>
  1654. /// <returns></returns>
  1655. public ActionResult StatisticsProductTrack(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  1656. {
  1657. ActionResult actionResult = new ActionResult();
  1658. try
  1659. {
  1660. // 验证请求头信息
  1661. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1662. // 验证失败
  1663. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1664. {
  1665. return actionResult;
  1666. }
  1667. RPT020101_SE se = new RPT020101_SE();
  1668. se.Barcode = barcode;
  1669. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  1670. () => Dongke.IBOSS.PRD.Service.ReportModuleLogic.ReportModuleLogic.GetRPT020101SData(sUserInfo, se));
  1671. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  1672. {
  1673. actionResult.Status = (int)Constant.PDAResult.Fail;
  1674. actionResult.Message = Messages.MSG_CMN_I002;
  1675. }
  1676. else
  1677. {
  1678. actionResult.Result = JsonHelper.ToJson(sre.Data);
  1679. actionResult.Status = (int)Constant.PDAResult.Success;
  1680. }
  1681. //ProductionDataEntity productionDataEntity = ServiceInvoker.Invoke<ProductionDataEntity>(this,
  1682. // () => PDAModuleLogic.StatisticsProductTrack(barcode, sUserInfo));
  1683. //if (productionDataEntity != null)
  1684. //{
  1685. // actionResult.Result = JsonHelper.ToJson(productionDataEntity);
  1686. // actionResult.Status = (int)Constant.PDAResult.Success;
  1687. //}
  1688. //else
  1689. //{
  1690. // actionResult.Status = (int)Constant.PDAResult.Fail;
  1691. // actionResult.Message = Messages.MSG_CMN_I002;
  1692. //}
  1693. }
  1694. catch (Exception ex)
  1695. {
  1696. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1697. OutputLog.TraceLog(LogPriority.Error,
  1698. this.ToString(),
  1699. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1700. ex.ToString() + ex.HelpLink,
  1701. LocalPath.LogExePath);
  1702. actionResult.Status = (int)Constant.PDAResult.Exception;
  1703. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1704. }
  1705. return actionResult;
  1706. }
  1707. #endregion
  1708. #region 撤销装车及成检
  1709. /// <summary>
  1710. /// 检验条码是否可以撤销装车
  1711. /// </summary>
  1712. /// <param name="accountCode">帐套code</param>
  1713. /// <param name="userCode">用户code</param>
  1714. /// <param name="userPassword">用户密码</param>
  1715. /// <param name="sessionKey">本次登陆密钥</param>
  1716. /// <param name="procedureID">当前工序ID</param>
  1717. /// <param name="barcode">条码</param>
  1718. /// <returns></returns>
  1719. public ActionResult CheckCancelLoadCar(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  1720. {
  1721. ActionResult actionResult = new ActionResult();
  1722. try
  1723. {
  1724. // 验证请求头信息
  1725. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1726. // 验证失败
  1727. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1728. {
  1729. return actionResult;
  1730. }
  1731. CheckCancelLoadCar checkCancelLoadCar = ServiceInvoker.Invoke<CheckCancelLoadCar>(this,
  1732. () => PMModuleLogic.CheckCancelLoadCar(procedureID, barcode, sUserInfo));
  1733. actionResult.Result = JsonHelper.ToJson(checkCancelLoadCar);
  1734. actionResult.Status = (int)Constant.PDAResult.Success;
  1735. }
  1736. catch (Exception ex)
  1737. {
  1738. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1739. OutputLog.TraceLog(LogPriority.Error,
  1740. this.ToString(),
  1741. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1742. ex.ToString(),
  1743. LocalPath.LogExePath);
  1744. actionResult.Status = (int)Constant.PDAResult.Exception;
  1745. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1746. }
  1747. return actionResult;
  1748. }
  1749. /// <summary>
  1750. /// 保存撤销装车的条码
  1751. /// </summary>
  1752. /// <param name="accountCode">帐套code</param>
  1753. /// <param name="userCode">用户code</param>
  1754. /// <param name="userPassword">用户密码</param>
  1755. /// <param name="sessionKey">本次登陆密钥</param>
  1756. /// <param name="procedureID">当前工序ID</param>
  1757. /// <param name="barcode">条码</param>
  1758. /// <returns></returns>
  1759. public ActionResult AddCancelLoadCar(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  1760. {
  1761. ActionResult actionResult = new ActionResult();
  1762. try
  1763. {
  1764. // 验证请求头信息
  1765. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1766. // 验证失败
  1767. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1768. {
  1769. return actionResult;
  1770. }
  1771. string err = ServiceInvoker.Invoke<string>(this,
  1772. () => PMModuleLogicDAL.AddCancelLoadCar(procedureID, barcode, sUserInfo));
  1773. if (err == null)
  1774. {
  1775. err = "";
  1776. }
  1777. actionResult.Result = JsonHelper.ToJson(err);
  1778. actionResult.Status = (int)Constant.PDAResult.Success;
  1779. }
  1780. catch (Exception ex)
  1781. {
  1782. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1783. OutputLog.TraceLog(LogPriority.Error,
  1784. this.ToString(),
  1785. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1786. ex.ToString(),
  1787. LocalPath.LogExePath);
  1788. actionResult.Status = (int)Constant.PDAResult.Exception;
  1789. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1790. }
  1791. return actionResult;
  1792. }
  1793. /// <summary>
  1794. /// 由产品条码获取注浆信息
  1795. /// </summary>
  1796. /// <param name="barcode"></param>
  1797. /// <returns></returns>
  1798. public ActionResult GetGroutingProducttByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  1799. {
  1800. ActionResult actionResult = new ActionResult();
  1801. try
  1802. {
  1803. // 验证请求头信息
  1804. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1805. // 验证失败
  1806. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1807. {
  1808. return actionResult;
  1809. }
  1810. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1811. () => PDAModuleLogic.GetGroutingProducttByBarCode(barcode));
  1812. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1813. {
  1814. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1815. actionResult.Status = (int)Constant.PDAResult.Success;
  1816. }
  1817. else
  1818. {
  1819. actionResult.Status = (int)Constant.PDAResult.Fail;
  1820. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1821. }
  1822. }
  1823. catch (Exception ex)
  1824. {
  1825. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1826. OutputLog.TraceLog(LogPriority.Error,
  1827. this.ToString(),
  1828. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1829. ex.ToString(),
  1830. LocalPath.LogExePath);
  1831. actionResult.Status = (int)Constant.PDAResult.Exception;
  1832. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1833. }
  1834. return actionResult;
  1835. }
  1836. /// <summary>
  1837. /// 获取工号下的所有工种信息
  1838. /// </summary>
  1839. /// <param name="UserID">工号ID</param>
  1840. /// <returns></returns>
  1841. public ActionResult GetAllJobsByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int UserID)
  1842. {
  1843. ActionResult actionResult = new ActionResult();
  1844. try
  1845. {
  1846. // 验证请求头信息
  1847. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1848. // 验证失败
  1849. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1850. {
  1851. return actionResult;
  1852. }
  1853. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1854. () => PDAModuleLogic.GetAllJobsByUserID(UserID, sUserInfo));
  1855. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1856. {
  1857. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1858. actionResult.Status = (int)Constant.PDAResult.Success;
  1859. }
  1860. else
  1861. {
  1862. actionResult.Status = (int)Constant.PDAResult.Fail;
  1863. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1864. }
  1865. }
  1866. catch (Exception ex)
  1867. {
  1868. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1869. OutputLog.TraceLog(LogPriority.Error,
  1870. this.ToString(),
  1871. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1872. ex.ToString(),
  1873. LocalPath.LogExePath);
  1874. actionResult.Status = (int)Constant.PDAResult.Exception;
  1875. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1876. }
  1877. return actionResult;
  1878. }
  1879. /// <summary>
  1880. /// 根据所选工号对应的工种,查出缺陷责任员工
  1881. /// </summary>
  1882. /// <param name="jobs">工种ID</param>
  1883. /// <returns></returns>
  1884. public ActionResult GetDutyStaffByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int jobs)
  1885. {
  1886. ActionResult actionResult = new ActionResult();
  1887. try
  1888. {
  1889. // 验证请求头信息
  1890. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1891. // 验证失败
  1892. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1893. {
  1894. return actionResult;
  1895. }
  1896. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1897. () => PDAModuleLogic.GetDutyStaffByUserID(jobs, sUserInfo));
  1898. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1899. {
  1900. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1901. actionResult.Status = (int)Constant.PDAResult.Success;
  1902. }
  1903. else
  1904. {
  1905. actionResult.Status = (int)Constant.PDAResult.Fail;
  1906. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1907. }
  1908. }
  1909. catch (Exception ex)
  1910. {
  1911. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1912. OutputLog.TraceLog(LogPriority.Error,
  1913. this.ToString(),
  1914. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1915. ex.ToString(),
  1916. LocalPath.LogExePath);
  1917. actionResult.Status = (int)Constant.PDAResult.Exception;
  1918. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1919. }
  1920. return actionResult;
  1921. }
  1922. /// <summary>
  1923. /// 根据所选工号,查出漏检责任员工
  1924. /// </summary>
  1925. /// <param name="userid">工号</param>
  1926. /// <returns></returns>
  1927. public ActionResult GetMissedStaffByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int userid)
  1928. {
  1929. ActionResult actionResult = new ActionResult();
  1930. try
  1931. {
  1932. // 验证请求头信息
  1933. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1934. // 验证失败
  1935. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1936. {
  1937. return actionResult;
  1938. }
  1939. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1940. () => PDAModuleLogic.GetMissedStaffByUserID(userid, sUserInfo));
  1941. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1942. {
  1943. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1944. actionResult.Status = (int)Constant.PDAResult.Success;
  1945. }
  1946. else
  1947. {
  1948. actionResult.Status = (int)Constant.PDAResult.Fail;
  1949. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1950. }
  1951. }
  1952. catch (Exception ex)
  1953. {
  1954. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1955. OutputLog.TraceLog(LogPriority.Error,
  1956. this.ToString(),
  1957. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1958. ex.ToString(),
  1959. LocalPath.LogExePath);
  1960. actionResult.Status = (int)Constant.PDAResult.Exception;
  1961. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1962. }
  1963. return actionResult;
  1964. }
  1965. /// <summary>
  1966. /// 获取用户列表
  1967. /// </summary>
  1968. /// <param name="requestEntity">用户实体</param>
  1969. /// <returns></returns>
  1970. public ActionResult SearchUserData(string accountCode, string userCode, string userPassword, string sessionKey, byte IsWorker)
  1971. {
  1972. ActionResult actionResult = new ActionResult();
  1973. try
  1974. {
  1975. // 验证请求头信息
  1976. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1977. // 验证失败
  1978. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1979. {
  1980. return actionResult;
  1981. }
  1982. SUserEntity requestEntity = new SUserEntity();
  1983. requestEntity.IsWorker = IsWorker;
  1984. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1985. () => PDAModuleLogic.SearchUserData(requestEntity, sUserInfo));
  1986. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1987. {
  1988. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1989. actionResult.Status = (int)Constant.PDAResult.Success;
  1990. }
  1991. else
  1992. {
  1993. actionResult.Status = (int)Constant.PDAResult.Fail;
  1994. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1995. }
  1996. }
  1997. catch (Exception ex)
  1998. {
  1999. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2000. OutputLog.TraceLog(LogPriority.Error,
  2001. this.ToString(),
  2002. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2003. ex.ToString(),
  2004. LocalPath.LogExePath);
  2005. actionResult.Status = (int)Constant.PDAResult.Exception;
  2006. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2007. }
  2008. return actionResult;
  2009. }
  2010. /// <summary>
  2011. /// 获取数据字典管理的数据
  2012. /// </summary>
  2013. /// <param name="Pvalue">显示停用标识</param>
  2014. /// <param name="dictionaryType">字典类别</param>
  2015. /// <returns></returns>
  2016. /// <remarks>
  2017. /// 2014.12.03 新建
  2018. /// </remarks>
  2019. public ActionResult GetDictionaryData(string accountCode, string userCode, string userPassword, string sessionKey, byte Pvalue, string dictionaryType)
  2020. {
  2021. ActionResult actionResult = new ActionResult();
  2022. try
  2023. {
  2024. // 验证请求头信息
  2025. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2026. // 验证失败
  2027. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2028. {
  2029. return actionResult;
  2030. }
  2031. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2032. () => PDAModuleLogic.GetDictionaryData(Pvalue, dictionaryType, sUserInfo));
  2033. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2034. {
  2035. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2036. actionResult.Status = (int)Constant.PDAResult.Success;
  2037. }
  2038. else
  2039. {
  2040. actionResult.Status = (int)Constant.PDAResult.Fail;
  2041. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2042. }
  2043. }
  2044. catch (Exception ex)
  2045. {
  2046. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2047. OutputLog.TraceLog(LogPriority.Error,
  2048. this.ToString(),
  2049. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2050. ex.ToString(),
  2051. LocalPath.LogExePath);
  2052. actionResult.Status = (int)Constant.PDAResult.Exception;
  2053. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2054. }
  2055. return actionResult;
  2056. }
  2057. #endregion
  2058. #region 保存半检数据
  2059. /// <summary>
  2060. /// 保存半检数据
  2061. /// </summary>
  2062. /// <param name="accountCode">帐套code</param>
  2063. /// <param name="userCode">用户code</param>
  2064. /// <param name="userPassword">用户密码</param>
  2065. /// <param name="sessionKey">本次登陆密钥</param>
  2066. /// <param name="productionDataEntitys">半检信息</param>
  2067. /// <returns></returns>
  2068. public ActionResult AddSemiTest(string accountCode, string userCode, string userPassword, string sessionKey, SemiTestEntity[] semiTestEntitys)
  2069. {
  2070. ActionResult actionResult = new ActionResult();
  2071. try
  2072. {
  2073. // 验证请求头信息
  2074. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2075. // 验证失败
  2076. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2077. {
  2078. return actionResult;
  2079. }
  2080. string err = ServiceInvoker.Invoke<string>(this,
  2081. () => PMModuleLogicDAL.AddSemiTest(semiTestEntitys, sUserInfo));
  2082. if (err == null)
  2083. {
  2084. err = "";
  2085. }
  2086. actionResult.Result = JsonHelper.ToJson(err);
  2087. actionResult.Status = (int)Constant.PDAResult.Success;
  2088. }
  2089. catch (Exception ex)
  2090. {
  2091. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2092. OutputLog.TraceLog(LogPriority.Error,
  2093. this.ToString(),
  2094. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2095. ex.ToString(),
  2096. LocalPath.LogExePath);
  2097. actionResult.Status = (int)Constant.PDAResult.Exception;
  2098. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2099. }
  2100. return actionResult;
  2101. }
  2102. #endregion
  2103. /// <summary>
  2104. /// 获取产品列表
  2105. /// </summary>
  2106. /// <returns></returns>
  2107. public ActionResult SerachGoods(string accountCode, string userCode, string userPassword, string sessionKey, int valueFlag)
  2108. {
  2109. ActionResult actionResult = new ActionResult();
  2110. try
  2111. {
  2112. // 验证请求头信息
  2113. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2114. // 验证失败
  2115. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2116. {
  2117. return actionResult;
  2118. }
  2119. GoodsEntity goodsEntity = new GoodsEntity();
  2120. goodsEntity.ValueFlag = 1;//有效标记
  2121. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2122. () => PDAModuleLogic.SerachGoods(sUserInfo, goodsEntity));
  2123. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2124. {
  2125. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2126. actionResult.Status = (int)Constant.PDAResult.Success;
  2127. }
  2128. else
  2129. {
  2130. actionResult.Status = (int)Constant.PDAResult.Fail;
  2131. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2132. }
  2133. }
  2134. catch (Exception ex)
  2135. {
  2136. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2137. OutputLog.TraceLog(LogPriority.Error,
  2138. this.ToString(),
  2139. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2140. ex.ToString(),
  2141. LocalPath.LogExePath);
  2142. actionResult.Status = (int)Constant.PDAResult.Exception;
  2143. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2144. }
  2145. return actionResult;
  2146. }
  2147. /// <summary>
  2148. /// 使用存储过程PRO_PM_GetProductionData获取生产工序计件数据
  2149. /// </summary>
  2150. /// <param name="searchEntity">生产数据实体类</param>
  2151. /// <returns>DataTable</returns>
  2152. public ActionResult GetProductionData(string accountCode, string userCode, string userPassword, string sessionKey, int ProcedureID, string BarCode)
  2153. {
  2154. ActionResult actionResult = new ActionResult();
  2155. try
  2156. {
  2157. // 验证请求头信息
  2158. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2159. // 验证失败
  2160. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2161. {
  2162. return actionResult;
  2163. }
  2164. SearchProductionDataEntity searchEntity = new SearchProductionDataEntity();
  2165. searchEntity.ProcedureID = ProcedureID;
  2166. searchEntity.BarCode = BarCode;
  2167. DataTable reworkDs = ServiceInvoker.Invoke<DataTable>(this,
  2168. () => PDAModuleLogic.GetProductionData(searchEntity, sUserInfo));
  2169. if (reworkDs != null && reworkDs.Rows.Count > Constant.INT_IS_ZERO)
  2170. {
  2171. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2172. actionResult.Status = (int)Constant.PDAResult.Success;
  2173. }
  2174. else
  2175. {
  2176. actionResult.Status = (int)Constant.PDAResult.Fail;
  2177. actionResult.Message = Constant.PDA_RESULT_ALLOW_ERR;
  2178. }
  2179. }
  2180. catch (Exception ex)
  2181. {
  2182. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2183. OutputLog.TraceLog(LogPriority.Error,
  2184. this.ToString(),
  2185. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2186. ex.ToString(),
  2187. LocalPath.LogExePath);
  2188. actionResult.Status = (int)Constant.PDAResult.Exception;
  2189. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2190. }
  2191. return actionResult;
  2192. }
  2193. /// <summary>
  2194. /// xuwei add 2020-03-23 此方法用于成检后 回收 再次成检 获取正确ID
  2195. /// </summary>
  2196. /// <param name="searchEntity">生产数据实体类</param>
  2197. /// <returns>DataTable</returns>
  2198. public ActionResult GetProductionDataCheckID(string accountCode, string userCode, string userPassword, string sessionKey, string BarCode)
  2199. {
  2200. ActionResult actionResult = new ActionResult();
  2201. try
  2202. {
  2203. // 验证请求头信息
  2204. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2205. // 验证失败
  2206. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2207. {
  2208. return actionResult;
  2209. }
  2210. SearchProductionDataEntity searchEntity = new SearchProductionDataEntity();
  2211. searchEntity.BarCode = BarCode;
  2212. DataTable reworkDs = ServiceInvoker.Invoke<DataTable>(this,
  2213. () => PDAModuleLogic.GetProductionDataCheckID(searchEntity, sUserInfo));
  2214. if (reworkDs != null && reworkDs.Rows.Count > Constant.INT_IS_ZERO)
  2215. {
  2216. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2217. actionResult.Status = (int)Constant.PDAResult.Success;
  2218. }
  2219. else
  2220. {
  2221. actionResult.Status = (int)Constant.PDAResult.Fail;
  2222. actionResult.Message = Constant.PDA_RESULT_ALLOW_ERR;
  2223. }
  2224. }
  2225. catch (Exception ex)
  2226. {
  2227. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2228. OutputLog.TraceLog(LogPriority.Error,
  2229. this.ToString(),
  2230. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2231. ex.ToString(),
  2232. LocalPath.LogExePath);
  2233. actionResult.Status = (int)Constant.PDAResult.Exception;
  2234. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2235. }
  2236. return actionResult;
  2237. }
  2238. /// <summary>
  2239. /// 根据所选生产数据ID,显示成检数据信息
  2240. /// </summary>
  2241. /// <param name="productionDataID">生产数据ID</param>
  2242. /// <returns>DataSet</returns>
  2243. public ActionResult GetProductionDataByID(string accountCode, string userCode, string userPassword, string sessionKey, int productionDataID)
  2244. {
  2245. ActionResult actionResult = new ActionResult();
  2246. try
  2247. {
  2248. // 验证请求头信息
  2249. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2250. // 验证失败
  2251. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2252. {
  2253. return actionResult;
  2254. }
  2255. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2256. () => PDAModuleLogic.GetProductionDataByID(productionDataID));
  2257. PDAProductionDataResult productionDatas = new PDAProductionDataResult();
  2258. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2259. {
  2260. if (reworkDs != null && reworkDs.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  2261. {
  2262. for (int i = 0; i < reworkDs.Tables[0].Rows.Count; i++)
  2263. {
  2264. PDAProductionDataResult productionData = new PDAProductionDataResult();
  2265. productionData.BarCode = reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
  2266. if (reworkDs.Tables[0].Rows[i]["GoodsID"].ToString() != "")
  2267. {
  2268. productionData.GoodsID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsID"].ToString());
  2269. }
  2270. productionData.GoodsCode = reworkDs.Tables[0].Rows[i]["GoodsCode"].ToString();
  2271. productionData.GoodsName = reworkDs.Tables[0].Rows[i]["GoodsName"].ToString();
  2272. if (reworkDs.Tables[0].Rows[0]["DefectFlagID"].ToString() != "")
  2273. {
  2274. productionData.DefectFlagID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["DefectFlagID"].ToString());
  2275. }
  2276. if (reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString() != "")
  2277. {
  2278. productionData.ReworkProcedureID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString());
  2279. }
  2280. productionData.Remarks = reworkDs.Tables[0].Rows[i]["Remarks"].ToString();
  2281. if (reworkDs.Tables[0].Rows[i]["UserID"].ToString() != "")
  2282. {
  2283. productionData.UserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["UserID"].ToString());
  2284. }
  2285. if (reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString() != "")
  2286. {
  2287. productionData.GoodsLevelTypeID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString());
  2288. }
  2289. productionData.UserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
  2290. productionData.UserName = reworkDs.Tables[0].Rows[i]["UserName"].ToString();
  2291. productionData.SpecialRepairflag = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["SpecialRepairflag"]);
  2292. productionData.IsReFire = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["IsReFire"]);
  2293. productionData.KilnCarCode = reworkDs.Tables[0].Rows[i]["KilnCarCode"].ToString();
  2294. productionData.KilnCode = reworkDs.Tables[0].Rows[i]["KilnCode"].ToString();
  2295. productionData.GlazeName = reworkDs.Tables[0].Rows[i]["GlazeName"].ToString();
  2296. if (reworkDs.Tables[0].Rows[i]["logoid"].ToString() != "")
  2297. {
  2298. productionData.LogoID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["logoid"]);
  2299. productionData.LogoCode = reworkDs.Tables[0].Rows[i]["LogoCode"].ToString();
  2300. productionData.LogoName = reworkDs.Tables[0].Rows[i]["LogoName"].ToString();
  2301. }
  2302. productionData.CreateTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["CreateTime"]);
  2303. if (reworkDs.Tables[0].Rows[i]["CheckTime"].ToString() != "")
  2304. {
  2305. productionData.CheckTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["CheckTime"].ToString());
  2306. }
  2307. DataView dvDefect = reworkDs.Tables[1].DefaultView;
  2308. dvDefect.RowFilter = "BarCode=" + reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
  2309. DataTable dtDefect = dvDefect.ToTable();
  2310. for (int row = 0; row < dtDefect.Rows.Count; row++)
  2311. {
  2312. // 产品缺陷
  2313. PDADefectResult defect = new PDADefectResult();
  2314. defect.SpecialDefect = dtDefect.Rows[row]["SpecialDefect"].ToString();
  2315. defect.DefectDeductionNum = Convert.ToDecimal(dtDefect.Rows[row]["DefectDeductionNum"].ToString());
  2316. if (dtDefect.Rows[row]["ProductionDefectID"].ToString() != "")
  2317. {
  2318. defect.ProductionDefectID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDefectID"].ToString());
  2319. }
  2320. defect.BarCode = dtDefect.Rows[row]["BarCode"].ToString();
  2321. if (dtDefect.Rows[row]["DefectID"].ToString() != "")
  2322. {
  2323. defect.DefectID = Convert.ToInt32(dtDefect.Rows[row]["DefectID"].ToString());
  2324. }
  2325. defect.DefectName = dtDefect.Rows[row]["DefectName"].ToString();
  2326. defect.DefectCode = dtDefect.Rows[row]["DefectCode"].ToString();
  2327. if (dtDefect.Rows[row]["DefectPositionID"].ToString() != "")
  2328. {
  2329. defect.DefectPositionID = Convert.ToInt32(dtDefect.Rows[row]["DefectPositionID"].ToString());
  2330. }
  2331. defect.DefectPositionName = dtDefect.Rows[row]["DefectPositionName"].ToString();
  2332. defect.DefectPositionCode = dtDefect.Rows[row]["DefectPositionCode"].ToString();
  2333. if (dtDefect.Rows[row]["DefectProcedureID"].ToString() != "")
  2334. {
  2335. defect.DefectProcedureID = Convert.ToInt32(dtDefect.Rows[row]["DefectProcedureID"].ToString());
  2336. }
  2337. defect.DefectProcedureName = dtDefect.Rows[row]["DefectProcedureName"].ToString();
  2338. defect.DefectProcedureCode = dtDefect.Rows[row]["DefectProcedureCode"].ToString();
  2339. if (dtDefect.Rows[row]["DefectUserID"].ToString() != "")
  2340. {
  2341. defect.DefectUserID = Convert.ToInt32(dtDefect.Rows[row]["DefectUserID"].ToString());
  2342. }
  2343. defect.DefectUserName = dtDefect.Rows[row]["DefectUserName"].ToString();
  2344. defect.DefectUserCode = dtDefect.Rows[row]["DefectUserCode"].ToString();
  2345. if (dtDefect.Rows[row]["Jobs"].ToString() != "")
  2346. {
  2347. defect.Jobs = Convert.ToInt32(dtDefect.Rows[row]["Jobs"].ToString());
  2348. }
  2349. if (dtDefect.Rows[row]["MissedUserID"].ToString() != "")
  2350. {
  2351. defect.MissedUserID = Convert.ToInt32(dtDefect.Rows[row]["MissedUserID"].ToString());
  2352. }
  2353. defect.MissedUserCode = dtDefect.Rows[row]["MissedUserCode"].ToString();
  2354. defect.MissedUserName = dtDefect.Rows[row]["MissedUserName"].ToString();
  2355. defect.JobsText = dtDefect.Rows[row]["JobsText"].ToString();
  2356. defect.DefectRemarks = dtDefect.Rows[row]["DefectRemarks"].ToString();
  2357. if (dtDefect.Rows[row]["ProductionDataID"].ToString() != "")
  2358. {
  2359. defect.ProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDataID"].ToString());
  2360. }
  2361. if (dtDefect.Rows[row]["DefectProductionDataID"].ToString() != "")
  2362. {
  2363. defect.DefectProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["DefectProductionDataID"].ToString());
  2364. }
  2365. if (dtDefect.Rows[row]["DefectFineID"].ToString() != "")
  2366. {
  2367. defect.DefectFineID = Convert.ToInt32(dtDefect.Rows[row]["DefectFineID"].ToString());
  2368. }
  2369. defect.DefectFineValue = dtDefect.Rows[row]["DefectFineValue"].ToString();
  2370. defect.CheckTime = Convert.ToDateTime(dtDefect.Rows[row]["CheckTime"]);
  2371. //--------责任员工-------------------
  2372. DataRow[] drRow = reworkDs.Tables[2].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[row]["ProductionDefectID"]);
  2373. if (drRow.Length > Constant.INT_IS_ZERO)
  2374. {
  2375. foreach (DataRow r in drRow)
  2376. {
  2377. PDADefectResponsibleResult defectResponsible = new PDADefectResponsibleResult();
  2378. if (r["ProductionDefectID"].ToString() != "")
  2379. {
  2380. defectResponsible.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
  2381. }
  2382. if (r["StaffID"].ToString() != "")
  2383. {
  2384. defectResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
  2385. }
  2386. defectResponsible.StaffCode = r["StaffCode"].ToString();
  2387. defectResponsible.StaffName = r["StaffName"].ToString();
  2388. if (r["StaffStatus"].ToString() != "")
  2389. {
  2390. defectResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
  2391. }
  2392. if (r["UJobsID"].ToString() != "")
  2393. {
  2394. defectResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
  2395. }
  2396. if (r["SJobsID"].ToString() != "")
  2397. {
  2398. defectResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
  2399. }
  2400. defect.PDADefectResponsibles.Add(defectResponsible);
  2401. }
  2402. }
  2403. //------------------------------
  2404. //--------漏检员工-------------------
  2405. DataRow[] drMissedRow = reworkDs.Tables[4].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[i]["ProductionDefectID"]);
  2406. if (drMissedRow.Length > Constant.INT_IS_ZERO)
  2407. {
  2408. foreach (DataRow r in drMissedRow)
  2409. {
  2410. PDADefectMissedResponsibleResult defectMissedResponsible = new PDADefectMissedResponsibleResult();
  2411. if (r["ProductionDefectID"].ToString() != "")
  2412. {
  2413. defectMissedResponsible.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
  2414. }
  2415. if (r["StaffID"].ToString() != "")
  2416. {
  2417. defectMissedResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
  2418. }
  2419. defectMissedResponsible.StaffCode = r["StaffCode"].ToString();
  2420. defectMissedResponsible.StaffName = r["StaffName"].ToString();
  2421. if (r["StaffStatus"].ToString() != "")
  2422. {
  2423. defectMissedResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
  2424. }
  2425. if (r["UJobsID"].ToString() != "")
  2426. {
  2427. defectMissedResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
  2428. }
  2429. if (r["SJobsID"].ToString() != "")
  2430. {
  2431. defectMissedResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
  2432. }
  2433. defect.PDADefectMissedResponsibles.Add(defectMissedResponsible);
  2434. }
  2435. }
  2436. //------------------------------
  2437. DataRow[] drImageRow = reworkDs.Tables[3].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[row]["ProductionDefectID"]);
  2438. if (drImageRow.Length > Constant.INT_IS_ZERO)
  2439. {
  2440. foreach (DataRow r in drImageRow)
  2441. {
  2442. PDADefectImageResult defectImage = new PDADefectImageResult();
  2443. if (r["ProductionDefectID"].ToString() != "")
  2444. {
  2445. defectImage.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
  2446. }
  2447. defectImage.Thumbnailpath = r["Thumbnailpath"].ToString();
  2448. //if (File.Exists(System.AppDomain.CurrentDomain.BaseDirectory + r["Imagepath"].ToString()))
  2449. //{
  2450. defectImage.Imagepath = r["Imagepath"].ToString();// r["Imagepath"].ToString();
  2451. //}
  2452. defect.PDADefectImageResults.Add(defectImage);
  2453. }
  2454. }
  2455. productionData.PDADefects.Add(defect);
  2456. }
  2457. if (productionDatas.PDAProductionData == null)
  2458. {
  2459. productionDatas.PDAProductionData = new System.Collections.Generic.List<PDAProductionDataResult>();
  2460. }
  2461. productionDatas.PDAProductionData.Add(productionData);
  2462. //---------------------------------------------------------------------------------
  2463. }
  2464. }
  2465. actionResult.Result = JsonHelper.ToJson(productionDatas);
  2466. actionResult.Status = (int)Constant.PDAResult.Success;
  2467. }
  2468. else
  2469. {
  2470. actionResult.Status = (int)Constant.PDAResult.Fail;
  2471. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2472. }
  2473. }
  2474. catch (Exception ex)
  2475. {
  2476. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2477. OutputLog.TraceLog(LogPriority.Error,
  2478. this.ToString(),
  2479. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2480. ex.ToString(),
  2481. LocalPath.LogExePath);
  2482. actionResult.Status = (int)Constant.PDAResult.Exception;
  2483. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2484. }
  2485. return actionResult;
  2486. }
  2487. /// <summary>
  2488. /// 编辑后删除生产数据
  2489. /// </summary>
  2490. /// <param name="productionDataID">生产数据ID</param>
  2491. /// <returns>int</returns>
  2492. public ActionResult DeleteProductionDataByID(string accountCode, string userCode, string userPassword, string sessionKey, int productionDataID)
  2493. {
  2494. ActionResult actionResult = new ActionResult();
  2495. try
  2496. {
  2497. // 验证请求头信息
  2498. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2499. // 验证失败
  2500. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2501. {
  2502. return actionResult;
  2503. }
  2504. int row = ServiceInvoker.Invoke<int>(this,
  2505. () => PMModuleLogic.DeleteProductionDataByID(productionDataID));
  2506. actionResult.Result = JsonHelper.ToJson(row);
  2507. actionResult.Status = (int)Constant.PDAResult.Success;
  2508. }
  2509. catch (Exception ex)
  2510. {
  2511. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2512. OutputLog.TraceLog(LogPriority.Error,
  2513. this.ToString(),
  2514. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2515. ex.ToString(),
  2516. LocalPath.LogExePath);
  2517. actionResult.Status = (int)Constant.PDAResult.Exception;
  2518. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2519. }
  2520. return actionResult;
  2521. }
  2522. /// <summary>
  2523. /// 获取产品完成工序的ID
  2524. /// </summary>
  2525. /// <param name="barcode">产品条码</param>
  2526. /// <returns>int</returns>
  2527. public ActionResult GetCompleteProcedureID(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  2528. {
  2529. ActionResult actionResult = new ActionResult();
  2530. try
  2531. {
  2532. // 验证请求头信息
  2533. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2534. // 验证失败
  2535. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2536. {
  2537. return actionResult;
  2538. }
  2539. int row = ServiceInvoker.Invoke<int>(this,
  2540. () => PMModuleLogic.GetCompleteProcedureID(barcode));
  2541. actionResult.Result = JsonHelper.ToJson(row);
  2542. actionResult.Status = (int)Constant.PDAResult.Success;
  2543. }
  2544. catch (Exception ex)
  2545. {
  2546. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2547. OutputLog.TraceLog(LogPriority.Error,
  2548. this.ToString(),
  2549. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2550. ex.ToString(),
  2551. LocalPath.LogExePath);
  2552. actionResult.Status = (int)Constant.PDAResult.Exception;
  2553. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2554. }
  2555. return actionResult;
  2556. }
  2557. /// <summary>
  2558. /// 绑定图片
  2559. /// </summary>
  2560. /// <param name="accountCode">帐套code</param>
  2561. /// <param name="userCode">用户code</param>
  2562. /// <param name="userPassword">用户密码</param>
  2563. /// <param name="sessionKey">本次登陆密钥</param>
  2564. /// <param name="imagePath">图片路径</param>
  2565. /// <returns></returns>
  2566. public Stream BindDefectImage(string accountCode, string userCode, string userPassword, string sessionKey, string imagePath)
  2567. {
  2568. try
  2569. {
  2570. return ServiceInvoker.Invoke<Stream>(this, () => PDAModuleLogic.BindDefectImage(imagePath));
  2571. }
  2572. catch (Exception ex)
  2573. {
  2574. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2575. OutputLog.TraceLog(LogPriority.Error,
  2576. this.ToString(),
  2577. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2578. ex.ToString(),
  2579. LocalPath.LogExePath);
  2580. return null;
  2581. }
  2582. }
  2583. /// <summary>
  2584. /// 根据所选工号对应的工种,查出缺陷责任员工
  2585. /// </summary>
  2586. /// <param name="jobs">工种ID</param>
  2587. /// <returns></returns>
  2588. public ActionResult GetDutyStaffByUserJobsID(string accountCode, string userCode, string userPassword, string sessionKey, int jobs, int userid)
  2589. {
  2590. ActionResult actionResult = new ActionResult();
  2591. try
  2592. {
  2593. // 验证请求头信息
  2594. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2595. // 验证失败
  2596. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2597. {
  2598. return actionResult;
  2599. }
  2600. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2601. () => PDAModuleLogic.GetDutyStaffByUserJobsID(jobs, sUserInfo, userid));
  2602. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2603. {
  2604. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2605. actionResult.Status = (int)Constant.PDAResult.Success;
  2606. }
  2607. else
  2608. {
  2609. actionResult.Status = (int)Constant.PDAResult.Fail;
  2610. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2611. }
  2612. }
  2613. catch (Exception ex)
  2614. {
  2615. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2616. OutputLog.TraceLog(LogPriority.Error,
  2617. this.ToString(),
  2618. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2619. ex.ToString(),
  2620. LocalPath.LogExePath);
  2621. actionResult.Status = (int)Constant.PDAResult.Exception;
  2622. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2623. }
  2624. return actionResult;
  2625. }
  2626. #region 产品报废
  2627. /// <summary>
  2628. /// 验证废弃产品唯一性
  2629. /// </summary>
  2630. /// <param name="barcode">产品条码</param>
  2631. /// <returns>int</returns>
  2632. public ActionResult ScrapProductChack(string accountCode, string userCode, string userPassword, string sessionKey, string barCode)
  2633. {
  2634. ActionResult actionResult = new ActionResult();
  2635. try
  2636. {
  2637. // 验证请求头信息
  2638. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2639. // 验证失败
  2640. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2641. {
  2642. return actionResult;
  2643. }
  2644. string row = ServiceInvoker.Invoke<string>(this,
  2645. () => PDAModuleLogic.ScrapProductChack(barCode, sUserInfo));
  2646. string[] rm = row.Split(':');
  2647. actionResult.Result = rm[0];//JsonHelper.ToJson(rm[0]);
  2648. if (rm.Length > 1)
  2649. {
  2650. actionResult.Message = rm[1];
  2651. }
  2652. actionResult.Status = (int)Constant.PDAResult.Success;
  2653. }
  2654. catch (Exception ex)
  2655. {
  2656. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2657. OutputLog.TraceLog(LogPriority.Error,
  2658. this.ToString(),
  2659. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2660. ex.ToString(),
  2661. LocalPath.LogExePath);
  2662. actionResult.Status = (int)Constant.PDAResult.Exception;
  2663. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2664. }
  2665. return actionResult;
  2666. }
  2667. /// <summary>
  2668. /// 根据条码获取该产品的在产信息以及生产数据
  2669. /// </summary>
  2670. /// <param name="Barcode">产品条码</param>
  2671. /// <returns>装有两个DataTable的数据集,第一个是在产信息,第二个是生产数据</returns>
  2672. public ActionResult GetInProductionAndProductionData(string accountCode, string userCode, string userPassword, string sessionKey, string barCode)
  2673. {
  2674. ActionResult actionResult = new ActionResult();
  2675. try
  2676. {
  2677. // 验证请求头信息
  2678. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2679. // 验证失败
  2680. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2681. {
  2682. return actionResult;
  2683. }
  2684. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2685. () => PDAModuleLogic.GetInProductionAndProductionData(barCode, sUserInfo));
  2686. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2687. {
  2688. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2689. actionResult.Status = (int)Constant.PDAResult.Success;
  2690. }
  2691. else
  2692. {
  2693. actionResult.Status = (int)Constant.PDAResult.Fail;
  2694. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2695. }
  2696. }
  2697. catch (Exception ex)
  2698. {
  2699. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2700. OutputLog.TraceLog(LogPriority.Error,
  2701. this.ToString(),
  2702. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2703. ex.ToString(),
  2704. LocalPath.LogExePath);
  2705. actionResult.Status = (int)Constant.PDAResult.Exception;
  2706. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2707. }
  2708. return actionResult;
  2709. }
  2710. /// <summary>
  2711. /// 根据工号查询员工档案信息
  2712. /// </summary>
  2713. /// <param name="accountCode"></param>
  2714. /// <param name="userCode"></param>
  2715. /// <param name="userPassword"></param>
  2716. /// <param name="sessionKey"></param>
  2717. /// <param name="userId"></param>
  2718. /// <returns></returns>
  2719. public ActionResult SearchHrStaffInfo(string accountCode, string userCode, string userPassword, string sessionKey, int userId)
  2720. {
  2721. ActionResult actionResult = new ActionResult();
  2722. try
  2723. {
  2724. // 验证请求头信息
  2725. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2726. // 验证失败
  2727. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2728. {
  2729. return actionResult;
  2730. }
  2731. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2732. () => PDAModuleLogic.SearchHrStaffInfo(userId, sUserInfo));
  2733. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2734. {
  2735. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2736. actionResult.Status = (int)Constant.PDAResult.Success;
  2737. }
  2738. else
  2739. {
  2740. actionResult.Status = (int)Constant.PDAResult.Fail;
  2741. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2742. }
  2743. }
  2744. catch (Exception ex)
  2745. {
  2746. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2747. OutputLog.TraceLog(LogPriority.Error,
  2748. this.ToString(),
  2749. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2750. ex.ToString(),
  2751. LocalPath.LogExePath);
  2752. actionResult.Status = (int)Constant.PDAResult.Exception;
  2753. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2754. }
  2755. return actionResult;
  2756. }
  2757. /// <summary>
  2758. /// 添加废弃产品记录
  2759. /// </summary>
  2760. /// <param name="SProductEntity">废弃产品实体</param>
  2761. /// <param name="RProcedureEntity">废弃责任工序实体</param>
  2762. /// <param name="SResponsibleList">责任者集合</param>
  2763. /// <param name="userInfo">用户基本信息</param>
  2764. /// <returns>int结果返回值</returns>
  2765. /// <remarks>
  2766. /// 庄天威 2014.09.24 新建
  2767. /// </remarks>
  2768. public ActionResult AddScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey,
  2769. ScrapProductEntity SProductEntity, ResponProcedureEntity RProcedureEntity,
  2770. ScrapResponsibleEntity[] SResponsibleList)
  2771. {
  2772. ActionResult actionResult = new ActionResult();
  2773. if (SResponsibleList == null || SResponsibleList.Length == 0)
  2774. {
  2775. actionResult.Status = (int)Constant.PDAResult.Fail;
  2776. actionResult.Message = "没有选择责任人";
  2777. }
  2778. try
  2779. {
  2780. // 验证请求头信息
  2781. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2782. // 验证失败
  2783. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2784. {
  2785. return actionResult;
  2786. }
  2787. int addRow = ServiceInvoker.Invoke<int>(this,
  2788. () => PDAModuleLogic.AddScrapProduct(SProductEntity, RProcedureEntity, SResponsibleList, sUserInfo));
  2789. actionResult.Result = JsonHelper.ToJson(addRow);
  2790. actionResult.Status = (int)Constant.PDAResult.Success;
  2791. }
  2792. catch (Exception ex)
  2793. {
  2794. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2795. OutputLog.TraceLog(LogPriority.Error,
  2796. this.ToString(),
  2797. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2798. ex.ToString(),
  2799. LocalPath.LogExePath);
  2800. actionResult.Status = (int)Constant.PDAResult.Exception;
  2801. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2802. // TODO 空指针异常问题检测
  2803. try
  2804. {
  2805. OutputLog.TraceLog(LogPriority.Error,
  2806. this.ToString(),
  2807. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2808. "accountCode:" + accountCode + "#userCode:" + userCode + "#sessionKey:" + sessionKey,
  2809. LocalPath.LogExePath);
  2810. string json1 = JsonHelper.ToJson(SProductEntity);
  2811. OutputLog.TraceLog(LogPriority.Error,
  2812. this.ToString(),
  2813. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2814. "SProductEntity:" + json1,
  2815. LocalPath.LogExePath);
  2816. string json2 = JsonHelper.ToJson(RProcedureEntity);
  2817. OutputLog.TraceLog(LogPriority.Error,
  2818. this.ToString(),
  2819. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2820. "RProcedureEntity:" + json2,
  2821. LocalPath.LogExePath);
  2822. string json3 = JsonHelper.ToJson(SResponsibleList);
  2823. OutputLog.TraceLog(LogPriority.Error,
  2824. this.ToString(),
  2825. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2826. "SResponsibleList:" + json3,
  2827. LocalPath.LogExePath);
  2828. }
  2829. catch (Exception exc)
  2830. {
  2831. OutputLog.TraceLog(LogPriority.Error,
  2832. this.ToString(),
  2833. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2834. "参数输入异常:" + exc.Message,
  2835. LocalPath.LogExePath);
  2836. }
  2837. }
  2838. return actionResult;
  2839. }
  2840. /// <summary>
  2841. /// 获取产品分级的数据(根据ID)
  2842. /// </summary>
  2843. /// <param name="GoodsLevelTypeID">分类类别ID</param>
  2844. /// <param name="GoodsLevelID">分类ID</param>
  2845. /// <param name="sUserInfo">用户基本信息</param>
  2846. /// <returns>DataSet</returns>
  2847. /// <remarks>
  2848. /// 2014.10.22 庄天威 新建
  2849. public ActionResult GetGoodsLevelDataById(string accountCode, string userCode, string userPassword, string sessionKey, int? GoodsLevelTypeID)
  2850. {
  2851. ActionResult actionResult = new ActionResult();
  2852. try
  2853. {
  2854. // 验证请求头信息
  2855. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2856. // 验证失败
  2857. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2858. {
  2859. return actionResult;
  2860. }
  2861. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2862. () => SystemModuleLogic.GetGoodsLevelDataById(GoodsLevelTypeID, null, sUserInfo));
  2863. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2864. {
  2865. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2866. actionResult.Status = (int)Constant.PDAResult.Success;
  2867. }
  2868. else
  2869. {
  2870. actionResult.Status = (int)Constant.PDAResult.Fail;
  2871. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2872. }
  2873. }
  2874. catch (Exception ex)
  2875. {
  2876. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2877. OutputLog.TraceLog(LogPriority.Error,
  2878. this.ToString(),
  2879. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2880. ex.ToString(),
  2881. LocalPath.LogExePath);
  2882. actionResult.Status = (int)Constant.PDAResult.Exception;
  2883. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2884. }
  2885. return actionResult;
  2886. }
  2887. /// <summary>
  2888. /// 获取账务日期
  2889. /// </summary>
  2890. /// <param name="accountCode"></param>
  2891. /// <param name="userCode"></param>
  2892. /// <param name="userPassword"></param>
  2893. /// <param name="sessionKey"></param>
  2894. /// <returns></returns>
  2895. public ActionResult GetAccountDate(string accountCode, string userCode, string userPassword, string sessionKey)
  2896. {
  2897. ActionResult actionResult = new ActionResult();
  2898. try
  2899. {
  2900. // 验证请求头信息
  2901. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2902. // 验证失败
  2903. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2904. {
  2905. return actionResult;
  2906. }
  2907. DateTime reworkDs = ServiceInvoker.Invoke<DateTime>(this,
  2908. () => CommonModuleLogic.GetAccountDate(sUserInfo));
  2909. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2910. actionResult.Status = (int)Constant.PDAResult.Success;
  2911. }
  2912. catch (Exception ex)
  2913. {
  2914. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2915. OutputLog.TraceLog(LogPriority.Error,
  2916. this.ToString(),
  2917. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2918. ex.ToString(),
  2919. LocalPath.LogExePath);
  2920. actionResult.Status = (int)Constant.PDAResult.Exception;
  2921. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2922. }
  2923. return actionResult;
  2924. }
  2925. /// <summary>
  2926. /// 获取登陆帐户有无报损权限
  2927. /// </summary>
  2928. /// <param name="accountCode"></param>
  2929. /// <param name="userCode"></param>
  2930. /// <param name="userPassword"></param>
  2931. /// <param name="sessionKey"></param>
  2932. /// <param name="usercode">工号编码</param>
  2933. /// <returns></returns>
  2934. public ActionResult GetScrapFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  2935. {
  2936. ActionResult actionResult = new ActionResult();
  2937. try
  2938. {
  2939. // 验证请求头信息
  2940. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2941. // 验证失败
  2942. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2943. {
  2944. return actionResult;
  2945. }
  2946. int returnValue = ServiceInvoker.Invoke<int>(this,
  2947. () => PDAModuleLogic.GetScrapFuntion(userCode, sUserInfo));
  2948. actionResult.Result = JsonHelper.ToJson(returnValue);
  2949. actionResult.Status = (int)Constant.PDAResult.Success;
  2950. }
  2951. catch (Exception ex)
  2952. {
  2953. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2954. OutputLog.TraceLog(LogPriority.Error,
  2955. this.ToString(),
  2956. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2957. ex.ToString(),
  2958. LocalPath.LogExePath);
  2959. actionResult.Status = (int)Constant.PDAResult.Exception;
  2960. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2961. }
  2962. return actionResult;
  2963. }
  2964. #endregion
  2965. /// <summary>
  2966. /// 获取是否存在报损未审核产品
  2967. /// </summary>
  2968. /// <param name="barcode">产品条码</param>
  2969. /// <returns>int</returns>
  2970. public ActionResult GetScrapProductAuditStatus(string accountCode, string userCode, string userPassword, string sessionKey, string barCode)
  2971. {
  2972. ActionResult actionResult = new ActionResult();
  2973. try
  2974. {
  2975. // 验证请求头信息
  2976. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2977. // 验证失败
  2978. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2979. {
  2980. return actionResult;
  2981. }
  2982. int row = ServiceInvoker.Invoke<int>(this,
  2983. () => PDAModuleLogic.GetScrapProductAuditStatus(barCode));
  2984. actionResult.Result = JsonHelper.ToJson(row);
  2985. actionResult.Status = (int)Constant.PDAResult.Success;
  2986. }
  2987. catch (Exception ex)
  2988. {
  2989. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2990. OutputLog.TraceLog(LogPriority.Error,
  2991. this.ToString(),
  2992. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2993. ex.ToString(),
  2994. LocalPath.LogExePath);
  2995. actionResult.Status = (int)Constant.PDAResult.Exception;
  2996. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2997. }
  2998. return actionResult;
  2999. }
  3000. /// <summary>
  3001. /// 查询报废产品信息
  3002. /// </summary>
  3003. /// <param name="accountCode"></param>
  3004. /// <param name="userCode"></param>
  3005. /// <param name="userPassword"></param>
  3006. /// <param name="sessionKey"></param>
  3007. /// <param name="barCode">产品条码</param>
  3008. /// <param name="scrapProductID">报废产品ID</param>
  3009. /// <returns></returns>
  3010. public ActionResult GetScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barCode, int scrapProductID)
  3011. {
  3012. ActionResult actionResult = new ActionResult();
  3013. try
  3014. {
  3015. // 验证请求头信息
  3016. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3017. // 验证失败
  3018. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3019. {
  3020. return actionResult;
  3021. }
  3022. ScrapProductEntity selectProEntity = new ScrapProductEntity();
  3023. selectProEntity.BarCode = barCode;
  3024. selectProEntity.ScrapProductID = scrapProductID;
  3025. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3026. () => PMModuleLogic.GetScrapProduct(selectProEntity, sUserInfo));
  3027. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3028. {
  3029. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3030. actionResult.Status = (int)Constant.PDAResult.Success;
  3031. }
  3032. else
  3033. {
  3034. actionResult.Status = (int)Constant.PDAResult.Fail;
  3035. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3036. }
  3037. }
  3038. catch (Exception ex)
  3039. {
  3040. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3041. OutputLog.TraceLog(LogPriority.Error,
  3042. this.ToString(),
  3043. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3044. ex.ToString(),
  3045. LocalPath.LogExePath);
  3046. actionResult.Status = (int)Constant.PDAResult.Exception;
  3047. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3048. }
  3049. return actionResult;
  3050. }
  3051. /// <summary>
  3052. /// 根据废弃产品ID获取责任工序
  3053. /// </summary>
  3054. /// <param name="accountCode"></param>
  3055. /// <param name="userCode"></param>
  3056. /// <param name="userPassword"></param>
  3057. /// <param name="sessionKey"></param>
  3058. /// <param name="scrapProductID">报废产品ID</param>
  3059. /// <returns></returns>
  3060. public ActionResult GetResponProcedureBySPId(string accountCode, string userCode, string userPassword, string sessionKey, int scrapProductID)
  3061. {
  3062. ActionResult actionResult = new ActionResult();
  3063. try
  3064. {
  3065. // 验证请求头信息
  3066. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3067. // 验证失败
  3068. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3069. {
  3070. return actionResult;
  3071. }
  3072. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3073. () => PMModuleLogic.GetResponProcedureBySPId(scrapProductID));
  3074. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3075. {
  3076. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3077. actionResult.Status = (int)Constant.PDAResult.Success;
  3078. }
  3079. else
  3080. {
  3081. actionResult.Status = (int)Constant.PDAResult.Fail;
  3082. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3083. }
  3084. }
  3085. catch (Exception ex)
  3086. {
  3087. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3088. OutputLog.TraceLog(LogPriority.Error,
  3089. this.ToString(),
  3090. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3091. ex.ToString(),
  3092. LocalPath.LogExePath);
  3093. actionResult.Status = (int)Constant.PDAResult.Exception;
  3094. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3095. }
  3096. return actionResult;
  3097. }
  3098. /// <summary>
  3099. /// 根据废弃产品ID获取责任人列表
  3100. /// </summary>
  3101. /// <param name="accountCode"></param>
  3102. /// <param name="userCode"></param>
  3103. /// <param name="userPassword"></param>
  3104. /// <param name="sessionKey"></param>
  3105. /// <param name="scrapProductID">报废产品ID</param>
  3106. /// <returns></returns>
  3107. public ActionResult GetScrapResponsibleBySPId(string accountCode, string userCode, string userPassword, string sessionKey, int scrapProductID)
  3108. {
  3109. ActionResult actionResult = new ActionResult();
  3110. try
  3111. {
  3112. // 验证请求头信息
  3113. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3114. // 验证失败
  3115. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3116. {
  3117. return actionResult;
  3118. }
  3119. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3120. () => PMModuleLogic.GetScrapResponsibleBySPId(scrapProductID));
  3121. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3122. {
  3123. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3124. actionResult.Status = (int)Constant.PDAResult.Success;
  3125. }
  3126. else
  3127. {
  3128. actionResult.Status = (int)Constant.PDAResult.Fail;
  3129. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3130. }
  3131. }
  3132. catch (Exception ex)
  3133. {
  3134. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3135. OutputLog.TraceLog(LogPriority.Error,
  3136. this.ToString(),
  3137. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3138. ex.ToString(),
  3139. LocalPath.LogExePath);
  3140. actionResult.Status = (int)Constant.PDAResult.Exception;
  3141. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3142. }
  3143. return actionResult;
  3144. }
  3145. /// <summary>
  3146. /// 添加废弃产品记录
  3147. /// </summary>
  3148. /// <param name="SProductEntity">废弃产品实体</param>
  3149. /// <param name="RProcedureEntity">废弃责任工序实体</param>
  3150. /// <param name="SResponsibleList">责任者集合</param>
  3151. /// <param name="userInfo">用户基本信息</param>
  3152. /// <returns>int结果返回值</returns>
  3153. /// <remarks>
  3154. /// 庄天威 2014.09.24 新建
  3155. /// </remarks>
  3156. public ActionResult UpdateScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, ScrapProductEntity UpdateSProductEntity,
  3157. ResponProcedureEntity UpdateRProcedureEntity,
  3158. ScrapResponsibleEntity[] UpdateSResponsibleList, ScrapResponsibleEntity[] YSResponsibleList)
  3159. {
  3160. ActionResult actionResult = new ActionResult();
  3161. try
  3162. {
  3163. // 验证请求头信息
  3164. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3165. // 验证失败
  3166. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3167. {
  3168. return actionResult;
  3169. }
  3170. int addRow = ServiceInvoker.Invoke<int>(this,
  3171. () => PDAModuleLogic.UpdateScrapProduct(UpdateSProductEntity, UpdateRProcedureEntity, UpdateSResponsibleList, YSResponsibleList, sUserInfo));
  3172. actionResult.Result = JsonHelper.ToJson(addRow);
  3173. actionResult.Status = (int)Constant.PDAResult.Success;
  3174. }
  3175. catch (Exception ex)
  3176. {
  3177. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3178. OutputLog.TraceLog(LogPriority.Error,
  3179. this.ToString(),
  3180. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3181. ex.ToString(),
  3182. LocalPath.LogExePath);
  3183. actionResult.Status = (int)Constant.PDAResult.Exception;
  3184. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3185. }
  3186. return actionResult;
  3187. }
  3188. /// <summary>
  3189. /// 获取产品窑炉
  3190. /// </summary>
  3191. /// <param name="accountCode"></param>
  3192. /// <param name="userCode"></param>
  3193. /// <param name="userPassword"></param>
  3194. /// <param name="sessionKey"></param>
  3195. /// <returns>Datase</returns>
  3196. public ActionResult GetAllKilntInfo(string accountCode, string userCode, string userPassword, string sessionKey)
  3197. {
  3198. ActionResult actionResult = new ActionResult();
  3199. try
  3200. {
  3201. // 验证请求头信息
  3202. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3203. // 验证失败
  3204. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3205. {
  3206. return actionResult;
  3207. }
  3208. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3209. () => PDAModuleLogic.GetAllKilntInfo(sUserInfo));
  3210. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3211. {
  3212. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3213. actionResult.Status = (int)Constant.PDAResult.Success;
  3214. }
  3215. else
  3216. {
  3217. actionResult.Status = (int)Constant.PDAResult.Fail;
  3218. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3219. }
  3220. }
  3221. catch (Exception ex)
  3222. {
  3223. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3224. OutputLog.TraceLog(LogPriority.Error,
  3225. this.ToString(),
  3226. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3227. ex.ToString(),
  3228. LocalPath.LogExePath);
  3229. actionResult.Status = (int)Constant.PDAResult.Exception;
  3230. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3231. }
  3232. return actionResult;
  3233. }
  3234. /// <summary>
  3235. /// 获取次品产品条码允许编辑
  3236. /// </summary>
  3237. /// <param name="accountCode"></param>
  3238. /// <param name="userCode"></param>
  3239. /// <param name="userPassword"></param>
  3240. /// <param name="sessionKey"></param>
  3241. /// <param name="barcode">产品条码</param>
  3242. /// <returns>Datase</returns>
  3243. public ActionResult GetSubstandardInfo(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3244. {
  3245. ActionResult actionResult = new ActionResult();
  3246. try
  3247. {
  3248. // 验证请求头信息
  3249. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3250. // 验证失败
  3251. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3252. {
  3253. return actionResult;
  3254. }
  3255. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3256. () => PDAModuleLogic.GetSubstandardInfo(barcode));
  3257. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3258. {
  3259. actionResult.Result = JsonHelper.ToJson(1);
  3260. actionResult.Status = (int)Constant.PDAResult.Success;
  3261. }
  3262. else
  3263. {
  3264. actionResult.Result = JsonHelper.ToJson(0);
  3265. actionResult.Status = (int)Constant.PDAResult.Fail;
  3266. actionResult.Message = "次品条码:" + barcode + "不允许修改";
  3267. }
  3268. }
  3269. catch (Exception ex)
  3270. {
  3271. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3272. OutputLog.TraceLog(LogPriority.Error,
  3273. this.ToString(),
  3274. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3275. ex.ToString(),
  3276. LocalPath.LogExePath);
  3277. actionResult.Status = (int)Constant.PDAResult.Exception;
  3278. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3279. }
  3280. return actionResult;
  3281. }
  3282. /// <summary>
  3283. /// 获取产品条码是否重烧
  3284. /// </summary>
  3285. /// <param name="accountCode"></param>
  3286. /// <param name="userCode"></param>
  3287. /// <param name="userPassword"></param>
  3288. /// <param name="sessionKey"></param>
  3289. /// <param name="barcode">产品条码</param>
  3290. /// <returns>Datase</returns>
  3291. public ActionResult GetReFine(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3292. {
  3293. ActionResult actionResult = new ActionResult();
  3294. try
  3295. {
  3296. // 验证请求头信息
  3297. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3298. // 验证失败
  3299. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3300. {
  3301. return actionResult;
  3302. }
  3303. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3304. () => PDAModuleLogic.GetReFine(barcode));
  3305. if (reworkDs != null && reworkDs.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  3306. {
  3307. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(reworkDs.Tables[0].Rows[0]["IsReFire"]));
  3308. }
  3309. else
  3310. {
  3311. actionResult.Result = JsonHelper.ToJson(0);
  3312. }
  3313. actionResult.Status = (int)Constant.PDAResult.Success;
  3314. }
  3315. catch (Exception ex)
  3316. {
  3317. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3318. OutputLog.TraceLog(LogPriority.Error,
  3319. this.ToString(),
  3320. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3321. ex.ToString(),
  3322. LocalPath.LogExePath);
  3323. actionResult.Status = (int)Constant.PDAResult.Exception;
  3324. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3325. }
  3326. return actionResult;
  3327. }
  3328. /// <summary>
  3329. /// 获取登陆帐户有无成检编辑权限
  3330. /// </summary>
  3331. /// <param name="accountCode"></param>
  3332. /// <param name="userCode"></param>
  3333. /// <param name="userPassword"></param>
  3334. /// <param name="sessionKey"></param>
  3335. /// <param name="usercode">工号编码</param>
  3336. /// <returns></returns>
  3337. public ActionResult GetFinishedProductEditFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  3338. {
  3339. ActionResult actionResult = new ActionResult();
  3340. try
  3341. {
  3342. // 验证请求头信息
  3343. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3344. // 验证失败
  3345. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3346. {
  3347. return actionResult;
  3348. }
  3349. int returnValue = ServiceInvoker.Invoke<int>(this,
  3350. () => PDAModuleLogic.GetFinishedProductEditFuntion(sUserInfo));
  3351. actionResult.Result = JsonHelper.ToJson(returnValue);
  3352. actionResult.Status = (int)Constant.PDAResult.Success;
  3353. }
  3354. catch (Exception ex)
  3355. {
  3356. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3357. OutputLog.TraceLog(LogPriority.Error,
  3358. this.ToString(),
  3359. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3360. ex.ToString(),
  3361. LocalPath.LogExePath);
  3362. actionResult.Status = (int)Constant.PDAResult.Exception;
  3363. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3364. }
  3365. return actionResult;
  3366. }
  3367. /// <summary>
  3368. /// 根据条码及工序判断是否漏扫
  3369. /// </summary>
  3370. /// <param name="accountCode"></param>
  3371. /// <param name="userCode"></param>
  3372. /// <param name="userPassword"></param>
  3373. /// <param name="sessionKey"></param>
  3374. /// <param name="usercode">工号编码</param>
  3375. /// <param name="barcode">产品条码</param>
  3376. /// <param name="produceid">工序ID</param>
  3377. /// <returns></returns>
  3378. public ActionResult AddBarCodeMissing(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int produceid)
  3379. {
  3380. ActionResult actionResult = new ActionResult();
  3381. try
  3382. {
  3383. // 验证请求头信息
  3384. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3385. // 验证失败
  3386. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3387. {
  3388. return actionResult;
  3389. }
  3390. int returnValue = 1;
  3391. //int returnValue = ServiceInvoker.Invoke<int>(this,
  3392. // () => PMModuleLogicDAL.AddBarCodeMissing(barcode, produceid, sUserInfo));
  3393. actionResult.Result = JsonHelper.ToJson(returnValue);
  3394. actionResult.Status = (int)Constant.PDAResult.Success;
  3395. }
  3396. catch (Exception ex)
  3397. {
  3398. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3399. OutputLog.TraceLog(LogPriority.Error,
  3400. this.ToString(),
  3401. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3402. ex.ToString(),
  3403. LocalPath.LogExePath);
  3404. actionResult.Status = (int)Constant.PDAResult.Exception;
  3405. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3406. }
  3407. return actionResult;
  3408. }
  3409. /// <summary>
  3410. /// 获取登陆帐户有无报损审批权限
  3411. /// </summary>
  3412. /// <param name="accountCode"></param>
  3413. /// <param name="userCode"></param>
  3414. /// <param name="userPassword"></param>
  3415. /// <param name="sessionKey"></param>
  3416. /// <param name="usercode">工号编码</param>
  3417. /// <returns></returns>
  3418. public ActionResult GetScrapProductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  3419. {
  3420. ActionResult actionResult = new ActionResult();
  3421. try
  3422. {
  3423. // 验证请求头信息
  3424. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3425. // 验证失败
  3426. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3427. {
  3428. return actionResult;
  3429. }
  3430. int returnValue = ServiceInvoker.Invoke<int>(this,
  3431. () => PDAModuleLogic.GetScrapProductFuntion(sUserInfo));
  3432. actionResult.Result = JsonHelper.ToJson(returnValue);
  3433. actionResult.Status = (int)Constant.PDAResult.Success;
  3434. }
  3435. catch (Exception ex)
  3436. {
  3437. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3438. OutputLog.TraceLog(LogPriority.Error,
  3439. this.ToString(),
  3440. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3441. ex.ToString(),
  3442. LocalPath.LogExePath);
  3443. actionResult.Status = (int)Constant.PDAResult.Exception;
  3444. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3445. }
  3446. return actionResult;
  3447. }
  3448. /// <summary>
  3449. /// 获取登陆帐户有无报损审批权限
  3450. /// </summary>
  3451. /// <param name="accountCode"></param>
  3452. /// <param name="userCode"></param>
  3453. /// <param name="userPassword"></param>
  3454. /// <param name="sessionKey"></param>
  3455. /// <param name="usercode">工号编码</param>
  3456. /// <returns></returns>
  3457. public ActionResult GetSpecialRepairflagByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3458. {
  3459. ActionResult actionResult = new ActionResult();
  3460. try
  3461. {
  3462. // 验证请求头信息
  3463. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3464. // 验证失败
  3465. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3466. {
  3467. return actionResult;
  3468. }
  3469. int returnValue = ServiceInvoker.Invoke<int>(this,
  3470. () => PMModuleLogic.GetSpecialRepairflagByBarcode(barcode, sUserInfo));
  3471. actionResult.Result = JsonHelper.ToJson(returnValue);
  3472. actionResult.Status = (int)Constant.PDAResult.Success;
  3473. }
  3474. catch (Exception ex)
  3475. {
  3476. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3477. OutputLog.TraceLog(LogPriority.Error,
  3478. this.ToString(),
  3479. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3480. ex.ToString(),
  3481. LocalPath.LogExePath);
  3482. actionResult.Status = (int)Constant.PDAResult.Exception;
  3483. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3484. }
  3485. return actionResult;
  3486. }
  3487. /// <summary>
  3488. /// 获取窑车对应产品列表
  3489. /// </summary>
  3490. /// <param name="accountCode"></param>
  3491. /// <param name="userCode"></param>
  3492. /// <param name="userPassword"></param>
  3493. /// <param name="sessionKey"></param>
  3494. /// <param name="KilnCarID">窑车ID</param>
  3495. /// <returns>Dataset</returns>
  3496. public ActionResult GetKilnCarGoodsByKilnCarID(string accountCode, string userCode, string userPassword, string sessionKey, int KilnCarID)
  3497. {
  3498. ActionResult actionResult = new ActionResult();
  3499. try
  3500. {
  3501. // 验证请求头信息
  3502. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3503. // 验证失败
  3504. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3505. {
  3506. return actionResult;
  3507. }
  3508. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3509. () => PMModuleLogic.GetKilnCarGoodsByKilnCarID(KilnCarID));
  3510. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3511. {
  3512. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3513. actionResult.Status = (int)Constant.PDAResult.Success;
  3514. }
  3515. else
  3516. {
  3517. actionResult.Status = (int)Constant.PDAResult.Fail;
  3518. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3519. }
  3520. }
  3521. catch (Exception ex)
  3522. {
  3523. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3524. OutputLog.TraceLog(LogPriority.Error,
  3525. this.ToString(),
  3526. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3527. ex.ToString(),
  3528. LocalPath.LogExePath);
  3529. actionResult.Status = (int)Constant.PDAResult.Exception;
  3530. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3531. }
  3532. return actionResult;
  3533. }
  3534. /// <summary>
  3535. /// 更换条码
  3536. /// </summary>
  3537. /// <param name="accountCode"></param>
  3538. /// <param name="userCode"></param>
  3539. /// <param name="userPassword"></param>
  3540. /// <param name="sessionKey"></param>
  3541. ///<param name="barcode">原条码</param>
  3542. /// <param name="newBarcode">新条码</param>
  3543. /// <param name="remarks">备注</param>
  3544. /// <returns>操作结果</returns>
  3545. public ActionResult SaveBarCodeChange(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, string newBarcode, string remarks, string groutingUserCode, string goodsCode)
  3546. {
  3547. ActionResult actionResult = new ActionResult();
  3548. try
  3549. {
  3550. // 验证请求头信息
  3551. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3552. // 验证失败
  3553. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3554. {
  3555. return actionResult;
  3556. }
  3557. ServiceResultEntity serviceResultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  3558. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SetFPM0201Data(sUserInfo, barcode, newBarcode, remarks, groutingUserCode, goodsCode));
  3559. if (serviceResultEntity.Status == Constant.ServiceResultStatus.Success)
  3560. {
  3561. actionResult.Result = 1;
  3562. actionResult.Status = (int)Constant.PDAResult.Success;
  3563. }
  3564. else
  3565. {
  3566. actionResult.Status = (int)Constant.PDAResult.Fail;
  3567. actionResult.Message = serviceResultEntity.Message;
  3568. }
  3569. }
  3570. catch (Exception ex)
  3571. {
  3572. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3573. OutputLog.TraceLog(LogPriority.Error,
  3574. this.ToString(),
  3575. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3576. ex.ToString(),
  3577. LocalPath.LogExePath);
  3578. actionResult.Status = (int)Constant.PDAResult.Exception;
  3579. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3580. }
  3581. return actionResult;
  3582. }
  3583. /// <summary>
  3584. /// 获取(注浆登记)的查询数据
  3585. /// </summary>
  3586. /// <param name="accountCode"></param>
  3587. /// <param name="userCode"></param>
  3588. /// <param name="userPassword"></param>
  3589. /// <param name="sessionKey"></param>
  3590. /// <param name="se">查询条件</param>
  3591. /// <returns>Dataset</returns>
  3592. public ActionResult GetGroutingList(string accountCode, string userCode, string userPassword, string sessionKey, FPM0202_SE se)
  3593. {
  3594. ActionResult actionResult = new ActionResult();
  3595. try
  3596. {
  3597. // 验证请求头信息
  3598. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3599. // 验证失败
  3600. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3601. {
  3602. return actionResult;
  3603. }
  3604. ServiceResultEntity serviceResultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  3605. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetFPM0202SData(sUserInfo, se));
  3606. if (serviceResultEntity.Status != Constant.ServiceResultStatus.NoSearchResults)
  3607. {
  3608. // PDA不显示的列删除掉
  3609. //serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingDailyDetailID");
  3610. //serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingDailyID");
  3611. serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingLineName");
  3612. serviceResultEntity.Data.Tables[0].Columns.Remove("UserCode");
  3613. serviceResultEntity.Data.Tables[0].Columns.Remove("GoodsName");
  3614. serviceResultEntity.Data.Tables[0].Columns.Remove("GMouldStatusName");
  3615. serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingCount");
  3616. serviceResultEntity.Data.Tables[0].Columns.Remove("Remarks");
  3617. serviceResultEntity.Data.Tables[0].Columns.Remove("GMouldTypeName");
  3618. //serviceResultEntity.Data.Tables[0].Columns.Remove("DMUserCode");
  3619. serviceResultEntity.Data.Tables[0].Columns.Remove("IsPublicBody");
  3620. actionResult.Result = JsonHelper.ToJson(serviceResultEntity.Data.Tables[0]);
  3621. actionResult.Status = (int)Constant.PDAResult.Success;
  3622. }
  3623. else
  3624. {
  3625. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3626. actionResult.Message = "无查询数据";
  3627. }
  3628. }
  3629. catch (Exception ex)
  3630. {
  3631. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3632. OutputLog.TraceLog(LogPriority.Error,
  3633. this.ToString(),
  3634. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3635. ex.ToString(),
  3636. LocalPath.LogExePath);
  3637. actionResult.Status = (int)Constant.PDAResult.Exception;
  3638. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3639. }
  3640. return actionResult;
  3641. }
  3642. /// <summary>
  3643. /// 获取(注浆登记)的查询数据
  3644. /// </summary>
  3645. /// <param name="accountCode"></param>
  3646. /// <param name="userCode"></param>
  3647. /// <param name="userPassword"></param>
  3648. /// <param name="sessionKey"></param>
  3649. /// <param name="se">查询条件</param>
  3650. /// <returns>Dataset</returns>
  3651. public ActionResult GetGroutingListByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3652. {
  3653. ActionResult actionResult = new ActionResult();
  3654. try
  3655. {
  3656. // 验证请求头信息
  3657. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3658. // 验证失败
  3659. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3660. {
  3661. return actionResult;
  3662. }
  3663. ServiceResultEntity serviceResultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  3664. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetFPM0203SData(sUserInfo, barcode));
  3665. if (serviceResultEntity.Status != Constant.ServiceResultStatus.NoSearchResults)
  3666. {
  3667. actionResult.Result = JsonHelper.ToJson(serviceResultEntity.Data.Tables[0]);
  3668. actionResult.Status = (int)Constant.PDAResult.Success;
  3669. }
  3670. else
  3671. {
  3672. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3673. actionResult.Message = "无查询数据";
  3674. }
  3675. }
  3676. catch (Exception ex)
  3677. {
  3678. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3679. OutputLog.TraceLog(LogPriority.Error,
  3680. this.ToString(),
  3681. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3682. ex.ToString(),
  3683. LocalPath.LogExePath);
  3684. actionResult.Status = (int)Constant.PDAResult.Exception;
  3685. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3686. }
  3687. return actionResult;
  3688. }
  3689. /// <summary>
  3690. ///获得成型线信息
  3691. /// </summary>
  3692. /// <param name="accountCode"></param>
  3693. /// <param name="userCode"></param>
  3694. /// <param name="userPassword"></param>
  3695. /// <param name="sessionKey"></param>
  3696. /// <param name="se">查询条件</param>
  3697. /// <returns>Dataset</returns>
  3698. public ActionResult GetGroutingLine(string accountCode, string userCode, string userPassword, string sessionKey, GroutingLineEntity groutingLineEntity)
  3699. {
  3700. ActionResult actionResult = new ActionResult();
  3701. try
  3702. {
  3703. // 验证请求头信息
  3704. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3705. // 验证失败
  3706. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3707. {
  3708. return actionResult;
  3709. }
  3710. DataSet dsReturn = ServiceInvoker.Invoke<DataSet>(this,
  3711. () => Dongke.IBOSS.PRD.Service.PCModuleLogic.PCModuleLogic.GetGroutingLine(groutingLineEntity, sUserInfo));
  3712. if (dsReturn != null && dsReturn.Tables[0].Rows.Count > 0)
  3713. {
  3714. actionResult.Result = JsonHelper.ToJson(dsReturn.Tables[0]);
  3715. actionResult.Status = (int)Constant.PDAResult.Success;
  3716. }
  3717. else
  3718. {
  3719. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3720. actionResult.Message = "无查询数据";
  3721. }
  3722. }
  3723. catch (Exception ex)
  3724. {
  3725. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3726. OutputLog.TraceLog(LogPriority.Error,
  3727. this.ToString(),
  3728. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3729. ex.ToString(),
  3730. LocalPath.LogExePath);
  3731. actionResult.Status = (int)Constant.PDAResult.Exception;
  3732. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3733. }
  3734. return actionResult;
  3735. }
  3736. /// <summary>
  3737. ///获取在产产品的信息标识列表
  3738. /// </summary>
  3739. /// <param name="accountCode"></param>
  3740. /// <param name="userCode"></param>
  3741. /// <param name="userPassword"></param>
  3742. /// <param name="sessionKey"></param>
  3743. /// <param name="barcode">查询条件</param>
  3744. /// <returns>Dataset</returns>
  3745. public ActionResult GetInProductionDataList(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3746. {
  3747. ActionResult actionResult = new ActionResult();
  3748. try
  3749. {
  3750. // 验证请求头信息
  3751. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3752. // 验证失败
  3753. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3754. {
  3755. return actionResult;
  3756. }
  3757. DataSet dsReturn = ServiceInvoker.Invoke<DataSet>(this,
  3758. () => PMModuleLogic.GetInProductionDataList(barcode));
  3759. if (dsReturn != null && dsReturn.Tables[0].Rows.Count > 0)
  3760. {
  3761. actionResult.Result = JsonHelper.ToJson(dsReturn.Tables[0]);
  3762. actionResult.Status = (int)Constant.PDAResult.Success;
  3763. }
  3764. else
  3765. {
  3766. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3767. actionResult.Message = "无查询数据";
  3768. }
  3769. }
  3770. catch (Exception ex)
  3771. {
  3772. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3773. OutputLog.TraceLog(LogPriority.Error,
  3774. this.ToString(),
  3775. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3776. ex.ToString(),
  3777. LocalPath.LogExePath);
  3778. actionResult.Status = (int)Constant.PDAResult.Exception;
  3779. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3780. }
  3781. return actionResult;
  3782. }
  3783. /// <summary>
  3784. ///获取条码是否注浆登记过,0行无效
  3785. /// </summary>
  3786. /// <param name="accountCode"></param>
  3787. /// <param name="userCode"></param>
  3788. /// <param name="userPassword"></param>
  3789. /// <param name="sessionKey"></param>
  3790. /// <param name="barcode">查询条件</param>
  3791. /// <returns>Dataset</returns>
  3792. public ActionResult GetBarCodeInGroutingDailyDetail(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3793. {
  3794. ActionResult actionResult = new ActionResult();
  3795. try
  3796. {
  3797. // 验证请求头信息
  3798. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3799. // 验证失败
  3800. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3801. {
  3802. return actionResult;
  3803. }
  3804. DataSet dsReturn = ServiceInvoker.Invoke<DataSet>(this,
  3805. () => PMModuleLogic.GetBarCodeInGroutingDailyDetail(barcode));
  3806. if (dsReturn != null && dsReturn.Tables[0].Rows.Count > 0)
  3807. {
  3808. actionResult.Result = JsonHelper.ToJson(dsReturn.Tables[0]);
  3809. actionResult.Status = (int)Constant.PDAResult.Success;
  3810. }
  3811. else
  3812. {
  3813. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3814. actionResult.Message = "该产品条码无效,无法报损!";
  3815. }
  3816. }
  3817. catch (Exception ex)
  3818. {
  3819. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3820. OutputLog.TraceLog(LogPriority.Error,
  3821. this.ToString(),
  3822. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3823. ex.ToString(),
  3824. LocalPath.LogExePath);
  3825. actionResult.Status = (int)Constant.PDAResult.Exception;
  3826. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3827. }
  3828. return actionResult;
  3829. }
  3830. /// <summary>
  3831. /// 获取登陆帐户有变更条码权限
  3832. /// </summary>
  3833. /// <param name="accountCode"></param>
  3834. /// <param name="userCode"></param>
  3835. /// <param name="userPassword"></param>
  3836. /// <param name="sessionKey"></param>
  3837. /// <returns></returns>
  3838. public ActionResult GetBarCodeRecordFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  3839. {
  3840. ActionResult actionResult = new ActionResult();
  3841. try
  3842. {
  3843. // 验证请求头信息
  3844. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3845. // 验证失败
  3846. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3847. {
  3848. return actionResult;
  3849. }
  3850. int returnValue = ServiceInvoker.Invoke<int>(this,
  3851. () => PDAModuleLogic.GetBarCodeRecordFuntion(sUserInfo));
  3852. actionResult.Result = JsonHelper.ToJson(returnValue);
  3853. actionResult.Status = (int)Constant.PDAResult.Success;
  3854. }
  3855. catch (Exception ex)
  3856. {
  3857. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3858. OutputLog.TraceLog(LogPriority.Error,
  3859. this.ToString(),
  3860. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3861. ex.ToString(),
  3862. LocalPath.LogExePath);
  3863. actionResult.Status = (int)Constant.PDAResult.Exception;
  3864. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3865. }
  3866. return actionResult;
  3867. }
  3868. /// <summary>
  3869. /// 成检时获取此条码是否报损
  3870. /// </summary>
  3871. /// <param name="accountCode"></param>
  3872. /// <param name="userCode"></param>
  3873. /// <param name="userPassword"></param>
  3874. /// <param name="sessionKey"></param>
  3875. /// <param name="barcode">产品条码</param>
  3876. /// <returns></returns>
  3877. public ActionResult CheckScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3878. {
  3879. ActionResult actionResult = new ActionResult();
  3880. try
  3881. {
  3882. // 验证请求头信息
  3883. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3884. // 验证失败
  3885. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3886. {
  3887. return actionResult;
  3888. }
  3889. int returnValue = ServiceInvoker.Invoke<int>(this,
  3890. () => PMModuleLogic.CheckScrapProduct(barcode));
  3891. if (returnValue == -100)
  3892. {
  3893. actionResult.Result = JsonHelper.ToJson(returnValue);
  3894. actionResult.Status = (int)Constant.PDAResult.Success;
  3895. }
  3896. else
  3897. {
  3898. actionResult.Status = (int)Constant.PDAResult.Fail;
  3899. if (returnValue == 0)
  3900. {
  3901. actionResult.Message = "该条码:" + barcode + "存在报损记录(待审批)";
  3902. }
  3903. else
  3904. {
  3905. actionResult.Message = "该条码:" + barcode + "存在报损记录(审批通过)";
  3906. }
  3907. }
  3908. }
  3909. catch (Exception ex)
  3910. {
  3911. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3912. OutputLog.TraceLog(LogPriority.Error,
  3913. this.ToString(),
  3914. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3915. ex.ToString(),
  3916. LocalPath.LogExePath);
  3917. actionResult.Status = (int)Constant.PDAResult.Exception;
  3918. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3919. }
  3920. return actionResult;
  3921. }
  3922. /// <summary>
  3923. /// 获取产品完成工序的ID(PDA)
  3924. /// </summary>
  3925. /// <param name="barcode">产品条码</param>
  3926. /// <returns>int</returns>
  3927. public ActionResult GetCompleteProcedureIDPDA(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3928. {
  3929. ActionResult actionResult = new ActionResult();
  3930. try
  3931. {
  3932. // 验证请求头信息
  3933. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3934. // 验证失败
  3935. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3936. {
  3937. return actionResult;
  3938. }
  3939. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  3940. () => PMModuleLogic.GetCompleteProcedureIDPDA(barcode));
  3941. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  3942. actionResult.Status = (int)Constant.PDAResult.Success;
  3943. }
  3944. catch (Exception ex)
  3945. {
  3946. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3947. OutputLog.TraceLog(LogPriority.Error,
  3948. this.ToString(),
  3949. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3950. ex.ToString(),
  3951. LocalPath.LogExePath);
  3952. actionResult.Status = (int)Constant.PDAResult.Exception;
  3953. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3954. }
  3955. return actionResult;
  3956. }
  3957. /// <summary>
  3958. /// 获取产品完成工序的ID(PDA)
  3959. /// </summary>
  3960. /// <param name="barcode">产品条码</param>
  3961. /// <returns>int</returns>
  3962. public ActionResult GetGoodsInfoBybarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3963. {
  3964. ActionResult actionResult = new ActionResult();
  3965. try
  3966. {
  3967. // 验证请求头信息
  3968. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3969. // 验证失败
  3970. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3971. {
  3972. return actionResult;
  3973. }
  3974. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  3975. () => PMModuleLogic.GetGoodsInfoBybarcode(barcode));
  3976. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  3977. actionResult.Status = (int)Constant.PDAResult.Success;
  3978. }
  3979. catch (Exception ex)
  3980. {
  3981. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3982. OutputLog.TraceLog(LogPriority.Error,
  3983. this.ToString(),
  3984. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3985. ex.ToString(),
  3986. LocalPath.LogExePath);
  3987. actionResult.Status = (int)Constant.PDAResult.Exception;
  3988. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3989. }
  3990. return actionResult;
  3991. }
  3992. /// <summary>
  3993. /// 成检-校验生产工号
  3994. /// </summary>
  3995. /// <param name="usercode">生产工号</param>
  3996. /// <returns>int</returns>
  3997. public ActionResult GetUserCode(string accountCode, string userCode, string userPassword, string sessionKey, string usercode)
  3998. {
  3999. ActionResult actionResult = new ActionResult();
  4000. try
  4001. {
  4002. // 验证请求头信息
  4003. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4004. // 验证失败
  4005. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4006. {
  4007. return actionResult;
  4008. }
  4009. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4010. () => PDAModuleLogic.GetUserCode(usercode, sUserInfo));
  4011. actionResult.Result = JsonHelper.ToJson(ds);
  4012. actionResult.Status = (int)Constant.PDAResult.Success;
  4013. }
  4014. catch (Exception ex)
  4015. {
  4016. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4017. OutputLog.TraceLog(LogPriority.Error,
  4018. this.ToString(),
  4019. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4020. ex.ToString(),
  4021. LocalPath.LogExePath);
  4022. actionResult.Status = (int)Constant.PDAResult.Exception;
  4023. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4024. }
  4025. return actionResult;
  4026. }
  4027. /// <summary>
  4028. /// 更新漏扫的成型工号
  4029. /// </summary>
  4030. /// <param name="accountCode"></param>
  4031. /// <param name="userCode"></param>
  4032. /// <param name="userPassword"></param>
  4033. /// <param name="sessionKey"></param>
  4034. /// <param name="groutingUserCode">成型工号</param>
  4035. /// <param name="missingID">漏扫ID</param>
  4036. /// <returns></returns>
  4037. public ActionResult UpdateGroutingUserCodeByMissingID(string accountCode, string userCode, string userPassword, string sessionKey, string groutingUserCode, int missingID)
  4038. {
  4039. ActionResult actionResult = new ActionResult();
  4040. try
  4041. {
  4042. // 验证请求头信息
  4043. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4044. // 验证失败
  4045. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4046. {
  4047. return actionResult;
  4048. }
  4049. int returnValue = ServiceInvoker.Invoke<int>(this,
  4050. () => PMModuleLogicDAL.UpdateGroutingUserCodeByMissingID(groutingUserCode, missingID, sUserInfo));
  4051. if (returnValue != -1)
  4052. {
  4053. actionResult.Result = JsonHelper.ToJson(returnValue);
  4054. actionResult.Status = (int)Constant.PDAResult.Success;
  4055. }
  4056. else
  4057. {
  4058. actionResult.Status = (int)Constant.PDAResult.Fail;
  4059. actionResult.Message = "存在无效的漏扫工号";
  4060. }
  4061. }
  4062. catch (Exception ex)
  4063. {
  4064. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4065. OutputLog.TraceLog(LogPriority.Error,
  4066. this.ToString(),
  4067. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4068. ex.ToString(),
  4069. LocalPath.LogExePath);
  4070. actionResult.Status = (int)Constant.PDAResult.Exception;
  4071. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4072. }
  4073. return actionResult;
  4074. }
  4075. /// <summary>
  4076. /// 在入窑工序检验窑车号是否存在
  4077. /// </summary>
  4078. /// <param name="accountCode"></param>
  4079. /// <param name="userCode"></param>
  4080. /// <param name="userPassword"></param>
  4081. /// <param name="sessionKey"></param>
  4082. /// <param name="kilncarcode">窑车编码</param>
  4083. /// <param name="procedureid">工序ID</param>
  4084. /// <returns></returns>
  4085. public ActionResult CheckKilnCarByIntoCar(string accountCode, string userCode, string userPassword, string sessionKey, string kilncarcode, int procedureid)
  4086. {
  4087. ActionResult actionResult = new ActionResult();
  4088. try
  4089. {
  4090. // 验证请求头信息
  4091. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4092. // 验证失败
  4093. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4094. {
  4095. return actionResult;
  4096. }
  4097. int returnValue = ServiceInvoker.Invoke<int>(this,
  4098. () => PMModuleLogicDAL.CheckKilnCarByIntoCar(kilncarcode, procedureid, sUserInfo));
  4099. if (returnValue == 1)
  4100. {
  4101. actionResult.Result = JsonHelper.ToJson(returnValue);
  4102. actionResult.Status = (int)Constant.PDAResult.Success;
  4103. }
  4104. else
  4105. {
  4106. actionResult.Status = (int)Constant.PDAResult.Fail;
  4107. if (returnValue == -99)
  4108. actionResult.Message = "窑炉车号无效";
  4109. else if (returnValue == -98)
  4110. actionResult.Message = "窑车己无产品";
  4111. else if (returnValue == -97)
  4112. actionResult.Message = "窑车没有入窑,不可以撤销";
  4113. else if (returnValue == -1)
  4114. actionResult.Message = "保存失败";
  4115. }
  4116. }
  4117. catch (Exception ex)
  4118. {
  4119. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4120. OutputLog.TraceLog(LogPriority.Error,
  4121. this.ToString(),
  4122. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4123. ex.ToString(),
  4124. LocalPath.LogExePath);
  4125. actionResult.Status = (int)Constant.PDAResult.Exception;
  4126. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4127. }
  4128. return actionResult;
  4129. }
  4130. /// <summary>
  4131. /// 获取盘点单列表
  4132. /// </summary>
  4133. /// <param name="sUserInfo"></param>
  4134. /// <returns></returns>
  4135. public ActionResult GetInCheckedList(string accountCode, string userCode, string userPassword, string sessionKey)
  4136. {
  4137. ActionResult actionResult = new ActionResult();
  4138. try
  4139. {
  4140. // 验证请求头信息
  4141. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4142. // 验证失败
  4143. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4144. {
  4145. return actionResult;
  4146. }
  4147. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4148. () => PMModuleLogic.GetInCheckedList(sUserInfo));
  4149. actionResult.Result = JsonHelper.ToJson(ds);
  4150. actionResult.Status = (int)Constant.PDAResult.Success;
  4151. }
  4152. catch (Exception ex)
  4153. {
  4154. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4155. OutputLog.TraceLog(LogPriority.Error,
  4156. this.ToString(),
  4157. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4158. ex.ToString(),
  4159. LocalPath.LogExePath);
  4160. actionResult.Status = (int)Constant.PDAResult.Exception;
  4161. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4162. }
  4163. return actionResult;
  4164. }
  4165. /// <summary>
  4166. /// 进行盘点操作
  4167. /// </summary>
  4168. /// <param name="accountCode"></param>
  4169. /// <param name="userCode"></param>
  4170. /// <param name="userPassword"></param>
  4171. /// <param name="sessionKey"></param>
  4172. /// <param name="InCheckedID">盘点单ID</param>
  4173. /// <param name="BarCode">产品条码</param>
  4174. /// <returns></returns>
  4175. public ActionResult UpdateInChecked(string accountCode, string userCode, string userPassword, string sessionKey, int InCheckedID, string BarCode)
  4176. {
  4177. ActionResult actionResult = new ActionResult();
  4178. try
  4179. {
  4180. // 验证请求头信息
  4181. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4182. // 验证失败
  4183. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4184. {
  4185. return actionResult;
  4186. }
  4187. int returnValue = ServiceInvoker.Invoke<int>(this,
  4188. () => PMModuleLogicDAL.UpdateInChecked(InCheckedID, BarCode, sUserInfo));
  4189. if (returnValue > 0)
  4190. {
  4191. actionResult.Result = JsonHelper.ToJson(returnValue);
  4192. actionResult.Status = (int)Constant.PDAResult.Success;
  4193. actionResult.Message = "产品" + BarCode + "盘点成功";
  4194. }
  4195. else if (returnValue == 10)
  4196. {
  4197. actionResult.Result = JsonHelper.ToJson(returnValue);
  4198. actionResult.Status = (int)Constant.PDAResult.Success;
  4199. actionResult.Message = "产品" + BarCode + "盘盈成功";
  4200. }
  4201. else
  4202. {
  4203. actionResult.Status = (int)Constant.PDAResult.Fail;
  4204. if (returnValue == -2)
  4205. actionResult.Message = "产品" + BarCode + "不是在产产品";
  4206. //if (returnValue == 10)
  4207. // actionResult.Message = "产品" + BarCode + "盘盈成功";
  4208. //if (returnValue > 0)
  4209. // actionResult.Message = "产品" + BarCode + "盘点成功";
  4210. if (returnValue == -22)
  4211. actionResult.Message = "产品" + BarCode + "己被其他工号盘点";
  4212. if (returnValue == -23)
  4213. actionResult.Message = "产品" + BarCode + "己被其他工号盘盈";
  4214. if (returnValue == -24)
  4215. actionResult.Message = "产品" + BarCode + "己被此工号盘点";
  4216. if (returnValue == -25)
  4217. actionResult.Message = "产品" + BarCode + "己被此工号盘盈";
  4218. else if (returnValue == 0)
  4219. actionResult.Message = "盘点失败";
  4220. }
  4221. }
  4222. catch (Exception ex)
  4223. {
  4224. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4225. OutputLog.TraceLog(LogPriority.Error,
  4226. this.ToString(),
  4227. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4228. ex.ToString(),
  4229. LocalPath.LogExePath);
  4230. actionResult.Status = (int)Constant.PDAResult.Exception;
  4231. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4232. }
  4233. return actionResult;
  4234. }
  4235. #region 班次配置
  4236. /// <summary>
  4237. /// 班次配置-通过工号获取工种列表
  4238. /// </summary>
  4239. /// <param name="userId">工号ID</param>
  4240. /// <returns></returns>
  4241. public ActionResult BindUserJobs(string accountCode, string userCode, string userPassword, string sessionKey, int userId)
  4242. {
  4243. ActionResult actionResult = new ActionResult();
  4244. try
  4245. {
  4246. // 验证请求头信息
  4247. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4248. // 验证失败
  4249. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4250. {
  4251. return actionResult;
  4252. }
  4253. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4254. () => SystemModuleLogic.GetJobByUserId(userId));
  4255. actionResult.Result = JsonHelper.ToJson(ds);
  4256. actionResult.Status = (int)Constant.PDAResult.Success;
  4257. }
  4258. catch (Exception ex)
  4259. {
  4260. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4261. OutputLog.TraceLog(LogPriority.Error,
  4262. this.ToString(),
  4263. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4264. ex.ToString(),
  4265. LocalPath.LogExePath);
  4266. actionResult.Status = (int)Constant.PDAResult.Exception;
  4267. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4268. }
  4269. return actionResult;
  4270. }
  4271. ///// <summary>
  4272. ///// 班次配置-根据工号查询员工档案信息
  4273. ///// </summary>
  4274. ///// <param name="userId">工号ID</param>
  4275. ///// <returns></returns>
  4276. //public ActionResult SearchHrStaffInfo(string accountCode, string userCode, string userPassword, string sessionKey, int userId)
  4277. //{
  4278. // ActionResult actionResult = new ActionResult();
  4279. // try
  4280. // {
  4281. // // 验证请求头信息
  4282. // actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4283. // // 验证失败
  4284. // if (actionResult.Status != (int)Constant.PDAResult.Success)
  4285. // {
  4286. // return actionResult;
  4287. // }
  4288. // DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4289. // () => HRModuleLogic.SearchHrStaffInfo(userId,sUserInfo));
  4290. // actionResult.Result = JsonHelper.ToJson(ds);
  4291. // actionResult.Status = (int)Constant.PDAResult.Success;
  4292. // }
  4293. // catch (Exception ex)
  4294. // {
  4295. // //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4296. // OutputLog.TraceLog(LogPriority.Error,
  4297. // this.ToString(),
  4298. // System.Reflection.MethodBase.GetCurrentMethod().Name,
  4299. // ex.ToString(),
  4300. // LocalPath.LogExePath);
  4301. // actionResult.Status = (int)Constant.PDAResult.Exception;
  4302. // actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4303. // }
  4304. // return actionResult;
  4305. //}
  4306. /// <summary>
  4307. /// 班次配置-根据员工姓名查员工信息
  4308. /// </summary>
  4309. /// <param name="searchStaffEntity"></param>
  4310. /// <returns></returns>
  4311. public ActionResult SearchStaffInfo(string accountCode, string userCode, string userPassword, string sessionKey, SearchStaffEntity searchStaffEntity)
  4312. {
  4313. ActionResult actionResult = new ActionResult();
  4314. try
  4315. {
  4316. // 验证请求头信息
  4317. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4318. // 验证失败
  4319. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4320. {
  4321. return actionResult;
  4322. }
  4323. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4324. () => PDAModuleLogic.SearchStaffInfo(searchStaffEntity, sUserInfo));
  4325. actionResult.Result = JsonHelper.ToJson(ds);
  4326. actionResult.Status = (int)Constant.PDAResult.Success;
  4327. }
  4328. catch (Exception ex)
  4329. {
  4330. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4331. OutputLog.TraceLog(LogPriority.Error,
  4332. this.ToString(),
  4333. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4334. ex.ToString(),
  4335. LocalPath.LogExePath);
  4336. actionResult.Status = (int)Constant.PDAResult.Exception;
  4337. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4338. }
  4339. return actionResult;
  4340. }
  4341. /// <summary>
  4342. /// 获取班次配置信息
  4343. /// </summary>
  4344. /// <param name="searchEntity"></param>
  4345. /// <returns></returns>
  4346. public ActionResult SearchClassesSetting(string accountCode, string userCode, string userPassword, string sessionKey, SearchClassesSettingEntity searchEntity)
  4347. {
  4348. ActionResult actionResult = new ActionResult();
  4349. try
  4350. {
  4351. // 验证请求头信息
  4352. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4353. // 验证失败
  4354. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4355. {
  4356. return actionResult;
  4357. }
  4358. searchEntity.StartAccountDate = Convert.ToDateTime(searchEntity.StartAccountDatePDA);
  4359. searchEntity.EndAccountDate = Convert.ToDateTime(searchEntity.EndAccountDatePDA).AddDays(1).AddMinutes(-1);
  4360. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4361. () => PCModuleLogic.SearchClassesSetting(searchEntity, sUserInfo));
  4362. actionResult.Result = JsonHelper.ToJson(ds);
  4363. actionResult.Status = (int)Constant.PDAResult.Success;
  4364. }
  4365. catch (Exception ex)
  4366. {
  4367. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4368. OutputLog.TraceLog(LogPriority.Error,
  4369. this.ToString(),
  4370. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4371. ex.ToString(),
  4372. LocalPath.LogExePath);
  4373. actionResult.Status = (int)Constant.PDAResult.Exception;
  4374. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4375. }
  4376. return actionResult;
  4377. }
  4378. public ActionResult SaveClassesSetting(string accountCode, string userCode, string userPassword, string sessionKey, ClassesSettingEntity setEntity, ClassesDetailSettingEntity[] setDetailEntity)
  4379. {
  4380. ActionResult actionResult = new ActionResult();
  4381. try
  4382. {
  4383. // 验证请求头信息
  4384. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4385. // 验证失败
  4386. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4387. {
  4388. return actionResult;
  4389. }
  4390. int returnValue = ServiceInvoker.Invoke<int>(this,
  4391. () => PDAModuleLogic.SaveClassesSetting(setEntity, setDetailEntity, sUserInfo));
  4392. if (returnValue > 0)
  4393. {
  4394. actionResult.Result = JsonHelper.ToJson(returnValue);
  4395. actionResult.Status = (int)Constant.PDAResult.Success;
  4396. }
  4397. else
  4398. {
  4399. actionResult.Status = (int)Constant.PDAResult.Fail;
  4400. actionResult.Message = "保存失败";
  4401. }
  4402. }
  4403. catch (Exception ex)
  4404. {
  4405. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4406. OutputLog.TraceLog(LogPriority.Error,
  4407. this.ToString(),
  4408. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4409. ex.ToString(),
  4410. LocalPath.LogExePath);
  4411. actionResult.Status = (int)Constant.PDAResult.Exception;
  4412. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4413. }
  4414. return actionResult;
  4415. }
  4416. /// <summary>
  4417. /// 班次配置--获取详细信息
  4418. /// </summary>
  4419. /// <param name="searchEntity"></param>
  4420. /// <returns></returns>
  4421. public ActionResult SearchClassesDetail(string accountCode, string userCode, string userPassword, string sessionKey, int classesSettingID)
  4422. {
  4423. ActionResult actionResult = new ActionResult();
  4424. try
  4425. {
  4426. // 验证请求头信息
  4427. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4428. // 验证失败
  4429. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4430. {
  4431. return actionResult;
  4432. }
  4433. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4434. () => PCModuleLogic.SearchClassesDetail(classesSettingID, sUserInfo));
  4435. actionResult.Result = JsonHelper.ToJson(ds);
  4436. actionResult.Status = (int)Constant.PDAResult.Success;
  4437. }
  4438. catch (Exception ex)
  4439. {
  4440. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4441. OutputLog.TraceLog(LogPriority.Error,
  4442. this.ToString(),
  4443. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4444. ex.ToString(),
  4445. LocalPath.LogExePath);
  4446. actionResult.Status = (int)Constant.PDAResult.Exception;
  4447. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4448. }
  4449. return actionResult;
  4450. }
  4451. /// <summary>
  4452. /// 获取用户是否有班次配置权限
  4453. /// </summary>
  4454. /// <param name="accountCode"></param>
  4455. /// <param name="userCode"></param>
  4456. /// <param name="userPassword"></param>
  4457. /// <param name="sessionKey"></param>
  4458. /// <returns></returns>
  4459. public ActionResult GetClassesSettingFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  4460. {
  4461. ActionResult actionResult = new ActionResult();
  4462. try
  4463. {
  4464. // 验证请求头信息
  4465. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4466. // 验证失败
  4467. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4468. {
  4469. return actionResult;
  4470. }
  4471. int returnValue = ServiceInvoker.Invoke<int>(this,
  4472. () => PDAModuleLogic.GetClassesSettingFuntion(sUserInfo));
  4473. actionResult.Result = JsonHelper.ToJson(returnValue);
  4474. actionResult.Status = (int)Constant.PDAResult.Success;
  4475. }
  4476. catch (Exception ex)
  4477. {
  4478. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4479. OutputLog.TraceLog(LogPriority.Error,
  4480. this.ToString(),
  4481. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4482. ex.ToString(),
  4483. LocalPath.LogExePath);
  4484. actionResult.Status = (int)Constant.PDAResult.Exception;
  4485. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4486. }
  4487. return actionResult;
  4488. }
  4489. /// <summary>
  4490. /// 获取盘点单列表
  4491. /// </summary>
  4492. /// <param name="sUserInfo"></param>
  4493. /// <returns></returns>
  4494. public ActionResult GetAllInChecked(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity)
  4495. {
  4496. ActionResult actionResult = new ActionResult();
  4497. try
  4498. {
  4499. // 验证请求头信息
  4500. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4501. // 验证失败
  4502. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4503. {
  4504. return actionResult;
  4505. }
  4506. entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA);
  4507. entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1);
  4508. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4509. () => PDAModuleLogic.GetAllInChecked(entity, sUserInfo));
  4510. actionResult.Result = JsonHelper.ToJson(ds);
  4511. actionResult.Status = (int)Constant.PDAResult.Success;
  4512. }
  4513. catch (Exception ex)
  4514. {
  4515. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4516. OutputLog.TraceLog(LogPriority.Error,
  4517. this.ToString(),
  4518. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4519. ex.ToString(),
  4520. LocalPath.LogExePath);
  4521. actionResult.Status = (int)Constant.PDAResult.Exception;
  4522. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4523. }
  4524. return actionResult;
  4525. }
  4526. #endregion
  4527. #region PDA报表
  4528. /// <summary>
  4529. /// 产品质量跟踪
  4530. /// </summary>
  4531. /// <param name="accountCode"></param>
  4532. /// <param name="userCode"></param>
  4533. /// <param name="userPassword"></param>
  4534. /// <param name="sessionKey"></param>
  4535. /// <param name="se"></param>
  4536. /// <returns></returns>
  4537. public ActionResult GetRPT040104SData(string accountCode, string userCode, string userPassword, string sessionKey, RPT040104_SE se)
  4538. {
  4539. ActionResult actionResult = new ActionResult();
  4540. try
  4541. {
  4542. // 验证请求头信息
  4543. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4544. // 验证失败
  4545. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4546. {
  4547. return actionResult;
  4548. }
  4549. se.CreateTimeStart = Convert.ToDateTime(se.CreateTimeStartPDA);
  4550. se.CreateTimeEnd = Convert.ToDateTime(se.CreateTimeEndPDA).AddDays(1);
  4551. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4552. () => PDAModuleLogic.GetRPT040104SData(sUserInfo, se));
  4553. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4554. {
  4555. actionResult.Status = (int)Constant.PDAResult.Fail;
  4556. actionResult.Message = Messages.MSG_CMN_I002;
  4557. }
  4558. else
  4559. {
  4560. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4561. actionResult.Status = (int)Constant.PDAResult.Success;
  4562. }
  4563. }
  4564. catch (Exception ex)
  4565. {
  4566. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4567. OutputLog.TraceLog(LogPriority.Error,
  4568. this.ToString(),
  4569. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4570. ex.ToString(),
  4571. LocalPath.LogExePath);
  4572. actionResult.Status = (int)Constant.PDAResult.Exception;
  4573. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4574. }
  4575. return actionResult;
  4576. }
  4577. /// <summary>
  4578. /// 工号产量质量分析表
  4579. /// </summary>
  4580. /// <param name="accountCode"></param>
  4581. /// <param name="userCode"></param>
  4582. /// <param name="userPassword"></param>
  4583. /// <param name="sessionKey"></param>
  4584. /// <param name="se"></param>
  4585. /// <returns></returns>
  4586. public ActionResult GetFP00002Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4587. int rptSProcedureID, string workcode, string date)
  4588. {
  4589. ActionResult actionResult = new ActionResult();
  4590. try
  4591. {
  4592. // 验证请求头信息
  4593. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4594. // 验证失败
  4595. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4596. {
  4597. return actionResult;
  4598. }
  4599. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4600. () => PDAModuleLogic.GetFP00002Data(sUserInfo, rptSProcedureID, workcode, Convert.ToDateTime(date)));
  4601. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4602. {
  4603. actionResult.Status = (int)Constant.PDAResult.Fail;
  4604. actionResult.Message = Messages.MSG_CMN_I002;
  4605. }
  4606. else
  4607. {
  4608. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4609. actionResult.Status = (int)Constant.PDAResult.Success;
  4610. }
  4611. }
  4612. catch (Exception ex)
  4613. {
  4614. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4615. OutputLog.TraceLog(LogPriority.Error,
  4616. this.ToString(),
  4617. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4618. ex.ToString(),
  4619. LocalPath.LogExePath);
  4620. actionResult.Status = (int)Constant.PDAResult.Exception;
  4621. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4622. }
  4623. return actionResult;
  4624. }
  4625. /// <summary>
  4626. /// 工号产量质量分析表(中陶)
  4627. /// </summary>
  4628. /// <param name="accountCode"></param>
  4629. /// <param name="userCode"></param>
  4630. /// <param name="userPassword"></param>
  4631. /// <param name="sessionKey"></param>
  4632. /// <param name="se"></param>
  4633. /// <returns></returns>
  4634. public ActionResult GetFP00002_1Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4635. int rptSProcedureID, string workcode, string date, string goodscode)
  4636. {
  4637. ActionResult actionResult = new ActionResult();
  4638. try
  4639. {
  4640. // 验证请求头信息
  4641. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4642. // 验证失败
  4643. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4644. {
  4645. return actionResult;
  4646. }
  4647. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4648. () => PDAModuleLogic.GetFP00002_1Data(sUserInfo, rptSProcedureID, workcode,
  4649. Convert.ToDateTime(date), goodscode));
  4650. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4651. {
  4652. actionResult.Status = (int)Constant.PDAResult.Fail;
  4653. actionResult.Message = Messages.MSG_CMN_I002;
  4654. }
  4655. else
  4656. {
  4657. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4658. actionResult.Status = (int)Constant.PDAResult.Success;
  4659. }
  4660. }
  4661. catch (Exception ex)
  4662. {
  4663. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4664. OutputLog.TraceLog(LogPriority.Error,
  4665. this.ToString(),
  4666. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4667. ex.ToString(),
  4668. LocalPath.LogExePath);
  4669. actionResult.Status = (int)Constant.PDAResult.Exception;
  4670. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4671. }
  4672. return actionResult;
  4673. }
  4674. /// <summary>
  4675. /// 半检数据统计表
  4676. /// </summary>
  4677. /// <param name="accountCode"></param>
  4678. /// <param name="userCode"></param>
  4679. /// <param name="userPassword"></param>
  4680. /// <param name="sessionKey"></param>
  4681. /// <param name="se"></param>
  4682. /// <returns></returns>
  4683. public ActionResult GetPDARPT000001Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4684. string workcode, string datebegin, string dateend)
  4685. {
  4686. ActionResult actionResult = new ActionResult();
  4687. try
  4688. {
  4689. // 验证请求头信息
  4690. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4691. // 验证失败
  4692. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4693. {
  4694. return actionResult;
  4695. }
  4696. DateTime datetimebegin = Convert.ToDateTime(datebegin);
  4697. DateTime datetimeend = Convert.ToDateTime(dateend);
  4698. datetimebegin = datetimebegin.Date;
  4699. datetimeend = datetimeend.Date.AddDays(1).AddSeconds(-1);
  4700. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4701. () => PDAModuleLogic.GetPDARPT000001Data(sUserInfo, workcode, datetimebegin, datetimeend));
  4702. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4703. {
  4704. actionResult.Status = (int)Constant.PDAResult.Fail;
  4705. actionResult.Message = Messages.MSG_CMN_I002;
  4706. }
  4707. else
  4708. {
  4709. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4710. actionResult.Status = (int)Constant.PDAResult.Success;
  4711. }
  4712. }
  4713. catch (Exception ex)
  4714. {
  4715. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4716. OutputLog.TraceLog(LogPriority.Error,
  4717. this.ToString(),
  4718. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4719. ex.ToString(),
  4720. LocalPath.LogExePath);
  4721. actionResult.Status = (int)Constant.PDAResult.Exception;
  4722. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4723. }
  4724. return actionResult;
  4725. }
  4726. /// <summary>
  4727. /// 工号质量统计表
  4728. /// </summary>
  4729. /// <param name="accountCode"></param>
  4730. /// <param name="userCode"></param>
  4731. /// <param name="userPassword"></param>
  4732. /// <param name="sessionKey"></param>
  4733. /// <param name="se"></param>
  4734. /// <returns></returns>
  4735. public ActionResult GetPDARPT000002Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4736. int rptSProcedureID, string workcode, string datebegin, string dateend)
  4737. {
  4738. ActionResult actionResult = new ActionResult();
  4739. try
  4740. {
  4741. // 验证请求头信息
  4742. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4743. // 验证失败
  4744. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4745. {
  4746. return actionResult;
  4747. }
  4748. DateTime datetimebegin = Convert.ToDateTime(datebegin);
  4749. DateTime datetimeend = Convert.ToDateTime(dateend);
  4750. datetimebegin = datetimebegin.Date;
  4751. datetimeend = datetimeend.Date.AddDays(1).AddSeconds(-1);
  4752. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4753. () => PDAModuleLogic.GetPDARPT000002Data(sUserInfo, rptSProcedureID, workcode, datetimebegin, datetimeend));
  4754. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4755. {
  4756. actionResult.Status = (int)Constant.PDAResult.Fail;
  4757. actionResult.Message = Messages.MSG_CMN_I002;
  4758. }
  4759. else
  4760. {
  4761. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4762. actionResult.Status = (int)Constant.PDAResult.Success;
  4763. }
  4764. }
  4765. catch (Exception ex)
  4766. {
  4767. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4768. OutputLog.TraceLog(LogPriority.Error,
  4769. this.ToString(),
  4770. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4771. ex.ToString(),
  4772. LocalPath.LogExePath);
  4773. actionResult.Status = (int)Constant.PDAResult.Exception;
  4774. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4775. }
  4776. return actionResult;
  4777. }
  4778. /// <summary>
  4779. /// 损坯数据统计表
  4780. /// </summary>
  4781. /// <param name="accountCode"></param>
  4782. /// <param name="userCode"></param>
  4783. /// <param name="userPassword"></param>
  4784. /// <param name="sessionKey"></param>
  4785. /// <param name="se"></param>
  4786. /// <returns></returns>
  4787. public ActionResult GetPDARPT000003Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4788. string workcode, string datebegin, string dateend)
  4789. {
  4790. ActionResult actionResult = new ActionResult();
  4791. try
  4792. {
  4793. // 验证请求头信息
  4794. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4795. // 验证失败
  4796. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4797. {
  4798. return actionResult;
  4799. }
  4800. DateTime datetimebegin = Convert.ToDateTime(datebegin);
  4801. DateTime datetimeend = Convert.ToDateTime(dateend);
  4802. datetimebegin = datetimebegin.Date;
  4803. datetimeend = datetimeend.Date.AddDays(1).AddSeconds(-1);
  4804. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4805. () => PDAModuleLogic.GetPDARPT000003Data(sUserInfo, workcode, datetimebegin, datetimeend));
  4806. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4807. {
  4808. actionResult.Status = (int)Constant.PDAResult.Fail;
  4809. actionResult.Message = Messages.MSG_CMN_I002;
  4810. }
  4811. else
  4812. {
  4813. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4814. actionResult.Status = (int)Constant.PDAResult.Success;
  4815. }
  4816. }
  4817. catch (Exception ex)
  4818. {
  4819. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4820. OutputLog.TraceLog(LogPriority.Error,
  4821. this.ToString(),
  4822. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4823. ex.ToString(),
  4824. LocalPath.LogExePath);
  4825. actionResult.Status = (int)Constant.PDAResult.Exception;
  4826. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4827. }
  4828. return actionResult;
  4829. }
  4830. #endregion
  4831. /// <summary>
  4832. /// 取得报表数据源数据
  4833. /// </summary>
  4834. /// <param name="accountCode"></param>
  4835. /// <param name="userCode"></param>
  4836. /// <param name="userPassword"></param>
  4837. /// <param name="sessionKey"></param>
  4838. /// <returns></returns>
  4839. public ActionResult GetRptProcedureModule(string accountCode, string userCode, string userPassword, string sessionKey)
  4840. {
  4841. ActionResult actionResult = new ActionResult();
  4842. try
  4843. {
  4844. // 验证请求头信息
  4845. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4846. // 验证失败
  4847. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4848. {
  4849. return actionResult;
  4850. }
  4851. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4852. () => ReportModuleLogic.GetRptProcedureModule(sUserInfo));
  4853. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4854. {
  4855. actionResult.Status = (int)Constant.PDAResult.Fail;
  4856. actionResult.Message = Messages.MSG_CMN_I002;
  4857. }
  4858. else
  4859. {
  4860. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4861. actionResult.Status = (int)Constant.PDAResult.Success;
  4862. }
  4863. }
  4864. catch (Exception ex)
  4865. {
  4866. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4867. OutputLog.TraceLog(LogPriority.Error,
  4868. this.ToString(),
  4869. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4870. ex.ToString(),
  4871. LocalPath.LogExePath);
  4872. actionResult.Status = (int)Constant.PDAResult.Exception;
  4873. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4874. }
  4875. return actionResult;
  4876. }
  4877. /// <summary>
  4878. /// 取得报表的查询数据源统计工序数据
  4879. /// </summary>
  4880. /// <param name="accountCode"></param>
  4881. /// <param name="userCode"></param>
  4882. /// <param name="userPassword"></param>
  4883. /// <param name="sessionKey"></param>
  4884. /// <param name="RptProcedureID"></param>
  4885. /// <returns></returns>
  4886. public ActionResult GetRptSourceProcedureModule(string accountCode, string userCode, string userPassword, string sessionKey, int? RptProcedureID)
  4887. {
  4888. ActionResult actionResult = new ActionResult();
  4889. try
  4890. {
  4891. // 验证请求头信息
  4892. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4893. // 验证失败
  4894. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4895. {
  4896. return actionResult;
  4897. }
  4898. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4899. () => ReportModuleLogic.GetRptSourceProcedureModule(sUserInfo, RptProcedureID));
  4900. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4901. {
  4902. actionResult.Status = (int)Constant.PDAResult.Fail;
  4903. actionResult.Message = Messages.MSG_CMN_I002;
  4904. }
  4905. else
  4906. {
  4907. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4908. actionResult.Status = (int)Constant.PDAResult.Success;
  4909. }
  4910. }
  4911. catch (Exception ex)
  4912. {
  4913. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4914. OutputLog.TraceLog(LogPriority.Error,
  4915. this.ToString(),
  4916. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4917. ex.ToString(),
  4918. LocalPath.LogExePath);
  4919. actionResult.Status = (int)Constant.PDAResult.Exception;
  4920. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4921. }
  4922. return actionResult;
  4923. }
  4924. /// <summary>
  4925. /// 获取用户是否有统计产成品权限
  4926. /// </summary>
  4927. /// <param name="accountCode"></param>
  4928. /// <param name="userCode"></param>
  4929. /// <param name="userPassword"></param>
  4930. /// <param name="sessionKey"></param>
  4931. /// <returns></returns>
  4932. public ActionResult GetStatisticsFinishedProductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  4933. {
  4934. ActionResult actionResult = new ActionResult();
  4935. try
  4936. {
  4937. // 验证请求头信息
  4938. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4939. // 验证失败
  4940. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4941. {
  4942. return actionResult;
  4943. }
  4944. int returnValue = ServiceInvoker.Invoke<int>(this,
  4945. () => PDAModuleLogic.GetStatisticsFinishedProductFuntion(sUserInfo));
  4946. actionResult.Result = JsonHelper.ToJson(returnValue);
  4947. actionResult.Status = (int)Constant.PDAResult.Success;
  4948. }
  4949. catch (Exception ex)
  4950. {
  4951. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4952. OutputLog.TraceLog(LogPriority.Error,
  4953. this.ToString(),
  4954. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4955. ex.ToString(),
  4956. LocalPath.LogExePath);
  4957. actionResult.Status = (int)Constant.PDAResult.Exception;
  4958. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4959. }
  4960. return actionResult;
  4961. }
  4962. /// <summary>
  4963. /// 获取用户是否有盘点权限
  4964. /// </summary>
  4965. /// <param name="accountCode"></param>
  4966. /// <param name="userCode"></param>
  4967. /// <param name="userPassword"></param>
  4968. /// <param name="sessionKey"></param>
  4969. /// <returns></returns>
  4970. public ActionResult GetInCheckedFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  4971. {
  4972. ActionResult actionResult = new ActionResult();
  4973. try
  4974. {
  4975. // 验证请求头信息
  4976. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4977. // 验证失败
  4978. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4979. {
  4980. return actionResult;
  4981. }
  4982. int returnValue = ServiceInvoker.Invoke<int>(this,
  4983. () => PDAModuleLogic.GetInCheckedFuntion(sUserInfo));
  4984. actionResult.Result = JsonHelper.ToJson(returnValue);
  4985. actionResult.Status = (int)Constant.PDAResult.Success;
  4986. }
  4987. catch (Exception ex)
  4988. {
  4989. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4990. OutputLog.TraceLog(LogPriority.Error,
  4991. this.ToString(),
  4992. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4993. ex.ToString(),
  4994. LocalPath.LogExePath);
  4995. actionResult.Status = (int)Constant.PDAResult.Exception;
  4996. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4997. }
  4998. return actionResult;
  4999. }
  5000. /// <summary>
  5001. /// 根据条件查询是否存在班次配置
  5002. /// </summary>
  5003. /// <param name="accountCode"></param>
  5004. /// <param name="userCode"></param>
  5005. /// <param name="userPassword"></param>
  5006. /// <param name="sessionKey"></param>
  5007. /// <param name="userCode">工号编码</param>
  5008. /// <returns></returns>
  5009. public ActionResult GetClassesSetting(string accountCode, string userCode, string userPassword, string sessionKey, string uCode)
  5010. {
  5011. ActionResult actionResult = new ActionResult();
  5012. try
  5013. {
  5014. // 验证请求头信息
  5015. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5016. // 验证失败
  5017. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5018. {
  5019. return actionResult;
  5020. }
  5021. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  5022. () => PDAModuleLogic.GetClassesSetting(uCode, sUserInfo));
  5023. actionResult.Result = JsonHelper.ToJson(ds);
  5024. actionResult.Status = (int)Constant.PDAResult.Success;
  5025. }
  5026. catch (Exception ex)
  5027. {
  5028. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5029. OutputLog.TraceLog(LogPriority.Error,
  5030. this.ToString(),
  5031. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5032. ex.ToString(),
  5033. LocalPath.LogExePath);
  5034. actionResult.Status = (int)Constant.PDAResult.Exception;
  5035. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5036. }
  5037. return actionResult;
  5038. }
  5039. /// <summary>
  5040. /// 报损工序查出工号根据生产数据ID
  5041. /// </summary>
  5042. /// <param name="accountCode"></param>
  5043. /// <param name="userCode"></param>
  5044. /// <param name="userPassword"></param>
  5045. /// <param name="sessionKey"></param>
  5046. /// <param name="ProductionDataID">生产数据ID</param>
  5047. /// <returns></returns>
  5048. public ActionResult GetScrapProductUserCodeByProductionDataID(string accountCode, string userCode, string userPassword, string sessionKey, int ProductionDataID)
  5049. {
  5050. ActionResult actionResult = new ActionResult();
  5051. try
  5052. {
  5053. // 验证请求头信息
  5054. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5055. // 验证失败
  5056. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5057. {
  5058. return actionResult;
  5059. }
  5060. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  5061. () => PMModuleLogic.GetScrapProductUserCodeByProductionDataID(ProductionDataID));
  5062. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  5063. {
  5064. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  5065. actionResult.Status = (int)Constant.PDAResult.Success;
  5066. }
  5067. else
  5068. {
  5069. actionResult.Status = (int)Constant.PDAResult.Fail;
  5070. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5071. }
  5072. }
  5073. catch (Exception ex)
  5074. {
  5075. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5076. OutputLog.TraceLog(LogPriority.Error,
  5077. this.ToString(),
  5078. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5079. ex.ToString(),
  5080. LocalPath.LogExePath);
  5081. actionResult.Status = (int)Constant.PDAResult.Exception;
  5082. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5083. }
  5084. return actionResult;
  5085. }
  5086. /// <summary>
  5087. /// 在入窑工序检验窑车号是否存在
  5088. /// </summary>
  5089. /// <param name="accountCode"></param>
  5090. /// <param name="userCode"></param>
  5091. /// <param name="userPassword"></param>
  5092. /// <param name="sessionKey"></param>
  5093. /// <param name="kilncarcode">窑车编码</param>
  5094. /// <param name="procedureid">工序ID</param>
  5095. /// <returns></returns>
  5096. public ActionResult CheckKilnCarByIntoCar2(string accountCode, string userCode, string userPassword, string sessionKey, string kilncarcode, int procedureid)
  5097. {
  5098. ActionResult actionResult = new ActionResult();
  5099. try
  5100. {
  5101. // 验证请求头信息
  5102. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5103. // 验证失败
  5104. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5105. {
  5106. return actionResult;
  5107. }
  5108. int returnValue = ServiceInvoker.Invoke<int>(this,
  5109. () => PMModuleLogicDAL.CheckKilnCarByIntoCar2(kilncarcode, procedureid, sUserInfo));
  5110. if (returnValue == 1)
  5111. {
  5112. actionResult.Result = JsonHelper.ToJson(returnValue);
  5113. actionResult.Status = (int)Constant.PDAResult.Success;
  5114. }
  5115. else
  5116. {
  5117. actionResult.Status = (int)Constant.PDAResult.Fail;
  5118. if (returnValue == -99)
  5119. actionResult.Message = "窑炉车号无效";
  5120. else if (returnValue == -98)
  5121. actionResult.Message = "窑车己无产品";
  5122. else if (returnValue == -97)
  5123. actionResult.Message = "窑车没有入窑,不可以撤销";
  5124. else if (returnValue == -1)
  5125. actionResult.Message = "保存失败";
  5126. }
  5127. }
  5128. catch (Exception ex)
  5129. {
  5130. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5131. OutputLog.TraceLog(LogPriority.Error,
  5132. this.ToString(),
  5133. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5134. ex.ToString(),
  5135. LocalPath.LogExePath);
  5136. actionResult.Status = (int)Constant.PDAResult.Exception;
  5137. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5138. }
  5139. return actionResult;
  5140. }
  5141. /// <summary>
  5142. /// 撤销包装
  5143. /// </summary>
  5144. /// <param name="accountCode"></param>
  5145. /// <param name="userCode"></param>
  5146. /// <param name="userPassword"></param>
  5147. /// <param name="sessionKey"></param>
  5148. /// <param name="barcode"></param>
  5149. /// <returns></returns>
  5150. public ActionResult AddChancelFinishedproduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5151. {
  5152. ActionResult actionResult = new ActionResult();
  5153. try
  5154. {
  5155. // 验证请求头信息
  5156. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5157. // 验证失败
  5158. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5159. {
  5160. return actionResult;
  5161. }
  5162. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5163. () => PMModuleLogicDAL.AddChancelFinishedproduct(barcode, sUserInfo));
  5164. if (Convert.ToInt32(returnValue.Result) > 0)
  5165. {
  5166. actionResult.Result = JsonHelper.ToJson(returnValue);
  5167. actionResult.Status = (int)Constant.PDAResult.Success;
  5168. }
  5169. else
  5170. {
  5171. actionResult.Status = (int)Constant.PDAResult.Fail;
  5172. if (Convert.ToInt32(returnValue.Result) == -1)
  5173. actionResult.Message = "产品条码不存在包装记录";
  5174. else if (Convert.ToInt32(returnValue.Result) == -200)
  5175. actionResult.Message = returnValue.Message;
  5176. else
  5177. actionResult.Message = "成品撤销失败";
  5178. }
  5179. }
  5180. catch (Exception ex)
  5181. {
  5182. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5183. OutputLog.TraceLog(LogPriority.Error,
  5184. this.ToString(),
  5185. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5186. ex.ToString(),
  5187. LocalPath.LogExePath);
  5188. actionResult.Status = (int)Constant.PDAResult.Exception;
  5189. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5190. }
  5191. return actionResult;
  5192. }
  5193. /*
  5194. /// <summary>
  5195. /// 获取用户是否有撤销包装权限
  5196. /// </summary>
  5197. /// <param name="accountCode"></param>
  5198. /// <param name="userCode"></param>
  5199. /// <param name="userPassword"></param>
  5200. /// <param name="sessionKey"></param>
  5201. /// <returns></returns>
  5202. public ActionResult GetChancelFinishedproductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5203. {
  5204. ActionResult actionResult = new ActionResult();
  5205. try
  5206. {
  5207. // 验证请求头信息
  5208. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5209. // 验证失败
  5210. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5211. {
  5212. return actionResult;
  5213. }
  5214. int returnValue = ServiceInvoker.Invoke<int>(this,
  5215. () => PDAModuleLogic.GetChancelFinishedproductFuntion(sUserInfo));
  5216. actionResult.Result = JsonHelper.ToJson(returnValue);
  5217. actionResult.Status = (int)Constant.PDAResult.Success;
  5218. }
  5219. catch (Exception ex)
  5220. {
  5221. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5222. OutputLog.TraceLog(LogPriority.Error,
  5223. this.ToString(),
  5224. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5225. ex.ToString(),
  5226. LocalPath.LogExePath);
  5227. actionResult.Status = (int)Constant.PDAResult.Exception;
  5228. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5229. }
  5230. return actionResult;
  5231. }
  5232. */
  5233. /// <summary>
  5234. /// 窑车状态明细表查询
  5235. /// </summary>
  5236. /// <param name="accountCode"></param>
  5237. /// <param name="userCode"></param>
  5238. /// <param name="userPassword"></param>
  5239. /// <param name="sessionKey"></param>
  5240. /// <param name="kilnCarCode"></param>
  5241. /// <returns></returns>
  5242. public ActionResult GetKilnCarStatusDetailByCode(string accountCode, string userCode, string userPassword, string sessionKey, string kilnCarCode)
  5243. {
  5244. ActionResult actionResult = new ActionResult();
  5245. try
  5246. {
  5247. // 验证请求头信息
  5248. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5249. // 验证失败
  5250. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5251. {
  5252. return actionResult;
  5253. }
  5254. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5255. () => ReportModuleLogic.GetKilnCarStatusDetailByCode(kilnCarCode, sUserInfo));
  5256. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  5257. {
  5258. actionResult.Status = (int)Constant.PDAResult.Fail;
  5259. actionResult.Message = Messages.MSG_CMN_I002;
  5260. }
  5261. else
  5262. {
  5263. actionResult.Result = JsonHelper.ToJson(sre.Data);
  5264. actionResult.Status = (int)Constant.PDAResult.Success;
  5265. }
  5266. }
  5267. catch (Exception ex)
  5268. {
  5269. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5270. OutputLog.TraceLog(LogPriority.Error,
  5271. this.ToString(),
  5272. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5273. ex.ToString(),
  5274. LocalPath.LogExePath);
  5275. actionResult.Status = (int)Constant.PDAResult.Exception;
  5276. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5277. }
  5278. return actionResult;
  5279. }
  5280. /// <summary>
  5281. /// 损坯撤销
  5282. /// </summary>
  5283. /// <param name="accountCode"></param>
  5284. /// <param name="userCode"></param>
  5285. /// <param name="userPassword"></param>
  5286. /// <param name="sessionKey"></param>
  5287. /// <param name="barcode"></param>
  5288. /// <returns></returns>
  5289. public ActionResult AddCancelScrapProduction(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5290. {
  5291. ActionResult actionResult = new ActionResult();
  5292. try
  5293. {
  5294. // 验证请求头信息
  5295. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5296. // 验证失败
  5297. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5298. {
  5299. return actionResult;
  5300. }
  5301. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5302. () => PMModuleLogicDAL.AddCancelScrapProduction(barcode, sUserInfo));
  5303. if (Convert.ToInt32(returnValue.Result) > 0)
  5304. {
  5305. actionResult.Result = JsonHelper.ToJson(returnValue);
  5306. actionResult.Status = (int)Constant.PDAResult.Success;
  5307. }
  5308. else
  5309. {
  5310. actionResult.Status = (int)Constant.PDAResult.Fail;
  5311. if (Convert.ToInt32(returnValue.Result) == -1)
  5312. actionResult.Message = "此产品没有损坯,不能撤销";
  5313. else if (Convert.ToInt32(returnValue.Result) == -200)
  5314. actionResult.Message = returnValue.Message;
  5315. else
  5316. actionResult.Message = "损坯撤销失败";
  5317. }
  5318. }
  5319. catch (Exception ex)
  5320. {
  5321. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5322. OutputLog.TraceLog(LogPriority.Error,
  5323. this.ToString(),
  5324. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5325. ex.ToString(),
  5326. LocalPath.LogExePath);
  5327. actionResult.Status = (int)Constant.PDAResult.Exception;
  5328. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5329. }
  5330. return actionResult;
  5331. }
  5332. /*
  5333. /// <summary>
  5334. /// 获取用户是否有损坯撤销权限
  5335. /// </summary>
  5336. /// <param name="accountCode"></param>
  5337. /// <param name="userCode"></param>
  5338. /// <param name="userPassword"></param>
  5339. /// <param name="sessionKey"></param>
  5340. /// <returns></returns>
  5341. public ActionResult GetCancelScrapProductionFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5342. {
  5343. ActionResult actionResult = new ActionResult();
  5344. try
  5345. {
  5346. // 验证请求头信息
  5347. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5348. // 验证失败
  5349. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5350. {
  5351. return actionResult;
  5352. }
  5353. int returnValue = ServiceInvoker.Invoke<int>(this,
  5354. () => PDAModuleLogic.GetCancelScrapProductionFuntion(sUserInfo));
  5355. actionResult.Result = JsonHelper.ToJson(returnValue);
  5356. actionResult.Status = (int)Constant.PDAResult.Success;
  5357. }
  5358. catch (Exception ex)
  5359. {
  5360. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5361. OutputLog.TraceLog(LogPriority.Error,
  5362. this.ToString(),
  5363. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5364. ex.ToString(),
  5365. LocalPath.LogExePath);
  5366. actionResult.Status = (int)Constant.PDAResult.Exception;
  5367. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5368. }
  5369. return actionResult;
  5370. }
  5371. */
  5372. /// <summary>
  5373. /// 获取条码注浆信息
  5374. /// </summary>
  5375. /// <param name="accountCode"></param>
  5376. /// <param name="userCode"></param>
  5377. /// <param name="userPassword"></param>
  5378. /// <param name="sessionKey"></param>
  5379. /// <returns></returns>
  5380. public ActionResult GetGroutingInfoBybarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5381. {
  5382. ActionResult actionResult = new ActionResult();
  5383. try
  5384. {
  5385. // 验证请求头信息
  5386. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5387. // 验证失败
  5388. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5389. {
  5390. return actionResult;
  5391. }
  5392. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  5393. () => PMModuleLogic.GetGroutingInfoBybarcode(barcode, sUserInfo));
  5394. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  5395. {
  5396. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  5397. actionResult.Status = (int)Constant.PDAResult.Success;
  5398. }
  5399. else
  5400. {
  5401. actionResult.Status = (int)Constant.PDAResult.Fail;
  5402. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5403. }
  5404. }
  5405. catch (Exception ex)
  5406. {
  5407. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5408. OutputLog.TraceLog(LogPriority.Error,
  5409. this.ToString(),
  5410. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5411. ex.ToString(),
  5412. LocalPath.LogExePath);
  5413. actionResult.Status = (int)Constant.PDAResult.Exception;
  5414. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5415. }
  5416. return actionResult;
  5417. }
  5418. /// <summary>
  5419. /// 获取条码注浆信息
  5420. /// </summary>
  5421. /// <param name="accountCode"></param>
  5422. /// <param name="userCode"></param>
  5423. /// <param name="userPassword"></param>
  5424. /// <param name="sessionKey"></param>
  5425. /// <returns></returns>
  5426. public ActionResult GetFinishedProductGroutingInfoBybarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5427. {
  5428. ActionResult actionResult = new ActionResult();
  5429. try
  5430. {
  5431. // 验证请求头信息
  5432. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5433. // 验证失败
  5434. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5435. {
  5436. return actionResult;
  5437. }
  5438. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  5439. () => PMModuleLogic.GetFinishedProductGroutingInfoBybarcode(barcode, sUserInfo));
  5440. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  5441. {
  5442. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  5443. actionResult.Status = (int)Constant.PDAResult.Success;
  5444. }
  5445. else
  5446. {
  5447. actionResult.Status = (int)Constant.PDAResult.Fail;
  5448. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5449. }
  5450. }
  5451. catch (Exception ex)
  5452. {
  5453. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5454. OutputLog.TraceLog(LogPriority.Error,
  5455. this.ToString(),
  5456. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5457. ex.ToString(),
  5458. LocalPath.LogExePath);
  5459. actionResult.Status = (int)Constant.PDAResult.Exception;
  5460. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5461. }
  5462. return actionResult;
  5463. }
  5464. /// <summary>
  5465. /// 公坯设定
  5466. /// </summary>
  5467. /// <param name="accountCode"></param>
  5468. /// <param name="userCode"></param>
  5469. /// <param name="userPassword"></param>
  5470. /// <param name="sessionKey"></param>
  5471. /// <param name="barcode"></param>
  5472. /// <returns></returns>
  5473. public ActionResult AddPublicBodyProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5474. {
  5475. ActionResult actionResult = new ActionResult();
  5476. try
  5477. {
  5478. // 验证请求头信息
  5479. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5480. // 验证失败
  5481. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5482. {
  5483. return actionResult;
  5484. }
  5485. int returnValue = ServiceInvoker.Invoke<int>(this,
  5486. () => PMModuleLogicDAL.AddPublicBodyProduct(barcode, sUserInfo));
  5487. if (returnValue > 0)
  5488. {
  5489. actionResult.Result = JsonHelper.ToJson(returnValue);
  5490. actionResult.Status = (int)Constant.PDAResult.Success;
  5491. }
  5492. else
  5493. {
  5494. actionResult.Status = (int)Constant.PDAResult.Fail;
  5495. if (returnValue == -1)
  5496. actionResult.Message = "此产品不在生产线上";
  5497. else if (returnValue == -2)
  5498. actionResult.Message = "该产品已经标识为公坯";
  5499. else
  5500. actionResult.Message = "公坯设定失败";
  5501. }
  5502. }
  5503. catch (Exception ex)
  5504. {
  5505. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5506. OutputLog.TraceLog(LogPriority.Error,
  5507. this.ToString(),
  5508. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5509. ex.ToString(),
  5510. LocalPath.LogExePath);
  5511. actionResult.Status = (int)Constant.PDAResult.Exception;
  5512. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5513. }
  5514. return actionResult;
  5515. }
  5516. /*
  5517. /// <summary>
  5518. /// 获取用户是否有公坯设定
  5519. /// </summary>
  5520. /// <param name="accountCode"></param>
  5521. /// <param name="userCode"></param>
  5522. /// <param name="userPassword"></param>
  5523. /// <param name="sessionKey"></param>
  5524. /// <returns></returns>
  5525. public ActionResult GetPublicBodyProductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5526. {
  5527. ActionResult actionResult = new ActionResult();
  5528. try
  5529. {
  5530. // 验证请求头信息
  5531. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5532. // 验证失败
  5533. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5534. {
  5535. return actionResult;
  5536. }
  5537. int returnValue = ServiceInvoker.Invoke<int>(this,
  5538. () => PDAModuleLogic.GetPublicBodyProductFuntion(sUserInfo));
  5539. actionResult.Result = JsonHelper.ToJson(returnValue);
  5540. actionResult.Status = (int)Constant.PDAResult.Success;
  5541. }
  5542. catch (Exception ex)
  5543. {
  5544. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5545. OutputLog.TraceLog(LogPriority.Error,
  5546. this.ToString(),
  5547. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5548. ex.ToString(),
  5549. LocalPath.LogExePath);
  5550. actionResult.Status = (int)Constant.PDAResult.Exception;
  5551. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5552. }
  5553. return actionResult;
  5554. }
  5555. */
  5556. /// <summary>
  5557. /// 校验产品条码是否可以走到该工序
  5558. /// </summary>
  5559. /// <param name="accountCode">帐套code</param>
  5560. /// <param name="userCode">用户code</param>
  5561. /// <param name="userPassword">用户密码</param>
  5562. /// <param name="sessionKey">本次登陆密钥</param>
  5563. /// <param name="procedureID">工序ID</param>
  5564. /// <param name="barcode">条码</param>
  5565. /// <returns></returns>
  5566. /// <remarks>
  5567. /// 陈冰 2014.09.18 新建
  5568. /// </remarks>
  5569. public ActionResult CheckBarcodeDeliverMud(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  5570. {
  5571. ActionResult actionResult = new ActionResult();
  5572. try
  5573. {
  5574. // 验证请求头信息
  5575. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5576. // 验证失败
  5577. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5578. {
  5579. return actionResult;
  5580. }
  5581. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  5582. () => PMModuleLogic.CheckBarcodeDeliverMud(procedureID, barcode, sUserInfo));
  5583. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  5584. {
  5585. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  5586. actionResult.Status = (int)Constant.PDAResult.Success;
  5587. }
  5588. else
  5589. {
  5590. actionResult.Status = (int)Constant.PDAResult.Fail;
  5591. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5592. }
  5593. }
  5594. catch (Exception ex)
  5595. {
  5596. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5597. OutputLog.TraceLog(LogPriority.Error,
  5598. this.ToString(),
  5599. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5600. ex.ToString(),
  5601. LocalPath.LogExePath);
  5602. actionResult.Status = (int)Constant.PDAResult.Exception;
  5603. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5604. }
  5605. return actionResult;
  5606. }
  5607. /// <summary>
  5608. /// 获取用户所有菜单权限
  5609. /// </summary>
  5610. /// <param name="accountCode"></param>
  5611. /// <param name="userCode"></param>
  5612. /// <param name="userPassword"></param>
  5613. /// <param name="sessionKey"></param>
  5614. /// <returns></returns>
  5615. public ActionResult GetUserAllFunction(string accountCode, string userCode, string userPassword, string sessionKey)
  5616. {
  5617. ActionResult actionResult = new ActionResult();
  5618. try
  5619. {
  5620. // 验证请求头信息
  5621. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5622. // 验证失败
  5623. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5624. {
  5625. return actionResult;
  5626. }
  5627. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  5628. () => PDAModuleLogic.GetUserAllFunction(sUserInfo));
  5629. actionResult.Result = JsonHelper.ToJson(returnValue);
  5630. actionResult.Status = (int)Constant.PDAResult.Success;
  5631. }
  5632. catch (Exception ex)
  5633. {
  5634. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5635. OutputLog.TraceLog(LogPriority.Error,
  5636. this.ToString(),
  5637. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5638. ex.ToString(),
  5639. LocalPath.LogExePath);
  5640. actionResult.Status = (int)Constant.PDAResult.Exception;
  5641. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5642. }
  5643. return actionResult;
  5644. }
  5645. public ActionResult AddChancelBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5646. {
  5647. ActionResult actionResult = new ActionResult();
  5648. try
  5649. {
  5650. // 验证请求头信息
  5651. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5652. // 验证失败
  5653. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5654. {
  5655. return actionResult;
  5656. }
  5657. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5658. () => PMModuleLogicDAL.AddChancelBarCode(barcode, sUserInfo));
  5659. if (Convert.ToInt32(returnValue.Result) > 0)
  5660. {
  5661. actionResult.Result = JsonHelper.ToJson(returnValue);
  5662. actionResult.Status = (int)Constant.PDAResult.Success;
  5663. }
  5664. else
  5665. {
  5666. actionResult.Status = (int)Constant.PDAResult.Fail;
  5667. if (Convert.ToInt32(returnValue.Result) == -1)
  5668. actionResult.Message = "无效条码";
  5669. else if (Convert.ToInt32(returnValue.Result) == -2)
  5670. actionResult.Message = "已经生产完成";
  5671. else if (Convert.ToInt32(returnValue.Result) == -3)
  5672. actionResult.Message = "条码已经申请报废";
  5673. else if (Convert.ToInt32(returnValue.Result) == -4)
  5674. actionResult.Message = "此条码当前工序不允许进行撤销";
  5675. else if (Convert.ToInt32(returnValue.Result) == -5)
  5676. actionResult.Message = "此条码没有生产数据";
  5677. else if (Convert.ToInt32(returnValue.Result) == -6)
  5678. actionResult.Message = "没有当前工序权限";
  5679. else if (Convert.ToInt32(returnValue.Result) == -7)
  5680. actionResult.Message = "条码不在生产线上";
  5681. else if (Convert.ToInt32(returnValue.Result) == -8)
  5682. actionResult.Message = "操作用户无此工序的撤销范围权限";
  5683. else if (Convert.ToInt32(returnValue.Result) == -9)
  5684. actionResult.Message = "条码已经是返工状态";
  5685. else if (Convert.ToInt32(returnValue.Result) == -200)
  5686. actionResult.Message = returnValue.Message;
  5687. }
  5688. }
  5689. catch (Exception ex)
  5690. {
  5691. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5692. OutputLog.TraceLog(LogPriority.Error,
  5693. this.ToString(),
  5694. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5695. ex.ToString(),
  5696. LocalPath.LogExePath);
  5697. actionResult.Status = (int)Constant.PDAResult.Exception;
  5698. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5699. }
  5700. return actionResult;
  5701. }
  5702. public ActionResult AddChancelDeliverMudBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5703. {
  5704. ActionResult actionResult = new ActionResult();
  5705. try
  5706. {
  5707. // 验证请求头信息
  5708. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5709. // 验证失败
  5710. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5711. {
  5712. return actionResult;
  5713. }
  5714. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5715. () => PMModuleLogicDAL.AddChancelDeliverMudBarCode(barcode, sUserInfo));
  5716. if (Convert.ToInt32(returnValue.Result) > 0)
  5717. {
  5718. actionResult.Result = JsonHelper.ToJson(returnValue);
  5719. actionResult.Status = (int)Constant.PDAResult.Success;
  5720. }
  5721. else
  5722. {
  5723. actionResult.Status = (int)Constant.PDAResult.Fail;
  5724. if (Convert.ToInt32(returnValue.Result) == -1)
  5725. actionResult.Message = "无效条码";
  5726. else if (Convert.ToInt32(returnValue.Result) == -2)
  5727. actionResult.Message = "已经生产完成";
  5728. else if (Convert.ToInt32(returnValue.Result) == -3)
  5729. actionResult.Message = "条码已经申请报废";
  5730. else if (Convert.ToInt32(returnValue.Result) == -4)
  5731. actionResult.Message = "此条码当前工序不允许进行撤销";
  5732. else if (Convert.ToInt32(returnValue.Result) == -5)
  5733. actionResult.Message = "此条码没有生产数据";
  5734. else if (Convert.ToInt32(returnValue.Result) == -55)
  5735. actionResult.Message = "条码已经不在交坯工序,不允许撤销";
  5736. else if (Convert.ToInt32(returnValue.Result) == -6)
  5737. actionResult.Message = "没有任何影响行";
  5738. else if (Convert.ToInt32(returnValue.Result) == -7)
  5739. actionResult.Message = "条码不在生产线上";
  5740. else if (Convert.ToInt32(returnValue.Result) == -8)
  5741. actionResult.Message = "条码已经是返工状态";
  5742. else if (Convert.ToInt32(returnValue.Result) == -200)
  5743. actionResult.Message = returnValue.Message;
  5744. }
  5745. }
  5746. catch (Exception ex)
  5747. {
  5748. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5749. OutputLog.TraceLog(LogPriority.Error,
  5750. this.ToString(),
  5751. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5752. ex.ToString(),
  5753. LocalPath.LogExePath);
  5754. actionResult.Status = (int)Constant.PDAResult.Exception;
  5755. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5756. }
  5757. return actionResult;
  5758. }
  5759. public ActionResult GetAllLogoInfo(string accountCode, string userCode, string userPassword, string sessionKey)
  5760. {
  5761. ActionResult actionResult = new ActionResult();
  5762. try
  5763. {
  5764. // 验证请求头信息
  5765. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5766. // 验证失败
  5767. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5768. {
  5769. return actionResult;
  5770. }
  5771. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  5772. //() => SystemModuleLogic.GetAllLogoInfo(sUserInfo));
  5773. () => SystemModuleLogic.GetLogoInfo(sUserInfo));
  5774. if (returnValue != null && returnValue.Tables[0].Rows.Count > 0)
  5775. {
  5776. //DataView dv = returnValue.Tables[0].DefaultView;
  5777. //dv.RowFilter = "ValueFlag=1";
  5778. //actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  5779. actionResult.Result = JsonHelper.ToJson(returnValue.Tables[0]);
  5780. actionResult.Status = (int)Constant.PDAResult.Success;
  5781. }
  5782. }
  5783. catch (Exception ex)
  5784. {
  5785. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5786. OutputLog.TraceLog(LogPriority.Error,
  5787. this.ToString(),
  5788. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5789. ex.ToString(),
  5790. LocalPath.LogExePath);
  5791. actionResult.Status = (int)Constant.PDAResult.Exception;
  5792. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5793. }
  5794. return actionResult;
  5795. }
  5796. /// <summary>
  5797. /// 变更产品商标用
  5798. /// </summary>
  5799. /// <param name="accountCode"></param>
  5800. /// <param name="userCode"></param>
  5801. /// <param name="userPassword"></param>
  5802. /// <param name="sessionKey"></param>
  5803. /// <param name="goodsid"></param>
  5804. /// <returns></returns>
  5805. public ActionResult GetLogoInfoForChange(string accountCode, string userCode, string userPassword, string sessionKey
  5806. , int goodsid)
  5807. {
  5808. ActionResult actionResult = new ActionResult();
  5809. try
  5810. {
  5811. // 验证请求头信息
  5812. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5813. // 验证失败
  5814. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5815. {
  5816. return actionResult;
  5817. }
  5818. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  5819. //() => SystemModuleLogic.GetAllLogoInfo(sUserInfo));
  5820. //() => SystemModuleLogic.GetLogoInfo(sUserInfo));
  5821. () => SystemModuleLogic.GetLogoInfoForChange(sUserInfo, goodsid));
  5822. if (returnValue != null && returnValue.Tables[0].Rows.Count > 0)
  5823. {
  5824. //DataView dv = returnValue.Tables[0].DefaultView;
  5825. //dv.RowFilter = "ValueFlag=1";
  5826. //actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  5827. actionResult.Result = JsonHelper.ToJson(returnValue.Tables[0]);
  5828. actionResult.Status = (int)Constant.PDAResult.Success;
  5829. }
  5830. }
  5831. catch (Exception ex)
  5832. {
  5833. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5834. OutputLog.TraceLog(LogPriority.Error,
  5835. this.ToString(),
  5836. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5837. ex.ToString(),
  5838. LocalPath.LogExePath);
  5839. actionResult.Status = (int)Constant.PDAResult.Exception;
  5840. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5841. }
  5842. return actionResult;
  5843. }
  5844. public ActionResult GetLogoID(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  5845. {
  5846. ActionResult actionResult = new ActionResult();
  5847. try
  5848. {
  5849. // 验证请求头信息
  5850. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5851. // 验证失败
  5852. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5853. {
  5854. return actionResult;
  5855. }
  5856. int returnValue = ServiceInvoker.Invoke<int>(this,
  5857. () => PMModuleLogic.GetLogoID(procedureID, sUserInfo));
  5858. actionResult.Result = JsonHelper.ToJson(returnValue);
  5859. actionResult.Status = (int)Constant.PDAResult.Success;
  5860. }
  5861. catch (Exception ex)
  5862. {
  5863. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5864. OutputLog.TraceLog(LogPriority.Error,
  5865. this.ToString(),
  5866. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5867. ex.ToString(),
  5868. LocalPath.LogExePath);
  5869. actionResult.Status = (int)Constant.PDAResult.Exception;
  5870. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5871. }
  5872. return actionResult;
  5873. }
  5874. public ActionResult SaveBarCodeLogo(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int logoid)
  5875. {
  5876. ActionResult actionResult = new ActionResult();
  5877. try
  5878. {
  5879. // 验证请求头信息
  5880. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5881. // 验证失败
  5882. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5883. {
  5884. return actionResult;
  5885. }
  5886. int returnValue = ServiceInvoker.Invoke<int>(this,
  5887. () => PMModuleLogicDAL.SaveBarCodeLogo(barcode, logoid, sUserInfo));
  5888. actionResult.Result = JsonHelper.ToJson(returnValue);
  5889. if (returnValue > 0)
  5890. {
  5891. actionResult.Status = (int)Constant.PDAResult.Success;
  5892. }
  5893. else if (returnValue == -2)
  5894. {
  5895. actionResult.Message = "条码不存在";
  5896. actionResult.Status = (int)Constant.PDAResult.Fail;
  5897. }
  5898. else if (returnValue == -3)
  5899. {
  5900. actionResult.Message = "已交接的产品不能变更商标";
  5901. actionResult.Status = (int)Constant.PDAResult.Fail;
  5902. }
  5903. else
  5904. {
  5905. actionResult.Status = (int)Constant.PDAResult.Fail;
  5906. }
  5907. }
  5908. catch (Exception ex)
  5909. {
  5910. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5911. OutputLog.TraceLog(LogPriority.Error,
  5912. this.ToString(),
  5913. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5914. ex.ToString(),
  5915. LocalPath.LogExePath);
  5916. actionResult.Status = (int)Constant.PDAResult.Exception;
  5917. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5918. }
  5919. return actionResult;
  5920. }
  5921. public ActionResult SaveBarCodeLogoAndGlazetype(string accountCode, string userCode, string userPassword, string sessionKey,
  5922. string barcode, int logoid, int glazetypeid)
  5923. {
  5924. ActionResult actionResult = new ActionResult();
  5925. try
  5926. {
  5927. // 验证请求头信息
  5928. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5929. // 验证失败
  5930. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5931. {
  5932. return actionResult;
  5933. }
  5934. int returnValue = ServiceInvoker.Invoke<int>(this,
  5935. () => PMModuleLogicDAL.SaveBarCodeLogoAndGlazetype(barcode, logoid, glazetypeid, sUserInfo));
  5936. actionResult.Result = JsonHelper.ToJson(returnValue);
  5937. if (returnValue > 0)
  5938. {
  5939. actionResult.Status = (int)Constant.PDAResult.Success;
  5940. }
  5941. else
  5942. {
  5943. actionResult.Status = (int)Constant.PDAResult.Fail;
  5944. actionResult.Message = "条码不存在";
  5945. }
  5946. }
  5947. catch (Exception ex)
  5948. {
  5949. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5950. OutputLog.TraceLog(LogPriority.Error,
  5951. this.ToString(),
  5952. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5953. ex.ToString(),
  5954. LocalPath.LogExePath);
  5955. actionResult.Status = (int)Constant.PDAResult.Exception;
  5956. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5957. }
  5958. return actionResult;
  5959. }
  5960. public ActionResult SaveBarCodesLogoAndGlazetype(string accountCode, string userCode, string userPassword, string sessionKey,
  5961. string barcodes, int logoid, int glazetypeid, int procedureID)
  5962. {
  5963. ActionResult actionResult = new ActionResult();
  5964. try
  5965. {
  5966. // 验证请求头信息
  5967. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5968. // 验证失败
  5969. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5970. {
  5971. return actionResult;
  5972. }
  5973. int returnValue = ServiceInvoker.Invoke<int>(this,
  5974. () => PMModuleLogicDAL.SaveBarCodesLogoAndGlazetype(barcodes, logoid, glazetypeid, procedureID, sUserInfo));
  5975. actionResult.Result = JsonHelper.ToJson(returnValue);
  5976. if (returnValue > 0)
  5977. {
  5978. actionResult.Status = (int)Constant.PDAResult.Success;
  5979. }
  5980. else
  5981. {
  5982. actionResult.Status = (int)Constant.PDAResult.Fail;
  5983. actionResult.Message = "条码不存在";
  5984. }
  5985. }
  5986. catch (Exception ex)
  5987. {
  5988. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5989. OutputLog.TraceLog(LogPriority.Error,
  5990. this.ToString(),
  5991. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5992. ex.ToString(),
  5993. LocalPath.LogExePath);
  5994. actionResult.Status = (int)Constant.PDAResult.Exception;
  5995. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5996. }
  5997. return actionResult;
  5998. }
  5999. public ActionResult GetBarCodeLogoID(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6000. {
  6001. ActionResult actionResult = new ActionResult();
  6002. try
  6003. {
  6004. // 验证请求头信息
  6005. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6006. // 验证失败
  6007. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6008. {
  6009. return actionResult;
  6010. }
  6011. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  6012. () => PMModuleLogic.GetBarCodeLogoID(barcode, sUserInfo));
  6013. if (returnValue != null && returnValue.Tables[0].Rows.Count > 0)
  6014. {
  6015. string err_msg = returnValue.Tables[0].Rows[0]["err_msg"] + "";
  6016. if (!string.IsNullOrWhiteSpace(err_msg))
  6017. {
  6018. actionResult.Status = (int)Constant.PDAResult.Fail;
  6019. actionResult.Message = err_msg;
  6020. }
  6021. else
  6022. {
  6023. actionResult.Result = JsonHelper.ToJson(returnValue.Tables[0]);
  6024. actionResult.Status = (int)Constant.PDAResult.Success;
  6025. }
  6026. }
  6027. else
  6028. {
  6029. actionResult.Status = (int)Constant.PDAResult.Fail;
  6030. }
  6031. }
  6032. catch (Exception ex)
  6033. {
  6034. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6035. OutputLog.TraceLog(LogPriority.Error,
  6036. this.ToString(),
  6037. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6038. ex.ToString(),
  6039. LocalPath.LogExePath);
  6040. actionResult.Status = (int)Constant.PDAResult.Exception;
  6041. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6042. }
  6043. return actionResult;
  6044. }
  6045. /// <summary>
  6046. /// 半检时,入窑前检验获取此条码是否报损为废品
  6047. /// </summary>
  6048. /// <param name="accountCode"></param>
  6049. /// <param name="userCode"></param>
  6050. /// <param name="userPassword"></param>
  6051. /// <param name="sessionKey"></param>
  6052. /// <param name="barcode">产品条码</param>
  6053. /// <returns></returns>
  6054. public ActionResult CheckWasteScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6055. {
  6056. ActionResult actionResult = new ActionResult();
  6057. try
  6058. {
  6059. // 验证请求头信息
  6060. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6061. // 验证失败
  6062. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6063. {
  6064. return actionResult;
  6065. }
  6066. int returnValue = ServiceInvoker.Invoke<int>(this,
  6067. () => PMModuleLogic.CheckWasteScrapProduct(barcode));
  6068. if (returnValue != -100)
  6069. {
  6070. actionResult.Result = JsonHelper.ToJson(returnValue);
  6071. actionResult.Status = (int)Constant.PDAResult.Success;
  6072. }
  6073. else
  6074. {
  6075. actionResult.Status = (int)Constant.PDAResult.Fail;
  6076. actionResult.Message = "条码[" + barcode + "]不是废品,不能进行编辑";
  6077. }
  6078. }
  6079. catch (Exception ex)
  6080. {
  6081. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6082. OutputLog.TraceLog(LogPriority.Error,
  6083. this.ToString(),
  6084. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6085. ex.ToString(),
  6086. LocalPath.LogExePath);
  6087. actionResult.Status = (int)Constant.PDAResult.Exception;
  6088. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6089. }
  6090. return actionResult;
  6091. }
  6092. /// <summary>
  6093. /// 获取登陆帐户有无入窑前检验数据编辑权限
  6094. /// </summary>
  6095. /// <param name="accountCode"></param>
  6096. /// <param name="userCode"></param>
  6097. /// <param name="userPassword"></param>
  6098. /// <param name="sessionKey"></param>
  6099. /// <param name="usercode">工号编码</param>
  6100. /// <returns></returns>
  6101. public ActionResult GetIntoKilnCheckEditFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  6102. {
  6103. ActionResult actionResult = new ActionResult();
  6104. try
  6105. {
  6106. // 验证请求头信息
  6107. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6108. // 验证失败
  6109. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6110. {
  6111. return actionResult;
  6112. }
  6113. int returnValue = ServiceInvoker.Invoke<int>(this,
  6114. () => PDAModuleLogic.GetIntoKilnCheckEditFuntion(sUserInfo));
  6115. actionResult.Result = JsonHelper.ToJson(returnValue);
  6116. actionResult.Status = (int)Constant.PDAResult.Success;
  6117. }
  6118. catch (Exception ex)
  6119. {
  6120. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6121. OutputLog.TraceLog(LogPriority.Error,
  6122. this.ToString(),
  6123. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6124. ex.ToString(),
  6125. LocalPath.LogExePath);
  6126. actionResult.Status = (int)Constant.PDAResult.Exception;
  6127. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6128. }
  6129. return actionResult;
  6130. }
  6131. /// <summary>
  6132. /// 获取登陆帐户有无半检验数据编辑权限
  6133. /// </summary>
  6134. /// <param name="accountCode"></param>
  6135. /// <param name="userCode"></param>
  6136. /// <param name="userPassword"></param>
  6137. /// <param name="sessionKey"></param>
  6138. /// <param name="usercode">工号编码</param>
  6139. /// <returns></returns>
  6140. public ActionResult GetNormalCheckEditFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  6141. {
  6142. ActionResult actionResult = new ActionResult();
  6143. try
  6144. {
  6145. // 验证请求头信息
  6146. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6147. // 验证失败
  6148. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6149. {
  6150. return actionResult;
  6151. }
  6152. int returnValue = ServiceInvoker.Invoke<int>(this,
  6153. () => PDAModuleLogic.GetNormalCheckEditFuntion(sUserInfo));
  6154. actionResult.Result = JsonHelper.ToJson(returnValue);
  6155. actionResult.Status = (int)Constant.PDAResult.Success;
  6156. }
  6157. catch (Exception ex)
  6158. {
  6159. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6160. OutputLog.TraceLog(LogPriority.Error,
  6161. this.ToString(),
  6162. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6163. ex.ToString(),
  6164. LocalPath.LogExePath);
  6165. actionResult.Status = (int)Constant.PDAResult.Exception;
  6166. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6167. }
  6168. return actionResult;
  6169. }
  6170. /// <summary>
  6171. /// 获取缺陷扣罚管理的全部数据
  6172. /// </summary>
  6173. /// <param name="accountCode"></param>
  6174. /// <param name="userCode"></param>
  6175. /// <param name="userPassword"></param>
  6176. /// <param name="sessionKey"></param>
  6177. /// <returns></returns>
  6178. public ActionResult GetAllDefectFine(string accountCode, string userCode, string userPassword, string sessionKey)
  6179. {
  6180. ActionResult actionResult = new ActionResult();
  6181. try
  6182. {
  6183. // 验证请求头信息
  6184. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6185. // 验证失败
  6186. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6187. {
  6188. return actionResult;
  6189. }
  6190. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6191. () => SystemModuleLogic.GetAllDefectFine(sUserInfo));
  6192. if (ds != null && ds.Tables[0].Rows.Count > 0)
  6193. {
  6194. DataView dv = ds.Tables[0].DefaultView;
  6195. dv.RowFilter = "valueflag=1";
  6196. actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  6197. actionResult.Status = (int)Constant.PDAResult.Success;
  6198. }
  6199. else
  6200. {
  6201. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  6202. actionResult.Status = (int)Constant.PDAResult.Success;
  6203. }
  6204. }
  6205. catch (Exception ex)
  6206. {
  6207. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6208. OutputLog.TraceLog(LogPriority.Error,
  6209. this.ToString(),
  6210. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6211. ex.ToString(),
  6212. LocalPath.LogExePath);
  6213. actionResult.Status = (int)Constant.PDAResult.Exception;
  6214. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6215. }
  6216. return actionResult;
  6217. }
  6218. /// <summary>
  6219. /// 获取缺陷扣除数管理的全部数据
  6220. /// </summary>
  6221. /// <param name="accountCode"></param>
  6222. /// <param name="userCode"></param>
  6223. /// <param name="userPassword"></param>
  6224. /// <param name="sessionKey"></param>
  6225. /// <returns></returns>
  6226. public ActionResult GetAllDefectDeduction(string accountCode, string userCode, string userPassword, string sessionKey)
  6227. {
  6228. ActionResult actionResult = new ActionResult();
  6229. try
  6230. {
  6231. // 验证请求头信息
  6232. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6233. // 验证失败
  6234. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6235. {
  6236. return actionResult;
  6237. }
  6238. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6239. () => SystemModuleLogic.GetAllDefectDeduction(sUserInfo));
  6240. if (ds != null && ds.Tables[0].Rows.Count > 0)
  6241. {
  6242. DataView dv = ds.Tables[0].DefaultView;
  6243. dv.RowFilter = "valueflag=1";
  6244. actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  6245. actionResult.Status = (int)Constant.PDAResult.Success;
  6246. }
  6247. else
  6248. {
  6249. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  6250. actionResult.Status = (int)Constant.PDAResult.Success;
  6251. }
  6252. }
  6253. catch (Exception ex)
  6254. {
  6255. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6256. OutputLog.TraceLog(LogPriority.Error,
  6257. this.ToString(),
  6258. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6259. ex.ToString(),
  6260. LocalPath.LogExePath);
  6261. actionResult.Status = (int)Constant.PDAResult.Exception;
  6262. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6263. }
  6264. return actionResult;
  6265. }
  6266. /// <summary>
  6267. /// 获取缺陷扣罚关系管理的全部数据
  6268. /// </summary>
  6269. /// <param name="accountCode"></param>
  6270. /// <param name="userCode"></param>
  6271. /// <param name="userPassword"></param>
  6272. /// <param name="sessionKey"></param>
  6273. /// <returns></returns>
  6274. public ActionResult GetAllDefectFineRelation(string accountCode, string userCode, string userPassword, string sessionKey)
  6275. {
  6276. ActionResult actionResult = new ActionResult();
  6277. try
  6278. {
  6279. // 验证请求头信息
  6280. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6281. // 验证失败
  6282. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6283. {
  6284. return actionResult;
  6285. }
  6286. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6287. () => SystemModuleLogic.GetAllDefectFineRelation(sUserInfo));
  6288. DataTable dt = new DataTable();
  6289. dt.Columns.Add("DefectID");
  6290. dt.Columns.Add("DefectFineID");
  6291. DataView dv = ds.Tables[0].DefaultView;
  6292. DataTable dtFor = dv.ToTable("defectid", true);
  6293. for (int i = 0; i < dtFor.Rows.Count; i++)
  6294. {
  6295. DataRow[] r = ds.Tables[0].Select("defectid=" + dtFor.Rows[i]["defectid"]);
  6296. string substring = "";
  6297. foreach (DataRow r1 in r)
  6298. {
  6299. substring += r1["DefectFineID"].ToString() + "-" + r1["DEFECTFINECODE"].ToString() + ",";
  6300. }
  6301. if (substring != "")
  6302. {
  6303. DataRow drnew = dt.NewRow();
  6304. drnew["DefectID"] = dtFor.Rows[i]["defectid"];
  6305. drnew["DefectFineID"] = substring.TrimEnd(',');
  6306. dt.Rows.Add(drnew);
  6307. }
  6308. }
  6309. actionResult.Result = JsonHelper.ToJson(dt);//ds.Tables[0]
  6310. actionResult.Status = (int)Constant.PDAResult.Success;
  6311. }
  6312. catch (Exception ex)
  6313. {
  6314. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6315. OutputLog.TraceLog(LogPriority.Error,
  6316. this.ToString(),
  6317. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6318. ex.ToString(),
  6319. LocalPath.LogExePath);
  6320. actionResult.Status = (int)Constant.PDAResult.Exception;
  6321. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6322. }
  6323. return actionResult;
  6324. }
  6325. /// <summary>
  6326. /// 获取缺陷扣除数关系管理的全部数据
  6327. /// </summary>
  6328. /// <param name="accountCode"></param>
  6329. /// <param name="userCode"></param>
  6330. /// <param name="userPassword"></param>
  6331. /// <param name="sessionKey"></param>
  6332. /// <returns></returns>
  6333. public ActionResult GetAllDefectDeductionRelation(string accountCode, string userCode, string userPassword, string sessionKey)
  6334. {
  6335. ActionResult actionResult = new ActionResult();
  6336. try
  6337. {
  6338. // 验证请求头信息
  6339. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6340. // 验证失败
  6341. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6342. {
  6343. return actionResult;
  6344. }
  6345. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6346. () => SystemModuleLogic.GetAllDefectDeductionRelation(sUserInfo));
  6347. DataTable dt = new DataTable();
  6348. dt.Columns.Add("DefectID");
  6349. dt.Columns.Add("DefectDeductionNum");
  6350. DataView dv = ds.Tables[0].DefaultView;
  6351. DataTable dtFor = dv.ToTable("defectid", true);
  6352. for (int i = 0; i < dtFor.Rows.Count; i++)
  6353. {
  6354. DataRow[] r = ds.Tables[0].Select("defectid=" + dtFor.Rows[i]["defectid"]);
  6355. string substring = "";
  6356. foreach (DataRow r1 in r)
  6357. {
  6358. substring += r1["DefectDeductionID"].ToString() + "-" + r1["DefectDeductionNum"].ToString() + ",";
  6359. }
  6360. if (substring != "")
  6361. {
  6362. DataRow drnew = dt.NewRow();
  6363. drnew["DefectID"] = dtFor.Rows[i]["defectid"];
  6364. drnew["DefectDeductionNum"] = substring.TrimEnd(',');
  6365. dt.Rows.Add(drnew);
  6366. }
  6367. }
  6368. actionResult.Result = JsonHelper.ToJson(dt);//ds.Tables[0]
  6369. actionResult.Status = (int)Constant.PDAResult.Success;
  6370. }
  6371. catch (Exception ex)
  6372. {
  6373. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6374. OutputLog.TraceLog(LogPriority.Error,
  6375. this.ToString(),
  6376. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6377. ex.ToString(),
  6378. LocalPath.LogExePath);
  6379. actionResult.Status = (int)Constant.PDAResult.Exception;
  6380. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6381. }
  6382. return actionResult;
  6383. }
  6384. /// <summary>
  6385. /// 获取盘点单明细
  6386. /// </summary>
  6387. /// <param name="sUserInfo"></param>
  6388. /// <returns></returns>
  6389. public ActionResult GetUpdateInCheckedInfo(string accountCode, string userCode, string userPassword, string sessionKey, string incheckedno)
  6390. {
  6391. ActionResult actionResult = new ActionResult();
  6392. try
  6393. {
  6394. // 验证请求头信息
  6395. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6396. // 验证失败
  6397. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6398. {
  6399. return actionResult;
  6400. }
  6401. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6402. () => PMModuleLogic.GetUpdateInCheckedInfo(incheckedno, sUserInfo));
  6403. actionResult.Result = JsonHelper.ToJson(ds);
  6404. actionResult.Status = (int)Constant.PDAResult.Success;
  6405. }
  6406. catch (Exception ex)
  6407. {
  6408. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6409. OutputLog.TraceLog(LogPriority.Error,
  6410. this.ToString(),
  6411. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6412. ex.ToString(),
  6413. LocalPath.LogExePath);
  6414. actionResult.Status = (int)Constant.PDAResult.Exception;
  6415. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6416. }
  6417. return actionResult;
  6418. }
  6419. /// <summary>
  6420. /// 半检检验条码
  6421. /// </summary>
  6422. /// <param name="sUserInfo"></param>
  6423. /// <returns></returns>
  6424. public ActionResult SemiCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6425. {
  6426. ActionResult actionResult = new ActionResult();
  6427. try
  6428. {
  6429. // 验证请求头信息
  6430. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6431. // 验证失败
  6432. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6433. {
  6434. return actionResult;
  6435. }
  6436. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6437. () => PMModuleLogic.SemiCheckBarcode(barcode, sUserInfo));
  6438. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6439. if (Convert.ToInt32(resultEntity.Result) < 0)
  6440. {
  6441. actionResult.Status = (int)Constant.PDAResult.Fail;
  6442. }
  6443. else
  6444. {
  6445. actionResult.Status = (int)Constant.PDAResult.Success;
  6446. }
  6447. actionResult.Message = resultEntity.Message;
  6448. }
  6449. catch (Exception ex)
  6450. {
  6451. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6452. OutputLog.TraceLog(LogPriority.Error,
  6453. this.ToString(),
  6454. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6455. ex.ToString(),
  6456. LocalPath.LogExePath);
  6457. actionResult.Status = (int)Constant.PDAResult.Exception;
  6458. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6459. }
  6460. return actionResult;
  6461. }
  6462. /// <summary>
  6463. /// 根据条码获取经过的工序,用于绑定返工工序
  6464. /// </summary>
  6465. /// <param name="sUserInfo"></param>
  6466. /// <returns></returns>
  6467. public ActionResult GetSemiCheckPassProcedure(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6468. {
  6469. ActionResult actionResult = new ActionResult();
  6470. try
  6471. {
  6472. // 验证请求头信息
  6473. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6474. // 验证失败
  6475. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6476. {
  6477. return actionResult;
  6478. }
  6479. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6480. () => PMModuleLogic.GetSemiCheckPassProcedure(barcode));
  6481. actionResult.Result = JsonHelper.ToJson(resultEntity);
  6482. actionResult.Status = (int)Constant.PDAResult.Success;
  6483. }
  6484. catch (Exception ex)
  6485. {
  6486. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6487. OutputLog.TraceLog(LogPriority.Error,
  6488. this.ToString(),
  6489. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6490. ex.ToString(),
  6491. LocalPath.LogExePath);
  6492. actionResult.Status = (int)Constant.PDAResult.Exception;
  6493. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6494. }
  6495. return actionResult;
  6496. }
  6497. /// <summary>
  6498. /// 获取登陆帐户有无半检状态权限
  6499. /// </summary>
  6500. /// <param name="sUserInfo"></param>
  6501. /// <returns></returns>
  6502. public ActionResult GetSemiCheckStatusFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  6503. {
  6504. ActionResult actionResult = new ActionResult();
  6505. try
  6506. {
  6507. // 验证请求头信息
  6508. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6509. // 验证失败
  6510. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6511. {
  6512. return actionResult;
  6513. }
  6514. int resultEntity = ServiceInvoker.Invoke<int>(this,
  6515. () => PMModuleLogic.GetSemiCheckStatusFuntion(sUserInfo));
  6516. actionResult.Result = JsonHelper.ToJson(resultEntity);
  6517. actionResult.Status = (int)Constant.PDAResult.Success;
  6518. }
  6519. catch (Exception ex)
  6520. {
  6521. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6522. OutputLog.TraceLog(LogPriority.Error,
  6523. this.ToString(),
  6524. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6525. ex.ToString(),
  6526. LocalPath.LogExePath);
  6527. actionResult.Status = (int)Constant.PDAResult.Exception;
  6528. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6529. }
  6530. return actionResult;
  6531. }
  6532. /// <summary>
  6533. /// 复检状态数据源
  6534. /// </summary>
  6535. /// <param name="sUserInfo"></param>
  6536. /// <returns></returns>
  6537. public ActionResult GetSemiCheckType(string accountCode, string userCode, string userPassword, string sessionKey)
  6538. {
  6539. ActionResult actionResult = new ActionResult();
  6540. try
  6541. {
  6542. // 验证请求头信息
  6543. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6544. // 验证失败
  6545. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6546. {
  6547. return actionResult;
  6548. }
  6549. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6550. () => SystemModuleLogic.GetSemiCheckType());
  6551. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6552. actionResult.Status = (int)Constant.PDAResult.Success;
  6553. }
  6554. catch (Exception ex)
  6555. {
  6556. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6557. OutputLog.TraceLog(LogPriority.Error,
  6558. this.ToString(),
  6559. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6560. ex.ToString(),
  6561. LocalPath.LogExePath);
  6562. actionResult.Status = (int)Constant.PDAResult.Exception;
  6563. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6564. }
  6565. return actionResult;
  6566. }
  6567. /// <summary>
  6568. /// 根据半成品检验数据ID,显示半成品数据信息
  6569. /// </summary>
  6570. /// <param name="sUserInfo"></param>
  6571. /// <returns></returns>
  6572. public ActionResult GetSemiCheckByID(string accountCode, string userCode, string userPassword, string sessionKey, int semiCheckID)
  6573. {
  6574. ActionResult actionResult = new ActionResult();
  6575. try
  6576. {
  6577. // 验证请求头信息
  6578. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6579. // 验证失败
  6580. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6581. {
  6582. return actionResult;
  6583. }
  6584. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  6585. () => PMModuleLogic.GetSemiCheckByID(semiCheckID));
  6586. SemiCheckEntity[] productionDatas = new SemiCheckEntity[1];
  6587. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  6588. {
  6589. if (reworkDs != null && reworkDs.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  6590. {
  6591. for (int i = 0; i < reworkDs.Tables[0].Rows.Count; i++)
  6592. {
  6593. SemiCheckEntity productionData = new SemiCheckEntity();
  6594. productionData.BarCode = reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
  6595. if (reworkDs.Tables[0].Rows[i]["GoodsID"].ToString() != "")
  6596. {
  6597. productionData.GoodsID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsID"].ToString());
  6598. }
  6599. productionData.SemiCheckID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["SemiCheckID"].ToString());
  6600. productionData.GoodsCode = reworkDs.Tables[0].Rows[i]["GoodsCode"].ToString();
  6601. productionData.GoodsName = reworkDs.Tables[0].Rows[i]["GoodsName"].ToString();
  6602. productionData.SemiCheckType = reworkDs.Tables[0].Rows[i]["SemiCheckType"].ToString();
  6603. productionData.ReFine = 0;
  6604. if (reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString() != "")
  6605. {
  6606. productionData.ReworkProcedureID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString());
  6607. }
  6608. productionData.ReSemiCheckType = reworkDs.Tables[0].Rows[i]["ReSemiCheckType"].ToString();
  6609. productionData.ReworkProcedureCode = reworkDs.Tables[0].Rows[i]["ReworkProcedureCode"].ToString();
  6610. productionData.ReworkProcedureName = reworkDs.Tables[0].Rows[i]["ReworkProcedureName"].ToString();
  6611. productionData.Remarks = reworkDs.Tables[0].Rows[i]["Remarks"].ToString();
  6612. if (reworkDs.Tables[0].Rows[i]["UserID"].ToString() != "")
  6613. {
  6614. productionData.SemiCheckUserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["UserID"].ToString());
  6615. productionData.SemiCheckUserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
  6616. }
  6617. if (reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString() != "")
  6618. {
  6619. productionData.GoodsLevelTypeID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString());
  6620. }
  6621. //productionData.UserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
  6622. //productionData.UserName = reworkDs.Tables[0].Rows[i]["UserName"].ToString();
  6623. productionData.SpecialRepairFlag = reworkDs.Tables[0].Rows[i]["SpecialRepairFlag"].ToString();
  6624. productionData.GroutingUserCode = reworkDs.Tables[0].Rows[i]["GroutingUserCode"].ToString();
  6625. productionData.GroutingNum = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GroutingNum"]);
  6626. productionData.IsPublicBody = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["IsPublicBody"]);
  6627. productionData.MouldCode = reworkDs.Tables[0].Rows[i]["MouldCode"].ToString();
  6628. productionData.GroutingDate = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["GroutingDate"]);
  6629. if (reworkDs.Tables[0].Rows[i]["ReworkUserID"].ToString() != "")
  6630. {
  6631. productionData.ReworkUserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkUserID"].ToString());
  6632. productionData.ReworkUserCode = reworkDs.Tables[0].Rows[i]["ReworkUserCode"].ToString();
  6633. }
  6634. productionData.ReSemiCheckUserCode = reworkDs.Tables[0].Rows[i]["ReSemiCheckUserCode"].ToString();
  6635. if (reworkDs.Tables[0].Rows[i]["logoid"].ToString() != "")
  6636. {
  6637. productionData.Logoid = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["Logoid"]);
  6638. productionData.LogoCode = reworkDs.Tables[0].Rows[i]["LogoCode"].ToString();
  6639. productionData.LogoName = reworkDs.Tables[0].Rows[i]["LogoName"].ToString();
  6640. }
  6641. productionData.SemiCheckTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["SemiCheckTime"]);
  6642. if (reworkDs.Tables[0].Rows[i]["ReSemiCheckTime"] != DBNull.Value)
  6643. {
  6644. productionData.ReSemiCheckDateTimeStart = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["ReSemiCheckTime"]);
  6645. }
  6646. DataView dvDefect = reworkDs.Tables[1].DefaultView;
  6647. dvDefect.RowFilter = "SemiCheckID=" + reworkDs.Tables[0].Rows[i]["SemiCheckID"].ToString();
  6648. DataTable dtDefect = dvDefect.ToTable();
  6649. for (int row = 0; row < dtDefect.Rows.Count; row++)
  6650. {
  6651. // 产品缺陷
  6652. SemiCheckDefectEntity defect = new SemiCheckDefectEntity();
  6653. //defect.SpecialDefect = dtDefect.Rows[row]["SpecialDefect"].ToString();
  6654. //defect.DefectDeductionNum = Convert.ToDecimal(dtDefect.Rows[row]["DefectDeductionNum"].ToString());
  6655. //if (dtDefect.Rows[row]["ProductionDefectID"].ToString() != "")
  6656. //{
  6657. // defect.ProductionDefectID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDefectID"].ToString());
  6658. //}
  6659. //defect.BarCode = dtDefect.Rows[row]["BarCode"].ToString();
  6660. if (dtDefect.Rows[row]["DefectID"].ToString() != "")
  6661. {
  6662. defect.DefectID = Convert.ToInt32(dtDefect.Rows[row]["DefectID"].ToString());
  6663. }
  6664. defect.DefectName = dtDefect.Rows[row]["DefectName"].ToString();
  6665. defect.DefectCode = dtDefect.Rows[row]["DefectCode"].ToString();
  6666. if (dtDefect.Rows[row]["DefectPositionID"].ToString() != "")
  6667. {
  6668. defect.DefectPositionID = Convert.ToInt32(dtDefect.Rows[row]["DefectPositionID"].ToString());
  6669. }
  6670. defect.DefectPositionName = dtDefect.Rows[row]["DefectPositionName"].ToString();
  6671. defect.DefectPositionCode = dtDefect.Rows[row]["DefectPositionCode"].ToString();
  6672. if (dtDefect.Rows[row]["DefectProcedureID"].ToString() != "")
  6673. {
  6674. defect.DefectProcedureID = Convert.ToInt32(dtDefect.Rows[row]["DefectProcedureID"].ToString());
  6675. }
  6676. defect.DefectProcedureName = dtDefect.Rows[row]["DefectProcedureName"].ToString();
  6677. defect.DefectProcedureCode = dtDefect.Rows[row]["DefectProcedureCode"].ToString();
  6678. if (dtDefect.Rows[row]["DefectUserID"].ToString() != "")
  6679. {
  6680. defect.DefectUserID = Convert.ToInt32(dtDefect.Rows[row]["DefectUserID"].ToString());
  6681. }
  6682. defect.DefectUserName = dtDefect.Rows[row]["DefectUserName"].ToString();
  6683. defect.DefectUserCode = dtDefect.Rows[row]["DefectUserCode"].ToString();
  6684. //if (dtDefect.Rows[row]["Jobs"].ToString() != "")
  6685. //{
  6686. // defect.Jobs = Convert.ToInt32(dtDefect.Rows[row]["Jobs"].ToString());
  6687. //}
  6688. //if (dtDefect.Rows[row]["MissedUserID"].ToString() != "")
  6689. //{
  6690. // defect.MissedUserID = Convert.ToInt32(dtDefect.Rows[row]["MissedUserID"].ToString());
  6691. //}
  6692. //defect.MissedUserCode = dtDefect.Rows[row]["MissedUserCode"].ToString();
  6693. //defect.MissedUserName = dtDefect.Rows[row]["MissedUserName"].ToString();
  6694. //defect.JobsText = dtDefect.Rows[row]["JobsText"].ToString();
  6695. defect.Remarks = dtDefect.Rows[row]["remarks"].ToString();
  6696. if (dtDefect.Rows[row]["semicheckid"].ToString() != "")
  6697. {
  6698. defect.SemiCheckID = Convert.ToInt32(dtDefect.Rows[row]["semicheckid"].ToString());
  6699. }
  6700. if (dtDefect.Rows[row]["DefectProductionDataID"].ToString() != "")
  6701. {
  6702. defect.DefectProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["DefectProductionDataID"].ToString());
  6703. }
  6704. //if (dtDefect.Rows[row]["DefectFineID"].ToString() != "")
  6705. //{
  6706. // defect.DefectFineID = Convert.ToInt32(dtDefect.Rows[row]["DefectFineID"].ToString());
  6707. //}
  6708. //defect.DefectFineValue = dtDefect.Rows[row]["DefectFineValue"].ToString();
  6709. //--------责任员工-------------------
  6710. DataRow[] drRow = reworkDs.Tables[2].Select("SemiCheckDefectID=" + reworkDs.Tables[1].Rows[row]["SemiCheckDefectID"]);
  6711. if (drRow.Length > Constant.INT_IS_ZERO)
  6712. {
  6713. if (defect.DefectResponsibles == null)
  6714. {
  6715. defect.DefectResponsibles = new List<SemiCheckResponsibleEntity>();
  6716. }
  6717. foreach (DataRow r in drRow)
  6718. {
  6719. SemiCheckResponsibleEntity defectResponsible = new SemiCheckResponsibleEntity();
  6720. if (r["SemiCheckDefectID"].ToString() != "")
  6721. {
  6722. defectResponsible.SemiCheckDefectID = Convert.ToInt32(r["SemiCheckDefectID"]);
  6723. }
  6724. if (r["StaffID"].ToString() != "")
  6725. {
  6726. defectResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
  6727. }
  6728. defectResponsible.StaffCode = r["StaffCode"].ToString();
  6729. defectResponsible.StaffName = r["StaffName"].ToString();
  6730. if (r["StaffStatus"].ToString() != "")
  6731. {
  6732. defectResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
  6733. }
  6734. if (r["UJobsID"].ToString() != "")
  6735. {
  6736. defectResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
  6737. }
  6738. if (r["SJobsID"].ToString() != "")
  6739. {
  6740. defectResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
  6741. }
  6742. defect.DefectResponsibles.Add(defectResponsible);
  6743. }
  6744. }
  6745. //------------------------------
  6746. if (productionData.SemiCheckDefects == null)
  6747. {
  6748. productionData.SemiCheckDefects = new List<SemiCheckDefectEntity>();
  6749. }
  6750. productionData.SemiCheckDefects.Add(defect);
  6751. }
  6752. //if (productionDatas.PDAProductionData == null)
  6753. //{
  6754. // productionDatas.PDAProductionData = new System.Collections.Generic.List<PDAProductionDataResult>();
  6755. //}
  6756. productionDatas[0] = productionData;
  6757. //---------------------------------------------------------------------------------
  6758. }
  6759. }
  6760. }
  6761. actionResult.Result = JsonHelper.ToJson(productionDatas);
  6762. actionResult.Status = (int)Constant.PDAResult.Success;
  6763. }
  6764. catch (Exception ex)
  6765. {
  6766. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6767. OutputLog.TraceLog(LogPriority.Error,
  6768. this.ToString(),
  6769. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6770. ex.ToString(),
  6771. LocalPath.LogExePath);
  6772. actionResult.Status = (int)Constant.PDAResult.Exception;
  6773. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6774. }
  6775. return actionResult;
  6776. }
  6777. /// <summary>
  6778. /// 保存半检登记
  6779. /// </summary>
  6780. /// <param name="accountCode">帐套code</param>
  6781. /// <param name="userCode">用户code</param>
  6782. /// <param name="userPassword">用户密码</param>
  6783. /// <param name="sessionKey">本次登陆密钥</param>
  6784. /// <param name="entity">半检实体类</param>
  6785. /// <param name="sUserInfo">用户基本信息</param>
  6786. /// <returns></returns>
  6787. public ActionResult AddSemiCheck(string accountCode, string userCode, string userPassword, string sessionKey, SemiCheckEntity[] entityobj)
  6788. {
  6789. ActionResult actionResult = new ActionResult();
  6790. try
  6791. {
  6792. // 验证请求头信息
  6793. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6794. // 验证失败
  6795. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6796. {
  6797. return actionResult;
  6798. }
  6799. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6800. () => PMModuleLogicDAL.AddSemiCheck(entityobj, sUserInfo));
  6801. string err = string.Empty;
  6802. err = resultEntity.Message;
  6803. if (err == null)
  6804. {
  6805. err = "";
  6806. }
  6807. SemiCheckEntity entity = entityobj[0];
  6808. if (entity.SemiCheckCategory == 1) // 半检登记
  6809. {
  6810. }
  6811. else if (entity.SemiCheckCategory == 2)// 复检登记
  6812. {
  6813. err = JsonHelper.ToJson(err);
  6814. }
  6815. else if (entity.SemiCheckCategory == 3)// 撤销复检
  6816. {
  6817. err = JsonHelper.ToJson(err);
  6818. }
  6819. //actionResult.Result = JsonHelper.ToJson(err);
  6820. actionResult.Result = err;//JsonHelper.ToJson(err);
  6821. actionResult.Status = (int)Constant.PDAResult.Success;
  6822. }
  6823. catch (Exception ex)
  6824. {
  6825. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6826. OutputLog.TraceLog(LogPriority.Error,
  6827. this.ToString(),
  6828. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6829. ex.ToString(),
  6830. LocalPath.LogExePath);
  6831. actionResult.Status = (int)Constant.PDAResult.Exception;
  6832. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6833. }
  6834. return actionResult;
  6835. }
  6836. /// <summary>
  6837. /// 根据所选工号,查出缺陷责任员工
  6838. /// </summary>
  6839. /// <param name="sUserInfo"></param>
  6840. /// <returns></returns>
  6841. public ActionResult GetSemiCheckDefectStaffByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int userid)
  6842. {
  6843. ActionResult actionResult = new ActionResult();
  6844. try
  6845. {
  6846. // 验证请求头信息
  6847. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6848. // 验证失败
  6849. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6850. {
  6851. return actionResult;
  6852. }
  6853. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6854. () => PMModuleLogic.GetSemiCheckDefectStaffByUserID(sUserInfo, userid));
  6855. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6856. actionResult.Status = (int)Constant.PDAResult.Success;
  6857. }
  6858. catch (Exception ex)
  6859. {
  6860. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6861. OutputLog.TraceLog(LogPriority.Error,
  6862. this.ToString(),
  6863. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6864. ex.ToString(),
  6865. LocalPath.LogExePath);
  6866. actionResult.Status = (int)Constant.PDAResult.Exception;
  6867. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6868. }
  6869. return actionResult;
  6870. }
  6871. /// <summary>
  6872. /// 获取半成品缺陷管理的全部数据
  6873. /// </summary>
  6874. /// <param name="sUserInfo"></param>
  6875. /// <returns></returns>
  6876. public ActionResult GetAllSemicheckDefect(string accountCode, string userCode, string userPassword, string sessionKey)
  6877. {
  6878. ActionResult actionResult = new ActionResult();
  6879. try
  6880. {
  6881. // 验证请求头信息
  6882. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6883. // 验证失败
  6884. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6885. {
  6886. return actionResult;
  6887. }
  6888. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6889. () => SystemModuleLogic.GetAllSemicheckDefect(sUserInfo));
  6890. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6891. actionResult.Status = (int)Constant.PDAResult.Success;
  6892. }
  6893. catch (Exception ex)
  6894. {
  6895. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6896. OutputLog.TraceLog(LogPriority.Error,
  6897. this.ToString(),
  6898. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6899. ex.ToString(),
  6900. LocalPath.LogExePath);
  6901. actionResult.Status = (int)Constant.PDAResult.Exception;
  6902. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6903. }
  6904. return actionResult;
  6905. }
  6906. /// <summary>
  6907. /// 获取半成品缺陷位置管理的全部数据
  6908. /// </summary>
  6909. /// <param name="sUserInfo"></param>
  6910. /// <returns></returns>
  6911. public ActionResult GetAllScdefectPosition(string accountCode, string userCode, string userPassword, string sessionKey)
  6912. {
  6913. ActionResult actionResult = new ActionResult();
  6914. try
  6915. {
  6916. // 验证请求头信息
  6917. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6918. // 验证失败
  6919. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6920. {
  6921. return actionResult;
  6922. }
  6923. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6924. () => SystemModuleLogic.GetAllScdefectPosition(sUserInfo));
  6925. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6926. actionResult.Status = (int)Constant.PDAResult.Success;
  6927. }
  6928. catch (Exception ex)
  6929. {
  6930. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6931. OutputLog.TraceLog(LogPriority.Error,
  6932. this.ToString(),
  6933. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6934. ex.ToString(),
  6935. LocalPath.LogExePath);
  6936. actionResult.Status = (int)Constant.PDAResult.Exception;
  6937. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6938. }
  6939. return actionResult;
  6940. }
  6941. /// <summary>
  6942. /// 复检验条码
  6943. /// </summary>
  6944. /// <param name="sUserInfo"></param>
  6945. /// <returns></returns>
  6946. public ActionResult ReSemiCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6947. {
  6948. ActionResult actionResult = new ActionResult();
  6949. try
  6950. {
  6951. // 验证请求头信息
  6952. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6953. // 验证失败
  6954. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6955. {
  6956. return actionResult;
  6957. }
  6958. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6959. () => PMModuleLogic.ReSemiCheckBarcode(barcode, sUserInfo));
  6960. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6961. if (Convert.ToInt32(resultEntity.Result) < 0)
  6962. {
  6963. actionResult.Status = (int)Constant.PDAResult.Fail;
  6964. }
  6965. else
  6966. {
  6967. actionResult.Status = (int)Constant.PDAResult.Success;
  6968. }
  6969. actionResult.Message = resultEntity.Message;
  6970. }
  6971. catch (Exception ex)
  6972. {
  6973. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6974. OutputLog.TraceLog(LogPriority.Error,
  6975. this.ToString(),
  6976. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6977. ex.ToString(),
  6978. LocalPath.LogExePath);
  6979. actionResult.Status = (int)Constant.PDAResult.Exception;
  6980. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6981. }
  6982. return actionResult;
  6983. }
  6984. /// <summary>
  6985. /// 撤销复检验条码
  6986. /// </summary>
  6987. /// <param name="sUserInfo"></param>
  6988. /// <returns></returns>
  6989. public ActionResult CancelSemiCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6990. {
  6991. ActionResult actionResult = new ActionResult();
  6992. try
  6993. {
  6994. // 验证请求头信息
  6995. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6996. // 验证失败
  6997. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6998. {
  6999. return actionResult;
  7000. }
  7001. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7002. () => PMModuleLogic.CancelSemiCheckBarcode(barcode, sUserInfo));
  7003. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7004. if (Convert.ToInt32(resultEntity.Result) < 0)
  7005. {
  7006. actionResult.Status = (int)Constant.PDAResult.Fail;
  7007. }
  7008. else
  7009. {
  7010. actionResult.Status = (int)Constant.PDAResult.Success;
  7011. }
  7012. actionResult.Message = resultEntity.Message;
  7013. }
  7014. catch (Exception ex)
  7015. {
  7016. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7017. OutputLog.TraceLog(LogPriority.Error,
  7018. this.ToString(),
  7019. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7020. ex.ToString(),
  7021. LocalPath.LogExePath);
  7022. actionResult.Status = (int)Constant.PDAResult.Exception;
  7023. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7024. }
  7025. return actionResult;
  7026. }
  7027. /// <summary>
  7028. /// 恢复数据
  7029. /// </summary>
  7030. /// <param name="sUserInfo"></param>
  7031. /// <returns></returns>
  7032. public ActionResult ResetBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7033. {
  7034. ActionResult actionResult = new ActionResult();
  7035. try
  7036. {
  7037. // 验证请求头信息
  7038. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7039. // 验证失败
  7040. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7041. {
  7042. return actionResult;
  7043. }
  7044. int resultEntity = ServiceInvoker.Invoke<int>(this,
  7045. () => PMModuleLogicDAL.ResetBarCode(barcode));
  7046. if (resultEntity > 0)
  7047. {
  7048. actionResult.Status = (int)Constant.PDAResult.Success;
  7049. actionResult.Message = "恢复数据成功";
  7050. }
  7051. else
  7052. {
  7053. actionResult.Status = (int)Constant.PDAResult.Fail;
  7054. if (resultEntity == -1)
  7055. {
  7056. actionResult.Message = "此条码没有清除,不能恢复";
  7057. }
  7058. else if (resultEntity == 0)
  7059. {
  7060. actionResult.Message = "没有可恢复的数据";
  7061. }
  7062. }
  7063. }
  7064. catch (Exception ex)
  7065. {
  7066. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7067. OutputLog.TraceLog(LogPriority.Error,
  7068. this.ToString(),
  7069. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7070. ex.ToString(),
  7071. LocalPath.LogExePath);
  7072. actionResult.Status = (int)Constant.PDAResult.Exception;
  7073. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7074. }
  7075. return actionResult;
  7076. }
  7077. /// <summary>
  7078. /// 通过SettingCode获取系统参数管理的数据
  7079. /// </summary>
  7080. /// <param name="accountCode"></param>
  7081. /// <param name="userCode"></param>
  7082. /// <param name="userPassword"></param>
  7083. /// <param name="sessionKey"></param>
  7084. /// <param name="settingcode">设置编码</param>
  7085. /// <returns></returns>
  7086. public ActionResult GetSystemSettingDataByCode(string accountCode, string userCode, string userPassword, string sessionKey, string settingcode)
  7087. {
  7088. ActionResult actionResult = new ActionResult();
  7089. try
  7090. {
  7091. // 验证请求头信息
  7092. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7093. // 验证失败
  7094. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7095. {
  7096. return actionResult;
  7097. }
  7098. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  7099. () => SystemModuleLogic.GetSystemSettingDataByCode(settingcode, sUserInfo));
  7100. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7101. actionResult.Status = (int)Constant.PDAResult.Success;
  7102. }
  7103. catch (Exception ex)
  7104. {
  7105. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7106. OutputLog.TraceLog(LogPriority.Error,
  7107. this.ToString(),
  7108. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7109. ex.ToString(),
  7110. LocalPath.LogExePath);
  7111. actionResult.Status = (int)Constant.PDAResult.Exception;
  7112. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7113. }
  7114. return actionResult;
  7115. }
  7116. /// <summary>
  7117. /// 校验条码是否允许撤销,如果不允许提示错误消息
  7118. /// </summary>
  7119. /// <param name="accountCode"></param>
  7120. /// <param name="userCode"></param>
  7121. /// <param name="userPassword"></param>
  7122. /// <param name="sessionKey"></param>
  7123. /// <param name="orgTime">原时间</param>
  7124. /// <param name="days">允许撤销天数</param>
  7125. /// <param name="settingCode">设置code,用于返回不同错误消息</param>
  7126. /// <returns></returns>
  7127. public ActionResult BarcodeAllowCancel(string accountCode, string userCode, string userPassword, string sessionKey, string orgTime, int days, string settingCode)
  7128. {
  7129. ActionResult actionResult = new ActionResult();
  7130. try
  7131. {
  7132. // 验证请求头信息
  7133. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7134. // 验证失败
  7135. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7136. {
  7137. return actionResult;
  7138. }
  7139. string[] subOrgTime = orgTime.Split('-');
  7140. DateTime newOrgTime = new DateTime(Convert.ToInt32(subOrgTime[0]), Convert.ToInt32(subOrgTime[1]), Convert.ToInt32(subOrgTime[2]));
  7141. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7142. () => PMModuleLogic.BarcodeAllowCancel(newOrgTime, days, settingCode, sUserInfo));
  7143. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7144. if (Convert.ToInt32(resultEntity.Result) < 0)
  7145. {
  7146. actionResult.Status = (int)Constant.PDAResult.Fail;
  7147. }
  7148. else
  7149. {
  7150. actionResult.Status = (int)Constant.PDAResult.Success;
  7151. }
  7152. actionResult.Message = resultEntity.Message;
  7153. }
  7154. catch (Exception ex)
  7155. {
  7156. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7157. OutputLog.TraceLog(LogPriority.Error,
  7158. this.ToString(),
  7159. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7160. ex.ToString(),
  7161. LocalPath.LogExePath);
  7162. actionResult.Status = (int)Constant.PDAResult.Exception;
  7163. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7164. }
  7165. return actionResult;
  7166. }
  7167. /// <summary>
  7168. /// 获取生产订单管理的全部数据
  7169. /// </summary>
  7170. /// <param name="sUserInfo"></param>
  7171. /// <returns></returns>
  7172. public ActionResult GetOrderList(string accountCode, string userCode, string userPassword, string sessionKey, OrderEntity order)
  7173. {
  7174. ActionResult actionResult = new ActionResult();
  7175. try
  7176. {
  7177. // 验证请求头信息
  7178. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7179. // 验证失败
  7180. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7181. {
  7182. return actionResult;
  7183. }
  7184. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  7185. () => PMModuleLogic.GetOrderList(order, sUserInfo));
  7186. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7187. actionResult.Status = (int)Constant.PDAResult.Success;
  7188. }
  7189. catch (Exception ex)
  7190. {
  7191. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7192. OutputLog.TraceLog(LogPriority.Error,
  7193. this.ToString(),
  7194. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7195. ex.ToString(),
  7196. LocalPath.LogExePath);
  7197. actionResult.Status = (int)Constant.PDAResult.Exception;
  7198. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7199. }
  7200. return actionResult;
  7201. }
  7202. public ActionResult FinishedHandoverBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7203. {
  7204. ActionResult actionResult = new ActionResult();
  7205. try
  7206. {
  7207. // 验证请求头信息
  7208. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7209. // 验证失败
  7210. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7211. {
  7212. return actionResult;
  7213. }
  7214. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7215. () => PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo));
  7216. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7217. if (Convert.ToInt32(resultEntity.Result) < 0)
  7218. {
  7219. actionResult.Status = (int)Constant.PDAResult.Fail;
  7220. actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
  7221. }
  7222. else
  7223. {
  7224. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  7225. actionResult.Status = (int)Constant.PDAResult.Success;
  7226. }
  7227. actionResult.Message = resultEntity.Message;
  7228. }
  7229. catch (Exception ex)
  7230. {
  7231. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7232. OutputLog.TraceLog(LogPriority.Error,
  7233. this.ToString(),
  7234. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7235. ex.ToString(),
  7236. LocalPath.LogExePath);
  7237. actionResult.Status = (int)Constant.PDAResult.Exception;
  7238. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7239. }
  7240. return actionResult;
  7241. }
  7242. public ActionResult GetSystemData(string accountCode, string userCode, string userPassword, string sessionKey)
  7243. {
  7244. ActionResult actionResult = new ActionResult();
  7245. try
  7246. {
  7247. // 验证请求头信息
  7248. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7249. // 验证失败
  7250. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7251. {
  7252. return actionResult;
  7253. }
  7254. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  7255. () => SystemModuleLogic.GetSystemData(sUserInfo));
  7256. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7257. actionResult.Status = (int)Constant.PDAResult.Success;
  7258. }
  7259. catch (Exception ex)
  7260. {
  7261. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7262. OutputLog.TraceLog(LogPriority.Error,
  7263. this.ToString(),
  7264. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7265. ex.ToString(),
  7266. LocalPath.LogExePath);
  7267. actionResult.Status = (int)Constant.PDAResult.Exception;
  7268. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7269. }
  7270. return actionResult;
  7271. }
  7272. public ActionResult SaveFinishedHandover(string accountCode, string userCode, string userPassword, string sessionKey, int orderid, OrderEntity[] orderEntity)
  7273. {
  7274. ActionResult actionResult = new ActionResult();
  7275. try
  7276. {
  7277. // 验证请求头信息
  7278. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7279. // 验证失败
  7280. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7281. {
  7282. return actionResult;
  7283. }
  7284. DataTable dtOrderData = DataConvert.ObjectConvertToTable<OrderEntity>(orderEntity);
  7285. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7286. () => PMModuleLogicDAL.SaveFinishedHandover(orderid, dtOrderData, sUserInfo));
  7287. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7288. if (Convert.ToInt32(resultEntity.Result) < 0)
  7289. {
  7290. actionResult.Status = (int)Constant.PDAResult.Fail;
  7291. }
  7292. else
  7293. {
  7294. actionResult.Status = (int)Constant.PDAResult.Success;
  7295. }
  7296. actionResult.Message = resultEntity.Message;
  7297. }
  7298. catch (Exception ex)
  7299. {
  7300. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7301. OutputLog.TraceLog(LogPriority.Error,
  7302. this.ToString(),
  7303. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7304. ex.ToString(),
  7305. LocalPath.LogExePath);
  7306. actionResult.Status = (int)Constant.PDAResult.Exception;
  7307. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7308. }
  7309. return actionResult;
  7310. }
  7311. public ActionResult CancelFinishedHandoverBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7312. {
  7313. ActionResult actionResult = new ActionResult();
  7314. try
  7315. {
  7316. // 验证请求头信息
  7317. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7318. // 验证失败
  7319. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7320. {
  7321. return actionResult;
  7322. }
  7323. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7324. () => PMModuleLogic.CancelFinishedHandoverBarcode(barcode, sUserInfo));
  7325. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7326. if (Convert.ToInt32(resultEntity.Result) < 0)
  7327. {
  7328. actionResult.Status = (int)Constant.PDAResult.Fail;
  7329. }
  7330. else
  7331. {
  7332. actionResult.Result = JsonHelper.ToJson(resultEntity.Data.Tables[0]);
  7333. actionResult.Status = (int)Constant.PDAResult.Success;
  7334. }
  7335. actionResult.Message = resultEntity.Message;
  7336. }
  7337. catch (Exception ex)
  7338. {
  7339. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7340. OutputLog.TraceLog(LogPriority.Error,
  7341. this.ToString(),
  7342. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7343. ex.ToString(),
  7344. LocalPath.LogExePath);
  7345. actionResult.Status = (int)Constant.PDAResult.Exception;
  7346. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7347. }
  7348. return actionResult;
  7349. }
  7350. public ActionResult SaveCancelFinishedHandoverByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7351. {
  7352. ActionResult actionResult = new ActionResult();
  7353. try
  7354. {
  7355. // 验证请求头信息
  7356. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7357. // 验证失败
  7358. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7359. {
  7360. return actionResult;
  7361. }
  7362. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7363. () => PMModuleLogicDAL.SaveCancelFinishedHandoverByBarcode(barcode, sUserInfo));
  7364. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7365. if (Convert.ToInt32(resultEntity.Result) < 0)
  7366. {
  7367. actionResult.Status = (int)Constant.PDAResult.Fail;
  7368. }
  7369. else
  7370. {
  7371. actionResult.Status = (int)Constant.PDAResult.Success;
  7372. }
  7373. actionResult.Message = resultEntity.Message;
  7374. }
  7375. catch (Exception ex)
  7376. {
  7377. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7378. OutputLog.TraceLog(LogPriority.Error,
  7379. this.ToString(),
  7380. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7381. ex.ToString(),
  7382. LocalPath.LogExePath);
  7383. actionResult.Status = (int)Constant.PDAResult.Exception;
  7384. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7385. }
  7386. return actionResult;
  7387. }
  7388. public ActionResult SaveChangeFinishedHandoverByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int orderid)
  7389. {
  7390. ActionResult actionResult = new ActionResult();
  7391. try
  7392. {
  7393. // 验证请求头信息
  7394. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7395. // 验证失败
  7396. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7397. {
  7398. return actionResult;
  7399. }
  7400. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7401. () => PMModuleLogicDAL.SaveChangeFinishedHandoverByBarcode(barcode, orderid, sUserInfo));
  7402. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7403. if (Convert.ToInt32(resultEntity.Result) < 0)
  7404. {
  7405. actionResult.Status = (int)Constant.PDAResult.Fail;
  7406. }
  7407. else
  7408. {
  7409. actionResult.Status = (int)Constant.PDAResult.Success;
  7410. }
  7411. actionResult.Message = resultEntity.Message;
  7412. }
  7413. catch (Exception ex)
  7414. {
  7415. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7416. OutputLog.TraceLog(LogPriority.Error,
  7417. this.ToString(),
  7418. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7419. ex.ToString(),
  7420. LocalPath.LogExePath);
  7421. actionResult.Status = (int)Constant.PDAResult.Exception;
  7422. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7423. }
  7424. return actionResult;
  7425. }
  7426. #region PDA条码打印
  7427. /// <summary>
  7428. /// 获取条码打印机
  7429. /// </summary>
  7430. /// <param name="accountCode"></param>
  7431. /// <param name="userCode"></param>
  7432. /// <param name="userPassword"></param>
  7433. /// <param name="sessionKey"></param>
  7434. /// <returns></returns>
  7435. public ActionResult GetBarcodePrinter(string accountCode, string userCode, string userPassword, string sessionKey, int printType=0)
  7436. {
  7437. ActionResult actionResult = new ActionResult();
  7438. try
  7439. {
  7440. // 验证请求头信息
  7441. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7442. // 验证失败
  7443. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7444. {
  7445. return actionResult;
  7446. }
  7447. DataSet resultEntity = BarcodePrintLogic.GetBarcodePrinter(sUserInfo, printType);
  7448. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7449. actionResult.Status = (int)Constant.PDAResult.Success;
  7450. }
  7451. catch (Exception ex)
  7452. {
  7453. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7454. OutputLog.TraceLog(LogPriority.Error,
  7455. this.ToString(),
  7456. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7457. ex.ToString(),
  7458. LocalPath.LogExePath);
  7459. actionResult.Status = (int)Constant.PDAResult.Exception;
  7460. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7461. }
  7462. return actionResult;
  7463. }
  7464. /// <summary>
  7465. /// 打印条码样式(补打)
  7466. /// </summary>
  7467. /// <param name="accountCode"></param>
  7468. /// <param name="userCode"></param>
  7469. /// <param name="userPassword"></param>
  7470. /// <param name="sessionKey"></param>
  7471. /// <returns></returns>
  7472. public ActionResult PrintBarcodeLayout(string accountCode, string userCode, string userPassword, string sessionKey,
  7473. string barcode, int copies, int printerID, int printWay=2)
  7474. {
  7475. ActionResult actionResult = new ActionResult();
  7476. try
  7477. {
  7478. // 验证请求头信息
  7479. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7480. // 验证失败
  7481. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7482. {
  7483. return actionResult;
  7484. }
  7485. if (printWay == 0)
  7486. {
  7487. printWay = 2;
  7488. }
  7489. //ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode(barcode,
  7490. // copies, printerID, sUserInfo);
  7491. long ddd = DateTime.Now.Ticks;
  7492. OutputLog.TraceLog(LogPriority.Information,
  7493. this.ToString(),
  7494. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7495. string.Format("PDA打印补打开始{0}:barcode {1}, userCode {2}, printWay {3}, copies {4} ProcedureID {5}",
  7496. ddd,
  7497. barcode,
  7498. userCode,
  7499. 0,
  7500. copies,
  7501. printerID),
  7502. LocalPath.LogExePath + "PrintBarcode\\");
  7503. ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode_3C(barcode,
  7504. copies, printerID, sUserInfo, printWay);
  7505. OutputLog.TraceLog(LogPriority.Information,
  7506. this.ToString(),
  7507. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7508. string.Format("PDA打印补打结束{0}:Status {1}", ddd, sre.Status),
  7509. LocalPath.LogExePath + "PrintBarcode\\");
  7510. if (sre.Status != Constant.ServiceResultStatus.Success)
  7511. {
  7512. actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  7513. actionResult.Message = sre.Message;
  7514. return actionResult;
  7515. }
  7516. actionResult.Result = JsonHelper.ToJson(sre.Result as DataTable);
  7517. actionResult.Status = (int)Constant.PDAResult.Success;
  7518. }
  7519. catch (Exception ex)
  7520. {
  7521. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7522. OutputLog.TraceLog(LogPriority.Error,
  7523. this.ToString(),
  7524. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7525. ex.ToString(),
  7526. LocalPath.LogExePath);
  7527. actionResult.Status = (int)Constant.PDAResult.Exception;
  7528. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7529. }
  7530. return actionResult;
  7531. }
  7532. #endregion PDA条码打印
  7533. #region 统计报表
  7534. /// <summary>
  7535. /// 成型结算报表
  7536. /// </summary>
  7537. /// <param name="accountCode"></param>
  7538. /// <param name="userCode"></param>
  7539. /// <param name="userPassword"></param>
  7540. /// <param name="sessionKey"></param>
  7541. /// <returns></returns>
  7542. public ActionResult GetGroutingSettlementInfo(string accountCode, string userCode, string userPassword, string sessionKey,
  7543. int currentMonth)
  7544. {
  7545. ActionResult actionResult = new ActionResult();
  7546. try
  7547. {
  7548. // 验证请求头信息
  7549. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7550. // 验证失败
  7551. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7552. {
  7553. return actionResult;
  7554. }
  7555. DateTime date = DateTime.Now;
  7556. if (currentMonth != 1)
  7557. {
  7558. date = date.AddMonths(-1);
  7559. }
  7560. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7561. () => PublicModuleLogic.GetFP00002Data(sUserInfo.AccountID, userCode, date));
  7562. if (resultEntity == null || resultEntity.Data == null)
  7563. {
  7564. actionResult.Status = (int)Constant.PDAResult.Fail;
  7565. actionResult.Message = "查询失败";
  7566. return actionResult;
  7567. }
  7568. if (resultEntity.Status == Constant.ServiceResultStatus.Other)
  7569. {
  7570. actionResult.Status = (int)Constant.PDAResult.Fail;
  7571. actionResult.Message = resultEntity.Message;
  7572. return actionResult;
  7573. }
  7574. actionResult.Result = JsonHelper.ToJson(resultEntity.Data.Tables["DataM"]);
  7575. actionResult.Status = (int)Constant.PDAResult.Success;
  7576. }
  7577. catch (Exception ex)
  7578. {
  7579. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7580. OutputLog.TraceLog(LogPriority.Error,
  7581. this.ToString(),
  7582. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7583. ex.ToString(),
  7584. LocalPath.LogExePath);
  7585. actionResult.Status = (int)Constant.PDAResult.Exception;
  7586. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7587. }
  7588. return actionResult;
  7589. }
  7590. #endregion
  7591. #region 设置当期用户默认打印机配置
  7592. /// <summary>
  7593. /// 设置当期用户默认打印机配置
  7594. /// </summary>
  7595. /// <param name="accountCode"></param>
  7596. /// <param name="userCode"></param>
  7597. /// <param name="userPassword"></param>
  7598. /// <param name="sessionKey"></param>
  7599. /// <param name="printerID"></param>
  7600. /// <returns></returns>
  7601. public ActionResult SetCurrentUserPrinter(string accountCode, string userCode, string userPassword, string sessionKey,
  7602. int printerID)
  7603. {
  7604. ActionResult actionResult = new ActionResult();
  7605. try
  7606. {
  7607. // 验证请求头信息
  7608. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7609. // 验证失败
  7610. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7611. {
  7612. return actionResult;
  7613. }
  7614. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7615. () => BarcodePrintLogic.SetCurrentUserPrinter(printerID, sUserInfo));
  7616. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7617. if (resultEntity.Status == Constant.ServiceResultStatus.Other || Convert.ToInt32(resultEntity.Result) < 0)
  7618. {
  7619. actionResult.Status = (int)Constant.PDAResult.Fail;
  7620. }
  7621. else
  7622. {
  7623. actionResult.Status = (int)Constant.PDAResult.Success;
  7624. }
  7625. actionResult.Message = resultEntity.Message;
  7626. }
  7627. catch (Exception ex)
  7628. {
  7629. OutputLog.TraceLog(LogPriority.Error,
  7630. this.ToString(),
  7631. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7632. ex.ToString(),
  7633. LocalPath.LogExePath);
  7634. actionResult.Status = (int)Constant.PDAResult.Exception;
  7635. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7636. }
  7637. return actionResult;
  7638. }
  7639. /// <summary>
  7640. /// 校验产品条码是否可以进行回收
  7641. /// </summary>
  7642. /// <param name="accountCode">帐套code</param>
  7643. /// <param name="userCode">用户code</param>
  7644. /// <param name="userPassword">用户密码</param>
  7645. /// <param name="sessionKey">本次登陆密钥</param>
  7646. /// <param name="procedureID">工序ID</param>
  7647. /// <param name="barcode">条码</param>
  7648. /// <returns></returns>
  7649. /// <remarks>
  7650. /// 王鑫 2017.7.21 新建
  7651. /// </remarks>
  7652. public ActionResult CheckRecydingFlagBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  7653. {
  7654. ActionResult actionResult = new ActionResult();
  7655. try
  7656. {
  7657. // 验证请求头信息
  7658. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7659. // 验证失败
  7660. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7661. {
  7662. return actionResult;
  7663. }
  7664. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  7665. () => PMModuleLogic.CheckRecydingFlagBarcode(procedureID, barcode, sUserInfo));
  7666. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  7667. {
  7668. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  7669. actionResult.Status = (int)Constant.PDAResult.Success;
  7670. }
  7671. else
  7672. {
  7673. actionResult.Status = (int)Constant.PDAResult.Fail;
  7674. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  7675. }
  7676. }
  7677. catch (Exception ex)
  7678. {
  7679. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7680. OutputLog.TraceLog(LogPriority.Error,
  7681. this.ToString(),
  7682. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7683. ex.ToString(),
  7684. LocalPath.LogExePath);
  7685. actionResult.Status = (int)Constant.PDAResult.Exception;
  7686. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7687. }
  7688. return actionResult;
  7689. }
  7690. /// <summary>
  7691. /// 获取回收标识
  7692. /// </summary>
  7693. /// <param name="accountCode"></param>
  7694. /// <param name="userCode"></param>
  7695. /// <param name="userPassword"></param>
  7696. /// <param name="sessionKey"></param>
  7697. /// <param name="usercode">工号编码</param>
  7698. /// <returns></returns>
  7699. public ActionResult GetRecyclingflagByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7700. {
  7701. ActionResult actionResult = new ActionResult();
  7702. try
  7703. {
  7704. // 验证请求头信息
  7705. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7706. // 验证失败
  7707. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7708. {
  7709. return actionResult;
  7710. }
  7711. int returnValue = ServiceInvoker.Invoke<int>(this,
  7712. () => PMModuleLogic.GetRecyclingflagByBarcode(barcode, sUserInfo));
  7713. actionResult.Result = JsonHelper.ToJson(returnValue);
  7714. actionResult.Status = (int)Constant.PDAResult.Success;
  7715. }
  7716. catch (Exception ex)
  7717. {
  7718. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7719. OutputLog.TraceLog(LogPriority.Error,
  7720. this.ToString(),
  7721. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7722. ex.ToString(),
  7723. LocalPath.LogExePath);
  7724. actionResult.Status = (int)Constant.PDAResult.Exception;
  7725. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7726. }
  7727. return actionResult;
  7728. }
  7729. #endregion
  7730. #region 注浆盘点
  7731. /// <summary>
  7732. /// 获取注浆盘点单列表
  7733. /// </summary>
  7734. /// <param name="sUserInfo"></param>
  7735. /// <returns></returns>
  7736. public ActionResult GetAllGBChecked(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity)
  7737. {
  7738. ActionResult actionResult = new ActionResult();
  7739. try
  7740. {
  7741. // 验证请求头信息
  7742. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7743. // 验证失败
  7744. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7745. {
  7746. return actionResult;
  7747. }
  7748. entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA);
  7749. entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1);
  7750. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  7751. () => PDAModuleLogic.GetAllGBChecked(entity, sUserInfo));
  7752. actionResult.Result = JsonHelper.ToJson(ds);
  7753. actionResult.Status = (int)Constant.PDAResult.Success;
  7754. }
  7755. catch (Exception ex)
  7756. {
  7757. string json = JsonHelper.ToJson(entity);
  7758. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7759. OutputLog.TraceLog(LogPriority.Error,
  7760. this.ToString(),
  7761. System.Reflection.MethodBase.GetCurrentMethod().Name + "\r\n" + json,
  7762. ex.ToString(),
  7763. LocalPath.LogExePath);
  7764. actionResult.Status = (int)Constant.PDAResult.Exception;
  7765. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7766. }
  7767. return actionResult;
  7768. }
  7769. /// <summary>
  7770. /// 进行盘点操作
  7771. /// </summary>
  7772. /// <param name="accountCode"></param>
  7773. /// <param name="userCode"></param>
  7774. /// <param name="userPassword"></param>
  7775. /// <param name="sessionKey"></param>
  7776. /// <param name="InCheckedID">盘点单ID</param>
  7777. /// <param name="BarCode">产品条码</param>
  7778. /// <returns></returns>
  7779. public ActionResult UpdateGBChecked(string accountCode, string userCode, string userPassword, string sessionKey, int CheckedID, string BarCode)
  7780. {
  7781. ActionResult actionResult = new ActionResult();
  7782. try
  7783. {
  7784. // 验证请求头信息
  7785. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7786. // 验证失败
  7787. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7788. {
  7789. return actionResult;
  7790. }
  7791. ClientRequestEntity cre = new ClientRequestEntity();
  7792. cre.Properties["CheckedID"] = CheckedID;
  7793. cre.Properties["Barcode"] = BarCode;
  7794. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7795. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.UpdateGBChecked(sUserInfo, cre));
  7796. if (returnValue.Status == Constant.ServiceResultStatus.Success)
  7797. {
  7798. //actionResult.Result = JsonHelper.ToJson(returnValue);
  7799. actionResult.Status = (int)Constant.PDAResult.Success;
  7800. actionResult.Message = "产品【" + BarCode + "】盘点成功";
  7801. }
  7802. else
  7803. {
  7804. //actionResult.Result = JsonHelper.ToJson(returnValue);
  7805. actionResult.Status = (int)Constant.PDAResult.Fail;
  7806. actionResult.Message = returnValue.Message;
  7807. }
  7808. }
  7809. catch (Exception ex)
  7810. {
  7811. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7812. OutputLog.TraceLog(LogPriority.Error,
  7813. this.ToString(),
  7814. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7815. ex.ToString(),
  7816. LocalPath.LogExePath);
  7817. actionResult.Status = (int)Constant.PDAResult.Exception;
  7818. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7819. }
  7820. return actionResult;
  7821. }
  7822. /// <summary>
  7823. /// 获取盘点单明细
  7824. /// </summary>
  7825. /// <param name="sUserInfo"></param>
  7826. /// <returns></returns>
  7827. public ActionResult GetUpdateGBCheckedInfo(string accountCode, string userCode, string userPassword, string sessionKey, int checkedID)
  7828. {
  7829. ActionResult actionResult = new ActionResult();
  7830. try
  7831. {
  7832. // 验证请求头信息
  7833. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7834. // 验证失败
  7835. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7836. {
  7837. return actionResult;
  7838. }
  7839. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  7840. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.
  7841. GetUpdateGBCheckedInfo(checkedID, sUserInfo));
  7842. actionResult.Result = JsonHelper.ToJson(ds);
  7843. actionResult.Status = (int)Constant.PDAResult.Success;
  7844. }
  7845. catch (Exception ex)
  7846. {
  7847. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7848. OutputLog.TraceLog(LogPriority.Error,
  7849. this.ToString(),
  7850. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7851. ex.ToString(),
  7852. LocalPath.LogExePath);
  7853. actionResult.Status = (int)Constant.PDAResult.Exception;
  7854. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7855. }
  7856. return actionResult;
  7857. }
  7858. #endregion
  7859. #region 模具盘点
  7860. /// <summary>
  7861. /// 获取模具盘点单列表
  7862. /// </summary>
  7863. /// <param name="sUserInfo"></param>
  7864. /// <returns></returns>
  7865. public ActionResult GetAllMouldChecked(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity)
  7866. {
  7867. ActionResult actionResult = new ActionResult();
  7868. try
  7869. {
  7870. // 验证请求头信息
  7871. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7872. // 验证失败
  7873. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7874. {
  7875. return actionResult;
  7876. }
  7877. entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA);
  7878. entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1);
  7879. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  7880. () => PDAModuleLogic.GetAllMouldChecked(entity, sUserInfo));
  7881. actionResult.Result = JsonHelper.ToJson(ds);
  7882. actionResult.Status = (int)Constant.PDAResult.Success;
  7883. }
  7884. catch (Exception ex)
  7885. {
  7886. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7887. OutputLog.TraceLog(LogPriority.Error,
  7888. this.ToString(),
  7889. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7890. ex.ToString(),
  7891. LocalPath.LogExePath);
  7892. actionResult.Status = (int)Constant.PDAResult.Exception;
  7893. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7894. }
  7895. return actionResult;
  7896. }
  7897. /// <summary>
  7898. /// 进行盘点操作
  7899. /// </summary>
  7900. /// <param name="accountCode"></param>
  7901. /// <param name="userCode"></param>
  7902. /// <param name="userPassword"></param>
  7903. /// <param name="sessionKey"></param>
  7904. /// <param name="InCheckedID">盘点单ID</param>
  7905. /// <param name="BarCode">产品条码</param>
  7906. /// <returns></returns>
  7907. public ActionResult UpdateMouldChecked(string accountCode, string userCode, string userPassword, string sessionKey, int CheckedID, string BarCode)
  7908. {
  7909. ActionResult actionResult = new ActionResult();
  7910. try
  7911. {
  7912. // 验证请求头信息
  7913. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7914. // 验证失败
  7915. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7916. {
  7917. return actionResult;
  7918. }
  7919. ClientRequestEntity cre = new ClientRequestEntity();
  7920. cre.Properties["CheckedID"] = CheckedID;
  7921. cre.Properties["Barcode"] = BarCode;
  7922. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7923. () => Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.UpdateMouldChecked(sUserInfo, cre));
  7924. if (returnValue.Status == Constant.ServiceResultStatus.Success)
  7925. {
  7926. //actionResult.Result = JsonHelper.ToJson(returnValue);
  7927. actionResult.Status = (int)Constant.PDAResult.Success;
  7928. actionResult.Message = "产品【" + BarCode + "】盘点成功";
  7929. }
  7930. else
  7931. {
  7932. //actionResult.Result = JsonHelper.ToJson(returnValue);
  7933. actionResult.Status = (int)Constant.PDAResult.Fail;
  7934. actionResult.Message = returnValue.Message;
  7935. }
  7936. }
  7937. catch (Exception ex)
  7938. {
  7939. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7940. OutputLog.TraceLog(LogPriority.Error,
  7941. this.ToString(),
  7942. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7943. ex.ToString(),
  7944. LocalPath.LogExePath);
  7945. actionResult.Status = (int)Constant.PDAResult.Exception;
  7946. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7947. }
  7948. return actionResult;
  7949. }
  7950. /// <summary>
  7951. /// 获取盘点单明细
  7952. /// </summary>
  7953. /// <param name="sUserInfo"></param>
  7954. /// <returns></returns>
  7955. public ActionResult GetUpdateMouldCheckedInfo(string accountCode, string userCode, string userPassword, string sessionKey, int checkedID)
  7956. {
  7957. ActionResult actionResult = new ActionResult();
  7958. try
  7959. {
  7960. // 验证请求头信息
  7961. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7962. // 验证失败
  7963. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7964. {
  7965. return actionResult;
  7966. }
  7967. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  7968. () => Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.
  7969. GetUpdateMouldCheckedInfo(checkedID, sUserInfo));
  7970. actionResult.Result = JsonHelper.ToJson(ds);
  7971. actionResult.Status = (int)Constant.PDAResult.Success;
  7972. }
  7973. catch (Exception ex)
  7974. {
  7975. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7976. OutputLog.TraceLog(LogPriority.Error,
  7977. this.ToString(),
  7978. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7979. ex.ToString(),
  7980. LocalPath.LogExePath);
  7981. actionResult.Status = (int)Constant.PDAResult.Exception;
  7982. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7983. }
  7984. return actionResult;
  7985. }
  7986. #endregion
  7987. #region 通用接口
  7988. /// <summary>
  7989. /// PDA调用通用接口
  7990. /// </summary>
  7991. /// <param name="accountCode"></param>
  7992. /// <param name="userCode"></param>
  7993. /// <param name="userPassword"></param>
  7994. /// <param name="sessionKey"></param>
  7995. /// <param name="module"></param>
  7996. /// <param name="action"></param>
  7997. /// <param name="data"></param>
  7998. /// <returns></returns>
  7999. public ActionResult DoAction(string accountCode, string userCode, string userPassword, string sessionKey,
  8000. string module, string action, string jsonData)
  8001. {
  8002. ActionResult actionResult = null;
  8003. try
  8004. {
  8005. // 验证请求头信息
  8006. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  8007. // 验证失败
  8008. if (actionResult.Status != (int)Constant.PDAResult.Success)
  8009. {
  8010. return actionResult;
  8011. }
  8012. actionResult.Status = (int)Constant.PDAResult.Fail;
  8013. Dictionary<string, object> data = null;
  8014. if (!string.IsNullOrEmpty(jsonData) && jsonData[0] == '{')
  8015. {
  8016. data = JsonHelper.FromJson<Dictionary<string, object>>(jsonData);
  8017. }
  8018. #region PDA报表
  8019. if (module == "Report")
  8020. {
  8021. // 成型月度结算
  8022. if (action == "GetGroutingSettlementInfo")
  8023. {
  8024. DateTime month = DateTime.Now;
  8025. month = new DateTime(month.Year, month.Month, 1);
  8026. //month = new DateTime(2017, 6, 1);
  8027. int currentMonth = Convert.ToInt32(data["CurrentMonth"]);
  8028. if (currentMonth != 1)
  8029. {
  8030. month = month.AddMonths(-1);
  8031. }
  8032. ServiceResultEntity sre = PDAModuleLogic.GetGroutingSettlementInfo(sUserInfo, month);
  8033. if (sre.Status == Constant.ServiceResultStatus.Success)
  8034. {
  8035. actionResult.Status = (int)Constant.PDAResult.Success;
  8036. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8037. }
  8038. else
  8039. {
  8040. actionResult.Status = (int)Constant.PDAResult.Fail;
  8041. actionResult.Message = sre.Message;
  8042. }
  8043. return actionResult;
  8044. }
  8045. // 成型月度结算-明细
  8046. if (action == "GetGroutingSettlementDetail")
  8047. {
  8048. DateTime month = DateTime.Now;
  8049. month = new DateTime(month.Year, month.Month, 1);
  8050. //month = new DateTime(2017, 6, 1);
  8051. int currentMonth = Convert.ToInt32(data["CurrentMonth"]);
  8052. if (currentMonth != 1)
  8053. {
  8054. month = month.AddMonths(-1);
  8055. }
  8056. string goodsCode = data["GoodsCode"].ToString();
  8057. string detailDate = data["DetailDate"].ToString();
  8058. DateTime? date = null;
  8059. if (detailDate != "合计")
  8060. {
  8061. date = DateTime.Parse(detailDate);
  8062. }
  8063. ServiceResultEntity sre = PDAModuleLogic.GetGroutingSettlementDetail(sUserInfo, month, goodsCode, date);
  8064. if (sre.Status == Constant.ServiceResultStatus.Success)
  8065. {
  8066. actionResult.Status = (int)Constant.PDAResult.Success;
  8067. actionResult.Result = JsonHelper.ToJson(sre.Data);
  8068. }
  8069. else
  8070. {
  8071. actionResult.Status = (int)Constant.PDAResult.Fail;
  8072. actionResult.Message = sre.Message;
  8073. }
  8074. return actionResult;
  8075. }
  8076. // 产成品交接汇总
  8077. if (action == "GetFinishedProductHandoverSum")
  8078. {
  8079. DateTime date = DateTime.Parse(data["date"].ToString());
  8080. ServiceResultEntity sre = ReportModuleLogic.GetRPT0030112NPDAData(date,
  8081. data["goodscode"] as string, sUserInfo);
  8082. if (sre.Status == Constant.ServiceResultStatus.Success)
  8083. {
  8084. actionResult.Status = (int)Constant.PDAResult.Success;
  8085. actionResult.Result = JsonHelper.ToJson(sre.Data);
  8086. }
  8087. else if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  8088. {
  8089. actionResult.Status = (int)Constant.PDAResult.Success;
  8090. }
  8091. else
  8092. {
  8093. actionResult.Status = (int)Constant.PDAResult.Fail;
  8094. actionResult.Message = sre.Message;
  8095. }
  8096. return actionResult;
  8097. }
  8098. //xuwei add 2019-10-21
  8099. //统计当前工号,当日,按产品编码分组统计半检返修数据数量
  8100. if (action == "GetSemiReworkDayCount")
  8101. {
  8102. //不指定参数查询当天
  8103. string dateStr = DateTime.Now.ToString("yyyy-MM-dd");
  8104. //dateStr = "2019-10-17";
  8105. //指定参数查询特定日期
  8106. if(data.ContainsKey("SemiReworkDate")) dateStr = data["SemiReworkDate"].ToString();
  8107. ServiceResultEntity sre = ReportModuleLogic.GetSemiReworkDayCount(sUserInfo, dateStr);
  8108. if (sre.Status == Constant.ServiceResultStatus.Success)
  8109. {
  8110. actionResult.Status = (int)Constant.PDAResult.Success;
  8111. actionResult.Result = JsonHelper.ToJson(sre.Data);
  8112. }
  8113. else
  8114. {
  8115. actionResult.Status = (int)Constant.PDAResult.Fail;
  8116. actionResult.Message = sre.Message;
  8117. }
  8118. return actionResult;
  8119. }
  8120. //xuwe end
  8121. return actionResult;
  8122. }
  8123. #endregion
  8124. #region 模具管理
  8125. if (module == "PC_Mould")
  8126. {
  8127. #region 模具新建画面数据初始化
  8128. if (action == "GetMouldAddInit")
  8129. {
  8130. ClientRequestEntity cre = new ClientRequestEntity();
  8131. cre.Properties["MouldID"] = 0;
  8132. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1002LoadData(sUserInfo, cre);
  8133. if (sre.Status == Constant.ServiceResultStatus.Success)
  8134. {
  8135. actionResult.Status = (int)Constant.PDAResult.Success;
  8136. actionResult.Result = JsonHelper.ToJson(sre.Data);
  8137. }
  8138. else
  8139. {
  8140. actionResult.Status = (int)Constant.PDAResult.Fail;
  8141. actionResult.Message = sre.Message;
  8142. }
  8143. return actionResult;
  8144. }
  8145. #endregion
  8146. #region 验证模具产品型号
  8147. if (action == "CheckGoodsCodeOnMould")
  8148. {
  8149. ClientRequestEntity cre = new ClientRequestEntity();
  8150. cre.Properties["GoodsCode"] = data["GoodsCode"];
  8151. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1002GoodsData(sUserInfo, cre);
  8152. if (sre.Status == Constant.ServiceResultStatus.Success &&
  8153. sre.Data.Tables[0].Rows.Count > 0)
  8154. {
  8155. actionResult.Status = (int)Constant.PDAResult.Success;
  8156. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8157. }
  8158. else
  8159. {
  8160. actionResult.Status = (int)Constant.PDAResult.Fail;
  8161. actionResult.Message = "无效产品型号";
  8162. }
  8163. return actionResult;
  8164. }
  8165. #endregion
  8166. #region 验证模具生产工号
  8167. if (action == "CheckUserCodeOnMould")
  8168. {
  8169. DataTable sre = PDAModuleLogic.GetUserCodeOnMould(sUserInfo, data["UserCode"].ToString());
  8170. if (sre != null && sre.Rows.Count > 0)
  8171. {
  8172. actionResult.Status = (int)Constant.PDAResult.Success;
  8173. actionResult.Result = JsonHelper.ToJson(sre);
  8174. }
  8175. else
  8176. {
  8177. actionResult.Status = (int)Constant.PDAResult.Fail;
  8178. actionResult.Message = "无效生产工号";
  8179. }
  8180. return actionResult;
  8181. }
  8182. #endregion
  8183. #region 新建保存
  8184. if (action == "SetMouldAdd" || action == "SetMouldEdit")
  8185. {
  8186. ClientRequestEntity cre = new ClientRequestEntity();
  8187. foreach (string item in data.Keys)
  8188. {
  8189. if (item == "ProductionDate")
  8190. {
  8191. cre.Properties.Add(item, Convert.ToDateTime(data[item]));
  8192. }
  8193. else
  8194. {
  8195. cre.Properties.Add(item, data[item]);
  8196. }
  8197. }
  8198. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1002Data(sUserInfo, cre);
  8199. if (sre.Status == Constant.ServiceResultStatus.Success)
  8200. {
  8201. actionResult.Status = (int)Constant.PDAResult.Success;
  8202. }
  8203. else
  8204. {
  8205. actionResult.Status = (int)Constant.PDAResult.Fail;
  8206. actionResult.Result = sre.OtherStatus;
  8207. actionResult.Message = sre.Message;
  8208. }
  8209. return actionResult;
  8210. }
  8211. #endregion
  8212. #region 模具编辑画面数据初始化
  8213. if (action == "GetMouldEditInfo")
  8214. {
  8215. DataTable sre = PDAModuleLogic.GetMouldEditInfo(sUserInfo, data["MouldBarcode"].ToString());
  8216. if (sre != null && sre.Rows.Count > 0)
  8217. {
  8218. actionResult.Status = (int)Constant.PDAResult.Success;
  8219. actionResult.Result = JsonHelper.ToJson(sre);
  8220. }
  8221. else
  8222. {
  8223. actionResult.Status = (int)Constant.PDAResult.Fail;
  8224. actionResult.Message = "无效模具条码";
  8225. }
  8226. return actionResult;
  8227. }
  8228. #endregion
  8229. #region 模具操作-画面初始化
  8230. if (action == "GetMouldOperationInit")
  8231. {
  8232. ClientRequestEntity cre = new ClientRequestEntity();
  8233. cre.Properties["MouldOperationType"] = data["MouldOperationType"];
  8234. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1004LoadData(sUserInfo, cre);
  8235. if (sre.Status == Constant.ServiceResultStatus.Success)
  8236. {
  8237. actionResult.Status = (int)Constant.PDAResult.Success;
  8238. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8239. }
  8240. else
  8241. {
  8242. actionResult.Status = (int)Constant.PDAResult.Fail;
  8243. actionResult.Result = sre.OtherStatus;
  8244. actionResult.Message = sre.Message;
  8245. }
  8246. return actionResult;
  8247. }
  8248. #endregion
  8249. #region 模具操作-验证模具条码
  8250. if (action == "CheckMouldBarcode")
  8251. {
  8252. ClientRequestEntity cre = new ClientRequestEntity();
  8253. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8254. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetMouldData(sUserInfo, cre);
  8255. if (sre.Status == Constant.ServiceResultStatus.Success)
  8256. {
  8257. if (sre.Data.Tables[0].Rows.Count == 0)
  8258. {
  8259. actionResult.Status = (int)Constant.PDAResult.Fail;
  8260. actionResult.Result = -1;
  8261. actionResult.Message = "模具【" + data["MouldBarcode"] + "】不存在";
  8262. return actionResult;
  8263. }
  8264. int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
  8265. int mouldStatusID = Convert.ToInt32(sre.Data.Tables[0].Rows[0]["MouldStatus"]);
  8266. string mouldStatusName = sre.Data.Tables[0].Rows[0]["MouldStatusName"].ToString();
  8267. #region 报损
  8268. if (mouldOperationType == 2)
  8269. {
  8270. if (mouldStatusID == 1 || mouldStatusID == 3)
  8271. {
  8272. actionResult.Status = (int)Constant.PDAResult.Success;
  8273. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8274. }
  8275. else
  8276. {
  8277. actionResult.Status = (int)Constant.PDAResult.Fail;
  8278. actionResult.Result = -2;
  8279. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行报损操作";
  8280. }
  8281. return actionResult;
  8282. }
  8283. #endregion
  8284. #region 撤销
  8285. if (mouldOperationType == 3)
  8286. {
  8287. if (mouldStatusID == 4)
  8288. {
  8289. actionResult.Status = (int)Constant.PDAResult.Success;
  8290. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8291. }
  8292. else
  8293. {
  8294. actionResult.Status = (int)Constant.PDAResult.Fail;
  8295. actionResult.Result = -2;
  8296. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行撤销报损操作";
  8297. }
  8298. return actionResult;
  8299. }
  8300. #endregion
  8301. #region 领用
  8302. if (mouldOperationType == 4)
  8303. {
  8304. if (mouldStatusID == 1)
  8305. {
  8306. actionResult.Status = (int)Constant.PDAResult.Success;
  8307. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8308. }
  8309. else
  8310. {
  8311. actionResult.Status = (int)Constant.PDAResult.Fail;
  8312. actionResult.Result = -2;
  8313. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行领用操作";
  8314. }
  8315. return actionResult;
  8316. }
  8317. #endregion
  8318. #region 回收
  8319. if (mouldOperationType == 5)
  8320. {
  8321. if (mouldStatusID == 3)
  8322. {
  8323. actionResult.Status = (int)Constant.PDAResult.Success;
  8324. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8325. }
  8326. else
  8327. {
  8328. actionResult.Status = (int)Constant.PDAResult.Fail;
  8329. actionResult.Result = -2;
  8330. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行回收操作";
  8331. }
  8332. return actionResult;
  8333. }
  8334. #endregion
  8335. #region 变更型号
  8336. if (mouldOperationType == -1)
  8337. {
  8338. if (mouldStatusID != 4)
  8339. {
  8340. actionResult.Status = (int)Constant.PDAResult.Success;
  8341. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8342. }
  8343. else
  8344. {
  8345. actionResult.Status = (int)Constant.PDAResult.Fail;
  8346. actionResult.Result = -2;
  8347. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行变更型号操作";
  8348. }
  8349. return actionResult;
  8350. }
  8351. #endregion
  8352. #region 替换条码
  8353. if (mouldOperationType == -2)
  8354. {
  8355. actionResult.Status = (int)Constant.PDAResult.Success;
  8356. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8357. return actionResult;
  8358. }
  8359. #endregion
  8360. return actionResult;
  8361. }
  8362. }
  8363. #endregion
  8364. #region 模具操作-保存
  8365. if (action == "SetMouldOperation")
  8366. {
  8367. ClientRequestEntity cre = new ClientRequestEntity();
  8368. cre.Properties["MouldIDs"] = string.Join(",", JsonHelper.FromJson<int[]>(data["MouldIDs"].ToString()));
  8369. cre.Properties["MouldOperationType"] = data["MouldOperationType"];
  8370. cre.Properties["Remarks"] = data["Remarks"];
  8371. int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
  8372. if (mouldOperationType == (int)Constant.MouldOperationType.ChangeGoodsCode)
  8373. {
  8374. cre.Properties["GoodsID"] = data["GoodsID"];
  8375. cre.Properties["GoodsCode"] = data["GoodsCode"];
  8376. }
  8377. else if (mouldOperationType == (int)Constant.MouldOperationType.InvToScrap)
  8378. {
  8379. cre.Properties["ScrapReason"] = data["ScrapReason"];
  8380. cre.Properties["ScrapResponsibility"] = data["ScrapRemarks"];
  8381. }
  8382. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1004Data(sUserInfo, cre);
  8383. if (sre.Status == Constant.ServiceResultStatus.Success)
  8384. {
  8385. actionResult.Status = (int)Constant.PDAResult.Success;
  8386. }
  8387. else
  8388. {
  8389. actionResult.Status = (int)Constant.PDAResult.Fail;
  8390. }
  8391. return actionResult;
  8392. }
  8393. #endregion
  8394. #region 模具操作-替换条码
  8395. if (action == "ChangedMouldBarcode")
  8396. {
  8397. ClientRequestEntity cre = new ClientRequestEntity();
  8398. cre.Properties["MouldID"] = data["MouldID"];
  8399. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8400. cre.Properties["NewMouldBarcode"] = data["NewMouldBarcode"];
  8401. cre.Properties["Remarks"] = data["Remarks"];
  8402. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1003Data(sUserInfo, cre);
  8403. if (sre.Status == Constant.ServiceResultStatus.Success)
  8404. {
  8405. actionResult.Status = (int)Constant.PDAResult.Success;
  8406. }
  8407. else
  8408. {
  8409. actionResult.Status = (int)Constant.PDAResult.Fail;
  8410. actionResult.Result = sre.OtherStatus;
  8411. actionResult.Message = sre.Message;
  8412. }
  8413. return actionResult;
  8414. }
  8415. #endregion
  8416. #region 模具跟踪表
  8417. if (action == "GetMoldTracking")
  8418. {
  8419. ClientRequestEntity cre = new ClientRequestEntity();
  8420. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8421. ServiceResultEntity sre = ReportModuleLogic.GetRPT020105Data(cre, sUserInfo);
  8422. if (sre.Status == Constant.ServiceResultStatus.Success)
  8423. {
  8424. actionResult.Status = (int)Constant.PDAResult.Success;
  8425. actionResult.Result = JsonHelper.ToJson(sre.Data);
  8426. }
  8427. else
  8428. {
  8429. actionResult.Status = (int)Constant.PDAResult.Fail;
  8430. actionResult.Message = "此模具条码不存在";
  8431. }
  8432. return actionResult;
  8433. }
  8434. #endregion
  8435. return actionResult;
  8436. }
  8437. #endregion
  8438. #region 成型线模具管理
  8439. if (module == "PC_GroutingLineMould")
  8440. {
  8441. #region 获取当前用户成型线模具管理权限
  8442. if (action == "GetGMouldStatusRight")
  8443. {
  8444. DataTable right = PDAModuleLogic.GetGMouldStatusRight(sUserInfo);
  8445. actionResult.Status = (int)Constant.PDAResult.Success;
  8446. if (right != null && right.Rows.Count > 0)
  8447. {
  8448. actionResult.Result = JsonHelper.ToJson(right);
  8449. }
  8450. return actionResult;
  8451. }
  8452. #endregion
  8453. #region 获取成型线状态等信息,和成型模具信息
  8454. if (action == "GetGroutingLineMould")
  8455. {
  8456. int? groutingLineID = null;
  8457. string groutingLineCode = null;
  8458. if (data.ContainsKey("GroutingLineID"))
  8459. {
  8460. groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8461. }
  8462. else
  8463. {
  8464. groutingLineCode = data["GroutingLineCode"] + "";
  8465. }
  8466. DataSet lineInfo = PDAModuleLogic.GetGroutingLineMould(sUserInfo, groutingLineCode, groutingLineID);
  8467. if (lineInfo == null)
  8468. {
  8469. actionResult.Status = (int)Constant.PDAResult.Fail;
  8470. actionResult.Message = "成型线【" + groutingLineCode + "】不存在或是停用状态";
  8471. }
  8472. else
  8473. {
  8474. actionResult.Status = (int)Constant.PDAResult.Success;
  8475. actionResult.Result = JsonHelper.ToJson(lineInfo);
  8476. }
  8477. return actionResult;
  8478. }
  8479. #endregion
  8480. #region 模具操作-画面初始化
  8481. if (action == "GetMouldOperationInit")
  8482. {
  8483. ClientRequestEntity cre = new ClientRequestEntity();
  8484. cre.Properties["MouldOperationType"] = 2;
  8485. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1004LoadData(sUserInfo, cre);
  8486. if (sre.Status == Constant.ServiceResultStatus.Success)
  8487. {
  8488. actionResult.Status = (int)Constant.PDAResult.Success;
  8489. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8490. }
  8491. else
  8492. {
  8493. actionResult.Status = (int)Constant.PDAResult.Fail;
  8494. actionResult.Result = sre.OtherStatus;
  8495. actionResult.Message = sre.Message;
  8496. }
  8497. return actionResult;
  8498. }
  8499. #endregion
  8500. #region 成型模具操作-画面初始化
  8501. if (action == "GetGroutingMouldOperationInit")
  8502. {
  8503. DataTable initData = PDAModuleLogic.GetGroutingMouldOperationInit(sUserInfo, 6);
  8504. if (initData != null && initData.Rows.Count > 0)
  8505. {
  8506. actionResult.Status = (int)Constant.PDAResult.Success;
  8507. Dictionary<string, string> syssetting = new Dictionary<string, string>();
  8508. foreach (DataRow item in initData.Rows)
  8509. {
  8510. syssetting.Add(item["settingcode"].ToString(), item["settingvalue"].ToString());
  8511. }
  8512. actionResult.Result = JsonHelper.ToJson(syssetting);
  8513. }
  8514. else
  8515. {
  8516. actionResult.Status = (int)Constant.PDAResult.Fail;
  8517. }
  8518. return actionResult;
  8519. }
  8520. #endregion
  8521. #region 模具操作-验证模具条码
  8522. if (action == "CheckMouldBarcode")
  8523. {
  8524. ClientRequestEntity cre = new ClientRequestEntity();
  8525. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8526. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetMouldData(sUserInfo, cre);
  8527. if (sre.Status == Constant.ServiceResultStatus.Success)
  8528. {
  8529. if (sre.Data.Tables[0].Rows.Count == 0)
  8530. {
  8531. actionResult.Status = (int)Constant.PDAResult.Fail;
  8532. actionResult.Result = -1;
  8533. actionResult.Message = "模具【" + data["MouldBarcode"] + "】不存在";
  8534. return actionResult;
  8535. }
  8536. int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
  8537. int mouldStatusID = Convert.ToInt32(sre.Data.Tables[0].Rows[0]["MouldStatus"]);
  8538. string mouldStatusName = sre.Data.Tables[0].Rows[0]["MouldStatusName"].ToString();
  8539. #region 上线
  8540. if (mouldOperationType == 6)
  8541. {
  8542. if (mouldStatusID == 1 || mouldStatusID == 3)
  8543. {
  8544. if (data.ContainsKey("GoodsID"))
  8545. {
  8546. if (sre.Data.Tables[0].Rows[0]["GoodsID"] + "" != data["GoodsID"] + "")
  8547. {
  8548. actionResult.Status = (int)Constant.PDAResult.Fail;
  8549. actionResult.Result = -3;
  8550. actionResult.Message =
  8551. "模具【" + data["MouldBarcode"] + "】的产品型号为【" +
  8552. sre.Data.Tables[0].Rows[0]["GoodsCode"] +
  8553. "】与当前不一致";
  8554. return actionResult;
  8555. }
  8556. }
  8557. actionResult.Status = (int)Constant.PDAResult.Success;
  8558. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8559. }
  8560. else
  8561. {
  8562. actionResult.Status = (int)Constant.PDAResult.Fail;
  8563. actionResult.Result = -2;
  8564. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行报损操作";
  8565. }
  8566. return actionResult;
  8567. }
  8568. #endregion
  8569. return actionResult;
  8570. }
  8571. }
  8572. #endregion
  8573. #region 停用
  8574. if (action == "StopGroutingLineDetail")
  8575. {
  8576. if (data == null || !data.ContainsKey("Details"))
  8577. {
  8578. actionResult.Status = (int)Constant.PDAResult.Fail;
  8579. actionResult.Message = "参数错误";
  8580. return actionResult;
  8581. }
  8582. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8583. DataTable gTable = new DataTable();
  8584. gTable.Columns.Add("GroutingLineID", typeof(int));
  8585. gTable.Columns.Add("GroutingLineCode");
  8586. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8587. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8588. gTable.Columns.Add("GroutingMouldCode");
  8589. gTable.Columns.Add("RecordRemarks");
  8590. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8591. gTable.Columns.Add("MouldID", typeof(int));
  8592. gTable.Columns.Add("MouldCode");
  8593. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8594. string groutingLineCode = data["GroutingLineCode"] + "";
  8595. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8596. foreach (Dictionary<string, object> item in details)
  8597. {
  8598. int? mouldID = null;
  8599. if (item.ContainsKey("MouldID"))
  8600. {
  8601. mouldID = Convert.ToInt32(item["MouldID"]);
  8602. if (mouldID == 0)
  8603. {
  8604. mouldID = null;
  8605. }
  8606. }
  8607. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8608. item["GLineDetailID"], item["GLineDetailCode"],
  8609. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8610. mouldID, item["MouldCode"]);
  8611. }
  8612. int result = PCModuleLogicDAL.StopGroutingLineDetail(gTable, sUserInfo);
  8613. if (result > 0)
  8614. {
  8615. actionResult.Status = (int)Constant.PDAResult.Success;
  8616. }
  8617. else
  8618. {
  8619. actionResult.Status = (int)Constant.PDAResult.Fail;
  8620. actionResult.Result = result;
  8621. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8622. return actionResult;
  8623. }
  8624. return actionResult;
  8625. }
  8626. #endregion
  8627. #region 启用
  8628. if (action == "StartGroutingLineDetail")
  8629. {
  8630. if (data == null || !data.ContainsKey("Details"))
  8631. {
  8632. actionResult.Status = (int)Constant.PDAResult.Fail;
  8633. actionResult.Message = "参数错误";
  8634. return actionResult;
  8635. }
  8636. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8637. DataTable gTable = new DataTable();
  8638. gTable.Columns.Add("GroutingLineID", typeof(int));
  8639. gTable.Columns.Add("GroutingLineCode");
  8640. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8641. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8642. gTable.Columns.Add("GroutingMouldCode");
  8643. gTable.Columns.Add("RecordRemarks");
  8644. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8645. gTable.Columns.Add("MouldID", typeof(int));
  8646. gTable.Columns.Add("MouldCode");
  8647. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8648. string groutingLineCode = data["GroutingLineCode"] + "";
  8649. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8650. foreach (Dictionary<string, object> item in details)
  8651. {
  8652. int? mouldID = null;
  8653. if (item.ContainsKey("MouldID"))
  8654. {
  8655. mouldID = Convert.ToInt32(item["MouldID"]);
  8656. if (mouldID == 0)
  8657. {
  8658. mouldID = null;
  8659. }
  8660. }
  8661. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8662. item["GLineDetailID"], item["GLineDetailCode"],
  8663. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8664. mouldID, item["MouldCode"]);
  8665. }
  8666. int result = PCModuleLogicDAL.StartGroutingLineDetail(gTable, sUserInfo);
  8667. if (result > 0)
  8668. {
  8669. actionResult.Status = (int)Constant.PDAResult.Success;
  8670. }
  8671. else
  8672. {
  8673. actionResult.Status = (int)Constant.PDAResult.Fail;
  8674. actionResult.Result = result;
  8675. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8676. return actionResult;
  8677. }
  8678. return actionResult;
  8679. }
  8680. #endregion
  8681. #region 维修
  8682. if (action == "RepairStartGroutingLineDetail")
  8683. {
  8684. if (data == null || !data.ContainsKey("Details"))
  8685. {
  8686. actionResult.Status = (int)Constant.PDAResult.Fail;
  8687. actionResult.Message = "参数错误";
  8688. return actionResult;
  8689. }
  8690. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8691. DataTable gTable = new DataTable();
  8692. gTable.Columns.Add("GroutingLineID", typeof(int));
  8693. gTable.Columns.Add("GroutingLineCode");
  8694. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8695. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8696. gTable.Columns.Add("GroutingMouldCode");
  8697. gTable.Columns.Add("RecordRemarks");
  8698. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8699. gTable.Columns.Add("MouldID", typeof(int));
  8700. gTable.Columns.Add("MouldCode");
  8701. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8702. string groutingLineCode = data["GroutingLineCode"] + "";
  8703. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8704. foreach (Dictionary<string, object> item in details)
  8705. {
  8706. int? mouldID = null;
  8707. if (item.ContainsKey("MouldID"))
  8708. {
  8709. mouldID = Convert.ToInt32(item["MouldID"]);
  8710. if (mouldID == 0)
  8711. {
  8712. mouldID = null;
  8713. }
  8714. }
  8715. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8716. item["GLineDetailID"], item["GLineDetailCode"],
  8717. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8718. mouldID, item["MouldCode"]);
  8719. }
  8720. int result = PCModuleLogicDAL.RepairStartGroutingLineDetail(gTable, sUserInfo);
  8721. if (result > 0)
  8722. {
  8723. actionResult.Status = (int)Constant.PDAResult.Success;
  8724. }
  8725. else
  8726. {
  8727. actionResult.Status = (int)Constant.PDAResult.Fail;
  8728. actionResult.Result = result;
  8729. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8730. return actionResult;
  8731. }
  8732. return actionResult;
  8733. }
  8734. #endregion
  8735. #region 结束维修
  8736. if (action == "RepairEndGroutingLineDetail")
  8737. {
  8738. if (data == null || !data.ContainsKey("Details"))
  8739. {
  8740. actionResult.Status = (int)Constant.PDAResult.Fail;
  8741. actionResult.Message = "参数错误";
  8742. return actionResult;
  8743. }
  8744. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8745. DataTable gTable = new DataTable();
  8746. gTable.Columns.Add("GroutingLineID", typeof(int));
  8747. gTable.Columns.Add("GroutingLineCode");
  8748. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8749. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8750. gTable.Columns.Add("GroutingMouldCode");
  8751. gTable.Columns.Add("RecordRemarks");
  8752. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8753. gTable.Columns.Add("MouldID", typeof(int));
  8754. gTable.Columns.Add("MouldCode");
  8755. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8756. string groutingLineCode = data["GroutingLineCode"] + "";
  8757. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8758. foreach (Dictionary<string, object> item in details)
  8759. {
  8760. int? mouldID = null;
  8761. if (item.ContainsKey("MouldID"))
  8762. {
  8763. mouldID = Convert.ToInt32(item["MouldID"]);
  8764. if (mouldID == 0)
  8765. {
  8766. mouldID = null;
  8767. }
  8768. }
  8769. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8770. item["GLineDetailID"], item["GLineDetailCode"],
  8771. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8772. mouldID, item["MouldCode"]);
  8773. }
  8774. int result = PCModuleLogicDAL.RepairEndGroutingLineDetail(gTable, sUserInfo);
  8775. if (result > 0)
  8776. {
  8777. actionResult.Status = (int)Constant.PDAResult.Success;
  8778. }
  8779. else
  8780. {
  8781. actionResult.Status = (int)Constant.PDAResult.Fail;
  8782. actionResult.Result = result;
  8783. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8784. return actionResult;
  8785. }
  8786. return actionResult;
  8787. }
  8788. #endregion
  8789. #region 换模
  8790. if (action == "ChangeGMouldStartGroutingLineDetail")
  8791. {
  8792. if (data == null || !data.ContainsKey("Details"))
  8793. {
  8794. actionResult.Status = (int)Constant.PDAResult.Fail;
  8795. actionResult.Message = "参数错误";
  8796. return actionResult;
  8797. }
  8798. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8799. DataTable gTable = new DataTable();
  8800. gTable.Columns.Add("GroutingLineID", typeof(int));
  8801. gTable.Columns.Add("GroutingLineCode");
  8802. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8803. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8804. gTable.Columns.Add("GroutingMouldCode");
  8805. gTable.Columns.Add("RecordRemarks");
  8806. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8807. gTable.Columns.Add("MouldID", typeof(int));
  8808. gTable.Columns.Add("MouldCode");
  8809. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8810. gTable.Columns.Add("MouldStatus", typeof(int));
  8811. gTable.Columns.Add("ScrapReason", typeof(int));
  8812. gTable.Columns.Add("ScrapResponsibility");
  8813. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8814. string groutingLineCode = data["GroutingLineCode"] + "";
  8815. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8816. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  8817. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  8818. string scrapResponsibility = data["ScrapRemarks"] + "";
  8819. foreach (Dictionary<string, object> item in details)
  8820. {
  8821. int? mouldID = null;
  8822. if (item.ContainsKey("MouldID"))
  8823. {
  8824. mouldID = Convert.ToInt32(item["MouldID"]);
  8825. if (mouldID == 0)
  8826. {
  8827. mouldID = null;
  8828. }
  8829. }
  8830. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8831. item["GLineDetailID"], item["GLineDetailCode"],
  8832. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8833. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  8834. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  8835. }
  8836. int result = PCModuleLogicDAL.ChangeGMouldStartGroutingLineDetail(gTable, sUserInfo);
  8837. if (result > 0)
  8838. {
  8839. actionResult.Status = (int)Constant.PDAResult.Success;
  8840. }
  8841. else
  8842. {
  8843. actionResult.Status = (int)Constant.PDAResult.Fail;
  8844. actionResult.Result = result;
  8845. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8846. return actionResult;
  8847. }
  8848. return actionResult;
  8849. }
  8850. #endregion
  8851. #region 变产
  8852. if (action == "UpdateLineStartGroutingLineDetail")
  8853. {
  8854. if (data == null || !data.ContainsKey("Details"))
  8855. {
  8856. actionResult.Status = (int)Constant.PDAResult.Fail;
  8857. actionResult.Message = "参数错误";
  8858. return actionResult;
  8859. }
  8860. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8861. DataTable gTable = new DataTable();
  8862. gTable.Columns.Add("GroutingLineID", typeof(int));
  8863. gTable.Columns.Add("GroutingLineCode");
  8864. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8865. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8866. gTable.Columns.Add("GroutingMouldCode");
  8867. gTable.Columns.Add("RecordRemarks");
  8868. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8869. gTable.Columns.Add("MouldID", typeof(int));
  8870. gTable.Columns.Add("MouldCode");
  8871. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8872. gTable.Columns.Add("MouldStatus", typeof(int));
  8873. gTable.Columns.Add("ScrapReason", typeof(int));
  8874. gTable.Columns.Add("ScrapResponsibility");
  8875. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8876. string groutingLineCode = data["GroutingLineCode"] + "";
  8877. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8878. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  8879. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  8880. string scrapResponsibility = data["ScrapRemarks"] + "";
  8881. foreach (Dictionary<string, object> item in details)
  8882. {
  8883. int? mouldID = null;
  8884. if (item.ContainsKey("MouldID"))
  8885. {
  8886. mouldID = Convert.ToInt32(item["MouldID"]);
  8887. if (mouldID == 0)
  8888. {
  8889. mouldID = null;
  8890. }
  8891. }
  8892. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8893. item["GLineDetailID"], item["GLineDetailCode"],
  8894. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8895. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  8896. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  8897. }
  8898. int result = PCModuleLogicDAL.UpdateLineStartGroutingLineDetail(gTable, sUserInfo);
  8899. if (result > 0)
  8900. {
  8901. actionResult.Status = (int)Constant.PDAResult.Success;
  8902. }
  8903. else
  8904. {
  8905. actionResult.Status = (int)Constant.PDAResult.Fail;
  8906. actionResult.Result = result;
  8907. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8908. return actionResult;
  8909. }
  8910. return actionResult;
  8911. }
  8912. #endregion
  8913. #region 整线变产
  8914. if (action == "UpdateAllLineStartGroutingLineDetail")
  8915. {
  8916. if (data == null || !data.ContainsKey("Details"))
  8917. {
  8918. actionResult.Status = (int)Constant.PDAResult.Fail;
  8919. actionResult.Message = "参数错误";
  8920. return actionResult;
  8921. }
  8922. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8923. DataTable gTable = new DataTable();
  8924. gTable.Columns.Add("GroutingLineID", typeof(int));
  8925. gTable.Columns.Add("GroutingLineCode");
  8926. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8927. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8928. gTable.Columns.Add("GroutingMouldCode");
  8929. gTable.Columns.Add("RecordRemarks");
  8930. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8931. gTable.Columns.Add("MouldID", typeof(int));
  8932. gTable.Columns.Add("MouldCode");
  8933. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8934. gTable.Columns.Add("MouldStatus", typeof(int));
  8935. gTable.Columns.Add("ScrapReason", typeof(int));
  8936. gTable.Columns.Add("ScrapResponsibility");
  8937. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8938. string groutingLineCode = data["GroutingLineCode"] + "";
  8939. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8940. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  8941. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  8942. string scrapResponsibility = data["ScrapRemarks"] + "";
  8943. foreach (Dictionary<string, object> item in details)
  8944. {
  8945. int? mouldID = null;
  8946. if (item.ContainsKey("MouldID"))
  8947. {
  8948. mouldID = Convert.ToInt32(item["MouldID"]);
  8949. if (mouldID == 0)
  8950. {
  8951. mouldID = null;
  8952. }
  8953. }
  8954. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8955. item["GLineDetailID"], item["GLineDetailCode"],
  8956. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8957. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  8958. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  8959. }
  8960. int result = PCModuleLogicDAL.UpdateAllLineStartGroutingLineDetail(gTable, groutingLineID, lineOPTimeStamp, sUserInfo);
  8961. if (result > 0)
  8962. {
  8963. actionResult.Status = (int)Constant.PDAResult.Success;
  8964. }
  8965. else
  8966. {
  8967. actionResult.Status = (int)Constant.PDAResult.Fail;
  8968. actionResult.Result = result;
  8969. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8970. return actionResult;
  8971. }
  8972. return actionResult;
  8973. }
  8974. #endregion
  8975. #region 卸模
  8976. if (action == "UnloadGroutingLineDetail")
  8977. {
  8978. if (data == null || !data.ContainsKey("Details"))
  8979. {
  8980. actionResult.Status = (int)Constant.PDAResult.Fail;
  8981. actionResult.Message = "参数错误";
  8982. return actionResult;
  8983. }
  8984. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8985. DataTable gTable = new DataTable();
  8986. gTable.Columns.Add("GroutingLineID", typeof(int));
  8987. gTable.Columns.Add("GroutingLineCode");
  8988. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8989. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8990. gTable.Columns.Add("GroutingMouldCode");
  8991. gTable.Columns.Add("RecordRemarks");
  8992. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8993. gTable.Columns.Add("MouldID", typeof(int));
  8994. gTable.Columns.Add("MouldCode");
  8995. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8996. gTable.Columns.Add("MouldStatus", typeof(int));
  8997. gTable.Columns.Add("ScrapReason", typeof(int));
  8998. gTable.Columns.Add("ScrapResponsibility");
  8999. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9000. string groutingLineCode = data["GroutingLineCode"] + "";
  9001. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9002. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  9003. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  9004. string scrapResponsibility = data["ScrapRemarks"] + "";
  9005. foreach (Dictionary<string, object> item in details)
  9006. {
  9007. int? mouldID = null;
  9008. if (item.ContainsKey("MouldID"))
  9009. {
  9010. mouldID = Convert.ToInt32(item["MouldID"]);
  9011. if (mouldID == 0)
  9012. {
  9013. mouldID = null;
  9014. }
  9015. }
  9016. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9017. item["GLineDetailID"], item["GLineDetailCode"],
  9018. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  9019. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  9020. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  9021. }
  9022. int result = PCModuleLogicDAL.UnloadGroutingLineDetail(gTable, sUserInfo);
  9023. if (result > 0)
  9024. {
  9025. actionResult.Status = (int)Constant.PDAResult.Success;
  9026. }
  9027. else
  9028. {
  9029. actionResult.Status = (int)Constant.PDAResult.Fail;
  9030. actionResult.Result = result;
  9031. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9032. return actionResult;
  9033. }
  9034. return actionResult;
  9035. }
  9036. #endregion
  9037. #region 结束换模
  9038. if (action == "ChangeGMouldEndGroutingLineDetail")
  9039. {
  9040. if (data == null || !data.ContainsKey("Details"))
  9041. {
  9042. actionResult.Status = (int)Constant.PDAResult.Fail;
  9043. actionResult.Message = "参数错误";
  9044. return actionResult;
  9045. }
  9046. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9047. DataTable gTable = new DataTable();
  9048. gTable.Columns.Add("GroutingLineID", typeof(int));
  9049. gTable.Columns.Add("GroutingLineCode");
  9050. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9051. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9052. gTable.Columns.Add("GroutingMouldCode");
  9053. gTable.Columns.Add("RreasonRemarks");
  9054. gTable.Columns.Add("RecordRemarks");
  9055. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9056. gTable.Columns.Add("MouldID", typeof(int));
  9057. gTable.Columns.Add("MouldCode");
  9058. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9059. gTable.Columns.Add("GoodsID", typeof(int));
  9060. gTable.Columns.Add("GoodsCode");
  9061. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  9062. gTable.Columns.Add("GroutingCount", typeof(int));
  9063. gTable.Columns.Add("MouldSource");
  9064. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9065. string groutingLineCode = data["GroutingLineCode"] + "";
  9066. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9067. foreach (Dictionary<string, object> item in details)
  9068. {
  9069. int? mouldID = null;
  9070. if (item.ContainsKey("MouldID"))
  9071. {
  9072. mouldID = Convert.ToInt32(item["MouldID"]);
  9073. if (mouldID == 0)
  9074. {
  9075. mouldID = null;
  9076. }
  9077. }
  9078. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9079. item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"],
  9080. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  9081. mouldID, item["MouldCode"], item["MouldOutputNo"],
  9082. item["GoodsID"], item["GoodsCode"],
  9083. item["StandardGroutingCount"], item["GroutingCount"],
  9084. (mouldID == null ? "0" : "1"));
  9085. }
  9086. ServiceResultEntity result = PCModuleLogicDAL.ChangeGMouldEndGroutingLineDetail(gTable, sUserInfo);
  9087. if (result.Status == Constant.ServiceResultStatus.Success)
  9088. {
  9089. actionResult.Status = (int)Constant.PDAResult.Success;
  9090. }
  9091. else if (result.OtherStatus == -100)
  9092. {
  9093. actionResult.Status = (int)Constant.PDAResult.Fail;
  9094. actionResult.Result = -100;
  9095. actionResult.Message = result.Message;
  9096. return actionResult;
  9097. }
  9098. else
  9099. {
  9100. actionResult.Status = (int)Constant.PDAResult.Fail;
  9101. actionResult.Result = -500;
  9102. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9103. return actionResult;
  9104. }
  9105. return actionResult;
  9106. }
  9107. #endregion
  9108. #region 结束变产
  9109. if (action == "UpdateLineEndGroutingLineDetail")
  9110. {
  9111. if (data == null || !data.ContainsKey("Details"))
  9112. {
  9113. actionResult.Status = (int)Constant.PDAResult.Fail;
  9114. actionResult.Message = "参数错误";
  9115. return actionResult;
  9116. }
  9117. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9118. DataTable gTable = new DataTable();
  9119. gTable.Columns.Add("GroutingLineID", typeof(int));
  9120. gTable.Columns.Add("GroutingLineCode");
  9121. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9122. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9123. gTable.Columns.Add("GroutingMouldCode");
  9124. gTable.Columns.Add("RreasonRemarks");
  9125. gTable.Columns.Add("RecordRemarks");
  9126. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9127. gTable.Columns.Add("MouldID", typeof(int));
  9128. gTable.Columns.Add("MouldCode");
  9129. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9130. gTable.Columns.Add("GoodsID", typeof(int));
  9131. gTable.Columns.Add("GoodsCode");
  9132. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  9133. gTable.Columns.Add("GroutingCount", typeof(int));
  9134. gTable.Columns.Add("MouldSource");
  9135. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9136. string groutingLineCode = data["GroutingLineCode"] + "";
  9137. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9138. foreach (Dictionary<string, object> item in details)
  9139. {
  9140. int? mouldID = null;
  9141. if (item.ContainsKey("MouldID"))
  9142. {
  9143. mouldID = Convert.ToInt32(item["MouldID"]);
  9144. if (mouldID == 0)
  9145. {
  9146. mouldID = null;
  9147. }
  9148. }
  9149. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9150. item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"],
  9151. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  9152. mouldID, item["MouldCode"], item["MouldOutputNo"],
  9153. item["GoodsID"], item["GoodsCode"],
  9154. item["StandardGroutingCount"], item["GroutingCount"],
  9155. (mouldID == null ? "0" : "1"));
  9156. }
  9157. ServiceResultEntity result = PCModuleLogicDAL.UpdateLineEndGroutingLineDetail(gTable, 0, sUserInfo);
  9158. if (result.Status == Constant.ServiceResultStatus.Success)
  9159. {
  9160. actionResult.Status = (int)Constant.PDAResult.Success;
  9161. }
  9162. else if (result.OtherStatus == -100)
  9163. {
  9164. actionResult.Status = (int)Constant.PDAResult.Fail;
  9165. actionResult.Result = -100;
  9166. actionResult.Message = result.Message;
  9167. return actionResult;
  9168. }
  9169. else
  9170. {
  9171. actionResult.Status = (int)Constant.PDAResult.Fail;
  9172. actionResult.Result = -500;
  9173. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9174. return actionResult;
  9175. }
  9176. return actionResult;
  9177. }
  9178. #endregion
  9179. #region 结束整线变产
  9180. if (action == "UpdateAllLineEndGroutingLineDetail")
  9181. {
  9182. if (data == null || !data.ContainsKey("Details"))
  9183. {
  9184. actionResult.Status = (int)Constant.PDAResult.Fail;
  9185. actionResult.Message = "参数错误";
  9186. return actionResult;
  9187. }
  9188. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9189. DataTable gTable = new DataTable();
  9190. gTable.Columns.Add("GroutingLineID", typeof(int));
  9191. gTable.Columns.Add("GroutingLineCode");
  9192. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9193. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9194. gTable.Columns.Add("GroutingMouldCode");
  9195. gTable.Columns.Add("Remarks");
  9196. gTable.Columns.Add("RecordRemarks");
  9197. //gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9198. gTable.Columns.Add("MouldID", typeof(int));
  9199. gTable.Columns.Add("MouldCode");
  9200. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9201. gTable.Columns.Add("GoodsID", typeof(int));
  9202. gTable.Columns.Add("GoodsCode");
  9203. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  9204. gTable.Columns.Add("GroutingCount", typeof(int));
  9205. gTable.Columns.Add("MouldSource");
  9206. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9207. string groutingLineCode = data["GroutingLineCode"] + "";
  9208. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9209. foreach (Dictionary<string, object> item in details)
  9210. {
  9211. int? mouldID = null;
  9212. if (item.ContainsKey("MouldID"))
  9213. {
  9214. mouldID = Convert.ToInt32(item["MouldID"]);
  9215. if (mouldID == 0)
  9216. {
  9217. mouldID = null;
  9218. }
  9219. }
  9220. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9221. item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"],
  9222. item["RecordRemarks"], //Convert.ToDateTime(item["OPTimeStamp"]),
  9223. mouldID, item["MouldCode"], item["MouldOutputNo"],
  9224. item["GoodsID"], item["GoodsCode"],
  9225. item["StandardGroutingCount"], item["GroutingCount"],
  9226. (mouldID == null ? "0" : "1"));
  9227. }
  9228. ServiceResultEntity result = PCModuleLogicDAL.UpdateAllLineEndGroutingLineDetail(gTable, null, groutingLineID, lineOPTimeStamp, sUserInfo);
  9229. if (result.Status == Constant.ServiceResultStatus.Success)
  9230. {
  9231. actionResult.Status = (int)Constant.PDAResult.Success;
  9232. }
  9233. else if (result.OtherStatus == -100)
  9234. {
  9235. actionResult.Status = (int)Constant.PDAResult.Fail;
  9236. actionResult.Result = -100;
  9237. actionResult.Message = result.Message;
  9238. return actionResult;
  9239. }
  9240. else
  9241. {
  9242. actionResult.Status = (int)Constant.PDAResult.Fail;
  9243. actionResult.Result = -500;
  9244. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9245. return actionResult;
  9246. }
  9247. return actionResult;
  9248. }
  9249. #endregion
  9250. #region 上模
  9251. if (action == "UpdateGroutingLine_AddMould")
  9252. {
  9253. if (data == null || !data.ContainsKey("Details"))
  9254. {
  9255. actionResult.Status = (int)Constant.PDAResult.Fail;
  9256. actionResult.Message = "参数错误";
  9257. return actionResult;
  9258. }
  9259. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9260. DataTable gTable = new DataTable();
  9261. gTable.Columns.Add("GroutingLineID", typeof(int));
  9262. gTable.Columns.Add("GroutingLineCode");
  9263. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9264. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9265. gTable.Columns.Add("GroutingMouldCode");
  9266. gTable.Columns.Add("Remarks");
  9267. gTable.Columns.Add("RecordRemarks");
  9268. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9269. gTable.Columns.Add("MouldID", typeof(int));
  9270. gTable.Columns.Add("MouldCode");
  9271. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9272. gTable.Columns.Add("GoodsID", typeof(int));
  9273. gTable.Columns.Add("GoodsCode");
  9274. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  9275. gTable.Columns.Add("GroutingCount", typeof(int));
  9276. gTable.Columns.Add("MouldSource");
  9277. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9278. string groutingLineCode = data["GroutingLineCode"] + "";
  9279. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9280. foreach (Dictionary<string, object> item in details)
  9281. {
  9282. int? mouldID = null;
  9283. if (item.ContainsKey("MouldID"))
  9284. {
  9285. mouldID = Convert.ToInt32(item["MouldID"]);
  9286. if (mouldID == 0)
  9287. {
  9288. mouldID = null;
  9289. }
  9290. }
  9291. int gldID = Convert.ToInt32(item["GLineDetailID"]);
  9292. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9293. gldID, item["GLineDetailCode"],
  9294. item["DetailRemarks"], item["RecordRemarks"],
  9295. (gldID > 0 ? (object)Convert.ToDateTime(item["OPTimeStamp"]) : null),
  9296. mouldID, item["MouldCode"], item["MouldOutputNo"],
  9297. item["GoodsID"], item["GoodsCode"],
  9298. item["StandardGroutingCount"], item["GroutingCount"],
  9299. (mouldID == null ? "0" : "1"));
  9300. }
  9301. ServiceResultEntity result = PCModuleLogicDAL.UpdateGroutingLine_AddMould(groutingLineID, groutingLineCode, lineOPTimeStamp, gTable, sUserInfo);
  9302. if (result.Status == Constant.ServiceResultStatus.Success)
  9303. {
  9304. actionResult.Status = (int)Constant.PDAResult.Success;
  9305. }
  9306. else if (result.OtherStatus == -2 || result.OtherStatus == -100)
  9307. {
  9308. actionResult.Status = (int)Constant.PDAResult.Fail;
  9309. actionResult.Result = result.OtherStatus;
  9310. actionResult.Message = result.Message;
  9311. return actionResult;
  9312. }
  9313. else
  9314. {
  9315. actionResult.Status = (int)Constant.PDAResult.Fail;
  9316. actionResult.Result = -500;
  9317. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9318. return actionResult;
  9319. }
  9320. return actionResult;
  9321. }
  9322. #endregion
  9323. return actionResult;
  9324. }
  9325. #endregion
  9326. #region 包装装板限制
  9327. if (module == "FinishedLoadingCar")
  9328. {
  9329. if (action == "GetSetting")
  9330. {
  9331. ClientRequestEntity cre = new ClientRequestEntity();
  9332. cre.Properties["GoodsID"] = data["GoodsID"];
  9333. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetFinishedLoadingCarSetting(sUserInfo, cre);
  9334. if (sre.Status == Constant.ServiceResultStatus.Success)
  9335. {
  9336. actionResult.Status = (int)Constant.PDAResult.Success;
  9337. foreach (DataRow item in sre.Data.Tables[0].Rows)
  9338. {
  9339. if (item["settingcode"].ToString() == "S_PM_011")
  9340. {
  9341. cre.Properties["S_PM_011"] = item["settingvalue"];
  9342. }
  9343. else if (item["settingcode"].ToString() == "S_PM_012")
  9344. {
  9345. cre.Properties["S_PM_012"] = item["settingvalue"];
  9346. }
  9347. else if (item["settingcode"].ToString() == "S_PM_013")
  9348. {
  9349. cre.Properties["S_PM_013"] = item["settingvalue"];
  9350. }
  9351. }
  9352. cre.Properties["PlatelitNum"] = sre.Result;
  9353. actionResult.Result = JsonHelper.ToJson(cre.Properties);
  9354. }
  9355. else
  9356. {
  9357. actionResult.Status = (int)Constant.PDAResult.Fail;
  9358. actionResult.Message = "";
  9359. }
  9360. return actionResult;
  9361. }
  9362. }
  9363. #endregion
  9364. #region 成型报损
  9365. if (module == "GroutingScrapProduct")
  9366. {
  9367. // 查询注浆日报明细表
  9368. if ("GetGroutingDailyDetail" == action)
  9369. {
  9370. ClientRequestEntity cre = new ClientRequestEntity();
  9371. cre.NameSpace = module;
  9372. cre.Name = action;
  9373. if (!string.IsNullOrEmpty(jsonData))
  9374. {
  9375. cre.Properties["BarCode"] = data["BarCode"];
  9376. }
  9377. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetGroutingDailyDetail(cre, sUserInfo);
  9378. //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9379. actionResult.Status = (int)Constant.PDAResult.Success;
  9380. if (sre == null || sre.Data == null || sre.Data.Tables.Count == 0
  9381. || sre.Data.Tables[0].Rows.Count == 0)
  9382. {
  9383. actionResult.Message = "未查询到该产品信息,请确认该产品是否已经进行注浆!";
  9384. actionResult.Status = (int)Constant.PDAResult.Fail;
  9385. }
  9386. else
  9387. {
  9388. DataRow _barCodeRow = sre.Data.Tables[0].Rows[0];
  9389. // 判断是否进行了注浆
  9390. if ("0".Equals(_barCodeRow["GroutingFlag"]))
  9391. {
  9392. actionResult.Message = "该产品还未进行注浆!";
  9393. actionResult.Status = (int)Constant.PDAResult.Fail;
  9394. }
  9395. // 判断是否进行了交坯
  9396. if ("1".Equals(_barCodeRow["DeliverFlag"]))
  9397. {
  9398. actionResult.Message = "该产品已经交坯!";
  9399. actionResult.Status = (int)Constant.PDAResult.Fail;
  9400. }
  9401. // 判断是否已经报损
  9402. if ("1".Equals(_barCodeRow["ScrapFlag"]))
  9403. {
  9404. actionResult.Message = "该产品已经报损!";
  9405. actionResult.Status = (int)Constant.PDAResult.Fail;
  9406. }
  9407. // 该产品已进入生产工序
  9408. if ("1".Equals(_barCodeRow["beginningflag"]))
  9409. {
  9410. actionResult.Message = "该产品已进入生产工序!";
  9411. actionResult.Status = (int)Constant.PDAResult.Fail;
  9412. }
  9413. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9414. }
  9415. }
  9416. // 获取成型报损原因
  9417. else if ("GetScrapReasonData" == action)
  9418. {
  9419. ClientRequestEntity cre = new ClientRequestEntity();
  9420. cre.NameSpace = module;
  9421. cre.Name = action;
  9422. ServiceResultEntity sre = SystemModuleLogic.GetScrapReasonData(cre, sUserInfo, "1");
  9423. actionResult.Status = (int)Constant.PDAResult.Success;
  9424. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9425. }
  9426. // 保存成型报损
  9427. else if ("SaveGroutingScrapProduct" == action)
  9428. {
  9429. ClientRequestEntity cre = new ClientRequestEntity();
  9430. cre.NameSpace = module;
  9431. cre.Name = action;
  9432. if (!string.IsNullOrEmpty(jsonData))
  9433. {
  9434. // DataSet returnData = JsonHelper.FromJson<DataSet>(jsonData);
  9435. DataTable dt = JsonHelper.FromJson<DataTable>(data["Table"] + "");
  9436. DataTable dtResponsible = JsonHelper.FromJson<DataTable>(data["Table1"] + "");
  9437. if (dt != null && dt.Rows.Count > 0)
  9438. {
  9439. // 总单信息
  9440. DataRow properties = dt.Rows[0];
  9441. cre.Properties["BarCode"] = properties["BarCode"]; // 产品条码
  9442. cre.Properties["GoodsID"] = properties["GoodsID"]; // 产品ID
  9443. cre.Properties["GoodsCode"] = properties["GoodsCode"]; // 产品编码
  9444. cre.Properties["GoodsName"] = properties["GoodsName"]; // 产品名称
  9445. cre.Properties["GroutingDailyID"] = properties["GroutingDailyID"]; // 注浆日报ID
  9446. cre.Properties["GroutingDailyDetailID"] = properties["GroutingDailyDetailID"]; // 注浆日报明细ID
  9447. cre.Properties["GroutingDate"] = properties["GroutingDate"]; // 注浆日期
  9448. cre.Properties["GroutingLineID"] = properties["GroutingLineID"]; // 成型生产线ID
  9449. cre.Properties["GroutingLineCode"] = properties["GroutingLineCode"]; // 成型生产线编码
  9450. cre.Properties["GroutingLineName"] = properties["GroutingLineName"]; // 成型生产线名称
  9451. cre.Properties["GMouldTypeID"] = properties["GMouldTypeID"]; // 成型线类型ID
  9452. cre.Properties["GroutingLineDetailID"] = properties["GroutingLineDetailID"]; // 成型生产线明细ID
  9453. cre.Properties["GroutingMouldCode"] = properties["GroutingMouldCode"]; // 注浆模具编号
  9454. cre.Properties["MouldCode"] = properties["MouldCode"]; // 模具编号
  9455. cre.Properties["GroutingUserID"] = properties["GroutingUserID"]; // 注浆工号ID
  9456. cre.Properties["GroutingUserCode"] = properties["GroutingUserCode"]; // 注浆工号编码
  9457. cre.Properties["GroutingNum"] = properties["GroutingNum"]; // 注浆次数
  9458. cre.Properties["ScrapType"] = properties["ScrapType"]; // 损坯类型
  9459. //cre.Properties["ScrapDate"] = properties["ScrapDate"]; // 报损日期
  9460. cre.Properties["ScrapDate"] = DateTime.Now.ToString("yyyy-MM-dd"); // 报损日期
  9461. cre.Properties["ScrapRreasonID"] = properties["ScrapRreasonID"]; // 报损日期
  9462. cre.Properties["ResponUserID"] = properties["ResponUserID"]; // 损坯工号
  9463. cre.Properties["ResponUserCode"] = properties["ResponUserCode"];
  9464. cre.Properties["Remarks"] = properties["Remarks"]; // 备注
  9465. cre.Properties["AuditStatus"] = properties["AuditStatus"]; // 审批状态
  9466. // 责任员工
  9467. cre.Data = new DataSet();
  9468. //DataTable returnTable = returnData.Tables[1].Copy();
  9469. cre.Data.Tables.Add(dtResponsible);
  9470. }
  9471. }
  9472. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveGroutingScrapProduct(cre, sUserInfo);
  9473. if (sre.Status == Constant.ServiceResultStatus.Success)
  9474. {
  9475. actionResult.Status = (int)Constant.PDAResult.Success;
  9476. actionResult.Result = sre.Result;
  9477. }
  9478. else
  9479. {
  9480. actionResult.Status = (int)Constant.PDAResult.Fail;
  9481. actionResult.Result = sre.OtherStatus;
  9482. actionResult.Message = sre.Message;
  9483. }
  9484. }
  9485. // 获取成型报损信息 用于撤销使用
  9486. else if ("GetGroutingScrapProduct" == action)
  9487. {
  9488. ClientRequestEntity cre = new ClientRequestEntity();
  9489. cre.NameSpace = module;
  9490. cre.Name = action;
  9491. if (!string.IsNullOrEmpty(jsonData))
  9492. {
  9493. cre.Properties["BarCode"] = data["BarCode"];
  9494. }
  9495. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetGroutingScrapProduct(cre, sUserInfo);
  9496. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9497. actionResult.Status = (int)Constant.PDAResult.Success;
  9498. }
  9499. //xuwei add 2020-03-23
  9500. //获取成型报损信息 用于撤销使用 支持 浆日报直接报损
  9501. else if ("GetGroutingScrap" == action)
  9502. {
  9503. ClientRequestEntity cre = new ClientRequestEntity();
  9504. cre.NameSpace = module;
  9505. cre.Name = action;
  9506. if (!string.IsNullOrEmpty(jsonData))
  9507. {
  9508. cre.Properties["BarCode"] = data["BarCode"];
  9509. }
  9510. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetGroutingScrap(cre, sUserInfo);
  9511. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9512. actionResult.Status = (int)Constant.PDAResult.Success;
  9513. }
  9514. // 撤销成型报损
  9515. else if ("ReverseGroutingScrapProduct" == action)
  9516. {
  9517. ClientRequestEntity cre = new ClientRequestEntity();
  9518. cre.NameSpace = module;
  9519. cre.Name = action;
  9520. if (!string.IsNullOrEmpty(jsonData))
  9521. {
  9522. cre.Properties["BarCode"] = data["BarCode"];
  9523. }
  9524. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.ReverseGroutingScrapProduct(cre, sUserInfo);
  9525. if (sre.Status == Constant.ServiceResultStatus.Success)
  9526. {
  9527. actionResult.Status = (int)Constant.PDAResult.Success;
  9528. actionResult.Result = sre.Result;
  9529. }
  9530. else
  9531. {
  9532. actionResult.Status = (int)Constant.PDAResult.Fail;
  9533. actionResult.Result = sre.OtherStatus;
  9534. actionResult.Message = sre.Message;
  9535. }
  9536. }
  9537. }
  9538. #endregion
  9539. #region 产品挂起
  9540. if (module == "ProductSuspend")
  9541. {
  9542. // 获取可以挂起的工序(干补、装车、入窑、出窑)工序不能挂起
  9543. if (action == "GetSuspendProcedure")
  9544. {
  9545. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetSuspendProcedure(sUserInfo);
  9546. if (sre.Status == Constant.ServiceResultStatus.Success)
  9547. {
  9548. actionResult.Status = (int)Constant.PDAResult.Success;
  9549. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9550. }
  9551. else
  9552. {
  9553. actionResult.Status = (int)Constant.PDAResult.Fail;
  9554. actionResult.Message = sre.Message;
  9555. }
  9556. return actionResult;
  9557. }
  9558. // 验证挂起条码
  9559. if (action == "CheckSuspendBarcode")
  9560. {
  9561. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.CheckSuspendBarcode(sUserInfo, data["barcode"] + "");
  9562. if (sre.Status == Constant.ServiceResultStatus.Success)
  9563. {
  9564. actionResult.Status = (int)Constant.PDAResult.Success;
  9565. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9566. }
  9567. else
  9568. {
  9569. actionResult.Status = (int)Constant.PDAResult.Fail;
  9570. actionResult.Message = sre.Message;
  9571. }
  9572. return actionResult;
  9573. }
  9574. // 挂起条码
  9575. if (action == "SaveSuspendProduct")
  9576. {
  9577. int[] gids = JsonHelper.FromJson<int[]>(data["groutingdailydetailids"] + "");
  9578. int[] pids = JsonHelper.FromJson<int[]>(data["procedureids"] + "");
  9579. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveSuspendProduct(sUserInfo, pids, gids, data["remarks"] + "");
  9580. if (sre.Status == Constant.ServiceResultStatus.Success)
  9581. {
  9582. actionResult.Status = (int)Constant.PDAResult.Success;
  9583. //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9584. }
  9585. else
  9586. {
  9587. actionResult.Status = (int)Constant.PDAResult.Fail;
  9588. actionResult.Message = sre.Message;
  9589. }
  9590. return actionResult;
  9591. }
  9592. // 撤销挂起条码
  9593. if (action == "DeleteSuspendProduct")
  9594. {
  9595. int[] gids = JsonHelper.FromJson<int[]>(data["groutingdailydetailids"] + "");
  9596. int[] pids = JsonHelper.FromJson<int[]>(data["procedureids"] + "");
  9597. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.DeleteSuspendProduct(sUserInfo, pids, gids);
  9598. if (sre.Status == Constant.ServiceResultStatus.Success)
  9599. {
  9600. actionResult.Status = (int)Constant.PDAResult.Success;
  9601. //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9602. }
  9603. else
  9604. {
  9605. actionResult.Status = (int)Constant.PDAResult.Fail;
  9606. actionResult.Message = sre.Message;
  9607. }
  9608. return actionResult;
  9609. }
  9610. // 查询挂起条码
  9611. if (action == "GetSuspendProduct")
  9612. {
  9613. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetSuspendProduct(sUserInfo, data["barcode"] + "");
  9614. if (sre.Status == Constant.ServiceResultStatus.Success)
  9615. {
  9616. if (sre.Data.Tables[0].Rows.Count == 0)
  9617. {
  9618. actionResult.Status = (int)Constant.PDAResult.Fail;
  9619. actionResult.Message = "此条码没有可撤销的挂起信息";
  9620. }
  9621. else
  9622. {
  9623. actionResult.Status = (int)Constant.PDAResult.Success;
  9624. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9625. }
  9626. }
  9627. else
  9628. {
  9629. actionResult.Status = (int)Constant.PDAResult.Fail;
  9630. actionResult.Message = sre.Message;
  9631. }
  9632. return actionResult;
  9633. }
  9634. }
  9635. #endregion
  9636. #region 品保抽查
  9637. if (module == "QASpotCheck")
  9638. {
  9639. if (action == "GetAllQASpotCheck")
  9640. {
  9641. ClientRequestEntity cre = new ClientRequestEntity();
  9642. cre.NameSpace = module;
  9643. cre.Name = action;
  9644. if (data != null && data.Count > 0)
  9645. {
  9646. foreach (string item in data.Keys)
  9647. {
  9648. if (item.StartsWith("checktime"))
  9649. {
  9650. cre.Properties.Add(item, DateTime.ParseExact(data[item] + "", "yyyy-MM-dd", null));
  9651. }
  9652. else
  9653. {
  9654. cre.Properties.Add(item, data[item]);
  9655. }
  9656. }
  9657. }
  9658. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetAllQASpotCheck(sUserInfo, cre));
  9659. if (sre.Status == Constant.ServiceResultStatus.Success)
  9660. {
  9661. actionResult.Status = (int)Constant.PDAResult.Success;
  9662. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9663. }
  9664. else if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  9665. {
  9666. actionResult.Status = (int)Constant.PDAResult.Success;
  9667. }
  9668. else
  9669. {
  9670. actionResult.Status = (int)Constant.PDAResult.Fail;
  9671. actionResult.Message = sre.Message;
  9672. }
  9673. return actionResult;
  9674. }
  9675. if (action == "AutoSaveQASpotCheck")
  9676. {
  9677. string barcode = data["barcode"] + "";
  9678. string remarks = data["remarks"] + "";
  9679. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.AutoSaveQASpotCheck(sUserInfo, barcode, remarks));
  9680. if (sre.Status == Constant.ServiceResultStatus.Success)
  9681. {
  9682. actionResult.Status = (int)Constant.PDAResult.Success;
  9683. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9684. }
  9685. else
  9686. {
  9687. actionResult.Status = (int)Constant.PDAResult.Fail;
  9688. actionResult.Message = sre.Message;
  9689. }
  9690. return actionResult;
  9691. }
  9692. if (action == "CheckQASpotCheck")
  9693. {
  9694. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.CheckQASpotCheck(sUserInfo, jsonData));
  9695. if (sre.Status == Constant.ServiceResultStatus.Success)
  9696. {
  9697. actionResult.Status = (int)Constant.PDAResult.Success;
  9698. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9699. }
  9700. else
  9701. {
  9702. actionResult.Status = (int)Constant.PDAResult.Fail;
  9703. actionResult.Message = sre.Message;
  9704. }
  9705. return actionResult;
  9706. }
  9707. if (action == "SaveQASpotCheck")
  9708. {
  9709. data["CheckTime"] = DateTime.ParseExact(data["CheckTime"] + "", "yyyy-MM-dd HH:mm:ss", null);
  9710. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveQASpotCheck(sUserInfo, data));
  9711. if (sre.Status == Constant.ServiceResultStatus.Success)
  9712. {
  9713. actionResult.Status = (int)Constant.PDAResult.Success;
  9714. }
  9715. else
  9716. {
  9717. actionResult.Status = (int)Constant.PDAResult.Fail;
  9718. actionResult.Message = sre.Message;
  9719. }
  9720. return actionResult;
  9721. }
  9722. return null;
  9723. }
  9724. #endregion
  9725. #region 产成品交接
  9726. if (module == "FinishedProduct")
  9727. {
  9728. #region 产成品交接、整板撤销 by fubin 20200824
  9729. // 交接验证
  9730. if (action == "FinishedHandoverBarcode")
  9731. {
  9732. string barcode = data["Barcode"] + "";
  9733. ServiceResultEntity sre = PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo);
  9734. if (sre.Data != null && sre.Data.Tables.Count > 0)
  9735. {
  9736. actionResult.Status = (int)Constant.PDAResult.Success;
  9737. actionResult.Result = JsonHelper.ToJson(sre.Data);
  9738. actionResult.Message = sre.Message;
  9739. }
  9740. else
  9741. {
  9742. actionResult.Status = (int)Constant.PDAResult.Fail;
  9743. actionResult.Message = sre.Message;
  9744. }
  9745. return actionResult;
  9746. }
  9747. // 交接操作
  9748. if (action == "SaveFinishedHandover")
  9749. {
  9750. int orderID = Convert.ToInt32(data["OrderID"]);
  9751. DataTable dt = JsonHelper.FromJson<DataTable>(data["Table"] + "");
  9752. ServiceResultEntity sre = PMModuleLogicDAL.SaveFinishedHandover(orderID, dt, sUserInfo);
  9753. if (Convert.ToInt32(sre.Result) > 0)
  9754. {
  9755. actionResult.Status = (int)Constant.PDAResult.Success;
  9756. actionResult.Message = "产成品交接成功";
  9757. }
  9758. else
  9759. {
  9760. actionResult.Status = (int)Constant.PDAResult.Fail;
  9761. actionResult.Message = sre.Message;
  9762. }
  9763. return actionResult;
  9764. }
  9765. // 撤销交接验证
  9766. if (action == "BackFinishedHandoverCheck")
  9767. {
  9768. string barcode = data["Barcode"] + "";
  9769. ServiceResultEntity sre = PMModuleLogic.BackFinishedHandoverCheck(barcode, sUserInfo);
  9770. if (sre.Data != null && sre.Data.Tables.Count > 0)
  9771. {
  9772. actionResult.Status = (int)Constant.PDAResult.Success;
  9773. actionResult.Result = JsonHelper.ToJson(sre.Data);
  9774. actionResult.Message = sre.Message;
  9775. }
  9776. else
  9777. {
  9778. actionResult.Status = (int)Constant.PDAResult.Fail;
  9779. actionResult.Message = sre.Message;
  9780. }
  9781. return actionResult;
  9782. }
  9783. // 撤销交接操作
  9784. if (action == "BackFinishedHandover")
  9785. {
  9786. DataTable dt = JsonHelper.FromJson<DataTable>(data["Table"] + "");
  9787. ServiceResultEntity sre = PMModuleLogicDAL.BackFinishedHandover(dt, sUserInfo);
  9788. if (Convert.ToInt32(sre.Result) > 0)
  9789. {
  9790. actionResult.Status = (int)Constant.PDAResult.Success;
  9791. actionResult.Message = "产成品撤销交接成功";
  9792. }
  9793. else
  9794. {
  9795. actionResult.Status = (int)Constant.PDAResult.Fail;
  9796. actionResult.Message = sre.Message;
  9797. }
  9798. return actionResult;
  9799. }
  9800. #endregion
  9801. // 设定商标
  9802. if (action == "GetFinishedBarcode")
  9803. {
  9804. string barcode = data["barcode"].ToString();
  9805. ServiceResultEntity resultEntity = PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo, 2);
  9806. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9807. if (Convert.ToInt32(resultEntity.Result) < 0)
  9808. {
  9809. actionResult.Status = (int)Constant.PDAResult.Fail;
  9810. actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
  9811. actionResult.Message = resultEntity.Message;
  9812. }
  9813. else
  9814. {
  9815. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9816. actionResult.Status = (int)Constant.PDAResult.Success;
  9817. actionResult.Message = resultEntity.Message;
  9818. }
  9819. return actionResult;
  9820. }
  9821. if (action == "GetHandoveredBarcode")
  9822. {
  9823. string barcode = data["barcode"].ToString();
  9824. ServiceResultEntity resultEntity = PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo, 1);
  9825. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9826. if (Convert.ToInt32(resultEntity.Result) < 0)
  9827. {
  9828. actionResult.Status = (int)Constant.PDAResult.Fail;
  9829. actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
  9830. actionResult.Message = resultEntity.Message;
  9831. }
  9832. else
  9833. {
  9834. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9835. actionResult.Status = (int)Constant.PDAResult.Success;
  9836. actionResult.Message = resultEntity.Message;
  9837. }
  9838. return actionResult;
  9839. }
  9840. if (action == "SetFinishedLogo")
  9841. {
  9842. int logoid = Convert.ToInt32(data["logoid"]);
  9843. string[] barcodes = data["barcodes"].ToString().Split(',');
  9844. int result = PMModuleLogicDAL.SetFinishedLogo(barcodes, logoid, sUserInfo);
  9845. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9846. if (result < 0)
  9847. {
  9848. actionResult.Status = (int)Constant.PDAResult.Fail;
  9849. }
  9850. else
  9851. {
  9852. actionResult.Status = (int)Constant.PDAResult.Success;
  9853. }
  9854. return actionResult;
  9855. }
  9856. if (action == "SetHandoveredOrder")
  9857. {
  9858. int orderID = Convert.ToInt32(data["orderID"]);
  9859. string[] barcodes = data["barcodes"].ToString().Split(',');
  9860. int result = PMModuleLogicDAL.SetHandoveredOrder(barcodes, orderID, sUserInfo);
  9861. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9862. if (result < 0)
  9863. {
  9864. actionResult.Status = (int)Constant.PDAResult.Fail;
  9865. }
  9866. else
  9867. {
  9868. actionResult.Status = (int)Constant.PDAResult.Success;
  9869. }
  9870. return actionResult;
  9871. }
  9872. }
  9873. #endregion
  9874. #region 产成品装车
  9875. /*
  9876. if (module == "FinishedLoading")
  9877. {
  9878. // 设定商标
  9879. if (action == "GetMaxLoadingNo")
  9880. {
  9881. int no = Service.PMModuleService.PMModuleLogic.GetMaxLoadingNo(sUserInfo);
  9882. actionResult.Status = (int)Constant.PDAResult.Success;
  9883. actionResult.Result = no;
  9884. return actionResult;
  9885. }
  9886. if (action == "CheckFinishedLaodingBarcode")
  9887. {
  9888. string barcode = data["barcode"].ToString();
  9889. ServiceResultEntity resultEntity = Service.PMModuleService.PMModuleLogic.CheckFinishedLaodingBarcode(sUserInfo, barcode);
  9890. if (resultEntity.Status == Constant.ServiceResultStatus.Success)
  9891. {
  9892. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9893. actionResult.Status = (int)Constant.PDAResult.Success;
  9894. actionResult.Message = resultEntity.Message;
  9895. }
  9896. else
  9897. {
  9898. actionResult.Status = (int)Constant.PDAResult.Fail;
  9899. actionResult.Result = resultEntity.OtherStatus;
  9900. actionResult.Message = resultEntity.Message;
  9901. }
  9902. return actionResult;
  9903. }
  9904. if (action == "SaveFinishedLoading")
  9905. {
  9906. int loadingNo = Convert.ToInt32(data["loadingNo"]);
  9907. string carLicense = data["carLicense"] + "";
  9908. int palletNum = Convert.ToInt32(data["palletNum"]);
  9909. int goodsNum = Convert.ToInt32(data["goodsNum"]);
  9910. string remarks = data["remarks"] + "";
  9911. Dictionary<string, object>[] details =
  9912. JsonHelper.FromJson<Dictionary<string, object>[]>(data["details"] + "");
  9913. //"[{\"A\":1,\"B\":\"V\"},{\"A\":2,\"B\":\"V1\"}]"
  9914. ServiceResultEntity result = Service.PMModuleService.PMModuleLogic.SaveFinishedLoading(sUserInfo,
  9915. loadingNo, carLicense, palletNum, goodsNum, remarks, details);
  9916. if (result.Status == Constant.ServiceResultStatus.Success)
  9917. {
  9918. actionResult.Status = (int)Constant.PDAResult.Success;
  9919. actionResult.Message = result.Message;
  9920. }
  9921. else
  9922. {
  9923. actionResult.Status = (int)Constant.PDAResult.Fail;
  9924. actionResult.Result = result.OtherStatus;
  9925. actionResult.Message = result.Message;
  9926. }
  9927. return actionResult;
  9928. }
  9929. }
  9930. */
  9931. #endregion
  9932. #region 产成品质量改判
  9933. if (module == "FinishedProductTamper")
  9934. {
  9935. // 获取产成品信息及缺陷数据
  9936. if (action == "GetDefectData")
  9937. {
  9938. string barcode = data["barcode"].ToString();
  9939. ServiceResultEntity sre = PDAModuleLogic.GetDefectData(barcode, sUserInfo);
  9940. if (sre.Status == Constant.ServiceResultStatus.Success)
  9941. {
  9942. actionResult.Status = (int)Constant.PDAResult.Success;
  9943. actionResult.Result = JsonHelper.ToJson(sre.Result);
  9944. actionResult.Message = sre.Message;
  9945. }
  9946. else
  9947. {
  9948. actionResult.Status = (int)Constant.PDAResult.Fail;
  9949. actionResult.Result = sre.OtherStatus;
  9950. actionResult.Message = sre.Message;
  9951. }
  9952. return actionResult;
  9953. }
  9954. // 获取产成品信息及缺陷数据
  9955. if (action == "SaveDefectData")
  9956. {
  9957. ProductionDataEntity productionDataEntity = JsonHelper.FromJson<ProductionDataEntity>(data["ProductionDataEntity"] + "");
  9958. ServiceResultEntity sre = PDAModuleLogic.SaveDefectData(productionDataEntity, sUserInfo);
  9959. if (sre.Status == Constant.ServiceResultStatus.Success)
  9960. {
  9961. actionResult.Status = (int)Constant.PDAResult.Success;
  9962. actionResult.Message = sre.Message;
  9963. }
  9964. else
  9965. {
  9966. actionResult.Status = (int)Constant.PDAResult.Fail;
  9967. actionResult.Message = sre.Message;
  9968. }
  9969. return actionResult;
  9970. }
  9971. // 通过条码查出责任工序(成品改判用)
  9972. if (action == "GetDutyProcedureByBarCodeForTamper")
  9973. {
  9974. string barcode = data["barcode"] + "";
  9975. int defectid = int.Parse(data["defectid"] + "");
  9976. ServiceResultEntity sre = PDAModuleLogic.GetDutyProcedureByBarCodeForTamper(barcode, defectid, sUserInfo.AccountID);
  9977. if (sre.Status == Constant.ServiceResultStatus.Success)
  9978. {
  9979. actionResult.Status = (int)Constant.PDAResult.Success;
  9980. actionResult.Result = JsonHelper.ToJson(sre.Data);
  9981. actionResult.Message = sre.Message;
  9982. }
  9983. else
  9984. {
  9985. actionResult.Status = (int)Constant.PDAResult.Fail;
  9986. actionResult.Result = sre.OtherStatus;
  9987. actionResult.Message = sre.Message;
  9988. }
  9989. return actionResult;
  9990. }
  9991. }
  9992. #endregion
  9993. #region PDA独立功能
  9994. #region 水效标识
  9995. if (module == "WaterEffect")
  9996. {
  9997. // 获取产成品信息及水效标识
  9998. if (action == "GetGoodsByBarCode")
  9999. {
  10000. string barcode = data["barcode"].ToString();
  10001. ServiceResultEntity sre = PDAModuleLogic.GetGoodsByBarCode(barcode, sUserInfo);
  10002. if (sre.Status == Constant.ServiceResultStatus.Success)
  10003. {
  10004. actionResult.Status = (int)Constant.PDAResult.Success;
  10005. actionResult.Result = JsonHelper.ToJson(sre.Result);
  10006. actionResult.Message = sre.Message;
  10007. }
  10008. else
  10009. {
  10010. actionResult.Status = (int)Constant.PDAResult.Fail;
  10011. actionResult.Result = sre.OtherStatus;
  10012. actionResult.Message = sre.Message;
  10013. }
  10014. return actionResult;
  10015. }
  10016. }
  10017. #endregion
  10018. #region 盖板型号
  10019. if (module == "SeatCoverType")
  10020. {
  10021. // 获取产成品信息及水效标识
  10022. if (action == "SendGoodsCodeToPLC")
  10023. {
  10024. string barcode = data["barcode"].ToString();
  10025. int sre = PLCModuleLogic.SendGoodsCodeToPLCBySeatCover(barcode, sUserInfo);
  10026. if (sre == 0)
  10027. {
  10028. actionResult.Status = (int)Constant.PDAResult.Success;
  10029. }
  10030. else
  10031. {
  10032. actionResult.Status = (int)Constant.PDAResult.Fail;
  10033. actionResult.Result = sre;
  10034. switch (sre)
  10035. {
  10036. case 1:
  10037. case 2:
  10038. actionResult.Message = "无效条码";
  10039. break;
  10040. case 3:
  10041. actionResult.Message = "此产品型号没有设置盖板标识码";
  10042. break;
  10043. case 4:
  10044. actionResult.Message = "当前用户没有设置PLC参数";
  10045. break;
  10046. case 5:
  10047. actionResult.Message = "PLC参数设置不全";
  10048. break;
  10049. default:
  10050. actionResult.Message = "PLC通信异常";
  10051. break;
  10052. }
  10053. }
  10054. return actionResult;
  10055. }
  10056. }
  10057. #endregion
  10058. #region PDA PLC 相关功能
  10059. if (module == "PDA_FUN_PLC")
  10060. {
  10061. // PDA扫码发送到PLCServer
  10062. if (action == "SendBarcodeToPLCServer")
  10063. {
  10064. string barcode = data["barcode"].ToString();
  10065. int sre = PLCModuleLogic.SendBarcodeToPLCServer(barcode, sUserInfo);
  10066. if (sre == 0)
  10067. {
  10068. actionResult.Status = (int)Constant.PDAResult.Success;
  10069. }
  10070. else
  10071. {
  10072. actionResult.Status = (int)Constant.PDAResult.Fail;
  10073. actionResult.Result = sre;
  10074. switch (sre)
  10075. {
  10076. case 1:
  10077. case 2:
  10078. actionResult.Message = "无效条码";
  10079. break;
  10080. case 3:
  10081. actionResult.Message = "PLC通信异常";
  10082. break;
  10083. case 4:
  10084. actionResult.Message = "当前用户没有设置PLC参数";
  10085. break;
  10086. case 5:
  10087. actionResult.Message = "PLC参数设置不全";
  10088. break;
  10089. default:
  10090. actionResult.Message = "PLC通信异常";
  10091. break;
  10092. }
  10093. }
  10094. return actionResult;
  10095. }
  10096. }
  10097. #endregion
  10098. #endregion
  10099. #region 半检返修
  10100. if (module == "SemiRework")
  10101. {
  10102. // 验证半检返修条码
  10103. if (action == "CheckSemiReworkBarcode")
  10104. {
  10105. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10106. PMModuleLogic.CheckSemiReworkBarcode(jsonData);
  10107. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  10108. if (Convert.ToInt32(resultEntity.Result) < 0)
  10109. {
  10110. actionResult.Status = (int)Constant.PDAResult.Fail;
  10111. }
  10112. else
  10113. {
  10114. actionResult.Status = (int)Constant.PDAResult.Success;
  10115. }
  10116. actionResult.Message = resultEntity.Message;
  10117. return actionResult;
  10118. }
  10119. // 可以返修的工序
  10120. if (action == "GetSemiReworkProcedure")
  10121. {
  10122. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10123. PMModuleLogic.GetSemiReworkProcedure(jsonData, sUserInfo);
  10124. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  10125. actionResult.Status = (int)Constant.PDAResult.Success;
  10126. return actionResult;
  10127. }
  10128. // 根据条码获取经过的工序,用于责任工序
  10129. if (action == "GetSemiReworkPassProcedure")
  10130. {
  10131. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10132. PMModuleLogic.GetSemiReworkPassProcedure(jsonData);
  10133. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  10134. actionResult.Status = (int)Constant.PDAResult.Success;
  10135. return actionResult;
  10136. }
  10137. // 根据所选生产工序(生产数据ID)查询责任员工
  10138. if (action == "GetSemiReworkDefectStaffByProductionDataID")
  10139. {
  10140. int productionDataID = Convert.ToInt32(jsonData);
  10141. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10142. PMModuleLogic.GetSemiReworkDefectStaffByProductionDataID(productionDataID);
  10143. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  10144. actionResult.Status = (int)Constant.PDAResult.Success;
  10145. return actionResult;
  10146. }
  10147. // 根据所选工号,查出缺陷责任员工
  10148. if (action == "GetSemiReworkDefectStaffByUserID")
  10149. {
  10150. int userID = Convert.ToInt32(jsonData);
  10151. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10152. PMModuleLogic.GetSemiReworkDefectStaffByUserID(userID);
  10153. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  10154. actionResult.Status = (int)Constant.PDAResult.Success;
  10155. return actionResult;
  10156. }
  10157. // 新建半检返修
  10158. if (action == "AddSemiRework")
  10159. {
  10160. SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"]+"");
  10161. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10162. PMModuleLogic.AddSemiRework(entity, sUserInfo);
  10163. actionResult.Result = resultEntity.Result;
  10164. actionResult.Message = resultEntity.Message;
  10165. if (Convert.ToInt32(resultEntity.Result) > 0)
  10166. {
  10167. actionResult.Status = (int)Constant.PDAResult.Success;
  10168. }
  10169. else
  10170. {
  10171. actionResult.Status = (int)Constant.PDAResult.Fail;
  10172. }
  10173. return actionResult;
  10174. }
  10175. // 编辑半检返修
  10176. if (action == "EditSemiRework")
  10177. {
  10178. SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"] + "");
  10179. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10180. PMModuleLogic.EditSemiRework(entity, sUserInfo);
  10181. actionResult.Result = resultEntity.Result;
  10182. actionResult.Message = resultEntity.Message;
  10183. if (Convert.ToInt32(resultEntity.Result) > 0)
  10184. {
  10185. actionResult.Status = (int)Constant.PDAResult.Success;
  10186. }
  10187. else
  10188. {
  10189. actionResult.Status = (int)Constant.PDAResult.Fail;
  10190. }
  10191. return actionResult;
  10192. }
  10193. // 撤销半检返修
  10194. if (action == "CancelSemiRework")
  10195. {
  10196. SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"] + "");
  10197. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10198. PMModuleLogic.CancelSemiRework(entity, sUserInfo);
  10199. actionResult.Result = resultEntity.Result;
  10200. actionResult.Message = resultEntity.Message;
  10201. if (Convert.ToInt32(resultEntity.Result) > 0)
  10202. {
  10203. actionResult.Status = (int)Constant.PDAResult.Success;
  10204. }
  10205. else
  10206. {
  10207. actionResult.Status = (int)Constant.PDAResult.Fail;
  10208. }
  10209. return actionResult;
  10210. }
  10211. // 获取半检返修数据(PDA编辑用)
  10212. if (action == "GetSemiReworkByID")
  10213. {
  10214. int id = Convert.ToInt32(jsonData);
  10215. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10216. PMModuleLogic.GetSemiReworkByID(id,sUserInfo.UserCode);
  10217. DataTable data1 = resultEntity.Data.Tables[0];
  10218. DataTable data2 = resultEntity.Data.Tables[1];
  10219. DataTable data3 = resultEntity.Data.Tables[2];
  10220. if (data1.Rows.Count == 0)
  10221. {
  10222. actionResult.Status = (int)Constant.PDAResult.Fail;
  10223. actionResult.Message = "半检返修信息不存在";
  10224. return actionResult;
  10225. }
  10226. SemiReworkEntity srEntity = new SemiReworkEntity();
  10227. srEntity.SemiReworkID = id;
  10228. srEntity.BarCode = data1.Rows[0]["BarCode"] + "";
  10229. srEntity.ReworkProcedureID = Convert.ToInt32(data1.Rows[0]["ReworkProcedureID"]);
  10230. srEntity.Remarks = data1.Rows[0]["Remarks"] + "";
  10231. srEntity.SemiReworkDefects = new List<SemiReworkDefectEntity>();
  10232. foreach (DataRow row2 in data2.Rows)
  10233. {
  10234. SemiReworkDefectEntity defectEntity = new SemiReworkDefectEntity();
  10235. srEntity.SemiReworkDefects.Add(defectEntity);
  10236. defectEntity.SemiReworkDefectID = Convert.ToInt32(row2["SemiReworkDefectID"]);
  10237. defectEntity.SemiReworkID = id;
  10238. defectEntity.DefectID = Convert.ToInt32(row2["DefectID"]);
  10239. defectEntity.DefectCode = row2["DefectCode"] + "";
  10240. defectEntity.DefectName = row2["DefectName"] + "";
  10241. defectEntity.DefectPositionID = Convert.ToInt32(row2["DefectPositionID"]);
  10242. defectEntity.DefectPositionCode = row2["DefectPositionCode"] + "";
  10243. defectEntity.DefectPositionName = row2["DefectPositionName"] + "";
  10244. defectEntity.ScrapResponFlag = row2["ScrapResponFlag"] + "";
  10245. defectEntity.DefectProductionDataID = row2["DefectProductionDataID"].ToNullableInt32();
  10246. defectEntity.DefectProcedureID = row2["DefectProcedureID"].ToNullableInt32();
  10247. defectEntity.DefectProcedureCode = row2["DefectProcedureCode"] + "";
  10248. defectEntity.DefectProcedureName = row2["DefectProcedureName"] + "";
  10249. defectEntity.Remarks = row2["Remarks"] + "";
  10250. defectEntity.DefectUserID = Convert.ToInt32(row2["DefectUserID"]);
  10251. defectEntity.DefectUserCode = row2["DefectUserCode"] + "";
  10252. defectEntity.DefectUserName = row2["DefectUserName"] + "";
  10253. defectEntity.DefectResponsibles = new List<SemiReworkRPSEntity>();
  10254. defectEntity.ValueFlag = Convert.ToInt32(row2["ValueFlag"]);
  10255. DataRow[] row3s = data3.Select("SemiReworkDefectID=" + defectEntity.SemiReworkDefectID);
  10256. if (row3s.Length == 0)
  10257. {
  10258. continue;
  10259. }
  10260. foreach (DataRow row3 in row3s)
  10261. {
  10262. SemiReworkRPSEntity semiReworkRPS = new SemiReworkRPSEntity();
  10263. defectEntity.DefectResponsibles.Add(semiReworkRPS);
  10264. semiReworkRPS.SemiReworkDefectID = Convert.ToInt32(row3["SemiReworkDefectID"]);
  10265. semiReworkRPS.StaffID = Convert.ToInt32(row3["StaffID"]);
  10266. semiReworkRPS.StaffName = row3["StaffName"] + "";
  10267. semiReworkRPS.StaffCode = row3["StaffCode"] + "";
  10268. semiReworkRPS.SemiReworkID = Convert.ToInt32(row3["SemiReworkID"]);
  10269. semiReworkRPS.UserID = Convert.ToInt32(row3["UserID"]);
  10270. semiReworkRPS.UserCode = row3["UserCode"] + "";
  10271. semiReworkRPS.UJobsID = Convert.ToInt32(row3["UJobsID"]);
  10272. semiReworkRPS.SJobsID = Convert.ToInt32(row3["SJobsID"]);
  10273. }
  10274. }
  10275. //xuwei note 总单用于显示,信息较全
  10276. actionResult.Message = JsonHelper.ToJson(data1);
  10277. //xuwei note 总单信息不全,但有明细,用于回传保存
  10278. actionResult.Result = JsonHelper.ToJson(srEntity);
  10279. actionResult.Status = (int)Constant.PDAResult.Success;
  10280. }
  10281. }
  10282. #endregion
  10283. #region 窑车漏扫补件
  10284. if (module == "F_PM_0504")
  10285. {
  10286. // 验证窑车编码是否存在
  10287. if (action == "CheckKilnCar")
  10288. {
  10289. ClientRequestEntity cre = new ClientRequestEntity();
  10290. cre.Properties["kilncarcode"] = data["KilnCarCode"];
  10291. cre.Properties["procedureID"] = data["ProcedureID"];
  10292. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.CheckKilnCar(cre, sUserInfo);
  10293. if (sre.Status == Constant.ServiceResultStatus.Success)
  10294. {
  10295. actionResult.Status = (int)Constant.PDAResult.Success;
  10296. actionResult.Result = sre.Result;
  10297. }
  10298. else
  10299. {
  10300. actionResult.Status = (int)Constant.PDAResult.Fail;
  10301. actionResult.Message = sre.Message;
  10302. }
  10303. return actionResult;
  10304. }
  10305. // 验证窑车烧成批次号是否存在 和 是否能补漏扫
  10306. if (action == "CheckKilnCarBatchNo")
  10307. {
  10308. ClientRequestEntity cre = new ClientRequestEntity();
  10309. cre.Properties["KilnID"] = data["KilnID"];
  10310. cre.Properties["KilnCarID"] = data["KilnCarID"];
  10311. cre.Properties["ProcedureID"] = data["ProcedureID"];
  10312. cre.Properties["KilnCarBatchNo"] = data["KilnCarBatchNo"];
  10313. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.CheckKilnCarBatchNo(cre, sUserInfo);
  10314. if (sre.Status == Constant.ServiceResultStatus.Success)
  10315. {
  10316. actionResult.Status = (int)Constant.PDAResult.Success;
  10317. }
  10318. else
  10319. {
  10320. actionResult.Status = (int)Constant.PDAResult.Fail;
  10321. actionResult.Message = sre.Message;
  10322. }
  10323. return actionResult;
  10324. }
  10325. // 窑车漏扫补件
  10326. if (action == "SetKilnCarMissing")
  10327. {
  10328. ClientRequestEntity cre = new ClientRequestEntity();
  10329. cre.Properties["KilnCarBatchNo"] = data["KilnCarBatchNo"];
  10330. string carData = data["CarData"] + "";
  10331. DataTable dataTable = JsonHelper.FromJson<DataTable>(carData);
  10332. cre.Data = new DataSet();
  10333. cre.Data.Tables.Add(dataTable);
  10334. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.SetKilnCarMissing(cre, sUserInfo);
  10335. if (sre.Status == Constant.ServiceResultStatus.Success)
  10336. {
  10337. actionResult.Status = (int)Constant.PDAResult.Success;
  10338. }
  10339. else
  10340. {
  10341. actionResult.Status = (int)Constant.PDAResult.Fail;
  10342. actionResult.Message = sre.Message;
  10343. }
  10344. return actionResult;
  10345. }
  10346. }
  10347. #endregion
  10348. #region 工厂调出功能
  10349. if (module == "F_PM_3302")
  10350. {
  10351. // 工厂调出条码验证
  10352. if (action == "CheckAllocateOut")
  10353. {
  10354. ServiceResultEntity sre = PDAModuleLogic.CheckAllocateOut(
  10355. data["Barcode"] + "", Convert.ToInt32(data["OutFlag"]), sUserInfo);
  10356. if (sre.Data != null)
  10357. {
  10358. actionResult.Status = (int)Constant.PDAResult.Success;
  10359. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  10360. }
  10361. else{
  10362. actionResult.Status = (int)Constant.PDAResult.Fail;
  10363. actionResult.Message = sre.Message;
  10364. }
  10365. return actionResult;
  10366. }
  10367. // 保存工厂调出
  10368. if (action == "SaveAllocateOut")
  10369. {
  10370. ClientRequestEntity cre = new ClientRequestEntity();
  10371. cre.Properties["rreason"] = data["Rreason"];
  10372. cre.Properties["remarks"] = data["Remarks"];
  10373. DataTable dtAllocateOutData = JsonHelper.FromJson<DataTable>(data["AllocateOutData"] + "");
  10374. cre.Data = new DataSet();
  10375. cre.Data.Tables.Add(dtAllocateOutData);
  10376. ServiceResultEntity sre = PDAModuleLogic.SaveAllocateOut(cre, sUserInfo);
  10377. if (sre.OtherStatus > 0)
  10378. {
  10379. actionResult.Status = (int)Constant.PDAResult.Success;
  10380. }
  10381. else
  10382. {
  10383. actionResult.Status = (int)Constant.PDAResult.Fail;
  10384. actionResult.Message = sre.Message;
  10385. }
  10386. return actionResult;
  10387. }
  10388. // 撤销工厂调出
  10389. if (action == "CancelAllocateOut")
  10390. {
  10391. ClientRequestEntity cre = new ClientRequestEntity();
  10392. DataTable dtAllocateOutData = JsonHelper.FromJson<DataTable>(data["AllocateOutData"] + "");
  10393. cre.Data = new DataSet();
  10394. cre.Data.Tables.Add(dtAllocateOutData);
  10395. ServiceResultEntity sre = PDAModuleLogic.CancelAllocateOut(cre, sUserInfo);
  10396. if (sre.OtherStatus > 0)
  10397. {
  10398. actionResult.Status = (int)Constant.PDAResult.Success;
  10399. }
  10400. else
  10401. {
  10402. actionResult.Status = (int)Constant.PDAResult.Fail;
  10403. actionResult.Message = sre.Message;
  10404. }
  10405. return actionResult;
  10406. }
  10407. }
  10408. #endregion
  10409. #region 工位打卡
  10410. if (module == "01020601")
  10411. {
  10412. // 获取工号工位
  10413. if (action == "GetUserWorkStation")
  10414. {
  10415. ServiceResultEntity sre = SystemModuleLogic.GetUserWorkStation(sUserInfo);
  10416. if (!string.IsNullOrEmpty(sre.Message))
  10417. {
  10418. actionResult.Status = (int)Constant.PDAResult.Fail;
  10419. actionResult.Message = sre.Message;
  10420. }
  10421. else
  10422. {
  10423. actionResult.Status = (int)Constant.PDAResult.Success;
  10424. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  10425. }
  10426. return actionResult;
  10427. }
  10428. // 工号工位打卡
  10429. if (action == "SaveUserWorkStation")
  10430. {
  10431. ServiceResultEntity sre = SystemModuleLogic.SaveUserWorkStation(Convert.ToInt32(data["WorkStationID"]), sUserInfo);
  10432. if (sre.OtherStatus > 0)
  10433. {
  10434. actionResult.Status = (int)Constant.PDAResult.Success;
  10435. }
  10436. else
  10437. {
  10438. actionResult.Status = (int)Constant.PDAResult.Fail;
  10439. actionResult.Message = sre.Message;
  10440. }
  10441. return actionResult;
  10442. }
  10443. }
  10444. #endregion
  10445. return actionResult;
  10446. }
  10447. catch (Exception ex)
  10448. {
  10449. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  10450. OutputLog.TraceLog(LogPriority.Error,
  10451. this.ToString(),
  10452. System.Reflection.MethodBase.GetCurrentMethod().Name + System.Environment.NewLine +
  10453. JsonHelper.ToJson(sUserInfo) + System.Environment.NewLine +
  10454. " module:" + module + " action:" + action + " json:" + jsonData,
  10455. ex.ToString(),
  10456. LocalPath.LogExePath);
  10457. actionResult.Status = (int)Constant.PDAResult.Exception;
  10458. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  10459. }
  10460. return actionResult;
  10461. }
  10462. #endregion
  10463. }
  10464. }