PDAModuleService.cs 585 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556
  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 Dongke.IBOSS.PRD.Basics.BaseResources;
  17. using Dongke.IBOSS.PRD.Basics.Library;
  18. using Dongke.IBOSS.PRD.Service.BarcodePrintService;
  19. using Dongke.IBOSS.PRD.Service.CommonModuleLogic;
  20. using Dongke.IBOSS.PRD.Service.DataModels;
  21. using Dongke.IBOSS.PRD.Service.DKIBOSSPRDLogic;
  22. using Dongke.IBOSS.PRD.Service.PCModuleLogic;
  23. using Dongke.IBOSS.PRD.Service.PDAModuleLogic;
  24. using Dongke.IBOSS.PRD.Service.PMModuleLogic;
  25. using Dongke.IBOSS.PRD.Service.PublicModuleService;
  26. using Dongke.IBOSS.PRD.Service.ReportModuleLogic;
  27. using Dongke.IBOSS.PRD.Service.SmartDeviceService;
  28. using Dongke.IBOSS.PRD.Service.SystemModuleLogic;
  29. using Dongke.IBOSS.PRD.WCF.Contracts;
  30. using Dongke.IBOSS.PRD.WCF.DataModels;
  31. using Dongke.IBOSS.PRD.WCF.DataModels.ConfigModule;
  32. using Dongke.IBOSS.PRD.WCF.DataModels.HRModule;
  33. using Dongke.IBOSS.PRD.WCF.DataModels.PCModule;
  34. using Dongke.IBOSS.PRD.WCF.DataModels.PDAModule;
  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, bool isNewCheck)
  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. if (isNewCheck)
  465. {
  466. actionResult.Result = JsonHelper.ToJson(barcodeDataSet);
  467. }
  468. else
  469. {
  470. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  471. }
  472. actionResult.Status = (int)Constant.PDAResult.Success;
  473. }
  474. else
  475. {
  476. actionResult.Status = (int)Constant.PDAResult.Fail;
  477. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  478. }
  479. }
  480. catch (Exception ex)
  481. {
  482. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  483. OutputLog.TraceLog(LogPriority.Error,
  484. this.ToString(),
  485. System.Reflection.MethodBase.GetCurrentMethod().Name,
  486. ex.ToString(),
  487. LocalPath.LogExePath);
  488. actionResult.Status = (int)Constant.PDAResult.Exception;
  489. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  490. }
  491. return actionResult;
  492. }
  493. /// <summary>
  494. /// 校验产品条码是否可以进行干补
  495. /// </summary>
  496. /// <param name="accountCode">帐套code</param>
  497. /// <param name="userCode">用户code</param>
  498. /// <param name="userPassword">用户密码</param>
  499. /// <param name="sessionKey">本次登陆密钥</param>
  500. /// <param name="procedureID">工序ID</param>
  501. /// <param name="barcode">条码</param>
  502. /// <returns></returns>
  503. /// <remarks>
  504. /// 袁新成 2015.4.1 新建
  505. /// </remarks>
  506. public ActionResult CheckDryRepairBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  507. {
  508. ActionResult actionResult = new ActionResult();
  509. try
  510. {
  511. // 验证请求头信息
  512. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  513. // 验证失败
  514. if (actionResult.Status != (int)Constant.PDAResult.Success)
  515. {
  516. return actionResult;
  517. }
  518. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  519. () => PMModuleLogic.CheckDryRepairBarcode(procedureID, barcode, sUserInfo));
  520. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  521. {
  522. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  523. actionResult.Status = (int)Constant.PDAResult.Success;
  524. }
  525. else
  526. {
  527. actionResult.Status = (int)Constant.PDAResult.Fail;
  528. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  529. }
  530. }
  531. catch (Exception ex)
  532. {
  533. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  534. OutputLog.TraceLog(LogPriority.Error,
  535. this.ToString(),
  536. System.Reflection.MethodBase.GetCurrentMethod().Name,
  537. ex.ToString(),
  538. LocalPath.LogExePath);
  539. actionResult.Status = (int)Constant.PDAResult.Exception;
  540. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  541. }
  542. return actionResult;
  543. }
  544. /// <summary>
  545. /// 检验生产工号
  546. /// </summary>
  547. /// <param name="accountCode">帐套code</param>
  548. /// <param name="userCode">用户code</param>
  549. /// <param name="userPassword">用户密码</param>
  550. /// <param name="sessionKey">本次登陆密钥</param>
  551. /// <param name="procedureID">工序ID</param>
  552. /// <param name="procedureUserCode">生产工号</param>
  553. /// <remarks>
  554. /// 陈冰 2014.09.18 新建
  555. /// </remarks>
  556. public ActionResult CheckProcedureUser(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string procedureUserCode)
  557. {
  558. ActionResult actionResult = new ActionResult();
  559. try
  560. {
  561. // 验证请求头信息
  562. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  563. // 验证失败
  564. if (actionResult.Status != (int)Constant.PDAResult.Success)
  565. {
  566. return actionResult;
  567. }
  568. CheckProcedureUserResult checkProcedureUserResult = ServiceInvoker.Invoke<CheckProcedureUserResult>(this,
  569. () => PMModuleLogic.CheckProcedureUser(procedureID, procedureUserCode, sUserInfo));
  570. actionResult.Result = JsonHelper.ToJson(checkProcedureUserResult);
  571. actionResult.Status = (int)Constant.PDAResult.Success;
  572. }
  573. catch (Exception ex)
  574. {
  575. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  576. OutputLog.TraceLog(LogPriority.Error,
  577. this.ToString(),
  578. System.Reflection.MethodBase.GetCurrentMethod().Name,
  579. ex.ToString(),
  580. LocalPath.LogExePath);
  581. actionResult.Status = (int)Constant.PDAResult.Exception;
  582. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  583. }
  584. return actionResult;
  585. }
  586. /// <summary>
  587. /// 校验窑车是否可装车并返回窑车信息
  588. /// </summary>
  589. /// <param name="accountCode">帐套code</param>
  590. /// <param name="userCode">用户code</param>
  591. /// <param name="userPassword">用户密码</param>
  592. /// <param name="sessionKey">本次登陆密钥</param>
  593. /// <param name="kilnCarCode">窑车号</param>
  594. /// <param name="modelType">工序类别</param>
  595. /// <returns></returns>
  596. /// <remarks>
  597. /// 陈冰 2014.10.04 新建
  598. /// </remarks>
  599. public ActionResult CheckKilnCar(string accountCode, string userCode, string userPassword, string sessionKey, int pProcedureId, string kilnCarCode, int modelType)
  600. {
  601. ActionResult actionResult = new ActionResult();
  602. try
  603. {
  604. // 验证请求头信息
  605. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  606. // 验证失败
  607. if (actionResult.Status != (int)Constant.PDAResult.Success)
  608. {
  609. return actionResult;
  610. }
  611. CheckKilnCarResultEntity checkKilnCarResultEntity = ServiceInvoker.Invoke<CheckKilnCarResultEntity>(this,
  612. () => PMModuleLogic.CheckKilnCar(pProcedureId, kilnCarCode, modelType, sUserInfo));
  613. actionResult.Result = JsonHelper.ToJson(checkKilnCarResultEntity);
  614. actionResult.Status = (int)Constant.PDAResult.Success;
  615. }
  616. catch (Exception ex)
  617. {
  618. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  619. OutputLog.TraceLog(LogPriority.Error,
  620. this.ToString(),
  621. System.Reflection.MethodBase.GetCurrentMethod().Name,
  622. ex.ToString(),
  623. LocalPath.LogExePath);
  624. actionResult.Status = (int)Constant.PDAResult.Exception;
  625. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  626. }
  627. return actionResult;
  628. }
  629. #endregion
  630. #region 保存条码信息
  631. /// <summary>
  632. /// 保存条码信息
  633. /// </summary>
  634. /// <param name="accountCode">帐套code</param>
  635. /// <param name="userCode">用户code</param>
  636. /// <param name="userPassword">用户密码</param>
  637. /// <param name="sessionKey">本次登陆密钥</param>
  638. /// <param name="procedureID">工序ID</param>
  639. /// <param name="productionDataEntitys">条码信息</param>
  640. public ActionResult AddWorkPiece(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID,
  641. ProductionDataEntity[] productionDataEntitys)
  642. {
  643. ActionResult actionResult = new ActionResult();
  644. try
  645. {
  646. // 验证请求头信息
  647. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  648. // 验证失败
  649. if (actionResult.Status != (int)Constant.PDAResult.Success)
  650. {
  651. return actionResult;
  652. }
  653. DataTable dtProductionData = DataConvert.ObjectConvertToTable<ProductionDataEntity>(productionDataEntitys);
  654. if (!dtProductionData.Columns.Contains("IsPDA"))
  655. {
  656. dtProductionData.Columns.Add("IsPDA");
  657. }
  658. ProcedureEntity procedureInfo = null;
  659. DataTable resultDT = ServiceInvoker.Invoke<DataTable>(this,
  660. () => PMModuleLogicDAL.AddWorkPiece(procedureID, dtProductionData, sUserInfo, out procedureInfo));
  661. actionResult.Result = JsonHelper.ToJson(resultDT);
  662. actionResult.Status = (int)Constant.PDAResult.Success;
  663. if (resultDT != null)
  664. {
  665. DataRow[] drs = resultDT.Select("out_errMsg is not null and out_errMsg <> ''");
  666. if (drs != null && drs.Length > 0)
  667. {
  668. return actionResult;
  669. }
  670. }
  671. #region PDA条码打印
  672. if (procedureInfo != null && procedureInfo.BarCodePrintCopies > 0 &&
  673. procedureInfo.ModelType == (int)Constant.ProcedureModelType.Normal)
  674. {
  675. try
  676. {
  677. if (procedureInfo.CollectType == 1)
  678. {
  679. //foreach (DataRow item in dtProductionData.Rows)
  680. //{
  681. // ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode(item["barcode"].ToString(),
  682. // procedureInfo.BarCodePrintCopies, null, sUserInfo);
  683. // if (sre.Status != Constant.ServiceResultStatus.Success)
  684. // {
  685. // actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  686. // actionResult.Message = sre.Message;
  687. // return actionResult;
  688. // }
  689. //}
  690. }
  691. else
  692. {
  693. //ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode(dtProductionData.Rows[0]["barcode"].ToString(),
  694. // procedureInfo.BarCodePrintCopies, null, sUserInfo);
  695. ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode_3C(dtProductionData.Rows[0]["barcode"].ToString(),
  696. procedureInfo.BarCodePrintCopies, null, sUserInfo, 0);
  697. if (sre.Status != Constant.ServiceResultStatus.Success)
  698. {
  699. actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  700. actionResult.Message = sre.Message;
  701. return actionResult;
  702. }
  703. }
  704. }
  705. catch (Exception ex)
  706. {
  707. OutputLog.TraceLog(LogPriority.Error,
  708. this.ToString(),
  709. System.Reflection.MethodBase.GetCurrentMethod().Name,
  710. ex.ToString(),
  711. LocalPath.LogExePath);
  712. actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  713. actionResult.Message = "条码打印异常";
  714. return actionResult;
  715. }
  716. }
  717. #endregion PDA条码打印
  718. }
  719. catch (Exception ex)
  720. {
  721. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  722. OutputLog.TraceLog(LogPriority.Error,
  723. this.ToString(),
  724. System.Reflection.MethodBase.GetCurrentMethod().Name,
  725. ex.ToString(),
  726. LocalPath.LogExePath);
  727. try
  728. {
  729. string ss = JsonHelper.ToJson(productionDataEntitys);
  730. OutputLog.TraceLog(LogPriority.Error,
  731. this.ToString(),
  732. System.Reflection.MethodBase.GetCurrentMethod().Name,
  733. $" userCode:{userCode} procedureID:{procedureID} " + ss,
  734. LocalPath.LogExePath);
  735. }
  736. catch
  737. {
  738. }
  739. actionResult.Status = (int)Constant.PDAResult.Exception;
  740. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  741. }
  742. return actionResult;
  743. }
  744. #endregion
  745. #region 获得系统/基数数据
  746. /// <summary>
  747. /// 获得数据字典
  748. /// </summary>
  749. /// <param name="accountCode">帐套code</param>
  750. /// <param name="userCode">用户code</param>
  751. /// <param name="userPassword">用户密码</param>
  752. /// <param name="sessionKey">本次登陆密钥</param>
  753. /// <param name="dicType">字典类型</param>
  754. /// <returns></returns>
  755. public ActionResult GetDataDictionaryByType(string accountCode, string userCode, string userPassword, string sessionKey, string dicType)
  756. {
  757. ActionResult actionResult = new ActionResult();
  758. try
  759. {
  760. // 验证请求头信息
  761. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  762. // 验证失败
  763. if (actionResult.Status != (int)Constant.PDAResult.Success)
  764. {
  765. return actionResult;
  766. }
  767. DataTable dicDataTable = ServiceInvoker.Invoke<DataTable>(this,
  768. () => CommonModuleLogic.GetDataDictionaryByType(sUserInfo, dicType));
  769. actionResult.Result = JsonHelper.ToJson(dicDataTable);
  770. actionResult.Status = (int)Constant.PDAResult.Success;
  771. }
  772. catch (Exception ex)
  773. {
  774. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  775. OutputLog.TraceLog(LogPriority.Error,
  776. this.ToString(),
  777. System.Reflection.MethodBase.GetCurrentMethod().Name,
  778. ex.ToString(),
  779. LocalPath.LogExePath);
  780. actionResult.Status = (int)Constant.PDAResult.Exception;
  781. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  782. }
  783. return actionResult;
  784. }
  785. #endregion
  786. #region 检验工序接口
  787. /// <summary>
  788. /// 获得检验标识
  789. /// </summary>
  790. /// <param name="accountCode">帐套code</param>
  791. /// <param name="userCode">用户code</param>
  792. /// <param name="userPassword">用户密码</param>
  793. /// <param name="sessionKey">本次登陆密钥</param>
  794. /// <returns></returns>
  795. /// <remarks>
  796. /// 陈冰 2014.10.04 新建
  797. /// </remarks>
  798. public ActionResult GetDefectFlagData(string accountCode, string userCode, string userPassword, string sessionKey)
  799. {
  800. ActionResult actionResult = new ActionResult();
  801. try
  802. {
  803. // 验证请求头信息
  804. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  805. // 验证失败
  806. if (actionResult.Status != (int)Constant.PDAResult.Success)
  807. {
  808. return actionResult;
  809. }
  810. #region 构造缺陷标识的数据源
  811. DataTable dtDefectFlag = CreateDataSource.GetDefectFlagTable();
  812. #endregion
  813. actionResult.Result = JsonHelper.ToJson(dtDefectFlag);
  814. actionResult.Status = (int)Constant.PDAResult.Success;
  815. }
  816. catch (Exception ex)
  817. {
  818. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  819. OutputLog.TraceLog(LogPriority.Error,
  820. this.ToString(),
  821. System.Reflection.MethodBase.GetCurrentMethod().Name,
  822. ex.ToString(),
  823. LocalPath.LogExePath);
  824. actionResult.Status = (int)Constant.PDAResult.Exception;
  825. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  826. }
  827. return actionResult;
  828. }
  829. /// <summary>
  830. /// 由条码和当前检验工序获取返工工序
  831. /// </summary>
  832. /// <param name="accountCode">帐套code</param>
  833. /// <param name="userCode">用户code</param>
  834. /// <param name="userPassword">用户密码</param>
  835. /// <param name="sessionKey">本次登陆密钥</param>
  836. /// <param name="procedureID">当前检验工序ID</param>
  837. /// <param name="barcode">条码</param>
  838. /// <returns></returns>
  839. /// <remarks>
  840. /// 陈冰 2014.10.04 新建
  841. /// </remarks>
  842. public ActionResult GetReworkProcedureByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  843. {
  844. ActionResult actionResult = new ActionResult();
  845. try
  846. {
  847. // 验证请求头信息
  848. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  849. // 验证失败
  850. if (actionResult.Status != (int)Constant.PDAResult.Success)
  851. {
  852. return actionResult;
  853. }
  854. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  855. () => PMModuleLogic.GetReworkProcedureByBarcode(procedureID, barcode));
  856. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  857. {
  858. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  859. actionResult.Status = (int)Constant.PDAResult.Success;
  860. }
  861. else
  862. {
  863. actionResult.Status = (int)Constant.PDAResult.Fail;
  864. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  865. }
  866. }
  867. catch (Exception ex)
  868. {
  869. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  870. OutputLog.TraceLog(LogPriority.Error,
  871. this.ToString(),
  872. System.Reflection.MethodBase.GetCurrentMethod().Name,
  873. ex.ToString(),
  874. LocalPath.LogExePath);
  875. actionResult.Status = (int)Constant.PDAResult.Exception;
  876. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  877. }
  878. return actionResult;
  879. }
  880. /// <summary>
  881. /// 由当前检验工序获取缺陷列表
  882. /// </summary>
  883. /// <param name="accountCode">帐套code</param>
  884. /// <param name="userCode">用户code</param>
  885. /// <param name="userPassword">用户密码</param>
  886. /// <param name="sessionKey">本次登陆密钥</param>
  887. /// <param name="procedureID">当前检验工序ID</param>
  888. /// <param name="defectCode">缺陷编码</param>
  889. /// <returns></returns>
  890. /// <remarks>
  891. /// 陈冰 2014.10.04 新建
  892. /// </remarks>
  893. public ActionResult GetDefectByProcedureIDAndDefectCode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string defectCode)
  894. {
  895. ActionResult actionResult = new ActionResult();
  896. try
  897. {
  898. // 验证请求头信息
  899. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  900. // 验证失败
  901. if (actionResult.Status != (int)Constant.PDAResult.Success)
  902. {
  903. return actionResult;
  904. }
  905. object defectDs = ServiceInvoker.Invoke<object>(this,
  906. () => PMModuleLogic.GetDefectByProcedureIDAndDefectCode(procedureID, defectCode));
  907. if (defectDs != null)
  908. {
  909. actionResult.Result = JsonHelper.ToJson(defectDs);
  910. actionResult.Status = (int)Constant.PDAResult.Success;
  911. }
  912. else
  913. {
  914. actionResult.Status = (int)Constant.PDAResult.Fail;
  915. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  916. }
  917. }
  918. catch (Exception ex)
  919. {
  920. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  921. OutputLog.TraceLog(LogPriority.Error,
  922. this.ToString(),
  923. System.Reflection.MethodBase.GetCurrentMethod().Name,
  924. ex.ToString(),
  925. LocalPath.LogExePath);
  926. actionResult.Status = (int)Constant.PDAResult.Exception;
  927. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  928. }
  929. return actionResult;
  930. }
  931. /// <summary>
  932. /// 根据产品ID查出缺陷位置
  933. /// </summary>
  934. /// <param name="accountCode">帐套code</param>
  935. /// <param name="userCode">用户code</param>
  936. /// <param name="userPassword">用户密码</param>
  937. /// <param name="sessionKey">本次登陆密钥</param>
  938. /// <param name="goodsID">产品ID</param>
  939. /// <param name="positionCode">位置编码</param>
  940. /// <returns></returns>
  941. /// <remarks>
  942. /// 陈冰 2014.10.04 新建
  943. /// </remarks>
  944. public ActionResult GetDefectPositionByGoodsIDAndPositionCode(string accountCode, string userCode, string userPassword, string sessionKey, int goodsID, string positionCode)
  945. {
  946. ActionResult actionResult = new ActionResult();
  947. try
  948. {
  949. // 验证请求头信息
  950. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  951. // 验证失败
  952. if (actionResult.Status != (int)Constant.PDAResult.Success)
  953. {
  954. return actionResult;
  955. }
  956. // 缺陷位置已经不用在关联产品
  957. //object defectDs = ServiceInvoker.Invoke<object>(this,() => PMModuleLogic.GetDefectPositionByGoodsIDAndPositionCode(goodsID, positionCode));
  958. object defectDs = ServiceInvoker.Invoke<object>(this, () => PMModuleLogic.GetDefectPosition(positionCode, sUserInfo));
  959. if (defectDs != null)
  960. {
  961. actionResult.Result = JsonHelper.ToJson(defectDs);
  962. actionResult.Status = (int)Constant.PDAResult.Success;
  963. }
  964. else
  965. {
  966. actionResult.Status = (int)Constant.PDAResult.Fail;
  967. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  968. }
  969. }
  970. catch (Exception ex)
  971. {
  972. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  973. OutputLog.TraceLog(LogPriority.Error,
  974. this.ToString(),
  975. System.Reflection.MethodBase.GetCurrentMethod().Name,
  976. ex.ToString(),
  977. LocalPath.LogExePath);
  978. actionResult.Status = (int)Constant.PDAResult.Exception;
  979. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  980. }
  981. return actionResult;
  982. }
  983. /// <summary>
  984. /// 通过条码和缺陷查出责任工序
  985. /// </summary>
  986. /// <param name="accountCode">帐套code</param>
  987. /// <param name="userCode">用户code</param>
  988. /// <param name="userPassword">用户密码</param>
  989. /// <param name="sessionKey">本次登陆密钥</param>
  990. /// <param name="barcode">条码</param>
  991. /// <param name="defectid">缺陷ID</param>
  992. /// <returns></returns>
  993. /// <remarks>
  994. /// 陈冰 2014.10.04 新建
  995. /// </remarks>
  996. public ActionResult GetDutyProcedureByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int defectid)
  997. {
  998. ActionResult actionResult = new ActionResult();
  999. try
  1000. {
  1001. // 验证请求头信息
  1002. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1003. // 验证失败
  1004. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1005. {
  1006. return actionResult;
  1007. }
  1008. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1009. () => PMModuleLogic.GetDutyProcedureByBarCode(barcode, defectid, sUserInfo.AccountID));
  1010. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1011. {
  1012. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs);
  1013. actionResult.Status = (int)Constant.PDAResult.Success;
  1014. }
  1015. else
  1016. {
  1017. actionResult.Status = (int)Constant.PDAResult.Fail;
  1018. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1019. }
  1020. }
  1021. catch (Exception ex)
  1022. {
  1023. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1024. OutputLog.TraceLog(LogPriority.Error,
  1025. this.ToString(),
  1026. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1027. ex.ToString(),
  1028. LocalPath.LogExePath);
  1029. actionResult.Status = (int)Constant.PDAResult.Exception;
  1030. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1031. }
  1032. return actionResult;
  1033. }
  1034. /// <summary>
  1035. /// 通过条码与工序查出责任工号(己废)
  1036. /// </summary>
  1037. /// <param name="accountCode">帐套code</param>
  1038. /// <param name="userCode">用户code</param>
  1039. /// <param name="userPassword">用户密码</param>
  1040. /// <param name="sessionKey">本次登陆密钥</param>
  1041. /// <param name="barcode">条码</param>
  1042. /// <param name="dutyProcedureID">责任工序</param>
  1043. /// <returns></returns>
  1044. /// <remarks>
  1045. /// 陈冰 2014.10.04 新建
  1046. /// </remarks>
  1047. public ActionResult GetDutyProcedureCodeByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int dutyProcedureID)
  1048. {
  1049. ActionResult actionResult = new ActionResult();
  1050. try
  1051. {
  1052. // 验证请求头信息
  1053. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1054. // 验证失败
  1055. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1056. {
  1057. return actionResult;
  1058. }
  1059. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1060. () => PMModuleLogic.GetDutyProcedureCodeByBarCode(barcode, dutyProcedureID));
  1061. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1062. {
  1063. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1064. actionResult.Status = (int)Constant.PDAResult.Success;
  1065. }
  1066. else
  1067. {
  1068. actionResult.Status = (int)Constant.PDAResult.Fail;
  1069. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1070. }
  1071. }
  1072. catch (Exception ex)
  1073. {
  1074. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1075. OutputLog.TraceLog(LogPriority.Error,
  1076. this.ToString(),
  1077. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1078. ex.ToString(),
  1079. LocalPath.LogExePath);
  1080. actionResult.Status = (int)Constant.PDAResult.Exception;
  1081. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1082. }
  1083. return actionResult;
  1084. }
  1085. /// <summary>
  1086. /// 通过条码与工序查出责任工号
  1087. /// </summary>
  1088. /// <param name="accountCode"></param>
  1089. /// <param name="userCode"></param>
  1090. /// <param name="userPassword"></param>
  1091. /// <param name="sessionKey"></param>
  1092. /// <param name="ProductionDataID">生产数据ID</param>
  1093. /// <returns></returns>
  1094. public ActionResult GetDutyProcedureCodeByProductionDataID(string accountCode, string userCode, string userPassword, string sessionKey, int ProductionDataID)
  1095. {
  1096. ActionResult actionResult = new ActionResult();
  1097. try
  1098. {
  1099. // 验证请求头信息
  1100. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1101. // 验证失败
  1102. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1103. {
  1104. return actionResult;
  1105. }
  1106. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1107. () => PMModuleLogic.GetDutyProcedureCodeByProductionDataID(ProductionDataID));
  1108. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1109. {
  1110. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1111. actionResult.Status = (int)Constant.PDAResult.Success;
  1112. }
  1113. else
  1114. {
  1115. actionResult.Status = (int)Constant.PDAResult.Fail;
  1116. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1117. }
  1118. }
  1119. catch (Exception ex)
  1120. {
  1121. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1122. OutputLog.TraceLog(LogPriority.Error,
  1123. this.ToString(),
  1124. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1125. ex.ToString(),
  1126. LocalPath.LogExePath);
  1127. actionResult.Status = (int)Constant.PDAResult.Exception;
  1128. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1129. }
  1130. return actionResult;
  1131. }
  1132. /// <summary>
  1133. /// 通过生产数据与工号ID查询工种
  1134. /// </summary>
  1135. /// <param name="accountCode">帐套code</param>
  1136. /// <param name="userCode">用户code</param>
  1137. /// <param name="userPassword">用户密码</param>
  1138. /// <param name="sessionKey">本次登陆密钥</param>
  1139. /// <param name="productionDataID">生产数据ID</param>
  1140. /// <param name="userID">工号ID</param>
  1141. /// <returns></returns>
  1142. /// <remarks>
  1143. /// 陈冰 2014.10.08 新建
  1144. /// </remarks>
  1145. public ActionResult GetDutyJobsByUserIDAndProductionID(string accountCode, string userCode, string userPassword, string sessionKey,
  1146. //int productionDataID, int userID)
  1147. int classesSettingID, int defectid, int procedureID)
  1148. {
  1149. ActionResult actionResult = new ActionResult();
  1150. try
  1151. {
  1152. // 验证请求头信息
  1153. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1154. // 验证失败
  1155. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1156. {
  1157. return actionResult;
  1158. }
  1159. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1160. //() => PMModuleLogic.GetDutyJobsCodeByUser(userID, productionDataID));
  1161. () => PDAModuleLogic.GetDutyJobsCodeByUser(classesSettingID, defectid, procedureID));
  1162. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1163. {
  1164. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1165. actionResult.Status = (int)Constant.PDAResult.Success;
  1166. }
  1167. else
  1168. {
  1169. actionResult.Status = (int)Constant.PDAResult.Fail;
  1170. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1171. }
  1172. }
  1173. catch (Exception ex)
  1174. {
  1175. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1176. OutputLog.TraceLog(LogPriority.Error,
  1177. this.ToString(),
  1178. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1179. ex.ToString(),
  1180. LocalPath.LogExePath);
  1181. actionResult.Status = (int)Constant.PDAResult.Exception;
  1182. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1183. }
  1184. return actionResult;
  1185. }
  1186. /// <summary>
  1187. /// 根据生产数据ID,用户ID及工种选出责任员工
  1188. /// </summary>
  1189. /// <param name="accountCode">帐套code</param>
  1190. /// <param name="userCode">用户code</param>
  1191. /// <param name="userPassword">用户密码</param>
  1192. /// <param name="sessionKey">本次登陆密钥</param>
  1193. /// <param name="productionDataID">生产数据ID</param>
  1194. /// <param name="userID">工号ID</param>
  1195. /// <param name="jobsID">工种ID</param>
  1196. /// <returns></returns>
  1197. /// <remarks>
  1198. /// 陈冰 2014.10.08 新建
  1199. /// </remarks>
  1200. public ActionResult GetDutyStaffByUserIDAndJobs(string accountCode, string userCode, string userPassword, string sessionKey,
  1201. //int productionDataID, int userID, int jobsID)
  1202. int classesSettingID, int jobsID)
  1203. {
  1204. ActionResult actionResult = new ActionResult();
  1205. try
  1206. {
  1207. // 验证请求头信息
  1208. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1209. // 验证失败
  1210. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1211. {
  1212. return actionResult;
  1213. }
  1214. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1215. //() => PMModuleLogic.GetDutyStaffByUserIDAndJobs(productionDataID, userID, jobsID));
  1216. () => PDAModuleLogic.GetDutyStaffByUserIDAndJobs(classesSettingID, jobsID));
  1217. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1218. {
  1219. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1220. actionResult.Status = (int)Constant.PDAResult.Success;
  1221. }
  1222. else
  1223. {
  1224. actionResult.Status = (int)Constant.PDAResult.Fail;
  1225. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1226. }
  1227. }
  1228. catch (Exception ex)
  1229. {
  1230. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1231. OutputLog.TraceLog(LogPriority.Error,
  1232. this.ToString(),
  1233. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1234. ex.ToString(),
  1235. LocalPath.LogExePath);
  1236. actionResult.Status = (int)Constant.PDAResult.Exception;
  1237. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1238. }
  1239. return actionResult;
  1240. }
  1241. /// <summary>
  1242. /// 获得产品分级
  1243. /// </summary>
  1244. /// <param name="accountCode">帐套code</param>
  1245. /// <param name="userCode">用户code</param>
  1246. /// <param name="userPassword">用户密码</param>
  1247. /// <param name="sessionKey">本次登陆密钥</param>
  1248. /// <returns></returns>
  1249. /// <remarks>
  1250. /// 陈冰 2014.10.08 新建
  1251. /// xuwei 2019-12-4 添加参数type 默认为2成检 为1时 半检
  1252. /// </remarks>
  1253. public ActionResult GetGoodsGradeData(string accountCode, string userCode, string userPassword, string sessionKey, int type = 2)
  1254. {
  1255. ActionResult actionResult = new ActionResult();
  1256. try
  1257. {
  1258. // 验证请求头信息
  1259. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1260. // 验证失败
  1261. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1262. {
  1263. return actionResult;
  1264. }
  1265. #region 构造产品分级的数据源
  1266. //DataTable dtGrade = CreateDataSource.GetGoodsGradeTable();
  1267. //xuwei modify 2019-12-04 支持半检 没传参数 type=0
  1268. //DataSet dsGrade = SystemModuleLogic.GetGoodsLevel(2 , sUserInfo);
  1269. DataSet dsGrade = SystemModuleLogic.GetGoodsLevel(type == 0 ? 2 : type, sUserInfo);
  1270. if (dsGrade != null && dsGrade.Tables.Count > Constant.INT_IS_ZERO)
  1271. {
  1272. actionResult.Result = JsonHelper.ToJson(dsGrade.Tables[0]);
  1273. actionResult.Status = (int)Constant.PDAResult.Success;
  1274. }
  1275. else
  1276. {
  1277. actionResult.Status = (int)Constant.PDAResult.Fail;
  1278. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1279. }
  1280. #endregion
  1281. }
  1282. catch (Exception ex)
  1283. {
  1284. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1285. OutputLog.TraceLog(LogPriority.Error,
  1286. this.ToString(),
  1287. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1288. ex.ToString(),
  1289. LocalPath.LogExePath);
  1290. OutputLog.TraceLog(LogPriority.Error,
  1291. this.ToString(),
  1292. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1293. ex.ToString(),
  1294. LocalPath.LogExePath);
  1295. actionResult.Status = (int)Constant.PDAResult.Exception;
  1296. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1297. }
  1298. return actionResult;
  1299. }
  1300. #endregion
  1301. #region 保存检验条码
  1302. /// <summary>
  1303. /// 保存检验条码
  1304. /// </summary>
  1305. /// <param name="accountCode">帐套code</param>
  1306. /// <param name="userCode">用户code</param>
  1307. /// <param name="userPassword">用户密码</param>
  1308. /// <param name="sessionKey">本次登陆密钥</param>
  1309. /// <param name="procedureID">工序ID</param>
  1310. /// <param name="productionDataEntitys">条码信息</param>
  1311. /// <returns></returns>
  1312. public ActionResult AddCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, ProductionDataEntity[] productionDataEntitys)
  1313. {
  1314. ActionResult actionResult = new ActionResult();
  1315. if (productionDataEntitys == null || productionDataEntitys.Length == 0 ||
  1316. string.IsNullOrWhiteSpace(productionDataEntitys[0].Barcode))
  1317. {
  1318. actionResult.Status = (int)Constant.PDAResult.Fail;
  1319. actionResult.Message = "无效条码";
  1320. return actionResult;
  1321. }
  1322. try
  1323. {
  1324. // 验证请求头信息
  1325. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1326. // 验证失败
  1327. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1328. {
  1329. return actionResult;
  1330. }
  1331. //if(productionDataEntitys.Length>0)
  1332. //{
  1333. // if(productionDataEntitys[0].ProductionDataID>0)
  1334. // {
  1335. // productionDataEntitys[0].OPTimeStamp = Convert.ToDateTime(productionDataEntitys[0].OPTimeStampPDA.Replace("-","/"));
  1336. // }
  1337. //}
  1338. string err = ServiceInvoker.Invoke<string>(this,
  1339. //() => PMModuleLogicDAL.AddCheckBarcode(procedureID, productionDataEntitys, sUserInfo));
  1340. () => PMModuleLogicDAL.AddCheckBarcodePDA(procedureID, productionDataEntitys, sUserInfo));
  1341. if (err == null)
  1342. {
  1343. err = "";
  1344. }
  1345. if (err == "DataDouble")
  1346. {
  1347. actionResult.Result = string.Format(Messages.MSG_HR_W006, "成检", "保存");
  1348. actionResult.Status = 2;
  1349. return actionResult;
  1350. }
  1351. else if (!string.IsNullOrEmpty(err))
  1352. {
  1353. actionResult.Result = err;
  1354. actionResult.Message = err;
  1355. actionResult.Status = 666;
  1356. return actionResult;
  1357. }
  1358. //actionResult.Result = JsonHelper.ToJson(err);
  1359. actionResult.Result = err;// JsonHelper.ToJson(err);
  1360. actionResult.Status = (int)Constant.PDAResult.Success;
  1361. }
  1362. catch (Exception ex)
  1363. {
  1364. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1365. OutputLog.TraceLog(LogPriority.Error,
  1366. this.ToString(),
  1367. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1368. ex.ToString(),
  1369. LocalPath.LogExePath);
  1370. actionResult.Status = (int)Constant.PDAResult.Exception;
  1371. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1372. }
  1373. return actionResult;
  1374. }
  1375. /// <summary>
  1376. /// 保存检验条码
  1377. /// </summary>
  1378. /// <param name="accountCode">帐套code</param>
  1379. /// <param name="userCode">用户code</param>
  1380. /// <param name="userPassword">用户密码</param>
  1381. /// <param name="sessionKey">本次登陆密钥</param>
  1382. /// <param name="procedureID">工序ID</param>
  1383. /// <param name="productionDataEntitys">条码信息</param>
  1384. /// <returns></returns>
  1385. public ActionResult AddBarcodeIdnrkScrap(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, ProductionDataEntity[] productionDataEntitys)
  1386. {
  1387. ActionResult actionResult = new ActionResult();
  1388. if (productionDataEntitys == null || productionDataEntitys.Length == 0 ||
  1389. string.IsNullOrWhiteSpace(productionDataEntitys[0].Barcode))
  1390. {
  1391. actionResult.Status = (int)Constant.PDAResult.Fail;
  1392. actionResult.Message = "无效条码";
  1393. return actionResult;
  1394. }
  1395. try
  1396. {
  1397. // 验证请求头信息
  1398. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1399. // 验证失败
  1400. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1401. {
  1402. return actionResult;
  1403. }
  1404. string err = ServiceInvoker.Invoke<string>(this,
  1405. () => PMModuleLogicDAL.AddBarcodeIdnrkScrapPDA(procedureID, productionDataEntitys, sUserInfo));
  1406. if (err == null)
  1407. {
  1408. err = "";
  1409. }
  1410. actionResult.Result = err;
  1411. actionResult.Status = (int)Constant.PDAResult.Success;
  1412. }
  1413. catch (Exception ex)
  1414. {
  1415. OutputLog.TraceLog(LogPriority.Error,
  1416. this.ToString(),
  1417. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1418. ex.ToString(),
  1419. LocalPath.LogExePath);
  1420. actionResult.Status = (int)Constant.PDAResult.Exception;
  1421. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1422. }
  1423. return actionResult;
  1424. }
  1425. #endregion
  1426. #region 文件上传下载
  1427. /// <summary>
  1428. /// 软件更新
  1429. /// </summary>
  1430. /// <param name="accountCode">帐套code</param>
  1431. /// <param name="userCode">用户code</param>
  1432. /// <param name="userPassword">用户密码</param>
  1433. /// <param name="sessionKey">本次登陆密钥</param>
  1434. /// <returns></returns>
  1435. public Stream AutoUpgrade(string accountCode, string userCode, string userPassword, string sessionKey)
  1436. {
  1437. try
  1438. {
  1439. return ServiceInvoker.Invoke<Stream>(this, () => PDAModuleLogic.AutoUpgrade());
  1440. }
  1441. catch (Exception ex)
  1442. {
  1443. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1444. OutputLog.TraceLog(LogPriority.Error,
  1445. this.ToString(),
  1446. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1447. ex.ToString(),
  1448. LocalPath.LogExePath);
  1449. return null;
  1450. }
  1451. }
  1452. /// <summary>
  1453. /// 上传临时文件
  1454. /// </summary>
  1455. /// <param name="imgStream"></param>
  1456. /// <returns></returns>
  1457. public ActionResult SaveImg(Stream mageStream)
  1458. {
  1459. ActionResult actionResult = new ActionResult();
  1460. try
  1461. {
  1462. string err = PDAModuleLogic.SaveImg(mageStream);
  1463. if (err == null)
  1464. {
  1465. err = "";
  1466. }
  1467. actionResult.Result = err;
  1468. actionResult.Status = (int)Constant.PDAResult.Success;
  1469. }
  1470. catch (Exception ex)
  1471. {
  1472. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1473. OutputLog.TraceLog(LogPriority.Error,
  1474. this.ToString(),
  1475. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1476. ex.ToString(),
  1477. LocalPath.LogExePath);
  1478. actionResult.Status = (int)Constant.PDAResult.Exception;
  1479. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1480. }
  1481. return actionResult;
  1482. }
  1483. public Stream GetFileTest(string path)
  1484. {
  1485. return PDAModuleLogic.GetImg(path);
  1486. }
  1487. public Stream GetFileStream()
  1488. {
  1489. FileStream fs = new FileStream("999.apk", FileMode.OpenOrCreate, FileAccess.Read);
  1490. long l = fs.Length;
  1491. return fs;
  1492. }
  1493. public byte[] GetFileTestByte(string path)
  1494. {
  1495. FileStream stream = new FileInfo(path).OpenRead();
  1496. Byte[] buffer = new Byte[stream.Length];
  1497. //从流中读取字节块并将该数据写入给定缓冲区buffer中
  1498. stream.Read(buffer, 0, Convert.ToInt32(stream.Length));
  1499. return buffer;
  1500. }
  1501. public string GetFile(string path)
  1502. {
  1503. string imgFilePath = path;
  1504. System.IO.FileStream fs = new System.IO.FileStream(imgFilePath, System.IO.FileMode.Open);
  1505. int i = (int)fs.Length;
  1506. byte[] content = new byte[i];
  1507. fs.Read(content, 0, i);
  1508. string result = Convert.ToBase64String(content);
  1509. fs.Close();
  1510. FileStream fsTxt = new FileStream("A.txt", FileMode.OpenOrCreate);
  1511. StreamWriter sw = new StreamWriter(fsTxt, System.Text.Encoding.Default);
  1512. sw.Write(result);
  1513. sw.Close();
  1514. fsTxt.Close();
  1515. return result;
  1516. }
  1517. #endregion
  1518. /// <summary>
  1519. /// 获得产品分级
  1520. /// </summary>
  1521. /// <param name="accountCode">帐套code</param>
  1522. /// <param name="userCode">用户code</param>
  1523. /// <param name="userPassword">用户密码</param>
  1524. /// <param name="sessionKey">本次登陆密钥</param>
  1525. /// <param name="procedureID">当前工序ID</param>
  1526. /// <returns></returns>
  1527. /// <remarks>
  1528. /// 陈冰 2014.10.22 新建
  1529. /// </remarks>
  1530. public ActionResult GetReworkProcedureByProcedureID(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  1531. {
  1532. ActionResult actionResult = new ActionResult();
  1533. try
  1534. {
  1535. // 验证请求头信息
  1536. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1537. // 验证失败
  1538. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1539. {
  1540. return actionResult;
  1541. }
  1542. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1543. () => PMModuleLogic.GetReworkProcedureByProcedureID(procedureID));
  1544. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1545. {
  1546. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1547. actionResult.Status = (int)Constant.PDAResult.Success;
  1548. }
  1549. else
  1550. {
  1551. actionResult.Status = (int)Constant.PDAResult.Fail;
  1552. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1553. }
  1554. }
  1555. catch (Exception ex)
  1556. {
  1557. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1558. OutputLog.TraceLog(LogPriority.Error,
  1559. this.ToString(),
  1560. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1561. ex.ToString(),
  1562. LocalPath.LogExePath);
  1563. actionResult.Status = (int)Constant.PDAResult.Exception;
  1564. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1565. }
  1566. return actionResult;
  1567. }
  1568. /// <summary>
  1569. /// 获得产品分级
  1570. /// </summary>
  1571. /// <param name="accountCode">帐套code</param>
  1572. /// <param name="userCode">用户code</param>
  1573. /// <param name="userPassword">用户密码</param>
  1574. /// <param name="sessionKey">本次登陆密钥</param>
  1575. /// <param name="barcode">条码</param>
  1576. /// <returns></returns>
  1577. public ActionResult GetKilnCarByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  1578. {
  1579. ActionResult actionResult = new ActionResult();
  1580. try
  1581. {
  1582. // 验证请求头信息
  1583. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1584. // 验证失败
  1585. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1586. {
  1587. return actionResult;
  1588. }
  1589. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1590. () => PMModuleLogic.GetKilnCarByBarCode(barcode));
  1591. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1592. {
  1593. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1594. actionResult.Status = (int)Constant.PDAResult.Success;
  1595. }
  1596. else
  1597. {
  1598. actionResult.Status = (int)Constant.PDAResult.Fail;
  1599. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1600. }
  1601. }
  1602. catch (Exception ex)
  1603. {
  1604. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1605. OutputLog.TraceLog(LogPriority.Error,
  1606. this.ToString(),
  1607. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1608. ex.ToString(),
  1609. LocalPath.LogExePath);
  1610. actionResult.Status = (int)Constant.PDAResult.Exception;
  1611. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1612. }
  1613. return actionResult;
  1614. }
  1615. #region 统计
  1616. /// <summary>
  1617. /// 统计当日计数数量
  1618. /// </summary>
  1619. /// <param name="accountCode">帐套code</param>
  1620. /// <param name="userCode">用户code</param>
  1621. /// <param name="userPassword">用户密码</param>
  1622. /// <param name="sessionKey">本次登陆密钥</param>
  1623. /// <param name="procedureID">工序ID</param>
  1624. /// <returns></returns>
  1625. public ActionResult StatisticsCollectBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  1626. {
  1627. ActionResult actionResult = new ActionResult();
  1628. try
  1629. {
  1630. // 验证请求头信息
  1631. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1632. // 验证失败
  1633. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1634. {
  1635. return actionResult;
  1636. }
  1637. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1638. () => PDAModuleLogic.StatisticsCollectBarcode(procedureID, sUserInfo));
  1639. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1640. {
  1641. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1642. actionResult.Status = (int)Constant.PDAResult.Success;
  1643. }
  1644. else
  1645. {
  1646. actionResult.Status = (int)Constant.PDAResult.Fail;
  1647. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1648. }
  1649. }
  1650. catch (Exception ex)
  1651. {
  1652. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1653. OutputLog.TraceLog(LogPriority.Error,
  1654. this.ToString(),
  1655. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1656. ex.ToString(),
  1657. LocalPath.LogExePath);
  1658. actionResult.Status = (int)Constant.PDAResult.Exception;
  1659. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1660. }
  1661. return actionResult;
  1662. }
  1663. /// <summary>
  1664. /// 统计当日计数数量
  1665. /// </summary>
  1666. /// <param name="accountCode">帐套code</param>
  1667. /// <param name="userCode">用户code</param>
  1668. /// <param name="userPassword">用户密码</param>
  1669. /// <param name="sessionKey">本次登陆密钥</param>
  1670. /// <param name="procedureID">工序ID</param>
  1671. /// <returns></returns>
  1672. public ActionResult StatisticsKilnCar(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  1673. {
  1674. ActionResult actionResult = new ActionResult();
  1675. try
  1676. {
  1677. // 验证请求头信息
  1678. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1679. // 验证失败
  1680. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1681. {
  1682. return actionResult;
  1683. }
  1684. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1685. () => PDAModuleLogic.StatisticsKilnCar(procedureID, sUserInfo));
  1686. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1687. {
  1688. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1689. actionResult.Status = (int)Constant.PDAResult.Success;
  1690. }
  1691. else
  1692. {
  1693. actionResult.Status = (int)Constant.PDAResult.Fail;
  1694. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1695. }
  1696. }
  1697. catch (Exception ex)
  1698. {
  1699. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1700. OutputLog.TraceLog(LogPriority.Error,
  1701. this.ToString(),
  1702. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1703. ex.ToString(),
  1704. LocalPath.LogExePath);
  1705. actionResult.Status = (int)Constant.PDAResult.Exception;
  1706. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1707. }
  1708. return actionResult;
  1709. }
  1710. /// <summary>
  1711. /// 统计产品跟踪
  1712. /// </summary>
  1713. /// <param name="accountCode">帐套code</param>
  1714. /// <param name="userCode">用户code</param>
  1715. /// <param name="userPassword">用户密码</param>
  1716. /// <param name="sessionKey">本次登陆密钥</param>
  1717. /// <param name="procedureID">工序ID</param>
  1718. /// <returns></returns>
  1719. public ActionResult StatisticsProductTrack(string accountCode, string userCode, string userPassword, string sessionKey, 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. RPT020101_SE se = new RPT020101_SE();
  1732. se.Barcode = barcode;
  1733. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  1734. () => Dongke.IBOSS.PRD.Service.ReportModuleLogic.ReportModuleLogic.GetRPT020101SData(sUserInfo, se));
  1735. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  1736. {
  1737. actionResult.Status = (int)Constant.PDAResult.Fail;
  1738. actionResult.Message = Messages.MSG_CMN_I002;
  1739. }
  1740. else
  1741. {
  1742. actionResult.Result = JsonHelper.ToJson(sre.Data);
  1743. actionResult.Status = (int)Constant.PDAResult.Success;
  1744. }
  1745. //ProductionDataEntity productionDataEntity = ServiceInvoker.Invoke<ProductionDataEntity>(this,
  1746. // () => PDAModuleLogic.StatisticsProductTrack(barcode, sUserInfo));
  1747. //if (productionDataEntity != null)
  1748. //{
  1749. // actionResult.Result = JsonHelper.ToJson(productionDataEntity);
  1750. // actionResult.Status = (int)Constant.PDAResult.Success;
  1751. //}
  1752. //else
  1753. //{
  1754. // actionResult.Status = (int)Constant.PDAResult.Fail;
  1755. // actionResult.Message = Messages.MSG_CMN_I002;
  1756. //}
  1757. }
  1758. catch (Exception ex)
  1759. {
  1760. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1761. OutputLog.TraceLog(LogPriority.Error,
  1762. this.ToString(),
  1763. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1764. ex.ToString() + ex.HelpLink,
  1765. LocalPath.LogExePath);
  1766. actionResult.Status = (int)Constant.PDAResult.Exception;
  1767. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1768. }
  1769. return actionResult;
  1770. }
  1771. #endregion
  1772. #region 撤销装车及成检
  1773. /// <summary>
  1774. /// 检验条码是否可以撤销装车
  1775. /// </summary>
  1776. /// <param name="accountCode">帐套code</param>
  1777. /// <param name="userCode">用户code</param>
  1778. /// <param name="userPassword">用户密码</param>
  1779. /// <param name="sessionKey">本次登陆密钥</param>
  1780. /// <param name="procedureID">当前工序ID</param>
  1781. /// <param name="barcode">条码</param>
  1782. /// <returns></returns>
  1783. public ActionResult CheckCancelLoadCar(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  1784. {
  1785. ActionResult actionResult = new ActionResult();
  1786. try
  1787. {
  1788. // 验证请求头信息
  1789. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1790. // 验证失败
  1791. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1792. {
  1793. return actionResult;
  1794. }
  1795. CheckCancelLoadCar checkCancelLoadCar = ServiceInvoker.Invoke<CheckCancelLoadCar>(this,
  1796. () => PMModuleLogic.CheckCancelLoadCar(procedureID, barcode, sUserInfo));
  1797. actionResult.Result = JsonHelper.ToJson(checkCancelLoadCar);
  1798. actionResult.Status = (int)Constant.PDAResult.Success;
  1799. }
  1800. catch (Exception ex)
  1801. {
  1802. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1803. OutputLog.TraceLog(LogPriority.Error,
  1804. this.ToString(),
  1805. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1806. ex.ToString(),
  1807. LocalPath.LogExePath);
  1808. actionResult.Status = (int)Constant.PDAResult.Exception;
  1809. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1810. }
  1811. return actionResult;
  1812. }
  1813. /// <summary>
  1814. /// 保存撤销装车的条码
  1815. /// </summary>
  1816. /// <param name="accountCode">帐套code</param>
  1817. /// <param name="userCode">用户code</param>
  1818. /// <param name="userPassword">用户密码</param>
  1819. /// <param name="sessionKey">本次登陆密钥</param>
  1820. /// <param name="procedureID">当前工序ID</param>
  1821. /// <param name="barcode">条码</param>
  1822. /// <returns></returns>
  1823. public ActionResult AddCancelLoadCar(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  1824. {
  1825. ActionResult actionResult = new ActionResult();
  1826. try
  1827. {
  1828. // 验证请求头信息
  1829. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1830. // 验证失败
  1831. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1832. {
  1833. return actionResult;
  1834. }
  1835. string err = ServiceInvoker.Invoke<string>(this,
  1836. () => PMModuleLogicDAL.AddCancelLoadCar(procedureID, barcode, sUserInfo));
  1837. if (err == null)
  1838. {
  1839. err = "";
  1840. }
  1841. actionResult.Result = JsonHelper.ToJson(err);
  1842. actionResult.Status = (int)Constant.PDAResult.Success;
  1843. }
  1844. catch (Exception ex)
  1845. {
  1846. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1847. OutputLog.TraceLog(LogPriority.Error,
  1848. this.ToString(),
  1849. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1850. ex.ToString(),
  1851. LocalPath.LogExePath);
  1852. actionResult.Status = (int)Constant.PDAResult.Exception;
  1853. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1854. }
  1855. return actionResult;
  1856. }
  1857. /// <summary>
  1858. /// 由产品条码获取注浆信息
  1859. /// </summary>
  1860. /// <param name="barcode"></param>
  1861. /// <returns></returns>
  1862. public ActionResult GetGroutingProducttByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  1863. {
  1864. ActionResult actionResult = new ActionResult();
  1865. try
  1866. {
  1867. // 验证请求头信息
  1868. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1869. // 验证失败
  1870. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1871. {
  1872. return actionResult;
  1873. }
  1874. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1875. () => PDAModuleLogic.GetGroutingProducttByBarCode(barcode));
  1876. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1877. {
  1878. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1879. actionResult.Status = (int)Constant.PDAResult.Success;
  1880. }
  1881. else
  1882. {
  1883. actionResult.Status = (int)Constant.PDAResult.Fail;
  1884. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1885. }
  1886. }
  1887. catch (Exception ex)
  1888. {
  1889. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1890. OutputLog.TraceLog(LogPriority.Error,
  1891. this.ToString(),
  1892. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1893. ex.ToString(),
  1894. LocalPath.LogExePath);
  1895. actionResult.Status = (int)Constant.PDAResult.Exception;
  1896. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1897. }
  1898. return actionResult;
  1899. }
  1900. /// <summary>
  1901. /// 获取工号下的所有工种信息
  1902. /// </summary>
  1903. /// <param name="UserID">工号ID</param>
  1904. /// <returns></returns>
  1905. public ActionResult GetAllJobsByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int UserID)
  1906. {
  1907. ActionResult actionResult = new ActionResult();
  1908. try
  1909. {
  1910. // 验证请求头信息
  1911. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1912. // 验证失败
  1913. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1914. {
  1915. return actionResult;
  1916. }
  1917. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1918. () => PDAModuleLogic.GetAllJobsByUserID(UserID, sUserInfo));
  1919. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1920. {
  1921. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1922. actionResult.Status = (int)Constant.PDAResult.Success;
  1923. }
  1924. else
  1925. {
  1926. actionResult.Status = (int)Constant.PDAResult.Fail;
  1927. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1928. }
  1929. }
  1930. catch (Exception ex)
  1931. {
  1932. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1933. OutputLog.TraceLog(LogPriority.Error,
  1934. this.ToString(),
  1935. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1936. ex.ToString(),
  1937. LocalPath.LogExePath);
  1938. actionResult.Status = (int)Constant.PDAResult.Exception;
  1939. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1940. }
  1941. return actionResult;
  1942. }
  1943. /// <summary>
  1944. /// 根据所选工号对应的工种,查出缺陷责任员工
  1945. /// </summary>
  1946. /// <param name="jobs">工种ID</param>
  1947. /// <returns></returns>
  1948. public ActionResult GetDutyStaffByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int jobs)
  1949. {
  1950. ActionResult actionResult = new ActionResult();
  1951. try
  1952. {
  1953. // 验证请求头信息
  1954. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1955. // 验证失败
  1956. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1957. {
  1958. return actionResult;
  1959. }
  1960. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1961. () => PDAModuleLogic.GetDutyStaffByUserID(jobs, sUserInfo));
  1962. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1963. {
  1964. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1965. actionResult.Status = (int)Constant.PDAResult.Success;
  1966. }
  1967. else
  1968. {
  1969. actionResult.Status = (int)Constant.PDAResult.Fail;
  1970. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1971. }
  1972. }
  1973. catch (Exception ex)
  1974. {
  1975. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1976. OutputLog.TraceLog(LogPriority.Error,
  1977. this.ToString(),
  1978. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1979. ex.ToString(),
  1980. LocalPath.LogExePath);
  1981. actionResult.Status = (int)Constant.PDAResult.Exception;
  1982. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1983. }
  1984. return actionResult;
  1985. }
  1986. /// <summary>
  1987. /// 根据所选工号,查出漏检责任员工
  1988. /// </summary>
  1989. /// <param name="userid">工号</param>
  1990. /// <returns></returns>
  1991. public ActionResult GetMissedStaffByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int userid)
  1992. {
  1993. ActionResult actionResult = new ActionResult();
  1994. try
  1995. {
  1996. // 验证请求头信息
  1997. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1998. // 验证失败
  1999. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2000. {
  2001. return actionResult;
  2002. }
  2003. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2004. () => PDAModuleLogic.GetMissedStaffByUserID(userid, sUserInfo));
  2005. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2006. {
  2007. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2008. actionResult.Status = (int)Constant.PDAResult.Success;
  2009. }
  2010. else
  2011. {
  2012. actionResult.Status = (int)Constant.PDAResult.Fail;
  2013. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2014. }
  2015. }
  2016. catch (Exception ex)
  2017. {
  2018. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2019. OutputLog.TraceLog(LogPriority.Error,
  2020. this.ToString(),
  2021. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2022. ex.ToString(),
  2023. LocalPath.LogExePath);
  2024. actionResult.Status = (int)Constant.PDAResult.Exception;
  2025. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2026. }
  2027. return actionResult;
  2028. }
  2029. /// <summary>
  2030. /// 获取用户列表
  2031. /// </summary>
  2032. /// <param name="requestEntity">用户实体</param>
  2033. /// <returns></returns>
  2034. public ActionResult SearchUserData(string accountCode, string userCode, string userPassword, string sessionKey, byte IsWorker)
  2035. {
  2036. ActionResult actionResult = new ActionResult();
  2037. try
  2038. {
  2039. // 验证请求头信息
  2040. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2041. // 验证失败
  2042. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2043. {
  2044. return actionResult;
  2045. }
  2046. SUserEntity requestEntity = new SUserEntity();
  2047. requestEntity.IsWorker = IsWorker;
  2048. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2049. () => PDAModuleLogic.SearchUserData(requestEntity, sUserInfo));
  2050. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2051. {
  2052. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2053. actionResult.Status = (int)Constant.PDAResult.Success;
  2054. }
  2055. else
  2056. {
  2057. actionResult.Status = (int)Constant.PDAResult.Fail;
  2058. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2059. }
  2060. }
  2061. catch (Exception ex)
  2062. {
  2063. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2064. OutputLog.TraceLog(LogPriority.Error,
  2065. this.ToString(),
  2066. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2067. ex.ToString(),
  2068. LocalPath.LogExePath);
  2069. actionResult.Status = (int)Constant.PDAResult.Exception;
  2070. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2071. }
  2072. return actionResult;
  2073. }
  2074. /// <summary>
  2075. /// 获取数据字典管理的数据
  2076. /// </summary>
  2077. /// <param name="Pvalue">显示停用标识</param>
  2078. /// <param name="dictionaryType">字典类别</param>
  2079. /// <returns></returns>
  2080. /// <remarks>
  2081. /// 2014.12.03 新建
  2082. /// </remarks>
  2083. public ActionResult GetDictionaryData(string accountCode, string userCode, string userPassword, string sessionKey, byte Pvalue, string dictionaryType)
  2084. {
  2085. ActionResult actionResult = new ActionResult();
  2086. try
  2087. {
  2088. // 验证请求头信息
  2089. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2090. // 验证失败
  2091. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2092. {
  2093. return actionResult;
  2094. }
  2095. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2096. () => PDAModuleLogic.GetDictionaryData(Pvalue, dictionaryType, sUserInfo));
  2097. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2098. {
  2099. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2100. actionResult.Status = (int)Constant.PDAResult.Success;
  2101. }
  2102. else
  2103. {
  2104. actionResult.Status = (int)Constant.PDAResult.Fail;
  2105. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2106. }
  2107. }
  2108. catch (Exception ex)
  2109. {
  2110. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2111. OutputLog.TraceLog(LogPriority.Error,
  2112. this.ToString(),
  2113. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2114. ex.ToString(),
  2115. LocalPath.LogExePath);
  2116. actionResult.Status = (int)Constant.PDAResult.Exception;
  2117. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2118. }
  2119. return actionResult;
  2120. }
  2121. #endregion
  2122. #region 保存半检数据
  2123. /// <summary>
  2124. /// 保存半检数据
  2125. /// </summary>
  2126. /// <param name="accountCode">帐套code</param>
  2127. /// <param name="userCode">用户code</param>
  2128. /// <param name="userPassword">用户密码</param>
  2129. /// <param name="sessionKey">本次登陆密钥</param>
  2130. /// <param name="productionDataEntitys">半检信息</param>
  2131. /// <returns></returns>
  2132. public ActionResult AddSemiTest(string accountCode, string userCode, string userPassword, string sessionKey, SemiTestEntity[] semiTestEntitys)
  2133. {
  2134. ActionResult actionResult = new ActionResult();
  2135. try
  2136. {
  2137. // 验证请求头信息
  2138. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2139. // 验证失败
  2140. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2141. {
  2142. return actionResult;
  2143. }
  2144. string err = ServiceInvoker.Invoke<string>(this,
  2145. () => PMModuleLogicDAL.AddSemiTest(semiTestEntitys, sUserInfo));
  2146. if (err == null)
  2147. {
  2148. err = "";
  2149. }
  2150. actionResult.Result = JsonHelper.ToJson(err);
  2151. actionResult.Status = (int)Constant.PDAResult.Success;
  2152. }
  2153. catch (Exception ex)
  2154. {
  2155. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2156. OutputLog.TraceLog(LogPriority.Error,
  2157. this.ToString(),
  2158. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2159. ex.ToString(),
  2160. LocalPath.LogExePath);
  2161. actionResult.Status = (int)Constant.PDAResult.Exception;
  2162. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2163. }
  2164. return actionResult;
  2165. }
  2166. #endregion
  2167. /// <summary>
  2168. /// 获取产品列表
  2169. /// </summary>
  2170. /// <returns></returns>
  2171. public ActionResult SerachGoods(string accountCode, string userCode, string userPassword, string sessionKey, int valueFlag)
  2172. {
  2173. ActionResult actionResult = new ActionResult();
  2174. try
  2175. {
  2176. // 验证请求头信息
  2177. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2178. // 验证失败
  2179. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2180. {
  2181. return actionResult;
  2182. }
  2183. GoodsEntity goodsEntity = new GoodsEntity();
  2184. goodsEntity.ValueFlag = 1;//有效标记
  2185. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2186. () => PDAModuleLogic.SerachGoods(sUserInfo, goodsEntity));
  2187. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2188. {
  2189. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2190. actionResult.Status = (int)Constant.PDAResult.Success;
  2191. }
  2192. else
  2193. {
  2194. actionResult.Status = (int)Constant.PDAResult.Fail;
  2195. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2196. }
  2197. }
  2198. catch (Exception ex)
  2199. {
  2200. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2201. OutputLog.TraceLog(LogPriority.Error,
  2202. this.ToString(),
  2203. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2204. ex.ToString(),
  2205. LocalPath.LogExePath);
  2206. actionResult.Status = (int)Constant.PDAResult.Exception;
  2207. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2208. }
  2209. return actionResult;
  2210. }
  2211. /// <summary>
  2212. /// 使用存储过程PRO_PM_GetProductionData获取生产工序计件数据
  2213. /// </summary>
  2214. /// <param name="searchEntity">生产数据实体类</param>
  2215. /// <returns>DataTable</returns>
  2216. public ActionResult GetProductionData(string accountCode, string userCode, string userPassword, string sessionKey, int ProcedureID, string BarCode)
  2217. {
  2218. ActionResult actionResult = new ActionResult();
  2219. try
  2220. {
  2221. // 验证请求头信息
  2222. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2223. // 验证失败
  2224. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2225. {
  2226. return actionResult;
  2227. }
  2228. SearchProductionDataEntity searchEntity = new SearchProductionDataEntity();
  2229. searchEntity.ProcedureID = ProcedureID;
  2230. searchEntity.BarCode = BarCode;
  2231. DataTable reworkDs = ServiceInvoker.Invoke<DataTable>(this,
  2232. () => PDAModuleLogic.GetProductionData(searchEntity, sUserInfo));
  2233. if (reworkDs != null && reworkDs.Rows.Count > Constant.INT_IS_ZERO)
  2234. {
  2235. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2236. actionResult.Status = (int)Constant.PDAResult.Success;
  2237. }
  2238. else
  2239. {
  2240. actionResult.Status = (int)Constant.PDAResult.Fail;
  2241. actionResult.Message = Constant.PDA_RESULT_ALLOW_ERR;
  2242. }
  2243. }
  2244. catch (Exception ex)
  2245. {
  2246. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2247. OutputLog.TraceLog(LogPriority.Error,
  2248. this.ToString(),
  2249. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2250. ex.ToString(),
  2251. LocalPath.LogExePath);
  2252. actionResult.Status = (int)Constant.PDAResult.Exception;
  2253. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2254. }
  2255. return actionResult;
  2256. }
  2257. /// <summary>
  2258. /// xuwei add 2020-03-23 此方法用于成检后 回收 再次成检 获取正确ID
  2259. /// </summary>
  2260. /// <param name="searchEntity">生产数据实体类</param>
  2261. /// <returns>DataTable</returns>
  2262. public ActionResult GetProductionDataCheckID(string accountCode, string userCode, string userPassword, string sessionKey, string BarCode)
  2263. {
  2264. ActionResult actionResult = new ActionResult();
  2265. try
  2266. {
  2267. // 验证请求头信息
  2268. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2269. // 验证失败
  2270. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2271. {
  2272. return actionResult;
  2273. }
  2274. SearchProductionDataEntity searchEntity = new SearchProductionDataEntity();
  2275. searchEntity.BarCode = BarCode;
  2276. DataTable reworkDs = ServiceInvoker.Invoke<DataTable>(this,
  2277. () => PDAModuleLogic.GetProductionDataCheckID(searchEntity, sUserInfo));
  2278. if (reworkDs != null && reworkDs.Rows.Count > Constant.INT_IS_ZERO)
  2279. {
  2280. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2281. actionResult.Status = (int)Constant.PDAResult.Success;
  2282. }
  2283. else
  2284. {
  2285. actionResult.Status = (int)Constant.PDAResult.Fail;
  2286. actionResult.Message = Constant.PDA_RESULT_ALLOW_ERR;
  2287. }
  2288. }
  2289. catch (Exception ex)
  2290. {
  2291. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2292. OutputLog.TraceLog(LogPriority.Error,
  2293. this.ToString(),
  2294. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2295. ex.ToString(),
  2296. LocalPath.LogExePath);
  2297. actionResult.Status = (int)Constant.PDAResult.Exception;
  2298. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2299. }
  2300. return actionResult;
  2301. }
  2302. /// <summary>
  2303. /// 根据所选生产数据ID,显示成检数据信息
  2304. /// </summary>
  2305. /// <param name="productionDataID">生产数据ID</param>
  2306. /// <returns>DataSet</returns>
  2307. public ActionResult GetProductionDataByID(string accountCode, string userCode, string userPassword, string sessionKey, int productionDataID)
  2308. {
  2309. ActionResult actionResult = new ActionResult();
  2310. try
  2311. {
  2312. // 验证请求头信息
  2313. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2314. // 验证失败
  2315. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2316. {
  2317. return actionResult;
  2318. }
  2319. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2320. () => PDAModuleLogic.GetProductionDataByID(productionDataID));
  2321. PDAProductionDataResult productionDatas = new PDAProductionDataResult();
  2322. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2323. {
  2324. if (reworkDs != null && reworkDs.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  2325. {
  2326. for (int i = 0; i < reworkDs.Tables[0].Rows.Count; i++)
  2327. {
  2328. PDAProductionDataResult productionData = new PDAProductionDataResult();
  2329. productionData.BarCode = reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
  2330. if (reworkDs.Tables[0].Rows[i]["GoodsID"].ToString() != "")
  2331. {
  2332. productionData.GoodsID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsID"].ToString());
  2333. }
  2334. productionData.GoodsCode = reworkDs.Tables[0].Rows[i]["GoodsCode"].ToString();
  2335. productionData.GoodsName = reworkDs.Tables[0].Rows[i]["GoodsName"].ToString();
  2336. if (reworkDs.Tables[0].Rows[0]["DefectFlagID"].ToString() != "")
  2337. {
  2338. productionData.DefectFlagID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["DefectFlagID"].ToString());
  2339. }
  2340. if (reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString() != "")
  2341. {
  2342. productionData.ReworkProcedureID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString());
  2343. }
  2344. productionData.Remarks = reworkDs.Tables[0].Rows[i]["Remarks"].ToString();
  2345. if (reworkDs.Tables[0].Rows[i]["UserID"].ToString() != "")
  2346. {
  2347. productionData.UserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["UserID"].ToString());
  2348. }
  2349. if (reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString() != "")
  2350. {
  2351. productionData.GoodsLevelTypeID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString());
  2352. }
  2353. productionData.UserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
  2354. productionData.UserName = reworkDs.Tables[0].Rows[i]["UserName"].ToString();
  2355. productionData.SpecialRepairflag = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["SpecialRepairflag"]);
  2356. productionData.IsReFire = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["IsReFire"]);
  2357. productionData.KilnCarCode = reworkDs.Tables[0].Rows[i]["KilnCarCode"].ToString();
  2358. productionData.KilnCode = reworkDs.Tables[0].Rows[i]["KilnCode"].ToString();
  2359. productionData.GlazeName = reworkDs.Tables[0].Rows[i]["GlazeName"].ToString();
  2360. productionData.LeakFlag1 = reworkDs.Tables[0].Rows[i]["LeakFlag1"].ToString();
  2361. productionData.LeakFlag2 = reworkDs.Tables[0].Rows[i]["LeakFlag2"].ToString();
  2362. productionData.LeakFlag3 = reworkDs.Tables[0].Rows[i]["LeakFlag3"].ToString();
  2363. productionData.SpecialRepairFlagName = reworkDs.Tables[0].Rows[i]["specialRepairFlagName"].ToString();
  2364. productionData.IsReFireName = reworkDs.Tables[0].Rows[i]["isReFireName"].ToString();
  2365. productionData.LeakFlag1Name = reworkDs.Tables[0].Rows[i]["LeakFlag1Name"].ToString();
  2366. productionData.LeakFlag2Name = reworkDs.Tables[0].Rows[i]["LeakFlag2Name"].ToString();
  2367. productionData.LeakFlag3Name = reworkDs.Tables[0].Rows[i]["LeakFlag3Name"].ToString();
  2368. if (reworkDs.Tables[0].Rows[i]["logoid"].ToString() != "")
  2369. {
  2370. productionData.LogoID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["logoid"]);
  2371. productionData.LogoCode = reworkDs.Tables[0].Rows[i]["LogoCode"].ToString();
  2372. productionData.LogoName = reworkDs.Tables[0].Rows[i]["LogoName"].ToString();
  2373. }
  2374. productionData.CreateTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["CreateTime"]);
  2375. if (reworkDs.Tables[0].Rows[i]["CheckTime"].ToString() != "")
  2376. {
  2377. productionData.CheckTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["CheckTime"].ToString());
  2378. }
  2379. DataView dvDefect = reworkDs.Tables[1].DefaultView;
  2380. dvDefect.RowFilter = "BarCode=" + reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
  2381. DataTable dtDefect = dvDefect.ToTable();
  2382. for (int row = 0; row < dtDefect.Rows.Count; row++)
  2383. {
  2384. // 产品缺陷
  2385. PDADefectResult defect = new PDADefectResult();
  2386. defect.SpecialDefect = dtDefect.Rows[row]["SpecialDefect"].ToString();
  2387. defect.DefectDeductionNum = Convert.ToDecimal(dtDefect.Rows[row]["DefectDeductionNum"].ToString());
  2388. if (dtDefect.Rows[row]["ProductionDefectID"].ToString() != "")
  2389. {
  2390. defect.ProductionDefectID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDefectID"].ToString());
  2391. }
  2392. defect.BarCode = dtDefect.Rows[row]["BarCode"].ToString();
  2393. if (dtDefect.Rows[row]["DefectID"].ToString() != "")
  2394. {
  2395. defect.DefectID = Convert.ToInt32(dtDefect.Rows[row]["DefectID"].ToString());
  2396. }
  2397. defect.DefectName = dtDefect.Rows[row]["DefectName"].ToString();
  2398. defect.DefectCode = dtDefect.Rows[row]["DefectCode"].ToString();
  2399. if (dtDefect.Rows[row]["DefectPositionID"].ToString() != "")
  2400. {
  2401. defect.DefectPositionID = Convert.ToInt32(dtDefect.Rows[row]["DefectPositionID"].ToString());
  2402. }
  2403. defect.DefectPositionName = dtDefect.Rows[row]["DefectPositionName"].ToString();
  2404. defect.DefectPositionCode = dtDefect.Rows[row]["DefectPositionCode"].ToString();
  2405. if (dtDefect.Rows[row]["DefectProcedureID"].ToString() != "")
  2406. {
  2407. defect.DefectProcedureID = Convert.ToInt32(dtDefect.Rows[row]["DefectProcedureID"].ToString());
  2408. }
  2409. defect.DefectProcedureName = dtDefect.Rows[row]["DefectProcedureName"].ToString();
  2410. defect.DefectProcedureCode = dtDefect.Rows[row]["DefectProcedureCode"].ToString();
  2411. if (dtDefect.Rows[row]["DefectUserID"].ToString() != "")
  2412. {
  2413. defect.DefectUserID = Convert.ToInt32(dtDefect.Rows[row]["DefectUserID"].ToString());
  2414. }
  2415. defect.DefectUserName = dtDefect.Rows[row]["DefectUserName"].ToString();
  2416. defect.DefectUserCode = dtDefect.Rows[row]["DefectUserCode"].ToString();
  2417. if (dtDefect.Rows[row]["Jobs"].ToString() != "")
  2418. {
  2419. defect.Jobs = Convert.ToInt32(dtDefect.Rows[row]["Jobs"].ToString());
  2420. }
  2421. if (dtDefect.Rows[row]["MissedUserID"].ToString() != "")
  2422. {
  2423. defect.MissedUserID = Convert.ToInt32(dtDefect.Rows[row]["MissedUserID"].ToString());
  2424. }
  2425. defect.MissedUserCode = dtDefect.Rows[row]["MissedUserCode"].ToString();
  2426. defect.MissedUserName = dtDefect.Rows[row]["MissedUserName"].ToString();
  2427. defect.JobsText = dtDefect.Rows[row]["JobsText"].ToString();
  2428. defect.DefectRemarks = dtDefect.Rows[row]["DefectRemarks"].ToString();
  2429. if (dtDefect.Rows[row]["ProductionDataID"].ToString() != "")
  2430. {
  2431. defect.ProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDataID"].ToString());
  2432. }
  2433. if (dtDefect.Rows[row]["DefectProductionDataID"].ToString() != "")
  2434. {
  2435. defect.DefectProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["DefectProductionDataID"].ToString());
  2436. }
  2437. if (dtDefect.Rows[row]["DefectFineID"].ToString() != "")
  2438. {
  2439. defect.DefectFineID = Convert.ToInt32(dtDefect.Rows[row]["DefectFineID"].ToString());
  2440. }
  2441. defect.DefectFineValue = dtDefect.Rows[row]["DefectFineValue"].ToString();
  2442. defect.CheckTime = Convert.ToDateTime(dtDefect.Rows[row]["CheckTime"]);
  2443. //--------责任员工-------------------
  2444. DataRow[] drRow = reworkDs.Tables[2].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[row]["ProductionDefectID"]);
  2445. if (drRow.Length > Constant.INT_IS_ZERO)
  2446. {
  2447. foreach (DataRow r in drRow)
  2448. {
  2449. PDADefectResponsibleResult defectResponsible = new PDADefectResponsibleResult();
  2450. if (r["ProductionDefectID"].ToString() != "")
  2451. {
  2452. defectResponsible.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
  2453. }
  2454. if (r["StaffID"].ToString() != "")
  2455. {
  2456. defectResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
  2457. }
  2458. defectResponsible.StaffCode = r["StaffCode"].ToString();
  2459. defectResponsible.StaffName = r["StaffName"].ToString();
  2460. if (r["StaffStatus"].ToString() != "")
  2461. {
  2462. defectResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
  2463. }
  2464. if (r["UJobsID"].ToString() != "")
  2465. {
  2466. defectResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
  2467. }
  2468. if (r["SJobsID"].ToString() != "")
  2469. {
  2470. defectResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
  2471. }
  2472. defect.PDADefectResponsibles.Add(defectResponsible);
  2473. }
  2474. }
  2475. //------------------------------
  2476. //--------漏检员工-------------------
  2477. DataRow[] drMissedRow = reworkDs.Tables[4].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[i]["ProductionDefectID"]);
  2478. if (drMissedRow.Length > Constant.INT_IS_ZERO)
  2479. {
  2480. foreach (DataRow r in drMissedRow)
  2481. {
  2482. PDADefectMissedResponsibleResult defectMissedResponsible = new PDADefectMissedResponsibleResult();
  2483. if (r["ProductionDefectID"].ToString() != "")
  2484. {
  2485. defectMissedResponsible.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
  2486. }
  2487. if (r["StaffID"].ToString() != "")
  2488. {
  2489. defectMissedResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
  2490. }
  2491. defectMissedResponsible.StaffCode = r["StaffCode"].ToString();
  2492. defectMissedResponsible.StaffName = r["StaffName"].ToString();
  2493. if (r["StaffStatus"].ToString() != "")
  2494. {
  2495. defectMissedResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
  2496. }
  2497. if (r["UJobsID"].ToString() != "")
  2498. {
  2499. defectMissedResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
  2500. }
  2501. if (r["SJobsID"].ToString() != "")
  2502. {
  2503. defectMissedResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
  2504. }
  2505. defect.PDADefectMissedResponsibles.Add(defectMissedResponsible);
  2506. }
  2507. }
  2508. //------------------------------
  2509. DataRow[] drImageRow = reworkDs.Tables[3].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[row]["ProductionDefectID"]);
  2510. if (drImageRow.Length > Constant.INT_IS_ZERO)
  2511. {
  2512. foreach (DataRow r in drImageRow)
  2513. {
  2514. PDADefectImageResult defectImage = new PDADefectImageResult();
  2515. if (r["ProductionDefectID"].ToString() != "")
  2516. {
  2517. defectImage.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
  2518. }
  2519. defectImage.Thumbnailpath = r["Thumbnailpath"].ToString();
  2520. //if (File.Exists(System.AppDomain.CurrentDomain.BaseDirectory + r["Imagepath"].ToString()))
  2521. //{
  2522. defectImage.Imagepath = r["Imagepath"].ToString();// r["Imagepath"].ToString();
  2523. //}
  2524. defect.PDADefectImageResults.Add(defectImage);
  2525. }
  2526. }
  2527. productionData.PDADefects.Add(defect);
  2528. }
  2529. if (productionDatas.PDAProductionData == null)
  2530. {
  2531. productionDatas.PDAProductionData = new System.Collections.Generic.List<PDAProductionDataResult>();
  2532. }
  2533. productionDatas.PDAProductionData.Add(productionData);
  2534. //---------------------------------------------------------------------------------
  2535. }
  2536. }
  2537. actionResult.Result = JsonHelper.ToJson(productionDatas);
  2538. actionResult.Status = (int)Constant.PDAResult.Success;
  2539. }
  2540. else
  2541. {
  2542. actionResult.Status = (int)Constant.PDAResult.Fail;
  2543. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2544. }
  2545. }
  2546. catch (Exception ex)
  2547. {
  2548. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2549. OutputLog.TraceLog(LogPriority.Error,
  2550. this.ToString(),
  2551. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2552. ex.ToString(),
  2553. LocalPath.LogExePath);
  2554. actionResult.Status = (int)Constant.PDAResult.Exception;
  2555. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2556. }
  2557. return actionResult;
  2558. }
  2559. /// <summary>
  2560. /// 编辑后删除生产数据
  2561. /// </summary>
  2562. /// <param name="productionDataID">生产数据ID</param>
  2563. /// <returns>int</returns>
  2564. public ActionResult DeleteProductionDataByID(string accountCode, string userCode, string userPassword, string sessionKey, int productionDataID)
  2565. {
  2566. ActionResult actionResult = new ActionResult();
  2567. try
  2568. {
  2569. // 验证请求头信息
  2570. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2571. // 验证失败
  2572. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2573. {
  2574. return actionResult;
  2575. }
  2576. int row = ServiceInvoker.Invoke<int>(this,
  2577. () => PMModuleLogic.DeleteProductionDataByID(productionDataID));
  2578. actionResult.Result = JsonHelper.ToJson(row);
  2579. actionResult.Status = (int)Constant.PDAResult.Success;
  2580. }
  2581. catch (Exception ex)
  2582. {
  2583. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2584. OutputLog.TraceLog(LogPriority.Error,
  2585. this.ToString(),
  2586. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2587. ex.ToString(),
  2588. LocalPath.LogExePath);
  2589. actionResult.Status = (int)Constant.PDAResult.Exception;
  2590. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2591. }
  2592. return actionResult;
  2593. }
  2594. /// <summary>
  2595. /// 获取产品完成工序的ID
  2596. /// </summary>
  2597. /// <param name="barcode">产品条码</param>
  2598. /// <returns>int</returns>
  2599. public ActionResult GetCompleteProcedureID(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  2600. {
  2601. ActionResult actionResult = new ActionResult();
  2602. try
  2603. {
  2604. // 验证请求头信息
  2605. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2606. // 验证失败
  2607. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2608. {
  2609. return actionResult;
  2610. }
  2611. int row = ServiceInvoker.Invoke<int>(this,
  2612. () => PMModuleLogic.GetCompleteProcedureID(barcode));
  2613. actionResult.Result = JsonHelper.ToJson(row);
  2614. actionResult.Status = (int)Constant.PDAResult.Success;
  2615. }
  2616. catch (Exception ex)
  2617. {
  2618. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2619. OutputLog.TraceLog(LogPriority.Error,
  2620. this.ToString(),
  2621. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2622. ex.ToString(),
  2623. LocalPath.LogExePath);
  2624. actionResult.Status = (int)Constant.PDAResult.Exception;
  2625. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2626. }
  2627. return actionResult;
  2628. }
  2629. /// <summary>
  2630. /// 绑定图片
  2631. /// </summary>
  2632. /// <param name="accountCode">帐套code</param>
  2633. /// <param name="userCode">用户code</param>
  2634. /// <param name="userPassword">用户密码</param>
  2635. /// <param name="sessionKey">本次登陆密钥</param>
  2636. /// <param name="imagePath">图片路径</param>
  2637. /// <returns></returns>
  2638. public Stream BindDefectImage(string accountCode, string userCode, string userPassword, string sessionKey, string imagePath)
  2639. {
  2640. try
  2641. {
  2642. return ServiceInvoker.Invoke<Stream>(this, () => PDAModuleLogic.BindDefectImage(imagePath));
  2643. }
  2644. catch (Exception ex)
  2645. {
  2646. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2647. OutputLog.TraceLog(LogPriority.Error,
  2648. this.ToString(),
  2649. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2650. ex.ToString(),
  2651. LocalPath.LogExePath);
  2652. return null;
  2653. }
  2654. }
  2655. /// <summary>
  2656. /// 根据所选工号对应的工种,查出缺陷责任员工
  2657. /// </summary>
  2658. /// <param name="jobs">工种ID</param>
  2659. /// <returns></returns>
  2660. public ActionResult GetDutyStaffByUserJobsID(string accountCode, string userCode, string userPassword, string sessionKey, int jobs, int userid)
  2661. {
  2662. ActionResult actionResult = new ActionResult();
  2663. try
  2664. {
  2665. // 验证请求头信息
  2666. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2667. // 验证失败
  2668. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2669. {
  2670. return actionResult;
  2671. }
  2672. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2673. () => PDAModuleLogic.GetDutyStaffByUserJobsID(jobs, sUserInfo, userid));
  2674. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2675. {
  2676. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2677. actionResult.Status = (int)Constant.PDAResult.Success;
  2678. }
  2679. else
  2680. {
  2681. actionResult.Status = (int)Constant.PDAResult.Fail;
  2682. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2683. }
  2684. }
  2685. catch (Exception ex)
  2686. {
  2687. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2688. OutputLog.TraceLog(LogPriority.Error,
  2689. this.ToString(),
  2690. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2691. ex.ToString(),
  2692. LocalPath.LogExePath);
  2693. actionResult.Status = (int)Constant.PDAResult.Exception;
  2694. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2695. }
  2696. return actionResult;
  2697. }
  2698. #region 产品报废
  2699. /// <summary>
  2700. /// 验证废弃产品唯一性
  2701. /// </summary>
  2702. /// <param name="barcode">产品条码</param>
  2703. /// <returns>int</returns>
  2704. public ActionResult ScrapProductChack(string accountCode, string userCode, string userPassword, string sessionKey, string barCode)
  2705. {
  2706. ActionResult actionResult = new ActionResult();
  2707. try
  2708. {
  2709. // 验证请求头信息
  2710. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2711. // 验证失败
  2712. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2713. {
  2714. return actionResult;
  2715. }
  2716. string row = ServiceInvoker.Invoke<string>(this,
  2717. () => PDAModuleLogic.ScrapProductChack(barCode, sUserInfo));
  2718. string[] rm = row.Split(':');
  2719. actionResult.Result = rm[0];//JsonHelper.ToJson(rm[0]);
  2720. if (rm.Length > 1)
  2721. {
  2722. actionResult.Message = rm[1];
  2723. }
  2724. actionResult.Status = (int)Constant.PDAResult.Success;
  2725. }
  2726. catch (Exception ex)
  2727. {
  2728. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2729. OutputLog.TraceLog(LogPriority.Error,
  2730. this.ToString(),
  2731. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2732. ex.ToString(),
  2733. LocalPath.LogExePath);
  2734. actionResult.Status = (int)Constant.PDAResult.Exception;
  2735. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2736. }
  2737. return actionResult;
  2738. }
  2739. /// <summary>
  2740. /// 根据条码获取该产品的在产信息以及生产数据
  2741. /// </summary>
  2742. /// <param name="Barcode">产品条码</param>
  2743. /// <returns>装有两个DataTable的数据集,第一个是在产信息,第二个是生产数据</returns>
  2744. public ActionResult GetInProductionAndProductionData(string accountCode, string userCode, string userPassword, string sessionKey, string barCode)
  2745. {
  2746. ActionResult actionResult = new ActionResult();
  2747. try
  2748. {
  2749. // 验证请求头信息
  2750. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2751. // 验证失败
  2752. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2753. {
  2754. return actionResult;
  2755. }
  2756. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2757. () => PDAModuleLogic.GetInProductionAndProductionData(barCode, sUserInfo));
  2758. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2759. {
  2760. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2761. actionResult.Status = (int)Constant.PDAResult.Success;
  2762. }
  2763. else
  2764. {
  2765. actionResult.Status = (int)Constant.PDAResult.Fail;
  2766. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2767. }
  2768. }
  2769. catch (Exception ex)
  2770. {
  2771. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2772. OutputLog.TraceLog(LogPriority.Error,
  2773. this.ToString(),
  2774. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2775. ex.ToString(),
  2776. LocalPath.LogExePath);
  2777. actionResult.Status = (int)Constant.PDAResult.Exception;
  2778. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2779. }
  2780. return actionResult;
  2781. }
  2782. /// <summary>
  2783. /// 根据工号查询员工档案信息
  2784. /// </summary>
  2785. /// <param name="accountCode"></param>
  2786. /// <param name="userCode"></param>
  2787. /// <param name="userPassword"></param>
  2788. /// <param name="sessionKey"></param>
  2789. /// <param name="userId"></param>
  2790. /// <returns></returns>
  2791. public ActionResult SearchHrStaffInfo(string accountCode, string userCode, string userPassword, string sessionKey, int userId)
  2792. {
  2793. ActionResult actionResult = new ActionResult();
  2794. try
  2795. {
  2796. // 验证请求头信息
  2797. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2798. // 验证失败
  2799. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2800. {
  2801. return actionResult;
  2802. }
  2803. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2804. () => PDAModuleLogic.SearchHrStaffInfo(userId, sUserInfo));
  2805. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2806. {
  2807. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2808. actionResult.Status = (int)Constant.PDAResult.Success;
  2809. }
  2810. else
  2811. {
  2812. actionResult.Status = (int)Constant.PDAResult.Fail;
  2813. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2814. }
  2815. }
  2816. catch (Exception ex)
  2817. {
  2818. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2819. OutputLog.TraceLog(LogPriority.Error,
  2820. this.ToString(),
  2821. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2822. ex.ToString(),
  2823. LocalPath.LogExePath);
  2824. actionResult.Status = (int)Constant.PDAResult.Exception;
  2825. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2826. }
  2827. return actionResult;
  2828. }
  2829. /// <summary>
  2830. /// 添加废弃产品记录
  2831. /// </summary>
  2832. /// <param name="SProductEntity">废弃产品实体</param>
  2833. /// <param name="RProcedureEntity">废弃责任工序实体</param>
  2834. /// <param name="SResponsibleList">责任者集合</param>
  2835. /// <param name="userInfo">用户基本信息</param>
  2836. /// <returns>int结果返回值</returns>
  2837. /// <remarks>
  2838. /// 庄天威 2014.09.24 新建
  2839. /// </remarks>
  2840. public ActionResult AddScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey,
  2841. ScrapProductEntity SProductEntity, ResponProcedureEntity RProcedureEntity,
  2842. ScrapResponsibleEntity[] SResponsibleList)
  2843. {
  2844. ActionResult actionResult = new ActionResult();
  2845. if (SResponsibleList == null || SResponsibleList.Length == 0)
  2846. {
  2847. actionResult.Status = (int)Constant.PDAResult.Fail;
  2848. actionResult.Message = "没有选择责任人";
  2849. }
  2850. try
  2851. {
  2852. // 验证请求头信息
  2853. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2854. // 验证失败
  2855. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2856. {
  2857. return actionResult;
  2858. }
  2859. int addRow = ServiceInvoker.Invoke<int>(this,
  2860. () => PDAModuleLogic.AddScrapProduct(SProductEntity, RProcedureEntity, SResponsibleList, sUserInfo));
  2861. actionResult.Result = JsonHelper.ToJson(addRow);
  2862. actionResult.Status = (int)Constant.PDAResult.Success;
  2863. }
  2864. catch (Exception ex)
  2865. {
  2866. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2867. OutputLog.TraceLog(LogPriority.Error,
  2868. this.ToString(),
  2869. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2870. ex.ToString(),
  2871. LocalPath.LogExePath);
  2872. actionResult.Status = (int)Constant.PDAResult.Exception;
  2873. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2874. // TODO 空指针异常问题检测
  2875. try
  2876. {
  2877. OutputLog.TraceLog(LogPriority.Error,
  2878. this.ToString(),
  2879. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2880. "accountCode:" + accountCode + "#userCode:" + userCode + "#sessionKey:" + sessionKey,
  2881. LocalPath.LogExePath);
  2882. string json1 = JsonHelper.ToJson(SProductEntity);
  2883. OutputLog.TraceLog(LogPriority.Error,
  2884. this.ToString(),
  2885. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2886. "SProductEntity:" + json1,
  2887. LocalPath.LogExePath);
  2888. string json2 = JsonHelper.ToJson(RProcedureEntity);
  2889. OutputLog.TraceLog(LogPriority.Error,
  2890. this.ToString(),
  2891. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2892. "RProcedureEntity:" + json2,
  2893. LocalPath.LogExePath);
  2894. string json3 = JsonHelper.ToJson(SResponsibleList);
  2895. OutputLog.TraceLog(LogPriority.Error,
  2896. this.ToString(),
  2897. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2898. "SResponsibleList:" + json3,
  2899. LocalPath.LogExePath);
  2900. }
  2901. catch (Exception exc)
  2902. {
  2903. OutputLog.TraceLog(LogPriority.Error,
  2904. this.ToString(),
  2905. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2906. "参数输入异常:" + exc.Message,
  2907. LocalPath.LogExePath);
  2908. }
  2909. }
  2910. return actionResult;
  2911. }
  2912. /// <summary>
  2913. /// 获取产品分级的数据(根据ID)
  2914. /// </summary>
  2915. /// <param name="GoodsLevelTypeID">分类类别ID</param>
  2916. /// <param name="GoodsLevelID">分类ID</param>
  2917. /// <param name="sUserInfo">用户基本信息</param>
  2918. /// <returns>DataSet</returns>
  2919. /// <remarks>
  2920. /// 2014.10.22 庄天威 新建
  2921. public ActionResult GetGoodsLevelDataById(string accountCode, string userCode, string userPassword, string sessionKey, int? GoodsLevelTypeID)
  2922. {
  2923. ActionResult actionResult = new ActionResult();
  2924. try
  2925. {
  2926. // 验证请求头信息
  2927. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2928. // 验证失败
  2929. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2930. {
  2931. return actionResult;
  2932. }
  2933. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2934. () => SystemModuleLogic.GetGoodsLevelDataById(GoodsLevelTypeID, null, sUserInfo));
  2935. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2936. {
  2937. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2938. actionResult.Status = (int)Constant.PDAResult.Success;
  2939. }
  2940. else
  2941. {
  2942. actionResult.Status = (int)Constant.PDAResult.Fail;
  2943. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2944. }
  2945. }
  2946. catch (Exception ex)
  2947. {
  2948. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2949. OutputLog.TraceLog(LogPriority.Error,
  2950. this.ToString(),
  2951. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2952. ex.ToString(),
  2953. LocalPath.LogExePath);
  2954. actionResult.Status = (int)Constant.PDAResult.Exception;
  2955. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2956. }
  2957. return actionResult;
  2958. }
  2959. /// <summary>
  2960. /// 获取账务日期
  2961. /// </summary>
  2962. /// <param name="accountCode"></param>
  2963. /// <param name="userCode"></param>
  2964. /// <param name="userPassword"></param>
  2965. /// <param name="sessionKey"></param>
  2966. /// <returns></returns>
  2967. public ActionResult GetAccountDate(string accountCode, string userCode, string userPassword, string sessionKey)
  2968. {
  2969. ActionResult actionResult = new ActionResult();
  2970. try
  2971. {
  2972. // 验证请求头信息
  2973. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2974. // 验证失败
  2975. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2976. {
  2977. return actionResult;
  2978. }
  2979. DateTime reworkDs = ServiceInvoker.Invoke<DateTime>(this,
  2980. () => CommonModuleLogic.GetAccountDate(sUserInfo));
  2981. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2982. actionResult.Status = (int)Constant.PDAResult.Success;
  2983. }
  2984. catch (Exception ex)
  2985. {
  2986. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2987. OutputLog.TraceLog(LogPriority.Error,
  2988. this.ToString(),
  2989. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2990. ex.ToString(),
  2991. LocalPath.LogExePath);
  2992. actionResult.Status = (int)Constant.PDAResult.Exception;
  2993. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2994. }
  2995. return actionResult;
  2996. }
  2997. /// <summary>
  2998. /// 获取登陆帐户有无报损权限
  2999. /// </summary>
  3000. /// <param name="accountCode"></param>
  3001. /// <param name="userCode"></param>
  3002. /// <param name="userPassword"></param>
  3003. /// <param name="sessionKey"></param>
  3004. /// <param name="usercode">工号编码</param>
  3005. /// <returns></returns>
  3006. public ActionResult GetScrapFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  3007. {
  3008. ActionResult actionResult = new ActionResult();
  3009. try
  3010. {
  3011. // 验证请求头信息
  3012. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3013. // 验证失败
  3014. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3015. {
  3016. return actionResult;
  3017. }
  3018. int returnValue = ServiceInvoker.Invoke<int>(this,
  3019. () => PDAModuleLogic.GetScrapFuntion(userCode, sUserInfo));
  3020. actionResult.Result = JsonHelper.ToJson(returnValue);
  3021. actionResult.Status = (int)Constant.PDAResult.Success;
  3022. }
  3023. catch (Exception ex)
  3024. {
  3025. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3026. OutputLog.TraceLog(LogPriority.Error,
  3027. this.ToString(),
  3028. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3029. ex.ToString(),
  3030. LocalPath.LogExePath);
  3031. actionResult.Status = (int)Constant.PDAResult.Exception;
  3032. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3033. }
  3034. return actionResult;
  3035. }
  3036. #endregion
  3037. /// <summary>
  3038. /// 获取是否存在报损未审核产品
  3039. /// </summary>
  3040. /// <param name="barcode">产品条码</param>
  3041. /// <returns>int</returns>
  3042. public ActionResult GetScrapProductAuditStatus(string accountCode, string userCode, string userPassword, string sessionKey, string barCode)
  3043. {
  3044. ActionResult actionResult = new ActionResult();
  3045. try
  3046. {
  3047. // 验证请求头信息
  3048. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3049. // 验证失败
  3050. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3051. {
  3052. return actionResult;
  3053. }
  3054. int row = ServiceInvoker.Invoke<int>(this,
  3055. () => PDAModuleLogic.GetScrapProductAuditStatus(barCode));
  3056. actionResult.Result = JsonHelper.ToJson(row);
  3057. actionResult.Status = (int)Constant.PDAResult.Success;
  3058. }
  3059. catch (Exception ex)
  3060. {
  3061. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3062. OutputLog.TraceLog(LogPriority.Error,
  3063. this.ToString(),
  3064. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3065. ex.ToString(),
  3066. LocalPath.LogExePath);
  3067. actionResult.Status = (int)Constant.PDAResult.Exception;
  3068. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3069. }
  3070. return actionResult;
  3071. }
  3072. /// <summary>
  3073. /// 查询报废产品信息
  3074. /// </summary>
  3075. /// <param name="accountCode"></param>
  3076. /// <param name="userCode"></param>
  3077. /// <param name="userPassword"></param>
  3078. /// <param name="sessionKey"></param>
  3079. /// <param name="barCode">产品条码</param>
  3080. /// <param name="scrapProductID">报废产品ID</param>
  3081. /// <returns></returns>
  3082. public ActionResult GetScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barCode, int scrapProductID)
  3083. {
  3084. ActionResult actionResult = new ActionResult();
  3085. try
  3086. {
  3087. // 验证请求头信息
  3088. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3089. // 验证失败
  3090. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3091. {
  3092. return actionResult;
  3093. }
  3094. ScrapProductEntity selectProEntity = new ScrapProductEntity();
  3095. selectProEntity.BarCode = barCode;
  3096. selectProEntity.ScrapProductID = scrapProductID;
  3097. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3098. () => PMModuleLogic.GetScrapProduct(selectProEntity, sUserInfo));
  3099. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3100. {
  3101. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3102. actionResult.Status = (int)Constant.PDAResult.Success;
  3103. }
  3104. else
  3105. {
  3106. actionResult.Status = (int)Constant.PDAResult.Fail;
  3107. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3108. }
  3109. }
  3110. catch (Exception ex)
  3111. {
  3112. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3113. OutputLog.TraceLog(LogPriority.Error,
  3114. this.ToString(),
  3115. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3116. ex.ToString(),
  3117. LocalPath.LogExePath);
  3118. actionResult.Status = (int)Constant.PDAResult.Exception;
  3119. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3120. }
  3121. return actionResult;
  3122. }
  3123. /// <summary>
  3124. /// 根据废弃产品ID获取责任工序
  3125. /// </summary>
  3126. /// <param name="accountCode"></param>
  3127. /// <param name="userCode"></param>
  3128. /// <param name="userPassword"></param>
  3129. /// <param name="sessionKey"></param>
  3130. /// <param name="scrapProductID">报废产品ID</param>
  3131. /// <returns></returns>
  3132. public ActionResult GetResponProcedureBySPId(string accountCode, string userCode, string userPassword, string sessionKey, int scrapProductID)
  3133. {
  3134. ActionResult actionResult = new ActionResult();
  3135. try
  3136. {
  3137. // 验证请求头信息
  3138. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3139. // 验证失败
  3140. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3141. {
  3142. return actionResult;
  3143. }
  3144. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3145. () => PMModuleLogic.GetResponProcedureBySPId(scrapProductID));
  3146. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3147. {
  3148. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3149. actionResult.Status = (int)Constant.PDAResult.Success;
  3150. }
  3151. else
  3152. {
  3153. actionResult.Status = (int)Constant.PDAResult.Fail;
  3154. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3155. }
  3156. }
  3157. catch (Exception ex)
  3158. {
  3159. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3160. OutputLog.TraceLog(LogPriority.Error,
  3161. this.ToString(),
  3162. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3163. ex.ToString(),
  3164. LocalPath.LogExePath);
  3165. actionResult.Status = (int)Constant.PDAResult.Exception;
  3166. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3167. }
  3168. return actionResult;
  3169. }
  3170. /// <summary>
  3171. /// 根据废弃产品ID获取责任人列表
  3172. /// </summary>
  3173. /// <param name="accountCode"></param>
  3174. /// <param name="userCode"></param>
  3175. /// <param name="userPassword"></param>
  3176. /// <param name="sessionKey"></param>
  3177. /// <param name="scrapProductID">报废产品ID</param>
  3178. /// <returns></returns>
  3179. public ActionResult GetScrapResponsibleBySPId(string accountCode, string userCode, string userPassword, string sessionKey, int scrapProductID)
  3180. {
  3181. ActionResult actionResult = new ActionResult();
  3182. try
  3183. {
  3184. // 验证请求头信息
  3185. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3186. // 验证失败
  3187. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3188. {
  3189. return actionResult;
  3190. }
  3191. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3192. () => PMModuleLogic.GetScrapResponsibleBySPId(scrapProductID));
  3193. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3194. {
  3195. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3196. actionResult.Status = (int)Constant.PDAResult.Success;
  3197. }
  3198. else
  3199. {
  3200. actionResult.Status = (int)Constant.PDAResult.Fail;
  3201. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3202. }
  3203. }
  3204. catch (Exception ex)
  3205. {
  3206. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3207. OutputLog.TraceLog(LogPriority.Error,
  3208. this.ToString(),
  3209. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3210. ex.ToString(),
  3211. LocalPath.LogExePath);
  3212. actionResult.Status = (int)Constant.PDAResult.Exception;
  3213. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3214. }
  3215. return actionResult;
  3216. }
  3217. /// <summary>
  3218. /// 添加废弃产品记录
  3219. /// </summary>
  3220. /// <param name="SProductEntity">废弃产品实体</param>
  3221. /// <param name="RProcedureEntity">废弃责任工序实体</param>
  3222. /// <param name="SResponsibleList">责任者集合</param>
  3223. /// <param name="userInfo">用户基本信息</param>
  3224. /// <returns>int结果返回值</returns>
  3225. /// <remarks>
  3226. /// 庄天威 2014.09.24 新建
  3227. /// </remarks>
  3228. public ActionResult UpdateScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, ScrapProductEntity UpdateSProductEntity,
  3229. ResponProcedureEntity UpdateRProcedureEntity,
  3230. ScrapResponsibleEntity[] UpdateSResponsibleList, ScrapResponsibleEntity[] YSResponsibleList)
  3231. {
  3232. ActionResult actionResult = new ActionResult();
  3233. try
  3234. {
  3235. // 验证请求头信息
  3236. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3237. // 验证失败
  3238. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3239. {
  3240. return actionResult;
  3241. }
  3242. int addRow = ServiceInvoker.Invoke<int>(this,
  3243. () => PDAModuleLogic.UpdateScrapProduct(UpdateSProductEntity, UpdateRProcedureEntity, UpdateSResponsibleList, YSResponsibleList, sUserInfo));
  3244. actionResult.Result = JsonHelper.ToJson(addRow);
  3245. actionResult.Status = (int)Constant.PDAResult.Success;
  3246. }
  3247. catch (Exception ex)
  3248. {
  3249. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3250. OutputLog.TraceLog(LogPriority.Error,
  3251. this.ToString(),
  3252. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3253. ex.ToString(),
  3254. LocalPath.LogExePath);
  3255. actionResult.Status = (int)Constant.PDAResult.Exception;
  3256. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3257. }
  3258. return actionResult;
  3259. }
  3260. /// <summary>
  3261. /// 获取产品窑炉
  3262. /// </summary>
  3263. /// <param name="accountCode"></param>
  3264. /// <param name="userCode"></param>
  3265. /// <param name="userPassword"></param>
  3266. /// <param name="sessionKey"></param>
  3267. /// <returns>Datase</returns>
  3268. public ActionResult GetAllKilntInfo(string accountCode, string userCode, string userPassword, string sessionKey)
  3269. {
  3270. ActionResult actionResult = new ActionResult();
  3271. try
  3272. {
  3273. // 验证请求头信息
  3274. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3275. // 验证失败
  3276. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3277. {
  3278. return actionResult;
  3279. }
  3280. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3281. () => PDAModuleLogic.GetAllKilntInfo(sUserInfo));
  3282. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3283. {
  3284. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3285. actionResult.Status = (int)Constant.PDAResult.Success;
  3286. }
  3287. else
  3288. {
  3289. actionResult.Status = (int)Constant.PDAResult.Fail;
  3290. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3291. }
  3292. }
  3293. catch (Exception ex)
  3294. {
  3295. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3296. OutputLog.TraceLog(LogPriority.Error,
  3297. this.ToString(),
  3298. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3299. ex.ToString(),
  3300. LocalPath.LogExePath);
  3301. actionResult.Status = (int)Constant.PDAResult.Exception;
  3302. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3303. }
  3304. return actionResult;
  3305. }
  3306. /// <summary>
  3307. /// 获取次品产品条码允许编辑
  3308. /// </summary>
  3309. /// <param name="accountCode"></param>
  3310. /// <param name="userCode"></param>
  3311. /// <param name="userPassword"></param>
  3312. /// <param name="sessionKey"></param>
  3313. /// <param name="barcode">产品条码</param>
  3314. /// <returns>Datase</returns>
  3315. public ActionResult GetSubstandardInfo(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3316. {
  3317. ActionResult actionResult = new ActionResult();
  3318. try
  3319. {
  3320. // 验证请求头信息
  3321. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3322. // 验证失败
  3323. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3324. {
  3325. return actionResult;
  3326. }
  3327. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3328. () => PDAModuleLogic.GetSubstandardInfo(barcode));
  3329. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3330. {
  3331. actionResult.Result = JsonHelper.ToJson(1);
  3332. actionResult.Status = (int)Constant.PDAResult.Success;
  3333. }
  3334. else
  3335. {
  3336. actionResult.Result = JsonHelper.ToJson(0);
  3337. actionResult.Status = (int)Constant.PDAResult.Fail;
  3338. actionResult.Message = "次品条码:" + barcode + "不允许修改";
  3339. }
  3340. }
  3341. catch (Exception ex)
  3342. {
  3343. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3344. OutputLog.TraceLog(LogPriority.Error,
  3345. this.ToString(),
  3346. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3347. ex.ToString(),
  3348. LocalPath.LogExePath);
  3349. actionResult.Status = (int)Constant.PDAResult.Exception;
  3350. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3351. }
  3352. return actionResult;
  3353. }
  3354. /// <summary>
  3355. /// 获取产品条码是否重烧
  3356. /// </summary>
  3357. /// <param name="accountCode"></param>
  3358. /// <param name="userCode"></param>
  3359. /// <param name="userPassword"></param>
  3360. /// <param name="sessionKey"></param>
  3361. /// <param name="barcode">产品条码</param>
  3362. /// <returns>Datase</returns>
  3363. public ActionResult GetReFine(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3364. {
  3365. ActionResult actionResult = new ActionResult();
  3366. try
  3367. {
  3368. // 验证请求头信息
  3369. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3370. // 验证失败
  3371. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3372. {
  3373. return actionResult;
  3374. }
  3375. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3376. () => PDAModuleLogic.GetReFine(barcode));
  3377. if (reworkDs != null && reworkDs.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  3378. {
  3379. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(reworkDs.Tables[0].Rows[0]["IsReFire"]));
  3380. }
  3381. else
  3382. {
  3383. actionResult.Result = JsonHelper.ToJson(0);
  3384. }
  3385. actionResult.Status = (int)Constant.PDAResult.Success;
  3386. }
  3387. catch (Exception ex)
  3388. {
  3389. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3390. OutputLog.TraceLog(LogPriority.Error,
  3391. this.ToString(),
  3392. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3393. ex.ToString(),
  3394. LocalPath.LogExePath);
  3395. actionResult.Status = (int)Constant.PDAResult.Exception;
  3396. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3397. }
  3398. return actionResult;
  3399. }
  3400. /// <summary>
  3401. /// 获取登陆帐户有无成检编辑权限
  3402. /// </summary>
  3403. /// <param name="accountCode"></param>
  3404. /// <param name="userCode"></param>
  3405. /// <param name="userPassword"></param>
  3406. /// <param name="sessionKey"></param>
  3407. /// <param name="usercode">工号编码</param>
  3408. /// <returns></returns>
  3409. public ActionResult GetFinishedProductEditFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  3410. {
  3411. ActionResult actionResult = new ActionResult();
  3412. try
  3413. {
  3414. // 验证请求头信息
  3415. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3416. // 验证失败
  3417. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3418. {
  3419. return actionResult;
  3420. }
  3421. int returnValue = ServiceInvoker.Invoke<int>(this,
  3422. () => PDAModuleLogic.GetFinishedProductEditFuntion(sUserInfo));
  3423. actionResult.Result = JsonHelper.ToJson(returnValue);
  3424. actionResult.Status = (int)Constant.PDAResult.Success;
  3425. }
  3426. catch (Exception ex)
  3427. {
  3428. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3429. OutputLog.TraceLog(LogPriority.Error,
  3430. this.ToString(),
  3431. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3432. ex.ToString(),
  3433. LocalPath.LogExePath);
  3434. actionResult.Status = (int)Constant.PDAResult.Exception;
  3435. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3436. }
  3437. return actionResult;
  3438. }
  3439. /// <summary>
  3440. /// 根据条码及工序判断是否漏扫
  3441. /// </summary>
  3442. /// <param name="accountCode"></param>
  3443. /// <param name="userCode"></param>
  3444. /// <param name="userPassword"></param>
  3445. /// <param name="sessionKey"></param>
  3446. /// <param name="usercode">工号编码</param>
  3447. /// <param name="barcode">产品条码</param>
  3448. /// <param name="produceid">工序ID</param>
  3449. /// <returns></returns>
  3450. public ActionResult AddBarCodeMissing(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int produceid)
  3451. {
  3452. ActionResult actionResult = new ActionResult();
  3453. try
  3454. {
  3455. // 验证请求头信息
  3456. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3457. // 验证失败
  3458. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3459. {
  3460. return actionResult;
  3461. }
  3462. int returnValue = 1;
  3463. //int returnValue = ServiceInvoker.Invoke<int>(this,
  3464. // () => PMModuleLogicDAL.AddBarCodeMissing(barcode, produceid, sUserInfo));
  3465. actionResult.Result = JsonHelper.ToJson(returnValue);
  3466. actionResult.Status = (int)Constant.PDAResult.Success;
  3467. }
  3468. catch (Exception ex)
  3469. {
  3470. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3471. OutputLog.TraceLog(LogPriority.Error,
  3472. this.ToString(),
  3473. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3474. ex.ToString(),
  3475. LocalPath.LogExePath);
  3476. actionResult.Status = (int)Constant.PDAResult.Exception;
  3477. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3478. }
  3479. return actionResult;
  3480. }
  3481. /// <summary>
  3482. /// 获取登陆帐户有无报损审批权限
  3483. /// </summary>
  3484. /// <param name="accountCode"></param>
  3485. /// <param name="userCode"></param>
  3486. /// <param name="userPassword"></param>
  3487. /// <param name="sessionKey"></param>
  3488. /// <param name="usercode">工号编码</param>
  3489. /// <returns></returns>
  3490. public ActionResult GetScrapProductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  3491. {
  3492. ActionResult actionResult = new ActionResult();
  3493. try
  3494. {
  3495. // 验证请求头信息
  3496. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3497. // 验证失败
  3498. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3499. {
  3500. return actionResult;
  3501. }
  3502. int returnValue = ServiceInvoker.Invoke<int>(this,
  3503. () => PDAModuleLogic.GetScrapProductFuntion(sUserInfo));
  3504. actionResult.Result = JsonHelper.ToJson(returnValue);
  3505. actionResult.Status = (int)Constant.PDAResult.Success;
  3506. }
  3507. catch (Exception ex)
  3508. {
  3509. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3510. OutputLog.TraceLog(LogPriority.Error,
  3511. this.ToString(),
  3512. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3513. ex.ToString(),
  3514. LocalPath.LogExePath);
  3515. actionResult.Status = (int)Constant.PDAResult.Exception;
  3516. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3517. }
  3518. return actionResult;
  3519. }
  3520. /// <summary>
  3521. /// 获取登陆帐户有无报损审批权限
  3522. /// </summary>
  3523. /// <param name="accountCode"></param>
  3524. /// <param name="userCode"></param>
  3525. /// <param name="userPassword"></param>
  3526. /// <param name="sessionKey"></param>
  3527. /// <param name="usercode">工号编码</param>
  3528. /// <returns></returns>
  3529. public ActionResult GetSpecialRepairflagByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3530. {
  3531. ActionResult actionResult = new ActionResult();
  3532. try
  3533. {
  3534. // 验证请求头信息
  3535. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3536. // 验证失败
  3537. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3538. {
  3539. return actionResult;
  3540. }
  3541. int returnValue = ServiceInvoker.Invoke<int>(this,
  3542. () => PMModuleLogic.GetSpecialRepairflagByBarcode(barcode, sUserInfo));
  3543. actionResult.Result = JsonHelper.ToJson(returnValue);
  3544. actionResult.Status = (int)Constant.PDAResult.Success;
  3545. }
  3546. catch (Exception ex)
  3547. {
  3548. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3549. OutputLog.TraceLog(LogPriority.Error,
  3550. this.ToString(),
  3551. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3552. ex.ToString(),
  3553. LocalPath.LogExePath);
  3554. actionResult.Status = (int)Constant.PDAResult.Exception;
  3555. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3556. }
  3557. return actionResult;
  3558. }
  3559. /// <summary>
  3560. /// 获取窑车对应产品列表
  3561. /// </summary>
  3562. /// <param name="accountCode"></param>
  3563. /// <param name="userCode"></param>
  3564. /// <param name="userPassword"></param>
  3565. /// <param name="sessionKey"></param>
  3566. /// <param name="KilnCarID">窑车ID</param>
  3567. /// <returns>Dataset</returns>
  3568. public ActionResult GetKilnCarGoodsByKilnCarID(string accountCode, string userCode, string userPassword, string sessionKey, int KilnCarID)
  3569. {
  3570. ActionResult actionResult = new ActionResult();
  3571. try
  3572. {
  3573. // 验证请求头信息
  3574. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3575. // 验证失败
  3576. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3577. {
  3578. return actionResult;
  3579. }
  3580. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3581. () => PMModuleLogic.GetKilnCarGoodsByKilnCarID(KilnCarID));
  3582. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3583. {
  3584. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3585. actionResult.Status = (int)Constant.PDAResult.Success;
  3586. }
  3587. else
  3588. {
  3589. actionResult.Status = (int)Constant.PDAResult.Fail;
  3590. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3591. }
  3592. }
  3593. catch (Exception ex)
  3594. {
  3595. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3596. OutputLog.TraceLog(LogPriority.Error,
  3597. this.ToString(),
  3598. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3599. ex.ToString(),
  3600. LocalPath.LogExePath);
  3601. actionResult.Status = (int)Constant.PDAResult.Exception;
  3602. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3603. }
  3604. return actionResult;
  3605. }
  3606. /// <summary>
  3607. /// 更换条码
  3608. /// </summary>
  3609. /// <param name="accountCode"></param>
  3610. /// <param name="userCode"></param>
  3611. /// <param name="userPassword"></param>
  3612. /// <param name="sessionKey"></param>
  3613. ///<param name="barcode">原条码</param>
  3614. /// <param name="newBarcode">新条码</param>
  3615. /// <param name="remarks">备注</param>
  3616. /// <returns>操作结果</returns>
  3617. public ActionResult SaveBarCodeChange(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, string newBarcode, string remarks, string groutingUserCode, string goodsCode)
  3618. {
  3619. ActionResult actionResult = new ActionResult();
  3620. try
  3621. {
  3622. // 验证请求头信息
  3623. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3624. // 验证失败
  3625. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3626. {
  3627. return actionResult;
  3628. }
  3629. ServiceResultEntity serviceResultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  3630. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SetFPM0201Data(sUserInfo, barcode, newBarcode, remarks, groutingUserCode, goodsCode));
  3631. if (serviceResultEntity.Status == Constant.ServiceResultStatus.Success)
  3632. {
  3633. actionResult.Result = 1;
  3634. actionResult.Status = (int)Constant.PDAResult.Success;
  3635. }
  3636. else
  3637. {
  3638. actionResult.Status = (int)Constant.PDAResult.Fail;
  3639. actionResult.Message = serviceResultEntity.Message;
  3640. }
  3641. }
  3642. catch (Exception ex)
  3643. {
  3644. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3645. OutputLog.TraceLog(LogPriority.Error,
  3646. this.ToString(),
  3647. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3648. ex.ToString(),
  3649. LocalPath.LogExePath);
  3650. actionResult.Status = (int)Constant.PDAResult.Exception;
  3651. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3652. }
  3653. return actionResult;
  3654. }
  3655. /// <summary>
  3656. /// 获取(注浆登记)的查询数据
  3657. /// </summary>
  3658. /// <param name="accountCode"></param>
  3659. /// <param name="userCode"></param>
  3660. /// <param name="userPassword"></param>
  3661. /// <param name="sessionKey"></param>
  3662. /// <param name="se">查询条件</param>
  3663. /// <returns>Dataset</returns>
  3664. public ActionResult GetGroutingList(string accountCode, string userCode, string userPassword, string sessionKey, FPM0202_SE se)
  3665. {
  3666. ActionResult actionResult = new ActionResult();
  3667. try
  3668. {
  3669. // 验证请求头信息
  3670. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3671. // 验证失败
  3672. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3673. {
  3674. return actionResult;
  3675. }
  3676. ServiceResultEntity serviceResultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  3677. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetFPM0202SData(sUserInfo, se));
  3678. if (serviceResultEntity.Status != Constant.ServiceResultStatus.NoSearchResults)
  3679. {
  3680. // PDA不显示的列删除掉
  3681. //serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingDailyDetailID");
  3682. //serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingDailyID");
  3683. serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingLineName");
  3684. serviceResultEntity.Data.Tables[0].Columns.Remove("UserCode");
  3685. serviceResultEntity.Data.Tables[0].Columns.Remove("GoodsName");
  3686. serviceResultEntity.Data.Tables[0].Columns.Remove("GMouldStatusName");
  3687. serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingCount");
  3688. serviceResultEntity.Data.Tables[0].Columns.Remove("Remarks");
  3689. serviceResultEntity.Data.Tables[0].Columns.Remove("GMouldTypeName");
  3690. //serviceResultEntity.Data.Tables[0].Columns.Remove("DMUserCode");
  3691. serviceResultEntity.Data.Tables[0].Columns.Remove("IsPublicBody");
  3692. actionResult.Result = JsonHelper.ToJson(serviceResultEntity.Data.Tables[0]);
  3693. actionResult.Status = (int)Constant.PDAResult.Success;
  3694. }
  3695. else
  3696. {
  3697. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3698. actionResult.Message = "无查询数据";
  3699. }
  3700. }
  3701. catch (Exception ex)
  3702. {
  3703. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3704. OutputLog.TraceLog(LogPriority.Error,
  3705. this.ToString(),
  3706. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3707. ex.ToString(),
  3708. LocalPath.LogExePath);
  3709. actionResult.Status = (int)Constant.PDAResult.Exception;
  3710. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3711. }
  3712. return actionResult;
  3713. }
  3714. /// <summary>
  3715. /// 获取(注浆登记)的查询数据
  3716. /// </summary>
  3717. /// <param name="accountCode"></param>
  3718. /// <param name="userCode"></param>
  3719. /// <param name="userPassword"></param>
  3720. /// <param name="sessionKey"></param>
  3721. /// <param name="se">查询条件</param>
  3722. /// <returns>Dataset</returns>
  3723. public ActionResult GetGroutingListByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3724. {
  3725. ActionResult actionResult = new ActionResult();
  3726. try
  3727. {
  3728. // 验证请求头信息
  3729. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3730. // 验证失败
  3731. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3732. {
  3733. return actionResult;
  3734. }
  3735. ServiceResultEntity serviceResultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  3736. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetFPM0203SData(sUserInfo, barcode));
  3737. if (serviceResultEntity.Status != Constant.ServiceResultStatus.NoSearchResults)
  3738. {
  3739. actionResult.Result = JsonHelper.ToJson(serviceResultEntity.Data.Tables[0]);
  3740. actionResult.Status = (int)Constant.PDAResult.Success;
  3741. }
  3742. else
  3743. {
  3744. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3745. actionResult.Message = "无查询数据";
  3746. }
  3747. }
  3748. catch (Exception ex)
  3749. {
  3750. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3751. OutputLog.TraceLog(LogPriority.Error,
  3752. this.ToString(),
  3753. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3754. ex.ToString(),
  3755. LocalPath.LogExePath);
  3756. actionResult.Status = (int)Constant.PDAResult.Exception;
  3757. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3758. }
  3759. return actionResult;
  3760. }
  3761. /// <summary>
  3762. ///获得成型线信息
  3763. /// </summary>
  3764. /// <param name="accountCode"></param>
  3765. /// <param name="userCode"></param>
  3766. /// <param name="userPassword"></param>
  3767. /// <param name="sessionKey"></param>
  3768. /// <param name="se">查询条件</param>
  3769. /// <returns>Dataset</returns>
  3770. public ActionResult GetGroutingLine(string accountCode, string userCode, string userPassword, string sessionKey, GroutingLineEntity groutingLineEntity)
  3771. {
  3772. ActionResult actionResult = new ActionResult();
  3773. try
  3774. {
  3775. // 验证请求头信息
  3776. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3777. // 验证失败
  3778. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3779. {
  3780. return actionResult;
  3781. }
  3782. DataSet dsReturn = ServiceInvoker.Invoke<DataSet>(this,
  3783. () => Dongke.IBOSS.PRD.Service.PCModuleLogic.PCModuleLogic.GetGroutingLine(groutingLineEntity, sUserInfo));
  3784. if (dsReturn != null && dsReturn.Tables[0].Rows.Count > 0)
  3785. {
  3786. actionResult.Result = JsonHelper.ToJson(dsReturn.Tables[0]);
  3787. actionResult.Status = (int)Constant.PDAResult.Success;
  3788. }
  3789. else
  3790. {
  3791. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3792. actionResult.Message = "无查询数据";
  3793. }
  3794. }
  3795. catch (Exception ex)
  3796. {
  3797. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3798. OutputLog.TraceLog(LogPriority.Error,
  3799. this.ToString(),
  3800. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3801. ex.ToString(),
  3802. LocalPath.LogExePath);
  3803. actionResult.Status = (int)Constant.PDAResult.Exception;
  3804. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3805. }
  3806. return actionResult;
  3807. }
  3808. /// <summary>
  3809. ///获取在产产品的信息标识列表
  3810. /// </summary>
  3811. /// <param name="accountCode"></param>
  3812. /// <param name="userCode"></param>
  3813. /// <param name="userPassword"></param>
  3814. /// <param name="sessionKey"></param>
  3815. /// <param name="barcode">查询条件</param>
  3816. /// <returns>Dataset</returns>
  3817. public ActionResult GetInProductionDataList(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3818. {
  3819. ActionResult actionResult = new ActionResult();
  3820. try
  3821. {
  3822. // 验证请求头信息
  3823. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3824. // 验证失败
  3825. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3826. {
  3827. return actionResult;
  3828. }
  3829. DataSet dsReturn = ServiceInvoker.Invoke<DataSet>(this,
  3830. () => PMModuleLogic.GetInProductionDataList(barcode));
  3831. if (dsReturn != null && dsReturn.Tables[0].Rows.Count > 0)
  3832. {
  3833. actionResult.Result = JsonHelper.ToJson(dsReturn.Tables[0]);
  3834. actionResult.Status = (int)Constant.PDAResult.Success;
  3835. }
  3836. else
  3837. {
  3838. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3839. actionResult.Message = "无查询数据";
  3840. }
  3841. }
  3842. catch (Exception ex)
  3843. {
  3844. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3845. OutputLog.TraceLog(LogPriority.Error,
  3846. this.ToString(),
  3847. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3848. ex.ToString(),
  3849. LocalPath.LogExePath);
  3850. actionResult.Status = (int)Constant.PDAResult.Exception;
  3851. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3852. }
  3853. return actionResult;
  3854. }
  3855. /// <summary>
  3856. ///获取条码是否注浆登记过,0行无效
  3857. /// </summary>
  3858. /// <param name="accountCode"></param>
  3859. /// <param name="userCode"></param>
  3860. /// <param name="userPassword"></param>
  3861. /// <param name="sessionKey"></param>
  3862. /// <param name="barcode">查询条件</param>
  3863. /// <returns>Dataset</returns>
  3864. public ActionResult GetBarCodeInGroutingDailyDetail(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3865. {
  3866. ActionResult actionResult = new ActionResult();
  3867. try
  3868. {
  3869. // 验证请求头信息
  3870. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3871. // 验证失败
  3872. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3873. {
  3874. return actionResult;
  3875. }
  3876. DataSet dsReturn = ServiceInvoker.Invoke<DataSet>(this,
  3877. () => PMModuleLogic.GetBarCodeInGroutingDailyDetail(barcode));
  3878. if (dsReturn != null && dsReturn.Tables[0].Rows.Count > 0)
  3879. {
  3880. actionResult.Result = JsonHelper.ToJson(dsReturn.Tables[0]);
  3881. actionResult.Status = (int)Constant.PDAResult.Success;
  3882. }
  3883. else
  3884. {
  3885. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3886. actionResult.Message = "该产品条码无效,无法报损!";
  3887. }
  3888. }
  3889. catch (Exception ex)
  3890. {
  3891. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3892. OutputLog.TraceLog(LogPriority.Error,
  3893. this.ToString(),
  3894. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3895. ex.ToString(),
  3896. LocalPath.LogExePath);
  3897. actionResult.Status = (int)Constant.PDAResult.Exception;
  3898. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3899. }
  3900. return actionResult;
  3901. }
  3902. /// <summary>
  3903. /// 获取登陆帐户有变更条码权限
  3904. /// </summary>
  3905. /// <param name="accountCode"></param>
  3906. /// <param name="userCode"></param>
  3907. /// <param name="userPassword"></param>
  3908. /// <param name="sessionKey"></param>
  3909. /// <returns></returns>
  3910. public ActionResult GetBarCodeRecordFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  3911. {
  3912. ActionResult actionResult = new ActionResult();
  3913. try
  3914. {
  3915. // 验证请求头信息
  3916. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3917. // 验证失败
  3918. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3919. {
  3920. return actionResult;
  3921. }
  3922. int returnValue = ServiceInvoker.Invoke<int>(this,
  3923. () => PDAModuleLogic.GetBarCodeRecordFuntion(sUserInfo));
  3924. actionResult.Result = JsonHelper.ToJson(returnValue);
  3925. actionResult.Status = (int)Constant.PDAResult.Success;
  3926. }
  3927. catch (Exception ex)
  3928. {
  3929. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3930. OutputLog.TraceLog(LogPriority.Error,
  3931. this.ToString(),
  3932. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3933. ex.ToString(),
  3934. LocalPath.LogExePath);
  3935. actionResult.Status = (int)Constant.PDAResult.Exception;
  3936. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3937. }
  3938. return actionResult;
  3939. }
  3940. /// <summary>
  3941. /// 成检时获取此条码是否报损
  3942. /// </summary>
  3943. /// <param name="accountCode"></param>
  3944. /// <param name="userCode"></param>
  3945. /// <param name="userPassword"></param>
  3946. /// <param name="sessionKey"></param>
  3947. /// <param name="barcode">产品条码</param>
  3948. /// <returns></returns>
  3949. public ActionResult CheckScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3950. {
  3951. ActionResult actionResult = new ActionResult();
  3952. try
  3953. {
  3954. // 验证请求头信息
  3955. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3956. // 验证失败
  3957. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3958. {
  3959. return actionResult;
  3960. }
  3961. int returnValue = ServiceInvoker.Invoke<int>(this,
  3962. () => PMModuleLogic.CheckScrapProduct(barcode));
  3963. if (returnValue == -100)
  3964. {
  3965. actionResult.Result = JsonHelper.ToJson(returnValue);
  3966. actionResult.Status = (int)Constant.PDAResult.Success;
  3967. }
  3968. else
  3969. {
  3970. actionResult.Status = (int)Constant.PDAResult.Fail;
  3971. if (returnValue == 0)
  3972. {
  3973. actionResult.Message = "该条码:" + barcode + "存在报损记录(待审批)";
  3974. }
  3975. else
  3976. {
  3977. actionResult.Message = "该条码:" + barcode + "存在报损记录(审批通过)";
  3978. }
  3979. }
  3980. }
  3981. catch (Exception ex)
  3982. {
  3983. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3984. OutputLog.TraceLog(LogPriority.Error,
  3985. this.ToString(),
  3986. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3987. ex.ToString(),
  3988. LocalPath.LogExePath);
  3989. actionResult.Status = (int)Constant.PDAResult.Exception;
  3990. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3991. }
  3992. return actionResult;
  3993. }
  3994. /// <summary>
  3995. /// 获取产品完成工序的ID(PDA)
  3996. /// </summary>
  3997. /// <param name="barcode">产品条码</param>
  3998. /// <returns>int</returns>
  3999. public ActionResult GetCompleteProcedureIDPDA(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  4000. {
  4001. ActionResult actionResult = new ActionResult();
  4002. try
  4003. {
  4004. // 验证请求头信息
  4005. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4006. // 验证失败
  4007. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4008. {
  4009. return actionResult;
  4010. }
  4011. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4012. () => PMModuleLogic.GetCompleteProcedureIDPDA(barcode));
  4013. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  4014. actionResult.Status = (int)Constant.PDAResult.Success;
  4015. }
  4016. catch (Exception ex)
  4017. {
  4018. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4019. OutputLog.TraceLog(LogPriority.Error,
  4020. this.ToString(),
  4021. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4022. ex.ToString(),
  4023. LocalPath.LogExePath);
  4024. actionResult.Status = (int)Constant.PDAResult.Exception;
  4025. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4026. }
  4027. return actionResult;
  4028. }
  4029. /// <summary>
  4030. /// 获取产品完成工序的ID(PDA)
  4031. /// </summary>
  4032. /// <param name="barcode">产品条码</param>
  4033. /// <returns>int</returns>
  4034. public ActionResult GetGoodsInfoBybarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  4035. {
  4036. ActionResult actionResult = new ActionResult();
  4037. try
  4038. {
  4039. // 验证请求头信息
  4040. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4041. // 验证失败
  4042. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4043. {
  4044. return actionResult;
  4045. }
  4046. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4047. () => PMModuleLogic.GetGoodsInfoBybarcode(barcode));
  4048. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  4049. actionResult.Status = (int)Constant.PDAResult.Success;
  4050. }
  4051. catch (Exception ex)
  4052. {
  4053. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4054. OutputLog.TraceLog(LogPriority.Error,
  4055. this.ToString(),
  4056. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4057. ex.ToString(),
  4058. LocalPath.LogExePath);
  4059. actionResult.Status = (int)Constant.PDAResult.Exception;
  4060. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4061. }
  4062. return actionResult;
  4063. }
  4064. /// <summary>
  4065. /// 成检-校验生产工号
  4066. /// </summary>
  4067. /// <param name="usercode">生产工号</param>
  4068. /// <returns>int</returns>
  4069. public ActionResult GetUserCode(string accountCode, string userCode, string userPassword, string sessionKey, string usercode)
  4070. {
  4071. ActionResult actionResult = new ActionResult();
  4072. try
  4073. {
  4074. // 验证请求头信息
  4075. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4076. // 验证失败
  4077. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4078. {
  4079. return actionResult;
  4080. }
  4081. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4082. () => PDAModuleLogic.GetUserCode(usercode, sUserInfo));
  4083. actionResult.Result = JsonHelper.ToJson(ds);
  4084. actionResult.Status = (int)Constant.PDAResult.Success;
  4085. }
  4086. catch (Exception ex)
  4087. {
  4088. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4089. OutputLog.TraceLog(LogPriority.Error,
  4090. this.ToString(),
  4091. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4092. ex.ToString(),
  4093. LocalPath.LogExePath);
  4094. actionResult.Status = (int)Constant.PDAResult.Exception;
  4095. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4096. }
  4097. return actionResult;
  4098. }
  4099. /// <summary>
  4100. /// 更新漏扫的成型工号
  4101. /// </summary>
  4102. /// <param name="accountCode"></param>
  4103. /// <param name="userCode"></param>
  4104. /// <param name="userPassword"></param>
  4105. /// <param name="sessionKey"></param>
  4106. /// <param name="groutingUserCode">成型工号</param>
  4107. /// <param name="missingID">漏扫ID</param>
  4108. /// <returns></returns>
  4109. public ActionResult UpdateGroutingUserCodeByMissingID(string accountCode, string userCode, string userPassword, string sessionKey, string groutingUserCode, int missingID)
  4110. {
  4111. ActionResult actionResult = new ActionResult();
  4112. try
  4113. {
  4114. // 验证请求头信息
  4115. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4116. // 验证失败
  4117. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4118. {
  4119. return actionResult;
  4120. }
  4121. int returnValue = ServiceInvoker.Invoke<int>(this,
  4122. () => PMModuleLogicDAL.UpdateGroutingUserCodeByMissingID(groutingUserCode, missingID, sUserInfo));
  4123. if (returnValue != -1)
  4124. {
  4125. actionResult.Result = JsonHelper.ToJson(returnValue);
  4126. actionResult.Status = (int)Constant.PDAResult.Success;
  4127. }
  4128. else
  4129. {
  4130. actionResult.Status = (int)Constant.PDAResult.Fail;
  4131. actionResult.Message = "存在无效的漏扫工号";
  4132. }
  4133. }
  4134. catch (Exception ex)
  4135. {
  4136. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4137. OutputLog.TraceLog(LogPriority.Error,
  4138. this.ToString(),
  4139. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4140. ex.ToString(),
  4141. LocalPath.LogExePath);
  4142. actionResult.Status = (int)Constant.PDAResult.Exception;
  4143. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4144. }
  4145. return actionResult;
  4146. }
  4147. /// <summary>
  4148. /// 在入窑工序检验窑车号是否存在
  4149. /// </summary>
  4150. /// <param name="accountCode"></param>
  4151. /// <param name="userCode"></param>
  4152. /// <param name="userPassword"></param>
  4153. /// <param name="sessionKey"></param>
  4154. /// <param name="kilncarcode">窑车编码</param>
  4155. /// <param name="procedureid">工序ID</param>
  4156. /// <returns></returns>
  4157. public ActionResult CheckKilnCarByIntoCar(string accountCode, string userCode, string userPassword, string sessionKey, string kilncarcode, int procedureid)
  4158. {
  4159. ActionResult actionResult = new ActionResult();
  4160. try
  4161. {
  4162. // 验证请求头信息
  4163. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4164. // 验证失败
  4165. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4166. {
  4167. return actionResult;
  4168. }
  4169. int returnValue = ServiceInvoker.Invoke<int>(this,
  4170. () => PMModuleLogicDAL.CheckKilnCarByIntoCar(kilncarcode, procedureid, sUserInfo));
  4171. if (returnValue == 1)
  4172. {
  4173. actionResult.Result = JsonHelper.ToJson(returnValue);
  4174. actionResult.Status = (int)Constant.PDAResult.Success;
  4175. }
  4176. else
  4177. {
  4178. actionResult.Status = (int)Constant.PDAResult.Fail;
  4179. if (returnValue == -99)
  4180. actionResult.Message = "窑炉车号无效";
  4181. else if (returnValue == -98)
  4182. actionResult.Message = "窑车己无产品";
  4183. else if (returnValue == -97)
  4184. actionResult.Message = "窑车没有入窑,不可以撤销";
  4185. else if (returnValue == -1)
  4186. actionResult.Message = "保存失败";
  4187. }
  4188. }
  4189. catch (Exception ex)
  4190. {
  4191. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4192. OutputLog.TraceLog(LogPriority.Error,
  4193. this.ToString(),
  4194. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4195. ex.ToString(),
  4196. LocalPath.LogExePath);
  4197. actionResult.Status = (int)Constant.PDAResult.Exception;
  4198. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4199. }
  4200. return actionResult;
  4201. }
  4202. /// <summary>
  4203. /// 获取盘点单列表
  4204. /// </summary>
  4205. /// <param name="sUserInfo"></param>
  4206. /// <returns></returns>
  4207. public ActionResult GetInCheckedList(string accountCode, string userCode, string userPassword, string sessionKey)
  4208. {
  4209. ActionResult actionResult = new ActionResult();
  4210. try
  4211. {
  4212. // 验证请求头信息
  4213. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4214. // 验证失败
  4215. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4216. {
  4217. return actionResult;
  4218. }
  4219. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4220. () => PMModuleLogic.GetInCheckedList(sUserInfo));
  4221. actionResult.Result = JsonHelper.ToJson(ds);
  4222. actionResult.Status = (int)Constant.PDAResult.Success;
  4223. }
  4224. catch (Exception ex)
  4225. {
  4226. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4227. OutputLog.TraceLog(LogPriority.Error,
  4228. this.ToString(),
  4229. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4230. ex.ToString(),
  4231. LocalPath.LogExePath);
  4232. actionResult.Status = (int)Constant.PDAResult.Exception;
  4233. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4234. }
  4235. return actionResult;
  4236. }
  4237. /// <summary>
  4238. /// 进行盘点操作
  4239. /// </summary>
  4240. /// <param name="accountCode"></param>
  4241. /// <param name="userCode"></param>
  4242. /// <param name="userPassword"></param>
  4243. /// <param name="sessionKey"></param>
  4244. /// <param name="InCheckedID">盘点单ID</param>
  4245. /// <param name="BarCode">产品条码</param>
  4246. /// <returns></returns>
  4247. public ActionResult UpdateInChecked(string accountCode, string userCode, string userPassword, string sessionKey, int InCheckedID, string BarCode)
  4248. {
  4249. ActionResult actionResult = new ActionResult();
  4250. try
  4251. {
  4252. // 验证请求头信息
  4253. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4254. // 验证失败
  4255. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4256. {
  4257. return actionResult;
  4258. }
  4259. int returnValue = ServiceInvoker.Invoke<int>(this,
  4260. () => PMModuleLogicDAL.UpdateInChecked(InCheckedID, BarCode, sUserInfo));
  4261. if (returnValue > 0)
  4262. {
  4263. actionResult.Result = JsonHelper.ToJson(returnValue);
  4264. actionResult.Status = (int)Constant.PDAResult.Success;
  4265. actionResult.Message = "产品" + BarCode + "盘点成功";
  4266. }
  4267. else if (returnValue == 10)
  4268. {
  4269. actionResult.Result = JsonHelper.ToJson(returnValue);
  4270. actionResult.Status = (int)Constant.PDAResult.Success;
  4271. actionResult.Message = "产品" + BarCode + "盘盈成功";
  4272. }
  4273. else
  4274. {
  4275. actionResult.Status = (int)Constant.PDAResult.Fail;
  4276. if (returnValue == -2)
  4277. actionResult.Message = "产品" + BarCode + "不是在产产品";
  4278. //if (returnValue == 10)
  4279. // actionResult.Message = "产品" + BarCode + "盘盈成功";
  4280. //if (returnValue > 0)
  4281. // actionResult.Message = "产品" + BarCode + "盘点成功";
  4282. if (returnValue == -22)
  4283. actionResult.Message = "产品" + BarCode + "己被其他工号盘点";
  4284. if (returnValue == -23)
  4285. actionResult.Message = "产品" + BarCode + "己被其他工号盘盈";
  4286. if (returnValue == -24)
  4287. actionResult.Message = "产品" + BarCode + "己被此工号盘点";
  4288. if (returnValue == -25)
  4289. actionResult.Message = "产品" + BarCode + "己被此工号盘盈";
  4290. else if (returnValue == 0)
  4291. actionResult.Message = "盘点失败";
  4292. }
  4293. }
  4294. catch (Exception ex)
  4295. {
  4296. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4297. OutputLog.TraceLog(LogPriority.Error,
  4298. this.ToString(),
  4299. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4300. ex.ToString(),
  4301. LocalPath.LogExePath);
  4302. actionResult.Status = (int)Constant.PDAResult.Exception;
  4303. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4304. }
  4305. return actionResult;
  4306. }
  4307. #region 班次配置
  4308. /// <summary>
  4309. /// 班次配置-通过工号获取工种列表
  4310. /// </summary>
  4311. /// <param name="userId">工号ID</param>
  4312. /// <returns></returns>
  4313. public ActionResult BindUserJobs(string accountCode, string userCode, string userPassword, string sessionKey, int userId)
  4314. {
  4315. ActionResult actionResult = new ActionResult();
  4316. try
  4317. {
  4318. // 验证请求头信息
  4319. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4320. // 验证失败
  4321. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4322. {
  4323. return actionResult;
  4324. }
  4325. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4326. () => SystemModuleLogic.GetJobByUserId(userId));
  4327. actionResult.Result = JsonHelper.ToJson(ds);
  4328. actionResult.Status = (int)Constant.PDAResult.Success;
  4329. }
  4330. catch (Exception ex)
  4331. {
  4332. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4333. OutputLog.TraceLog(LogPriority.Error,
  4334. this.ToString(),
  4335. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4336. ex.ToString(),
  4337. LocalPath.LogExePath);
  4338. actionResult.Status = (int)Constant.PDAResult.Exception;
  4339. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4340. }
  4341. return actionResult;
  4342. }
  4343. ///// <summary>
  4344. ///// 班次配置-根据工号查询员工档案信息
  4345. ///// </summary>
  4346. ///// <param name="userId">工号ID</param>
  4347. ///// <returns></returns>
  4348. //public ActionResult SearchHrStaffInfo(string accountCode, string userCode, string userPassword, string sessionKey, int userId)
  4349. //{
  4350. // ActionResult actionResult = new ActionResult();
  4351. // try
  4352. // {
  4353. // // 验证请求头信息
  4354. // actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4355. // // 验证失败
  4356. // if (actionResult.Status != (int)Constant.PDAResult.Success)
  4357. // {
  4358. // return actionResult;
  4359. // }
  4360. // DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4361. // () => HRModuleLogic.SearchHrStaffInfo(userId,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. /// <summary>
  4379. /// 班次配置-根据员工姓名查员工信息
  4380. /// </summary>
  4381. /// <param name="searchStaffEntity"></param>
  4382. /// <returns></returns>
  4383. public ActionResult SearchStaffInfo(string accountCode, string userCode, string userPassword, string sessionKey, SearchStaffEntity searchStaffEntity)
  4384. {
  4385. ActionResult actionResult = new ActionResult();
  4386. try
  4387. {
  4388. // 验证请求头信息
  4389. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4390. // 验证失败
  4391. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4392. {
  4393. return actionResult;
  4394. }
  4395. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4396. () => PDAModuleLogic.SearchStaffInfo(searchStaffEntity, sUserInfo));
  4397. actionResult.Result = JsonHelper.ToJson(ds);
  4398. actionResult.Status = (int)Constant.PDAResult.Success;
  4399. }
  4400. catch (Exception ex)
  4401. {
  4402. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4403. OutputLog.TraceLog(LogPriority.Error,
  4404. this.ToString(),
  4405. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4406. ex.ToString(),
  4407. LocalPath.LogExePath);
  4408. actionResult.Status = (int)Constant.PDAResult.Exception;
  4409. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4410. }
  4411. return actionResult;
  4412. }
  4413. /// <summary>
  4414. /// 获取班次配置信息
  4415. /// </summary>
  4416. /// <param name="searchEntity"></param>
  4417. /// <returns></returns>
  4418. public ActionResult SearchClassesSetting(string accountCode, string userCode, string userPassword, string sessionKey, SearchClassesSettingEntity searchEntity)
  4419. {
  4420. ActionResult actionResult = new ActionResult();
  4421. try
  4422. {
  4423. // 验证请求头信息
  4424. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4425. // 验证失败
  4426. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4427. {
  4428. return actionResult;
  4429. }
  4430. searchEntity.StartAccountDate = Convert.ToDateTime(searchEntity.StartAccountDatePDA);
  4431. searchEntity.EndAccountDate = Convert.ToDateTime(searchEntity.EndAccountDatePDA).AddDays(1).AddMinutes(-1);
  4432. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4433. () => PCModuleLogic.SearchClassesSetting(searchEntity, sUserInfo));
  4434. actionResult.Result = JsonHelper.ToJson(ds);
  4435. actionResult.Status = (int)Constant.PDAResult.Success;
  4436. }
  4437. catch (Exception ex)
  4438. {
  4439. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4440. OutputLog.TraceLog(LogPriority.Error,
  4441. this.ToString(),
  4442. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4443. ex.ToString(),
  4444. LocalPath.LogExePath);
  4445. actionResult.Status = (int)Constant.PDAResult.Exception;
  4446. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4447. }
  4448. return actionResult;
  4449. }
  4450. public ActionResult SaveClassesSetting(string accountCode, string userCode, string userPassword, string sessionKey, ClassesSettingEntity setEntity, ClassesDetailSettingEntity[] setDetailEntity)
  4451. {
  4452. ActionResult actionResult = new ActionResult();
  4453. try
  4454. {
  4455. // 验证请求头信息
  4456. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4457. // 验证失败
  4458. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4459. {
  4460. return actionResult;
  4461. }
  4462. int returnValue = ServiceInvoker.Invoke<int>(this,
  4463. () => PDAModuleLogic.SaveClassesSetting(setEntity, setDetailEntity, sUserInfo));
  4464. if (returnValue > 0)
  4465. {
  4466. actionResult.Result = JsonHelper.ToJson(returnValue);
  4467. actionResult.Status = (int)Constant.PDAResult.Success;
  4468. }
  4469. else
  4470. {
  4471. actionResult.Status = (int)Constant.PDAResult.Fail;
  4472. actionResult.Message = "保存失败";
  4473. }
  4474. }
  4475. catch (Exception ex)
  4476. {
  4477. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4478. OutputLog.TraceLog(LogPriority.Error,
  4479. this.ToString(),
  4480. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4481. ex.ToString(),
  4482. LocalPath.LogExePath);
  4483. actionResult.Status = (int)Constant.PDAResult.Exception;
  4484. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4485. }
  4486. return actionResult;
  4487. }
  4488. /// <summary>
  4489. /// 班次配置--获取详细信息
  4490. /// </summary>
  4491. /// <param name="searchEntity"></param>
  4492. /// <returns></returns>
  4493. public ActionResult SearchClassesDetail(string accountCode, string userCode, string userPassword, string sessionKey, int classesSettingID)
  4494. {
  4495. ActionResult actionResult = new ActionResult();
  4496. try
  4497. {
  4498. // 验证请求头信息
  4499. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4500. // 验证失败
  4501. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4502. {
  4503. return actionResult;
  4504. }
  4505. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4506. () => PCModuleLogic.SearchClassesDetail(classesSettingID, sUserInfo));
  4507. actionResult.Result = JsonHelper.ToJson(ds);
  4508. actionResult.Status = (int)Constant.PDAResult.Success;
  4509. }
  4510. catch (Exception ex)
  4511. {
  4512. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4513. OutputLog.TraceLog(LogPriority.Error,
  4514. this.ToString(),
  4515. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4516. ex.ToString(),
  4517. LocalPath.LogExePath);
  4518. actionResult.Status = (int)Constant.PDAResult.Exception;
  4519. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4520. }
  4521. return actionResult;
  4522. }
  4523. /// <summary>
  4524. /// 获取用户是否有班次配置权限
  4525. /// </summary>
  4526. /// <param name="accountCode"></param>
  4527. /// <param name="userCode"></param>
  4528. /// <param name="userPassword"></param>
  4529. /// <param name="sessionKey"></param>
  4530. /// <returns></returns>
  4531. public ActionResult GetClassesSettingFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  4532. {
  4533. ActionResult actionResult = new ActionResult();
  4534. try
  4535. {
  4536. // 验证请求头信息
  4537. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4538. // 验证失败
  4539. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4540. {
  4541. return actionResult;
  4542. }
  4543. int returnValue = ServiceInvoker.Invoke<int>(this,
  4544. () => PDAModuleLogic.GetClassesSettingFuntion(sUserInfo));
  4545. actionResult.Result = JsonHelper.ToJson(returnValue);
  4546. actionResult.Status = (int)Constant.PDAResult.Success;
  4547. }
  4548. catch (Exception ex)
  4549. {
  4550. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4551. OutputLog.TraceLog(LogPriority.Error,
  4552. this.ToString(),
  4553. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4554. ex.ToString(),
  4555. LocalPath.LogExePath);
  4556. actionResult.Status = (int)Constant.PDAResult.Exception;
  4557. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4558. }
  4559. return actionResult;
  4560. }
  4561. /// <summary>
  4562. /// 获取盘点单列表
  4563. /// </summary>
  4564. /// <param name="sUserInfo"></param>
  4565. /// <returns></returns>
  4566. public ActionResult GetAllInChecked(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity)
  4567. {
  4568. ActionResult actionResult = new ActionResult();
  4569. try
  4570. {
  4571. // 验证请求头信息
  4572. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4573. // 验证失败
  4574. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4575. {
  4576. return actionResult;
  4577. }
  4578. entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA);
  4579. entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1);
  4580. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4581. () => PDAModuleLogic.GetAllInChecked(entity, sUserInfo));
  4582. actionResult.Result = JsonHelper.ToJson(ds);
  4583. actionResult.Status = (int)Constant.PDAResult.Success;
  4584. }
  4585. catch (Exception ex)
  4586. {
  4587. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4588. OutputLog.TraceLog(LogPriority.Error,
  4589. this.ToString(),
  4590. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4591. ex.ToString(),
  4592. LocalPath.LogExePath);
  4593. actionResult.Status = (int)Constant.PDAResult.Exception;
  4594. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4595. }
  4596. return actionResult;
  4597. }
  4598. #endregion
  4599. #region PDA报表
  4600. /// <summary>
  4601. /// 产品质量跟踪
  4602. /// </summary>
  4603. /// <param name="accountCode"></param>
  4604. /// <param name="userCode"></param>
  4605. /// <param name="userPassword"></param>
  4606. /// <param name="sessionKey"></param>
  4607. /// <param name="se"></param>
  4608. /// <returns></returns>
  4609. public ActionResult GetRPT040104SData(string accountCode, string userCode, string userPassword, string sessionKey, RPT040104_SE se)
  4610. {
  4611. ActionResult actionResult = new ActionResult();
  4612. try
  4613. {
  4614. // 验证请求头信息
  4615. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4616. // 验证失败
  4617. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4618. {
  4619. return actionResult;
  4620. }
  4621. se.CreateTimeStart = Convert.ToDateTime(se.CreateTimeStartPDA);
  4622. se.CreateTimeEnd = Convert.ToDateTime(se.CreateTimeEndPDA).AddDays(1);
  4623. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4624. () => PDAModuleLogic.GetRPT040104SData(sUserInfo, se));
  4625. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4626. {
  4627. actionResult.Status = (int)Constant.PDAResult.Fail;
  4628. actionResult.Message = Messages.MSG_CMN_I002;
  4629. }
  4630. else
  4631. {
  4632. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4633. actionResult.Status = (int)Constant.PDAResult.Success;
  4634. }
  4635. }
  4636. catch (Exception ex)
  4637. {
  4638. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4639. OutputLog.TraceLog(LogPriority.Error,
  4640. this.ToString(),
  4641. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4642. ex.ToString(),
  4643. LocalPath.LogExePath);
  4644. actionResult.Status = (int)Constant.PDAResult.Exception;
  4645. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4646. }
  4647. return actionResult;
  4648. }
  4649. /// <summary>
  4650. /// 工号产量质量分析表
  4651. /// </summary>
  4652. /// <param name="accountCode"></param>
  4653. /// <param name="userCode"></param>
  4654. /// <param name="userPassword"></param>
  4655. /// <param name="sessionKey"></param>
  4656. /// <param name="se"></param>
  4657. /// <returns></returns>
  4658. public ActionResult GetFP00002Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4659. int rptSProcedureID, string workcode, string date)
  4660. {
  4661. ActionResult actionResult = new ActionResult();
  4662. try
  4663. {
  4664. // 验证请求头信息
  4665. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4666. // 验证失败
  4667. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4668. {
  4669. return actionResult;
  4670. }
  4671. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4672. () => PDAModuleLogic.GetFP00002Data(sUserInfo, rptSProcedureID, workcode, Convert.ToDateTime(date)));
  4673. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4674. {
  4675. actionResult.Status = (int)Constant.PDAResult.Fail;
  4676. actionResult.Message = Messages.MSG_CMN_I002;
  4677. }
  4678. else
  4679. {
  4680. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4681. actionResult.Status = (int)Constant.PDAResult.Success;
  4682. }
  4683. }
  4684. catch (Exception ex)
  4685. {
  4686. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4687. OutputLog.TraceLog(LogPriority.Error,
  4688. this.ToString(),
  4689. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4690. ex.ToString(),
  4691. LocalPath.LogExePath);
  4692. actionResult.Status = (int)Constant.PDAResult.Exception;
  4693. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4694. }
  4695. return actionResult;
  4696. }
  4697. /// <summary>
  4698. /// 工号产量质量分析表(中陶)
  4699. /// </summary>
  4700. /// <param name="accountCode"></param>
  4701. /// <param name="userCode"></param>
  4702. /// <param name="userPassword"></param>
  4703. /// <param name="sessionKey"></param>
  4704. /// <param name="se"></param>
  4705. /// <returns></returns>
  4706. public ActionResult GetFP00002_1Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4707. int rptSProcedureID, string workcode, string date, string goodscode)
  4708. {
  4709. ActionResult actionResult = new ActionResult();
  4710. try
  4711. {
  4712. // 验证请求头信息
  4713. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4714. // 验证失败
  4715. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4716. {
  4717. return actionResult;
  4718. }
  4719. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4720. () => PDAModuleLogic.GetFP00002_1Data(sUserInfo, rptSProcedureID, workcode,
  4721. Convert.ToDateTime(date), goodscode));
  4722. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4723. {
  4724. actionResult.Status = (int)Constant.PDAResult.Fail;
  4725. actionResult.Message = Messages.MSG_CMN_I002;
  4726. }
  4727. else
  4728. {
  4729. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4730. actionResult.Status = (int)Constant.PDAResult.Success;
  4731. }
  4732. }
  4733. catch (Exception ex)
  4734. {
  4735. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4736. OutputLog.TraceLog(LogPriority.Error,
  4737. this.ToString(),
  4738. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4739. ex.ToString(),
  4740. LocalPath.LogExePath);
  4741. actionResult.Status = (int)Constant.PDAResult.Exception;
  4742. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4743. }
  4744. return actionResult;
  4745. }
  4746. /// <summary>
  4747. /// 半检数据统计表
  4748. /// </summary>
  4749. /// <param name="accountCode"></param>
  4750. /// <param name="userCode"></param>
  4751. /// <param name="userPassword"></param>
  4752. /// <param name="sessionKey"></param>
  4753. /// <param name="se"></param>
  4754. /// <returns></returns>
  4755. public ActionResult GetPDARPT000001Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4756. string workcode, string datebegin, string dateend)
  4757. {
  4758. ActionResult actionResult = new ActionResult();
  4759. try
  4760. {
  4761. // 验证请求头信息
  4762. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4763. // 验证失败
  4764. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4765. {
  4766. return actionResult;
  4767. }
  4768. DateTime datetimebegin = Convert.ToDateTime(datebegin);
  4769. DateTime datetimeend = Convert.ToDateTime(dateend);
  4770. datetimebegin = datetimebegin.Date;
  4771. datetimeend = datetimeend.Date.AddDays(1).AddSeconds(-1);
  4772. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4773. () => PDAModuleLogic.GetPDARPT000001Data(sUserInfo, workcode, datetimebegin, datetimeend));
  4774. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4775. {
  4776. actionResult.Status = (int)Constant.PDAResult.Fail;
  4777. actionResult.Message = Messages.MSG_CMN_I002;
  4778. }
  4779. else
  4780. {
  4781. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4782. actionResult.Status = (int)Constant.PDAResult.Success;
  4783. }
  4784. }
  4785. catch (Exception ex)
  4786. {
  4787. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4788. OutputLog.TraceLog(LogPriority.Error,
  4789. this.ToString(),
  4790. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4791. ex.ToString(),
  4792. LocalPath.LogExePath);
  4793. actionResult.Status = (int)Constant.PDAResult.Exception;
  4794. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4795. }
  4796. return actionResult;
  4797. }
  4798. /// <summary>
  4799. /// 工号质量统计表
  4800. /// </summary>
  4801. /// <param name="accountCode"></param>
  4802. /// <param name="userCode"></param>
  4803. /// <param name="userPassword"></param>
  4804. /// <param name="sessionKey"></param>
  4805. /// <param name="se"></param>
  4806. /// <returns></returns>
  4807. public ActionResult GetPDARPT000002Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4808. int rptSProcedureID, string workcode, string datebegin, string dateend)
  4809. {
  4810. ActionResult actionResult = new ActionResult();
  4811. try
  4812. {
  4813. // 验证请求头信息
  4814. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4815. // 验证失败
  4816. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4817. {
  4818. return actionResult;
  4819. }
  4820. DateTime datetimebegin = Convert.ToDateTime(datebegin);
  4821. DateTime datetimeend = Convert.ToDateTime(dateend);
  4822. datetimebegin = datetimebegin.Date;
  4823. datetimeend = datetimeend.Date.AddDays(1).AddSeconds(-1);
  4824. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4825. () => PDAModuleLogic.GetPDARPT000002Data(sUserInfo, rptSProcedureID, workcode, datetimebegin, datetimeend));
  4826. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4827. {
  4828. actionResult.Status = (int)Constant.PDAResult.Fail;
  4829. actionResult.Message = Messages.MSG_CMN_I002;
  4830. }
  4831. else
  4832. {
  4833. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4834. actionResult.Status = (int)Constant.PDAResult.Success;
  4835. }
  4836. }
  4837. catch (Exception ex)
  4838. {
  4839. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4840. OutputLog.TraceLog(LogPriority.Error,
  4841. this.ToString(),
  4842. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4843. ex.ToString(),
  4844. LocalPath.LogExePath);
  4845. actionResult.Status = (int)Constant.PDAResult.Exception;
  4846. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4847. }
  4848. return actionResult;
  4849. }
  4850. /// <summary>
  4851. /// 损坯数据统计表
  4852. /// </summary>
  4853. /// <param name="accountCode"></param>
  4854. /// <param name="userCode"></param>
  4855. /// <param name="userPassword"></param>
  4856. /// <param name="sessionKey"></param>
  4857. /// <param name="se"></param>
  4858. /// <returns></returns>
  4859. public ActionResult GetPDARPT000003Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4860. string workcode, string datebegin, string dateend)
  4861. {
  4862. ActionResult actionResult = new ActionResult();
  4863. try
  4864. {
  4865. // 验证请求头信息
  4866. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4867. // 验证失败
  4868. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4869. {
  4870. return actionResult;
  4871. }
  4872. DateTime datetimebegin = Convert.ToDateTime(datebegin);
  4873. DateTime datetimeend = Convert.ToDateTime(dateend);
  4874. datetimebegin = datetimebegin.Date;
  4875. datetimeend = datetimeend.Date.AddDays(1).AddSeconds(-1);
  4876. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4877. () => PDAModuleLogic.GetPDARPT000003Data(sUserInfo, workcode, datetimebegin, datetimeend));
  4878. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4879. {
  4880. actionResult.Status = (int)Constant.PDAResult.Fail;
  4881. actionResult.Message = Messages.MSG_CMN_I002;
  4882. }
  4883. else
  4884. {
  4885. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4886. actionResult.Status = (int)Constant.PDAResult.Success;
  4887. }
  4888. }
  4889. catch (Exception ex)
  4890. {
  4891. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4892. OutputLog.TraceLog(LogPriority.Error,
  4893. this.ToString(),
  4894. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4895. ex.ToString(),
  4896. LocalPath.LogExePath);
  4897. actionResult.Status = (int)Constant.PDAResult.Exception;
  4898. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4899. }
  4900. return actionResult;
  4901. }
  4902. #endregion
  4903. /// <summary>
  4904. /// 取得报表数据源数据
  4905. /// </summary>
  4906. /// <param name="accountCode"></param>
  4907. /// <param name="userCode"></param>
  4908. /// <param name="userPassword"></param>
  4909. /// <param name="sessionKey"></param>
  4910. /// <returns></returns>
  4911. public ActionResult GetRptProcedureModule(string accountCode, string userCode, string userPassword, string sessionKey)
  4912. {
  4913. ActionResult actionResult = new ActionResult();
  4914. try
  4915. {
  4916. // 验证请求头信息
  4917. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4918. // 验证失败
  4919. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4920. {
  4921. return actionResult;
  4922. }
  4923. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4924. () => ReportModuleLogic.GetRptProcedureModule(sUserInfo));
  4925. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4926. {
  4927. actionResult.Status = (int)Constant.PDAResult.Fail;
  4928. actionResult.Message = Messages.MSG_CMN_I002;
  4929. }
  4930. else
  4931. {
  4932. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4933. actionResult.Status = (int)Constant.PDAResult.Success;
  4934. }
  4935. }
  4936. catch (Exception ex)
  4937. {
  4938. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4939. OutputLog.TraceLog(LogPriority.Error,
  4940. this.ToString(),
  4941. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4942. ex.ToString(),
  4943. LocalPath.LogExePath);
  4944. actionResult.Status = (int)Constant.PDAResult.Exception;
  4945. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4946. }
  4947. return actionResult;
  4948. }
  4949. /// <summary>
  4950. /// 取得报表的查询数据源统计工序数据
  4951. /// </summary>
  4952. /// <param name="accountCode"></param>
  4953. /// <param name="userCode"></param>
  4954. /// <param name="userPassword"></param>
  4955. /// <param name="sessionKey"></param>
  4956. /// <param name="RptProcedureID"></param>
  4957. /// <returns></returns>
  4958. public ActionResult GetRptSourceProcedureModule(string accountCode, string userCode, string userPassword, string sessionKey, int? RptProcedureID)
  4959. {
  4960. ActionResult actionResult = new ActionResult();
  4961. try
  4962. {
  4963. // 验证请求头信息
  4964. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4965. // 验证失败
  4966. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4967. {
  4968. return actionResult;
  4969. }
  4970. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4971. () => ReportModuleLogic.GetRptSourceProcedureModule(sUserInfo, RptProcedureID));
  4972. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4973. {
  4974. actionResult.Status = (int)Constant.PDAResult.Fail;
  4975. actionResult.Message = Messages.MSG_CMN_I002;
  4976. }
  4977. else
  4978. {
  4979. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4980. actionResult.Status = (int)Constant.PDAResult.Success;
  4981. }
  4982. }
  4983. catch (Exception ex)
  4984. {
  4985. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4986. OutputLog.TraceLog(LogPriority.Error,
  4987. this.ToString(),
  4988. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4989. ex.ToString(),
  4990. LocalPath.LogExePath);
  4991. actionResult.Status = (int)Constant.PDAResult.Exception;
  4992. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4993. }
  4994. return actionResult;
  4995. }
  4996. /// <summary>
  4997. /// 获取用户是否有统计产成品权限
  4998. /// </summary>
  4999. /// <param name="accountCode"></param>
  5000. /// <param name="userCode"></param>
  5001. /// <param name="userPassword"></param>
  5002. /// <param name="sessionKey"></param>
  5003. /// <returns></returns>
  5004. public ActionResult GetStatisticsFinishedProductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5005. {
  5006. ActionResult actionResult = new ActionResult();
  5007. try
  5008. {
  5009. // 验证请求头信息
  5010. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5011. // 验证失败
  5012. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5013. {
  5014. return actionResult;
  5015. }
  5016. int returnValue = ServiceInvoker.Invoke<int>(this,
  5017. () => PDAModuleLogic.GetStatisticsFinishedProductFuntion(sUserInfo));
  5018. actionResult.Result = JsonHelper.ToJson(returnValue);
  5019. actionResult.Status = (int)Constant.PDAResult.Success;
  5020. }
  5021. catch (Exception ex)
  5022. {
  5023. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5024. OutputLog.TraceLog(LogPriority.Error,
  5025. this.ToString(),
  5026. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5027. ex.ToString(),
  5028. LocalPath.LogExePath);
  5029. actionResult.Status = (int)Constant.PDAResult.Exception;
  5030. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5031. }
  5032. return actionResult;
  5033. }
  5034. /// <summary>
  5035. /// 获取用户是否有盘点权限
  5036. /// </summary>
  5037. /// <param name="accountCode"></param>
  5038. /// <param name="userCode"></param>
  5039. /// <param name="userPassword"></param>
  5040. /// <param name="sessionKey"></param>
  5041. /// <returns></returns>
  5042. public ActionResult GetInCheckedFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5043. {
  5044. ActionResult actionResult = new ActionResult();
  5045. try
  5046. {
  5047. // 验证请求头信息
  5048. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5049. // 验证失败
  5050. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5051. {
  5052. return actionResult;
  5053. }
  5054. int returnValue = ServiceInvoker.Invoke<int>(this,
  5055. () => PDAModuleLogic.GetInCheckedFuntion(sUserInfo));
  5056. actionResult.Result = JsonHelper.ToJson(returnValue);
  5057. actionResult.Status = (int)Constant.PDAResult.Success;
  5058. }
  5059. catch (Exception ex)
  5060. {
  5061. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5062. OutputLog.TraceLog(LogPriority.Error,
  5063. this.ToString(),
  5064. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5065. ex.ToString(),
  5066. LocalPath.LogExePath);
  5067. actionResult.Status = (int)Constant.PDAResult.Exception;
  5068. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5069. }
  5070. return actionResult;
  5071. }
  5072. /// <summary>
  5073. /// 根据条件查询是否存在班次配置
  5074. /// </summary>
  5075. /// <param name="accountCode"></param>
  5076. /// <param name="userCode"></param>
  5077. /// <param name="userPassword"></param>
  5078. /// <param name="sessionKey"></param>
  5079. /// <param name="userCode">工号编码</param>
  5080. /// <returns></returns>
  5081. public ActionResult GetClassesSetting(string accountCode, string userCode, string userPassword, string sessionKey, string uCode)
  5082. {
  5083. ActionResult actionResult = new ActionResult();
  5084. try
  5085. {
  5086. // 验证请求头信息
  5087. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5088. // 验证失败
  5089. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5090. {
  5091. return actionResult;
  5092. }
  5093. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  5094. () => PDAModuleLogic.GetClassesSetting(uCode, sUserInfo));
  5095. actionResult.Result = JsonHelper.ToJson(ds);
  5096. actionResult.Status = (int)Constant.PDAResult.Success;
  5097. }
  5098. catch (Exception ex)
  5099. {
  5100. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5101. OutputLog.TraceLog(LogPriority.Error,
  5102. this.ToString(),
  5103. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5104. ex.ToString(),
  5105. LocalPath.LogExePath);
  5106. actionResult.Status = (int)Constant.PDAResult.Exception;
  5107. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5108. }
  5109. return actionResult;
  5110. }
  5111. /// <summary>
  5112. /// 报损工序查出工号根据生产数据ID
  5113. /// </summary>
  5114. /// <param name="accountCode"></param>
  5115. /// <param name="userCode"></param>
  5116. /// <param name="userPassword"></param>
  5117. /// <param name="sessionKey"></param>
  5118. /// <param name="ProductionDataID">生产数据ID</param>
  5119. /// <returns></returns>
  5120. public ActionResult GetScrapProductUserCodeByProductionDataID(string accountCode, string userCode, string userPassword, string sessionKey, int ProductionDataID)
  5121. {
  5122. ActionResult actionResult = new ActionResult();
  5123. try
  5124. {
  5125. // 验证请求头信息
  5126. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5127. // 验证失败
  5128. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5129. {
  5130. return actionResult;
  5131. }
  5132. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  5133. () => PMModuleLogic.GetScrapProductUserCodeByProductionDataID(ProductionDataID));
  5134. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  5135. {
  5136. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  5137. actionResult.Status = (int)Constant.PDAResult.Success;
  5138. }
  5139. else
  5140. {
  5141. actionResult.Status = (int)Constant.PDAResult.Fail;
  5142. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5143. }
  5144. }
  5145. catch (Exception ex)
  5146. {
  5147. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5148. OutputLog.TraceLog(LogPriority.Error,
  5149. this.ToString(),
  5150. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5151. ex.ToString(),
  5152. LocalPath.LogExePath);
  5153. actionResult.Status = (int)Constant.PDAResult.Exception;
  5154. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5155. }
  5156. return actionResult;
  5157. }
  5158. /// <summary>
  5159. /// 在入窑工序检验窑车号是否存在
  5160. /// </summary>
  5161. /// <param name="accountCode"></param>
  5162. /// <param name="userCode"></param>
  5163. /// <param name="userPassword"></param>
  5164. /// <param name="sessionKey"></param>
  5165. /// <param name="kilncarcode">窑车编码</param>
  5166. /// <param name="procedureid">工序ID</param>
  5167. /// <returns></returns>
  5168. public ActionResult CheckKilnCarByIntoCar2(string accountCode, string userCode, string userPassword, string sessionKey, string kilncarcode, int procedureid)
  5169. {
  5170. ActionResult actionResult = new ActionResult();
  5171. try
  5172. {
  5173. // 验证请求头信息
  5174. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5175. // 验证失败
  5176. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5177. {
  5178. return actionResult;
  5179. }
  5180. int returnValue = ServiceInvoker.Invoke<int>(this,
  5181. () => PMModuleLogicDAL.CheckKilnCarByIntoCar2(kilncarcode, procedureid, sUserInfo));
  5182. if (returnValue == 1)
  5183. {
  5184. actionResult.Result = JsonHelper.ToJson(returnValue);
  5185. actionResult.Status = (int)Constant.PDAResult.Success;
  5186. }
  5187. else
  5188. {
  5189. actionResult.Status = (int)Constant.PDAResult.Fail;
  5190. if (returnValue == -99)
  5191. actionResult.Message = "窑炉车号无效";
  5192. else if (returnValue == -98)
  5193. actionResult.Message = "窑车己无产品";
  5194. else if (returnValue == -97)
  5195. actionResult.Message = "窑车没有入窑,不可以撤销";
  5196. else if (returnValue == -1)
  5197. actionResult.Message = "保存失败";
  5198. }
  5199. }
  5200. catch (Exception ex)
  5201. {
  5202. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5203. OutputLog.TraceLog(LogPriority.Error,
  5204. this.ToString(),
  5205. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5206. ex.ToString(),
  5207. LocalPath.LogExePath);
  5208. actionResult.Status = (int)Constant.PDAResult.Exception;
  5209. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5210. }
  5211. return actionResult;
  5212. }
  5213. /// <summary>
  5214. /// 撤销包装
  5215. /// </summary>
  5216. /// <param name="accountCode"></param>
  5217. /// <param name="userCode"></param>
  5218. /// <param name="userPassword"></param>
  5219. /// <param name="sessionKey"></param>
  5220. /// <param name="barcode"></param>
  5221. /// <returns></returns>
  5222. public ActionResult AddChancelFinishedproduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5223. {
  5224. ActionResult actionResult = new ActionResult();
  5225. try
  5226. {
  5227. // 验证请求头信息
  5228. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5229. // 验证失败
  5230. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5231. {
  5232. return actionResult;
  5233. }
  5234. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5235. () => PMModuleLogicDAL.AddChancelFinishedproduct(barcode, sUserInfo));
  5236. if (Convert.ToInt32(returnValue.Result) > 0)
  5237. {
  5238. actionResult.Result = JsonHelper.ToJson(returnValue);
  5239. actionResult.Status = (int)Constant.PDAResult.Success;
  5240. }
  5241. else
  5242. {
  5243. actionResult.Status = (int)Constant.PDAResult.Fail;
  5244. if (Convert.ToInt32(returnValue.Result) == -1)
  5245. actionResult.Message = "产品条码不存在包装记录";
  5246. else if (Convert.ToInt32(returnValue.Result) == -200)
  5247. actionResult.Message = returnValue.Message;
  5248. else
  5249. actionResult.Message = "成品撤销失败";
  5250. }
  5251. }
  5252. catch (Exception ex)
  5253. {
  5254. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5255. OutputLog.TraceLog(LogPriority.Error,
  5256. this.ToString(),
  5257. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5258. ex.ToString(),
  5259. LocalPath.LogExePath);
  5260. actionResult.Status = (int)Constant.PDAResult.Exception;
  5261. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5262. }
  5263. return actionResult;
  5264. }
  5265. /*
  5266. /// <summary>
  5267. /// 获取用户是否有撤销包装权限
  5268. /// </summary>
  5269. /// <param name="accountCode"></param>
  5270. /// <param name="userCode"></param>
  5271. /// <param name="userPassword"></param>
  5272. /// <param name="sessionKey"></param>
  5273. /// <returns></returns>
  5274. public ActionResult GetChancelFinishedproductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5275. {
  5276. ActionResult actionResult = new ActionResult();
  5277. try
  5278. {
  5279. // 验证请求头信息
  5280. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5281. // 验证失败
  5282. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5283. {
  5284. return actionResult;
  5285. }
  5286. int returnValue = ServiceInvoker.Invoke<int>(this,
  5287. () => PDAModuleLogic.GetChancelFinishedproductFuntion(sUserInfo));
  5288. actionResult.Result = JsonHelper.ToJson(returnValue);
  5289. actionResult.Status = (int)Constant.PDAResult.Success;
  5290. }
  5291. catch (Exception ex)
  5292. {
  5293. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5294. OutputLog.TraceLog(LogPriority.Error,
  5295. this.ToString(),
  5296. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5297. ex.ToString(),
  5298. LocalPath.LogExePath);
  5299. actionResult.Status = (int)Constant.PDAResult.Exception;
  5300. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5301. }
  5302. return actionResult;
  5303. }
  5304. */
  5305. /// <summary>
  5306. /// 窑车状态明细表查询
  5307. /// </summary>
  5308. /// <param name="accountCode"></param>
  5309. /// <param name="userCode"></param>
  5310. /// <param name="userPassword"></param>
  5311. /// <param name="sessionKey"></param>
  5312. /// <param name="kilnCarCode"></param>
  5313. /// <returns></returns>
  5314. public ActionResult GetKilnCarStatusDetailByCode(string accountCode, string userCode, string userPassword, string sessionKey, string kilnCarCode)
  5315. {
  5316. ActionResult actionResult = new ActionResult();
  5317. try
  5318. {
  5319. // 验证请求头信息
  5320. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5321. // 验证失败
  5322. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5323. {
  5324. return actionResult;
  5325. }
  5326. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5327. () => ReportModuleLogic.GetKilnCarStatusDetailByCode(kilnCarCode, sUserInfo));
  5328. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  5329. {
  5330. actionResult.Status = (int)Constant.PDAResult.Fail;
  5331. actionResult.Message = Messages.MSG_CMN_I002;
  5332. }
  5333. else
  5334. {
  5335. actionResult.Result = JsonHelper.ToJson(sre.Data);
  5336. actionResult.Status = (int)Constant.PDAResult.Success;
  5337. }
  5338. }
  5339. catch (Exception ex)
  5340. {
  5341. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5342. OutputLog.TraceLog(LogPriority.Error,
  5343. this.ToString(),
  5344. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5345. ex.ToString(),
  5346. LocalPath.LogExePath);
  5347. actionResult.Status = (int)Constant.PDAResult.Exception;
  5348. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5349. }
  5350. return actionResult;
  5351. }
  5352. /// <summary>
  5353. /// 损坯撤销
  5354. /// </summary>
  5355. /// <param name="accountCode"></param>
  5356. /// <param name="userCode"></param>
  5357. /// <param name="userPassword"></param>
  5358. /// <param name="sessionKey"></param>
  5359. /// <param name="barcode"></param>
  5360. /// <returns></returns>
  5361. public ActionResult AddCancelScrapProduction(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5362. {
  5363. ActionResult actionResult = new ActionResult();
  5364. try
  5365. {
  5366. // 验证请求头信息
  5367. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5368. // 验证失败
  5369. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5370. {
  5371. return actionResult;
  5372. }
  5373. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5374. () => PMModuleLogicDAL.AddCancelScrapProduction(barcode, sUserInfo));
  5375. if (Convert.ToInt32(returnValue.Result) > 0)
  5376. {
  5377. actionResult.Result = JsonHelper.ToJson(returnValue);
  5378. actionResult.Status = (int)Constant.PDAResult.Success;
  5379. }
  5380. else
  5381. {
  5382. actionResult.Status = (int)Constant.PDAResult.Fail;
  5383. if (Convert.ToInt32(returnValue.Result) == -1)
  5384. actionResult.Message = "此产品没有损坯,不能撤销";
  5385. else if (Convert.ToInt32(returnValue.Result) == -200)
  5386. actionResult.Message = returnValue.Message;
  5387. else
  5388. actionResult.Message = "损坯撤销失败";
  5389. }
  5390. }
  5391. catch (Exception ex)
  5392. {
  5393. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5394. OutputLog.TraceLog(LogPriority.Error,
  5395. this.ToString(),
  5396. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5397. ex.ToString(),
  5398. LocalPath.LogExePath);
  5399. actionResult.Status = (int)Constant.PDAResult.Exception;
  5400. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5401. }
  5402. return actionResult;
  5403. }
  5404. /*
  5405. /// <summary>
  5406. /// 获取用户是否有损坯撤销权限
  5407. /// </summary>
  5408. /// <param name="accountCode"></param>
  5409. /// <param name="userCode"></param>
  5410. /// <param name="userPassword"></param>
  5411. /// <param name="sessionKey"></param>
  5412. /// <returns></returns>
  5413. public ActionResult GetCancelScrapProductionFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5414. {
  5415. ActionResult actionResult = new ActionResult();
  5416. try
  5417. {
  5418. // 验证请求头信息
  5419. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5420. // 验证失败
  5421. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5422. {
  5423. return actionResult;
  5424. }
  5425. int returnValue = ServiceInvoker.Invoke<int>(this,
  5426. () => PDAModuleLogic.GetCancelScrapProductionFuntion(sUserInfo));
  5427. actionResult.Result = JsonHelper.ToJson(returnValue);
  5428. actionResult.Status = (int)Constant.PDAResult.Success;
  5429. }
  5430. catch (Exception ex)
  5431. {
  5432. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5433. OutputLog.TraceLog(LogPriority.Error,
  5434. this.ToString(),
  5435. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5436. ex.ToString(),
  5437. LocalPath.LogExePath);
  5438. actionResult.Status = (int)Constant.PDAResult.Exception;
  5439. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5440. }
  5441. return actionResult;
  5442. }
  5443. */
  5444. /// <summary>
  5445. /// 获取条码注浆信息
  5446. /// </summary>
  5447. /// <param name="accountCode"></param>
  5448. /// <param name="userCode"></param>
  5449. /// <param name="userPassword"></param>
  5450. /// <param name="sessionKey"></param>
  5451. /// <returns></returns>
  5452. public ActionResult GetGroutingInfoBybarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5453. {
  5454. ActionResult actionResult = new ActionResult();
  5455. try
  5456. {
  5457. // 验证请求头信息
  5458. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5459. // 验证失败
  5460. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5461. {
  5462. return actionResult;
  5463. }
  5464. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  5465. () => PMModuleLogic.GetGroutingInfoBybarcode(barcode, sUserInfo));
  5466. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  5467. {
  5468. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  5469. actionResult.Status = (int)Constant.PDAResult.Success;
  5470. }
  5471. else
  5472. {
  5473. actionResult.Status = (int)Constant.PDAResult.Fail;
  5474. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5475. }
  5476. }
  5477. catch (Exception ex)
  5478. {
  5479. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5480. OutputLog.TraceLog(LogPriority.Error,
  5481. this.ToString(),
  5482. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5483. ex.ToString(),
  5484. LocalPath.LogExePath);
  5485. actionResult.Status = (int)Constant.PDAResult.Exception;
  5486. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5487. }
  5488. return actionResult;
  5489. }
  5490. /// <summary>
  5491. /// 获取条码注浆信息
  5492. /// </summary>
  5493. /// <param name="accountCode"></param>
  5494. /// <param name="userCode"></param>
  5495. /// <param name="userPassword"></param>
  5496. /// <param name="sessionKey"></param>
  5497. /// <returns></returns>
  5498. public ActionResult GetFinishedProductGroutingInfoBybarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5499. {
  5500. ActionResult actionResult = new ActionResult();
  5501. try
  5502. {
  5503. // 验证请求头信息
  5504. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5505. // 验证失败
  5506. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5507. {
  5508. return actionResult;
  5509. }
  5510. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  5511. () => PMModuleLogic.GetFinishedProductGroutingInfoBybarcode(barcode, sUserInfo));
  5512. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  5513. {
  5514. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  5515. actionResult.Status = (int)Constant.PDAResult.Success;
  5516. }
  5517. else
  5518. {
  5519. actionResult.Status = (int)Constant.PDAResult.Fail;
  5520. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5521. }
  5522. }
  5523. catch (Exception ex)
  5524. {
  5525. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5526. OutputLog.TraceLog(LogPriority.Error,
  5527. this.ToString(),
  5528. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5529. ex.ToString(),
  5530. LocalPath.LogExePath);
  5531. actionResult.Status = (int)Constant.PDAResult.Exception;
  5532. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5533. }
  5534. return actionResult;
  5535. }
  5536. /// <summary>
  5537. /// 公坯设定
  5538. /// </summary>
  5539. /// <param name="accountCode"></param>
  5540. /// <param name="userCode"></param>
  5541. /// <param name="userPassword"></param>
  5542. /// <param name="sessionKey"></param>
  5543. /// <param name="barcode"></param>
  5544. /// <returns></returns>
  5545. public ActionResult AddPublicBodyProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5546. {
  5547. ActionResult actionResult = new ActionResult();
  5548. try
  5549. {
  5550. // 验证请求头信息
  5551. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5552. // 验证失败
  5553. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5554. {
  5555. return actionResult;
  5556. }
  5557. int returnValue = ServiceInvoker.Invoke<int>(this,
  5558. () => PMModuleLogicDAL.AddPublicBodyProduct(barcode, sUserInfo));
  5559. if (returnValue > 0)
  5560. {
  5561. actionResult.Result = JsonHelper.ToJson(returnValue);
  5562. actionResult.Status = (int)Constant.PDAResult.Success;
  5563. }
  5564. else
  5565. {
  5566. actionResult.Status = (int)Constant.PDAResult.Fail;
  5567. if (returnValue == -1)
  5568. actionResult.Message = "此产品不在生产线上";
  5569. else if (returnValue == -2)
  5570. actionResult.Message = "该产品已经标识为公坯";
  5571. else
  5572. actionResult.Message = "公坯设定失败";
  5573. }
  5574. }
  5575. catch (Exception ex)
  5576. {
  5577. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5578. OutputLog.TraceLog(LogPriority.Error,
  5579. this.ToString(),
  5580. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5581. ex.ToString(),
  5582. LocalPath.LogExePath);
  5583. actionResult.Status = (int)Constant.PDAResult.Exception;
  5584. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5585. }
  5586. return actionResult;
  5587. }
  5588. /*
  5589. /// <summary>
  5590. /// 获取用户是否有公坯设定
  5591. /// </summary>
  5592. /// <param name="accountCode"></param>
  5593. /// <param name="userCode"></param>
  5594. /// <param name="userPassword"></param>
  5595. /// <param name="sessionKey"></param>
  5596. /// <returns></returns>
  5597. public ActionResult GetPublicBodyProductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5598. {
  5599. ActionResult actionResult = new ActionResult();
  5600. try
  5601. {
  5602. // 验证请求头信息
  5603. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5604. // 验证失败
  5605. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5606. {
  5607. return actionResult;
  5608. }
  5609. int returnValue = ServiceInvoker.Invoke<int>(this,
  5610. () => PDAModuleLogic.GetPublicBodyProductFuntion(sUserInfo));
  5611. actionResult.Result = JsonHelper.ToJson(returnValue);
  5612. actionResult.Status = (int)Constant.PDAResult.Success;
  5613. }
  5614. catch (Exception ex)
  5615. {
  5616. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5617. OutputLog.TraceLog(LogPriority.Error,
  5618. this.ToString(),
  5619. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5620. ex.ToString(),
  5621. LocalPath.LogExePath);
  5622. actionResult.Status = (int)Constant.PDAResult.Exception;
  5623. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5624. }
  5625. return actionResult;
  5626. }
  5627. */
  5628. /// <summary>
  5629. /// 校验产品条码是否可以走到该工序
  5630. /// </summary>
  5631. /// <param name="accountCode">帐套code</param>
  5632. /// <param name="userCode">用户code</param>
  5633. /// <param name="userPassword">用户密码</param>
  5634. /// <param name="sessionKey">本次登陆密钥</param>
  5635. /// <param name="procedureID">工序ID</param>
  5636. /// <param name="barcode">条码</param>
  5637. /// <returns></returns>
  5638. /// <remarks>
  5639. /// 陈冰 2014.09.18 新建
  5640. /// </remarks>
  5641. public ActionResult CheckBarcodeDeliverMud(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  5642. {
  5643. ActionResult actionResult = new ActionResult();
  5644. try
  5645. {
  5646. // 验证请求头信息
  5647. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5648. // 验证失败
  5649. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5650. {
  5651. return actionResult;
  5652. }
  5653. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  5654. () => PMModuleLogic.CheckBarcodeDeliverMud(procedureID, barcode, sUserInfo));
  5655. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  5656. {
  5657. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  5658. actionResult.Status = (int)Constant.PDAResult.Success;
  5659. }
  5660. else
  5661. {
  5662. actionResult.Status = (int)Constant.PDAResult.Fail;
  5663. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5664. }
  5665. }
  5666. catch (Exception ex)
  5667. {
  5668. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5669. OutputLog.TraceLog(LogPriority.Error,
  5670. this.ToString(),
  5671. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5672. ex.ToString(),
  5673. LocalPath.LogExePath);
  5674. actionResult.Status = (int)Constant.PDAResult.Exception;
  5675. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5676. }
  5677. return actionResult;
  5678. }
  5679. /// <summary>
  5680. /// 获取用户所有菜单权限
  5681. /// </summary>
  5682. /// <param name="accountCode"></param>
  5683. /// <param name="userCode"></param>
  5684. /// <param name="userPassword"></param>
  5685. /// <param name="sessionKey"></param>
  5686. /// <returns></returns>
  5687. public ActionResult GetUserAllFunction(string accountCode, string userCode, string userPassword, string sessionKey)
  5688. {
  5689. ActionResult actionResult = new ActionResult();
  5690. try
  5691. {
  5692. // 验证请求头信息
  5693. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5694. // 验证失败
  5695. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5696. {
  5697. return actionResult;
  5698. }
  5699. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  5700. () => PDAModuleLogic.GetUserAllFunction(sUserInfo));
  5701. actionResult.Result = JsonHelper.ToJson(returnValue);
  5702. actionResult.Status = (int)Constant.PDAResult.Success;
  5703. }
  5704. catch (Exception ex)
  5705. {
  5706. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5707. OutputLog.TraceLog(LogPriority.Error,
  5708. this.ToString(),
  5709. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5710. ex.ToString(),
  5711. LocalPath.LogExePath);
  5712. actionResult.Status = (int)Constant.PDAResult.Exception;
  5713. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5714. }
  5715. return actionResult;
  5716. }
  5717. public ActionResult AddChancelBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5718. {
  5719. ActionResult actionResult = new ActionResult();
  5720. try
  5721. {
  5722. // 验证请求头信息
  5723. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5724. // 验证失败
  5725. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5726. {
  5727. return actionResult;
  5728. }
  5729. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5730. () => PMModuleLogicDAL.AddChancelBarCode(barcode, sUserInfo));
  5731. if (Convert.ToInt32(returnValue.Result) > 0)
  5732. {
  5733. actionResult.Result = JsonHelper.ToJson(returnValue);
  5734. actionResult.Status = (int)Constant.PDAResult.Success;
  5735. }
  5736. else
  5737. {
  5738. actionResult.Status = (int)Constant.PDAResult.Fail;
  5739. if (Convert.ToInt32(returnValue.Result) == -1)
  5740. actionResult.Message = "无效条码";
  5741. else if (Convert.ToInt32(returnValue.Result) == -2)
  5742. actionResult.Message = "已经生产完成";
  5743. else if (Convert.ToInt32(returnValue.Result) == -3)
  5744. actionResult.Message = "条码已经申请报废";
  5745. else if (Convert.ToInt32(returnValue.Result) == -4)
  5746. actionResult.Message = "此条码当前工序不允许进行撤销";
  5747. else if (Convert.ToInt32(returnValue.Result) == -5)
  5748. actionResult.Message = "此条码没有生产数据";
  5749. else if (Convert.ToInt32(returnValue.Result) == -6)
  5750. actionResult.Message = "没有当前工序权限";
  5751. else if (Convert.ToInt32(returnValue.Result) == -7)
  5752. actionResult.Message = "条码不在生产线上";
  5753. else if (Convert.ToInt32(returnValue.Result) == -8)
  5754. actionResult.Message = "操作用户无此工序的撤销范围权限";
  5755. else if (Convert.ToInt32(returnValue.Result) == -9)
  5756. actionResult.Message = "条码已经是返工状态";
  5757. else if (Convert.ToInt32(returnValue.Result) == -200)
  5758. actionResult.Message = returnValue.Message;
  5759. }
  5760. }
  5761. catch (Exception ex)
  5762. {
  5763. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5764. OutputLog.TraceLog(LogPriority.Error,
  5765. this.ToString(),
  5766. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5767. ex.ToString(),
  5768. LocalPath.LogExePath);
  5769. actionResult.Status = (int)Constant.PDAResult.Exception;
  5770. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5771. }
  5772. return actionResult;
  5773. }
  5774. public ActionResult AddChancelDeliverMudBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5775. {
  5776. ActionResult actionResult = new ActionResult();
  5777. try
  5778. {
  5779. // 验证请求头信息
  5780. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5781. // 验证失败
  5782. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5783. {
  5784. return actionResult;
  5785. }
  5786. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5787. () => PMModuleLogicDAL.AddChancelDeliverMudBarCode(barcode, sUserInfo));
  5788. if (Convert.ToInt32(returnValue.Result) > 0)
  5789. {
  5790. actionResult.Result = JsonHelper.ToJson(returnValue);
  5791. actionResult.Status = (int)Constant.PDAResult.Success;
  5792. }
  5793. else
  5794. {
  5795. actionResult.Status = (int)Constant.PDAResult.Fail;
  5796. if (Convert.ToInt32(returnValue.Result) == -1)
  5797. actionResult.Message = "无效条码";
  5798. else if (Convert.ToInt32(returnValue.Result) == -2)
  5799. actionResult.Message = "已经生产完成";
  5800. else if (Convert.ToInt32(returnValue.Result) == -3)
  5801. actionResult.Message = "条码已经申请报废";
  5802. else if (Convert.ToInt32(returnValue.Result) == -4)
  5803. actionResult.Message = "此条码当前工序不允许进行撤销";
  5804. else if (Convert.ToInt32(returnValue.Result) == -5)
  5805. actionResult.Message = "此条码没有生产数据";
  5806. else if (Convert.ToInt32(returnValue.Result) == -55)
  5807. actionResult.Message = "条码已经不在交坯工序,不允许撤销";
  5808. else if (Convert.ToInt32(returnValue.Result) == -6)
  5809. actionResult.Message = "没有任何影响行";
  5810. else if (Convert.ToInt32(returnValue.Result) == -7)
  5811. actionResult.Message = "条码不在生产线上";
  5812. else if (Convert.ToInt32(returnValue.Result) == -8)
  5813. actionResult.Message = "条码已经是返工状态";
  5814. else if (Convert.ToInt32(returnValue.Result) == -200)
  5815. actionResult.Message = returnValue.Message;
  5816. }
  5817. }
  5818. catch (Exception ex)
  5819. {
  5820. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5821. OutputLog.TraceLog(LogPriority.Error,
  5822. this.ToString(),
  5823. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5824. ex.ToString(),
  5825. LocalPath.LogExePath);
  5826. actionResult.Status = (int)Constant.PDAResult.Exception;
  5827. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5828. }
  5829. return actionResult;
  5830. }
  5831. public ActionResult GetAllLogoInfo(string accountCode, string userCode, string userPassword, string sessionKey)
  5832. {
  5833. ActionResult actionResult = new ActionResult();
  5834. try
  5835. {
  5836. // 验证请求头信息
  5837. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5838. // 验证失败
  5839. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5840. {
  5841. return actionResult;
  5842. }
  5843. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  5844. //() => SystemModuleLogic.GetAllLogoInfo(sUserInfo));
  5845. () => SystemModuleLogic.GetLogoInfo(sUserInfo));
  5846. if (returnValue != null && returnValue.Tables[0].Rows.Count > 0)
  5847. {
  5848. //DataView dv = returnValue.Tables[0].DefaultView;
  5849. //dv.RowFilter = "ValueFlag=1";
  5850. //actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  5851. actionResult.Result = JsonHelper.ToJson(returnValue.Tables[0]);
  5852. actionResult.Status = (int)Constant.PDAResult.Success;
  5853. }
  5854. }
  5855. catch (Exception ex)
  5856. {
  5857. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5858. OutputLog.TraceLog(LogPriority.Error,
  5859. this.ToString(),
  5860. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5861. ex.ToString(),
  5862. LocalPath.LogExePath);
  5863. actionResult.Status = (int)Constant.PDAResult.Exception;
  5864. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5865. }
  5866. return actionResult;
  5867. }
  5868. /// <summary>
  5869. /// 变更产品商标用
  5870. /// </summary>
  5871. /// <param name="accountCode"></param>
  5872. /// <param name="userCode"></param>
  5873. /// <param name="userPassword"></param>
  5874. /// <param name="sessionKey"></param>
  5875. /// <param name="goodsid"></param>
  5876. /// <returns></returns>
  5877. public ActionResult GetLogoInfoForChange(string accountCode, string userCode, string userPassword, string sessionKey
  5878. , int goodsid)
  5879. {
  5880. ActionResult actionResult = new ActionResult();
  5881. try
  5882. {
  5883. // 验证请求头信息
  5884. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5885. // 验证失败
  5886. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5887. {
  5888. return actionResult;
  5889. }
  5890. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  5891. //() => SystemModuleLogic.GetAllLogoInfo(sUserInfo));
  5892. //() => SystemModuleLogic.GetLogoInfo(sUserInfo));
  5893. () => SystemModuleLogic.GetLogoInfoForChange(sUserInfo, goodsid));
  5894. if (returnValue != null && returnValue.Tables[0].Rows.Count > 0)
  5895. {
  5896. //DataView dv = returnValue.Tables[0].DefaultView;
  5897. //dv.RowFilter = "ValueFlag=1";
  5898. //actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  5899. actionResult.Result = JsonHelper.ToJson(returnValue.Tables[0]);
  5900. actionResult.Status = (int)Constant.PDAResult.Success;
  5901. }
  5902. }
  5903. catch (Exception ex)
  5904. {
  5905. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5906. OutputLog.TraceLog(LogPriority.Error,
  5907. this.ToString(),
  5908. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5909. ex.ToString(),
  5910. LocalPath.LogExePath);
  5911. actionResult.Status = (int)Constant.PDAResult.Exception;
  5912. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5913. }
  5914. return actionResult;
  5915. }
  5916. public ActionResult GetLogoID(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  5917. {
  5918. ActionResult actionResult = new ActionResult();
  5919. try
  5920. {
  5921. // 验证请求头信息
  5922. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5923. // 验证失败
  5924. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5925. {
  5926. return actionResult;
  5927. }
  5928. int returnValue = ServiceInvoker.Invoke<int>(this,
  5929. () => PMModuleLogic.GetLogoID(procedureID, sUserInfo));
  5930. actionResult.Result = JsonHelper.ToJson(returnValue);
  5931. actionResult.Status = (int)Constant.PDAResult.Success;
  5932. }
  5933. catch (Exception ex)
  5934. {
  5935. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5936. OutputLog.TraceLog(LogPriority.Error,
  5937. this.ToString(),
  5938. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5939. ex.ToString(),
  5940. LocalPath.LogExePath);
  5941. actionResult.Status = (int)Constant.PDAResult.Exception;
  5942. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5943. }
  5944. return actionResult;
  5945. }
  5946. public ActionResult SaveBarCodeLogo(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int logoid)
  5947. {
  5948. ActionResult actionResult = new ActionResult();
  5949. try
  5950. {
  5951. // 验证请求头信息
  5952. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5953. // 验证失败
  5954. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5955. {
  5956. return actionResult;
  5957. }
  5958. string returnMessage = "";
  5959. int returnValue = ServiceInvoker.Invoke<int>(this,
  5960. () => PMModuleLogicDAL.SaveBarCodeLogo(barcode, logoid, sUserInfo, out returnMessage));
  5961. actionResult.Result = JsonHelper.ToJson(returnValue);
  5962. if (returnValue > 0)
  5963. {
  5964. actionResult.Status = (int)Constant.PDAResult.Success;
  5965. }
  5966. else if (returnValue == -2)
  5967. {
  5968. //lsq 20210723 已注浆非产成品没有商标可以变更商标
  5969. //begin
  5970. //actionResult.Message = "条码不存在";
  5971. actionResult.Message = "该条码未注浆";
  5972. //end
  5973. actionResult.Status = (int)Constant.PDAResult.Fail;
  5974. }
  5975. else if (returnValue == -3)
  5976. {
  5977. actionResult.Message = "已交接的产品不能变更商标";
  5978. actionResult.Status = (int)Constant.PDAResult.Fail;
  5979. }
  5980. else if (returnValue == -5)
  5981. {
  5982. actionResult.Message = "该商标已超过生产计划允许变更数量,不能变更商标";
  5983. actionResult.Status = (int)Constant.PDAResult.Fail;
  5984. }
  5985. else if (returnValue == -6)
  5986. {
  5987. actionResult.Message = "该商标无计划,不允许变更商标";
  5988. actionResult.Status = (int)Constant.PDAResult.Fail;
  5989. }
  5990. else
  5991. {
  5992. actionResult.Message = returnMessage;
  5993. actionResult.Status = (int)Constant.PDAResult.Fail;
  5994. }
  5995. }
  5996. catch (Exception ex)
  5997. {
  5998. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5999. OutputLog.TraceLog(LogPriority.Error,
  6000. this.ToString(),
  6001. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6002. ex.ToString(),
  6003. LocalPath.LogExePath);
  6004. actionResult.Status = (int)Constant.PDAResult.Exception;
  6005. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6006. }
  6007. return actionResult;
  6008. }
  6009. public ActionResult SaveBarCodeLogoAndGlazetype(string accountCode, string userCode, string userPassword, string sessionKey,
  6010. string barcode, int logoid, int glazetypeid)
  6011. {
  6012. ActionResult actionResult = new ActionResult();
  6013. try
  6014. {
  6015. // 验证请求头信息
  6016. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6017. // 验证失败
  6018. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6019. {
  6020. return actionResult;
  6021. }
  6022. string returnMessage = "";
  6023. int returnValue = ServiceInvoker.Invoke<int>(this,
  6024. () => PMModuleLogicDAL.SaveBarCodeLogoAndGlazetype(barcode, logoid, glazetypeid, sUserInfo, out returnMessage));
  6025. actionResult.Result = JsonHelper.ToJson(returnValue);
  6026. if (returnValue > 0)
  6027. {
  6028. actionResult.Status = (int)Constant.PDAResult.Success;
  6029. }
  6030. else
  6031. {
  6032. actionResult.Status = (int)Constant.PDAResult.Fail;
  6033. actionResult.Message = returnMessage;
  6034. }
  6035. }
  6036. catch (Exception ex)
  6037. {
  6038. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6039. OutputLog.TraceLog(LogPriority.Error,
  6040. this.ToString(),
  6041. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6042. ex.ToString(),
  6043. LocalPath.LogExePath);
  6044. actionResult.Status = (int)Constant.PDAResult.Exception;
  6045. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6046. }
  6047. return actionResult;
  6048. }
  6049. public ActionResult SaveBarCodesLogoAndGlazetype(string accountCode, string userCode, string userPassword, string sessionKey,
  6050. string barcodes, int logoid, int glazetypeid, int procedureID)
  6051. {
  6052. ActionResult actionResult = new ActionResult();
  6053. try
  6054. {
  6055. // 验证请求头信息
  6056. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6057. // 验证失败
  6058. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6059. {
  6060. return actionResult;
  6061. }
  6062. string returnMessage = "";
  6063. int returnValue = ServiceInvoker.Invoke<int>(this,
  6064. () => PMModuleLogicDAL.SaveBarCodesLogoAndGlazetype(barcodes, logoid, glazetypeid, procedureID, sUserInfo, out returnMessage));
  6065. actionResult.Result = JsonHelper.ToJson(returnValue);
  6066. if (returnValue > 0)
  6067. {
  6068. actionResult.Status = (int)Constant.PDAResult.Success;
  6069. }
  6070. else
  6071. {
  6072. actionResult.Status = (int)Constant.PDAResult.Fail;
  6073. actionResult.Message = returnMessage;
  6074. }
  6075. }
  6076. catch (Exception ex)
  6077. {
  6078. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6079. OutputLog.TraceLog(LogPriority.Error,
  6080. this.ToString(),
  6081. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6082. ex.ToString(),
  6083. LocalPath.LogExePath);
  6084. actionResult.Status = (int)Constant.PDAResult.Exception;
  6085. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6086. }
  6087. return actionResult;
  6088. }
  6089. public ActionResult GetBarCodeLogoID(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6090. {
  6091. ActionResult actionResult = new ActionResult();
  6092. try
  6093. {
  6094. // 验证请求头信息
  6095. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6096. // 验证失败
  6097. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6098. {
  6099. return actionResult;
  6100. }
  6101. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  6102. () => PMModuleLogic.GetBarCodeLogoID(barcode, sUserInfo));
  6103. if (returnValue != null && returnValue.Tables[0].Rows.Count > 0)
  6104. {
  6105. string err_msg = returnValue.Tables[0].Rows[0]["err_msg"] + "";
  6106. if (!string.IsNullOrWhiteSpace(err_msg))
  6107. {
  6108. actionResult.Status = (int)Constant.PDAResult.Fail;
  6109. actionResult.Message = err_msg;
  6110. }
  6111. else
  6112. {
  6113. actionResult.Result = JsonHelper.ToJson(returnValue.Tables[0]);
  6114. actionResult.Status = (int)Constant.PDAResult.Success;
  6115. }
  6116. }
  6117. else
  6118. {
  6119. actionResult.Status = (int)Constant.PDAResult.Fail;
  6120. }
  6121. }
  6122. catch (Exception ex)
  6123. {
  6124. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6125. OutputLog.TraceLog(LogPriority.Error,
  6126. this.ToString(),
  6127. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6128. ex.ToString(),
  6129. LocalPath.LogExePath);
  6130. actionResult.Status = (int)Constant.PDAResult.Exception;
  6131. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6132. }
  6133. return actionResult;
  6134. }
  6135. /// <summary>
  6136. /// 半检时,入窑前检验获取此条码是否报损为废品
  6137. /// </summary>
  6138. /// <param name="accountCode"></param>
  6139. /// <param name="userCode"></param>
  6140. /// <param name="userPassword"></param>
  6141. /// <param name="sessionKey"></param>
  6142. /// <param name="barcode">产品条码</param>
  6143. /// <returns></returns>
  6144. public ActionResult CheckWasteScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6145. {
  6146. ActionResult actionResult = new ActionResult();
  6147. try
  6148. {
  6149. // 验证请求头信息
  6150. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6151. // 验证失败
  6152. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6153. {
  6154. return actionResult;
  6155. }
  6156. int returnValue = ServiceInvoker.Invoke<int>(this,
  6157. () => PMModuleLogic.CheckWasteScrapProduct(barcode));
  6158. if (returnValue != -100)
  6159. {
  6160. actionResult.Result = JsonHelper.ToJson(returnValue);
  6161. actionResult.Status = (int)Constant.PDAResult.Success;
  6162. }
  6163. else
  6164. {
  6165. actionResult.Status = (int)Constant.PDAResult.Fail;
  6166. actionResult.Message = "条码[" + barcode + "]不是废品,不能进行编辑";
  6167. }
  6168. }
  6169. catch (Exception ex)
  6170. {
  6171. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6172. OutputLog.TraceLog(LogPriority.Error,
  6173. this.ToString(),
  6174. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6175. ex.ToString(),
  6176. LocalPath.LogExePath);
  6177. actionResult.Status = (int)Constant.PDAResult.Exception;
  6178. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6179. }
  6180. return actionResult;
  6181. }
  6182. /// <summary>
  6183. /// 获取登陆帐户有无入窑前检验数据编辑权限
  6184. /// </summary>
  6185. /// <param name="accountCode"></param>
  6186. /// <param name="userCode"></param>
  6187. /// <param name="userPassword"></param>
  6188. /// <param name="sessionKey"></param>
  6189. /// <param name="usercode">工号编码</param>
  6190. /// <returns></returns>
  6191. public ActionResult GetIntoKilnCheckEditFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  6192. {
  6193. ActionResult actionResult = new ActionResult();
  6194. try
  6195. {
  6196. // 验证请求头信息
  6197. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6198. // 验证失败
  6199. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6200. {
  6201. return actionResult;
  6202. }
  6203. int returnValue = ServiceInvoker.Invoke<int>(this,
  6204. () => PDAModuleLogic.GetIntoKilnCheckEditFuntion(sUserInfo));
  6205. actionResult.Result = JsonHelper.ToJson(returnValue);
  6206. actionResult.Status = (int)Constant.PDAResult.Success;
  6207. }
  6208. catch (Exception ex)
  6209. {
  6210. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6211. OutputLog.TraceLog(LogPriority.Error,
  6212. this.ToString(),
  6213. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6214. ex.ToString(),
  6215. LocalPath.LogExePath);
  6216. actionResult.Status = (int)Constant.PDAResult.Exception;
  6217. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6218. }
  6219. return actionResult;
  6220. }
  6221. /// <summary>
  6222. /// 获取登陆帐户有无半检验数据编辑权限
  6223. /// </summary>
  6224. /// <param name="accountCode"></param>
  6225. /// <param name="userCode"></param>
  6226. /// <param name="userPassword"></param>
  6227. /// <param name="sessionKey"></param>
  6228. /// <param name="usercode">工号编码</param>
  6229. /// <returns></returns>
  6230. public ActionResult GetNormalCheckEditFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  6231. {
  6232. ActionResult actionResult = new ActionResult();
  6233. try
  6234. {
  6235. // 验证请求头信息
  6236. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6237. // 验证失败
  6238. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6239. {
  6240. return actionResult;
  6241. }
  6242. int returnValue = ServiceInvoker.Invoke<int>(this,
  6243. () => PDAModuleLogic.GetNormalCheckEditFuntion(sUserInfo));
  6244. actionResult.Result = JsonHelper.ToJson(returnValue);
  6245. actionResult.Status = (int)Constant.PDAResult.Success;
  6246. }
  6247. catch (Exception ex)
  6248. {
  6249. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6250. OutputLog.TraceLog(LogPriority.Error,
  6251. this.ToString(),
  6252. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6253. ex.ToString(),
  6254. LocalPath.LogExePath);
  6255. actionResult.Status = (int)Constant.PDAResult.Exception;
  6256. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6257. }
  6258. return actionResult;
  6259. }
  6260. /// <summary>
  6261. /// 获取缺陷扣罚管理的全部数据
  6262. /// </summary>
  6263. /// <param name="accountCode"></param>
  6264. /// <param name="userCode"></param>
  6265. /// <param name="userPassword"></param>
  6266. /// <param name="sessionKey"></param>
  6267. /// <returns></returns>
  6268. public ActionResult GetAllDefectFine(string accountCode, string userCode, string userPassword, string sessionKey)
  6269. {
  6270. ActionResult actionResult = new ActionResult();
  6271. try
  6272. {
  6273. // 验证请求头信息
  6274. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6275. // 验证失败
  6276. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6277. {
  6278. return actionResult;
  6279. }
  6280. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6281. () => SystemModuleLogic.GetAllDefectFine(sUserInfo));
  6282. if (ds != null && ds.Tables[0].Rows.Count > 0)
  6283. {
  6284. DataView dv = ds.Tables[0].DefaultView;
  6285. dv.RowFilter = "valueflag=1";
  6286. actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  6287. actionResult.Status = (int)Constant.PDAResult.Success;
  6288. }
  6289. else
  6290. {
  6291. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  6292. actionResult.Status = (int)Constant.PDAResult.Success;
  6293. }
  6294. }
  6295. catch (Exception ex)
  6296. {
  6297. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6298. OutputLog.TraceLog(LogPriority.Error,
  6299. this.ToString(),
  6300. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6301. ex.ToString(),
  6302. LocalPath.LogExePath);
  6303. actionResult.Status = (int)Constant.PDAResult.Exception;
  6304. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6305. }
  6306. return actionResult;
  6307. }
  6308. /// <summary>
  6309. /// 获取缺陷扣除数管理的全部数据
  6310. /// </summary>
  6311. /// <param name="accountCode"></param>
  6312. /// <param name="userCode"></param>
  6313. /// <param name="userPassword"></param>
  6314. /// <param name="sessionKey"></param>
  6315. /// <returns></returns>
  6316. public ActionResult GetAllDefectDeduction(string accountCode, string userCode, string userPassword, string sessionKey)
  6317. {
  6318. ActionResult actionResult = new ActionResult();
  6319. try
  6320. {
  6321. // 验证请求头信息
  6322. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6323. // 验证失败
  6324. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6325. {
  6326. return actionResult;
  6327. }
  6328. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6329. () => SystemModuleLogic.GetAllDefectDeduction(sUserInfo));
  6330. if (ds != null && ds.Tables[0].Rows.Count > 0)
  6331. {
  6332. DataView dv = ds.Tables[0].DefaultView;
  6333. dv.RowFilter = "valueflag=1";
  6334. actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  6335. actionResult.Status = (int)Constant.PDAResult.Success;
  6336. }
  6337. else
  6338. {
  6339. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  6340. actionResult.Status = (int)Constant.PDAResult.Success;
  6341. }
  6342. }
  6343. catch (Exception ex)
  6344. {
  6345. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6346. OutputLog.TraceLog(LogPriority.Error,
  6347. this.ToString(),
  6348. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6349. ex.ToString(),
  6350. LocalPath.LogExePath);
  6351. actionResult.Status = (int)Constant.PDAResult.Exception;
  6352. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6353. }
  6354. return actionResult;
  6355. }
  6356. /// <summary>
  6357. /// 获取缺陷扣罚关系管理的全部数据
  6358. /// </summary>
  6359. /// <param name="accountCode"></param>
  6360. /// <param name="userCode"></param>
  6361. /// <param name="userPassword"></param>
  6362. /// <param name="sessionKey"></param>
  6363. /// <returns></returns>
  6364. public ActionResult GetAllDefectFineRelation(string accountCode, string userCode, string userPassword, string sessionKey)
  6365. {
  6366. ActionResult actionResult = new ActionResult();
  6367. try
  6368. {
  6369. // 验证请求头信息
  6370. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6371. // 验证失败
  6372. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6373. {
  6374. return actionResult;
  6375. }
  6376. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6377. () => SystemModuleLogic.GetAllDefectFineRelation(sUserInfo));
  6378. DataTable dt = new DataTable();
  6379. dt.Columns.Add("DefectID");
  6380. dt.Columns.Add("DefectFineID");
  6381. DataView dv = ds.Tables[0].DefaultView;
  6382. DataTable dtFor = dv.ToTable("defectid", true);
  6383. for (int i = 0; i < dtFor.Rows.Count; i++)
  6384. {
  6385. DataRow[] r = ds.Tables[0].Select("defectid=" + dtFor.Rows[i]["defectid"]);
  6386. string substring = "";
  6387. foreach (DataRow r1 in r)
  6388. {
  6389. substring += r1["DefectFineID"].ToString() + "-" + r1["DEFECTFINECODE"].ToString() + ",";
  6390. }
  6391. if (substring != "")
  6392. {
  6393. DataRow drnew = dt.NewRow();
  6394. drnew["DefectID"] = dtFor.Rows[i]["defectid"];
  6395. drnew["DefectFineID"] = substring.TrimEnd(',');
  6396. dt.Rows.Add(drnew);
  6397. }
  6398. }
  6399. actionResult.Result = JsonHelper.ToJson(dt);//ds.Tables[0]
  6400. actionResult.Status = (int)Constant.PDAResult.Success;
  6401. }
  6402. catch (Exception ex)
  6403. {
  6404. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6405. OutputLog.TraceLog(LogPriority.Error,
  6406. this.ToString(),
  6407. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6408. ex.ToString(),
  6409. LocalPath.LogExePath);
  6410. actionResult.Status = (int)Constant.PDAResult.Exception;
  6411. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6412. }
  6413. return actionResult;
  6414. }
  6415. /// <summary>
  6416. /// 获取缺陷扣除数关系管理的全部数据
  6417. /// </summary>
  6418. /// <param name="accountCode"></param>
  6419. /// <param name="userCode"></param>
  6420. /// <param name="userPassword"></param>
  6421. /// <param name="sessionKey"></param>
  6422. /// <returns></returns>
  6423. public ActionResult GetAllDefectDeductionRelation(string accountCode, string userCode, string userPassword, string sessionKey)
  6424. {
  6425. ActionResult actionResult = new ActionResult();
  6426. try
  6427. {
  6428. // 验证请求头信息
  6429. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6430. // 验证失败
  6431. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6432. {
  6433. return actionResult;
  6434. }
  6435. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6436. () => SystemModuleLogic.GetAllDefectDeductionRelation(sUserInfo));
  6437. DataTable dt = new DataTable();
  6438. dt.Columns.Add("DefectID");
  6439. dt.Columns.Add("DefectDeductionNum");
  6440. DataView dv = ds.Tables[0].DefaultView;
  6441. DataTable dtFor = dv.ToTable("defectid", true);
  6442. for (int i = 0; i < dtFor.Rows.Count; i++)
  6443. {
  6444. DataRow[] r = ds.Tables[0].Select("defectid=" + dtFor.Rows[i]["defectid"]);
  6445. string substring = "";
  6446. foreach (DataRow r1 in r)
  6447. {
  6448. substring += r1["DefectDeductionID"].ToString() + "-" + r1["DefectDeductionNum"].ToString() + ",";
  6449. }
  6450. if (substring != "")
  6451. {
  6452. DataRow drnew = dt.NewRow();
  6453. drnew["DefectID"] = dtFor.Rows[i]["defectid"];
  6454. drnew["DefectDeductionNum"] = substring.TrimEnd(',');
  6455. dt.Rows.Add(drnew);
  6456. }
  6457. }
  6458. actionResult.Result = JsonHelper.ToJson(dt);//ds.Tables[0]
  6459. actionResult.Status = (int)Constant.PDAResult.Success;
  6460. }
  6461. catch (Exception ex)
  6462. {
  6463. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6464. OutputLog.TraceLog(LogPriority.Error,
  6465. this.ToString(),
  6466. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6467. ex.ToString(),
  6468. LocalPath.LogExePath);
  6469. actionResult.Status = (int)Constant.PDAResult.Exception;
  6470. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6471. }
  6472. return actionResult;
  6473. }
  6474. /// <summary>
  6475. /// 获取盘点单明细
  6476. /// </summary>
  6477. /// <param name="sUserInfo"></param>
  6478. /// <returns></returns>
  6479. public ActionResult GetUpdateInCheckedInfo(string accountCode, string userCode, string userPassword, string sessionKey, string incheckedno)
  6480. {
  6481. ActionResult actionResult = new ActionResult();
  6482. try
  6483. {
  6484. // 验证请求头信息
  6485. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6486. // 验证失败
  6487. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6488. {
  6489. return actionResult;
  6490. }
  6491. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6492. () => PMModuleLogic.GetUpdateInCheckedInfo(incheckedno, sUserInfo));
  6493. actionResult.Result = JsonHelper.ToJson(ds);
  6494. actionResult.Status = (int)Constant.PDAResult.Success;
  6495. }
  6496. catch (Exception ex)
  6497. {
  6498. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6499. OutputLog.TraceLog(LogPriority.Error,
  6500. this.ToString(),
  6501. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6502. ex.ToString(),
  6503. LocalPath.LogExePath);
  6504. actionResult.Status = (int)Constant.PDAResult.Exception;
  6505. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6506. }
  6507. return actionResult;
  6508. }
  6509. /// <summary>
  6510. /// 半检检验条码
  6511. /// </summary>
  6512. /// <param name="sUserInfo"></param>
  6513. /// <returns></returns>
  6514. public ActionResult SemiCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6515. {
  6516. ActionResult actionResult = new ActionResult();
  6517. try
  6518. {
  6519. // 验证请求头信息
  6520. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6521. // 验证失败
  6522. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6523. {
  6524. return actionResult;
  6525. }
  6526. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6527. () => PMModuleLogic.SemiCheckBarcode(barcode, sUserInfo));
  6528. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6529. if (Convert.ToInt32(resultEntity.Result) < 0)
  6530. {
  6531. actionResult.Status = (int)Constant.PDAResult.Fail;
  6532. }
  6533. else
  6534. {
  6535. actionResult.Status = (int)Constant.PDAResult.Success;
  6536. }
  6537. actionResult.Message = resultEntity.Message;
  6538. }
  6539. catch (Exception ex)
  6540. {
  6541. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6542. OutputLog.TraceLog(LogPriority.Error,
  6543. this.ToString(),
  6544. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6545. ex.ToString(),
  6546. LocalPath.LogExePath);
  6547. actionResult.Status = (int)Constant.PDAResult.Exception;
  6548. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6549. }
  6550. return actionResult;
  6551. }
  6552. /// <summary>
  6553. /// 根据条码获取经过的工序,用于绑定返工工序
  6554. /// </summary>
  6555. /// <param name="sUserInfo"></param>
  6556. /// <returns></returns>
  6557. public ActionResult GetSemiCheckPassProcedure(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6558. {
  6559. ActionResult actionResult = new ActionResult();
  6560. try
  6561. {
  6562. // 验证请求头信息
  6563. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6564. // 验证失败
  6565. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6566. {
  6567. return actionResult;
  6568. }
  6569. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6570. () => PMModuleLogic.GetSemiCheckPassProcedure(barcode));
  6571. actionResult.Result = JsonHelper.ToJson(resultEntity);
  6572. actionResult.Status = (int)Constant.PDAResult.Success;
  6573. }
  6574. catch (Exception ex)
  6575. {
  6576. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6577. OutputLog.TraceLog(LogPriority.Error,
  6578. this.ToString(),
  6579. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6580. ex.ToString(),
  6581. LocalPath.LogExePath);
  6582. actionResult.Status = (int)Constant.PDAResult.Exception;
  6583. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6584. }
  6585. return actionResult;
  6586. }
  6587. /// <summary>
  6588. /// 获取登陆帐户有无半检状态权限
  6589. /// </summary>
  6590. /// <param name="sUserInfo"></param>
  6591. /// <returns></returns>
  6592. public ActionResult GetSemiCheckStatusFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  6593. {
  6594. ActionResult actionResult = new ActionResult();
  6595. try
  6596. {
  6597. // 验证请求头信息
  6598. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6599. // 验证失败
  6600. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6601. {
  6602. return actionResult;
  6603. }
  6604. int resultEntity = ServiceInvoker.Invoke<int>(this,
  6605. () => PMModuleLogic.GetSemiCheckStatusFuntion(sUserInfo));
  6606. actionResult.Result = JsonHelper.ToJson(resultEntity);
  6607. actionResult.Status = (int)Constant.PDAResult.Success;
  6608. }
  6609. catch (Exception ex)
  6610. {
  6611. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6612. OutputLog.TraceLog(LogPriority.Error,
  6613. this.ToString(),
  6614. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6615. ex.ToString(),
  6616. LocalPath.LogExePath);
  6617. actionResult.Status = (int)Constant.PDAResult.Exception;
  6618. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6619. }
  6620. return actionResult;
  6621. }
  6622. /// <summary>
  6623. /// 复检状态数据源
  6624. /// </summary>
  6625. /// <param name="sUserInfo"></param>
  6626. /// <returns></returns>
  6627. public ActionResult GetSemiCheckType(string accountCode, string userCode, string userPassword, string sessionKey)
  6628. {
  6629. ActionResult actionResult = new ActionResult();
  6630. try
  6631. {
  6632. // 验证请求头信息
  6633. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6634. // 验证失败
  6635. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6636. {
  6637. return actionResult;
  6638. }
  6639. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6640. () => SystemModuleLogic.GetSemiCheckType());
  6641. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6642. actionResult.Status = (int)Constant.PDAResult.Success;
  6643. }
  6644. catch (Exception ex)
  6645. {
  6646. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6647. OutputLog.TraceLog(LogPriority.Error,
  6648. this.ToString(),
  6649. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6650. ex.ToString(),
  6651. LocalPath.LogExePath);
  6652. actionResult.Status = (int)Constant.PDAResult.Exception;
  6653. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6654. }
  6655. return actionResult;
  6656. }
  6657. /// <summary>
  6658. /// 根据半成品检验数据ID,显示半成品数据信息
  6659. /// </summary>
  6660. /// <param name="sUserInfo"></param>
  6661. /// <returns></returns>
  6662. public ActionResult GetSemiCheckByID(string accountCode, string userCode, string userPassword, string sessionKey, int semiCheckID)
  6663. {
  6664. ActionResult actionResult = new ActionResult();
  6665. try
  6666. {
  6667. // 验证请求头信息
  6668. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6669. // 验证失败
  6670. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6671. {
  6672. return actionResult;
  6673. }
  6674. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  6675. () => PMModuleLogic.GetSemiCheckByID(semiCheckID));
  6676. SemiCheckEntity[] productionDatas = new SemiCheckEntity[1];
  6677. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  6678. {
  6679. if (reworkDs != null && reworkDs.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  6680. {
  6681. for (int i = 0; i < reworkDs.Tables[0].Rows.Count; i++)
  6682. {
  6683. SemiCheckEntity productionData = new SemiCheckEntity();
  6684. productionData.BarCode = reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
  6685. if (reworkDs.Tables[0].Rows[i]["GoodsID"].ToString() != "")
  6686. {
  6687. productionData.GoodsID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsID"].ToString());
  6688. }
  6689. productionData.SemiCheckID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["SemiCheckID"].ToString());
  6690. productionData.GoodsCode = reworkDs.Tables[0].Rows[i]["GoodsCode"].ToString();
  6691. productionData.GoodsName = reworkDs.Tables[0].Rows[i]["GoodsName"].ToString();
  6692. productionData.SemiCheckType = reworkDs.Tables[0].Rows[i]["SemiCheckType"].ToString();
  6693. productionData.ReFine = 0;
  6694. if (reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString() != "")
  6695. {
  6696. productionData.ReworkProcedureID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString());
  6697. }
  6698. productionData.ReSemiCheckType = reworkDs.Tables[0].Rows[i]["ReSemiCheckType"].ToString();
  6699. productionData.ReworkProcedureCode = reworkDs.Tables[0].Rows[i]["ReworkProcedureCode"].ToString();
  6700. productionData.ReworkProcedureName = reworkDs.Tables[0].Rows[i]["ReworkProcedureName"].ToString();
  6701. productionData.Remarks = reworkDs.Tables[0].Rows[i]["Remarks"].ToString();
  6702. if (reworkDs.Tables[0].Rows[i]["UserID"].ToString() != "")
  6703. {
  6704. productionData.SemiCheckUserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["UserID"].ToString());
  6705. productionData.SemiCheckUserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
  6706. }
  6707. if (reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString() != "")
  6708. {
  6709. productionData.GoodsLevelTypeID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString());
  6710. }
  6711. //productionData.UserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
  6712. //productionData.UserName = reworkDs.Tables[0].Rows[i]["UserName"].ToString();
  6713. productionData.SpecialRepairFlag = reworkDs.Tables[0].Rows[i]["SpecialRepairFlag"].ToString();
  6714. productionData.GroutingUserCode = reworkDs.Tables[0].Rows[i]["GroutingUserCode"].ToString();
  6715. productionData.GroutingNum = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GroutingNum"]);
  6716. productionData.IsPublicBody = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["IsPublicBody"]);
  6717. productionData.MouldCode = reworkDs.Tables[0].Rows[i]["MouldCode"].ToString();
  6718. productionData.GroutingDate = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["GroutingDate"]);
  6719. if (reworkDs.Tables[0].Rows[i]["ReworkUserID"].ToString() != "")
  6720. {
  6721. productionData.ReworkUserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkUserID"].ToString());
  6722. productionData.ReworkUserCode = reworkDs.Tables[0].Rows[i]["ReworkUserCode"].ToString();
  6723. }
  6724. productionData.ReSemiCheckUserCode = reworkDs.Tables[0].Rows[i]["ReSemiCheckUserCode"].ToString();
  6725. if (reworkDs.Tables[0].Rows[i]["logoid"].ToString() != "")
  6726. {
  6727. productionData.Logoid = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["Logoid"]);
  6728. productionData.LogoCode = reworkDs.Tables[0].Rows[i]["LogoCode"].ToString();
  6729. productionData.LogoName = reworkDs.Tables[0].Rows[i]["LogoName"].ToString();
  6730. }
  6731. productionData.SemiCheckTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["SemiCheckTime"]);
  6732. if (reworkDs.Tables[0].Rows[i]["ReSemiCheckTime"] != DBNull.Value)
  6733. {
  6734. productionData.ReSemiCheckDateTimeStart = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["ReSemiCheckTime"]);
  6735. }
  6736. DataView dvDefect = reworkDs.Tables[1].DefaultView;
  6737. dvDefect.RowFilter = "SemiCheckID=" + reworkDs.Tables[0].Rows[i]["SemiCheckID"].ToString();
  6738. DataTable dtDefect = dvDefect.ToTable();
  6739. for (int row = 0; row < dtDefect.Rows.Count; row++)
  6740. {
  6741. // 产品缺陷
  6742. SemiCheckDefectEntity defect = new SemiCheckDefectEntity();
  6743. //defect.SpecialDefect = dtDefect.Rows[row]["SpecialDefect"].ToString();
  6744. //defect.DefectDeductionNum = Convert.ToDecimal(dtDefect.Rows[row]["DefectDeductionNum"].ToString());
  6745. //if (dtDefect.Rows[row]["ProductionDefectID"].ToString() != "")
  6746. //{
  6747. // defect.ProductionDefectID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDefectID"].ToString());
  6748. //}
  6749. //defect.BarCode = dtDefect.Rows[row]["BarCode"].ToString();
  6750. if (dtDefect.Rows[row]["DefectID"].ToString() != "")
  6751. {
  6752. defect.DefectID = Convert.ToInt32(dtDefect.Rows[row]["DefectID"].ToString());
  6753. }
  6754. defect.DefectName = dtDefect.Rows[row]["DefectName"].ToString();
  6755. defect.DefectCode = dtDefect.Rows[row]["DefectCode"].ToString();
  6756. if (dtDefect.Rows[row]["DefectPositionID"].ToString() != "")
  6757. {
  6758. defect.DefectPositionID = Convert.ToInt32(dtDefect.Rows[row]["DefectPositionID"].ToString());
  6759. }
  6760. defect.DefectPositionName = dtDefect.Rows[row]["DefectPositionName"].ToString();
  6761. defect.DefectPositionCode = dtDefect.Rows[row]["DefectPositionCode"].ToString();
  6762. if (dtDefect.Rows[row]["DefectProcedureID"].ToString() != "")
  6763. {
  6764. defect.DefectProcedureID = Convert.ToInt32(dtDefect.Rows[row]["DefectProcedureID"].ToString());
  6765. }
  6766. defect.DefectProcedureName = dtDefect.Rows[row]["DefectProcedureName"].ToString();
  6767. defect.DefectProcedureCode = dtDefect.Rows[row]["DefectProcedureCode"].ToString();
  6768. if (dtDefect.Rows[row]["DefectUserID"].ToString() != "")
  6769. {
  6770. defect.DefectUserID = Convert.ToInt32(dtDefect.Rows[row]["DefectUserID"].ToString());
  6771. }
  6772. defect.DefectUserName = dtDefect.Rows[row]["DefectUserName"].ToString();
  6773. defect.DefectUserCode = dtDefect.Rows[row]["DefectUserCode"].ToString();
  6774. //if (dtDefect.Rows[row]["Jobs"].ToString() != "")
  6775. //{
  6776. // defect.Jobs = Convert.ToInt32(dtDefect.Rows[row]["Jobs"].ToString());
  6777. //}
  6778. //if (dtDefect.Rows[row]["MissedUserID"].ToString() != "")
  6779. //{
  6780. // defect.MissedUserID = Convert.ToInt32(dtDefect.Rows[row]["MissedUserID"].ToString());
  6781. //}
  6782. //defect.MissedUserCode = dtDefect.Rows[row]["MissedUserCode"].ToString();
  6783. //defect.MissedUserName = dtDefect.Rows[row]["MissedUserName"].ToString();
  6784. //defect.JobsText = dtDefect.Rows[row]["JobsText"].ToString();
  6785. defect.Remarks = dtDefect.Rows[row]["remarks"].ToString();
  6786. if (dtDefect.Rows[row]["semicheckid"].ToString() != "")
  6787. {
  6788. defect.SemiCheckID = Convert.ToInt32(dtDefect.Rows[row]["semicheckid"].ToString());
  6789. }
  6790. if (dtDefect.Rows[row]["DefectProductionDataID"].ToString() != "")
  6791. {
  6792. defect.DefectProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["DefectProductionDataID"].ToString());
  6793. }
  6794. //if (dtDefect.Rows[row]["DefectFineID"].ToString() != "")
  6795. //{
  6796. // defect.DefectFineID = Convert.ToInt32(dtDefect.Rows[row]["DefectFineID"].ToString());
  6797. //}
  6798. //defect.DefectFineValue = dtDefect.Rows[row]["DefectFineValue"].ToString();
  6799. //--------责任员工-------------------
  6800. DataRow[] drRow = reworkDs.Tables[2].Select("SemiCheckDefectID=" + reworkDs.Tables[1].Rows[row]["SemiCheckDefectID"]);
  6801. if (drRow.Length > Constant.INT_IS_ZERO)
  6802. {
  6803. if (defect.DefectResponsibles == null)
  6804. {
  6805. defect.DefectResponsibles = new List<SemiCheckResponsibleEntity>();
  6806. }
  6807. foreach (DataRow r in drRow)
  6808. {
  6809. SemiCheckResponsibleEntity defectResponsible = new SemiCheckResponsibleEntity();
  6810. if (r["SemiCheckDefectID"].ToString() != "")
  6811. {
  6812. defectResponsible.SemiCheckDefectID = Convert.ToInt32(r["SemiCheckDefectID"]);
  6813. }
  6814. if (r["StaffID"].ToString() != "")
  6815. {
  6816. defectResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
  6817. }
  6818. defectResponsible.StaffCode = r["StaffCode"].ToString();
  6819. defectResponsible.StaffName = r["StaffName"].ToString();
  6820. if (r["StaffStatus"].ToString() != "")
  6821. {
  6822. defectResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
  6823. }
  6824. if (r["UJobsID"].ToString() != "")
  6825. {
  6826. defectResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
  6827. }
  6828. if (r["SJobsID"].ToString() != "")
  6829. {
  6830. defectResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
  6831. }
  6832. defect.DefectResponsibles.Add(defectResponsible);
  6833. }
  6834. }
  6835. //------------------------------
  6836. if (productionData.SemiCheckDefects == null)
  6837. {
  6838. productionData.SemiCheckDefects = new List<SemiCheckDefectEntity>();
  6839. }
  6840. productionData.SemiCheckDefects.Add(defect);
  6841. }
  6842. //if (productionDatas.PDAProductionData == null)
  6843. //{
  6844. // productionDatas.PDAProductionData = new System.Collections.Generic.List<PDAProductionDataResult>();
  6845. //}
  6846. productionDatas[0] = productionData;
  6847. //---------------------------------------------------------------------------------
  6848. }
  6849. }
  6850. }
  6851. actionResult.Result = JsonHelper.ToJson(productionDatas);
  6852. actionResult.Status = (int)Constant.PDAResult.Success;
  6853. }
  6854. catch (Exception ex)
  6855. {
  6856. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6857. OutputLog.TraceLog(LogPriority.Error,
  6858. this.ToString(),
  6859. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6860. ex.ToString(),
  6861. LocalPath.LogExePath);
  6862. actionResult.Status = (int)Constant.PDAResult.Exception;
  6863. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6864. }
  6865. return actionResult;
  6866. }
  6867. /// <summary>
  6868. /// 保存半检登记
  6869. /// </summary>
  6870. /// <param name="accountCode">帐套code</param>
  6871. /// <param name="userCode">用户code</param>
  6872. /// <param name="userPassword">用户密码</param>
  6873. /// <param name="sessionKey">本次登陆密钥</param>
  6874. /// <param name="entity">半检实体类</param>
  6875. /// <param name="sUserInfo">用户基本信息</param>
  6876. /// <returns></returns>
  6877. public ActionResult AddSemiCheck(string accountCode, string userCode, string userPassword, string sessionKey, SemiCheckEntity[] entityobj)
  6878. {
  6879. ActionResult actionResult = new ActionResult();
  6880. try
  6881. {
  6882. // 验证请求头信息
  6883. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6884. // 验证失败
  6885. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6886. {
  6887. return actionResult;
  6888. }
  6889. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6890. () => PMModuleLogicDAL.AddSemiCheck(entityobj, sUserInfo));
  6891. string err = string.Empty;
  6892. err = resultEntity.Message;
  6893. if (err == null)
  6894. {
  6895. err = "";
  6896. }
  6897. SemiCheckEntity entity = entityobj[0];
  6898. if (entity.SemiCheckCategory == 1) // 半检登记
  6899. {
  6900. }
  6901. else if (entity.SemiCheckCategory == 2)// 复检登记
  6902. {
  6903. err = JsonHelper.ToJson(err);
  6904. }
  6905. else if (entity.SemiCheckCategory == 3)// 撤销复检
  6906. {
  6907. err = JsonHelper.ToJson(err);
  6908. }
  6909. //actionResult.Result = JsonHelper.ToJson(err);
  6910. actionResult.Result = err;//JsonHelper.ToJson(err);
  6911. actionResult.Status = (int)Constant.PDAResult.Success;
  6912. }
  6913. catch (Exception ex)
  6914. {
  6915. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6916. OutputLog.TraceLog(LogPriority.Error,
  6917. this.ToString(),
  6918. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6919. ex.ToString(),
  6920. LocalPath.LogExePath);
  6921. actionResult.Status = (int)Constant.PDAResult.Exception;
  6922. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6923. }
  6924. return actionResult;
  6925. }
  6926. /// <summary>
  6927. /// 根据所选工号,查出缺陷责任员工
  6928. /// </summary>
  6929. /// <param name="sUserInfo"></param>
  6930. /// <returns></returns>
  6931. public ActionResult GetSemiCheckDefectStaffByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int userid)
  6932. {
  6933. ActionResult actionResult = new ActionResult();
  6934. try
  6935. {
  6936. // 验证请求头信息
  6937. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6938. // 验证失败
  6939. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6940. {
  6941. return actionResult;
  6942. }
  6943. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6944. () => PMModuleLogic.GetSemiCheckDefectStaffByUserID(sUserInfo, userid));
  6945. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6946. actionResult.Status = (int)Constant.PDAResult.Success;
  6947. }
  6948. catch (Exception ex)
  6949. {
  6950. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6951. OutputLog.TraceLog(LogPriority.Error,
  6952. this.ToString(),
  6953. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6954. ex.ToString(),
  6955. LocalPath.LogExePath);
  6956. actionResult.Status = (int)Constant.PDAResult.Exception;
  6957. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6958. }
  6959. return actionResult;
  6960. }
  6961. /// <summary>
  6962. /// 获取半成品缺陷管理的全部数据
  6963. /// </summary>
  6964. /// <param name="sUserInfo"></param>
  6965. /// <returns></returns>
  6966. public ActionResult GetAllSemicheckDefect(string accountCode, string userCode, string userPassword, string sessionKey)
  6967. {
  6968. ActionResult actionResult = new ActionResult();
  6969. try
  6970. {
  6971. // 验证请求头信息
  6972. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6973. // 验证失败
  6974. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6975. {
  6976. return actionResult;
  6977. }
  6978. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6979. () => SystemModuleLogic.GetAllSemicheckDefect(sUserInfo));
  6980. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6981. actionResult.Status = (int)Constant.PDAResult.Success;
  6982. }
  6983. catch (Exception ex)
  6984. {
  6985. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6986. OutputLog.TraceLog(LogPriority.Error,
  6987. this.ToString(),
  6988. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6989. ex.ToString(),
  6990. LocalPath.LogExePath);
  6991. actionResult.Status = (int)Constant.PDAResult.Exception;
  6992. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6993. }
  6994. return actionResult;
  6995. }
  6996. /// <summary>
  6997. /// 获取PLC参数
  6998. /// </summary>
  6999. /// <param name="sUserInfo"></param>
  7000. /// <returns></returns>
  7001. public ActionResult GetPLCParameter(string accountCode, string userCode, string userPassword, string sessionKey, string PlcName)
  7002. {
  7003. ActionResult actionResult = new ActionResult();
  7004. try
  7005. {
  7006. // 验证请求头信息
  7007. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7008. // 验证失败
  7009. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7010. {
  7011. return actionResult;
  7012. }
  7013. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  7014. () => SystemModuleLogic.GetPLCParameter(PlcName));
  7015. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7016. actionResult.Status = (int)Constant.PDAResult.Success;
  7017. }
  7018. catch (Exception ex)
  7019. {
  7020. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7021. OutputLog.TraceLog(LogPriority.Error,
  7022. this.ToString(),
  7023. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7024. ex.ToString(),
  7025. LocalPath.LogExePath);
  7026. actionResult.Status = (int)Constant.PDAResult.Exception;
  7027. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7028. }
  7029. return actionResult;
  7030. }
  7031. /// <summary>
  7032. /// 获取产品信息
  7033. /// </summary>
  7034. /// <param name="sUserInfo"></param>
  7035. /// <returns></returns>
  7036. public ActionResult GetGodsParameter(string accountCode, string userCode, string userPassword, string sessionKey, string BarCode)
  7037. {
  7038. ActionResult actionResult = new ActionResult();
  7039. try
  7040. {
  7041. // 验证请求头信息
  7042. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7043. // 验证失败
  7044. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7045. {
  7046. return actionResult;
  7047. }
  7048. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  7049. () => SystemModuleLogic.GetGodsParameter(BarCode));
  7050. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7051. actionResult.Status = (int)Constant.PDAResult.Success;
  7052. }
  7053. catch (Exception ex)
  7054. {
  7055. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7056. OutputLog.TraceLog(LogPriority.Error,
  7057. this.ToString(),
  7058. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7059. ex.ToString(),
  7060. LocalPath.LogExePath);
  7061. actionResult.Status = (int)Constant.PDAResult.Exception;
  7062. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7063. }
  7064. return actionResult;
  7065. }
  7066. /// <summary>
  7067. /// 传输PLC产品信息
  7068. /// </summary>
  7069. /// <param name="sUserInfo"></param>
  7070. /// <returns></returns>
  7071. public ActionResult AddPlcGood(string accountCode, string userCode, string userPassword, string sessionKey, string Plcid, string BarCode, string GROUTINGLINECODE, string GOODSMODEL, string GOODSTYPENAME, string GOODSSPECIFICATION)
  7072. {
  7073. ActionResult actionResult = new ActionResult();
  7074. try
  7075. {
  7076. // 验证请求头信息
  7077. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7078. // 验证失败
  7079. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7080. {
  7081. return actionResult;
  7082. }
  7083. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7084. () => SystemModuleLogic.AddPlcGood(Plcid, BarCode, GROUTINGLINECODE, GOODSMODEL, GOODSTYPENAME, GOODSSPECIFICATION));
  7085. actionResult.Result = JsonHelper.ToJson(resultEntity);
  7086. actionResult.Status = (int)Constant.PDAResult.Success;
  7087. }
  7088. catch (Exception ex)
  7089. {
  7090. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7091. OutputLog.TraceLog(LogPriority.Error,
  7092. this.ToString(),
  7093. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7094. ex.ToString(),
  7095. LocalPath.LogExePath);
  7096. actionResult.Status = (int)Constant.PDAResult.Exception;
  7097. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7098. }
  7099. return actionResult;
  7100. }
  7101. /// <summary>
  7102. /// 获取半成品缺陷位置管理的全部数据
  7103. /// </summary>
  7104. /// <param name="sUserInfo"></param>
  7105. /// <returns></returns>
  7106. public ActionResult GetAllScdefectPosition(string accountCode, string userCode, string userPassword, string sessionKey)
  7107. {
  7108. ActionResult actionResult = new ActionResult();
  7109. try
  7110. {
  7111. // 验证请求头信息
  7112. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7113. // 验证失败
  7114. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7115. {
  7116. return actionResult;
  7117. }
  7118. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  7119. () => SystemModuleLogic.GetAllScdefectPosition(sUserInfo));
  7120. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7121. actionResult.Status = (int)Constant.PDAResult.Success;
  7122. }
  7123. catch (Exception ex)
  7124. {
  7125. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7126. OutputLog.TraceLog(LogPriority.Error,
  7127. this.ToString(),
  7128. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7129. ex.ToString(),
  7130. LocalPath.LogExePath);
  7131. actionResult.Status = (int)Constant.PDAResult.Exception;
  7132. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7133. }
  7134. return actionResult;
  7135. }
  7136. /// <summary>
  7137. /// 复检验条码
  7138. /// </summary>
  7139. /// <param name="sUserInfo"></param>
  7140. /// <returns></returns>
  7141. public ActionResult ReSemiCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7142. {
  7143. ActionResult actionResult = new ActionResult();
  7144. try
  7145. {
  7146. // 验证请求头信息
  7147. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7148. // 验证失败
  7149. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7150. {
  7151. return actionResult;
  7152. }
  7153. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7154. () => PMModuleLogic.ReSemiCheckBarcode(barcode, sUserInfo));
  7155. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7156. if (Convert.ToInt32(resultEntity.Result) < 0)
  7157. {
  7158. actionResult.Status = (int)Constant.PDAResult.Fail;
  7159. }
  7160. else
  7161. {
  7162. actionResult.Status = (int)Constant.PDAResult.Success;
  7163. }
  7164. actionResult.Message = resultEntity.Message;
  7165. }
  7166. catch (Exception ex)
  7167. {
  7168. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7169. OutputLog.TraceLog(LogPriority.Error,
  7170. this.ToString(),
  7171. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7172. ex.ToString(),
  7173. LocalPath.LogExePath);
  7174. actionResult.Status = (int)Constant.PDAResult.Exception;
  7175. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7176. }
  7177. return actionResult;
  7178. }
  7179. /// <summary>
  7180. /// 撤销复检验条码
  7181. /// </summary>
  7182. /// <param name="sUserInfo"></param>
  7183. /// <returns></returns>
  7184. public ActionResult CancelSemiCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7185. {
  7186. ActionResult actionResult = new ActionResult();
  7187. try
  7188. {
  7189. // 验证请求头信息
  7190. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7191. // 验证失败
  7192. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7193. {
  7194. return actionResult;
  7195. }
  7196. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7197. () => PMModuleLogic.CancelSemiCheckBarcode(barcode, sUserInfo));
  7198. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7199. if (Convert.ToInt32(resultEntity.Result) < 0)
  7200. {
  7201. actionResult.Status = (int)Constant.PDAResult.Fail;
  7202. }
  7203. else
  7204. {
  7205. actionResult.Status = (int)Constant.PDAResult.Success;
  7206. }
  7207. actionResult.Message = resultEntity.Message;
  7208. }
  7209. catch (Exception ex)
  7210. {
  7211. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7212. OutputLog.TraceLog(LogPriority.Error,
  7213. this.ToString(),
  7214. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7215. ex.ToString(),
  7216. LocalPath.LogExePath);
  7217. actionResult.Status = (int)Constant.PDAResult.Exception;
  7218. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7219. }
  7220. return actionResult;
  7221. }
  7222. /// <summary>
  7223. /// 恢复数据
  7224. /// </summary>
  7225. /// <param name="sUserInfo"></param>
  7226. /// <returns></returns>
  7227. public ActionResult ResetBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7228. {
  7229. ActionResult actionResult = new ActionResult();
  7230. try
  7231. {
  7232. // 验证请求头信息
  7233. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7234. // 验证失败
  7235. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7236. {
  7237. return actionResult;
  7238. }
  7239. int resultEntity = ServiceInvoker.Invoke<int>(this,
  7240. () => PMModuleLogicDAL.ResetBarCode(barcode));
  7241. if (resultEntity > 0)
  7242. {
  7243. actionResult.Status = (int)Constant.PDAResult.Success;
  7244. actionResult.Message = "恢复数据成功";
  7245. }
  7246. else
  7247. {
  7248. actionResult.Status = (int)Constant.PDAResult.Fail;
  7249. if (resultEntity == -1)
  7250. {
  7251. actionResult.Message = "此条码没有清除,不能恢复";
  7252. }
  7253. else if (resultEntity == 0)
  7254. {
  7255. actionResult.Message = "没有可恢复的数据";
  7256. }
  7257. }
  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. /// <summary>
  7273. /// 通过SettingCode获取系统参数管理的数据
  7274. /// </summary>
  7275. /// <param name="accountCode"></param>
  7276. /// <param name="userCode"></param>
  7277. /// <param name="userPassword"></param>
  7278. /// <param name="sessionKey"></param>
  7279. /// <param name="settingcode">设置编码</param>
  7280. /// <returns></returns>
  7281. public ActionResult GetSystemSettingDataByCode(string accountCode, string userCode, string userPassword, string sessionKey, string settingcode)
  7282. {
  7283. ActionResult actionResult = new ActionResult();
  7284. try
  7285. {
  7286. // 验证请求头信息
  7287. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7288. // 验证失败
  7289. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7290. {
  7291. return actionResult;
  7292. }
  7293. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  7294. () => SystemModuleLogic.GetSystemSettingDataByCode(settingcode, sUserInfo));
  7295. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7296. actionResult.Status = (int)Constant.PDAResult.Success;
  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. /// <summary>
  7312. /// 校验条码是否允许撤销,如果不允许提示错误消息
  7313. /// </summary>
  7314. /// <param name="accountCode"></param>
  7315. /// <param name="userCode"></param>
  7316. /// <param name="userPassword"></param>
  7317. /// <param name="sessionKey"></param>
  7318. /// <param name="orgTime">原时间</param>
  7319. /// <param name="days">允许撤销天数</param>
  7320. /// <param name="settingCode">设置code,用于返回不同错误消息</param>
  7321. /// <returns></returns>
  7322. public ActionResult BarcodeAllowCancel(string accountCode, string userCode, string userPassword, string sessionKey, string orgTime, int days, string settingCode)
  7323. {
  7324. ActionResult actionResult = new ActionResult();
  7325. try
  7326. {
  7327. // 验证请求头信息
  7328. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7329. // 验证失败
  7330. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7331. {
  7332. return actionResult;
  7333. }
  7334. string[] subOrgTime = orgTime.Split('-');
  7335. DateTime newOrgTime = new DateTime(Convert.ToInt32(subOrgTime[0]), Convert.ToInt32(subOrgTime[1]), Convert.ToInt32(subOrgTime[2]));
  7336. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7337. () => PMModuleLogic.BarcodeAllowCancel(newOrgTime, days, settingCode, sUserInfo));
  7338. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7339. if (Convert.ToInt32(resultEntity.Result) < 0)
  7340. {
  7341. actionResult.Status = (int)Constant.PDAResult.Fail;
  7342. }
  7343. else
  7344. {
  7345. actionResult.Status = (int)Constant.PDAResult.Success;
  7346. }
  7347. actionResult.Message = resultEntity.Message;
  7348. }
  7349. catch (Exception ex)
  7350. {
  7351. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7352. OutputLog.TraceLog(LogPriority.Error,
  7353. this.ToString(),
  7354. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7355. ex.ToString(),
  7356. LocalPath.LogExePath);
  7357. actionResult.Status = (int)Constant.PDAResult.Exception;
  7358. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7359. }
  7360. return actionResult;
  7361. }
  7362. /// <summary>
  7363. /// 获取生产订单管理的全部数据
  7364. /// </summary>
  7365. /// <param name="sUserInfo"></param>
  7366. /// <returns></returns>
  7367. public ActionResult GetOrderList(string accountCode, string userCode, string userPassword, string sessionKey, OrderEntity order)
  7368. {
  7369. ActionResult actionResult = new ActionResult();
  7370. try
  7371. {
  7372. // 验证请求头信息
  7373. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7374. // 验证失败
  7375. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7376. {
  7377. return actionResult;
  7378. }
  7379. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  7380. () => PMModuleLogic.GetOrderList(order, sUserInfo));
  7381. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7382. actionResult.Status = (int)Constant.PDAResult.Success;
  7383. }
  7384. catch (Exception ex)
  7385. {
  7386. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7387. OutputLog.TraceLog(LogPriority.Error,
  7388. this.ToString(),
  7389. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7390. ex.ToString(),
  7391. LocalPath.LogExePath);
  7392. actionResult.Status = (int)Constant.PDAResult.Exception;
  7393. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7394. }
  7395. return actionResult;
  7396. }
  7397. public ActionResult FinishedHandoverBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7398. {
  7399. ActionResult actionResult = new ActionResult();
  7400. try
  7401. {
  7402. // 验证请求头信息
  7403. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7404. // 验证失败
  7405. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7406. {
  7407. return actionResult;
  7408. }
  7409. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7410. () => PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo));
  7411. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7412. if (Convert.ToInt32(resultEntity.Result) < 0)
  7413. {
  7414. actionResult.Status = (int)Constant.PDAResult.Fail;
  7415. actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
  7416. }
  7417. else
  7418. {
  7419. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  7420. actionResult.Status = (int)Constant.PDAResult.Success;
  7421. }
  7422. actionResult.Message = resultEntity.Message;
  7423. }
  7424. catch (Exception ex)
  7425. {
  7426. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7427. OutputLog.TraceLog(LogPriority.Error,
  7428. this.ToString(),
  7429. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7430. ex.ToString(),
  7431. LocalPath.LogExePath);
  7432. actionResult.Status = (int)Constant.PDAResult.Exception;
  7433. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7434. }
  7435. return actionResult;
  7436. }
  7437. public ActionResult GetSystemData(string accountCode, string userCode, string userPassword, string sessionKey)
  7438. {
  7439. ActionResult actionResult = new ActionResult();
  7440. try
  7441. {
  7442. // 验证请求头信息
  7443. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7444. // 验证失败
  7445. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7446. {
  7447. return actionResult;
  7448. }
  7449. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  7450. () => SystemModuleLogic.GetSystemData(sUserInfo));
  7451. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7452. actionResult.Status = (int)Constant.PDAResult.Success;
  7453. }
  7454. catch (Exception ex)
  7455. {
  7456. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7457. OutputLog.TraceLog(LogPriority.Error,
  7458. this.ToString(),
  7459. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7460. ex.ToString(),
  7461. LocalPath.LogExePath);
  7462. actionResult.Status = (int)Constant.PDAResult.Exception;
  7463. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7464. }
  7465. return actionResult;
  7466. }
  7467. public ActionResult SaveFinishedHandover(string accountCode, string userCode, string userPassword, string sessionKey, int orderid, OrderEntity[] orderEntity)
  7468. {
  7469. ActionResult actionResult = new ActionResult();
  7470. try
  7471. {
  7472. // 验证请求头信息
  7473. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7474. // 验证失败
  7475. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7476. {
  7477. return actionResult;
  7478. }
  7479. DataTable dtOrderData = DataConvert.ObjectConvertToTable<OrderEntity>(orderEntity);
  7480. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7481. () => PMModuleLogicDAL.SaveFinishedHandover(orderid, dtOrderData, sUserInfo));
  7482. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7483. if (Convert.ToInt32(resultEntity.Result) < 0)
  7484. {
  7485. actionResult.Status = (int)Constant.PDAResult.Fail;
  7486. }
  7487. else
  7488. {
  7489. actionResult.Status = (int)Constant.PDAResult.Success;
  7490. }
  7491. actionResult.Message = resultEntity.Message;
  7492. }
  7493. catch (Exception ex)
  7494. {
  7495. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7496. OutputLog.TraceLog(LogPriority.Error,
  7497. this.ToString(),
  7498. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7499. ex.ToString(),
  7500. LocalPath.LogExePath);
  7501. actionResult.Status = (int)Constant.PDAResult.Exception;
  7502. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7503. }
  7504. return actionResult;
  7505. }
  7506. public ActionResult CancelFinishedHandoverBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7507. {
  7508. ActionResult actionResult = new ActionResult();
  7509. try
  7510. {
  7511. // 验证请求头信息
  7512. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7513. // 验证失败
  7514. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7515. {
  7516. return actionResult;
  7517. }
  7518. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7519. () => PMModuleLogic.CancelFinishedHandoverBarcode(barcode, sUserInfo));
  7520. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7521. if (Convert.ToInt32(resultEntity.Result) < 0)
  7522. {
  7523. actionResult.Status = (int)Constant.PDAResult.Fail;
  7524. }
  7525. else
  7526. {
  7527. actionResult.Result = JsonHelper.ToJson(resultEntity.Data.Tables[0]);
  7528. actionResult.Status = (int)Constant.PDAResult.Success;
  7529. }
  7530. actionResult.Message = resultEntity.Message;
  7531. }
  7532. catch (Exception ex)
  7533. {
  7534. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7535. OutputLog.TraceLog(LogPriority.Error,
  7536. this.ToString(),
  7537. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7538. ex.ToString(),
  7539. LocalPath.LogExePath);
  7540. actionResult.Status = (int)Constant.PDAResult.Exception;
  7541. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7542. }
  7543. return actionResult;
  7544. }
  7545. public ActionResult SaveCancelFinishedHandoverByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7546. {
  7547. ActionResult actionResult = new ActionResult();
  7548. try
  7549. {
  7550. // 验证请求头信息
  7551. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7552. // 验证失败
  7553. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7554. {
  7555. return actionResult;
  7556. }
  7557. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7558. () => PMModuleLogicDAL.SaveCancelFinishedHandoverByBarcode(barcode, sUserInfo));
  7559. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7560. if (Convert.ToInt32(resultEntity.Result) < 0)
  7561. {
  7562. actionResult.Status = (int)Constant.PDAResult.Fail;
  7563. }
  7564. else
  7565. {
  7566. actionResult.Status = (int)Constant.PDAResult.Success;
  7567. }
  7568. actionResult.Message = resultEntity.Message;
  7569. }
  7570. catch (Exception ex)
  7571. {
  7572. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7573. OutputLog.TraceLog(LogPriority.Error,
  7574. this.ToString(),
  7575. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7576. ex.ToString(),
  7577. LocalPath.LogExePath);
  7578. actionResult.Status = (int)Constant.PDAResult.Exception;
  7579. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7580. }
  7581. return actionResult;
  7582. }
  7583. public ActionResult SaveChangeFinishedHandoverByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int orderid)
  7584. {
  7585. ActionResult actionResult = new ActionResult();
  7586. try
  7587. {
  7588. // 验证请求头信息
  7589. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7590. // 验证失败
  7591. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7592. {
  7593. return actionResult;
  7594. }
  7595. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7596. () => PMModuleLogicDAL.SaveChangeFinishedHandoverByBarcode(barcode, orderid, sUserInfo));
  7597. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7598. if (Convert.ToInt32(resultEntity.Result) < 0)
  7599. {
  7600. actionResult.Status = (int)Constant.PDAResult.Fail;
  7601. }
  7602. else
  7603. {
  7604. actionResult.Status = (int)Constant.PDAResult.Success;
  7605. }
  7606. actionResult.Message = resultEntity.Message;
  7607. }
  7608. catch (Exception ex)
  7609. {
  7610. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7611. OutputLog.TraceLog(LogPriority.Error,
  7612. this.ToString(),
  7613. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7614. ex.ToString(),
  7615. LocalPath.LogExePath);
  7616. actionResult.Status = (int)Constant.PDAResult.Exception;
  7617. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7618. }
  7619. return actionResult;
  7620. }
  7621. #region PDA条码打印
  7622. /// <summary>
  7623. /// 获取条码打印机
  7624. /// </summary>
  7625. /// <param name="accountCode"></param>
  7626. /// <param name="userCode"></param>
  7627. /// <param name="userPassword"></param>
  7628. /// <param name="sessionKey"></param>
  7629. /// <returns></returns>
  7630. public ActionResult GetBarcodePrinter(string accountCode, string userCode, string userPassword, string sessionKey, int printType = 0)
  7631. {
  7632. ActionResult actionResult = new ActionResult();
  7633. try
  7634. {
  7635. // 验证请求头信息
  7636. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7637. // 验证失败
  7638. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7639. {
  7640. return actionResult;
  7641. }
  7642. DataSet resultEntity = BarcodePrintLogic.GetBarcodePrinter(sUserInfo, printType);
  7643. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7644. actionResult.Status = (int)Constant.PDAResult.Success;
  7645. }
  7646. catch (Exception ex)
  7647. {
  7648. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7649. OutputLog.TraceLog(LogPriority.Error,
  7650. this.ToString(),
  7651. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7652. ex.ToString(),
  7653. LocalPath.LogExePath);
  7654. actionResult.Status = (int)Constant.PDAResult.Exception;
  7655. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7656. }
  7657. return actionResult;
  7658. }
  7659. /// <summary>
  7660. /// 打印条码样式(补打)
  7661. /// </summary>
  7662. /// <param name="accountCode"></param>
  7663. /// <param name="userCode"></param>
  7664. /// <param name="userPassword"></param>
  7665. /// <param name="sessionKey"></param>
  7666. /// <returns></returns>
  7667. public ActionResult PrintBarcodeLayout(string accountCode, string userCode, string userPassword, string sessionKey,
  7668. string barcode, int copies, int printerID, int printWay = 2)
  7669. {
  7670. ActionResult actionResult = new ActionResult();
  7671. try
  7672. {
  7673. // 验证请求头信息
  7674. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7675. // 验证失败
  7676. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7677. {
  7678. return actionResult;
  7679. }
  7680. //ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode(barcode,
  7681. // copies, printerID, sUserInfo);
  7682. ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode_3C(barcode,
  7683. copies, printerID, sUserInfo, printWay);
  7684. if (sre.Status != Constant.ServiceResultStatus.Success)
  7685. {
  7686. actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  7687. actionResult.Message = sre.Message;
  7688. return actionResult;
  7689. }
  7690. actionResult.Result = JsonHelper.ToJson(sre.Result as DataTable);
  7691. actionResult.Status = (int)Constant.PDAResult.Success;
  7692. }
  7693. catch (Exception ex)
  7694. {
  7695. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7696. OutputLog.TraceLog(LogPriority.Error,
  7697. this.ToString(),
  7698. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7699. ex.ToString(),
  7700. LocalPath.LogExePath);
  7701. actionResult.Status = (int)Constant.PDAResult.Exception;
  7702. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7703. }
  7704. return actionResult;
  7705. }
  7706. #endregion PDA条码打印
  7707. #region 统计报表
  7708. /// <summary>
  7709. /// 成型结算报表
  7710. /// </summary>
  7711. /// <param name="accountCode"></param>
  7712. /// <param name="userCode"></param>
  7713. /// <param name="userPassword"></param>
  7714. /// <param name="sessionKey"></param>
  7715. /// <returns></returns>
  7716. public ActionResult GetGroutingSettlementInfo(string accountCode, string userCode, string userPassword, string sessionKey,
  7717. int currentMonth)
  7718. {
  7719. ActionResult actionResult = new ActionResult();
  7720. try
  7721. {
  7722. // 验证请求头信息
  7723. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7724. // 验证失败
  7725. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7726. {
  7727. return actionResult;
  7728. }
  7729. DateTime date = DateTime.Now;
  7730. if (currentMonth != 1)
  7731. {
  7732. date = date.AddMonths(-1);
  7733. }
  7734. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7735. () => PublicModuleLogic.GetFP00002Data(sUserInfo.AccountID, userCode, date));
  7736. if (resultEntity == null || resultEntity.Data == null)
  7737. {
  7738. actionResult.Status = (int)Constant.PDAResult.Fail;
  7739. actionResult.Message = "查询失败";
  7740. return actionResult;
  7741. }
  7742. if (resultEntity.Status == Constant.ServiceResultStatus.Other)
  7743. {
  7744. actionResult.Status = (int)Constant.PDAResult.Fail;
  7745. actionResult.Message = resultEntity.Message;
  7746. return actionResult;
  7747. }
  7748. actionResult.Result = JsonHelper.ToJson(resultEntity.Data.Tables["DataM"]);
  7749. actionResult.Status = (int)Constant.PDAResult.Success;
  7750. }
  7751. catch (Exception ex)
  7752. {
  7753. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7754. OutputLog.TraceLog(LogPriority.Error,
  7755. this.ToString(),
  7756. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7757. ex.ToString(),
  7758. LocalPath.LogExePath);
  7759. actionResult.Status = (int)Constant.PDAResult.Exception;
  7760. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7761. }
  7762. return actionResult;
  7763. }
  7764. #endregion
  7765. #region 设置当期用户默认打印机配置
  7766. /// <summary>
  7767. /// 设置当期用户默认打印机配置
  7768. /// </summary>
  7769. /// <param name="accountCode"></param>
  7770. /// <param name="userCode"></param>
  7771. /// <param name="userPassword"></param>
  7772. /// <param name="sessionKey"></param>
  7773. /// <param name="printerID"></param>
  7774. /// <returns></returns>
  7775. public ActionResult SetCurrentUserPrinter(string accountCode, string userCode, string userPassword, string sessionKey,
  7776. int printerID)
  7777. {
  7778. ActionResult actionResult = new ActionResult();
  7779. try
  7780. {
  7781. // 验证请求头信息
  7782. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7783. // 验证失败
  7784. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7785. {
  7786. return actionResult;
  7787. }
  7788. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7789. () => BarcodePrintLogic.SetCurrentUserPrinter(printerID, sUserInfo));
  7790. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7791. if (resultEntity.Status == Constant.ServiceResultStatus.Other || Convert.ToInt32(resultEntity.Result) < 0)
  7792. {
  7793. actionResult.Status = (int)Constant.PDAResult.Fail;
  7794. }
  7795. else
  7796. {
  7797. actionResult.Status = (int)Constant.PDAResult.Success;
  7798. }
  7799. actionResult.Message = resultEntity.Message;
  7800. }
  7801. catch (Exception ex)
  7802. {
  7803. OutputLog.TraceLog(LogPriority.Error,
  7804. this.ToString(),
  7805. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7806. ex.ToString(),
  7807. LocalPath.LogExePath);
  7808. actionResult.Status = (int)Constant.PDAResult.Exception;
  7809. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7810. }
  7811. return actionResult;
  7812. }
  7813. /// <summary>
  7814. /// 校验产品条码是否可以进行回收
  7815. /// </summary>
  7816. /// <param name="accountCode">帐套code</param>
  7817. /// <param name="userCode">用户code</param>
  7818. /// <param name="userPassword">用户密码</param>
  7819. /// <param name="sessionKey">本次登陆密钥</param>
  7820. /// <param name="procedureID">工序ID</param>
  7821. /// <param name="barcode">条码</param>
  7822. /// <returns></returns>
  7823. /// <remarks>
  7824. /// 王鑫 2017.7.21 新建
  7825. /// </remarks>
  7826. public ActionResult CheckRecydingFlagBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  7827. {
  7828. ActionResult actionResult = new ActionResult();
  7829. try
  7830. {
  7831. // 验证请求头信息
  7832. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7833. // 验证失败
  7834. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7835. {
  7836. return actionResult;
  7837. }
  7838. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  7839. () => PMModuleLogic.CheckRecydingFlagBarcode(procedureID, barcode, sUserInfo));
  7840. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  7841. {
  7842. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  7843. actionResult.Status = (int)Constant.PDAResult.Success;
  7844. }
  7845. else
  7846. {
  7847. actionResult.Status = (int)Constant.PDAResult.Fail;
  7848. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  7849. }
  7850. }
  7851. catch (Exception ex)
  7852. {
  7853. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7854. OutputLog.TraceLog(LogPriority.Error,
  7855. this.ToString(),
  7856. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7857. ex.ToString(),
  7858. LocalPath.LogExePath);
  7859. actionResult.Status = (int)Constant.PDAResult.Exception;
  7860. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7861. }
  7862. return actionResult;
  7863. }
  7864. /// <summary>
  7865. /// 获取回收标识
  7866. /// </summary>
  7867. /// <param name="accountCode"></param>
  7868. /// <param name="userCode"></param>
  7869. /// <param name="userPassword"></param>
  7870. /// <param name="sessionKey"></param>
  7871. /// <param name="usercode">工号编码</param>
  7872. /// <returns></returns>
  7873. public ActionResult GetRecyclingflagByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7874. {
  7875. ActionResult actionResult = new ActionResult();
  7876. try
  7877. {
  7878. // 验证请求头信息
  7879. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7880. // 验证失败
  7881. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7882. {
  7883. return actionResult;
  7884. }
  7885. int returnValue = ServiceInvoker.Invoke<int>(this,
  7886. () => PMModuleLogic.GetRecyclingflagByBarcode(barcode, sUserInfo));
  7887. actionResult.Result = JsonHelper.ToJson(returnValue);
  7888. actionResult.Status = (int)Constant.PDAResult.Success;
  7889. }
  7890. catch (Exception ex)
  7891. {
  7892. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7893. OutputLog.TraceLog(LogPriority.Error,
  7894. this.ToString(),
  7895. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7896. ex.ToString(),
  7897. LocalPath.LogExePath);
  7898. actionResult.Status = (int)Constant.PDAResult.Exception;
  7899. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7900. }
  7901. return actionResult;
  7902. }
  7903. #endregion
  7904. #region 注浆盘点
  7905. /// <summary>
  7906. /// 获取注浆盘点单列表
  7907. /// </summary>
  7908. /// <param name="sUserInfo"></param>
  7909. /// <returns></returns>
  7910. public ActionResult GetAllGBChecked(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity)
  7911. {
  7912. ActionResult actionResult = new ActionResult();
  7913. try
  7914. {
  7915. // 验证请求头信息
  7916. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7917. // 验证失败
  7918. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7919. {
  7920. return actionResult;
  7921. }
  7922. entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA);
  7923. entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1);
  7924. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  7925. () => PDAModuleLogic.GetAllGBChecked(entity, sUserInfo));
  7926. actionResult.Result = JsonHelper.ToJson(ds);
  7927. actionResult.Status = (int)Constant.PDAResult.Success;
  7928. }
  7929. catch (Exception ex)
  7930. {
  7931. string json = JsonHelper.ToJson(entity);
  7932. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7933. OutputLog.TraceLog(LogPriority.Error,
  7934. this.ToString(),
  7935. System.Reflection.MethodBase.GetCurrentMethod().Name + "\r\n" + json,
  7936. ex.ToString(),
  7937. LocalPath.LogExePath);
  7938. actionResult.Status = (int)Constant.PDAResult.Exception;
  7939. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7940. }
  7941. return actionResult;
  7942. }
  7943. /// <summary>
  7944. /// 进行盘点操作
  7945. /// </summary>
  7946. /// <param name="accountCode"></param>
  7947. /// <param name="userCode"></param>
  7948. /// <param name="userPassword"></param>
  7949. /// <param name="sessionKey"></param>
  7950. /// <param name="InCheckedID">盘点单ID</param>
  7951. /// <param name="BarCode">产品条码</param>
  7952. /// <returns></returns>
  7953. public ActionResult UpdateGBChecked(string accountCode, string userCode, string userPassword, string sessionKey, int CheckedID, string BarCode)
  7954. {
  7955. ActionResult actionResult = new ActionResult();
  7956. try
  7957. {
  7958. // 验证请求头信息
  7959. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7960. // 验证失败
  7961. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7962. {
  7963. return actionResult;
  7964. }
  7965. ClientRequestEntity cre = new ClientRequestEntity();
  7966. cre.Properties["CheckedID"] = CheckedID;
  7967. cre.Properties["Barcode"] = BarCode;
  7968. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7969. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.UpdateGBChecked(sUserInfo, cre));
  7970. if (returnValue.Status == Constant.ServiceResultStatus.Success)
  7971. {
  7972. //actionResult.Result = JsonHelper.ToJson(returnValue);
  7973. actionResult.Status = (int)Constant.PDAResult.Success;
  7974. actionResult.Message = "产品【" + BarCode + "】盘点成功";
  7975. }
  7976. else
  7977. {
  7978. //actionResult.Result = JsonHelper.ToJson(returnValue);
  7979. actionResult.Status = (int)Constant.PDAResult.Fail;
  7980. actionResult.Message = returnValue.Message;
  7981. }
  7982. }
  7983. catch (Exception ex)
  7984. {
  7985. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7986. OutputLog.TraceLog(LogPriority.Error,
  7987. this.ToString(),
  7988. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7989. ex.ToString(),
  7990. LocalPath.LogExePath);
  7991. actionResult.Status = (int)Constant.PDAResult.Exception;
  7992. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7993. }
  7994. return actionResult;
  7995. }
  7996. /// <summary>
  7997. /// 获取盘点单明细
  7998. /// </summary>
  7999. /// <param name="sUserInfo"></param>
  8000. /// <returns></returns>
  8001. public ActionResult GetUpdateGBCheckedInfo(string accountCode, string userCode, string userPassword, string sessionKey, int checkedID)
  8002. {
  8003. ActionResult actionResult = new ActionResult();
  8004. try
  8005. {
  8006. // 验证请求头信息
  8007. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  8008. // 验证失败
  8009. if (actionResult.Status != (int)Constant.PDAResult.Success)
  8010. {
  8011. return actionResult;
  8012. }
  8013. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  8014. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.
  8015. GetUpdateGBCheckedInfo(checkedID, sUserInfo));
  8016. actionResult.Result = JsonHelper.ToJson(ds);
  8017. actionResult.Status = (int)Constant.PDAResult.Success;
  8018. }
  8019. catch (Exception ex)
  8020. {
  8021. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  8022. OutputLog.TraceLog(LogPriority.Error,
  8023. this.ToString(),
  8024. System.Reflection.MethodBase.GetCurrentMethod().Name,
  8025. ex.ToString(),
  8026. LocalPath.LogExePath);
  8027. actionResult.Status = (int)Constant.PDAResult.Exception;
  8028. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  8029. }
  8030. return actionResult;
  8031. }
  8032. #endregion
  8033. #region 模具盘点
  8034. /// <summary>
  8035. /// 获取模具盘点单列表
  8036. /// </summary>
  8037. /// <param name="sUserInfo"></param>
  8038. /// <returns></returns>
  8039. public ActionResult GetAllMouldChecked(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity)
  8040. {
  8041. ActionResult actionResult = new ActionResult();
  8042. try
  8043. {
  8044. // 验证请求头信息
  8045. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  8046. // 验证失败
  8047. if (actionResult.Status != (int)Constant.PDAResult.Success)
  8048. {
  8049. return actionResult;
  8050. }
  8051. entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA);
  8052. entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1);
  8053. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  8054. () => PDAModuleLogic.GetAllMouldChecked(entity, sUserInfo));
  8055. actionResult.Result = JsonHelper.ToJson(ds);
  8056. actionResult.Status = (int)Constant.PDAResult.Success;
  8057. }
  8058. catch (Exception ex)
  8059. {
  8060. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  8061. OutputLog.TraceLog(LogPriority.Error,
  8062. this.ToString(),
  8063. System.Reflection.MethodBase.GetCurrentMethod().Name,
  8064. ex.ToString(),
  8065. LocalPath.LogExePath);
  8066. actionResult.Status = (int)Constant.PDAResult.Exception;
  8067. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  8068. }
  8069. return actionResult;
  8070. }
  8071. /// <summary>
  8072. /// 进行盘点操作
  8073. /// </summary>
  8074. /// <param name="accountCode"></param>
  8075. /// <param name="userCode"></param>
  8076. /// <param name="userPassword"></param>
  8077. /// <param name="sessionKey"></param>
  8078. /// <param name="InCheckedID">盘点单ID</param>
  8079. /// <param name="BarCode">产品条码</param>
  8080. /// <returns></returns>
  8081. public ActionResult UpdateMouldChecked(string accountCode, string userCode, string userPassword, string sessionKey, int CheckedID, string BarCode)
  8082. {
  8083. ActionResult actionResult = new ActionResult();
  8084. try
  8085. {
  8086. // 验证请求头信息
  8087. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  8088. // 验证失败
  8089. if (actionResult.Status != (int)Constant.PDAResult.Success)
  8090. {
  8091. return actionResult;
  8092. }
  8093. ClientRequestEntity cre = new ClientRequestEntity();
  8094. cre.Properties["CheckedID"] = CheckedID;
  8095. cre.Properties["Barcode"] = BarCode;
  8096. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  8097. () => Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.UpdateMouldChecked(sUserInfo, cre));
  8098. if (returnValue.Status == Constant.ServiceResultStatus.Success)
  8099. {
  8100. //actionResult.Result = JsonHelper.ToJson(returnValue);
  8101. actionResult.Status = (int)Constant.PDAResult.Success;
  8102. actionResult.Message = "产品【" + BarCode + "】盘点成功";
  8103. }
  8104. else
  8105. {
  8106. //actionResult.Result = JsonHelper.ToJson(returnValue);
  8107. actionResult.Status = (int)Constant.PDAResult.Fail;
  8108. actionResult.Message = returnValue.Message;
  8109. }
  8110. }
  8111. catch (Exception ex)
  8112. {
  8113. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  8114. OutputLog.TraceLog(LogPriority.Error,
  8115. this.ToString(),
  8116. System.Reflection.MethodBase.GetCurrentMethod().Name,
  8117. ex.ToString(),
  8118. LocalPath.LogExePath);
  8119. actionResult.Status = (int)Constant.PDAResult.Exception;
  8120. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  8121. }
  8122. return actionResult;
  8123. }
  8124. /// <summary>
  8125. /// 获取盘点单明细
  8126. /// </summary>
  8127. /// <param name="sUserInfo"></param>
  8128. /// <returns></returns>
  8129. public ActionResult GetUpdateMouldCheckedInfo(string accountCode, string userCode, string userPassword, string sessionKey, int checkedID)
  8130. {
  8131. ActionResult actionResult = new ActionResult();
  8132. try
  8133. {
  8134. // 验证请求头信息
  8135. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  8136. // 验证失败
  8137. if (actionResult.Status != (int)Constant.PDAResult.Success)
  8138. {
  8139. return actionResult;
  8140. }
  8141. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  8142. () => Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.
  8143. GetUpdateMouldCheckedInfo(checkedID, sUserInfo));
  8144. actionResult.Result = JsonHelper.ToJson(ds);
  8145. actionResult.Status = (int)Constant.PDAResult.Success;
  8146. }
  8147. catch (Exception ex)
  8148. {
  8149. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  8150. OutputLog.TraceLog(LogPriority.Error,
  8151. this.ToString(),
  8152. System.Reflection.MethodBase.GetCurrentMethod().Name,
  8153. ex.ToString(),
  8154. LocalPath.LogExePath);
  8155. actionResult.Status = (int)Constant.PDAResult.Exception;
  8156. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  8157. }
  8158. return actionResult;
  8159. }
  8160. #endregion
  8161. #region 通用接口
  8162. /// <summary>
  8163. /// PDA调用通用接口
  8164. /// </summary>
  8165. /// <param name="accountCode"></param>
  8166. /// <param name="userCode"></param>
  8167. /// <param name="userPassword"></param>
  8168. /// <param name="sessionKey"></param>
  8169. /// <param name="module"></param>
  8170. /// <param name="action"></param>
  8171. /// <param name="data"></param>
  8172. /// <returns></returns>
  8173. public ActionResult DoAction(string accountCode, string userCode, string userPassword, string sessionKey,
  8174. string module, string action, string jsonData)
  8175. {
  8176. ActionResult actionResult = null;
  8177. try
  8178. {
  8179. // 验证请求头信息
  8180. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  8181. // 验证失败
  8182. if (actionResult.Status != (int)Constant.PDAResult.Success)
  8183. {
  8184. return actionResult;
  8185. }
  8186. actionResult.Status = (int)Constant.PDAResult.Fail;
  8187. Dictionary<string, object> data = null;
  8188. if (!string.IsNullOrEmpty(jsonData) && jsonData[0] == '{')
  8189. {
  8190. data = JsonHelper.FromJson<Dictionary<string, object>>(jsonData);
  8191. }
  8192. #region PDA报表
  8193. if (module == "Report")
  8194. {
  8195. // 成型月度结算
  8196. if (action == "GetGroutingSettlementInfo")
  8197. {
  8198. DateTime month = DateTime.Now;
  8199. month = new DateTime(month.Year, month.Month, 1);
  8200. //month = new DateTime(2017, 6, 1);
  8201. int currentMonth = Convert.ToInt32(data["CurrentMonth"]);
  8202. if (currentMonth != 1)
  8203. {
  8204. month = month.AddMonths(-1);
  8205. }
  8206. ServiceResultEntity sre = PDAModuleLogic.GetGroutingSettlementInfo(sUserInfo, month);
  8207. if (sre.Status == Constant.ServiceResultStatus.Success)
  8208. {
  8209. actionResult.Status = (int)Constant.PDAResult.Success;
  8210. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8211. }
  8212. else
  8213. {
  8214. actionResult.Status = (int)Constant.PDAResult.Fail;
  8215. actionResult.Message = sre.Message;
  8216. }
  8217. return actionResult;
  8218. }
  8219. // 成型月度结算-明细
  8220. if (action == "GetGroutingSettlementDetail")
  8221. {
  8222. DateTime month = DateTime.Now;
  8223. month = new DateTime(month.Year, month.Month, 1);
  8224. //month = new DateTime(2017, 6, 1);
  8225. int currentMonth = Convert.ToInt32(data["CurrentMonth"]);
  8226. if (currentMonth != 1)
  8227. {
  8228. month = month.AddMonths(-1);
  8229. }
  8230. string goodsCode = data["GoodsCode"].ToString();
  8231. string detailDate = data["DetailDate"].ToString();
  8232. DateTime? date = null;
  8233. if (detailDate != "合计")
  8234. {
  8235. date = DateTime.Parse(detailDate);
  8236. }
  8237. ServiceResultEntity sre = PDAModuleLogic.GetGroutingSettlementDetail(sUserInfo, month, goodsCode, date);
  8238. if (sre.Status == Constant.ServiceResultStatus.Success)
  8239. {
  8240. actionResult.Status = (int)Constant.PDAResult.Success;
  8241. actionResult.Result = JsonHelper.ToJson(sre.Data);
  8242. }
  8243. else
  8244. {
  8245. actionResult.Status = (int)Constant.PDAResult.Fail;
  8246. actionResult.Message = sre.Message;
  8247. }
  8248. return actionResult;
  8249. }
  8250. // 产成品交接汇总
  8251. if (action == "GetFinishedProductHandoverSum")
  8252. {
  8253. DateTime date = DateTime.Parse(data["date"].ToString());
  8254. ServiceResultEntity sre = ReportModuleLogic.GetRPT0030112NPDAData(date,
  8255. data["goodscode"] as string, sUserInfo);
  8256. if (sre.Status == Constant.ServiceResultStatus.Success)
  8257. {
  8258. actionResult.Status = (int)Constant.PDAResult.Success;
  8259. actionResult.Result = JsonHelper.ToJson(sre.Data);
  8260. }
  8261. else if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  8262. {
  8263. actionResult.Status = (int)Constant.PDAResult.Success;
  8264. }
  8265. else
  8266. {
  8267. actionResult.Status = (int)Constant.PDAResult.Fail;
  8268. actionResult.Message = sre.Message;
  8269. }
  8270. return actionResult;
  8271. }
  8272. //xuwei add 2019-10-21
  8273. //统计当前工号,当日,按产品编码分组统计半检返修数据数量
  8274. if (action == "GetSemiReworkDayCount")
  8275. {
  8276. //不指定参数查询当天
  8277. string dateStr = DateTime.Now.ToString("yyyy-MM-dd");
  8278. //dateStr = "2019-10-17";
  8279. //指定参数查询特定日期
  8280. if (data.ContainsKey("SemiReworkDate")) dateStr = data["SemiReworkDate"].ToString();
  8281. ServiceResultEntity sre = ReportModuleLogic.GetSemiReworkDayCount(sUserInfo, dateStr);
  8282. if (sre.Status == Constant.ServiceResultStatus.Success)
  8283. {
  8284. actionResult.Status = (int)Constant.PDAResult.Success;
  8285. actionResult.Result = JsonHelper.ToJson(sre.Data);
  8286. }
  8287. else
  8288. {
  8289. actionResult.Status = (int)Constant.PDAResult.Fail;
  8290. actionResult.Message = sre.Message;
  8291. }
  8292. return actionResult;
  8293. }
  8294. //xuwe end
  8295. return actionResult;
  8296. }
  8297. #endregion
  8298. #region 模具管理
  8299. if (module == "PC_Mould")
  8300. {
  8301. #region 模具新建画面数据初始化
  8302. if (action == "GetMouldAddInit")
  8303. {
  8304. ClientRequestEntity cre = new ClientRequestEntity();
  8305. cre.Properties["MouldID"] = 0;
  8306. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1002LoadData(sUserInfo, cre);
  8307. if (sre.Status == Constant.ServiceResultStatus.Success)
  8308. {
  8309. actionResult.Status = (int)Constant.PDAResult.Success;
  8310. actionResult.Result = JsonHelper.ToJson(sre.Data);
  8311. }
  8312. else
  8313. {
  8314. actionResult.Status = (int)Constant.PDAResult.Fail;
  8315. actionResult.Message = sre.Message;
  8316. }
  8317. return actionResult;
  8318. }
  8319. #endregion
  8320. #region 验证模具产品型号
  8321. if (action == "CheckGoodsCodeOnMould")
  8322. {
  8323. ClientRequestEntity cre = new ClientRequestEntity();
  8324. cre.Properties["GoodsCode"] = data["GoodsCode"];
  8325. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1002GoodsData(sUserInfo, cre);
  8326. if (sre.Status == Constant.ServiceResultStatus.Success &&
  8327. sre.Data.Tables[0].Rows.Count > 0)
  8328. {
  8329. actionResult.Status = (int)Constant.PDAResult.Success;
  8330. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8331. }
  8332. else
  8333. {
  8334. actionResult.Status = (int)Constant.PDAResult.Fail;
  8335. actionResult.Message = "无效产品型号";
  8336. }
  8337. return actionResult;
  8338. }
  8339. #endregion
  8340. #region 验证模具生产工号
  8341. if (action == "CheckUserCodeOnMould")
  8342. {
  8343. DataTable sre = PDAModuleLogic.GetUserCodeOnMould(sUserInfo, data["UserCode"].ToString());
  8344. if (sre != null && sre.Rows.Count > 0)
  8345. {
  8346. actionResult.Status = (int)Constant.PDAResult.Success;
  8347. actionResult.Result = JsonHelper.ToJson(sre);
  8348. }
  8349. else
  8350. {
  8351. actionResult.Status = (int)Constant.PDAResult.Fail;
  8352. actionResult.Message = "无效生产工号";
  8353. }
  8354. return actionResult;
  8355. }
  8356. #endregion
  8357. #region 新建保存
  8358. if (action == "SetMouldAdd" || action == "SetMouldEdit")
  8359. {
  8360. ClientRequestEntity cre = new ClientRequestEntity();
  8361. foreach (string item in data.Keys)
  8362. {
  8363. if (item == "ProductionDate")
  8364. {
  8365. cre.Properties.Add(item, Convert.ToDateTime(data[item]));
  8366. }
  8367. else
  8368. {
  8369. cre.Properties.Add(item, data[item]);
  8370. }
  8371. }
  8372. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1002Data(sUserInfo, cre);
  8373. if (sre.Status == Constant.ServiceResultStatus.Success)
  8374. {
  8375. actionResult.Status = (int)Constant.PDAResult.Success;
  8376. }
  8377. else
  8378. {
  8379. actionResult.Status = (int)Constant.PDAResult.Fail;
  8380. actionResult.Result = sre.OtherStatus;
  8381. actionResult.Message = sre.Message;
  8382. }
  8383. return actionResult;
  8384. }
  8385. #endregion
  8386. #region 模具编辑画面数据初始化
  8387. if (action == "GetMouldEditInfo")
  8388. {
  8389. DataTable sre = PDAModuleLogic.GetMouldEditInfo(sUserInfo, data["MouldBarcode"].ToString());
  8390. if (sre != null && sre.Rows.Count > 0)
  8391. {
  8392. actionResult.Status = (int)Constant.PDAResult.Success;
  8393. actionResult.Result = JsonHelper.ToJson(sre);
  8394. }
  8395. else
  8396. {
  8397. actionResult.Status = (int)Constant.PDAResult.Fail;
  8398. actionResult.Message = "无效模具条码";
  8399. }
  8400. return actionResult;
  8401. }
  8402. #endregion
  8403. #region 模具操作-画面初始化
  8404. if (action == "GetMouldOperationInit")
  8405. {
  8406. ClientRequestEntity cre = new ClientRequestEntity();
  8407. cre.Properties["MouldOperationType"] = data["MouldOperationType"];
  8408. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1004LoadData(sUserInfo, cre);
  8409. if (sre.Status == Constant.ServiceResultStatus.Success)
  8410. {
  8411. actionResult.Status = (int)Constant.PDAResult.Success;
  8412. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8413. }
  8414. else
  8415. {
  8416. actionResult.Status = (int)Constant.PDAResult.Fail;
  8417. actionResult.Result = sre.OtherStatus;
  8418. actionResult.Message = sre.Message;
  8419. }
  8420. return actionResult;
  8421. }
  8422. #endregion
  8423. #region 模具操作-验证模具条码
  8424. if (action == "CheckMouldBarcode")
  8425. {
  8426. ClientRequestEntity cre = new ClientRequestEntity();
  8427. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8428. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetMouldData(sUserInfo, cre);
  8429. if (sre.Status == Constant.ServiceResultStatus.Success)
  8430. {
  8431. if (sre.Data.Tables[0].Rows.Count == 0)
  8432. {
  8433. actionResult.Status = (int)Constant.PDAResult.Fail;
  8434. actionResult.Result = -1;
  8435. actionResult.Message = "模具【" + data["MouldBarcode"] + "】不存在";
  8436. return actionResult;
  8437. }
  8438. int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
  8439. int mouldStatusID = Convert.ToInt32(sre.Data.Tables[0].Rows[0]["MouldStatus"]);
  8440. string mouldStatusName = sre.Data.Tables[0].Rows[0]["MouldStatusName"].ToString();
  8441. #region 报损
  8442. if (mouldOperationType == 2)
  8443. {
  8444. if (mouldStatusID == 1 || mouldStatusID == 3)
  8445. {
  8446. actionResult.Status = (int)Constant.PDAResult.Success;
  8447. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8448. }
  8449. else
  8450. {
  8451. actionResult.Status = (int)Constant.PDAResult.Fail;
  8452. actionResult.Result = -2;
  8453. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行报损操作";
  8454. }
  8455. return actionResult;
  8456. }
  8457. #endregion
  8458. #region 撤销
  8459. if (mouldOperationType == 3)
  8460. {
  8461. if (mouldStatusID == 4)
  8462. {
  8463. actionResult.Status = (int)Constant.PDAResult.Success;
  8464. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8465. }
  8466. else
  8467. {
  8468. actionResult.Status = (int)Constant.PDAResult.Fail;
  8469. actionResult.Result = -2;
  8470. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行撤销报损操作";
  8471. }
  8472. return actionResult;
  8473. }
  8474. #endregion
  8475. #region 领用
  8476. if (mouldOperationType == 4)
  8477. {
  8478. if (mouldStatusID == 1)
  8479. {
  8480. actionResult.Status = (int)Constant.PDAResult.Success;
  8481. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8482. }
  8483. else
  8484. {
  8485. actionResult.Status = (int)Constant.PDAResult.Fail;
  8486. actionResult.Result = -2;
  8487. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行领用操作";
  8488. }
  8489. return actionResult;
  8490. }
  8491. #endregion
  8492. #region 回收
  8493. if (mouldOperationType == 5)
  8494. {
  8495. if (mouldStatusID == 3)
  8496. {
  8497. actionResult.Status = (int)Constant.PDAResult.Success;
  8498. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8499. }
  8500. else
  8501. {
  8502. actionResult.Status = (int)Constant.PDAResult.Fail;
  8503. actionResult.Result = -2;
  8504. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行回收操作";
  8505. }
  8506. return actionResult;
  8507. }
  8508. #endregion
  8509. #region 变更型号
  8510. if (mouldOperationType == -1)
  8511. {
  8512. if (mouldStatusID != 4)
  8513. {
  8514. actionResult.Status = (int)Constant.PDAResult.Success;
  8515. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8516. }
  8517. else
  8518. {
  8519. actionResult.Status = (int)Constant.PDAResult.Fail;
  8520. actionResult.Result = -2;
  8521. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行变更型号操作";
  8522. }
  8523. return actionResult;
  8524. }
  8525. #endregion
  8526. #region 替换条码
  8527. if (mouldOperationType == -2)
  8528. {
  8529. actionResult.Status = (int)Constant.PDAResult.Success;
  8530. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8531. return actionResult;
  8532. }
  8533. #endregion
  8534. return actionResult;
  8535. }
  8536. }
  8537. #endregion
  8538. #region 模具操作-保存
  8539. if (action == "SetMouldOperation")
  8540. {
  8541. ClientRequestEntity cre = new ClientRequestEntity();
  8542. cre.Properties["MouldIDs"] = string.Join(",", JsonHelper.FromJson<int[]>(data["MouldIDs"].ToString()));
  8543. cre.Properties["MouldOperationType"] = data["MouldOperationType"];
  8544. cre.Properties["Remarks"] = data["Remarks"];
  8545. int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
  8546. if (mouldOperationType == (int)Constant.MouldOperationType.ChangeGoodsCode)
  8547. {
  8548. cre.Properties["GoodsID"] = data["GoodsID"];
  8549. cre.Properties["GoodsCode"] = data["GoodsCode"];
  8550. }
  8551. else if (mouldOperationType == (int)Constant.MouldOperationType.InvToScrap)
  8552. {
  8553. cre.Properties["ScrapReason"] = data["ScrapReason"];
  8554. cre.Properties["ScrapResponsibility"] = data["ScrapRemarks"];
  8555. }
  8556. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1004Data(sUserInfo, cre);
  8557. if (sre.Status == Constant.ServiceResultStatus.Success)
  8558. {
  8559. actionResult.Status = (int)Constant.PDAResult.Success;
  8560. }
  8561. else
  8562. {
  8563. actionResult.Status = (int)Constant.PDAResult.Fail;
  8564. }
  8565. return actionResult;
  8566. }
  8567. #endregion
  8568. #region 模具操作-替换条码
  8569. if (action == "ChangedMouldBarcode")
  8570. {
  8571. ClientRequestEntity cre = new ClientRequestEntity();
  8572. cre.Properties["MouldID"] = data["MouldID"];
  8573. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8574. cre.Properties["NewMouldBarcode"] = data["NewMouldBarcode"];
  8575. cre.Properties["Remarks"] = data["Remarks"];
  8576. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1003Data(sUserInfo, cre);
  8577. if (sre.Status == Constant.ServiceResultStatus.Success)
  8578. {
  8579. actionResult.Status = (int)Constant.PDAResult.Success;
  8580. }
  8581. else
  8582. {
  8583. actionResult.Status = (int)Constant.PDAResult.Fail;
  8584. actionResult.Result = sre.OtherStatus;
  8585. actionResult.Message = sre.Message;
  8586. }
  8587. return actionResult;
  8588. }
  8589. #endregion
  8590. #region 模具跟踪表
  8591. if (action == "GetMoldTracking")
  8592. {
  8593. ClientRequestEntity cre = new ClientRequestEntity();
  8594. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8595. ServiceResultEntity sre = ReportModuleLogic.GetRPT020105Data(cre, sUserInfo);
  8596. if (sre.Status == Constant.ServiceResultStatus.Success)
  8597. {
  8598. actionResult.Status = (int)Constant.PDAResult.Success;
  8599. actionResult.Result = JsonHelper.ToJson(sre.Data);
  8600. }
  8601. else
  8602. {
  8603. actionResult.Status = (int)Constant.PDAResult.Fail;
  8604. actionResult.Message = "此模具条码不存在";
  8605. }
  8606. return actionResult;
  8607. }
  8608. #endregion
  8609. return actionResult;
  8610. }
  8611. #endregion
  8612. #region 成型线模具管理
  8613. if (module == "PC_GroutingLineMould")
  8614. {
  8615. #region 获取当前用户成型线模具管理权限
  8616. if (action == "GetGMouldStatusRight")
  8617. {
  8618. DataTable right = PDAModuleLogic.GetGMouldStatusRight(sUserInfo);
  8619. actionResult.Status = (int)Constant.PDAResult.Success;
  8620. if (right != null && right.Rows.Count > 0)
  8621. {
  8622. actionResult.Result = JsonHelper.ToJson(right);
  8623. }
  8624. return actionResult;
  8625. }
  8626. #endregion
  8627. #region 获取成型线状态等信息,和成型模具信息
  8628. if (action == "GetGroutingLineMould")
  8629. {
  8630. int? groutingLineID = null;
  8631. string groutingLineCode = null;
  8632. if (data.ContainsKey("GroutingLineID"))
  8633. {
  8634. groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8635. }
  8636. else
  8637. {
  8638. groutingLineCode = data["GroutingLineCode"] + "";
  8639. }
  8640. DataSet lineInfo = PDAModuleLogic.GetGroutingLineMould(sUserInfo, groutingLineCode, groutingLineID);
  8641. if (lineInfo == null)
  8642. {
  8643. actionResult.Status = (int)Constant.PDAResult.Fail;
  8644. actionResult.Message = "成型线【" + groutingLineCode + "】不存在或是停用状态";
  8645. }
  8646. else
  8647. {
  8648. actionResult.Status = (int)Constant.PDAResult.Success;
  8649. actionResult.Result = JsonHelper.ToJson(lineInfo);
  8650. }
  8651. return actionResult;
  8652. }
  8653. #endregion
  8654. #region 模具操作-画面初始化
  8655. if (action == "GetMouldOperationInit")
  8656. {
  8657. ClientRequestEntity cre = new ClientRequestEntity();
  8658. cre.Properties["MouldOperationType"] = 2;
  8659. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1004LoadData(sUserInfo, cre);
  8660. if (sre.Status == Constant.ServiceResultStatus.Success)
  8661. {
  8662. actionResult.Status = (int)Constant.PDAResult.Success;
  8663. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8664. }
  8665. else
  8666. {
  8667. actionResult.Status = (int)Constant.PDAResult.Fail;
  8668. actionResult.Result = sre.OtherStatus;
  8669. actionResult.Message = sre.Message;
  8670. }
  8671. return actionResult;
  8672. }
  8673. #endregion
  8674. #region 成型模具操作-画面初始化
  8675. if (action == "GetGroutingMouldOperationInit")
  8676. {
  8677. DataTable initData = PDAModuleLogic.GetGroutingMouldOperationInit(sUserInfo, 6);
  8678. if (initData != null && initData.Rows.Count > 0)
  8679. {
  8680. actionResult.Status = (int)Constant.PDAResult.Success;
  8681. Dictionary<string, string> syssetting = new Dictionary<string, string>();
  8682. foreach (DataRow item in initData.Rows)
  8683. {
  8684. syssetting.Add(item["settingcode"].ToString(), item["settingvalue"].ToString());
  8685. }
  8686. actionResult.Result = JsonHelper.ToJson(syssetting);
  8687. }
  8688. else
  8689. {
  8690. actionResult.Status = (int)Constant.PDAResult.Fail;
  8691. }
  8692. return actionResult;
  8693. }
  8694. #endregion
  8695. #region 模具操作-验证模具条码
  8696. if (action == "CheckMouldBarcode")
  8697. {
  8698. ClientRequestEntity cre = new ClientRequestEntity();
  8699. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8700. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetMouldData(sUserInfo, cre);
  8701. if (sre.Status == Constant.ServiceResultStatus.Success)
  8702. {
  8703. if (sre.Data.Tables[0].Rows.Count == 0)
  8704. {
  8705. actionResult.Status = (int)Constant.PDAResult.Fail;
  8706. actionResult.Result = -1;
  8707. actionResult.Message = "模具【" + data["MouldBarcode"] + "】不存在";
  8708. return actionResult;
  8709. }
  8710. int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
  8711. int mouldStatusID = Convert.ToInt32(sre.Data.Tables[0].Rows[0]["MouldStatus"]);
  8712. string mouldStatusName = sre.Data.Tables[0].Rows[0]["MouldStatusName"].ToString();
  8713. #region 上线
  8714. if (mouldOperationType == 6)
  8715. {
  8716. if (mouldStatusID == 1 || mouldStatusID == 3)
  8717. {
  8718. if (data.ContainsKey("GoodsID"))
  8719. {
  8720. if (sre.Data.Tables[0].Rows[0]["GoodsID"] + "" != data["GoodsID"] + "")
  8721. {
  8722. actionResult.Status = (int)Constant.PDAResult.Fail;
  8723. actionResult.Result = -3;
  8724. actionResult.Message =
  8725. "模具【" + data["MouldBarcode"] + "】的产品型号为【" +
  8726. sre.Data.Tables[0].Rows[0]["GoodsCode"] +
  8727. "】与当前不一致";
  8728. return actionResult;
  8729. }
  8730. }
  8731. actionResult.Status = (int)Constant.PDAResult.Success;
  8732. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8733. }
  8734. else
  8735. {
  8736. actionResult.Status = (int)Constant.PDAResult.Fail;
  8737. actionResult.Result = -2;
  8738. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行报损操作";
  8739. }
  8740. return actionResult;
  8741. }
  8742. #endregion
  8743. return actionResult;
  8744. }
  8745. }
  8746. #endregion
  8747. #region 停用
  8748. if (action == "StopGroutingLineDetail")
  8749. {
  8750. if (data == null || !data.ContainsKey("Details"))
  8751. {
  8752. actionResult.Status = (int)Constant.PDAResult.Fail;
  8753. actionResult.Message = "参数错误";
  8754. return actionResult;
  8755. }
  8756. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8757. DataTable gTable = new DataTable();
  8758. gTable.Columns.Add("GroutingLineID", typeof(int));
  8759. gTable.Columns.Add("GroutingLineCode");
  8760. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8761. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8762. gTable.Columns.Add("GroutingMouldCode");
  8763. gTable.Columns.Add("RecordRemarks");
  8764. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8765. gTable.Columns.Add("MouldID", typeof(int));
  8766. gTable.Columns.Add("MouldCode");
  8767. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8768. string groutingLineCode = data["GroutingLineCode"] + "";
  8769. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8770. foreach (Dictionary<string, object> item in details)
  8771. {
  8772. int? mouldID = null;
  8773. if (item.ContainsKey("MouldID"))
  8774. {
  8775. mouldID = Convert.ToInt32(item["MouldID"]);
  8776. if (mouldID == 0)
  8777. {
  8778. mouldID = null;
  8779. }
  8780. }
  8781. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8782. item["GLineDetailID"], item["GLineDetailCode"],
  8783. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8784. mouldID, item["MouldCode"]);
  8785. }
  8786. int result = PCModuleLogicDAL.StopGroutingLineDetail(gTable, sUserInfo);
  8787. if (result > 0)
  8788. {
  8789. actionResult.Status = (int)Constant.PDAResult.Success;
  8790. }
  8791. else
  8792. {
  8793. actionResult.Status = (int)Constant.PDAResult.Fail;
  8794. actionResult.Result = result;
  8795. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8796. return actionResult;
  8797. }
  8798. return actionResult;
  8799. }
  8800. #endregion
  8801. #region 启用
  8802. if (action == "StartGroutingLineDetail")
  8803. {
  8804. if (data == null || !data.ContainsKey("Details"))
  8805. {
  8806. actionResult.Status = (int)Constant.PDAResult.Fail;
  8807. actionResult.Message = "参数错误";
  8808. return actionResult;
  8809. }
  8810. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8811. DataTable gTable = new DataTable();
  8812. gTable.Columns.Add("GroutingLineID", typeof(int));
  8813. gTable.Columns.Add("GroutingLineCode");
  8814. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8815. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8816. gTable.Columns.Add("GroutingMouldCode");
  8817. gTable.Columns.Add("RecordRemarks");
  8818. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8819. gTable.Columns.Add("MouldID", typeof(int));
  8820. gTable.Columns.Add("MouldCode");
  8821. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8822. string groutingLineCode = data["GroutingLineCode"] + "";
  8823. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8824. foreach (Dictionary<string, object> item in details)
  8825. {
  8826. int? mouldID = null;
  8827. if (item.ContainsKey("MouldID"))
  8828. {
  8829. mouldID = Convert.ToInt32(item["MouldID"]);
  8830. if (mouldID == 0)
  8831. {
  8832. mouldID = null;
  8833. }
  8834. }
  8835. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8836. item["GLineDetailID"], item["GLineDetailCode"],
  8837. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8838. mouldID, item["MouldCode"]);
  8839. }
  8840. int result = PCModuleLogicDAL.StartGroutingLineDetail(gTable, sUserInfo);
  8841. if (result > 0)
  8842. {
  8843. actionResult.Status = (int)Constant.PDAResult.Success;
  8844. }
  8845. else
  8846. {
  8847. actionResult.Status = (int)Constant.PDAResult.Fail;
  8848. actionResult.Result = result;
  8849. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8850. return actionResult;
  8851. }
  8852. return actionResult;
  8853. }
  8854. #endregion
  8855. #region 维修
  8856. if (action == "RepairStartGroutingLineDetail")
  8857. {
  8858. if (data == null || !data.ContainsKey("Details"))
  8859. {
  8860. actionResult.Status = (int)Constant.PDAResult.Fail;
  8861. actionResult.Message = "参数错误";
  8862. return actionResult;
  8863. }
  8864. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8865. DataTable gTable = new DataTable();
  8866. gTable.Columns.Add("GroutingLineID", typeof(int));
  8867. gTable.Columns.Add("GroutingLineCode");
  8868. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8869. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8870. gTable.Columns.Add("GroutingMouldCode");
  8871. gTable.Columns.Add("RecordRemarks");
  8872. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8873. gTable.Columns.Add("MouldID", typeof(int));
  8874. gTable.Columns.Add("MouldCode");
  8875. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8876. string groutingLineCode = data["GroutingLineCode"] + "";
  8877. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8878. foreach (Dictionary<string, object> item in details)
  8879. {
  8880. int? mouldID = null;
  8881. if (item.ContainsKey("MouldID"))
  8882. {
  8883. mouldID = Convert.ToInt32(item["MouldID"]);
  8884. if (mouldID == 0)
  8885. {
  8886. mouldID = null;
  8887. }
  8888. }
  8889. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8890. item["GLineDetailID"], item["GLineDetailCode"],
  8891. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8892. mouldID, item["MouldCode"]);
  8893. }
  8894. int result = PCModuleLogicDAL.RepairStartGroutingLineDetail(gTable, sUserInfo);
  8895. if (result > 0)
  8896. {
  8897. actionResult.Status = (int)Constant.PDAResult.Success;
  8898. }
  8899. else
  8900. {
  8901. actionResult.Status = (int)Constant.PDAResult.Fail;
  8902. actionResult.Result = result;
  8903. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8904. return actionResult;
  8905. }
  8906. return actionResult;
  8907. }
  8908. #endregion
  8909. #region 结束维修
  8910. if (action == "RepairEndGroutingLineDetail")
  8911. {
  8912. if (data == null || !data.ContainsKey("Details"))
  8913. {
  8914. actionResult.Status = (int)Constant.PDAResult.Fail;
  8915. actionResult.Message = "参数错误";
  8916. return actionResult;
  8917. }
  8918. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8919. DataTable gTable = new DataTable();
  8920. gTable.Columns.Add("GroutingLineID", typeof(int));
  8921. gTable.Columns.Add("GroutingLineCode");
  8922. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8923. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8924. gTable.Columns.Add("GroutingMouldCode");
  8925. gTable.Columns.Add("RecordRemarks");
  8926. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8927. gTable.Columns.Add("MouldID", typeof(int));
  8928. gTable.Columns.Add("MouldCode");
  8929. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8930. string groutingLineCode = data["GroutingLineCode"] + "";
  8931. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8932. foreach (Dictionary<string, object> item in details)
  8933. {
  8934. int? mouldID = null;
  8935. if (item.ContainsKey("MouldID"))
  8936. {
  8937. mouldID = Convert.ToInt32(item["MouldID"]);
  8938. if (mouldID == 0)
  8939. {
  8940. mouldID = null;
  8941. }
  8942. }
  8943. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8944. item["GLineDetailID"], item["GLineDetailCode"],
  8945. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8946. mouldID, item["MouldCode"]);
  8947. }
  8948. int result = PCModuleLogicDAL.RepairEndGroutingLineDetail(gTable, sUserInfo);
  8949. if (result > 0)
  8950. {
  8951. actionResult.Status = (int)Constant.PDAResult.Success;
  8952. }
  8953. else
  8954. {
  8955. actionResult.Status = (int)Constant.PDAResult.Fail;
  8956. actionResult.Result = result;
  8957. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8958. return actionResult;
  8959. }
  8960. return actionResult;
  8961. }
  8962. #endregion
  8963. #region 换模
  8964. if (action == "ChangeGMouldStartGroutingLineDetail")
  8965. {
  8966. if (data == null || !data.ContainsKey("Details"))
  8967. {
  8968. actionResult.Status = (int)Constant.PDAResult.Fail;
  8969. actionResult.Message = "参数错误";
  8970. return actionResult;
  8971. }
  8972. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8973. DataTable gTable = new DataTable();
  8974. gTable.Columns.Add("GroutingLineID", typeof(int));
  8975. gTable.Columns.Add("GroutingLineCode");
  8976. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8977. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8978. gTable.Columns.Add("GroutingMouldCode");
  8979. gTable.Columns.Add("RecordRemarks");
  8980. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8981. gTable.Columns.Add("MouldID", typeof(int));
  8982. gTable.Columns.Add("MouldCode");
  8983. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8984. gTable.Columns.Add("MouldStatus", typeof(int));
  8985. gTable.Columns.Add("ScrapReason", typeof(int));
  8986. gTable.Columns.Add("ScrapResponsibility");
  8987. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8988. string groutingLineCode = data["GroutingLineCode"] + "";
  8989. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8990. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  8991. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  8992. string scrapResponsibility = data["ScrapRemarks"] + "";
  8993. foreach (Dictionary<string, object> item in details)
  8994. {
  8995. int? mouldID = null;
  8996. if (item.ContainsKey("MouldID"))
  8997. {
  8998. mouldID = Convert.ToInt32(item["MouldID"]);
  8999. if (mouldID == 0)
  9000. {
  9001. mouldID = null;
  9002. }
  9003. }
  9004. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9005. item["GLineDetailID"], item["GLineDetailCode"],
  9006. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  9007. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  9008. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  9009. }
  9010. int result = PCModuleLogicDAL.ChangeGMouldStartGroutingLineDetail(gTable, sUserInfo);
  9011. if (result > 0)
  9012. {
  9013. actionResult.Status = (int)Constant.PDAResult.Success;
  9014. }
  9015. else
  9016. {
  9017. actionResult.Status = (int)Constant.PDAResult.Fail;
  9018. actionResult.Result = result;
  9019. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9020. return actionResult;
  9021. }
  9022. return actionResult;
  9023. }
  9024. #endregion
  9025. #region 变产
  9026. if (action == "UpdateLineStartGroutingLineDetail")
  9027. {
  9028. if (data == null || !data.ContainsKey("Details"))
  9029. {
  9030. actionResult.Status = (int)Constant.PDAResult.Fail;
  9031. actionResult.Message = "参数错误";
  9032. return actionResult;
  9033. }
  9034. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9035. DataTable gTable = new DataTable();
  9036. gTable.Columns.Add("GroutingLineID", typeof(int));
  9037. gTable.Columns.Add("GroutingLineCode");
  9038. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9039. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9040. gTable.Columns.Add("GroutingMouldCode");
  9041. gTable.Columns.Add("RecordRemarks");
  9042. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9043. gTable.Columns.Add("MouldID", typeof(int));
  9044. gTable.Columns.Add("MouldCode");
  9045. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9046. gTable.Columns.Add("MouldStatus", typeof(int));
  9047. gTable.Columns.Add("ScrapReason", typeof(int));
  9048. gTable.Columns.Add("ScrapResponsibility");
  9049. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9050. string groutingLineCode = data["GroutingLineCode"] + "";
  9051. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9052. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  9053. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  9054. string scrapResponsibility = data["ScrapRemarks"] + "";
  9055. foreach (Dictionary<string, object> item in details)
  9056. {
  9057. int? mouldID = null;
  9058. if (item.ContainsKey("MouldID"))
  9059. {
  9060. mouldID = Convert.ToInt32(item["MouldID"]);
  9061. if (mouldID == 0)
  9062. {
  9063. mouldID = null;
  9064. }
  9065. }
  9066. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9067. item["GLineDetailID"], item["GLineDetailCode"],
  9068. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  9069. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  9070. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  9071. }
  9072. int result = PCModuleLogicDAL.UpdateLineStartGroutingLineDetail(gTable, sUserInfo);
  9073. if (result > 0)
  9074. {
  9075. actionResult.Status = (int)Constant.PDAResult.Success;
  9076. }
  9077. else
  9078. {
  9079. actionResult.Status = (int)Constant.PDAResult.Fail;
  9080. actionResult.Result = result;
  9081. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9082. return actionResult;
  9083. }
  9084. return actionResult;
  9085. }
  9086. #endregion
  9087. #region 整线变产
  9088. if (action == "UpdateAllLineStartGroutingLineDetail")
  9089. {
  9090. if (data == null || !data.ContainsKey("Details"))
  9091. {
  9092. actionResult.Status = (int)Constant.PDAResult.Fail;
  9093. actionResult.Message = "参数错误";
  9094. return actionResult;
  9095. }
  9096. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9097. DataTable gTable = new DataTable();
  9098. gTable.Columns.Add("GroutingLineID", typeof(int));
  9099. gTable.Columns.Add("GroutingLineCode");
  9100. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9101. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9102. gTable.Columns.Add("GroutingMouldCode");
  9103. gTable.Columns.Add("RecordRemarks");
  9104. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9105. gTable.Columns.Add("MouldID", typeof(int));
  9106. gTable.Columns.Add("MouldCode");
  9107. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9108. gTable.Columns.Add("MouldStatus", typeof(int));
  9109. gTable.Columns.Add("ScrapReason", typeof(int));
  9110. gTable.Columns.Add("ScrapResponsibility");
  9111. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9112. string groutingLineCode = data["GroutingLineCode"] + "";
  9113. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9114. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  9115. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  9116. string scrapResponsibility = data["ScrapRemarks"] + "";
  9117. foreach (Dictionary<string, object> item in details)
  9118. {
  9119. int? mouldID = null;
  9120. if (item.ContainsKey("MouldID"))
  9121. {
  9122. mouldID = Convert.ToInt32(item["MouldID"]);
  9123. if (mouldID == 0)
  9124. {
  9125. mouldID = null;
  9126. }
  9127. }
  9128. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9129. item["GLineDetailID"], item["GLineDetailCode"],
  9130. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  9131. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  9132. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  9133. }
  9134. int result = PCModuleLogicDAL.UpdateAllLineStartGroutingLineDetail(gTable, groutingLineID, lineOPTimeStamp, sUserInfo);
  9135. if (result > 0)
  9136. {
  9137. actionResult.Status = (int)Constant.PDAResult.Success;
  9138. }
  9139. else
  9140. {
  9141. actionResult.Status = (int)Constant.PDAResult.Fail;
  9142. actionResult.Result = result;
  9143. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9144. return actionResult;
  9145. }
  9146. return actionResult;
  9147. }
  9148. #endregion
  9149. #region 卸模
  9150. if (action == "UnloadGroutingLineDetail")
  9151. {
  9152. if (data == null || !data.ContainsKey("Details"))
  9153. {
  9154. actionResult.Status = (int)Constant.PDAResult.Fail;
  9155. actionResult.Message = "参数错误";
  9156. return actionResult;
  9157. }
  9158. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9159. DataTable gTable = new DataTable();
  9160. gTable.Columns.Add("GroutingLineID", typeof(int));
  9161. gTable.Columns.Add("GroutingLineCode");
  9162. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9163. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9164. gTable.Columns.Add("GroutingMouldCode");
  9165. gTable.Columns.Add("RecordRemarks");
  9166. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9167. gTable.Columns.Add("MouldID", typeof(int));
  9168. gTable.Columns.Add("MouldCode");
  9169. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9170. gTable.Columns.Add("MouldStatus", typeof(int));
  9171. gTable.Columns.Add("ScrapReason", typeof(int));
  9172. gTable.Columns.Add("ScrapResponsibility");
  9173. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9174. string groutingLineCode = data["GroutingLineCode"] + "";
  9175. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9176. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  9177. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  9178. string scrapResponsibility = data["ScrapRemarks"] + "";
  9179. foreach (Dictionary<string, object> item in details)
  9180. {
  9181. int? mouldID = null;
  9182. if (item.ContainsKey("MouldID"))
  9183. {
  9184. mouldID = Convert.ToInt32(item["MouldID"]);
  9185. if (mouldID == 0)
  9186. {
  9187. mouldID = null;
  9188. }
  9189. }
  9190. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9191. item["GLineDetailID"], item["GLineDetailCode"],
  9192. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  9193. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  9194. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  9195. }
  9196. int result = PCModuleLogicDAL.UnloadGroutingLineDetail(gTable, sUserInfo);
  9197. if (result > 0)
  9198. {
  9199. actionResult.Status = (int)Constant.PDAResult.Success;
  9200. }
  9201. else
  9202. {
  9203. actionResult.Status = (int)Constant.PDAResult.Fail;
  9204. actionResult.Result = result;
  9205. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9206. return actionResult;
  9207. }
  9208. return actionResult;
  9209. }
  9210. #endregion
  9211. #region 结束换模
  9212. if (action == "ChangeGMouldEndGroutingLineDetail")
  9213. {
  9214. if (data == null || !data.ContainsKey("Details"))
  9215. {
  9216. actionResult.Status = (int)Constant.PDAResult.Fail;
  9217. actionResult.Message = "参数错误";
  9218. return actionResult;
  9219. }
  9220. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9221. DataTable gTable = new DataTable();
  9222. gTable.Columns.Add("GroutingLineID", typeof(int));
  9223. gTable.Columns.Add("GroutingLineCode");
  9224. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9225. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9226. gTable.Columns.Add("GroutingMouldCode");
  9227. gTable.Columns.Add("RreasonRemarks");
  9228. gTable.Columns.Add("RecordRemarks");
  9229. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9230. gTable.Columns.Add("MouldID", typeof(int));
  9231. gTable.Columns.Add("MouldCode");
  9232. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9233. gTable.Columns.Add("GoodsID", typeof(int));
  9234. gTable.Columns.Add("GoodsCode");
  9235. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  9236. gTable.Columns.Add("GroutingCount", typeof(int));
  9237. gTable.Columns.Add("MouldSource");
  9238. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9239. string groutingLineCode = data["GroutingLineCode"] + "";
  9240. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9241. foreach (Dictionary<string, object> item in details)
  9242. {
  9243. int? mouldID = null;
  9244. if (item.ContainsKey("MouldID"))
  9245. {
  9246. mouldID = Convert.ToInt32(item["MouldID"]);
  9247. if (mouldID == 0)
  9248. {
  9249. mouldID = null;
  9250. }
  9251. }
  9252. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9253. item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"],
  9254. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  9255. mouldID, item["MouldCode"], item["MouldOutputNo"],
  9256. item["GoodsID"], item["GoodsCode"],
  9257. item["StandardGroutingCount"], item["GroutingCount"],
  9258. (mouldID == null ? "0" : "1"));
  9259. }
  9260. ServiceResultEntity result = PCModuleLogicDAL.ChangeGMouldEndGroutingLineDetail(gTable, sUserInfo);
  9261. if (result.Status == Constant.ServiceResultStatus.Success)
  9262. {
  9263. actionResult.Status = (int)Constant.PDAResult.Success;
  9264. }
  9265. else if (result.OtherStatus == -100)
  9266. {
  9267. actionResult.Status = (int)Constant.PDAResult.Fail;
  9268. actionResult.Result = -100;
  9269. actionResult.Message = result.Message;
  9270. return actionResult;
  9271. }
  9272. else
  9273. {
  9274. actionResult.Status = (int)Constant.PDAResult.Fail;
  9275. actionResult.Result = -500;
  9276. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9277. return actionResult;
  9278. }
  9279. return actionResult;
  9280. }
  9281. #endregion
  9282. #region 结束变产
  9283. if (action == "UpdateLineEndGroutingLineDetail")
  9284. {
  9285. if (data == null || !data.ContainsKey("Details"))
  9286. {
  9287. actionResult.Status = (int)Constant.PDAResult.Fail;
  9288. actionResult.Message = "参数错误";
  9289. return actionResult;
  9290. }
  9291. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9292. DataTable gTable = new DataTable();
  9293. gTable.Columns.Add("GroutingLineID", typeof(int));
  9294. gTable.Columns.Add("GroutingLineCode");
  9295. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9296. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9297. gTable.Columns.Add("GroutingMouldCode");
  9298. gTable.Columns.Add("RreasonRemarks");
  9299. gTable.Columns.Add("RecordRemarks");
  9300. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9301. gTable.Columns.Add("MouldID", typeof(int));
  9302. gTable.Columns.Add("MouldCode");
  9303. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9304. gTable.Columns.Add("GoodsID", typeof(int));
  9305. gTable.Columns.Add("GoodsCode");
  9306. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  9307. gTable.Columns.Add("GroutingCount", typeof(int));
  9308. gTable.Columns.Add("MouldSource");
  9309. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9310. string groutingLineCode = data["GroutingLineCode"] + "";
  9311. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9312. foreach (Dictionary<string, object> item in details)
  9313. {
  9314. int? mouldID = null;
  9315. if (item.ContainsKey("MouldID"))
  9316. {
  9317. mouldID = Convert.ToInt32(item["MouldID"]);
  9318. if (mouldID == 0)
  9319. {
  9320. mouldID = null;
  9321. }
  9322. }
  9323. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9324. item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"],
  9325. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  9326. mouldID, item["MouldCode"], item["MouldOutputNo"],
  9327. item["GoodsID"], item["GoodsCode"],
  9328. item["StandardGroutingCount"], item["GroutingCount"],
  9329. (mouldID == null ? "0" : "1"));
  9330. }
  9331. ServiceResultEntity result = PCModuleLogicDAL.UpdateLineEndGroutingLineDetail(gTable, 0, sUserInfo);
  9332. if (result.Status == Constant.ServiceResultStatus.Success)
  9333. {
  9334. actionResult.Status = (int)Constant.PDAResult.Success;
  9335. }
  9336. else if (result.OtherStatus == -100)
  9337. {
  9338. actionResult.Status = (int)Constant.PDAResult.Fail;
  9339. actionResult.Result = -100;
  9340. actionResult.Message = result.Message;
  9341. return actionResult;
  9342. }
  9343. else
  9344. {
  9345. actionResult.Status = (int)Constant.PDAResult.Fail;
  9346. actionResult.Result = -500;
  9347. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9348. return actionResult;
  9349. }
  9350. return actionResult;
  9351. }
  9352. #endregion
  9353. #region 结束整线变产
  9354. if (action == "UpdateAllLineEndGroutingLineDetail")
  9355. {
  9356. if (data == null || !data.ContainsKey("Details"))
  9357. {
  9358. actionResult.Status = (int)Constant.PDAResult.Fail;
  9359. actionResult.Message = "参数错误";
  9360. return actionResult;
  9361. }
  9362. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9363. DataTable gTable = new DataTable();
  9364. gTable.Columns.Add("GroutingLineID", typeof(int));
  9365. gTable.Columns.Add("GroutingLineCode");
  9366. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9367. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9368. gTable.Columns.Add("GroutingMouldCode");
  9369. gTable.Columns.Add("Remarks");
  9370. gTable.Columns.Add("RecordRemarks");
  9371. //gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9372. gTable.Columns.Add("MouldID", typeof(int));
  9373. gTable.Columns.Add("MouldCode");
  9374. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9375. gTable.Columns.Add("GoodsID", typeof(int));
  9376. gTable.Columns.Add("GoodsCode");
  9377. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  9378. gTable.Columns.Add("GroutingCount", typeof(int));
  9379. gTable.Columns.Add("MouldSource");
  9380. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9381. string groutingLineCode = data["GroutingLineCode"] + "";
  9382. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9383. foreach (Dictionary<string, object> item in details)
  9384. {
  9385. int? mouldID = null;
  9386. if (item.ContainsKey("MouldID"))
  9387. {
  9388. mouldID = Convert.ToInt32(item["MouldID"]);
  9389. if (mouldID == 0)
  9390. {
  9391. mouldID = null;
  9392. }
  9393. }
  9394. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9395. item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"],
  9396. item["RecordRemarks"], //Convert.ToDateTime(item["OPTimeStamp"]),
  9397. mouldID, item["MouldCode"], item["MouldOutputNo"],
  9398. item["GoodsID"], item["GoodsCode"],
  9399. item["StandardGroutingCount"], item["GroutingCount"],
  9400. (mouldID == null ? "0" : "1"));
  9401. }
  9402. ServiceResultEntity result = PCModuleLogicDAL.UpdateAllLineEndGroutingLineDetail(gTable, null, groutingLineID, lineOPTimeStamp, sUserInfo);
  9403. if (result.Status == Constant.ServiceResultStatus.Success)
  9404. {
  9405. actionResult.Status = (int)Constant.PDAResult.Success;
  9406. }
  9407. else if (result.OtherStatus == -100)
  9408. {
  9409. actionResult.Status = (int)Constant.PDAResult.Fail;
  9410. actionResult.Result = -100;
  9411. actionResult.Message = result.Message;
  9412. return actionResult;
  9413. }
  9414. else
  9415. {
  9416. actionResult.Status = (int)Constant.PDAResult.Fail;
  9417. actionResult.Result = -500;
  9418. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9419. return actionResult;
  9420. }
  9421. return actionResult;
  9422. }
  9423. #endregion
  9424. #region 上模
  9425. if (action == "UpdateGroutingLine_AddMould")
  9426. {
  9427. if (data == null || !data.ContainsKey("Details"))
  9428. {
  9429. actionResult.Status = (int)Constant.PDAResult.Fail;
  9430. actionResult.Message = "参数错误";
  9431. return actionResult;
  9432. }
  9433. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9434. DataTable gTable = new DataTable();
  9435. gTable.Columns.Add("GroutingLineID", typeof(int));
  9436. gTable.Columns.Add("GroutingLineCode");
  9437. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9438. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9439. gTable.Columns.Add("GroutingMouldCode");
  9440. gTable.Columns.Add("Remarks");
  9441. gTable.Columns.Add("RecordRemarks");
  9442. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9443. gTable.Columns.Add("MouldID", typeof(int));
  9444. gTable.Columns.Add("MouldCode");
  9445. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9446. gTable.Columns.Add("GoodsID", typeof(int));
  9447. gTable.Columns.Add("GoodsCode");
  9448. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  9449. gTable.Columns.Add("GroutingCount", typeof(int));
  9450. gTable.Columns.Add("MouldSource");
  9451. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9452. string groutingLineCode = data["GroutingLineCode"] + "";
  9453. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9454. foreach (Dictionary<string, object> item in details)
  9455. {
  9456. int? mouldID = null;
  9457. if (item.ContainsKey("MouldID"))
  9458. {
  9459. mouldID = Convert.ToInt32(item["MouldID"]);
  9460. if (mouldID == 0)
  9461. {
  9462. mouldID = null;
  9463. }
  9464. }
  9465. int gldID = Convert.ToInt32(item["GLineDetailID"]);
  9466. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9467. gldID, item["GLineDetailCode"],
  9468. item["DetailRemarks"], item["RecordRemarks"],
  9469. (gldID > 0 ? (object)Convert.ToDateTime(item["OPTimeStamp"]) : null),
  9470. mouldID, item["MouldCode"], item["MouldOutputNo"],
  9471. item["GoodsID"], item["GoodsCode"],
  9472. item["StandardGroutingCount"], item["GroutingCount"],
  9473. (mouldID == null ? "0" : "1"));
  9474. }
  9475. ServiceResultEntity result = PCModuleLogicDAL.UpdateGroutingLine_AddMould(groutingLineID, groutingLineCode, lineOPTimeStamp, gTable, sUserInfo);
  9476. if (result.Status == Constant.ServiceResultStatus.Success)
  9477. {
  9478. actionResult.Status = (int)Constant.PDAResult.Success;
  9479. }
  9480. else if (result.OtherStatus == -2 || result.OtherStatus == -100)
  9481. {
  9482. actionResult.Status = (int)Constant.PDAResult.Fail;
  9483. actionResult.Result = result.OtherStatus;
  9484. actionResult.Message = result.Message;
  9485. return actionResult;
  9486. }
  9487. else if (result.OtherStatus == -10001 || result.OtherStatus == -10002)
  9488. {
  9489. actionResult.Status = -99;
  9490. actionResult.Result = result.OtherStatus;
  9491. actionResult.Message = result.Message;
  9492. return actionResult;
  9493. }
  9494. else
  9495. {
  9496. actionResult.Status = (int)Constant.PDAResult.Fail;
  9497. actionResult.Result = -500;
  9498. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9499. return actionResult;
  9500. }
  9501. return actionResult;
  9502. }
  9503. #endregion
  9504. return actionResult;
  9505. }
  9506. #endregion
  9507. #region 包装装板限制
  9508. if (module == "FinishedLoadingCar")
  9509. {
  9510. if (action == "GetSetting")
  9511. {
  9512. ClientRequestEntity cre = new ClientRequestEntity();
  9513. cre.Properties["GoodsID"] = data["GoodsID"];
  9514. if (data.ContainsKey("logoID"))
  9515. {
  9516. cre.Properties["logoID"] = data["logoID"] + "";
  9517. }
  9518. else
  9519. {
  9520. cre.Properties["logoID"] = "";
  9521. }
  9522. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetFinishedLoadingCarSetting(sUserInfo, cre);
  9523. if (sre.Status == Constant.ServiceResultStatus.Success)
  9524. {
  9525. actionResult.Status = (int)Constant.PDAResult.Success;
  9526. foreach (DataRow item in sre.Data.Tables[0].Rows)
  9527. {
  9528. if (item["settingcode"].ToString() == "S_PM_011")
  9529. {
  9530. cre.Properties["S_PM_011"] = item["settingvalue"];
  9531. }
  9532. else if (item["settingcode"].ToString() == "S_PM_012")
  9533. {
  9534. cre.Properties["S_PM_012"] = item["settingvalue"];
  9535. }
  9536. else if (item["settingcode"].ToString() == "S_PM_013")
  9537. {
  9538. cre.Properties["S_PM_013"] = item["settingvalue"];
  9539. }
  9540. }
  9541. DataTable dt = sre.Result as DataTable;
  9542. cre.Properties["PlatelitNum"] = dt.Rows[0]["PLATELIMITNUM"];
  9543. cre.Properties["PlatelitNumNew"] = dt.Rows[0]["PLATELIMITNUMNEW"];
  9544. actionResult.Result = JsonHelper.ToJson(cre.Properties);
  9545. }
  9546. else
  9547. {
  9548. actionResult.Status = (int)Constant.PDAResult.Fail;
  9549. actionResult.Message = "";
  9550. }
  9551. return actionResult;
  9552. }
  9553. }
  9554. #endregion
  9555. #region 成型报损
  9556. if (module == "GroutingScrapProduct")
  9557. {
  9558. // 查询注浆日报明细表
  9559. if ("GetGroutingDailyDetail" == action)
  9560. {
  9561. ClientRequestEntity cre = new ClientRequestEntity();
  9562. cre.NameSpace = module;
  9563. cre.Name = action;
  9564. if (!string.IsNullOrEmpty(jsonData))
  9565. {
  9566. cre.Properties["BarCode"] = data["BarCode"];
  9567. }
  9568. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetGroutingDailyDetail(cre, sUserInfo);
  9569. //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9570. actionResult.Status = (int)Constant.PDAResult.Success;
  9571. if (sre == null || sre.Data == null || sre.Data.Tables.Count == 0
  9572. || sre.Data.Tables[0].Rows.Count == 0)
  9573. {
  9574. actionResult.Message = "未查询到该产品信息,请确认该产品是否已经进行注浆!";
  9575. actionResult.Status = (int)Constant.PDAResult.Fail;
  9576. }
  9577. else
  9578. {
  9579. DataRow _barCodeRow = sre.Data.Tables[0].Rows[0];
  9580. // 判断是否进行了注浆
  9581. if ("0".Equals(_barCodeRow["GroutingFlag"]))
  9582. {
  9583. actionResult.Message = "该产品还未进行注浆!";
  9584. actionResult.Status = (int)Constant.PDAResult.Fail;
  9585. }
  9586. // 判断是否进行了交坯
  9587. if ("1".Equals(_barCodeRow["DeliverFlag"]))
  9588. {
  9589. actionResult.Message = "该产品已经交坯!";
  9590. actionResult.Status = (int)Constant.PDAResult.Fail;
  9591. }
  9592. // 判断是否已经报损
  9593. if ("1".Equals(_barCodeRow["ScrapFlag"]))
  9594. {
  9595. actionResult.Message = "该产品已经报损!";
  9596. actionResult.Status = (int)Constant.PDAResult.Fail;
  9597. }
  9598. // 该产品已进入生产工序
  9599. if ("1".Equals(_barCodeRow["beginningflag"]))
  9600. {
  9601. actionResult.Message = "该产品已进入生产工序!";
  9602. actionResult.Status = (int)Constant.PDAResult.Fail;
  9603. }
  9604. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9605. }
  9606. }
  9607. // 获取成型报损原因
  9608. else if ("GetScrapReasonData" == action)
  9609. {
  9610. ClientRequestEntity cre = new ClientRequestEntity();
  9611. cre.NameSpace = module;
  9612. cre.Name = action;
  9613. ServiceResultEntity sre = SystemModuleLogic.GetScrapReasonData(cre, sUserInfo, "1");
  9614. actionResult.Status = (int)Constant.PDAResult.Success;
  9615. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9616. }
  9617. // 保存成型报损
  9618. else if ("SaveGroutingScrapProduct" == action)
  9619. {
  9620. ClientRequestEntity cre = new ClientRequestEntity();
  9621. cre.NameSpace = module;
  9622. cre.Name = action;
  9623. if (!string.IsNullOrEmpty(jsonData))
  9624. {
  9625. // DataSet returnData = JsonHelper.FromJson<DataSet>(jsonData);
  9626. DataTable dt = JsonHelper.FromJson<DataTable>(data["Table"] + "");
  9627. DataTable dtResponsible = JsonHelper.FromJson<DataTable>(data["Table1"] + "");
  9628. if (dt != null && dt.Rows.Count > 0)
  9629. {
  9630. // 总单信息
  9631. DataRow properties = dt.Rows[0];
  9632. cre.Properties["BarCode"] = properties["BarCode"]; // 产品条码
  9633. cre.Properties["GoodsID"] = properties["GoodsID"]; // 产品ID
  9634. cre.Properties["GoodsCode"] = properties["GoodsCode"]; // 产品编码
  9635. cre.Properties["GoodsName"] = properties["GoodsName"]; // 产品名称
  9636. cre.Properties["GroutingDailyID"] = properties["GroutingDailyID"]; // 注浆日报ID
  9637. cre.Properties["GroutingDailyDetailID"] = properties["GroutingDailyDetailID"]; // 注浆日报明细ID
  9638. cre.Properties["GroutingDate"] = properties["GroutingDate"]; // 注浆日期
  9639. cre.Properties["GroutingLineID"] = properties["GroutingLineID"]; // 成型生产线ID
  9640. cre.Properties["GroutingLineCode"] = properties["GroutingLineCode"]; // 成型生产线编码
  9641. cre.Properties["GroutingLineName"] = properties["GroutingLineName"]; // 成型生产线名称
  9642. cre.Properties["GMouldTypeID"] = properties["GMouldTypeID"]; // 成型线类型ID
  9643. cre.Properties["GroutingLineDetailID"] = properties["GroutingLineDetailID"]; // 成型生产线明细ID
  9644. cre.Properties["GroutingMouldCode"] = properties["GroutingMouldCode"]; // 注浆模具编号
  9645. cre.Properties["MouldCode"] = properties["MouldCode"]; // 模具编号
  9646. cre.Properties["GroutingUserID"] = properties["GroutingUserID"]; // 注浆工号ID
  9647. cre.Properties["GroutingUserCode"] = properties["GroutingUserCode"]; // 注浆工号编码
  9648. cre.Properties["GroutingNum"] = properties["GroutingNum"]; // 注浆次数
  9649. cre.Properties["ScrapType"] = properties["ScrapType"]; // 损坯类型
  9650. cre.Properties["ScrapDate"] = properties["ScrapDate"]; // 报损日期
  9651. cre.Properties["ScrapRreasonID"] = properties["ScrapRreasonID"]; // 报损日期
  9652. cre.Properties["ResponUserID"] = properties["ResponUserID"]; // 损坯工号
  9653. cre.Properties["ResponUserCode"] = properties["ResponUserCode"];
  9654. cre.Properties["Remarks"] = properties["Remarks"]; // 备注
  9655. cre.Properties["AuditStatus"] = properties["AuditStatus"]; // 审批状态
  9656. // 责任员工
  9657. cre.Data = new DataSet();
  9658. //DataTable returnTable = returnData.Tables[1].Copy();
  9659. cre.Data.Tables.Add(dtResponsible);
  9660. }
  9661. }
  9662. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveGroutingScrapProduct(cre, sUserInfo);
  9663. if (sre.Status == Constant.ServiceResultStatus.Success)
  9664. {
  9665. actionResult.Status = (int)Constant.PDAResult.Success;
  9666. actionResult.Result = sre.Result;
  9667. }
  9668. else
  9669. {
  9670. actionResult.Status = (int)Constant.PDAResult.Fail;
  9671. actionResult.Result = sre.OtherStatus;
  9672. actionResult.Message = sre.Message;
  9673. }
  9674. }
  9675. // 获取成型报损信息 用于撤销使用
  9676. else if ("GetGroutingScrapProduct" == action)
  9677. {
  9678. ClientRequestEntity cre = new ClientRequestEntity();
  9679. cre.NameSpace = module;
  9680. cre.Name = action;
  9681. if (!string.IsNullOrEmpty(jsonData))
  9682. {
  9683. cre.Properties["BarCode"] = data["BarCode"];
  9684. }
  9685. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetGroutingScrapProduct(cre, sUserInfo);
  9686. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9687. actionResult.Status = (int)Constant.PDAResult.Success;
  9688. }
  9689. //xuwei add 2020-03-23
  9690. //获取成型报损信息 用于撤销使用 支持 浆日报直接报损
  9691. else if ("GetGroutingScrap" == action)
  9692. {
  9693. ClientRequestEntity cre = new ClientRequestEntity();
  9694. cre.NameSpace = module;
  9695. cre.Name = action;
  9696. if (!string.IsNullOrEmpty(jsonData))
  9697. {
  9698. cre.Properties["BarCode"] = data["BarCode"];
  9699. }
  9700. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetGroutingScrap(cre, sUserInfo);
  9701. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9702. actionResult.Status = (int)Constant.PDAResult.Success;
  9703. }
  9704. // 撤销成型报损
  9705. else if ("ReverseGroutingScrapProduct" == action)
  9706. {
  9707. ClientRequestEntity cre = new ClientRequestEntity();
  9708. cre.NameSpace = module;
  9709. cre.Name = action;
  9710. if (!string.IsNullOrEmpty(jsonData))
  9711. {
  9712. cre.Properties["BarCode"] = data["BarCode"];
  9713. }
  9714. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.ReverseGroutingScrapProduct(cre, sUserInfo);
  9715. if (sre.Status == Constant.ServiceResultStatus.Success)
  9716. {
  9717. actionResult.Status = (int)Constant.PDAResult.Success;
  9718. actionResult.Result = sre.Result;
  9719. }
  9720. else
  9721. {
  9722. actionResult.Status = (int)Constant.PDAResult.Fail;
  9723. actionResult.Result = sre.OtherStatus;
  9724. actionResult.Message = sre.Message;
  9725. }
  9726. }
  9727. }
  9728. #endregion
  9729. #region 产品挂起
  9730. if (module == "ProductSuspend")
  9731. {
  9732. // 获取可以挂起的工序(干补、装车、入窑、出窑)工序不能挂起
  9733. if (action == "GetSuspendProcedure")
  9734. {
  9735. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetSuspendProcedure(sUserInfo);
  9736. if (sre.Status == Constant.ServiceResultStatus.Success)
  9737. {
  9738. actionResult.Status = (int)Constant.PDAResult.Success;
  9739. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9740. }
  9741. else
  9742. {
  9743. actionResult.Status = (int)Constant.PDAResult.Fail;
  9744. actionResult.Message = sre.Message;
  9745. }
  9746. return actionResult;
  9747. }
  9748. // 验证挂起条码
  9749. if (action == "CheckSuspendBarcode")
  9750. {
  9751. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.CheckSuspendBarcode(sUserInfo, data["barcode"] + "");
  9752. if (sre.Status == Constant.ServiceResultStatus.Success)
  9753. {
  9754. actionResult.Status = (int)Constant.PDAResult.Success;
  9755. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9756. }
  9757. else
  9758. {
  9759. actionResult.Status = (int)Constant.PDAResult.Fail;
  9760. actionResult.Message = sre.Message;
  9761. }
  9762. return actionResult;
  9763. }
  9764. // 挂起条码
  9765. if (action == "SaveSuspendProduct")
  9766. {
  9767. int[] gids = JsonHelper.FromJson<int[]>(data["groutingdailydetailids"] + "");
  9768. int[] pids = JsonHelper.FromJson<int[]>(data["procedureids"] + "");
  9769. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveSuspendProduct(sUserInfo, pids, gids, data["remarks"] + "");
  9770. if (sre.Status == Constant.ServiceResultStatus.Success)
  9771. {
  9772. actionResult.Status = (int)Constant.PDAResult.Success;
  9773. //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9774. }
  9775. else
  9776. {
  9777. actionResult.Status = (int)Constant.PDAResult.Fail;
  9778. actionResult.Message = sre.Message;
  9779. }
  9780. return actionResult;
  9781. }
  9782. // 撤销挂起条码
  9783. if (action == "DeleteSuspendProduct")
  9784. {
  9785. int[] gids = JsonHelper.FromJson<int[]>(data["groutingdailydetailids"] + "");
  9786. int[] pids = JsonHelper.FromJson<int[]>(data["procedureids"] + "");
  9787. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.DeleteSuspendProduct(sUserInfo, pids, gids);
  9788. if (sre.Status == Constant.ServiceResultStatus.Success)
  9789. {
  9790. actionResult.Status = (int)Constant.PDAResult.Success;
  9791. //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9792. }
  9793. else
  9794. {
  9795. actionResult.Status = (int)Constant.PDAResult.Fail;
  9796. actionResult.Message = sre.Message;
  9797. }
  9798. return actionResult;
  9799. }
  9800. // 查询挂起条码
  9801. if (action == "GetSuspendProduct")
  9802. {
  9803. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetSuspendProduct(sUserInfo, data["barcode"] + "");
  9804. if (sre.Status == Constant.ServiceResultStatus.Success)
  9805. {
  9806. if (sre.Data.Tables[0].Rows.Count == 0)
  9807. {
  9808. actionResult.Status = (int)Constant.PDAResult.Fail;
  9809. actionResult.Message = "此条码没有可撤销的挂起信息";
  9810. }
  9811. else
  9812. {
  9813. actionResult.Status = (int)Constant.PDAResult.Success;
  9814. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9815. }
  9816. }
  9817. else
  9818. {
  9819. actionResult.Status = (int)Constant.PDAResult.Fail;
  9820. actionResult.Message = sre.Message;
  9821. }
  9822. return actionResult;
  9823. }
  9824. }
  9825. #endregion
  9826. #region 品保抽查
  9827. if (module == "QASpotCheck")
  9828. {
  9829. if (action == "GetAllQASpotCheck")
  9830. {
  9831. ClientRequestEntity cre = new ClientRequestEntity();
  9832. cre.NameSpace = module;
  9833. cre.Name = action;
  9834. if (data != null && data.Count > 0)
  9835. {
  9836. foreach (string item in data.Keys)
  9837. {
  9838. if (item.StartsWith("checktime"))
  9839. {
  9840. cre.Properties.Add(item, DateTime.ParseExact(data[item] + "", "yyyy-MM-dd", null));
  9841. }
  9842. else
  9843. {
  9844. cre.Properties.Add(item, data[item]);
  9845. }
  9846. }
  9847. }
  9848. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetAllQASpotCheck(sUserInfo, cre));
  9849. if (sre.Status == Constant.ServiceResultStatus.Success)
  9850. {
  9851. actionResult.Status = (int)Constant.PDAResult.Success;
  9852. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9853. }
  9854. else if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  9855. {
  9856. actionResult.Status = (int)Constant.PDAResult.Success;
  9857. }
  9858. else
  9859. {
  9860. actionResult.Status = (int)Constant.PDAResult.Fail;
  9861. actionResult.Message = sre.Message;
  9862. }
  9863. return actionResult;
  9864. }
  9865. if (action == "AutoSaveQASpotCheck")
  9866. {
  9867. string barcode = data["barcode"] + "";
  9868. string remarks = data["remarks"] + "";
  9869. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.AutoSaveQASpotCheck(sUserInfo, barcode, remarks));
  9870. if (sre.Status == Constant.ServiceResultStatus.Success)
  9871. {
  9872. actionResult.Status = (int)Constant.PDAResult.Success;
  9873. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9874. }
  9875. else
  9876. {
  9877. actionResult.Status = (int)Constant.PDAResult.Fail;
  9878. actionResult.Message = sre.Message;
  9879. }
  9880. return actionResult;
  9881. }
  9882. if (action == "CheckQASpotCheck")
  9883. {
  9884. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.CheckQASpotCheck(sUserInfo, jsonData));
  9885. if (sre.Status == Constant.ServiceResultStatus.Success)
  9886. {
  9887. actionResult.Status = (int)Constant.PDAResult.Success;
  9888. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9889. }
  9890. else
  9891. {
  9892. actionResult.Status = (int)Constant.PDAResult.Fail;
  9893. actionResult.Message = sre.Message;
  9894. }
  9895. return actionResult;
  9896. }
  9897. if (action == "SaveQASpotCheck")
  9898. {
  9899. data["CheckTime"] = DateTime.ParseExact(data["CheckTime"] + "", "yyyy-MM-dd HH:mm:ss", null);
  9900. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveQASpotCheck(sUserInfo, data));
  9901. if (sre.Status == Constant.ServiceResultStatus.Success)
  9902. {
  9903. actionResult.Status = (int)Constant.PDAResult.Success;
  9904. }
  9905. else
  9906. {
  9907. actionResult.Status = (int)Constant.PDAResult.Fail;
  9908. actionResult.Message = sre.Message;
  9909. }
  9910. return actionResult;
  9911. }
  9912. return null;
  9913. }
  9914. #endregion
  9915. #region 产成品交接
  9916. if (module == "SendOutGoods")
  9917. {
  9918. #region 产成品交接、整板撤销 by fubin 20200824
  9919. // 交接验证
  9920. if (action == "FinishedHandoverBarcode")
  9921. {
  9922. string barcode = data["Barcode"] + "";
  9923. ServiceResultEntity sre = PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo);
  9924. if (sre.Data != null && sre.Data.Tables.Count > 0)
  9925. {
  9926. actionResult.Status = (int)Constant.PDAResult.Success;
  9927. actionResult.Result = JsonHelper.ToJson(sre.Data);
  9928. actionResult.Message = sre.Message;
  9929. }
  9930. else
  9931. {
  9932. actionResult.Status = (int)Constant.PDAResult.Fail;
  9933. actionResult.Message = sre.Message;
  9934. }
  9935. return actionResult;
  9936. }
  9937. // 交接操作
  9938. if (action == "SaveFinishedHandover")
  9939. {
  9940. int orderID = Convert.ToInt32(data["OrderID"]);
  9941. DataTable dt = JsonHelper.FromJson<DataTable>(data["Table"] + "");
  9942. //切换sap地址 by fy 2022年7月5日09:15:23 开始
  9943. //ServiceResultEntity sre = PMModuleLogicDAL.SaveFinishedHandover(orderID, dt, sUserInfo);
  9944. string sapName = "";
  9945. if (data.ContainsKey("SPANAME") && data["SPANAME"] is object &&
  9946. (data["SPANAME"].Equals("APP1") || data["SPANAME"].Equals("APP2") || data["SPANAME"].Equals("APP3")))
  9947. {
  9948. sapName = "_" + data["SPANAME"].ToString();
  9949. }
  9950. else
  9951. {
  9952. sapName = "";
  9953. }
  9954. ServiceResultEntity sre = PMModuleLogicDAL.SaveFinishedHandover(orderID, dt, sUserInfo, sapName);
  9955. //结束
  9956. if (Convert.ToInt32(sre.Result) > 0)
  9957. {
  9958. actionResult.Status = (int)Constant.PDAResult.Success;
  9959. actionResult.Message = "产成品交接成功";
  9960. }
  9961. else
  9962. {
  9963. actionResult.Status = (int)Constant.PDAResult.Fail;
  9964. actionResult.Message = sre.Message;
  9965. }
  9966. return actionResult;
  9967. }
  9968. // 撤销交接验证
  9969. if (action == "BackFinishedHandoverCheck")
  9970. {
  9971. string barcode = data["Barcode"] + "";
  9972. ServiceResultEntity sre = PMModuleLogic.BackFinishedHandoverCheck(barcode, sUserInfo);
  9973. if (sre.Data != null && sre.Data.Tables.Count > 0)
  9974. {
  9975. actionResult.Status = (int)Constant.PDAResult.Success;
  9976. actionResult.Result = JsonHelper.ToJson(sre.Data);
  9977. actionResult.Message = sre.Message;
  9978. }
  9979. else
  9980. {
  9981. actionResult.Status = (int)Constant.PDAResult.Fail;
  9982. actionResult.Message = sre.Message;
  9983. }
  9984. return actionResult;
  9985. }
  9986. // 撤销交接操作
  9987. if (action == "BackFinishedHandover")
  9988. {
  9989. DataTable dt = JsonHelper.FromJson<DataTable>(data["Table"] + "");
  9990. ServiceResultEntity sre = PMModuleLogicDAL.BackFinishedHandover(dt, sUserInfo);
  9991. if (Convert.ToInt32(sre.Result) > 0)
  9992. {
  9993. actionResult.Status = (int)Constant.PDAResult.Success;
  9994. actionResult.Message = "产成品撤销交接成功";
  9995. }
  9996. else
  9997. {
  9998. actionResult.Status = (int)Constant.PDAResult.Fail;
  9999. actionResult.Message = sre.Message;
  10000. }
  10001. return actionResult;
  10002. }
  10003. #endregion
  10004. // 设定商标
  10005. if (action == "GetFinishedBarcode")
  10006. {
  10007. string barcode = data["barcode"].ToString();
  10008. ServiceResultEntity resultEntity = PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo, 2);
  10009. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  10010. if (Convert.ToInt32(resultEntity.Result) < 0)
  10011. {
  10012. actionResult.Status = (int)Constant.PDAResult.Fail;
  10013. actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
  10014. actionResult.Message = resultEntity.Message;
  10015. }
  10016. else
  10017. {
  10018. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  10019. actionResult.Status = (int)Constant.PDAResult.Success;
  10020. actionResult.Message = resultEntity.Message;
  10021. }
  10022. return actionResult;
  10023. }
  10024. if (action == "GetHandoveredBarcode")
  10025. {
  10026. string barcode = data["barcode"].ToString();
  10027. ServiceResultEntity resultEntity = PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo, 1);
  10028. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  10029. if (Convert.ToInt32(resultEntity.Result) < 0)
  10030. {
  10031. actionResult.Status = (int)Constant.PDAResult.Fail;
  10032. actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
  10033. actionResult.Message = resultEntity.Message;
  10034. }
  10035. else
  10036. {
  10037. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  10038. actionResult.Status = (int)Constant.PDAResult.Success;
  10039. actionResult.Message = resultEntity.Message;
  10040. }
  10041. return actionResult;
  10042. }
  10043. if (action == "SetFinishedLogo")
  10044. {
  10045. int logoid = Convert.ToInt32(data["logoid"]);
  10046. string[] barcodes = data["barcodes"].ToString().Split(',');
  10047. string returnMessage = "";
  10048. int result = PMModuleLogicDAL.SetFinishedLogo(barcodes, logoid, sUserInfo, out returnMessage);
  10049. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  10050. if (result < 0)
  10051. {
  10052. actionResult.Status = (int)Constant.PDAResult.Fail;
  10053. actionResult.Message = returnMessage;
  10054. }
  10055. else
  10056. {
  10057. actionResult.Status = (int)Constant.PDAResult.Success;
  10058. }
  10059. return actionResult;
  10060. }
  10061. if (action == "SetHandoveredOrder")
  10062. {
  10063. int orderID = Convert.ToInt32(data["orderID"]);
  10064. string[] barcodes = data["barcodes"].ToString().Split(',');
  10065. int result = PMModuleLogicDAL.SetHandoveredOrder(barcodes, orderID, sUserInfo);
  10066. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  10067. if (result < 0)
  10068. {
  10069. actionResult.Status = (int)Constant.PDAResult.Fail;
  10070. }
  10071. else
  10072. {
  10073. actionResult.Status = (int)Constant.PDAResult.Success;
  10074. }
  10075. return actionResult;
  10076. }
  10077. }
  10078. #endregion
  10079. #region 产成品装车
  10080. if (module == "SendOutGoods")
  10081. {
  10082. if (action == "GetSendOutGoodsLogs")
  10083. {
  10084. string Lgort = data["Lgort"].ToString();
  10085. string sendoutgoodslogid = data.ContainsKey("sendoutgoodslogid")&& data["sendoutgoodslogid"]!=null? data["sendoutgoodslogid"].ToString() : "";
  10086. var result = PMModuleLogicDAL.GetSendOutGoodsLogs(Lgort, sendoutgoodslogid, sUserInfo);
  10087. actionResult.Result = JsonHelper.ToJson(result);
  10088. actionResult.Status = (int)Constant.PDAResult.Success;
  10089. return actionResult;
  10090. }
  10091. if (action == "CheckSendOutBarcode")
  10092. {
  10093. var result = PMModuleLogic.CHeckFinishOutlabelCode(data["banma"].ToString(), sUserInfo);
  10094. actionResult.Result = JsonHelper.ToJson(result.Result);
  10095. actionResult.Status = (int)result.Status;
  10096. //actionResult.Message = result.Message;
  10097. return actionResult;
  10098. }
  10099. if (action == "SaveSendOutGoods")
  10100. {
  10101. var result = PMModuleLogicDAL.SaveSendOutGoodsLogs(data, sUserInfo);
  10102. actionResult.Result = JsonHelper.ToJson(result);
  10103. //actionResult.Message = message;
  10104. actionResult.Status = (int)result.Status;
  10105. return actionResult;
  10106. }
  10107. }
  10108. /*
  10109. if (module == "FinishedLoading")
  10110. {
  10111. // 设定商标
  10112. if (action == "GetMaxLoadingNo")
  10113. {
  10114. int no = Service.PMModuleService.PMModuleLogic.GetMaxLoadingNo(sUserInfo);
  10115. actionResult.Status = (int)Constant.PDAResult.Success;
  10116. actionResult.Result = no;
  10117. return actionResult;
  10118. }
  10119. if (action == "CheckFinishedLaodingBarcode")
  10120. {
  10121. string barcode = data["barcode"].ToString();
  10122. ServiceResultEntity resultEntity = Service.PMModuleService.PMModuleLogic.CheckFinishedLaodingBarcode(sUserInfo, barcode);
  10123. if (resultEntity.Status == Constant.ServiceResultStatus.Success)
  10124. {
  10125. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  10126. actionResult.Status = (int)Constant.PDAResult.Success;
  10127. actionResult.Message = resultEntity.Message;
  10128. }
  10129. else
  10130. {
  10131. actionResult.Status = (int)Constant.PDAResult.Fail;
  10132. actionResult.Result = resultEntity.OtherStatus;
  10133. actionResult.Message = resultEntity.Message;
  10134. }
  10135. return actionResult;
  10136. }
  10137. if (action == "SaveFinishedLoading")
  10138. {
  10139. int loadingNo = Convert.ToInt32(data["loadingNo"]);
  10140. string carLicense = data["carLicense"] + "";
  10141. int palletNum = Convert.ToInt32(data["palletNum"]);
  10142. int goodsNum = Convert.ToInt32(data["goodsNum"]);
  10143. string remarks = data["remarks"] + "";
  10144. Dictionary<string, object>[] details =
  10145. JsonHelper.FromJson<Dictionary<string, object>[]>(data["details"] + "");
  10146. //"[{\"A\":1,\"B\":\"V\"},{\"A\":2,\"B\":\"V1\"}]"
  10147. ServiceResultEntity result = Service.PMModuleService.PMModuleLogic.SaveFinishedLoading(sUserInfo,
  10148. loadingNo, carLicense, palletNum, goodsNum, remarks, details);
  10149. if (result.Status == Constant.ServiceResultStatus.Success)
  10150. {
  10151. actionResult.Status = (int)Constant.PDAResult.Success;
  10152. actionResult.Message = result.Message;
  10153. }
  10154. else
  10155. {
  10156. actionResult.Status = (int)Constant.PDAResult.Fail;
  10157. actionResult.Result = result.OtherStatus;
  10158. actionResult.Message = result.Message;
  10159. }
  10160. return actionResult;
  10161. }
  10162. }
  10163. */
  10164. #endregion
  10165. #region 产成品质量改判
  10166. if (module == "FinishedProductTamper")
  10167. {
  10168. // 获取产成品信息及缺陷数据
  10169. if (action == "GetDefectData")
  10170. {
  10171. string barcode = data["barcode"].ToString();
  10172. ServiceResultEntity sre = PDAModuleLogic.GetDefectData(barcode, sUserInfo);
  10173. if (sre.Status == Constant.ServiceResultStatus.Success)
  10174. {
  10175. actionResult.Status = (int)Constant.PDAResult.Success;
  10176. actionResult.Result = JsonHelper.ToJson(sre.Result);
  10177. actionResult.Message = sre.Message;
  10178. }
  10179. else
  10180. {
  10181. actionResult.Status = (int)Constant.PDAResult.Fail;
  10182. actionResult.Result = sre.OtherStatus;
  10183. actionResult.Message = sre.Message;
  10184. }
  10185. return actionResult;
  10186. }
  10187. // 获取产成品信息及缺陷数据
  10188. if (action == "SaveDefectData")
  10189. {
  10190. ProductionDataEntity productionDataEntity = JsonHelper.FromJson<ProductionDataEntity>(data["ProductionDataEntity"] + "");
  10191. ServiceResultEntity sre = PDAModuleLogic.SaveDefectData(productionDataEntity, sUserInfo);
  10192. if (sre.Status == Constant.ServiceResultStatus.Success)
  10193. {
  10194. actionResult.Status = (int)Constant.PDAResult.Success;
  10195. actionResult.Message = sre.Message;
  10196. }
  10197. else
  10198. {
  10199. actionResult.Status = (int)Constant.PDAResult.Fail;
  10200. actionResult.Message = sre.Message;
  10201. }
  10202. return actionResult;
  10203. }
  10204. // 通过条码查出责任工序(成品改判用)
  10205. if (action == "GetDutyProcedureByBarCodeForTamper")
  10206. {
  10207. string barcode = data["barcode"] + "";
  10208. int defectid = int.Parse(data["defectid"] + "");
  10209. ServiceResultEntity sre = PDAModuleLogic.GetDutyProcedureByBarCodeForTamper(barcode, defectid, sUserInfo.AccountID);
  10210. if (sre.Status == Constant.ServiceResultStatus.Success)
  10211. {
  10212. actionResult.Status = (int)Constant.PDAResult.Success;
  10213. actionResult.Result = JsonHelper.ToJson(sre.Data);
  10214. actionResult.Message = sre.Message;
  10215. }
  10216. else
  10217. {
  10218. actionResult.Status = (int)Constant.PDAResult.Fail;
  10219. actionResult.Result = sre.OtherStatus;
  10220. actionResult.Message = sre.Message;
  10221. }
  10222. return actionResult;
  10223. }
  10224. }
  10225. #endregion
  10226. #region PDA独立功能
  10227. #region 水效标识
  10228. if (module == "WaterEffect")
  10229. {
  10230. // 获取产成品信息及水效标识
  10231. if (action == "GetGoodsByBarCode")
  10232. {
  10233. string barcode = data["barcode"].ToString();
  10234. ServiceResultEntity sre = PDAModuleLogic.GetGoodsByBarCode(barcode, sUserInfo);
  10235. if (sre.Status == Constant.ServiceResultStatus.Success)
  10236. {
  10237. actionResult.Status = (int)Constant.PDAResult.Success;
  10238. actionResult.Result = JsonHelper.ToJson(sre.Result);
  10239. actionResult.Message = sre.Message;
  10240. }
  10241. else
  10242. {
  10243. actionResult.Status = (int)Constant.PDAResult.Fail;
  10244. actionResult.Result = sre.OtherStatus;
  10245. actionResult.Message = sre.Message;
  10246. }
  10247. return actionResult;
  10248. }
  10249. }
  10250. #endregion
  10251. #region 盖板型号
  10252. if (module == "SeatCoverType")
  10253. {
  10254. // 获取产成品信息及水效标识
  10255. if (action == "SendGoodsCodeToPLC")
  10256. {
  10257. string barcode = data["barcode"].ToString();
  10258. int sre = PLCModuleLogic.SendGoodsCodeToPLCBySeatCover(barcode, sUserInfo);
  10259. if (sre == 0)
  10260. {
  10261. actionResult.Status = (int)Constant.PDAResult.Success;
  10262. }
  10263. else
  10264. {
  10265. actionResult.Status = (int)Constant.PDAResult.Fail;
  10266. actionResult.Result = sre;
  10267. switch (sre)
  10268. {
  10269. case 1:
  10270. case 2:
  10271. actionResult.Message = "无效条码";
  10272. break;
  10273. case 3:
  10274. actionResult.Message = "此产品型号没有设置盖板标识码";
  10275. break;
  10276. case 4:
  10277. actionResult.Message = "当前用户没有设置PLC参数";
  10278. break;
  10279. case 5:
  10280. actionResult.Message = "PLC参数设置不全";
  10281. break;
  10282. default:
  10283. actionResult.Message = "PLC通信异常";
  10284. break;
  10285. }
  10286. }
  10287. return actionResult;
  10288. }
  10289. }
  10290. #endregion
  10291. #region PDA PLC 相关功能
  10292. if (module == "PDA_FUN_PLC")
  10293. {
  10294. // PDA扫码发送到PLCServer
  10295. if (action == "SendBarcodeToPLCServer")
  10296. {
  10297. string barcode = data["barcode"].ToString();
  10298. int sre = PLCModuleLogic.SendBarcodeToPLCServer(barcode, sUserInfo);
  10299. if (sre == 0)
  10300. {
  10301. actionResult.Status = (int)Constant.PDAResult.Success;
  10302. }
  10303. else
  10304. {
  10305. actionResult.Status = (int)Constant.PDAResult.Fail;
  10306. actionResult.Result = sre;
  10307. switch (sre)
  10308. {
  10309. case 1:
  10310. case 2:
  10311. actionResult.Message = "无效条码";
  10312. break;
  10313. case 3:
  10314. actionResult.Message = "PLC通信异常";
  10315. break;
  10316. case 4:
  10317. actionResult.Message = "当前用户没有设置PLC参数";
  10318. break;
  10319. case 5:
  10320. actionResult.Message = "PLC参数设置不全";
  10321. break;
  10322. default:
  10323. actionResult.Message = "PLC通信异常";
  10324. break;
  10325. }
  10326. }
  10327. return actionResult;
  10328. }
  10329. }
  10330. #endregion
  10331. #endregion
  10332. #region 半检返修
  10333. if (module == "SemiRework")
  10334. {
  10335. // 验证半检返修条码
  10336. if (action == "CheckSemiReworkBarcode")
  10337. {
  10338. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10339. PMModuleLogic.CheckSemiReworkBarcode(jsonData);
  10340. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  10341. if (Convert.ToInt32(resultEntity.Result) < 0)
  10342. {
  10343. actionResult.Status = (int)Constant.PDAResult.Fail;
  10344. }
  10345. else
  10346. {
  10347. actionResult.Status = (int)Constant.PDAResult.Success;
  10348. }
  10349. actionResult.Message = resultEntity.Message;
  10350. return actionResult;
  10351. }
  10352. // 可以返修的工序
  10353. if (action == "GetSemiReworkProcedure")
  10354. {
  10355. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10356. PMModuleLogic.GetSemiReworkProcedure(jsonData, sUserInfo);
  10357. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  10358. actionResult.Status = (int)Constant.PDAResult.Success;
  10359. return actionResult;
  10360. }
  10361. // 根据条码获取经过的工序,用于责任工序
  10362. if (action == "GetSemiReworkPassProcedure")
  10363. {
  10364. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10365. PMModuleLogic.GetSemiReworkPassProcedure(jsonData);
  10366. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  10367. actionResult.Status = (int)Constant.PDAResult.Success;
  10368. return actionResult;
  10369. }
  10370. // 根据所选生产工序(生产数据ID)查询责任员工
  10371. if (action == "GetSemiReworkDefectStaffByProductionDataID")
  10372. {
  10373. int productionDataID = Convert.ToInt32(jsonData);
  10374. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10375. PMModuleLogic.GetSemiReworkDefectStaffByProductionDataID(productionDataID);
  10376. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  10377. actionResult.Status = (int)Constant.PDAResult.Success;
  10378. return actionResult;
  10379. }
  10380. // 根据所选工号,查出缺陷责任员工
  10381. if (action == "GetSemiReworkDefectStaffByUserID")
  10382. {
  10383. int userID = Convert.ToInt32(jsonData);
  10384. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10385. PMModuleLogic.GetSemiReworkDefectStaffByUserID(userID);
  10386. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  10387. actionResult.Status = (int)Constant.PDAResult.Success;
  10388. return actionResult;
  10389. }
  10390. // 新建半检返修
  10391. if (action == "AddSemiRework")
  10392. {
  10393. SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"] + "");
  10394. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10395. PMModuleLogic.AddSemiRework(entity, sUserInfo);
  10396. actionResult.Result = resultEntity.Result;
  10397. actionResult.Message = resultEntity.Message;
  10398. if (Convert.ToInt32(resultEntity.Result) > 0)
  10399. {
  10400. actionResult.Status = (int)Constant.PDAResult.Success;
  10401. }
  10402. else
  10403. {
  10404. actionResult.Status = (int)Constant.PDAResult.Fail;
  10405. }
  10406. return actionResult;
  10407. }
  10408. // 编辑半检返修
  10409. if (action == "EditSemiRework")
  10410. {
  10411. SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"] + "");
  10412. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10413. PMModuleLogic.EditSemiRework(entity, sUserInfo);
  10414. actionResult.Result = resultEntity.Result;
  10415. actionResult.Message = resultEntity.Message;
  10416. if (Convert.ToInt32(resultEntity.Result) > 0)
  10417. {
  10418. actionResult.Status = (int)Constant.PDAResult.Success;
  10419. }
  10420. else
  10421. {
  10422. actionResult.Status = (int)Constant.PDAResult.Fail;
  10423. }
  10424. return actionResult;
  10425. }
  10426. // 撤销半检返修
  10427. if (action == "CancelSemiRework")
  10428. {
  10429. SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"] + "");
  10430. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10431. PMModuleLogic.CancelSemiRework(entity, sUserInfo);
  10432. actionResult.Result = resultEntity.Result;
  10433. actionResult.Message = resultEntity.Message;
  10434. if (Convert.ToInt32(resultEntity.Result) > 0)
  10435. {
  10436. actionResult.Status = (int)Constant.PDAResult.Success;
  10437. }
  10438. else
  10439. {
  10440. actionResult.Status = (int)Constant.PDAResult.Fail;
  10441. }
  10442. return actionResult;
  10443. }
  10444. // 获取半检返修数据(PDA编辑用)
  10445. if (action == "GetSemiReworkByID")
  10446. {
  10447. int id = Convert.ToInt32(jsonData);
  10448. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10449. PMModuleLogic.GetSemiReworkByID(id, sUserInfo.UserCode);
  10450. DataTable data1 = resultEntity.Data.Tables[0];
  10451. DataTable data2 = resultEntity.Data.Tables[1];
  10452. DataTable data3 = resultEntity.Data.Tables[2];
  10453. if (data1.Rows.Count == 0)
  10454. {
  10455. actionResult.Status = (int)Constant.PDAResult.Fail;
  10456. actionResult.Message = "半检返修信息不存在";
  10457. return actionResult;
  10458. }
  10459. SemiReworkEntity srEntity = new SemiReworkEntity();
  10460. srEntity.SemiReworkID = id;
  10461. srEntity.BarCode = data1.Rows[0]["BarCode"] + "";
  10462. srEntity.ReworkProcedureID = Convert.ToInt32(data1.Rows[0]["ReworkProcedureID"]);
  10463. srEntity.Remarks = data1.Rows[0]["Remarks"] + "";
  10464. srEntity.SemiReworkDefects = new List<SemiReworkDefectEntity>();
  10465. foreach (DataRow row2 in data2.Rows)
  10466. {
  10467. SemiReworkDefectEntity defectEntity = new SemiReworkDefectEntity();
  10468. srEntity.SemiReworkDefects.Add(defectEntity);
  10469. defectEntity.SemiReworkDefectID = Convert.ToInt32(row2["SemiReworkDefectID"]);
  10470. defectEntity.SemiReworkID = id;
  10471. defectEntity.DefectID = Convert.ToInt32(row2["DefectID"]);
  10472. defectEntity.DefectCode = row2["DefectCode"] + "";
  10473. defectEntity.DefectName = row2["DefectName"] + "";
  10474. defectEntity.DefectPositionID = Convert.ToInt32(row2["DefectPositionID"]);
  10475. defectEntity.DefectPositionCode = row2["DefectPositionCode"] + "";
  10476. defectEntity.DefectPositionName = row2["DefectPositionName"] + "";
  10477. defectEntity.ScrapResponFlag = row2["ScrapResponFlag"] + "";
  10478. defectEntity.DefectProductionDataID = row2["DefectProductionDataID"].ToNullableInt32();
  10479. defectEntity.DefectProcedureID = row2["DefectProcedureID"].ToNullableInt32();
  10480. defectEntity.DefectProcedureCode = row2["DefectProcedureCode"] + "";
  10481. defectEntity.DefectProcedureName = row2["DefectProcedureName"] + "";
  10482. defectEntity.Remarks = row2["Remarks"] + "";
  10483. defectEntity.DefectUserID = Convert.ToInt32(row2["DefectUserID"]);
  10484. defectEntity.DefectUserCode = row2["DefectUserCode"] + "";
  10485. defectEntity.DefectUserName = row2["DefectUserName"] + "";
  10486. defectEntity.DefectResponsibles = new List<SemiReworkRPSEntity>();
  10487. defectEntity.ValueFlag = Convert.ToInt32(row2["ValueFlag"]);
  10488. DataRow[] row3s = data3.Select("SemiReworkDefectID=" + defectEntity.SemiReworkDefectID);
  10489. if (row3s.Length == 0)
  10490. {
  10491. continue;
  10492. }
  10493. foreach (DataRow row3 in row3s)
  10494. {
  10495. SemiReworkRPSEntity semiReworkRPS = new SemiReworkRPSEntity();
  10496. defectEntity.DefectResponsibles.Add(semiReworkRPS);
  10497. semiReworkRPS.SemiReworkDefectID = Convert.ToInt32(row3["SemiReworkDefectID"]);
  10498. semiReworkRPS.StaffID = Convert.ToInt32(row3["StaffID"]);
  10499. semiReworkRPS.StaffName = row3["StaffName"] + "";
  10500. semiReworkRPS.StaffCode = row3["StaffCode"] + "";
  10501. semiReworkRPS.SemiReworkID = Convert.ToInt32(row3["SemiReworkID"]);
  10502. semiReworkRPS.UserID = Convert.ToInt32(row3["UserID"]);
  10503. semiReworkRPS.UserCode = row3["UserCode"] + "";
  10504. semiReworkRPS.UJobsID = Convert.ToInt32(row3["UJobsID"]);
  10505. semiReworkRPS.SJobsID = Convert.ToInt32(row3["SJobsID"]);
  10506. }
  10507. }
  10508. //xuwei note 总单用于显示,信息较全
  10509. actionResult.Message = JsonHelper.ToJson(data1);
  10510. //xuwei note 总单信息不全,但有明细,用于回传保存
  10511. actionResult.Result = JsonHelper.ToJson(srEntity);
  10512. actionResult.Status = (int)Constant.PDAResult.Success;
  10513. }
  10514. }
  10515. #endregion
  10516. #region 窑车漏扫补件
  10517. if (module == "F_PM_0504")
  10518. {
  10519. // 验证窑车编码是否存在
  10520. if (action == "CheckKilnCar")
  10521. {
  10522. ClientRequestEntity cre = new ClientRequestEntity();
  10523. cre.Properties["kilncarcode"] = data["KilnCarCode"];
  10524. cre.Properties["procedureID"] = data["ProcedureID"];
  10525. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.CheckKilnCar(cre, sUserInfo);
  10526. if (sre.Status == Constant.ServiceResultStatus.Success)
  10527. {
  10528. actionResult.Status = (int)Constant.PDAResult.Success;
  10529. actionResult.Result = sre.Result;
  10530. }
  10531. else
  10532. {
  10533. actionResult.Status = (int)Constant.PDAResult.Fail;
  10534. actionResult.Message = sre.Message;
  10535. }
  10536. return actionResult;
  10537. }
  10538. // 验证窑车烧成批次号是否存在 和 是否能补漏扫
  10539. if (action == "CheckKilnCarBatchNo")
  10540. {
  10541. ClientRequestEntity cre = new ClientRequestEntity();
  10542. cre.Properties["KilnID"] = data["KilnID"];
  10543. cre.Properties["KilnCarID"] = data["KilnCarID"];
  10544. cre.Properties["ProcedureID"] = data["ProcedureID"];
  10545. cre.Properties["KilnCarBatchNo"] = data["KilnCarBatchNo"];
  10546. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.CheckKilnCarBatchNo(cre, sUserInfo);
  10547. if (sre.Status == Constant.ServiceResultStatus.Success)
  10548. {
  10549. actionResult.Status = (int)Constant.PDAResult.Success;
  10550. }
  10551. else
  10552. {
  10553. actionResult.Status = (int)Constant.PDAResult.Fail;
  10554. actionResult.Message = sre.Message;
  10555. }
  10556. return actionResult;
  10557. }
  10558. // 窑车漏扫补件
  10559. if (action == "SetKilnCarMissing")
  10560. {
  10561. ClientRequestEntity cre = new ClientRequestEntity();
  10562. cre.Properties["KilnCarBatchNo"] = data["KilnCarBatchNo"];
  10563. string carData = data["CarData"] + "";
  10564. DataTable dataTable = JsonHelper.FromJson<DataTable>(carData);
  10565. cre.Data = new DataSet();
  10566. cre.Data.Tables.Add(dataTable);
  10567. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.SetKilnCarMissing(cre, sUserInfo);
  10568. if (sre.Status == Constant.ServiceResultStatus.Success)
  10569. {
  10570. actionResult.Status = (int)Constant.PDAResult.Success;
  10571. }
  10572. else
  10573. {
  10574. actionResult.Status = (int)Constant.PDAResult.Fail;
  10575. actionResult.Message = sre.Message;
  10576. }
  10577. return actionResult;
  10578. }
  10579. }
  10580. #endregion
  10581. #region 梭式窑入窑
  10582. else if (module == "F_PM_0505")
  10583. {
  10584. // 验证窑车编码是否存在
  10585. if (action == "GetAllKilntInfo")
  10586. {
  10587. DataSet dsKilntInfo = SystemModuleLogic.GetAllKilntInfo(sUserInfo);
  10588. if (dsKilntInfo != null && dsKilntInfo.Tables.Count > 0)
  10589. {
  10590. actionResult.Status = (int)Constant.PDAResult.Success;
  10591. actionResult.Result = JsonHelper.ToJson(dsKilntInfo.Tables[0]);
  10592. }
  10593. else
  10594. {
  10595. actionResult.Status = (int)Constant.PDAResult.Fail;
  10596. }
  10597. return actionResult;
  10598. }
  10599. // 保存梭式窑入窑计数
  10600. if (action == "SaveSKBatchNo")
  10601. {
  10602. ClientRequestEntity cre = new ClientRequestEntity();
  10603. cre.Properties["KilnCode"] = data["KilnCode"];
  10604. cre.Properties["Remarks"] = data["Remarks"];
  10605. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.SaveSKBatchNo(cre, sUserInfo);
  10606. if (sre.Status == Constant.ServiceResultStatus.Success)
  10607. {
  10608. if (sre.OtherStatus > 0)
  10609. {
  10610. actionResult.Status = (int)Constant.PDAResult.Success;
  10611. }
  10612. else
  10613. {
  10614. actionResult.Status = (int)Constant.PDAResult.Fail;
  10615. actionResult.Message = sre.Message;
  10616. }
  10617. }
  10618. else
  10619. {
  10620. actionResult.Status = (int)Constant.PDAResult.Fail;
  10621. actionResult.Message = sre.Message;
  10622. }
  10623. return actionResult;
  10624. }
  10625. }
  10626. #endregion
  10627. #region 重启3#高压注浆
  10628. else if (module == "F_PM_0107")
  10629. {
  10630. // 查询3#高压注浆线
  10631. if (action == "GetGroutingLine3")
  10632. {
  10633. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.GetGroutingLine3(sUserInfo);
  10634. if (sre.Data != null && sre.Data.Tables.Count > 0)
  10635. {
  10636. actionResult.Status = (int)Constant.PDAResult.Success;
  10637. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  10638. }
  10639. else
  10640. {
  10641. actionResult.Status = (int)Constant.PDAResult.Fail;
  10642. }
  10643. return actionResult;
  10644. }
  10645. // 重置注浆批次
  10646. if (action == "SaveGroutingLine3")
  10647. {
  10648. ClientRequestEntity cre = new ClientRequestEntity();
  10649. cre.Properties["GroutingLineID"] = data["GroutingLineID"];
  10650. cre.Properties["H_BatchNo"] = data["H_BatchNo"];
  10651. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.SaveGroutingLine3(cre, sUserInfo);
  10652. if (sre.Status == Constant.ServiceResultStatus.Success)
  10653. {
  10654. if (sre.OtherStatus > 0)
  10655. {
  10656. actionResult.Status = (int)Constant.PDAResult.Success;
  10657. }
  10658. else
  10659. {
  10660. actionResult.Status = (int)Constant.PDAResult.Fail;
  10661. actionResult.Message = sre.Message;
  10662. }
  10663. }
  10664. else
  10665. {
  10666. actionResult.Status = (int)Constant.PDAResult.Fail;
  10667. actionResult.Message = sre.Message;
  10668. }
  10669. return actionResult;
  10670. }
  10671. }
  10672. #endregion
  10673. #region 3#条码打印机(PDA用)
  10674. // 3#配置工位打印机
  10675. else if (module == "01070804")
  10676. {
  10677. // 获取3#条码打印机配置(PDA用)
  10678. if (action == "GetWorkStationPrinter3")
  10679. {
  10680. ServiceResultEntity sre = SystemModuleLogic.GetWorkStationPrinter3(sUserInfo);
  10681. if (sre.Data != null && sre.Data.Tables.Count > 0)
  10682. {
  10683. actionResult.Status = (int)Constant.PDAResult.Success;
  10684. actionResult.Result = JsonHelper.ToJson(sre.Data);
  10685. }
  10686. else
  10687. {
  10688. actionResult.Status = (int)Constant.PDAResult.Fail;
  10689. }
  10690. return actionResult;
  10691. }
  10692. // 保存3#条码打印机配置(PDA用)
  10693. else if (action == "SaveWorkStationPrinter3")
  10694. {
  10695. ClientRequestEntity cre = new ClientRequestEntity();
  10696. cre.Properties["WorkStationID"] = data["WorkStationID"];
  10697. cre.Properties["PrinterID1"] = data["PrinterID1"];
  10698. cre.Properties["PrinterID2"] = data["PrinterID2"];
  10699. cre.Properties["PrinterID3"] = data["PrinterID3"];
  10700. ServiceResultEntity sre = SystemModuleLogic.SaveWorkStationPrinter3(cre, sUserInfo);
  10701. if (sre.Status == Constant.ServiceResultStatus.Success)
  10702. {
  10703. if (sre.OtherStatus > 0)
  10704. {
  10705. actionResult.Status = (int)Constant.PDAResult.Success;
  10706. }
  10707. else
  10708. {
  10709. actionResult.Status = (int)Constant.PDAResult.Fail;
  10710. actionResult.Message = sre.Message;
  10711. }
  10712. }
  10713. else
  10714. {
  10715. actionResult.Status = (int)Constant.PDAResult.Fail;
  10716. actionResult.Message = sre.Message;
  10717. }
  10718. return actionResult;
  10719. }
  10720. }
  10721. // 3#条码打印
  10722. else if (module == "01070805")
  10723. {
  10724. // 获取3#条码打印机配置(PDA用)
  10725. if (action == "GetWorkStationPrinter3")
  10726. {
  10727. ServiceResultEntity sre = SystemModuleLogic.GetWorkStationPrinter3(sUserInfo);
  10728. if (sre.Data != null && sre.Data.Tables.Count > 0)
  10729. {
  10730. actionResult.Status = (int)Constant.PDAResult.Success;
  10731. actionResult.Result = JsonHelper.ToJson(sre.Data);
  10732. }
  10733. else
  10734. {
  10735. actionResult.Status = (int)Constant.PDAResult.Fail;
  10736. }
  10737. return actionResult;
  10738. }
  10739. // 条码打印(PDA用)
  10740. else if (action == "PrintBarcode_3BL")
  10741. {
  10742. ClientRequestEntity cre = new ClientRequestEntity();
  10743. cre.Properties["Barcode"] = data["Barcode"];
  10744. cre.Properties["WorkStationID"] = data["WorkStationID"];
  10745. ServiceResultEntity sre = SystemModuleLogic.PrintBarcode_3BL(cre, sUserInfo);
  10746. if (sre.Status == Constant.ServiceResultStatus.Success)
  10747. {
  10748. if (sre.Result != null)
  10749. {
  10750. actionResult.Status = (int)Constant.PDAResult.Success;
  10751. }
  10752. else
  10753. {
  10754. actionResult.Status = (int)Constant.PDAResult.Fail;
  10755. actionResult.Message = sre.Message;
  10756. }
  10757. }
  10758. else
  10759. {
  10760. actionResult.Status = (int)Constant.PDAResult.Fail;
  10761. actionResult.Message = sre.Message;
  10762. }
  10763. return actionResult;
  10764. }
  10765. }
  10766. // 3#条码补打
  10767. else if (module == "01070806")
  10768. {
  10769. // 获取3#条码打印机配置(PDA用)
  10770. if (action == "GetWorkStationPrinter3")
  10771. {
  10772. ServiceResultEntity sre = SystemModuleLogic.GetWorkStationPrinter3(sUserInfo);
  10773. if (sre.Data != null && sre.Data.Tables.Count > 0)
  10774. {
  10775. actionResult.Status = (int)Constant.PDAResult.Success;
  10776. actionResult.Result = JsonHelper.ToJson(sre.Data);
  10777. }
  10778. else
  10779. {
  10780. actionResult.Status = (int)Constant.PDAResult.Fail;
  10781. }
  10782. return actionResult;
  10783. }
  10784. // 补打3#条码(PDA用)
  10785. else if (action == "PrintBarcode_3BL_B")
  10786. {
  10787. ClientRequestEntity cre = new ClientRequestEntity();
  10788. cre.Properties["Barcode"] = data["Barcode"];
  10789. if (data.ContainsKey("PrinterID1"))
  10790. cre.Properties["PrinterID1"] = data["PrinterID1"];
  10791. if (data.ContainsKey("PrinterID2"))
  10792. cre.Properties["PrinterID2"] = data["PrinterID2"];
  10793. if (data.ContainsKey("PrinterID3"))
  10794. cre.Properties["PrinterID3"] = data["PrinterID3"];
  10795. ServiceResultEntity sre = SystemModuleLogic.PrintBarcode_3BL_B(cre, sUserInfo);
  10796. if (sre.Status == Constant.ServiceResultStatus.Success)
  10797. {
  10798. if (sre.Result != null)
  10799. {
  10800. actionResult.Status = (int)Constant.PDAResult.Success;
  10801. }
  10802. else
  10803. {
  10804. actionResult.Status = (int)Constant.PDAResult.Fail;
  10805. actionResult.Message = sre.Message;
  10806. }
  10807. }
  10808. else
  10809. {
  10810. actionResult.Status = (int)Constant.PDAResult.Fail;
  10811. actionResult.Message = sre.Message;
  10812. }
  10813. return actionResult;
  10814. }
  10815. }
  10816. #endregion
  10817. #region 获取3#成检二检PLC重量
  10818. else if (module == "GetPLCWeight")
  10819. {
  10820. // 获取3#条码打印机配置(PDA用)
  10821. if (action == "GetPLCWeight")
  10822. {
  10823. actionResult.Result = PMModuleLogic.Get3PLCWeight(sUserInfo);
  10824. actionResult.Status = (int)Constant.PDAResult.Success;
  10825. return actionResult;
  10826. }
  10827. }
  10828. #endregion
  10829. #region 注浆绑码时,验证成型线是否能绑码
  10830. else if (module == "CheckGroutingLine")
  10831. {
  10832. if (action == "CheckGroutingLine")
  10833. {
  10834. ServiceResultEntity sre = PDAModuleLogic.CheckGroutingLine(data["GroutingLineCode"] + "");
  10835. if (sre.OtherStatus < 0)
  10836. {
  10837. actionResult.Status = (int)Constant.PDAResult.Fail;
  10838. actionResult.Message = sre.Message;
  10839. }
  10840. else
  10841. {
  10842. actionResult.Status = (int)Constant.PDAResult.Success;
  10843. }
  10844. return actionResult;
  10845. }
  10846. }
  10847. #endregion
  10848. #region 注浆绑码选批次查询最小启用的模具编码
  10849. else if (module == "GetGroutingMouldByBatchNo")
  10850. {
  10851. if (action == "GetGroutingMouldByBatchNo")
  10852. {
  10853. string groutingLineCode = data["groutingLineCode"] + "";
  10854. string groutingDay = data["groutingDay"] + "";
  10855. string groutingBatchNo = data["groutingBatchNo"] + "";
  10856. string groutingMouldCode = data["groutingMouldCode"] + "";
  10857. ServiceResultEntity sre = PDAModuleLogic.GetGroutingMouldByBatchNo(groutingMouldCode, groutingLineCode, groutingDay, groutingBatchNo);
  10858. if (sre.Status == Constant.ServiceResultStatus.Success)
  10859. {
  10860. actionResult.Status = (int)Constant.PDAResult.Success;
  10861. actionResult.Result = JsonHelper.ToJson(sre.Result);
  10862. actionResult.Message = sre.Message;
  10863. }
  10864. else
  10865. {
  10866. actionResult.Status = (int)Constant.PDAResult.Fail;
  10867. actionResult.Result = sre.OtherStatus;
  10868. actionResult.Message = sre.Message;
  10869. }
  10870. return actionResult;
  10871. }
  10872. }
  10873. #endregion
  10874. #region 3#半检一检交坯
  10875. else if (module == "SemiQualityStatistics")
  10876. {
  10877. if (action == "SemiQualityStatisticsDeliver3")
  10878. {
  10879. ServiceResultEntity sre = PMModuleLogicDAL.SemiQualityStatisticsDeliver3(data, sUserInfo);
  10880. if (sre.OtherStatus < 0)
  10881. {
  10882. actionResult.Status = (int)Constant.PDAResult.Fail;
  10883. actionResult.Message = sre.Message;
  10884. }
  10885. else
  10886. {
  10887. actionResult.Status = (int)Constant.PDAResult.Success;
  10888. }
  10889. return actionResult;
  10890. }
  10891. }
  10892. #endregion
  10893. #region 产品分级(3车间)
  10894. else if (module == "0628")
  10895. {
  10896. if (action == "CheckOneLevelType")
  10897. {
  10898. string barcode = data["Barcode"] + "";
  10899. ServiceResultEntity sre = PDAModuleLogic.CheckOneLevelType(barcode);
  10900. if (sre.OtherStatus < 0)
  10901. {
  10902. actionResult.Status = (int)Constant.PDAResult.Fail;
  10903. actionResult.Message = sre.Message;
  10904. }
  10905. else
  10906. {
  10907. actionResult.Status = (int)Constant.PDAResult.Success;
  10908. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  10909. }
  10910. return actionResult;
  10911. }
  10912. if (action == "SaveOneLevelType")
  10913. {
  10914. int? levelTypeID = data["LevelTypeID"].ToNullableInt32();
  10915. string barcode = data["Barcode"] + "";
  10916. ServiceResultEntity sre = PDAModuleLogic.SaveOneLevelType(levelTypeID, barcode);
  10917. if (sre.OtherStatus < 0)
  10918. {
  10919. actionResult.Status = (int)Constant.PDAResult.Fail;
  10920. actionResult.Message = sre.Message;
  10921. }
  10922. else
  10923. {
  10924. actionResult.Status = (int)Constant.PDAResult.Success;
  10925. }
  10926. return actionResult;
  10927. }
  10928. }
  10929. #endregion
  10930. #region 半检查询责任工序(3车间)
  10931. else if (module == "GetDutyProcedureByBarCode3")
  10932. {
  10933. if (action == "GetDutyProcedureByBarCode3")
  10934. {
  10935. string barcode = data["barcode"] + "";
  10936. int defectid = Convert.ToInt32(data["defectid"] + "");
  10937. int procedureid = Convert.ToInt32(data["procedureid"] + "");
  10938. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  10939. () => PMModuleLogic.GetDutyProcedureByBarCode(barcode, defectid, sUserInfo.AccountID, procedureid));
  10940. if (dutyProcedureDs != null)
  10941. {
  10942. actionResult.Status = (int)Constant.PDAResult.Success;
  10943. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs);
  10944. }
  10945. else
  10946. {
  10947. actionResult.Status = (int)Constant.PDAResult.Fail;
  10948. }
  10949. return actionResult;
  10950. }
  10951. }
  10952. #endregion
  10953. #region 成品检验
  10954. if (module == "ProductionData")
  10955. {
  10956. //扫码查询
  10957. if (action == "CheckBarcode")
  10958. {
  10959. string barcode = data["barcode"] + "";
  10960. ServiceResultEntity sre = Service.PCModuleService.FinishedCheckLogic.GetProductionID(barcode);
  10961. int procedureID = Convert.ToInt32(sre.Data.Tables[0].Rows[0]["finishedcheckprocedureid"]);
  10962. sre = Service.PCModuleService.FinishedCheckLogic.CheckBarcode(procedureID, barcode, sUserInfo);
  10963. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  10964. if (Convert.ToInt32(sre.Result) < 0)
  10965. {
  10966. actionResult.Status = (int)Constant.PDAResult.Fail;
  10967. actionResult.Result = sre.OtherStatus; //漏扫1,反之0
  10968. actionResult.Message = sre.Message;
  10969. }
  10970. else
  10971. {
  10972. actionResult.Result = JsonHelper.ToJson(sre.Data);
  10973. actionResult.Status = (int)Constant.PDAResult.Success;
  10974. actionResult.Message = sre.Message;
  10975. }
  10976. return actionResult;
  10977. }
  10978. //撤销查询
  10979. if (action == "GetFinishedCancleData")
  10980. {
  10981. string barcode = data["barcode"] + "";
  10982. ServiceResultEntity sre = Service.PCModuleService.FinishedCheckLogic.GetFinishedCancleData(barcode, sUserInfo);
  10983. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  10984. if (Convert.ToInt32(sre.Result) < 0)
  10985. {
  10986. actionResult.Status = (int)Constant.PDAResult.Fail;
  10987. actionResult.Result = sre.OtherStatus; //漏扫1,反之0
  10988. actionResult.Message = sre.Message;
  10989. }
  10990. else
  10991. {
  10992. actionResult.Result = JsonHelper.ToJson(sre.Data);
  10993. actionResult.Status = (int)Constant.PDAResult.Success;
  10994. actionResult.Message = sre.Message;
  10995. }
  10996. return actionResult;
  10997. }
  10998. //保存成品检验
  10999. if (action == "AddCheckBarcode")
  11000. {
  11001. int procedureID = Convert.ToInt32(data["procedureID"]);
  11002. //DataTable TableProductionData = JsonHelper.FromJson<DataTable>(data["productionData"] + "");
  11003. //缺陷
  11004. //DataTable productionDefectTable = JsonHelper.FromJson<DataTable>(data["productionDefectTable"] + "");
  11005. //责任员工
  11006. //DataTable DSTableStaff = JsonHelper.FromJson<DataTable>(data["dSTableStaff"] + "");
  11007. //漏检员工
  11008. //DataTable DSTableMissedStaff = JsonHelper.FromJson<DataTable>(data["dSTableMissedStaff"] + "");
  11009. //图片
  11010. //DataTable DSTableImage = JsonHelper.FromJson<DataTable>(data["dSTableImage"] + "");
  11011. //ProductionDataEntity[] productionDataEntitys = new ProductionDataEntity[TableProductionData.Rows.Count];
  11012. #region 转换实体
  11013. //for (int i = 0; i < TableProductionData.Rows.Count; i++)
  11014. //{
  11015. // if (TableProductionData.Rows[i]["ReadOnly"].ToString() == "1") //只读数据不进行保存
  11016. // {
  11017. // continue;
  11018. // }
  11019. // ProductionDataEntity productionDataEntity = new ProductionDataEntity();
  11020. // if (TableProductionData.Rows[i]["ProductionDataID"].ToString() != "")
  11021. // {
  11022. // productionDataEntity.ProductionDataID = Convert.ToInt32(TableProductionData.Rows[i]["ProductionDataID"]);
  11023. // }
  11024. // productionDataEntity.Barcode = TableProductionData.Rows[i]["BarCode"].ToString();
  11025. // productionDataEntity.UserID = sUserInfo.UserID;
  11026. // productionDataEntity.UserCode = sUserInfo.UserCode;
  11027. // productionDataEntity.UserName = sUserInfo.UserName; ;
  11028. // productionDataEntity.DefectFlag = Convert.ToInt32(TableProductionData.Rows[i]["GoodsLevelTypeID"]) == 4 ? 1 : 2;
  11029. // productionDataEntity.GoodsLevelID = Convert.ToInt32(TableProductionData.Rows[i]["DefectFlagID"]);
  11030. // productionDataEntity.GoodsLevelTypeID = Convert.ToInt32(TableProductionData.Rows[i]["GoodsLevelTypeID"]);
  11031. // productionDataEntity.Remarks = TableProductionData.Rows[i]["Remarks"].ToString();
  11032. // if (TableProductionData.Rows[i]["LogoID"].ToString() != "")
  11033. // {
  11034. // productionDataEntity.LogoID = Convert.ToInt32(TableProductionData.Rows[i]["LogoID"]);
  11035. // }
  11036. // if (TableProductionData.Rows[i]["OPTimeStamp"].ToString() != "")
  11037. // {
  11038. // productionDataEntity.OPTimeStamp = Convert.ToDateTime(TableProductionData.Rows[i]["OPTimeStamp"]);
  11039. // }
  11040. // if (TableProductionData.Rows[i]["CheckTime"].ToString() != "")
  11041. // {
  11042. // productionDataEntity.CheckTime = Convert.ToDateTime(TableProductionData.Rows[i]["CheckTime"]);
  11043. // }
  11044. // if (TableProductionData.Rows[i]["OrgGoodsLevelTypeID"].ToString() != "-1")
  11045. // {
  11046. // productionDataEntity.OrgGoodsLevelTypeID = Convert.ToInt32(TableProductionData.Rows[i]["OrgGoodsLevelTypeID"]);
  11047. // }
  11048. // if (!string.IsNullOrEmpty(TableProductionData.Rows[i]["ReworkProcedureID"].ToString()))
  11049. // {
  11050. // productionDataEntity.ReworkProcedureID = int.Parse(TableProductionData.Rows[i]["ReworkProcedureID"].ToString());
  11051. // productionDataEntity.IsReworked = 1;
  11052. // }
  11053. // productionDataEntitys[i] = productionDataEntity;
  11054. // List<ProductionDefectEntity> productionDefectEntitys = new List<ProductionDefectEntity>();
  11055. // ProductionDefectEntity productionDefectEntity = null;
  11056. // for (int j = 0; j < productionDefectTable.Rows.Count; j++) //缺陷列表
  11057. // {
  11058. // productionDefectEntity = new ProductionDefectEntity();
  11059. // productionDefectEntity.SpecialDefect = productionDefectTable.Rows[j]["IsOtherDefect"].ToString();
  11060. // //if (productionDefectTable.Rows[j]["DefectDeductionID"].ToString() != "-1"
  11061. // // && productionDefectTable.Rows[j]["DefectDeductionID"].ToString() != string.Empty)
  11062. // //{
  11063. // // productionDefectEntity.DefectDeductionNum = Convert.ToDecimal(productionDefectTable.Rows[j]["DefectDeductionNum"]);
  11064. // //}
  11065. // if (!string.IsNullOrEmpty(productionDefectTable.Rows[j]["DefectDeductionNum"] + ""))
  11066. // {
  11067. // productionDefectEntity.DefectDeductionNum = Convert.ToDecimal(productionDefectTable.Rows[j]["DefectDeductionNum"]);
  11068. // }
  11069. // productionDefectEntity.ScrapResponFlag = "0";
  11070. // productionDefectEntity.DefectID =
  11071. // Convert.ToInt32(productionDefectTable.Rows[j]["DefectID"]);
  11072. // productionDefectEntity.DefectCode =
  11073. // productionDefectTable.Rows[j]["DefectCode"].ToString();
  11074. // productionDefectEntity.DefectName =
  11075. // productionDefectTable.Rows[j]["DefectName"].ToString().Replace(productionDefectEntity.DefectCode + "->", "");
  11076. // productionDefectEntity.DefectPositionID =
  11077. // Convert.ToInt32(productionDefectTable.Rows[j]["DefectPositionID"]);
  11078. // productionDefectEntity.DefectPositionCode =
  11079. // productionDefectTable.Rows[j]["DefectPositionCode"].ToString();
  11080. // productionDefectEntity.DefectPositionName =
  11081. // productionDefectTable.Rows[j]["DefectPositionName"].ToString().Replace(productionDefectEntity.DefectPositionCode + "->", "");
  11082. // productionDefectEntity.DefectProductionDataID =
  11083. // Convert.ToInt32(productionDefectTable.Rows[j]["ProductionDataID"] + "");
  11084. // if (productionDefectEntity.DefectProductionDataID == 0)
  11085. // {
  11086. // productionDefectEntity.DefectProductionDataID = null;
  11087. // }
  11088. // if (productionDefectTable.Rows[j]["DefectProcedureID"].ToString() != string.Empty &&
  11089. // Convert.ToInt32(productionDefectTable.Rows[j]["DefectProcedureID"] + "") > Constant.INT_IS_ZERO)
  11090. // {
  11091. // productionDefectEntity.DefectProcedureID =
  11092. // Convert.ToInt32(productionDefectTable.Rows[j]["DefectProcedureID"]);
  11093. // }
  11094. // productionDefectEntity.DefectProcedureCode =
  11095. // productionDefectTable.Rows[j]["DefectProcedureCode"].ToString();
  11096. // productionDefectEntity.DefectProcedureName =
  11097. // productionDefectTable.Rows[j]["DefectProcedureName"].ToString();
  11098. // productionDefectEntity.DefectUserID =
  11099. // Convert.ToInt32(productionDefectTable.Rows[j]["DefectUserID"]);
  11100. // productionDefectEntity.DefectUserCode =
  11101. // productionDefectTable.Rows[j]["DefectUserCode"].ToString();
  11102. // productionDefectEntity.DefectUserName =
  11103. // productionDefectTable.Rows[j]["DefectUserName"].ToString();
  11104. // productionDefectEntity.DefectJobs =
  11105. // Convert.ToInt32(productionDefectTable.Rows[j]["Jobs"].ToString());
  11106. // productionDefectEntity.Remarks =
  11107. // productionDefectTable.Rows[j]["DefectRemarks"].ToString();
  11108. // productionDefectEntity.Remarks =
  11109. // productionDefectTable.Rows[j]["DefectRemarks"].ToString();
  11110. // if (productionDefectTable.Rows[j]["DefectFineID"].ToString() != "-1"
  11111. // && productionDefectTable.Rows[j]["DefectFineID"].ToString() != string.Empty)
  11112. // {
  11113. // productionDefectEntity.DefectFine = Convert.ToInt32(productionDefectTable.Rows[j]["DefectFineID"]);
  11114. // }
  11115. // if (productionDefectTable.Rows[j]["CheckTime"].ToString() != string.Empty)
  11116. // {
  11117. // //if (Convert.ToInt32(this.TableProductionData.Rows[i]["OrgGoodsLevelTypeID"]) == Convert.ToInt32(this.TableProductionData.Rows[i]["GoodsLevelTypeID"]))
  11118. // //{
  11119. // productionDefectEntity.CheckTime = Convert.ToDateTime(productionDefectTable.Rows[j]["CheckTime"]);
  11120. // //}
  11121. // }
  11122. // if (productionDefectTable.Rows[j]["MissedUserID"].ToString() != "-1"
  11123. // && productionDefectTable.Rows[j]["MissedUserID"].ToString() != string.Empty)
  11124. // {
  11125. // productionDefectEntity.MissedUserID = Convert.ToInt32(productionDefectTable.Rows[j]["MissedUserID"]);
  11126. // productionDefectEntity.MissedUserCode = productionDefectTable.Rows[j]["MissedUserCode"].ToString();
  11127. // productionDefectEntity.MissedUserName = productionDefectTable.Rows[j]["MissedUserName"].ToString();
  11128. // }
  11129. // // 遍历责任员工
  11130. // List<DefectResponsibleEntity> DefectResponsibles = new List<DefectResponsibleEntity>();
  11131. // if (DSTableStaff != null && DSTableStaff.Rows.Count > 0)
  11132. // {
  11133. // DefectResponsibleEntity defectResponsibleEntity = null;
  11134. // foreach (DataRow drStaff in DSTableStaff.Rows)
  11135. // {
  11136. // if (Convert.ToInt32(drStaff["IsSelected"]) == Constant.INT_IS_ONE)
  11137. // {
  11138. // defectResponsibleEntity = new DefectResponsibleEntity();
  11139. // defectResponsibleEntity.StaffID = Convert.ToInt32(drStaff["StaffID"]);
  11140. // defectResponsibleEntity.UserID = Convert.ToInt32(productionDefectEntity.DefectUserID);
  11141. // defectResponsibleEntity.UserCode = productionDefectEntity.DefectUserCode;
  11142. // defectResponsibleEntity.UJobsID =
  11143. // Convert.ToInt32(productionDefectTable.Rows[j]["Jobs"].ToString());
  11144. // defectResponsibleEntity.SJobsID =
  11145. // Convert.ToInt32(productionDefectTable.Rows[j]["Jobs"].ToString());
  11146. // defectResponsibleEntity.StaffStatus = Convert.ToInt32(drStaff["StaffStatus"]);
  11147. // DefectResponsibles.Add(defectResponsibleEntity);
  11148. // }
  11149. // }
  11150. // //productionDefectEntity.DefectResponsibles = DefectResponsibles.ToArray();//每个缺陷对应的责任员工
  11151. // productionDefectEntity.DefectResponsibles = DefectResponsibles;//每个缺陷对应的责任员工
  11152. // }
  11153. // // 遍历漏检责任员工
  11154. // List<DefectMissedResponsibleEntity> DefectMissedResponsibles = new List<DefectMissedResponsibleEntity>();
  11155. // if (DSTableMissedStaff != null && DSTableMissedStaff.Rows.Count > 0)
  11156. // {
  11157. // DefectMissedResponsibleEntity defectMissedResponsibleEntity = null;
  11158. // foreach (DataRow drStaff in DSTableMissedStaff.Rows)
  11159. // {
  11160. // if (Convert.ToInt32(drStaff["IsSelected"]) == Constant.INT_IS_ONE)
  11161. // {
  11162. // defectMissedResponsibleEntity = new DefectMissedResponsibleEntity();
  11163. // defectMissedResponsibleEntity.StaffID = Convert.ToInt32(drStaff["StaffID"]);
  11164. // defectMissedResponsibleEntity.UserID = Convert.ToInt32(productionDefectEntity.DefectUserID);
  11165. // defectMissedResponsibleEntity.UserCode = productionDefectEntity.DefectUserCode;
  11166. // defectMissedResponsibleEntity.UJobsID = Convert.ToInt32(drStaff["UJobsID"]);
  11167. // defectMissedResponsibleEntity.SJobsID = Convert.ToInt32(drStaff["SJobsID"]);
  11168. // defectMissedResponsibleEntity.StaffStatus = Convert.ToInt32(drStaff["StaffStatus"]);
  11169. // DefectMissedResponsibles.Add(defectMissedResponsibleEntity);
  11170. // }
  11171. // }
  11172. // //productionDefectEntity.DefectMissedResponsibles = DefectMissedResponsibles.ToArray();
  11173. // productionDefectEntity.DefectMissedResponsibles = DefectMissedResponsibles;
  11174. // }
  11175. // // 遍历缺陷图片
  11176. // if (DSTableImage != null && DSTableImage.Rows.Count > 0)
  11177. // {
  11178. // List<DefectImageEntity> defectImageEntitys = new List<DefectImageEntity>();
  11179. // DefectImageEntity defectImageEntity = null;
  11180. // foreach (DataRow drImage in DSTableImage.Rows)
  11181. // {
  11182. // defectImageEntity = new DefectImageEntity();
  11183. // defectImageEntity.Thumbnail = (byte[])drImage["ImageByte"];
  11184. // defectImageEntity.Image = (byte[])drImage["orgImageByte"];
  11185. // defectImageEntitys.Add(defectImageEntity);
  11186. // }
  11187. // productionDefectEntity.DefectImages = defectImageEntitys;
  11188. // }
  11189. // productionDefectEntitys.Add(productionDefectEntity);
  11190. // }
  11191. // productionDataEntitys[i].ProductionDefects = productionDefectEntitys;
  11192. // }
  11193. #endregion
  11194. ProductionDataEntity[] productionDataEntitys = JsonHelper.FromJson<ProductionDataEntity[]>(data["productionDataEntitys"] + "");
  11195. DataTable bomDetailTable = new DataTable();
  11196. if (data["bomDetailTable"] != null)
  11197. {
  11198. bomDetailTable = JsonHelper.FromJson<DataTable>(data["bomDetailTable"] + "");
  11199. }
  11200. ServiceResultEntity sre = Service.PCModuleService.FinishedCheckLogic.AddCheckBarcode(procedureID, productionDataEntitys, bomDetailTable, sUserInfo);
  11201. if (Convert.ToInt32(sre.Result) > 0)
  11202. {
  11203. actionResult.Status = (int)Constant.PDAResult.Success;
  11204. actionResult.Message = "保存成功";
  11205. }
  11206. else
  11207. {
  11208. actionResult.Status = (int)Constant.PDAResult.Fail;
  11209. actionResult.Message = sre.Message;
  11210. }
  11211. return actionResult;
  11212. }
  11213. //撤销
  11214. if (action == "FinishedCancleData")
  11215. {
  11216. int productionDataID = Convert.ToInt32(data["productionDataID"]);
  11217. ServiceResultEntity sre = Service.PCModuleService.FinishedCheckLogic.FinishedCancleData(productionDataID, sUserInfo);
  11218. if (Convert.ToInt32(sre.OtherStatus) > 0)
  11219. {
  11220. actionResult.Status = (int)Constant.PDAResult.Success;
  11221. actionResult.Message = "撤销成功";
  11222. }
  11223. else
  11224. {
  11225. actionResult.Status = (int)Constant.PDAResult.Fail;
  11226. actionResult.Message = sre.Message;
  11227. }
  11228. return actionResult;
  11229. }
  11230. //查询用户
  11231. if (action == "CheckProcedureUser")
  11232. {
  11233. string userCode1 = data["UserCode"] + "";
  11234. ServiceResultEntity sre = Service.PCModuleService.FinishedCheckLogic.CheckProcedureUser(userCode1, sUserInfo);
  11235. if (Convert.ToInt32(sre.Result) < 0)
  11236. {
  11237. actionResult.Status = (int)Constant.PDAResult.Fail;
  11238. actionResult.Result = sre.OtherStatus;
  11239. actionResult.Message = sre.Message;
  11240. }
  11241. else
  11242. {
  11243. actionResult.Result = JsonHelper.ToJson(sre.Data);
  11244. actionResult.Status = (int)Constant.PDAResult.Success;
  11245. actionResult.Message = sre.Message;
  11246. }
  11247. return actionResult;
  11248. }
  11249. }
  11250. #endregion
  11251. #region BPM同步日志 add xiacm 2022-11-17
  11252. else if (module == "BARCODEIDNRKSCRAP")
  11253. {
  11254. if (action == "GetBarcodeIdnrkScrap")
  11255. {
  11256. //组件唯一编码
  11257. string IdnrkOnlyCode = data["IdnrkOnlyCode"].ToString();
  11258. // 确认日期
  11259. DateTime createTime = DateTime.Now.Date;
  11260. if (data.ContainsKey("CreateTime") && !string.IsNullOrEmpty(data["CreateTime"] + ""))
  11261. {
  11262. createTime = Convert.ToDateTime(data["CreateTime"].ToString());
  11263. }
  11264. // 确认标识(1:确认;2:撤销)
  11265. string confirmFlag = data["ConfirmFlag"].ToString();
  11266. string message = string.Empty;
  11267. DataSet IdnrkOnlyCodeDs = ServiceInvoker.Invoke(this,
  11268. () => PMModuleLogic.GetIdnrkOnlyCode(IdnrkOnlyCode, createTime, confirmFlag, sUserInfo, out message));
  11269. if (IdnrkOnlyCodeDs != null)
  11270. {
  11271. if (string.IsNullOrEmpty(message))
  11272. {
  11273. actionResult.Status = (int)Constant.PDAResult.Success;
  11274. actionResult.Result = JsonHelper.ToJson(IdnrkOnlyCodeDs);
  11275. }
  11276. else
  11277. {
  11278. actionResult.Status = (int)Constant.PDAResult.Fail;
  11279. actionResult.Message = message;
  11280. }
  11281. }
  11282. else
  11283. {
  11284. actionResult.Status = (int)Constant.PDAResult.Fail;
  11285. actionResult.Message = message;
  11286. }
  11287. return actionResult;
  11288. }
  11289. if (action == "ConfirmBarcodeIdnrkScrap")
  11290. {
  11291. ClientRequestEntity cre = new ClientRequestEntity();
  11292. DataTable dtBarcodeIdnrkScrap = JsonHelper.FromJson<DataTable>(data["Table1"] + "");
  11293. DateTime createTime = DateTime.Now.Date;
  11294. if (data.ContainsKey("CreateTime") && !string.IsNullOrEmpty(data["CreateTime"] + ""))
  11295. {
  11296. createTime = Convert.ToDateTime(data["CreateTime"].ToString());
  11297. }
  11298. cre.Data = new DataSet();
  11299. cre.Data.Tables.Add(dtBarcodeIdnrkScrap);
  11300. // 确认日期
  11301. cre.Properties["CreateTime"] = createTime;
  11302. // 确认标识(1:确认;2:撤销)
  11303. cre.Properties["ConfirmFlag"] = data["ConfirmFlag"].ToString();
  11304. if (dtBarcodeIdnrkScrap != null && dtBarcodeIdnrkScrap.Rows.Count > 0)
  11305. {
  11306. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  11307. () => PMModuleLogic.ConfirmBarcodeIdnrkScrap(cre, sUserInfo));
  11308. if (Convert.ToInt32(sre.Result) <= 0)
  11309. {
  11310. actionResult.Status = (int)Constant.PDAResult.Fail;
  11311. actionResult.Message = sre.Message;
  11312. }
  11313. else
  11314. {
  11315. actionResult.Status = (int)Constant.PDAResult.Success;
  11316. actionResult.Message = "保存成功";
  11317. }
  11318. }
  11319. else
  11320. {
  11321. actionResult.Status = (int)Constant.PDAResult.Fail;
  11322. }
  11323. return actionResult;
  11324. }
  11325. }
  11326. #endregion
  11327. #region 次品扫描功能 20230406 by qq
  11328. if (module == "Recycling")
  11329. {
  11330. //扫码查询
  11331. if (action == "RecyclingAddBarcode")
  11332. {
  11333. string barcode = data["barcode"] + "";
  11334. string type = data["type"] + "";
  11335. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  11336. () => PMModuleLogic.RecyclingAddBarcode(barcode, type, sUserInfo));
  11337. if (Convert.ToInt32(sre.Result) <= 0)
  11338. {
  11339. actionResult.Status = (int)Constant.PDAResult.Fail;
  11340. actionResult.Message = sre.Message;
  11341. }
  11342. else
  11343. {
  11344. actionResult.Status = (int)Constant.PDAResult.Success;
  11345. actionResult.Message = "保存成功";
  11346. }
  11347. return actionResult;
  11348. }
  11349. }
  11350. #endregion
  11351. #region 裸瓷包装状态撤销(非工序) by qq
  11352. if (module == "LuociRevoke")
  11353. {
  11354. //扫码查询
  11355. if (action == "CheckLuoci")
  11356. {
  11357. string barcode = data["barcode"] + "";
  11358. int procedureID = 159;
  11359. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  11360. () => PMModuleLogic.CheckLuoci(procedureID, barcode, sUserInfo));
  11361. if (sre.OtherStatus < 0)
  11362. {
  11363. actionResult.Status = (int)Constant.PDAResult.Fail;
  11364. actionResult.Message = sre.Message;
  11365. }
  11366. else
  11367. {
  11368. actionResult.Status = (int)Constant.PDAResult.Success;
  11369. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  11370. }
  11371. return actionResult;
  11372. }
  11373. //撤销保存
  11374. else if (action == "AddChancelLuoci")
  11375. {
  11376. DataTable detailTable = new DataTable();
  11377. if (data["detailTable"] != null)
  11378. {
  11379. detailTable = JsonHelper.FromJson<DataTable>(data["detailTable"] + "");
  11380. }
  11381. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  11382. () => PMModuleLogic.AddChancelLuoci(detailTable, sUserInfo));
  11383. if (Convert.ToInt32(sre.Result) < 0)
  11384. {
  11385. actionResult.Status = (int)Constant.PDAResult.Fail;
  11386. actionResult.Message = sre.Message;
  11387. }
  11388. else
  11389. {
  11390. actionResult.Status = (int)Constant.PDAResult.Success;
  11391. }
  11392. return actionResult;
  11393. }
  11394. }
  11395. #endregion
  11396. return actionResult;
  11397. }
  11398. catch (Exception ex)
  11399. {
  11400. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  11401. OutputLog.TraceLog(LogPriority.Error,
  11402. this.ToString(),
  11403. System.Reflection.MethodBase.GetCurrentMethod().Name + System.Environment.NewLine +
  11404. JsonHelper.ToJson(sUserInfo) + System.Environment.NewLine +
  11405. " module:" + module + " action:" + action + " json:" + jsonData,
  11406. ex.ToString(),
  11407. LocalPath.LogExePath);
  11408. actionResult.Status = (int)Constant.PDAResult.Exception;
  11409. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  11410. }
  11411. return actionResult;
  11412. }
  11413. #endregion
  11414. #region 发货单一览
  11415. /// <summary>
  11416. /// 发货单信息查询
  11417. /// </summary>
  11418. /// <param name="accountCode"></param>
  11419. /// <param name="userCode"></param>
  11420. /// <param name="userPassword"></param>
  11421. /// <param name="sessionKey"></param>
  11422. /// <param name="ementy"></param>
  11423. /// <returns></returns>
  11424. public ActionResult SelectDeliveryNoteInquiry(string accountCode, string userCode, string userPassword, string sessionKey, DeliveryNoteInquiry ementy)
  11425. {
  11426. ActionResult actionResult = new ActionResult();
  11427. try
  11428. {
  11429. // 验证请求头信息
  11430. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  11431. // 验证失败
  11432. if (actionResult.Status != (int)Constant.PDAResult.Success)
  11433. {
  11434. return actionResult;
  11435. }
  11436. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  11437. () => PDAModuleLogic.GetDetails(ementy));
  11438. if (resultEntity.OtherStatus == -1)
  11439. {
  11440. actionResult.Status = (int)Constant.PDAResult.Fail;
  11441. }
  11442. else
  11443. {
  11444. actionResult.Result = JsonHelper.ToJson(resultEntity.Data.Tables[0]);
  11445. actionResult.Status = (int)Constant.PDAResult.Success;
  11446. }
  11447. actionResult.Message = resultEntity.Message;
  11448. }
  11449. catch (Exception ex)
  11450. {
  11451. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  11452. OutputLog.TraceLog(LogPriority.Error,
  11453. this.ToString(),
  11454. System.Reflection.MethodBase.GetCurrentMethod().Name,
  11455. ex.ToString(),
  11456. LocalPath.LogExePath);
  11457. actionResult.Status = (int)Constant.PDAResult.Exception;
  11458. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  11459. }
  11460. return actionResult;
  11461. }
  11462. /// <summary>
  11463. /// 查询发出仓库,接收仓库,车牌号
  11464. /// </summary>
  11465. /// <param name="type"></param>
  11466. /// <returns></returns>
  11467. public ActionResult SelectCARPLATENAMES(string type)
  11468. {
  11469. ActionResult actionResult = new ActionResult();
  11470. try
  11471. {
  11472. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  11473. () => PDAModuleLogic.GetDATA(type));
  11474. actionResult.Result = JsonHelper.ToJson(resultEntity.Data.Tables[0]);
  11475. if (resultEntity.Data.Tables[0].Rows.Count == 0)
  11476. {
  11477. actionResult.Status = (int)Constant.PDAResult.Fail;
  11478. }
  11479. else
  11480. {
  11481. actionResult.Status = (int)Constant.PDAResult.Success;
  11482. }
  11483. actionResult.Message = resultEntity.Message;
  11484. }
  11485. catch (Exception ex)
  11486. {
  11487. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  11488. OutputLog.TraceLog(LogPriority.Error,
  11489. this.ToString(),
  11490. System.Reflection.MethodBase.GetCurrentMethod().Name,
  11491. ex.ToString(),
  11492. LocalPath.LogExePath);
  11493. actionResult.Status = (int)Constant.PDAResult.Exception;
  11494. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  11495. }
  11496. return actionResult;
  11497. }
  11498. /// <summary>
  11499. /// 刪除订单
  11500. /// </summary>
  11501. /// <param name="accountCode"></param>
  11502. /// <param name="userCode"></param>
  11503. /// <param name="userPassword"></param>
  11504. /// <param name="sessionKey"></param>
  11505. /// <param name="ementy"></param>
  11506. /// <returns></returns>
  11507. public ActionResult DestroyInvoice(string accountCode, string userCode, string userPassword, string sessionKey, string ementy)
  11508. {
  11509. ActionResult actionResult = new ActionResult();
  11510. try
  11511. {
  11512. // 验证请求头信息
  11513. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  11514. // 验证失败
  11515. if (actionResult.Status != (int)Constant.PDAResult.Success)
  11516. {
  11517. return actionResult;
  11518. }
  11519. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  11520. () => PDAModuleLogic.DestroyInvoice(ementy, userCode, userPassword));
  11521. actionResult.Result = JsonHelper.ToJson(resultEntity.Result);
  11522. actionResult.Status = (int)Constant.PDAResult.Success;
  11523. actionResult.Message = resultEntity.Message;
  11524. }
  11525. catch (Exception ex)
  11526. {
  11527. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  11528. OutputLog.TraceLog(LogPriority.Error,
  11529. this.ToString(),
  11530. System.Reflection.MethodBase.GetCurrentMethod().Name,
  11531. ex.ToString(),
  11532. LocalPath.LogExePath);
  11533. actionResult.Status = (int)Constant.PDAResult.Exception;
  11534. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  11535. }
  11536. return actionResult;
  11537. }
  11538. /// <summary>
  11539. /// 撤销订单
  11540. /// </summary>
  11541. /// <param name="accountCode"></param>
  11542. /// <param name="userCode"></param>
  11543. /// <param name="userPassword"></param>
  11544. /// <param name="sessionKey"></param>
  11545. /// <param name="ementy"></param>
  11546. /// <returns></returns>
  11547. public ActionResult RevokeInvoice(string accountCode, string userCode, string userPassword, string sessionKey, string ementy)
  11548. {
  11549. ActionResult actionResult = new ActionResult();
  11550. try
  11551. {
  11552. // 验证请求头信息
  11553. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  11554. // 验证失败
  11555. if (actionResult.Status != (int)Constant.PDAResult.Success)
  11556. {
  11557. return actionResult;
  11558. }
  11559. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  11560. () => PDAModuleLogic.RevokeInvoice(ementy, userCode, userPassword));
  11561. if (resultEntity.OtherStatus == -1)
  11562. {
  11563. actionResult.Status = (int)Constant.PDAResult.Fail;
  11564. }
  11565. else
  11566. {
  11567. actionResult.Result = JsonHelper.ToJson(resultEntity.Result);
  11568. actionResult.Status = (int)Constant.PDAResult.Success;
  11569. }
  11570. actionResult.Message = resultEntity.Message;
  11571. }
  11572. catch (Exception ex)
  11573. {
  11574. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  11575. OutputLog.TraceLog(LogPriority.Error,
  11576. this.ToString(),
  11577. System.Reflection.MethodBase.GetCurrentMethod().Name,
  11578. ex.ToString(),
  11579. LocalPath.LogExePath);
  11580. actionResult.Status = (int)Constant.PDAResult.Exception;
  11581. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  11582. }
  11583. return actionResult;
  11584. }
  11585. #endregion
  11586. }
  11587. }