PDAModuleService.cs 406 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413
  1. /*******************************************************************************
  2. * Copyright(c) 2014 DongkeSoft All rights reserved. / Confidential
  3. * 类的信息:
  4. * 1.程序名称:PDAModuleService.cs
  5. * 2.功能描述:PDA模块WCF服务
  6. * 编辑履历:
  7. * 作者 日期 版本 修改内容
  8. * 陈晓野 2014/09/16 1.00 新建
  9. *******************************************************************************/
  10. using System;
  11. using System.Collections.Generic;
  12. using System.Data;
  13. using System.IO;
  14. using System.ServiceModel;
  15. using System.ServiceModel.Activation;
  16. using Curtain.Log;
  17. using Dongke.IBOSS.PRD.Basics.BaseResources;
  18. using Dongke.IBOSS.PRD.Basics.Library;
  19. using Dongke.IBOSS.PRD.Service.BarcodePrintService;
  20. using Dongke.IBOSS.PRD.Service.CommonModuleLogic;
  21. using Dongke.IBOSS.PRD.Service.DataModels;
  22. using Dongke.IBOSS.PRD.Service.DKIBOSSPRDLogic;
  23. using Dongke.IBOSS.PRD.Service.PCModuleLogic;
  24. using Dongke.IBOSS.PRD.Service.PDAModuleLogic;
  25. using Dongke.IBOSS.PRD.Service.PMModuleLogic;
  26. using Dongke.IBOSS.PRD.Service.PublicModuleService;
  27. using Dongke.IBOSS.PRD.Service.ReportModuleLogic;
  28. using Dongke.IBOSS.PRD.Service.SmartDeviceService;
  29. using Dongke.IBOSS.PRD.Service.SystemModuleLogic;
  30. using Dongke.IBOSS.PRD.WCF.Contracts;
  31. using Dongke.IBOSS.PRD.WCF.DataModels;
  32. using Dongke.IBOSS.PRD.WCF.DataModels.ConfigModule;
  33. using Dongke.IBOSS.PRD.WCF.DataModels.HRModule;
  34. using Dongke.IBOSS.PRD.WCF.DataModels.PCModule;
  35. using Dongke.IBOSS.PRD.WCF.DataModels.PMModule;
  36. namespace Dongke.IBOSS.PRD.WCF.Services
  37. {
  38. // 服务实现类,继承服务声明接口
  39. // 该标签声明该服务可以在ASP.NET下运行
  40. [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
  41. [ServiceBehavior(ConfigurationName = "PDAModuleService",
  42. InstanceContextMode = InstanceContextMode.PerCall,
  43. ConcurrencyMode = ConcurrencyMode.Multiple,
  44. UseSynchronizationContext = false)]
  45. public partial class PDAModuleService : IPDAModule
  46. {
  47. #region 属性
  48. /// <summary>
  49. /// 用户登陆的信息
  50. /// </summary>
  51. SUserInfo sUserInfo
  52. {
  53. get;
  54. set;
  55. }
  56. #endregion
  57. #region 构造函数
  58. /// <summary>
  59. /// 构造函数
  60. /// </summary>
  61. public PDAModuleService()
  62. : base()
  63. {
  64. }
  65. #endregion
  66. #region 验证
  67. /// <summary>
  68. /// 验证访问头
  69. /// </summary>
  70. /// <param name="accountCode">帐套编码</param>
  71. /// <param name="userCode">用户编码</param>
  72. /// <param name="userPassword">用户密码</param>
  73. /// <param name="sessionKey">访问密钥</param>
  74. /// <returns></returns>
  75. private ActionResult DoPDACheck(string accountCode, string userCode, string userPassword, string sessionKey)
  76. {
  77. try
  78. {
  79. ActionResult actionResult = new ActionResult();
  80. LoginRequestEntity requestEntity = new LoginRequestEntity();
  81. requestEntity.AccountCode = accountCode;
  82. requestEntity.UserCode = userCode;
  83. requestEntity.Password = userPassword;
  84. requestEntity.SessionKey = sessionKey;
  85. SUserInfo userInfo = null;
  86. string loginStatus = DKIBOSSPRDLogic.AuthenticateRepeatLogin(requestEntity, out userInfo);
  87. // 用户登录信息错误
  88. if (Constant.INT_IS_ONE.ToString().Equals(loginStatus))
  89. {
  90. actionResult.Status = (int)Constant.PDAResult.LoginInfoError;
  91. actionResult.Message = Constant.PDA_RESULT_LOGININFOERROR;
  92. }
  93. // 用户在其它终端登陆
  94. else if (Constant.INT_IS_TWO.ToString().Equals(loginStatus))
  95. {
  96. actionResult.Status = (int)Constant.PDAResult.RepeatLogin;
  97. actionResult.Message = Constant.PDA_RESULT_REPEATLOGIN;
  98. }
  99. // Lic错误
  100. else if ("3".Equals(loginStatus))
  101. {
  102. actionResult.Status = (int)Constant.PDAResult.LicInfoError;
  103. actionResult.Message = "授权信息错误,请联系管理员。";
  104. }
  105. else
  106. {
  107. actionResult.Status = (int)Constant.PDAResult.Success;
  108. }
  109. sUserInfo = userInfo;
  110. return actionResult;
  111. }
  112. catch (Exception ex)
  113. {
  114. throw ex;
  115. }
  116. }
  117. #endregion
  118. #region WCF服务
  119. /// <summary>
  120. /// 测试PDA连接WCF服务
  121. /// </summary>
  122. /// <param name="value">测试文本</param>
  123. /// <returns>返回文本</returns>
  124. public string TestConnectionEx(string value)
  125. {
  126. return "连接成功!" + value;
  127. }
  128. public string TestConnection()
  129. {
  130. return "连接成功!";
  131. }
  132. #endregion
  133. #region 系统登录
  134. /// <summary>
  135. /// 系统登录
  136. /// </summary>
  137. /// <param name="accountCode"></param>
  138. /// <param name="userCode"></param>
  139. /// <param name="userPassword"></param>
  140. /// <param name="macAddress"></param>
  141. /// <param name="ipAddress"></param>
  142. /// <param name="phoneCode"></param>
  143. /// <param name="phoneType"></param>
  144. /// <param name="appVersion"></param>
  145. /// <param name="systemType"></param>
  146. /// <param name="systemVersion"></param>
  147. /// <returns></returns>
  148. public PDALoginResult DoPDALogin(string accountCode, string userCode, string userPassword,
  149. string macAddress, string ipAddress, string phoneCode, string phoneType,
  150. string appVersion, string systemType, string systemVersion,string IMEI)
  151. {
  152. try
  153. {
  154. LoginRequestEntity requestEntity = new LoginRequestEntity();
  155. requestEntity.AccountCode = accountCode;
  156. requestEntity.UserCode = userCode;
  157. requestEntity.Password = userPassword;
  158. requestEntity.ComputerName = phoneCode;
  159. requestEntity.IPAddress = ipAddress;
  160. requestEntity.MACAddress = macAddress;
  161. requestEntity.IMEI = IMEI;
  162. PDALoginResult result = ServiceInvoker.Invoke<PDALoginResult>(this,
  163. () => PDAModuleLogic.DoPDALogin(requestEntity));
  164. return result;
  165. }
  166. catch (Exception ex)
  167. {
  168. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  169. OutputLog.TraceLog(LogPriority.Error,
  170. this.ToString(),
  171. System.Reflection.MethodBase.GetCurrentMethod().Name,
  172. ex.ToString(),
  173. LocalPath.LogExePath);
  174. PDALoginResult result = new PDALoginResult();
  175. result.Status = (int)Constant.PDAResult.Exception;
  176. result.Message = Constant.PDA_RESULT_EXCEPTION;
  177. return result;
  178. }
  179. }
  180. /// <summary>
  181. /// 退出
  182. /// </summary>
  183. /// <param name="accountCode">帐套code</param>
  184. /// <param name="userCode">用户code</param>
  185. /// <param name="userPassword">用户密码</param>
  186. /// <param name="sessionKey">本次登陆密钥</param>
  187. /// <returns></returns>
  188. public ActionResult DoPDAOut(string accountCode, string userCode, string userPassword, string sessionKey)
  189. {
  190. ActionResult actionResult = new ActionResult();
  191. try
  192. {
  193. // 验证请求头信息
  194. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  195. // 验证失败
  196. if (actionResult.Status != (int)Constant.PDAResult.Success)
  197. {
  198. return actionResult;
  199. }
  200. bool result = DKIBOSSPRDLogic.Logout(sUserInfo.UserID, "3", sUserInfo);
  201. actionResult.Result = JsonHelper.ToJson(result);
  202. actionResult.Status = (int)Constant.PDAResult.Success;
  203. }
  204. catch (Exception ex)
  205. {
  206. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  207. OutputLog.TraceLog(LogPriority.Error,
  208. this.ToString(),
  209. System.Reflection.MethodBase.GetCurrentMethod().Name,
  210. ex.ToString(),
  211. LocalPath.LogExePath);
  212. actionResult.Status = (int)Constant.PDAResult.Exception;
  213. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  214. }
  215. return actionResult;
  216. }
  217. /// <summary>
  218. /// 修改密码
  219. /// </summary>
  220. /// <param name="accountCode"></param>
  221. /// <param name="userCode"></param>
  222. /// <param name="userPassword"></param>
  223. /// <param name="sessionKey"></param>
  224. /// <returns></returns>
  225. public ActionResult ChangeUserPassword(string accountCode, string userCode, string userPassword, string sessionKey,
  226. string newPassWord)
  227. {
  228. ActionResult actionResult = new ActionResult();
  229. try
  230. {
  231. // 验证请求头信息
  232. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  233. // 验证失败
  234. if (actionResult.Status != (int)Constant.PDAResult.Success)
  235. {
  236. return actionResult;
  237. }
  238. string result = ServiceInvoker.Invoke<string>(this,
  239. () => SystemModuleDAL.SaveUserPassWord(newPassWord, userCode, null, sUserInfo));
  240. actionResult.Status = (int)Constant.PDAResult.Success;
  241. }
  242. catch (Exception ex)
  243. {
  244. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  245. OutputLog.TraceLog(LogPriority.Error,
  246. this.ToString(),
  247. System.Reflection.MethodBase.GetCurrentMethod().Name,
  248. ex.ToString(),
  249. LocalPath.LogExePath);
  250. actionResult.Status = (int)Constant.PDAResult.Exception;
  251. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  252. }
  253. return actionResult;
  254. }
  255. #endregion
  256. #region 取得展示数据
  257. /// <summary>
  258. /// 获得生产线菜单
  259. /// </summary>
  260. /// <param name="accountCode">帐套code</param>
  261. /// <param name="userCode">用户code</param>
  262. /// <param name="userPassword">用户密码</param>
  263. /// <param name="sessionKey">本次登陆密钥</param>
  264. /// <returns></returns>
  265. /// <remarks>
  266. /// 陈冰 2014.09.18 新建
  267. /// </remarks>
  268. public ActionResult GetProductionLineMenu(string accountCode, string userCode, string userPassword, string sessionKey)
  269. {
  270. ActionResult actionResult = new ActionResult();
  271. try
  272. {
  273. // 验证请求头信息
  274. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  275. // 验证失败
  276. if (actionResult.Status != (int)Constant.PDAResult.Success)
  277. {
  278. return actionResult;
  279. }
  280. // 查询菜单
  281. DataTable dtPLM = ServiceInvoker.Invoke<DataTable>(this,
  282. () => PDAModuleLogic.GetProductionLineMenu(sUserInfo));
  283. PDAFunctionResult pdaFunction = new PDAFunctionResult();
  284. pdaFunction.MenuCode = "Root";
  285. DataRow[] navigationRows = dtPLM.Select("LEN(MenuCode) = " + Constant.INT_IS_TWO.ToString(), "MenuCode ASC"); // 编号2为一级菜单
  286. foreach (DataRow newRow in navigationRows)
  287. {
  288. #region 插入子节点数据
  289. int? intProcedureID = null;
  290. int? intModelType = null;
  291. if (!string.IsNullOrEmpty(newRow["ProcedureID"].ToString()))
  292. {
  293. intProcedureID = Convert.ToInt32(newRow["ProcedureID"]);
  294. }
  295. if (!string.IsNullOrEmpty(newRow["ModelType"].ToString()))
  296. {
  297. intModelType = Convert.ToInt32(newRow["ModelType"]);
  298. }
  299. PDAFunctionResult pdaFunctionChild = new PDAFunctionResult();
  300. //xuwei add 2020-01-02
  301. pdaFunctionChild.IsGlazeChange = string.IsNullOrEmpty(newRow["IsGlazeChange"].ToString()) ? 0 : Convert.ToInt32(newRow["IsGlazeChange"].ToString());
  302. //pdaFunctionChild.IsGlazeChange = 0;
  303. pdaFunctionChild.MenuCode = newRow["MenuCode"].ToString();
  304. pdaFunctionChild.MenuName = newRow["MenuName"].ToString();
  305. pdaFunctionChild.ProcedureID = intProcedureID;
  306. pdaFunctionChild.ProcedureModel = newRow["ProcedureModel"].ToString();
  307. pdaFunctionChild.ModelType = intModelType;
  308. pdaFunction.PDAFunctions.Add(pdaFunctionChild);
  309. #endregion
  310. InitTreeView(dtPLM, newRow["MenuCode"].ToString(), pdaFunctionChild);
  311. }
  312. //actionResult.Result = JsonHelper.ToJson(dtPLM);
  313. actionResult.Result = JsonHelper.ToJson(pdaFunction);
  314. actionResult.Status = (int)Constant.PDAResult.Success;
  315. }
  316. catch (Exception ex)
  317. {
  318. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  319. OutputLog.TraceLog(LogPriority.Error,
  320. this.ToString(),
  321. System.Reflection.MethodBase.GetCurrentMethod().Name,
  322. ex.ToString(),
  323. LocalPath.LogExePath);
  324. actionResult.Status = (int)Constant.PDAResult.Exception;
  325. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  326. }
  327. return actionResult;
  328. }
  329. /// <summary>
  330. /// 初始化树形控件
  331. /// </summary>
  332. /// <param name="treeTable">菜单数据表</param>
  333. /// <param name="rows">待处理的菜单集合</param>
  334. /// <param name="node">当前树节点</param>
  335. private void InitTreeView(DataTable treeTable, string pFuncCode, PDAFunctionResult pFunctions)
  336. {
  337. string filterExpression = "MenuCode LIKE '" + pFuncCode + "%' AND LEN(MenuCode) = "
  338. + (pFuncCode.Length + Constant.INT_IS_TWO);
  339. DataRow[] subRows = treeTable.Select(filterExpression, "MenuCode ASC");
  340. //DataRow[] subRows = treeTable.Select(filterExpression, "ProcedureCode ASC");
  341. foreach (DataRow newRow in subRows)
  342. {
  343. #region 插入子节点数据
  344. int? intProcedureID = null;
  345. int? intModelType = null;
  346. if (!string.IsNullOrEmpty(newRow["ProcedureID"].ToString()))
  347. {
  348. intProcedureID = Convert.ToInt32(newRow["ProcedureID"]);
  349. }
  350. if (!string.IsNullOrEmpty(newRow["ModelType"].ToString()))
  351. {
  352. intModelType = Convert.ToInt32(newRow["ModelType"]);
  353. }
  354. PDAFunctionResult pdaFunctionChild = new PDAFunctionResult();
  355. //xuwei add 2020-01-02
  356. pdaFunctionChild.IsGlazeChange = string.IsNullOrEmpty(newRow["IsGlazeChange"].ToString()) ? 0 : Convert.ToInt32(newRow["IsGlazeChange"].ToString());
  357. //pdaFunctionChild.IsGlazeChange = 0;
  358. pdaFunctionChild.MenuCode = newRow["MenuCode"].ToString();
  359. pdaFunctionChild.MenuName = newRow["MenuName"].ToString();
  360. pdaFunctionChild.ProcedureID = intProcedureID;
  361. pdaFunctionChild.ProcedureModel = newRow["ProcedureModel"].ToString();
  362. pdaFunctionChild.ModelType = intModelType;
  363. pFunctions.PDAFunctions.Add(pdaFunctionChild);
  364. #endregion
  365. // 递归方法
  366. InitTreeView(treeTable, newRow["MenuCode"].ToString(), pdaFunctionChild);
  367. }
  368. }
  369. #endregion
  370. #region 获得工序信息
  371. /// <summary>
  372. /// 获得工序信息
  373. /// </summary>
  374. /// <param name="accountCode">帐套code</param>
  375. /// <param name="userCode">用户code</param>
  376. /// <param name="userPassword">用户密码</param>
  377. /// <param name="sessionKey">本次登陆密钥</param>
  378. /// <param name="procedureID">工序ID</param>
  379. /// <returns></returns>
  380. /// <remarks>
  381. /// 陈冰 2014.09.18 新建
  382. /// </remarks>
  383. public ActionResult GetProcedureByID(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  384. {
  385. ActionResult actionResult = new ActionResult();
  386. try
  387. {
  388. // 验证请求头信息
  389. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  390. // 验证失败
  391. if (actionResult.Status != (int)Constant.PDAResult.Success)
  392. {
  393. return actionResult;
  394. }
  395. ProcedureEntity procedureEntity = ServiceInvoker.Invoke<ProcedureEntity>(this,
  396. () => PMModuleLogic.GetProcedureDataEntityByID(procedureID, sUserInfo));
  397. actionResult.Result = JsonHelper.ToJson(procedureEntity);
  398. actionResult.Status = (int)Constant.PDAResult.Success;
  399. }
  400. catch (Exception ex)
  401. {
  402. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  403. OutputLog.TraceLog(LogPriority.Error,
  404. this.ToString(),
  405. System.Reflection.MethodBase.GetCurrentMethod().Name,
  406. ex.ToString(),
  407. LocalPath.LogExePath);
  408. actionResult.Status = (int)Constant.PDAResult.Exception;
  409. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  410. }
  411. return actionResult;
  412. }
  413. #endregion
  414. #region 校验
  415. /// <summary>
  416. /// 校验产品条码是否可以走到该工序
  417. /// </summary>
  418. /// <param name="accountCode">帐套code</param>
  419. /// <param name="userCode">用户code</param>
  420. /// <param name="userPassword">用户密码</param>
  421. /// <param name="sessionKey">本次登陆密钥</param>
  422. /// <param name="procedureID">工序ID</param>
  423. /// <param name="barcode">条码</param>
  424. /// <returns></returns>
  425. /// <remarks>
  426. /// 陈冰 2014.09.18 新建
  427. /// </remarks>
  428. public ActionResult CheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  429. {
  430. ActionResult actionResult = new ActionResult();
  431. try
  432. {
  433. // 验证请求头信息
  434. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  435. // 验证失败
  436. if (actionResult.Status != (int)Constant.PDAResult.Success)
  437. {
  438. return actionResult;
  439. }
  440. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  441. () => PMModuleLogic.CheckBarcodePDA(procedureID, barcode, sUserInfo));
  442. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  443. {
  444. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  445. actionResult.Status = (int)Constant.PDAResult.Success;
  446. }
  447. else
  448. {
  449. actionResult.Status = (int)Constant.PDAResult.Fail;
  450. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  451. }
  452. }
  453. catch (Exception ex)
  454. {
  455. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  456. OutputLog.TraceLog(LogPriority.Error,
  457. this.ToString(),
  458. System.Reflection.MethodBase.GetCurrentMethod().Name,
  459. ex.ToString(),
  460. LocalPath.LogExePath);
  461. actionResult.Status = (int)Constant.PDAResult.Exception;
  462. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  463. }
  464. return actionResult;
  465. }
  466. /// <summary>
  467. /// 校验产品条码是否可以进行干补
  468. /// </summary>
  469. /// <param name="accountCode">帐套code</param>
  470. /// <param name="userCode">用户code</param>
  471. /// <param name="userPassword">用户密码</param>
  472. /// <param name="sessionKey">本次登陆密钥</param>
  473. /// <param name="procedureID">工序ID</param>
  474. /// <param name="barcode">条码</param>
  475. /// <returns></returns>
  476. /// <remarks>
  477. /// 袁新成 2015.4.1 新建
  478. /// </remarks>
  479. public ActionResult CheckDryRepairBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  480. {
  481. ActionResult actionResult = new ActionResult();
  482. try
  483. {
  484. // 验证请求头信息
  485. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  486. // 验证失败
  487. if (actionResult.Status != (int)Constant.PDAResult.Success)
  488. {
  489. return actionResult;
  490. }
  491. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  492. () => PMModuleLogic.CheckDryRepairBarcode(procedureID, barcode, sUserInfo));
  493. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  494. {
  495. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  496. actionResult.Status = (int)Constant.PDAResult.Success;
  497. }
  498. else
  499. {
  500. actionResult.Status = (int)Constant.PDAResult.Fail;
  501. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  502. }
  503. }
  504. catch (Exception ex)
  505. {
  506. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  507. OutputLog.TraceLog(LogPriority.Error,
  508. this.ToString(),
  509. System.Reflection.MethodBase.GetCurrentMethod().Name,
  510. ex.ToString(),
  511. LocalPath.LogExePath);
  512. actionResult.Status = (int)Constant.PDAResult.Exception;
  513. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  514. }
  515. return actionResult;
  516. }
  517. /// <summary>
  518. /// 检验生产工号
  519. /// </summary>
  520. /// <param name="accountCode">帐套code</param>
  521. /// <param name="userCode">用户code</param>
  522. /// <param name="userPassword">用户密码</param>
  523. /// <param name="sessionKey">本次登陆密钥</param>
  524. /// <param name="procedureID">工序ID</param>
  525. /// <param name="procedureUserCode">生产工号</param>
  526. /// <remarks>
  527. /// 陈冰 2014.09.18 新建
  528. /// </remarks>
  529. public ActionResult CheckProcedureUser(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string procedureUserCode)
  530. {
  531. ActionResult actionResult = new ActionResult();
  532. try
  533. {
  534. // 验证请求头信息
  535. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  536. // 验证失败
  537. if (actionResult.Status != (int)Constant.PDAResult.Success)
  538. {
  539. return actionResult;
  540. }
  541. CheckProcedureUserResult checkProcedureUserResult = ServiceInvoker.Invoke<CheckProcedureUserResult>(this,
  542. () => PMModuleLogic.CheckProcedureUser(procedureID, procedureUserCode, sUserInfo));
  543. actionResult.Result = JsonHelper.ToJson(checkProcedureUserResult);
  544. actionResult.Status = (int)Constant.PDAResult.Success;
  545. }
  546. catch (Exception ex)
  547. {
  548. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  549. OutputLog.TraceLog(LogPriority.Error,
  550. this.ToString(),
  551. System.Reflection.MethodBase.GetCurrentMethod().Name,
  552. ex.ToString(),
  553. LocalPath.LogExePath);
  554. actionResult.Status = (int)Constant.PDAResult.Exception;
  555. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  556. }
  557. return actionResult;
  558. }
  559. /// <summary>
  560. /// 校验窑车是否可装车并返回窑车信息
  561. /// </summary>
  562. /// <param name="accountCode">帐套code</param>
  563. /// <param name="userCode">用户code</param>
  564. /// <param name="userPassword">用户密码</param>
  565. /// <param name="sessionKey">本次登陆密钥</param>
  566. /// <param name="kilnCarCode">窑车号</param>
  567. /// <param name="modelType">工序类别</param>
  568. /// <returns></returns>
  569. /// <remarks>
  570. /// 陈冰 2014.10.04 新建
  571. /// </remarks>
  572. public ActionResult CheckKilnCar(string accountCode, string userCode, string userPassword, string sessionKey, int pProcedureId, string kilnCarCode, int modelType)
  573. {
  574. ActionResult actionResult = new ActionResult();
  575. try
  576. {
  577. // 验证请求头信息
  578. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  579. // 验证失败
  580. if (actionResult.Status != (int)Constant.PDAResult.Success)
  581. {
  582. return actionResult;
  583. }
  584. CheckKilnCarResultEntity checkKilnCarResultEntity = ServiceInvoker.Invoke<CheckKilnCarResultEntity>(this,
  585. () => PMModuleLogic.CheckKilnCar(pProcedureId, kilnCarCode, modelType, sUserInfo));
  586. actionResult.Result = JsonHelper.ToJson(checkKilnCarResultEntity);
  587. actionResult.Status = (int)Constant.PDAResult.Success;
  588. }
  589. catch (Exception ex)
  590. {
  591. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  592. OutputLog.TraceLog(LogPriority.Error,
  593. this.ToString(),
  594. System.Reflection.MethodBase.GetCurrentMethod().Name,
  595. ex.ToString(),
  596. LocalPath.LogExePath);
  597. actionResult.Status = (int)Constant.PDAResult.Exception;
  598. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  599. }
  600. return actionResult;
  601. }
  602. #endregion
  603. #region 保存条码信息
  604. /// <summary>
  605. /// 保存条码信息
  606. /// </summary>
  607. /// <param name="accountCode">帐套code</param>
  608. /// <param name="userCode">用户code</param>
  609. /// <param name="userPassword">用户密码</param>
  610. /// <param name="sessionKey">本次登陆密钥</param>
  611. /// <param name="procedureID">工序ID</param>
  612. /// <param name="productionDataEntitys">条码信息</param>
  613. public ActionResult AddWorkPiece(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, ProductionDataEntity[] productionDataEntitys)
  614. {
  615. ActionResult actionResult = new ActionResult();
  616. try
  617. {
  618. // 验证请求头信息
  619. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  620. // 验证失败
  621. if (actionResult.Status != (int)Constant.PDAResult.Success)
  622. {
  623. return actionResult;
  624. }
  625. DataTable dtProductionData = DataConvert.ObjectConvertToTable<ProductionDataEntity>(productionDataEntitys);
  626. if (!dtProductionData.Columns.Contains("IsPDA"))
  627. {
  628. dtProductionData.Columns.Add("IsPDA");
  629. }
  630. ProcedureEntity procedureInfo = null;
  631. DataTable resultDT = ServiceInvoker.Invoke<DataTable>(this,
  632. () => PMModuleLogicDAL.AddWorkPiece(procedureID, dtProductionData, sUserInfo, out procedureInfo));
  633. actionResult.Result = JsonHelper.ToJson(resultDT);
  634. actionResult.Status = (int)Constant.PDAResult.Success;
  635. if (resultDT != null)
  636. {
  637. DataRow[] drs = resultDT.Select("out_errMsg is not null and out_errMsg <> ''");
  638. if (drs != null && drs.Length > 0)
  639. {
  640. return actionResult;
  641. }
  642. }
  643. #region PDA条码打印
  644. if (procedureInfo != null && procedureInfo.BarCodePrintCopies > 0 &&
  645. procedureInfo.ModelType == (int)Constant.ProcedureModelType.Normal)
  646. {
  647. try
  648. {
  649. if (procedureInfo.CollectType == 1)
  650. {
  651. //foreach (DataRow item in dtProductionData.Rows)
  652. //{
  653. // ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode(item["barcode"].ToString(),
  654. // procedureInfo.BarCodePrintCopies, null, sUserInfo);
  655. // if (sre.Status != Constant.ServiceResultStatus.Success)
  656. // {
  657. // actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  658. // actionResult.Message = sre.Message;
  659. // return actionResult;
  660. // }
  661. //}
  662. }
  663. else
  664. {
  665. //ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode(dtProductionData.Rows[0]["barcode"].ToString(),
  666. // procedureInfo.BarCodePrintCopies, null, sUserInfo);
  667. ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode_3C(dtProductionData.Rows[0]["barcode"].ToString(),
  668. procedureInfo.BarCodePrintCopies, null, sUserInfo, 0);
  669. if (sre.Status != Constant.ServiceResultStatus.Success)
  670. {
  671. actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  672. actionResult.Message = sre.Message;
  673. return actionResult;
  674. }
  675. }
  676. }
  677. catch (Exception ex)
  678. {
  679. OutputLog.TraceLog(LogPriority.Error,
  680. this.ToString(),
  681. System.Reflection.MethodBase.GetCurrentMethod().Name,
  682. ex.ToString(),
  683. LocalPath.LogExePath);
  684. actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  685. actionResult.Message = "条码打印异常";
  686. return actionResult;
  687. }
  688. }
  689. #endregion PDA条码打印
  690. }
  691. catch (Exception ex)
  692. {
  693. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  694. OutputLog.TraceLog(LogPriority.Error,
  695. this.ToString(),
  696. System.Reflection.MethodBase.GetCurrentMethod().Name,
  697. ex.ToString(),
  698. LocalPath.LogExePath);
  699. try
  700. {
  701. string ss = JsonHelper.ToJson(productionDataEntitys);
  702. OutputLog.TraceLog(LogPriority.Error,
  703. this.ToString(),
  704. System.Reflection.MethodBase.GetCurrentMethod().Name,
  705. $" userCode:{userCode} procedureID:{procedureID} " + ss,
  706. LocalPath.LogExePath);
  707. }
  708. catch
  709. {
  710. }
  711. actionResult.Status = (int)Constant.PDAResult.Exception;
  712. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  713. }
  714. return actionResult;
  715. }
  716. #endregion
  717. #region 获得系统/基数数据
  718. /// <summary>
  719. /// 获得数据字典
  720. /// </summary>
  721. /// <param name="accountCode">帐套code</param>
  722. /// <param name="userCode">用户code</param>
  723. /// <param name="userPassword">用户密码</param>
  724. /// <param name="sessionKey">本次登陆密钥</param>
  725. /// <param name="dicType">字典类型</param>
  726. /// <returns></returns>
  727. public ActionResult GetDataDictionaryByType(string accountCode, string userCode, string userPassword, string sessionKey, string dicType)
  728. {
  729. ActionResult actionResult = new ActionResult();
  730. try
  731. {
  732. // 验证请求头信息
  733. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  734. // 验证失败
  735. if (actionResult.Status != (int)Constant.PDAResult.Success)
  736. {
  737. return actionResult;
  738. }
  739. DataTable dicDataTable = ServiceInvoker.Invoke<DataTable>(this,
  740. () => CommonModuleLogic.GetDataDictionaryByType(sUserInfo, dicType));
  741. actionResult.Result = JsonHelper.ToJson(dicDataTable);
  742. actionResult.Status = (int)Constant.PDAResult.Success;
  743. }
  744. catch (Exception ex)
  745. {
  746. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  747. OutputLog.TraceLog(LogPriority.Error,
  748. this.ToString(),
  749. System.Reflection.MethodBase.GetCurrentMethod().Name,
  750. ex.ToString(),
  751. LocalPath.LogExePath);
  752. actionResult.Status = (int)Constant.PDAResult.Exception;
  753. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  754. }
  755. return actionResult;
  756. }
  757. #endregion
  758. #region 检验工序接口
  759. /// <summary>
  760. /// 获得检验标识
  761. /// </summary>
  762. /// <param name="accountCode">帐套code</param>
  763. /// <param name="userCode">用户code</param>
  764. /// <param name="userPassword">用户密码</param>
  765. /// <param name="sessionKey">本次登陆密钥</param>
  766. /// <returns></returns>
  767. /// <remarks>
  768. /// 陈冰 2014.10.04 新建
  769. /// </remarks>
  770. public ActionResult GetDefectFlagData(string accountCode, string userCode, string userPassword, string sessionKey)
  771. {
  772. ActionResult actionResult = new ActionResult();
  773. try
  774. {
  775. // 验证请求头信息
  776. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  777. // 验证失败
  778. if (actionResult.Status != (int)Constant.PDAResult.Success)
  779. {
  780. return actionResult;
  781. }
  782. #region 构造缺陷标识的数据源
  783. DataTable dtDefectFlag = CreateDataSource.GetDefectFlagTable();
  784. #endregion
  785. actionResult.Result = JsonHelper.ToJson(dtDefectFlag);
  786. actionResult.Status = (int)Constant.PDAResult.Success;
  787. }
  788. catch (Exception ex)
  789. {
  790. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  791. OutputLog.TraceLog(LogPriority.Error,
  792. this.ToString(),
  793. System.Reflection.MethodBase.GetCurrentMethod().Name,
  794. ex.ToString(),
  795. LocalPath.LogExePath);
  796. actionResult.Status = (int)Constant.PDAResult.Exception;
  797. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  798. }
  799. return actionResult;
  800. }
  801. /// <summary>
  802. /// 由条码和当前检验工序获取返工工序
  803. /// </summary>
  804. /// <param name="accountCode">帐套code</param>
  805. /// <param name="userCode">用户code</param>
  806. /// <param name="userPassword">用户密码</param>
  807. /// <param name="sessionKey">本次登陆密钥</param>
  808. /// <param name="procedureID">当前检验工序ID</param>
  809. /// <param name="barcode">条码</param>
  810. /// <returns></returns>
  811. /// <remarks>
  812. /// 陈冰 2014.10.04 新建
  813. /// </remarks>
  814. public ActionResult GetReworkProcedureByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  815. {
  816. ActionResult actionResult = new ActionResult();
  817. try
  818. {
  819. // 验证请求头信息
  820. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  821. // 验证失败
  822. if (actionResult.Status != (int)Constant.PDAResult.Success)
  823. {
  824. return actionResult;
  825. }
  826. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  827. () => PMModuleLogic.GetReworkProcedureByBarcode(procedureID, barcode));
  828. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  829. {
  830. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  831. actionResult.Status = (int)Constant.PDAResult.Success;
  832. }
  833. else
  834. {
  835. actionResult.Status = (int)Constant.PDAResult.Fail;
  836. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  837. }
  838. }
  839. catch (Exception ex)
  840. {
  841. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  842. OutputLog.TraceLog(LogPriority.Error,
  843. this.ToString(),
  844. System.Reflection.MethodBase.GetCurrentMethod().Name,
  845. ex.ToString(),
  846. LocalPath.LogExePath);
  847. actionResult.Status = (int)Constant.PDAResult.Exception;
  848. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  849. }
  850. return actionResult;
  851. }
  852. /// <summary>
  853. /// 由当前检验工序获取缺陷列表
  854. /// </summary>
  855. /// <param name="accountCode">帐套code</param>
  856. /// <param name="userCode">用户code</param>
  857. /// <param name="userPassword">用户密码</param>
  858. /// <param name="sessionKey">本次登陆密钥</param>
  859. /// <param name="procedureID">当前检验工序ID</param>
  860. /// <param name="defectCode">缺陷编码</param>
  861. /// <returns></returns>
  862. /// <remarks>
  863. /// 陈冰 2014.10.04 新建
  864. /// </remarks>
  865. public ActionResult GetDefectByProcedureIDAndDefectCode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string defectCode)
  866. {
  867. ActionResult actionResult = new ActionResult();
  868. try
  869. {
  870. // 验证请求头信息
  871. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  872. // 验证失败
  873. if (actionResult.Status != (int)Constant.PDAResult.Success)
  874. {
  875. return actionResult;
  876. }
  877. object defectDs = ServiceInvoker.Invoke<object>(this,
  878. () => PMModuleLogic.GetDefectByProcedureIDAndDefectCode(procedureID, defectCode));
  879. if (defectDs != null)
  880. {
  881. actionResult.Result = JsonHelper.ToJson(defectDs);
  882. actionResult.Status = (int)Constant.PDAResult.Success;
  883. }
  884. else
  885. {
  886. actionResult.Status = (int)Constant.PDAResult.Fail;
  887. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  888. }
  889. }
  890. catch (Exception ex)
  891. {
  892. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  893. OutputLog.TraceLog(LogPriority.Error,
  894. this.ToString(),
  895. System.Reflection.MethodBase.GetCurrentMethod().Name,
  896. ex.ToString(),
  897. LocalPath.LogExePath);
  898. actionResult.Status = (int)Constant.PDAResult.Exception;
  899. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  900. }
  901. return actionResult;
  902. }
  903. /// <summary>
  904. /// 根据产品ID查出缺陷位置
  905. /// </summary>
  906. /// <param name="accountCode">帐套code</param>
  907. /// <param name="userCode">用户code</param>
  908. /// <param name="userPassword">用户密码</param>
  909. /// <param name="sessionKey">本次登陆密钥</param>
  910. /// <param name="goodsID">产品ID</param>
  911. /// <param name="positionCode">位置编码</param>
  912. /// <returns></returns>
  913. /// <remarks>
  914. /// 陈冰 2014.10.04 新建
  915. /// </remarks>
  916. public ActionResult GetDefectPositionByGoodsIDAndPositionCode(string accountCode, string userCode, string userPassword, string sessionKey, int goodsID, string positionCode)
  917. {
  918. ActionResult actionResult = new ActionResult();
  919. try
  920. {
  921. // 验证请求头信息
  922. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  923. // 验证失败
  924. if (actionResult.Status != (int)Constant.PDAResult.Success)
  925. {
  926. return actionResult;
  927. }
  928. // 缺陷位置已经不用在关联产品
  929. //object defectDs = ServiceInvoker.Invoke<object>(this,() => PMModuleLogic.GetDefectPositionByGoodsIDAndPositionCode(goodsID, positionCode));
  930. object defectDs = ServiceInvoker.Invoke<object>(this, () => PMModuleLogic.GetDefectPosition(positionCode, sUserInfo));
  931. if (defectDs != null)
  932. {
  933. actionResult.Result = JsonHelper.ToJson(defectDs);
  934. actionResult.Status = (int)Constant.PDAResult.Success;
  935. }
  936. else
  937. {
  938. actionResult.Status = (int)Constant.PDAResult.Fail;
  939. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  940. }
  941. }
  942. catch (Exception ex)
  943. {
  944. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  945. OutputLog.TraceLog(LogPriority.Error,
  946. this.ToString(),
  947. System.Reflection.MethodBase.GetCurrentMethod().Name,
  948. ex.ToString(),
  949. LocalPath.LogExePath);
  950. actionResult.Status = (int)Constant.PDAResult.Exception;
  951. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  952. }
  953. return actionResult;
  954. }
  955. /// <summary>
  956. /// 通过条码和缺陷查出责任工序
  957. /// </summary>
  958. /// <param name="accountCode">帐套code</param>
  959. /// <param name="userCode">用户code</param>
  960. /// <param name="userPassword">用户密码</param>
  961. /// <param name="sessionKey">本次登陆密钥</param>
  962. /// <param name="barcode">条码</param>
  963. /// <param name="defectid">缺陷ID</param>
  964. /// <returns></returns>
  965. /// <remarks>
  966. /// 陈冰 2014.10.04 新建
  967. /// </remarks>
  968. public ActionResult GetDutyProcedureByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int defectid)
  969. {
  970. ActionResult actionResult = new ActionResult();
  971. try
  972. {
  973. // 验证请求头信息
  974. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  975. // 验证失败
  976. if (actionResult.Status != (int)Constant.PDAResult.Success)
  977. {
  978. return actionResult;
  979. }
  980. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  981. () => PMModuleLogic.GetDutyProcedureByBarCode(barcode, defectid, sUserInfo.AccountID));
  982. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  983. {
  984. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs);
  985. actionResult.Status = (int)Constant.PDAResult.Success;
  986. }
  987. else
  988. {
  989. actionResult.Status = (int)Constant.PDAResult.Fail;
  990. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  991. }
  992. }
  993. catch (Exception ex)
  994. {
  995. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  996. OutputLog.TraceLog(LogPriority.Error,
  997. this.ToString(),
  998. System.Reflection.MethodBase.GetCurrentMethod().Name,
  999. ex.ToString(),
  1000. LocalPath.LogExePath);
  1001. actionResult.Status = (int)Constant.PDAResult.Exception;
  1002. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1003. }
  1004. return actionResult;
  1005. }
  1006. /// <summary>
  1007. /// 通过条码与工序查出责任工号(己废)
  1008. /// </summary>
  1009. /// <param name="accountCode">帐套code</param>
  1010. /// <param name="userCode">用户code</param>
  1011. /// <param name="userPassword">用户密码</param>
  1012. /// <param name="sessionKey">本次登陆密钥</param>
  1013. /// <param name="barcode">条码</param>
  1014. /// <param name="dutyProcedureID">责任工序</param>
  1015. /// <returns></returns>
  1016. /// <remarks>
  1017. /// 陈冰 2014.10.04 新建
  1018. /// </remarks>
  1019. public ActionResult GetDutyProcedureCodeByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int dutyProcedureID)
  1020. {
  1021. ActionResult actionResult = new ActionResult();
  1022. try
  1023. {
  1024. // 验证请求头信息
  1025. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1026. // 验证失败
  1027. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1028. {
  1029. return actionResult;
  1030. }
  1031. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1032. () => PMModuleLogic.GetDutyProcedureCodeByBarCode(barcode, dutyProcedureID));
  1033. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1034. {
  1035. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1036. actionResult.Status = (int)Constant.PDAResult.Success;
  1037. }
  1038. else
  1039. {
  1040. actionResult.Status = (int)Constant.PDAResult.Fail;
  1041. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1042. }
  1043. }
  1044. catch (Exception ex)
  1045. {
  1046. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1047. OutputLog.TraceLog(LogPriority.Error,
  1048. this.ToString(),
  1049. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1050. ex.ToString(),
  1051. LocalPath.LogExePath);
  1052. actionResult.Status = (int)Constant.PDAResult.Exception;
  1053. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1054. }
  1055. return actionResult;
  1056. }
  1057. /// <summary>
  1058. /// 通过条码与工序查出责任工号
  1059. /// </summary>
  1060. /// <param name="accountCode"></param>
  1061. /// <param name="userCode"></param>
  1062. /// <param name="userPassword"></param>
  1063. /// <param name="sessionKey"></param>
  1064. /// <param name="ProductionDataID">生产数据ID</param>
  1065. /// <returns></returns>
  1066. public ActionResult GetDutyProcedureCodeByProductionDataID(string accountCode, string userCode, string userPassword, string sessionKey, int ProductionDataID)
  1067. {
  1068. ActionResult actionResult = new ActionResult();
  1069. try
  1070. {
  1071. // 验证请求头信息
  1072. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1073. // 验证失败
  1074. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1075. {
  1076. return actionResult;
  1077. }
  1078. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1079. () => PMModuleLogic.GetDutyProcedureCodeByProductionDataID(ProductionDataID));
  1080. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1081. {
  1082. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1083. actionResult.Status = (int)Constant.PDAResult.Success;
  1084. }
  1085. else
  1086. {
  1087. actionResult.Status = (int)Constant.PDAResult.Fail;
  1088. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1089. }
  1090. }
  1091. catch (Exception ex)
  1092. {
  1093. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1094. OutputLog.TraceLog(LogPriority.Error,
  1095. this.ToString(),
  1096. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1097. ex.ToString(),
  1098. LocalPath.LogExePath);
  1099. actionResult.Status = (int)Constant.PDAResult.Exception;
  1100. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1101. }
  1102. return actionResult;
  1103. }
  1104. /// <summary>
  1105. /// 通过生产数据与工号ID查询工种
  1106. /// </summary>
  1107. /// <param name="accountCode">帐套code</param>
  1108. /// <param name="userCode">用户code</param>
  1109. /// <param name="userPassword">用户密码</param>
  1110. /// <param name="sessionKey">本次登陆密钥</param>
  1111. /// <param name="productionDataID">生产数据ID</param>
  1112. /// <param name="userID">工号ID</param>
  1113. /// <returns></returns>
  1114. /// <remarks>
  1115. /// 陈冰 2014.10.08 新建
  1116. /// </remarks>
  1117. public ActionResult GetDutyJobsByUserIDAndProductionID(string accountCode, string userCode, string userPassword, string sessionKey,
  1118. //int productionDataID, int userID)
  1119. int classesSettingID, int defectid, int procedureID)
  1120. {
  1121. ActionResult actionResult = new ActionResult();
  1122. try
  1123. {
  1124. // 验证请求头信息
  1125. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1126. // 验证失败
  1127. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1128. {
  1129. return actionResult;
  1130. }
  1131. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1132. //() => PMModuleLogic.GetDutyJobsCodeByUser(userID, productionDataID));
  1133. () => PDAModuleLogic.GetDutyJobsCodeByUser(classesSettingID, defectid, procedureID));
  1134. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1135. {
  1136. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1137. actionResult.Status = (int)Constant.PDAResult.Success;
  1138. }
  1139. else
  1140. {
  1141. actionResult.Status = (int)Constant.PDAResult.Fail;
  1142. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1143. }
  1144. }
  1145. catch (Exception ex)
  1146. {
  1147. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1148. OutputLog.TraceLog(LogPriority.Error,
  1149. this.ToString(),
  1150. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1151. ex.ToString(),
  1152. LocalPath.LogExePath);
  1153. actionResult.Status = (int)Constant.PDAResult.Exception;
  1154. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1155. }
  1156. return actionResult;
  1157. }
  1158. /// <summary>
  1159. /// 根据生产数据ID,用户ID及工种选出责任员工
  1160. /// </summary>
  1161. /// <param name="accountCode">帐套code</param>
  1162. /// <param name="userCode">用户code</param>
  1163. /// <param name="userPassword">用户密码</param>
  1164. /// <param name="sessionKey">本次登陆密钥</param>
  1165. /// <param name="productionDataID">生产数据ID</param>
  1166. /// <param name="userID">工号ID</param>
  1167. /// <param name="jobsID">工种ID</param>
  1168. /// <returns></returns>
  1169. /// <remarks>
  1170. /// 陈冰 2014.10.08 新建
  1171. /// </remarks>
  1172. public ActionResult GetDutyStaffByUserIDAndJobs(string accountCode, string userCode, string userPassword, string sessionKey,
  1173. //int productionDataID, int userID, int jobsID)
  1174. int classesSettingID, int jobsID)
  1175. {
  1176. ActionResult actionResult = new ActionResult();
  1177. try
  1178. {
  1179. // 验证请求头信息
  1180. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1181. // 验证失败
  1182. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1183. {
  1184. return actionResult;
  1185. }
  1186. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1187. //() => PMModuleLogic.GetDutyStaffByUserIDAndJobs(productionDataID, userID, jobsID));
  1188. () => PDAModuleLogic.GetDutyStaffByUserIDAndJobs(classesSettingID, jobsID));
  1189. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1190. {
  1191. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1192. actionResult.Status = (int)Constant.PDAResult.Success;
  1193. }
  1194. else
  1195. {
  1196. actionResult.Status = (int)Constant.PDAResult.Fail;
  1197. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1198. }
  1199. }
  1200. catch (Exception ex)
  1201. {
  1202. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1203. OutputLog.TraceLog(LogPriority.Error,
  1204. this.ToString(),
  1205. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1206. ex.ToString(),
  1207. LocalPath.LogExePath);
  1208. actionResult.Status = (int)Constant.PDAResult.Exception;
  1209. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1210. }
  1211. return actionResult;
  1212. }
  1213. /// <summary>
  1214. /// 获得产品分级
  1215. /// </summary>
  1216. /// <param name="accountCode">帐套code</param>
  1217. /// <param name="userCode">用户code</param>
  1218. /// <param name="userPassword">用户密码</param>
  1219. /// <param name="sessionKey">本次登陆密钥</param>
  1220. /// <returns></returns>
  1221. /// <remarks>
  1222. /// 陈冰 2014.10.08 新建
  1223. /// xuwei 2019-12-4 添加参数type 默认为2成检 为1时 半检
  1224. /// </remarks>
  1225. public ActionResult GetGoodsGradeData(string accountCode, string userCode, string userPassword, string sessionKey, int type = 2)
  1226. {
  1227. ActionResult actionResult = new ActionResult();
  1228. try
  1229. {
  1230. // 验证请求头信息
  1231. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1232. // 验证失败
  1233. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1234. {
  1235. return actionResult;
  1236. }
  1237. #region 构造产品分级的数据源
  1238. //DataTable dtGrade = CreateDataSource.GetGoodsGradeTable();
  1239. //xuwei modify 2019-12-04 支持半检 没传参数 type=0
  1240. //DataSet dsGrade = SystemModuleLogic.GetGoodsLevel(2 , sUserInfo);
  1241. DataSet dsGrade = SystemModuleLogic.GetGoodsLevel(type == 0 ? 2 : type, sUserInfo);
  1242. if (dsGrade != null && dsGrade.Tables.Count > Constant.INT_IS_ZERO)
  1243. {
  1244. actionResult.Result = JsonHelper.ToJson(dsGrade.Tables[0]);
  1245. actionResult.Status = (int)Constant.PDAResult.Success;
  1246. }
  1247. else
  1248. {
  1249. actionResult.Status = (int)Constant.PDAResult.Fail;
  1250. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1251. }
  1252. #endregion
  1253. }
  1254. catch (Exception ex)
  1255. {
  1256. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1257. OutputLog.TraceLog(LogPriority.Error,
  1258. this.ToString(),
  1259. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1260. ex.ToString(),
  1261. LocalPath.LogExePath);
  1262. OutputLog.TraceLog(LogPriority.Error,
  1263. this.ToString(),
  1264. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1265. ex.ToString(),
  1266. LocalPath.LogExePath);
  1267. actionResult.Status = (int)Constant.PDAResult.Exception;
  1268. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1269. }
  1270. return actionResult;
  1271. }
  1272. #endregion
  1273. #region 保存检验条码
  1274. /// <summary>
  1275. /// 保存检验条码
  1276. /// </summary>
  1277. /// <param name="accountCode">帐套code</param>
  1278. /// <param name="userCode">用户code</param>
  1279. /// <param name="userPassword">用户密码</param>
  1280. /// <param name="sessionKey">本次登陆密钥</param>
  1281. /// <param name="procedureID">工序ID</param>
  1282. /// <param name="productionDataEntitys">条码信息</param>
  1283. /// <returns></returns>
  1284. public ActionResult AddCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, ProductionDataEntity[] productionDataEntitys)
  1285. {
  1286. ActionResult actionResult = new ActionResult();
  1287. try
  1288. {
  1289. // 验证请求头信息
  1290. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1291. // 验证失败
  1292. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1293. {
  1294. return actionResult;
  1295. }
  1296. //if(productionDataEntitys.Length>0)
  1297. //{
  1298. // if(productionDataEntitys[0].ProductionDataID>0)
  1299. // {
  1300. // productionDataEntitys[0].OPTimeStamp = Convert.ToDateTime(productionDataEntitys[0].OPTimeStampPDA.Replace("-","/"));
  1301. // }
  1302. //}
  1303. string err = ServiceInvoker.Invoke<string>(this,
  1304. //() => PMModuleLogicDAL.AddCheckBarcode(procedureID, productionDataEntitys, sUserInfo));
  1305. () => PMModuleLogicDAL.AddCheckBarcodePDA(procedureID, productionDataEntitys, sUserInfo));
  1306. if (err == null)
  1307. {
  1308. err = "";
  1309. }
  1310. //actionResult.Result = JsonHelper.ToJson(err);
  1311. actionResult.Result = err;// JsonHelper.ToJson(err);
  1312. actionResult.Status = (int)Constant.PDAResult.Success;
  1313. }
  1314. catch (Exception ex)
  1315. {
  1316. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1317. OutputLog.TraceLog(LogPriority.Error,
  1318. this.ToString(),
  1319. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1320. ex.ToString(),
  1321. LocalPath.LogExePath);
  1322. actionResult.Status = (int)Constant.PDAResult.Exception;
  1323. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1324. }
  1325. return actionResult;
  1326. }
  1327. #endregion
  1328. #region 文件上传下载
  1329. /// <summary>
  1330. /// 软件更新
  1331. /// </summary>
  1332. /// <param name="accountCode">帐套code</param>
  1333. /// <param name="userCode">用户code</param>
  1334. /// <param name="userPassword">用户密码</param>
  1335. /// <param name="sessionKey">本次登陆密钥</param>
  1336. /// <returns></returns>
  1337. public Stream AutoUpgrade(string accountCode, string userCode, string userPassword, string sessionKey)
  1338. {
  1339. try
  1340. {
  1341. return ServiceInvoker.Invoke<Stream>(this, () => PDAModuleLogic.AutoUpgrade());
  1342. }
  1343. catch (Exception ex)
  1344. {
  1345. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1346. OutputLog.TraceLog(LogPriority.Error,
  1347. this.ToString(),
  1348. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1349. ex.ToString(),
  1350. LocalPath.LogExePath);
  1351. return null;
  1352. }
  1353. }
  1354. /// <summary>
  1355. /// 上传临时文件
  1356. /// </summary>
  1357. /// <param name="imgStream"></param>
  1358. /// <returns></returns>
  1359. public ActionResult SaveImg(Stream mageStream)
  1360. {
  1361. ActionResult actionResult = new ActionResult();
  1362. try
  1363. {
  1364. string err = PDAModuleLogic.SaveImg(mageStream);
  1365. if (err == null)
  1366. {
  1367. err = "";
  1368. }
  1369. actionResult.Result = err;
  1370. actionResult.Status = (int)Constant.PDAResult.Success;
  1371. }
  1372. catch (Exception ex)
  1373. {
  1374. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1375. OutputLog.TraceLog(LogPriority.Error,
  1376. this.ToString(),
  1377. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1378. ex.ToString(),
  1379. LocalPath.LogExePath);
  1380. actionResult.Status = (int)Constant.PDAResult.Exception;
  1381. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1382. }
  1383. return actionResult;
  1384. }
  1385. public Stream GetFileTest(string path)
  1386. {
  1387. return PDAModuleLogic.GetImg(path);
  1388. }
  1389. public Stream GetFileStream()
  1390. {
  1391. FileStream fs = new FileStream("999.apk", FileMode.OpenOrCreate, FileAccess.Read);
  1392. long l = fs.Length;
  1393. return fs;
  1394. }
  1395. public byte[] GetFileTestByte(string path)
  1396. {
  1397. FileStream stream = new FileInfo(path).OpenRead();
  1398. Byte[] buffer = new Byte[stream.Length];
  1399. //从流中读取字节块并将该数据写入给定缓冲区buffer中
  1400. stream.Read(buffer, 0, Convert.ToInt32(stream.Length));
  1401. return buffer;
  1402. }
  1403. public string GetFile(string path)
  1404. {
  1405. string imgFilePath = path;
  1406. System.IO.FileStream fs = new System.IO.FileStream(imgFilePath, System.IO.FileMode.Open);
  1407. int i = (int)fs.Length;
  1408. byte[] content = new byte[i];
  1409. fs.Read(content, 0, i);
  1410. string result = Convert.ToBase64String(content);
  1411. fs.Close();
  1412. FileStream fsTxt = new FileStream("A.txt", FileMode.OpenOrCreate);
  1413. StreamWriter sw = new StreamWriter(fsTxt, System.Text.Encoding.Default);
  1414. sw.Write(result);
  1415. sw.Close();
  1416. fsTxt.Close();
  1417. return result;
  1418. }
  1419. #endregion
  1420. /// <summary>
  1421. /// 获得产品分级
  1422. /// </summary>
  1423. /// <param name="accountCode">帐套code</param>
  1424. /// <param name="userCode">用户code</param>
  1425. /// <param name="userPassword">用户密码</param>
  1426. /// <param name="sessionKey">本次登陆密钥</param>
  1427. /// <param name="procedureID">当前工序ID</param>
  1428. /// <returns></returns>
  1429. /// <remarks>
  1430. /// 陈冰 2014.10.22 新建
  1431. /// </remarks>
  1432. public ActionResult GetReworkProcedureByProcedureID(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  1433. {
  1434. ActionResult actionResult = new ActionResult();
  1435. try
  1436. {
  1437. // 验证请求头信息
  1438. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1439. // 验证失败
  1440. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1441. {
  1442. return actionResult;
  1443. }
  1444. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1445. () => PMModuleLogic.GetReworkProcedureByProcedureID(procedureID));
  1446. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1447. {
  1448. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1449. actionResult.Status = (int)Constant.PDAResult.Success;
  1450. }
  1451. else
  1452. {
  1453. actionResult.Status = (int)Constant.PDAResult.Fail;
  1454. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1455. }
  1456. }
  1457. catch (Exception ex)
  1458. {
  1459. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1460. OutputLog.TraceLog(LogPriority.Error,
  1461. this.ToString(),
  1462. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1463. ex.ToString(),
  1464. LocalPath.LogExePath);
  1465. actionResult.Status = (int)Constant.PDAResult.Exception;
  1466. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1467. }
  1468. return actionResult;
  1469. }
  1470. /// <summary>
  1471. /// 获得产品分级
  1472. /// </summary>
  1473. /// <param name="accountCode">帐套code</param>
  1474. /// <param name="userCode">用户code</param>
  1475. /// <param name="userPassword">用户密码</param>
  1476. /// <param name="sessionKey">本次登陆密钥</param>
  1477. /// <param name="barcode">条码</param>
  1478. /// <returns></returns>
  1479. public ActionResult GetKilnCarByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  1480. {
  1481. ActionResult actionResult = new ActionResult();
  1482. try
  1483. {
  1484. // 验证请求头信息
  1485. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1486. // 验证失败
  1487. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1488. {
  1489. return actionResult;
  1490. }
  1491. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1492. () => PMModuleLogic.GetKilnCarByBarCode(barcode));
  1493. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1494. {
  1495. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1496. actionResult.Status = (int)Constant.PDAResult.Success;
  1497. }
  1498. else
  1499. {
  1500. actionResult.Status = (int)Constant.PDAResult.Fail;
  1501. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1502. }
  1503. }
  1504. catch (Exception ex)
  1505. {
  1506. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1507. OutputLog.TraceLog(LogPriority.Error,
  1508. this.ToString(),
  1509. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1510. ex.ToString(),
  1511. LocalPath.LogExePath);
  1512. actionResult.Status = (int)Constant.PDAResult.Exception;
  1513. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1514. }
  1515. return actionResult;
  1516. }
  1517. #region 统计
  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. public ActionResult StatisticsCollectBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  1528. {
  1529. ActionResult actionResult = new ActionResult();
  1530. try
  1531. {
  1532. // 验证请求头信息
  1533. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1534. // 验证失败
  1535. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1536. {
  1537. return actionResult;
  1538. }
  1539. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1540. () => PDAModuleLogic.StatisticsCollectBarcode(procedureID, sUserInfo));
  1541. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1542. {
  1543. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1544. actionResult.Status = (int)Constant.PDAResult.Success;
  1545. }
  1546. else
  1547. {
  1548. actionResult.Status = (int)Constant.PDAResult.Fail;
  1549. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1550. }
  1551. }
  1552. catch (Exception ex)
  1553. {
  1554. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1555. OutputLog.TraceLog(LogPriority.Error,
  1556. this.ToString(),
  1557. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1558. ex.ToString(),
  1559. LocalPath.LogExePath);
  1560. actionResult.Status = (int)Constant.PDAResult.Exception;
  1561. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1562. }
  1563. return actionResult;
  1564. }
  1565. /// <summary>
  1566. /// 统计当日计数数量
  1567. /// </summary>
  1568. /// <param name="accountCode">帐套code</param>
  1569. /// <param name="userCode">用户code</param>
  1570. /// <param name="userPassword">用户密码</param>
  1571. /// <param name="sessionKey">本次登陆密钥</param>
  1572. /// <param name="procedureID">工序ID</param>
  1573. /// <returns></returns>
  1574. public ActionResult StatisticsKilnCar(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  1575. {
  1576. ActionResult actionResult = new ActionResult();
  1577. try
  1578. {
  1579. // 验证请求头信息
  1580. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1581. // 验证失败
  1582. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1583. {
  1584. return actionResult;
  1585. }
  1586. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1587. () => PDAModuleLogic.StatisticsKilnCar(procedureID, sUserInfo));
  1588. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1589. {
  1590. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1591. actionResult.Status = (int)Constant.PDAResult.Success;
  1592. }
  1593. else
  1594. {
  1595. actionResult.Status = (int)Constant.PDAResult.Fail;
  1596. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1597. }
  1598. }
  1599. catch (Exception ex)
  1600. {
  1601. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1602. OutputLog.TraceLog(LogPriority.Error,
  1603. this.ToString(),
  1604. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1605. ex.ToString(),
  1606. LocalPath.LogExePath);
  1607. actionResult.Status = (int)Constant.PDAResult.Exception;
  1608. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1609. }
  1610. return actionResult;
  1611. }
  1612. /// <summary>
  1613. /// 统计产品跟踪
  1614. /// </summary>
  1615. /// <param name="accountCode">帐套code</param>
  1616. /// <param name="userCode">用户code</param>
  1617. /// <param name="userPassword">用户密码</param>
  1618. /// <param name="sessionKey">本次登陆密钥</param>
  1619. /// <param name="procedureID">工序ID</param>
  1620. /// <returns></returns>
  1621. public ActionResult StatisticsProductTrack(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  1622. {
  1623. ActionResult actionResult = new ActionResult();
  1624. try
  1625. {
  1626. // 验证请求头信息
  1627. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1628. // 验证失败
  1629. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1630. {
  1631. return actionResult;
  1632. }
  1633. RPT020101_SE se = new RPT020101_SE();
  1634. se.Barcode = barcode;
  1635. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  1636. () => Dongke.IBOSS.PRD.Service.ReportModuleLogic.ReportModuleLogic.GetRPT020101SData(sUserInfo, se));
  1637. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  1638. {
  1639. actionResult.Status = (int)Constant.PDAResult.Fail;
  1640. actionResult.Message = Messages.MSG_CMN_I002;
  1641. }
  1642. else
  1643. {
  1644. actionResult.Result = JsonHelper.ToJson(sre.Data);
  1645. actionResult.Status = (int)Constant.PDAResult.Success;
  1646. }
  1647. //ProductionDataEntity productionDataEntity = ServiceInvoker.Invoke<ProductionDataEntity>(this,
  1648. // () => PDAModuleLogic.StatisticsProductTrack(barcode, sUserInfo));
  1649. //if (productionDataEntity != null)
  1650. //{
  1651. // actionResult.Result = JsonHelper.ToJson(productionDataEntity);
  1652. // actionResult.Status = (int)Constant.PDAResult.Success;
  1653. //}
  1654. //else
  1655. //{
  1656. // actionResult.Status = (int)Constant.PDAResult.Fail;
  1657. // actionResult.Message = Messages.MSG_CMN_I002;
  1658. //}
  1659. }
  1660. catch (Exception ex)
  1661. {
  1662. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1663. OutputLog.TraceLog(LogPriority.Error,
  1664. this.ToString(),
  1665. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1666. ex.ToString() + ex.HelpLink,
  1667. LocalPath.LogExePath);
  1668. actionResult.Status = (int)Constant.PDAResult.Exception;
  1669. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1670. }
  1671. return actionResult;
  1672. }
  1673. #endregion
  1674. #region 撤销装车及成检
  1675. /// <summary>
  1676. /// 检验条码是否可以撤销装车
  1677. /// </summary>
  1678. /// <param name="accountCode">帐套code</param>
  1679. /// <param name="userCode">用户code</param>
  1680. /// <param name="userPassword">用户密码</param>
  1681. /// <param name="sessionKey">本次登陆密钥</param>
  1682. /// <param name="procedureID">当前工序ID</param>
  1683. /// <param name="barcode">条码</param>
  1684. /// <returns></returns>
  1685. public ActionResult CheckCancelLoadCar(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  1686. {
  1687. ActionResult actionResult = new ActionResult();
  1688. try
  1689. {
  1690. // 验证请求头信息
  1691. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1692. // 验证失败
  1693. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1694. {
  1695. return actionResult;
  1696. }
  1697. CheckCancelLoadCar checkCancelLoadCar = ServiceInvoker.Invoke<CheckCancelLoadCar>(this,
  1698. () => PMModuleLogic.CheckCancelLoadCar(procedureID, barcode, sUserInfo));
  1699. actionResult.Result = JsonHelper.ToJson(checkCancelLoadCar);
  1700. actionResult.Status = (int)Constant.PDAResult.Success;
  1701. }
  1702. catch (Exception ex)
  1703. {
  1704. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1705. OutputLog.TraceLog(LogPriority.Error,
  1706. this.ToString(),
  1707. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1708. ex.ToString(),
  1709. LocalPath.LogExePath);
  1710. actionResult.Status = (int)Constant.PDAResult.Exception;
  1711. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1712. }
  1713. return actionResult;
  1714. }
  1715. /// <summary>
  1716. /// 保存撤销装车的条码
  1717. /// </summary>
  1718. /// <param name="accountCode">帐套code</param>
  1719. /// <param name="userCode">用户code</param>
  1720. /// <param name="userPassword">用户密码</param>
  1721. /// <param name="sessionKey">本次登陆密钥</param>
  1722. /// <param name="procedureID">当前工序ID</param>
  1723. /// <param name="barcode">条码</param>
  1724. /// <returns></returns>
  1725. public ActionResult AddCancelLoadCar(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  1726. {
  1727. ActionResult actionResult = new ActionResult();
  1728. try
  1729. {
  1730. // 验证请求头信息
  1731. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1732. // 验证失败
  1733. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1734. {
  1735. return actionResult;
  1736. }
  1737. string err = ServiceInvoker.Invoke<string>(this,
  1738. () => PMModuleLogicDAL.AddCancelLoadCar(procedureID, barcode, sUserInfo));
  1739. if (err == null)
  1740. {
  1741. err = "";
  1742. }
  1743. actionResult.Result = JsonHelper.ToJson(err);
  1744. actionResult.Status = (int)Constant.PDAResult.Success;
  1745. }
  1746. catch (Exception ex)
  1747. {
  1748. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1749. OutputLog.TraceLog(LogPriority.Error,
  1750. this.ToString(),
  1751. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1752. ex.ToString(),
  1753. LocalPath.LogExePath);
  1754. actionResult.Status = (int)Constant.PDAResult.Exception;
  1755. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1756. }
  1757. return actionResult;
  1758. }
  1759. /// <summary>
  1760. /// 由产品条码获取注浆信息
  1761. /// </summary>
  1762. /// <param name="barcode"></param>
  1763. /// <returns></returns>
  1764. public ActionResult GetGroutingProducttByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  1765. {
  1766. ActionResult actionResult = new ActionResult();
  1767. try
  1768. {
  1769. // 验证请求头信息
  1770. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1771. // 验证失败
  1772. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1773. {
  1774. return actionResult;
  1775. }
  1776. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1777. () => PDAModuleLogic.GetGroutingProducttByBarCode(barcode));
  1778. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1779. {
  1780. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1781. actionResult.Status = (int)Constant.PDAResult.Success;
  1782. }
  1783. else
  1784. {
  1785. actionResult.Status = (int)Constant.PDAResult.Fail;
  1786. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1787. }
  1788. }
  1789. catch (Exception ex)
  1790. {
  1791. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1792. OutputLog.TraceLog(LogPriority.Error,
  1793. this.ToString(),
  1794. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1795. ex.ToString(),
  1796. LocalPath.LogExePath);
  1797. actionResult.Status = (int)Constant.PDAResult.Exception;
  1798. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1799. }
  1800. return actionResult;
  1801. }
  1802. /// <summary>
  1803. /// 获取工号下的所有工种信息
  1804. /// </summary>
  1805. /// <param name="UserID">工号ID</param>
  1806. /// <returns></returns>
  1807. public ActionResult GetAllJobsByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int UserID)
  1808. {
  1809. ActionResult actionResult = new ActionResult();
  1810. try
  1811. {
  1812. // 验证请求头信息
  1813. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1814. // 验证失败
  1815. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1816. {
  1817. return actionResult;
  1818. }
  1819. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1820. () => PDAModuleLogic.GetAllJobsByUserID(UserID, sUserInfo));
  1821. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1822. {
  1823. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1824. actionResult.Status = (int)Constant.PDAResult.Success;
  1825. }
  1826. else
  1827. {
  1828. actionResult.Status = (int)Constant.PDAResult.Fail;
  1829. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1830. }
  1831. }
  1832. catch (Exception ex)
  1833. {
  1834. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1835. OutputLog.TraceLog(LogPriority.Error,
  1836. this.ToString(),
  1837. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1838. ex.ToString(),
  1839. LocalPath.LogExePath);
  1840. actionResult.Status = (int)Constant.PDAResult.Exception;
  1841. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1842. }
  1843. return actionResult;
  1844. }
  1845. /// <summary>
  1846. /// 根据所选工号对应的工种,查出缺陷责任员工
  1847. /// </summary>
  1848. /// <param name="jobs">工种ID</param>
  1849. /// <returns></returns>
  1850. public ActionResult GetDutyStaffByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int jobs)
  1851. {
  1852. ActionResult actionResult = new ActionResult();
  1853. try
  1854. {
  1855. // 验证请求头信息
  1856. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1857. // 验证失败
  1858. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1859. {
  1860. return actionResult;
  1861. }
  1862. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1863. () => PDAModuleLogic.GetDutyStaffByUserID(jobs, sUserInfo));
  1864. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1865. {
  1866. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1867. actionResult.Status = (int)Constant.PDAResult.Success;
  1868. }
  1869. else
  1870. {
  1871. actionResult.Status = (int)Constant.PDAResult.Fail;
  1872. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1873. }
  1874. }
  1875. catch (Exception ex)
  1876. {
  1877. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1878. OutputLog.TraceLog(LogPriority.Error,
  1879. this.ToString(),
  1880. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1881. ex.ToString(),
  1882. LocalPath.LogExePath);
  1883. actionResult.Status = (int)Constant.PDAResult.Exception;
  1884. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1885. }
  1886. return actionResult;
  1887. }
  1888. /// <summary>
  1889. /// 根据所选工号,查出漏检责任员工
  1890. /// </summary>
  1891. /// <param name="userid">工号</param>
  1892. /// <returns></returns>
  1893. public ActionResult GetMissedStaffByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int userid)
  1894. {
  1895. ActionResult actionResult = new ActionResult();
  1896. try
  1897. {
  1898. // 验证请求头信息
  1899. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1900. // 验证失败
  1901. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1902. {
  1903. return actionResult;
  1904. }
  1905. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1906. () => PDAModuleLogic.GetMissedStaffByUserID(userid, sUserInfo));
  1907. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1908. {
  1909. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1910. actionResult.Status = (int)Constant.PDAResult.Success;
  1911. }
  1912. else
  1913. {
  1914. actionResult.Status = (int)Constant.PDAResult.Fail;
  1915. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1916. }
  1917. }
  1918. catch (Exception ex)
  1919. {
  1920. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1921. OutputLog.TraceLog(LogPriority.Error,
  1922. this.ToString(),
  1923. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1924. ex.ToString(),
  1925. LocalPath.LogExePath);
  1926. actionResult.Status = (int)Constant.PDAResult.Exception;
  1927. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1928. }
  1929. return actionResult;
  1930. }
  1931. /// <summary>
  1932. /// 获取用户列表
  1933. /// </summary>
  1934. /// <param name="requestEntity">用户实体</param>
  1935. /// <returns></returns>
  1936. public ActionResult SearchUserData(string accountCode, string userCode, string userPassword, string sessionKey, byte IsWorker)
  1937. {
  1938. ActionResult actionResult = new ActionResult();
  1939. try
  1940. {
  1941. // 验证请求头信息
  1942. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1943. // 验证失败
  1944. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1945. {
  1946. return actionResult;
  1947. }
  1948. SUserEntity requestEntity = new SUserEntity();
  1949. requestEntity.IsWorker = IsWorker;
  1950. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1951. () => PDAModuleLogic.SearchUserData(requestEntity, sUserInfo));
  1952. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1953. {
  1954. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1955. actionResult.Status = (int)Constant.PDAResult.Success;
  1956. }
  1957. else
  1958. {
  1959. actionResult.Status = (int)Constant.PDAResult.Fail;
  1960. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1961. }
  1962. }
  1963. catch (Exception ex)
  1964. {
  1965. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1966. OutputLog.TraceLog(LogPriority.Error,
  1967. this.ToString(),
  1968. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1969. ex.ToString(),
  1970. LocalPath.LogExePath);
  1971. actionResult.Status = (int)Constant.PDAResult.Exception;
  1972. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1973. }
  1974. return actionResult;
  1975. }
  1976. /// <summary>
  1977. /// 获取数据字典管理的数据
  1978. /// </summary>
  1979. /// <param name="Pvalue">显示停用标识</param>
  1980. /// <param name="dictionaryType">字典类别</param>
  1981. /// <returns></returns>
  1982. /// <remarks>
  1983. /// 2014.12.03 新建
  1984. /// </remarks>
  1985. public ActionResult GetDictionaryData(string accountCode, string userCode, string userPassword, string sessionKey, byte Pvalue, string dictionaryType)
  1986. {
  1987. ActionResult actionResult = new ActionResult();
  1988. try
  1989. {
  1990. // 验证请求头信息
  1991. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1992. // 验证失败
  1993. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1994. {
  1995. return actionResult;
  1996. }
  1997. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1998. () => PDAModuleLogic.GetDictionaryData(Pvalue, dictionaryType, sUserInfo));
  1999. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2000. {
  2001. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2002. actionResult.Status = (int)Constant.PDAResult.Success;
  2003. }
  2004. else
  2005. {
  2006. actionResult.Status = (int)Constant.PDAResult.Fail;
  2007. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2008. }
  2009. }
  2010. catch (Exception ex)
  2011. {
  2012. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2013. OutputLog.TraceLog(LogPriority.Error,
  2014. this.ToString(),
  2015. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2016. ex.ToString(),
  2017. LocalPath.LogExePath);
  2018. actionResult.Status = (int)Constant.PDAResult.Exception;
  2019. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2020. }
  2021. return actionResult;
  2022. }
  2023. #endregion
  2024. #region 保存半检数据
  2025. /// <summary>
  2026. /// 保存半检数据
  2027. /// </summary>
  2028. /// <param name="accountCode">帐套code</param>
  2029. /// <param name="userCode">用户code</param>
  2030. /// <param name="userPassword">用户密码</param>
  2031. /// <param name="sessionKey">本次登陆密钥</param>
  2032. /// <param name="productionDataEntitys">半检信息</param>
  2033. /// <returns></returns>
  2034. public ActionResult AddSemiTest(string accountCode, string userCode, string userPassword, string sessionKey, SemiTestEntity[] semiTestEntitys)
  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. string err = ServiceInvoker.Invoke<string>(this,
  2047. () => PMModuleLogicDAL.AddSemiTest(semiTestEntitys, sUserInfo));
  2048. if (err == null)
  2049. {
  2050. err = "";
  2051. }
  2052. actionResult.Result = JsonHelper.ToJson(err);
  2053. actionResult.Status = (int)Constant.PDAResult.Success;
  2054. }
  2055. catch (Exception ex)
  2056. {
  2057. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2058. OutputLog.TraceLog(LogPriority.Error,
  2059. this.ToString(),
  2060. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2061. ex.ToString(),
  2062. LocalPath.LogExePath);
  2063. actionResult.Status = (int)Constant.PDAResult.Exception;
  2064. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2065. }
  2066. return actionResult;
  2067. }
  2068. #endregion
  2069. /// <summary>
  2070. /// 获取产品列表
  2071. /// </summary>
  2072. /// <returns></returns>
  2073. public ActionResult SerachGoods(string accountCode, string userCode, string userPassword, string sessionKey, int valueFlag)
  2074. {
  2075. ActionResult actionResult = new ActionResult();
  2076. try
  2077. {
  2078. // 验证请求头信息
  2079. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2080. // 验证失败
  2081. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2082. {
  2083. return actionResult;
  2084. }
  2085. GoodsEntity goodsEntity = new GoodsEntity();
  2086. goodsEntity.ValueFlag = 1;//有效标记
  2087. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2088. () => PDAModuleLogic.SerachGoods(sUserInfo, goodsEntity));
  2089. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2090. {
  2091. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2092. actionResult.Status = (int)Constant.PDAResult.Success;
  2093. }
  2094. else
  2095. {
  2096. actionResult.Status = (int)Constant.PDAResult.Fail;
  2097. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2098. }
  2099. }
  2100. catch (Exception ex)
  2101. {
  2102. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2103. OutputLog.TraceLog(LogPriority.Error,
  2104. this.ToString(),
  2105. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2106. ex.ToString(),
  2107. LocalPath.LogExePath);
  2108. actionResult.Status = (int)Constant.PDAResult.Exception;
  2109. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2110. }
  2111. return actionResult;
  2112. }
  2113. /// <summary>
  2114. /// 使用存储过程PRO_PM_GetProductionData获取生产工序计件数据
  2115. /// </summary>
  2116. /// <param name="searchEntity">生产数据实体类</param>
  2117. /// <returns>DataTable</returns>
  2118. public ActionResult GetProductionData(string accountCode, string userCode, string userPassword, string sessionKey, int ProcedureID, string BarCode)
  2119. {
  2120. ActionResult actionResult = new ActionResult();
  2121. try
  2122. {
  2123. // 验证请求头信息
  2124. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2125. // 验证失败
  2126. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2127. {
  2128. return actionResult;
  2129. }
  2130. SearchProductionDataEntity searchEntity = new SearchProductionDataEntity();
  2131. searchEntity.ProcedureID = ProcedureID;
  2132. searchEntity.BarCode = BarCode;
  2133. DataTable reworkDs = ServiceInvoker.Invoke<DataTable>(this,
  2134. () => PDAModuleLogic.GetProductionData(searchEntity, sUserInfo));
  2135. if (reworkDs != null && reworkDs.Rows.Count > Constant.INT_IS_ZERO)
  2136. {
  2137. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2138. actionResult.Status = (int)Constant.PDAResult.Success;
  2139. }
  2140. else
  2141. {
  2142. actionResult.Status = (int)Constant.PDAResult.Fail;
  2143. actionResult.Message = Constant.PDA_RESULT_ALLOW_ERR;
  2144. }
  2145. }
  2146. catch (Exception ex)
  2147. {
  2148. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2149. OutputLog.TraceLog(LogPriority.Error,
  2150. this.ToString(),
  2151. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2152. ex.ToString(),
  2153. LocalPath.LogExePath);
  2154. actionResult.Status = (int)Constant.PDAResult.Exception;
  2155. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2156. }
  2157. return actionResult;
  2158. }
  2159. /// <summary>
  2160. /// xuwei add 2020-03-23 此方法用于成检后 回收 再次成检 获取正确ID
  2161. /// </summary>
  2162. /// <param name="searchEntity">生产数据实体类</param>
  2163. /// <returns>DataTable</returns>
  2164. public ActionResult GetProductionDataCheckID(string accountCode, string userCode, string userPassword, string sessionKey, string BarCode)
  2165. {
  2166. ActionResult actionResult = new ActionResult();
  2167. try
  2168. {
  2169. // 验证请求头信息
  2170. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2171. // 验证失败
  2172. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2173. {
  2174. return actionResult;
  2175. }
  2176. SearchProductionDataEntity searchEntity = new SearchProductionDataEntity();
  2177. searchEntity.BarCode = BarCode;
  2178. DataTable reworkDs = ServiceInvoker.Invoke<DataTable>(this,
  2179. () => PDAModuleLogic.GetProductionDataCheckID(searchEntity, sUserInfo));
  2180. if (reworkDs != null && reworkDs.Rows.Count > Constant.INT_IS_ZERO)
  2181. {
  2182. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2183. actionResult.Status = (int)Constant.PDAResult.Success;
  2184. }
  2185. else
  2186. {
  2187. actionResult.Status = (int)Constant.PDAResult.Fail;
  2188. actionResult.Message = Constant.PDA_RESULT_ALLOW_ERR;
  2189. }
  2190. }
  2191. catch (Exception ex)
  2192. {
  2193. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2194. OutputLog.TraceLog(LogPriority.Error,
  2195. this.ToString(),
  2196. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2197. ex.ToString(),
  2198. LocalPath.LogExePath);
  2199. actionResult.Status = (int)Constant.PDAResult.Exception;
  2200. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2201. }
  2202. return actionResult;
  2203. }
  2204. /// <summary>
  2205. /// 根据所选生产数据ID,显示成检数据信息
  2206. /// </summary>
  2207. /// <param name="productionDataID">生产数据ID</param>
  2208. /// <returns>DataSet</returns>
  2209. public ActionResult GetProductionDataByID(string accountCode, string userCode, string userPassword, string sessionKey, int productionDataID)
  2210. {
  2211. ActionResult actionResult = new ActionResult();
  2212. try
  2213. {
  2214. // 验证请求头信息
  2215. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2216. // 验证失败
  2217. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2218. {
  2219. return actionResult;
  2220. }
  2221. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2222. () => PDAModuleLogic.GetProductionDataByID(productionDataID));
  2223. PDAProductionDataResult productionDatas = new PDAProductionDataResult();
  2224. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2225. {
  2226. if (reworkDs != null && reworkDs.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  2227. {
  2228. for (int i = 0; i < reworkDs.Tables[0].Rows.Count; i++)
  2229. {
  2230. PDAProductionDataResult productionData = new PDAProductionDataResult();
  2231. productionData.BarCode = reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
  2232. if (reworkDs.Tables[0].Rows[i]["GoodsID"].ToString() != "")
  2233. {
  2234. productionData.GoodsID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsID"].ToString());
  2235. }
  2236. productionData.GoodsCode = reworkDs.Tables[0].Rows[i]["GoodsCode"].ToString();
  2237. productionData.GoodsName = reworkDs.Tables[0].Rows[i]["GoodsName"].ToString();
  2238. if (reworkDs.Tables[0].Rows[0]["DefectFlagID"].ToString() != "")
  2239. {
  2240. productionData.DefectFlagID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["DefectFlagID"].ToString());
  2241. }
  2242. if (reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString() != "")
  2243. {
  2244. productionData.ReworkProcedureID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString());
  2245. }
  2246. productionData.Remarks = reworkDs.Tables[0].Rows[i]["Remarks"].ToString();
  2247. if (reworkDs.Tables[0].Rows[i]["UserID"].ToString() != "")
  2248. {
  2249. productionData.UserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["UserID"].ToString());
  2250. }
  2251. if (reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString() != "")
  2252. {
  2253. productionData.GoodsLevelTypeID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString());
  2254. }
  2255. productionData.UserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
  2256. productionData.UserName = reworkDs.Tables[0].Rows[i]["UserName"].ToString();
  2257. productionData.SpecialRepairflag = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["SpecialRepairflag"]);
  2258. productionData.IsReFire = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["IsReFire"]);
  2259. productionData.KilnCarCode = reworkDs.Tables[0].Rows[i]["KilnCarCode"].ToString();
  2260. productionData.KilnCode = reworkDs.Tables[0].Rows[i]["KilnCode"].ToString();
  2261. productionData.GlazeName = reworkDs.Tables[0].Rows[i]["GlazeName"].ToString();
  2262. if (reworkDs.Tables[0].Rows[i]["logoid"].ToString() != "")
  2263. {
  2264. productionData.LogoID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["logoid"]);
  2265. productionData.LogoCode = reworkDs.Tables[0].Rows[i]["LogoCode"].ToString();
  2266. productionData.LogoName = reworkDs.Tables[0].Rows[i]["LogoName"].ToString();
  2267. }
  2268. productionData.CreateTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["CreateTime"]);
  2269. if (reworkDs.Tables[0].Rows[i]["CheckTime"].ToString() != "")
  2270. {
  2271. productionData.CheckTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["CheckTime"].ToString());
  2272. }
  2273. DataView dvDefect = reworkDs.Tables[1].DefaultView;
  2274. dvDefect.RowFilter = "BarCode=" + reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
  2275. DataTable dtDefect = dvDefect.ToTable();
  2276. for (int row = 0; row < dtDefect.Rows.Count; row++)
  2277. {
  2278. // 产品缺陷
  2279. PDADefectResult defect = new PDADefectResult();
  2280. defect.SpecialDefect = dtDefect.Rows[row]["SpecialDefect"].ToString();
  2281. defect.DefectDeductionNum = Convert.ToDecimal(dtDefect.Rows[row]["DefectDeductionNum"].ToString());
  2282. if (dtDefect.Rows[row]["ProductionDefectID"].ToString() != "")
  2283. {
  2284. defect.ProductionDefectID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDefectID"].ToString());
  2285. }
  2286. defect.BarCode = dtDefect.Rows[row]["BarCode"].ToString();
  2287. if (dtDefect.Rows[row]["DefectID"].ToString() != "")
  2288. {
  2289. defect.DefectID = Convert.ToInt32(dtDefect.Rows[row]["DefectID"].ToString());
  2290. }
  2291. defect.DefectName = dtDefect.Rows[row]["DefectName"].ToString();
  2292. defect.DefectCode = dtDefect.Rows[row]["DefectCode"].ToString();
  2293. if (dtDefect.Rows[row]["DefectPositionID"].ToString() != "")
  2294. {
  2295. defect.DefectPositionID = Convert.ToInt32(dtDefect.Rows[row]["DefectPositionID"].ToString());
  2296. }
  2297. defect.DefectPositionName = dtDefect.Rows[row]["DefectPositionName"].ToString();
  2298. defect.DefectPositionCode = dtDefect.Rows[row]["DefectPositionCode"].ToString();
  2299. if (dtDefect.Rows[row]["DefectProcedureID"].ToString() != "")
  2300. {
  2301. defect.DefectProcedureID = Convert.ToInt32(dtDefect.Rows[row]["DefectProcedureID"].ToString());
  2302. }
  2303. defect.DefectProcedureName = dtDefect.Rows[row]["DefectProcedureName"].ToString();
  2304. defect.DefectProcedureCode = dtDefect.Rows[row]["DefectProcedureCode"].ToString();
  2305. if (dtDefect.Rows[row]["DefectUserID"].ToString() != "")
  2306. {
  2307. defect.DefectUserID = Convert.ToInt32(dtDefect.Rows[row]["DefectUserID"].ToString());
  2308. }
  2309. defect.DefectUserName = dtDefect.Rows[row]["DefectUserName"].ToString();
  2310. defect.DefectUserCode = dtDefect.Rows[row]["DefectUserCode"].ToString();
  2311. if (dtDefect.Rows[row]["Jobs"].ToString() != "")
  2312. {
  2313. defect.Jobs = Convert.ToInt32(dtDefect.Rows[row]["Jobs"].ToString());
  2314. }
  2315. if (dtDefect.Rows[row]["MissedUserID"].ToString() != "")
  2316. {
  2317. defect.MissedUserID = Convert.ToInt32(dtDefect.Rows[row]["MissedUserID"].ToString());
  2318. }
  2319. defect.MissedUserCode = dtDefect.Rows[row]["MissedUserCode"].ToString();
  2320. defect.MissedUserName = dtDefect.Rows[row]["MissedUserName"].ToString();
  2321. defect.JobsText = dtDefect.Rows[row]["JobsText"].ToString();
  2322. defect.DefectRemarks = dtDefect.Rows[row]["DefectRemarks"].ToString();
  2323. if (dtDefect.Rows[row]["ProductionDataID"].ToString() != "")
  2324. {
  2325. defect.ProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDataID"].ToString());
  2326. }
  2327. if (dtDefect.Rows[row]["DefectProductionDataID"].ToString() != "")
  2328. {
  2329. defect.DefectProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["DefectProductionDataID"].ToString());
  2330. }
  2331. if (dtDefect.Rows[row]["DefectFineID"].ToString() != "")
  2332. {
  2333. defect.DefectFineID = Convert.ToInt32(dtDefect.Rows[row]["DefectFineID"].ToString());
  2334. }
  2335. defect.DefectFineValue = dtDefect.Rows[row]["DefectFineValue"].ToString();
  2336. defect.CheckTime = Convert.ToDateTime(dtDefect.Rows[row]["CheckTime"]);
  2337. //--------责任员工-------------------
  2338. DataRow[] drRow = reworkDs.Tables[2].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[row]["ProductionDefectID"]);
  2339. if (drRow.Length > Constant.INT_IS_ZERO)
  2340. {
  2341. foreach (DataRow r in drRow)
  2342. {
  2343. PDADefectResponsibleResult defectResponsible = new PDADefectResponsibleResult();
  2344. if (r["ProductionDefectID"].ToString() != "")
  2345. {
  2346. defectResponsible.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
  2347. }
  2348. if (r["StaffID"].ToString() != "")
  2349. {
  2350. defectResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
  2351. }
  2352. defectResponsible.StaffCode = r["StaffCode"].ToString();
  2353. defectResponsible.StaffName = r["StaffName"].ToString();
  2354. if (r["StaffStatus"].ToString() != "")
  2355. {
  2356. defectResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
  2357. }
  2358. if (r["UJobsID"].ToString() != "")
  2359. {
  2360. defectResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
  2361. }
  2362. if (r["SJobsID"].ToString() != "")
  2363. {
  2364. defectResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
  2365. }
  2366. defect.PDADefectResponsibles.Add(defectResponsible);
  2367. }
  2368. }
  2369. //------------------------------
  2370. //--------漏检员工-------------------
  2371. DataRow[] drMissedRow = reworkDs.Tables[4].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[i]["ProductionDefectID"]);
  2372. if (drMissedRow.Length > Constant.INT_IS_ZERO)
  2373. {
  2374. foreach (DataRow r in drMissedRow)
  2375. {
  2376. PDADefectMissedResponsibleResult defectMissedResponsible = new PDADefectMissedResponsibleResult();
  2377. if (r["ProductionDefectID"].ToString() != "")
  2378. {
  2379. defectMissedResponsible.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
  2380. }
  2381. if (r["StaffID"].ToString() != "")
  2382. {
  2383. defectMissedResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
  2384. }
  2385. defectMissedResponsible.StaffCode = r["StaffCode"].ToString();
  2386. defectMissedResponsible.StaffName = r["StaffName"].ToString();
  2387. if (r["StaffStatus"].ToString() != "")
  2388. {
  2389. defectMissedResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
  2390. }
  2391. if (r["UJobsID"].ToString() != "")
  2392. {
  2393. defectMissedResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
  2394. }
  2395. if (r["SJobsID"].ToString() != "")
  2396. {
  2397. defectMissedResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
  2398. }
  2399. defect.PDADefectMissedResponsibles.Add(defectMissedResponsible);
  2400. }
  2401. }
  2402. //------------------------------
  2403. DataRow[] drImageRow = reworkDs.Tables[3].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[row]["ProductionDefectID"]);
  2404. if (drImageRow.Length > Constant.INT_IS_ZERO)
  2405. {
  2406. foreach (DataRow r in drImageRow)
  2407. {
  2408. PDADefectImageResult defectImage = new PDADefectImageResult();
  2409. if (r["ProductionDefectID"].ToString() != "")
  2410. {
  2411. defectImage.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
  2412. }
  2413. defectImage.Thumbnailpath = r["Thumbnailpath"].ToString();
  2414. //if (File.Exists(System.AppDomain.CurrentDomain.BaseDirectory + r["Imagepath"].ToString()))
  2415. //{
  2416. defectImage.Imagepath = r["Imagepath"].ToString();// r["Imagepath"].ToString();
  2417. //}
  2418. defect.PDADefectImageResults.Add(defectImage);
  2419. }
  2420. }
  2421. productionData.PDADefects.Add(defect);
  2422. }
  2423. if (productionDatas.PDAProductionData == null)
  2424. {
  2425. productionDatas.PDAProductionData = new System.Collections.Generic.List<PDAProductionDataResult>();
  2426. }
  2427. productionDatas.PDAProductionData.Add(productionData);
  2428. //---------------------------------------------------------------------------------
  2429. }
  2430. }
  2431. actionResult.Result = JsonHelper.ToJson(productionDatas);
  2432. actionResult.Status = (int)Constant.PDAResult.Success;
  2433. }
  2434. else
  2435. {
  2436. actionResult.Status = (int)Constant.PDAResult.Fail;
  2437. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2438. }
  2439. }
  2440. catch (Exception ex)
  2441. {
  2442. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2443. OutputLog.TraceLog(LogPriority.Error,
  2444. this.ToString(),
  2445. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2446. ex.ToString(),
  2447. LocalPath.LogExePath);
  2448. actionResult.Status = (int)Constant.PDAResult.Exception;
  2449. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2450. }
  2451. return actionResult;
  2452. }
  2453. /// <summary>
  2454. /// 根据所选生产数据ID,显示成检数据信息--复检专用
  2455. /// </summary>
  2456. /// <param name="productionDataID">生产数据ID</param>
  2457. /// <returns>DataSet</returns>
  2458. public ActionResult GetProductionDataByIDSemiCheck(string accountCode, string userCode, string userPassword, string sessionKey, int productionDataID)
  2459. {
  2460. ActionResult actionResult = new ActionResult();
  2461. try
  2462. {
  2463. // 验证请求头信息
  2464. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2465. // 验证失败
  2466. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2467. {
  2468. return actionResult;
  2469. }
  2470. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2471. () => PDAModuleLogic.GetProductionDataByIDSemiCheck(productionDataID));
  2472. PDAProductionDataResult productionDatas = new PDAProductionDataResult();
  2473. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2474. {
  2475. if (reworkDs != null && reworkDs.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  2476. {
  2477. for (int i = 0; i < reworkDs.Tables[0].Rows.Count; i++)
  2478. {
  2479. PDAProductionDataResult productionData = new PDAProductionDataResult();
  2480. productionData.BarCode = reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
  2481. if (reworkDs.Tables[0].Rows[i]["GoodsID"].ToString() != "")
  2482. {
  2483. productionData.GoodsID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsID"].ToString());
  2484. }
  2485. productionData.GoodsCode = reworkDs.Tables[0].Rows[i]["GoodsCode"].ToString();
  2486. productionData.GoodsName = reworkDs.Tables[0].Rows[i]["GoodsName"].ToString();
  2487. if (reworkDs.Tables[0].Rows[0]["DefectFlagID"].ToString() != "")
  2488. {
  2489. productionData.DefectFlagID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["DefectFlagID"].ToString());
  2490. }
  2491. if (reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString() != "")
  2492. {
  2493. productionData.ReworkProcedureID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString());
  2494. }
  2495. productionData.Remarks = reworkDs.Tables[0].Rows[i]["Remarks"].ToString();
  2496. if (reworkDs.Tables[0].Rows[i]["UserID"].ToString() != "")
  2497. {
  2498. productionData.UserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["UserID"].ToString());
  2499. }
  2500. if (reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString() != "")
  2501. {
  2502. productionData.GoodsLevelTypeID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString());
  2503. }
  2504. productionData.UserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
  2505. productionData.UserName = reworkDs.Tables[0].Rows[i]["UserName"].ToString();
  2506. productionData.SpecialRepairflag = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["SpecialRepairflag"]);
  2507. productionData.IsReFire = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["IsReFire"]);
  2508. productionData.KilnCarCode = reworkDs.Tables[0].Rows[i]["KilnCarCode"].ToString();
  2509. productionData.KilnCode = reworkDs.Tables[0].Rows[i]["KilnCode"].ToString();
  2510. productionData.GlazeName = reworkDs.Tables[0].Rows[i]["GlazeName"].ToString();
  2511. if (reworkDs.Tables[0].Rows[i]["logoid"].ToString() != "")
  2512. {
  2513. productionData.LogoID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["logoid"]);
  2514. productionData.LogoCode = reworkDs.Tables[0].Rows[i]["LogoCode"].ToString();
  2515. productionData.LogoName = reworkDs.Tables[0].Rows[i]["LogoName"].ToString();
  2516. }
  2517. productionData.CreateTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["CreateTime"]);
  2518. if (reworkDs.Tables[0].Rows[i]["CheckTime"].ToString() != "")
  2519. {
  2520. productionData.CheckTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["CheckTime"].ToString());
  2521. }
  2522. DataView dvDefect = reworkDs.Tables[1].DefaultView;
  2523. dvDefect.RowFilter = "BarCode=" + reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
  2524. DataTable dtDefect = dvDefect.ToTable();
  2525. for (int row = 0; row < dtDefect.Rows.Count; row++)
  2526. {
  2527. // 产品缺陷
  2528. PDADefectResult defect = new PDADefectResult();
  2529. defect.SpecialDefect = dtDefect.Rows[row]["SpecialDefect"].ToString();
  2530. defect.DefectDeductionNum = Convert.ToDecimal(dtDefect.Rows[row]["DefectDeductionNum"].ToString());
  2531. if (dtDefect.Rows[row]["ProductionDefectID"].ToString() != "")
  2532. {
  2533. defect.ProductionDefectID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDefectID"].ToString());
  2534. }
  2535. defect.BarCode = dtDefect.Rows[row]["BarCode"].ToString();
  2536. if (dtDefect.Rows[row]["DefectID"].ToString() != "")
  2537. {
  2538. defect.DefectID = Convert.ToInt32(dtDefect.Rows[row]["DefectID"].ToString());
  2539. }
  2540. defect.DefectName = dtDefect.Rows[row]["DefectName"].ToString();
  2541. defect.DefectCode = dtDefect.Rows[row]["DefectCode"].ToString();
  2542. if (dtDefect.Rows[row]["DefectPositionID"].ToString() != "")
  2543. {
  2544. defect.DefectPositionID = Convert.ToInt32(dtDefect.Rows[row]["DefectPositionID"].ToString());
  2545. }
  2546. defect.DefectPositionName = dtDefect.Rows[row]["DefectPositionName"].ToString();
  2547. defect.DefectPositionCode = dtDefect.Rows[row]["DefectPositionCode"].ToString();
  2548. if (dtDefect.Rows[row]["DefectProcedureID"].ToString() != "")
  2549. {
  2550. defect.DefectProcedureID = Convert.ToInt32(dtDefect.Rows[row]["DefectProcedureID"].ToString());
  2551. }
  2552. defect.DefectProcedureName = dtDefect.Rows[row]["DefectProcedureName"].ToString();
  2553. defect.DefectProcedureCode = dtDefect.Rows[row]["DefectProcedureCode"].ToString();
  2554. if (dtDefect.Rows[row]["DefectUserID"].ToString() != "")
  2555. {
  2556. defect.DefectUserID = Convert.ToInt32(dtDefect.Rows[row]["DefectUserID"].ToString());
  2557. }
  2558. defect.DefectUserName = dtDefect.Rows[row]["DefectUserName"].ToString();
  2559. defect.DefectUserCode = dtDefect.Rows[row]["DefectUserCode"].ToString();
  2560. if (dtDefect.Rows[row]["Jobs"].ToString() != "")
  2561. {
  2562. defect.Jobs = Convert.ToInt32(dtDefect.Rows[row]["Jobs"].ToString());
  2563. }
  2564. if (dtDefect.Rows[row]["MissedUserID"].ToString() != "")
  2565. {
  2566. defect.MissedUserID = Convert.ToInt32(dtDefect.Rows[row]["MissedUserID"].ToString());
  2567. }
  2568. defect.MissedUserCode = dtDefect.Rows[row]["MissedUserCode"].ToString();
  2569. defect.MissedUserName = dtDefect.Rows[row]["MissedUserName"].ToString();
  2570. defect.JobsText = dtDefect.Rows[row]["JobsText"].ToString();
  2571. defect.DefectRemarks = dtDefect.Rows[row]["DefectRemarks"].ToString();
  2572. if (dtDefect.Rows[row]["ProductionDataID"].ToString() != "")
  2573. {
  2574. defect.ProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDataID"].ToString());
  2575. }
  2576. if (dtDefect.Rows[row]["DefectProductionDataID"].ToString() != "")
  2577. {
  2578. defect.DefectProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["DefectProductionDataID"].ToString());
  2579. }
  2580. if (dtDefect.Rows[row]["DefectFineID"].ToString() != "")
  2581. {
  2582. defect.DefectFineID = Convert.ToInt32(dtDefect.Rows[row]["DefectFineID"].ToString());
  2583. }
  2584. defect.DefectFineValue = dtDefect.Rows[row]["DefectFineValue"].ToString();
  2585. defect.CheckTime = Convert.ToDateTime(dtDefect.Rows[row]["CheckTime"]);
  2586. //--------责任员工-------------------
  2587. DataRow[] drRow = reworkDs.Tables[2].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[row]["ProductionDefectID"]);
  2588. if (drRow.Length > Constant.INT_IS_ZERO)
  2589. {
  2590. foreach (DataRow r in drRow)
  2591. {
  2592. PDADefectResponsibleResult defectResponsible = new PDADefectResponsibleResult();
  2593. if (r["ProductionDefectID"].ToString() != "")
  2594. {
  2595. defectResponsible.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
  2596. }
  2597. if (r["StaffID"].ToString() != "")
  2598. {
  2599. defectResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
  2600. }
  2601. defectResponsible.StaffCode = r["StaffCode"].ToString();
  2602. defectResponsible.StaffName = r["StaffName"].ToString();
  2603. if (r["StaffStatus"].ToString() != "")
  2604. {
  2605. defectResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
  2606. }
  2607. if (r["UJobsID"].ToString() != "")
  2608. {
  2609. defectResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
  2610. }
  2611. if (r["SJobsID"].ToString() != "")
  2612. {
  2613. defectResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
  2614. }
  2615. defect.PDADefectResponsibles.Add(defectResponsible);
  2616. }
  2617. }
  2618. //------------------------------
  2619. //--------漏检员工-------------------
  2620. DataRow[] drMissedRow = reworkDs.Tables[4].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[i]["ProductionDefectID"]);
  2621. if (drMissedRow.Length > Constant.INT_IS_ZERO)
  2622. {
  2623. foreach (DataRow r in drMissedRow)
  2624. {
  2625. PDADefectMissedResponsibleResult defectMissedResponsible = new PDADefectMissedResponsibleResult();
  2626. if (r["ProductionDefectID"].ToString() != "")
  2627. {
  2628. defectMissedResponsible.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
  2629. }
  2630. if (r["StaffID"].ToString() != "")
  2631. {
  2632. defectMissedResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
  2633. }
  2634. defectMissedResponsible.StaffCode = r["StaffCode"].ToString();
  2635. defectMissedResponsible.StaffName = r["StaffName"].ToString();
  2636. if (r["StaffStatus"].ToString() != "")
  2637. {
  2638. defectMissedResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
  2639. }
  2640. if (r["UJobsID"].ToString() != "")
  2641. {
  2642. defectMissedResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
  2643. }
  2644. if (r["SJobsID"].ToString() != "")
  2645. {
  2646. defectMissedResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
  2647. }
  2648. defect.PDADefectMissedResponsibles.Add(defectMissedResponsible);
  2649. }
  2650. }
  2651. //------------------------------
  2652. DataRow[] drImageRow = reworkDs.Tables[3].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[row]["ProductionDefectID"]);
  2653. if (drImageRow.Length > Constant.INT_IS_ZERO)
  2654. {
  2655. foreach (DataRow r in drImageRow)
  2656. {
  2657. PDADefectImageResult defectImage = new PDADefectImageResult();
  2658. if (r["ProductionDefectID"].ToString() != "")
  2659. {
  2660. defectImage.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
  2661. }
  2662. defectImage.Thumbnailpath = r["Thumbnailpath"].ToString();
  2663. //if (File.Exists(System.AppDomain.CurrentDomain.BaseDirectory + r["Imagepath"].ToString()))
  2664. //{
  2665. defectImage.Imagepath = r["Imagepath"].ToString();// r["Imagepath"].ToString();
  2666. //}
  2667. defect.PDADefectImageResults.Add(defectImage);
  2668. }
  2669. }
  2670. productionData.PDADefects.Add(defect);
  2671. }
  2672. if (productionDatas.PDAProductionData == null)
  2673. {
  2674. productionDatas.PDAProductionData = new System.Collections.Generic.List<PDAProductionDataResult>();
  2675. }
  2676. productionDatas.PDAProductionData.Add(productionData);
  2677. //---------------------------------------------------------------------------------
  2678. }
  2679. }
  2680. actionResult.Result = JsonHelper.ToJson(productionDatas);
  2681. actionResult.Status = (int)Constant.PDAResult.Success;
  2682. }
  2683. else
  2684. {
  2685. actionResult.Status = (int)Constant.PDAResult.Fail;
  2686. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2687. }
  2688. }
  2689. catch (Exception ex)
  2690. {
  2691. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2692. OutputLog.TraceLog(LogPriority.Error,
  2693. this.ToString(),
  2694. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2695. ex.ToString(),
  2696. LocalPath.LogExePath);
  2697. actionResult.Status = (int)Constant.PDAResult.Exception;
  2698. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2699. }
  2700. return actionResult;
  2701. }
  2702. /// <summary>
  2703. /// 编辑后删除生产数据
  2704. /// </summary>
  2705. /// <param name="productionDataID">生产数据ID</param>
  2706. /// <returns>int</returns>
  2707. public ActionResult DeleteProductionDataByID(string accountCode, string userCode, string userPassword, string sessionKey, int productionDataID)
  2708. {
  2709. ActionResult actionResult = new ActionResult();
  2710. try
  2711. {
  2712. // 验证请求头信息
  2713. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2714. // 验证失败
  2715. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2716. {
  2717. return actionResult;
  2718. }
  2719. int row = ServiceInvoker.Invoke<int>(this,
  2720. () => PMModuleLogic.DeleteProductionDataByID(productionDataID));
  2721. actionResult.Result = JsonHelper.ToJson(row);
  2722. actionResult.Status = (int)Constant.PDAResult.Success;
  2723. }
  2724. catch (Exception ex)
  2725. {
  2726. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2727. OutputLog.TraceLog(LogPriority.Error,
  2728. this.ToString(),
  2729. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2730. ex.ToString(),
  2731. LocalPath.LogExePath);
  2732. actionResult.Status = (int)Constant.PDAResult.Exception;
  2733. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2734. }
  2735. return actionResult;
  2736. }
  2737. /// <summary>
  2738. /// 获取产品完成工序的ID
  2739. /// </summary>
  2740. /// <param name="barcode">产品条码</param>
  2741. /// <returns>int</returns>
  2742. public ActionResult GetCompleteProcedureID(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  2743. {
  2744. ActionResult actionResult = new ActionResult();
  2745. try
  2746. {
  2747. // 验证请求头信息
  2748. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2749. // 验证失败
  2750. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2751. {
  2752. return actionResult;
  2753. }
  2754. int row = ServiceInvoker.Invoke<int>(this,
  2755. () => PMModuleLogic.GetCompleteProcedureID(barcode));
  2756. actionResult.Result = JsonHelper.ToJson(row);
  2757. actionResult.Status = (int)Constant.PDAResult.Success;
  2758. }
  2759. catch (Exception ex)
  2760. {
  2761. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2762. OutputLog.TraceLog(LogPriority.Error,
  2763. this.ToString(),
  2764. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2765. ex.ToString(),
  2766. LocalPath.LogExePath);
  2767. actionResult.Status = (int)Constant.PDAResult.Exception;
  2768. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2769. }
  2770. return actionResult;
  2771. }
  2772. /// <summary>
  2773. /// 绑定图片
  2774. /// </summary>
  2775. /// <param name="accountCode">帐套code</param>
  2776. /// <param name="userCode">用户code</param>
  2777. /// <param name="userPassword">用户密码</param>
  2778. /// <param name="sessionKey">本次登陆密钥</param>
  2779. /// <param name="imagePath">图片路径</param>
  2780. /// <returns></returns>
  2781. public Stream BindDefectImage(string accountCode, string userCode, string userPassword, string sessionKey, string imagePath)
  2782. {
  2783. try
  2784. {
  2785. return ServiceInvoker.Invoke<Stream>(this, () => PDAModuleLogic.BindDefectImage(imagePath));
  2786. }
  2787. catch (Exception ex)
  2788. {
  2789. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2790. OutputLog.TraceLog(LogPriority.Error,
  2791. this.ToString(),
  2792. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2793. ex.ToString(),
  2794. LocalPath.LogExePath);
  2795. return null;
  2796. }
  2797. }
  2798. /// <summary>
  2799. /// 根据所选工号对应的工种,查出缺陷责任员工
  2800. /// </summary>
  2801. /// <param name="jobs">工种ID</param>
  2802. /// <returns></returns>
  2803. public ActionResult GetDutyStaffByUserJobsID(string accountCode, string userCode, string userPassword, string sessionKey, int jobs, int userid)
  2804. {
  2805. ActionResult actionResult = new ActionResult();
  2806. try
  2807. {
  2808. // 验证请求头信息
  2809. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2810. // 验证失败
  2811. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2812. {
  2813. return actionResult;
  2814. }
  2815. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2816. () => PDAModuleLogic.GetDutyStaffByUserJobsID(jobs, sUserInfo, userid));
  2817. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2818. {
  2819. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2820. actionResult.Status = (int)Constant.PDAResult.Success;
  2821. }
  2822. else
  2823. {
  2824. actionResult.Status = (int)Constant.PDAResult.Fail;
  2825. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2826. }
  2827. }
  2828. catch (Exception ex)
  2829. {
  2830. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2831. OutputLog.TraceLog(LogPriority.Error,
  2832. this.ToString(),
  2833. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2834. ex.ToString(),
  2835. LocalPath.LogExePath);
  2836. actionResult.Status = (int)Constant.PDAResult.Exception;
  2837. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2838. }
  2839. return actionResult;
  2840. }
  2841. #region 产品报废
  2842. /// <summary>
  2843. /// 验证废弃产品唯一性
  2844. /// </summary>
  2845. /// <param name="barcode">产品条码</param>
  2846. /// <returns>int</returns>
  2847. public ActionResult ScrapProductChack(string accountCode, string userCode, string userPassword, string sessionKey, string barCode)
  2848. {
  2849. ActionResult actionResult = new ActionResult();
  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. string row = ServiceInvoker.Invoke<string>(this,
  2860. () => PDAModuleLogic.ScrapProductChack(barCode, sUserInfo));
  2861. string[] rm = row.Split(':');
  2862. actionResult.Result = rm[0];//JsonHelper.ToJson(rm[0]);
  2863. if (rm.Length > 1)
  2864. {
  2865. actionResult.Message = rm[1];
  2866. }
  2867. actionResult.Status = (int)Constant.PDAResult.Success;
  2868. }
  2869. catch (Exception ex)
  2870. {
  2871. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2872. OutputLog.TraceLog(LogPriority.Error,
  2873. this.ToString(),
  2874. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2875. ex.ToString(),
  2876. LocalPath.LogExePath);
  2877. actionResult.Status = (int)Constant.PDAResult.Exception;
  2878. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2879. }
  2880. return actionResult;
  2881. }
  2882. /// <summary>
  2883. /// 根据条码获取该产品的在产信息以及生产数据
  2884. /// </summary>
  2885. /// <param name="Barcode">产品条码</param>
  2886. /// <returns>装有两个DataTable的数据集,第一个是在产信息,第二个是生产数据</returns>
  2887. public ActionResult GetInProductionAndProductionData(string accountCode, string userCode, string userPassword, string sessionKey, string barCode)
  2888. {
  2889. ActionResult actionResult = new ActionResult();
  2890. try
  2891. {
  2892. // 验证请求头信息
  2893. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2894. // 验证失败
  2895. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2896. {
  2897. return actionResult;
  2898. }
  2899. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2900. () => PDAModuleLogic.GetInProductionAndProductionData(barCode, sUserInfo));
  2901. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2902. {
  2903. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2904. actionResult.Status = (int)Constant.PDAResult.Success;
  2905. }
  2906. else
  2907. {
  2908. actionResult.Status = (int)Constant.PDAResult.Fail;
  2909. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2910. }
  2911. }
  2912. catch (Exception ex)
  2913. {
  2914. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2915. OutputLog.TraceLog(LogPriority.Error,
  2916. this.ToString(),
  2917. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2918. ex.ToString(),
  2919. LocalPath.LogExePath);
  2920. actionResult.Status = (int)Constant.PDAResult.Exception;
  2921. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2922. }
  2923. return actionResult;
  2924. }
  2925. /// <summary>
  2926. /// 根据工号查询员工档案信息
  2927. /// </summary>
  2928. /// <param name="accountCode"></param>
  2929. /// <param name="userCode"></param>
  2930. /// <param name="userPassword"></param>
  2931. /// <param name="sessionKey"></param>
  2932. /// <param name="userId"></param>
  2933. /// <returns></returns>
  2934. public ActionResult SearchHrStaffInfo(string accountCode, string userCode, string userPassword, string sessionKey, int userId)
  2935. {
  2936. ActionResult actionResult = new ActionResult();
  2937. try
  2938. {
  2939. // 验证请求头信息
  2940. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2941. // 验证失败
  2942. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2943. {
  2944. return actionResult;
  2945. }
  2946. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2947. () => PDAModuleLogic.SearchHrStaffInfo(userId, sUserInfo));
  2948. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2949. {
  2950. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2951. actionResult.Status = (int)Constant.PDAResult.Success;
  2952. }
  2953. else
  2954. {
  2955. actionResult.Status = (int)Constant.PDAResult.Fail;
  2956. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2957. }
  2958. }
  2959. catch (Exception ex)
  2960. {
  2961. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2962. OutputLog.TraceLog(LogPriority.Error,
  2963. this.ToString(),
  2964. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2965. ex.ToString(),
  2966. LocalPath.LogExePath);
  2967. actionResult.Status = (int)Constant.PDAResult.Exception;
  2968. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2969. }
  2970. return actionResult;
  2971. }
  2972. /// <summary>
  2973. /// 添加废弃产品记录
  2974. /// </summary>
  2975. /// <param name="SProductEntity">废弃产品实体</param>
  2976. /// <param name="RProcedureEntity">废弃责任工序实体</param>
  2977. /// <param name="SResponsibleList">责任者集合</param>
  2978. /// <param name="userInfo">用户基本信息</param>
  2979. /// <returns>int结果返回值</returns>
  2980. /// <remarks>
  2981. /// 庄天威 2014.09.24 新建
  2982. /// </remarks>
  2983. public ActionResult AddScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey,
  2984. ScrapProductEntity SProductEntity, ResponProcedureEntity RProcedureEntity,
  2985. ScrapResponsibleEntity[] SResponsibleList)
  2986. {
  2987. ActionResult actionResult = new ActionResult();
  2988. if (SResponsibleList == null || SResponsibleList.Length == 0)
  2989. {
  2990. actionResult.Status = (int)Constant.PDAResult.Fail;
  2991. actionResult.Message = "没有选择责任人";
  2992. }
  2993. try
  2994. {
  2995. // 验证请求头信息
  2996. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2997. // 验证失败
  2998. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2999. {
  3000. return actionResult;
  3001. }
  3002. int addRow = ServiceInvoker.Invoke<int>(this,
  3003. () => PDAModuleLogic.AddScrapProduct(SProductEntity, RProcedureEntity, SResponsibleList, sUserInfo));
  3004. actionResult.Result = JsonHelper.ToJson(addRow);
  3005. actionResult.Status = (int)Constant.PDAResult.Success;
  3006. }
  3007. catch (Exception ex)
  3008. {
  3009. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3010. OutputLog.TraceLog(LogPriority.Error,
  3011. this.ToString(),
  3012. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3013. ex.ToString(),
  3014. LocalPath.LogExePath);
  3015. actionResult.Status = (int)Constant.PDAResult.Exception;
  3016. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3017. // TODO 空指针异常问题检测
  3018. try
  3019. {
  3020. OutputLog.TraceLog(LogPriority.Error,
  3021. this.ToString(),
  3022. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3023. "accountCode:" + accountCode + "#userCode:" + userCode + "#sessionKey:" + sessionKey,
  3024. LocalPath.LogExePath);
  3025. string json1 = JsonHelper.ToJson(SProductEntity);
  3026. OutputLog.TraceLog(LogPriority.Error,
  3027. this.ToString(),
  3028. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3029. "SProductEntity:" + json1,
  3030. LocalPath.LogExePath);
  3031. string json2 = JsonHelper.ToJson(RProcedureEntity);
  3032. OutputLog.TraceLog(LogPriority.Error,
  3033. this.ToString(),
  3034. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3035. "RProcedureEntity:" + json2,
  3036. LocalPath.LogExePath);
  3037. string json3 = JsonHelper.ToJson(SResponsibleList);
  3038. OutputLog.TraceLog(LogPriority.Error,
  3039. this.ToString(),
  3040. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3041. "SResponsibleList:" + json3,
  3042. LocalPath.LogExePath);
  3043. }
  3044. catch (Exception exc)
  3045. {
  3046. OutputLog.TraceLog(LogPriority.Error,
  3047. this.ToString(),
  3048. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3049. "参数输入异常:" + exc.Message,
  3050. LocalPath.LogExePath);
  3051. }
  3052. }
  3053. return actionResult;
  3054. }
  3055. /// <summary>
  3056. /// 获取产品分级的数据(根据ID)
  3057. /// </summary>
  3058. /// <param name="GoodsLevelTypeID">分类类别ID</param>
  3059. /// <param name="GoodsLevelID">分类ID</param>
  3060. /// <param name="sUserInfo">用户基本信息</param>
  3061. /// <returns>DataSet</returns>
  3062. /// <remarks>
  3063. /// 2014.10.22 庄天威 新建
  3064. public ActionResult GetGoodsLevelDataById(string accountCode, string userCode, string userPassword, string sessionKey, int? GoodsLevelTypeID)
  3065. {
  3066. ActionResult actionResult = new ActionResult();
  3067. try
  3068. {
  3069. // 验证请求头信息
  3070. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3071. // 验证失败
  3072. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3073. {
  3074. return actionResult;
  3075. }
  3076. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3077. () => SystemModuleLogic.GetGoodsLevelDataById(GoodsLevelTypeID, null, sUserInfo));
  3078. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3079. {
  3080. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3081. actionResult.Status = (int)Constant.PDAResult.Success;
  3082. }
  3083. else
  3084. {
  3085. actionResult.Status = (int)Constant.PDAResult.Fail;
  3086. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3087. }
  3088. }
  3089. catch (Exception ex)
  3090. {
  3091. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3092. OutputLog.TraceLog(LogPriority.Error,
  3093. this.ToString(),
  3094. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3095. ex.ToString(),
  3096. LocalPath.LogExePath);
  3097. actionResult.Status = (int)Constant.PDAResult.Exception;
  3098. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3099. }
  3100. return actionResult;
  3101. }
  3102. /// <summary>
  3103. /// 获取账务日期
  3104. /// </summary>
  3105. /// <param name="accountCode"></param>
  3106. /// <param name="userCode"></param>
  3107. /// <param name="userPassword"></param>
  3108. /// <param name="sessionKey"></param>
  3109. /// <returns></returns>
  3110. public ActionResult GetAccountDate(string accountCode, string userCode, string userPassword, string sessionKey)
  3111. {
  3112. ActionResult actionResult = new ActionResult();
  3113. try
  3114. {
  3115. // 验证请求头信息
  3116. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3117. // 验证失败
  3118. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3119. {
  3120. return actionResult;
  3121. }
  3122. DateTime reworkDs = ServiceInvoker.Invoke<DateTime>(this,
  3123. () => CommonModuleLogic.GetAccountDate(sUserInfo));
  3124. actionResult.Result = JsonHelper.ToJson(reworkDs);
  3125. actionResult.Status = (int)Constant.PDAResult.Success;
  3126. }
  3127. catch (Exception ex)
  3128. {
  3129. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3130. OutputLog.TraceLog(LogPriority.Error,
  3131. this.ToString(),
  3132. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3133. ex.ToString(),
  3134. LocalPath.LogExePath);
  3135. actionResult.Status = (int)Constant.PDAResult.Exception;
  3136. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3137. }
  3138. return actionResult;
  3139. }
  3140. /// <summary>
  3141. /// 获取登陆帐户有无报损权限
  3142. /// </summary>
  3143. /// <param name="accountCode"></param>
  3144. /// <param name="userCode"></param>
  3145. /// <param name="userPassword"></param>
  3146. /// <param name="sessionKey"></param>
  3147. /// <param name="usercode">工号编码</param>
  3148. /// <returns></returns>
  3149. public ActionResult GetScrapFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  3150. {
  3151. ActionResult actionResult = new ActionResult();
  3152. try
  3153. {
  3154. // 验证请求头信息
  3155. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3156. // 验证失败
  3157. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3158. {
  3159. return actionResult;
  3160. }
  3161. int returnValue = ServiceInvoker.Invoke<int>(this,
  3162. () => PDAModuleLogic.GetScrapFuntion(userCode, sUserInfo));
  3163. actionResult.Result = JsonHelper.ToJson(returnValue);
  3164. actionResult.Status = (int)Constant.PDAResult.Success;
  3165. }
  3166. catch (Exception ex)
  3167. {
  3168. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3169. OutputLog.TraceLog(LogPriority.Error,
  3170. this.ToString(),
  3171. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3172. ex.ToString(),
  3173. LocalPath.LogExePath);
  3174. actionResult.Status = (int)Constant.PDAResult.Exception;
  3175. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3176. }
  3177. return actionResult;
  3178. }
  3179. #endregion
  3180. /// <summary>
  3181. /// 获取是否存在报损未审核产品
  3182. /// </summary>
  3183. /// <param name="barcode">产品条码</param>
  3184. /// <returns>int</returns>
  3185. public ActionResult GetScrapProductAuditStatus(string accountCode, string userCode, string userPassword, string sessionKey, string barCode)
  3186. {
  3187. ActionResult actionResult = new ActionResult();
  3188. try
  3189. {
  3190. // 验证请求头信息
  3191. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3192. // 验证失败
  3193. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3194. {
  3195. return actionResult;
  3196. }
  3197. int row = ServiceInvoker.Invoke<int>(this,
  3198. () => PDAModuleLogic.GetScrapProductAuditStatus(barCode));
  3199. actionResult.Result = JsonHelper.ToJson(row);
  3200. actionResult.Status = (int)Constant.PDAResult.Success;
  3201. }
  3202. catch (Exception ex)
  3203. {
  3204. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3205. OutputLog.TraceLog(LogPriority.Error,
  3206. this.ToString(),
  3207. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3208. ex.ToString(),
  3209. LocalPath.LogExePath);
  3210. actionResult.Status = (int)Constant.PDAResult.Exception;
  3211. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3212. }
  3213. return actionResult;
  3214. }
  3215. /// <summary>
  3216. /// 查询报废产品信息
  3217. /// </summary>
  3218. /// <param name="accountCode"></param>
  3219. /// <param name="userCode"></param>
  3220. /// <param name="userPassword"></param>
  3221. /// <param name="sessionKey"></param>
  3222. /// <param name="barCode">产品条码</param>
  3223. /// <param name="scrapProductID">报废产品ID</param>
  3224. /// <returns></returns>
  3225. public ActionResult GetScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barCode, int scrapProductID)
  3226. {
  3227. ActionResult actionResult = new ActionResult();
  3228. try
  3229. {
  3230. // 验证请求头信息
  3231. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3232. // 验证失败
  3233. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3234. {
  3235. return actionResult;
  3236. }
  3237. ScrapProductEntity selectProEntity = new ScrapProductEntity();
  3238. selectProEntity.BarCode = barCode;
  3239. selectProEntity.ScrapProductID = scrapProductID;
  3240. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3241. () => PMModuleLogic.GetScrapProduct(selectProEntity, sUserInfo));
  3242. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3243. {
  3244. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3245. actionResult.Status = (int)Constant.PDAResult.Success;
  3246. }
  3247. else
  3248. {
  3249. actionResult.Status = (int)Constant.PDAResult.Fail;
  3250. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3251. }
  3252. }
  3253. catch (Exception ex)
  3254. {
  3255. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3256. OutputLog.TraceLog(LogPriority.Error,
  3257. this.ToString(),
  3258. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3259. ex.ToString(),
  3260. LocalPath.LogExePath);
  3261. actionResult.Status = (int)Constant.PDAResult.Exception;
  3262. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3263. }
  3264. return actionResult;
  3265. }
  3266. /// <summary>
  3267. /// 根据废弃产品ID获取责任工序
  3268. /// </summary>
  3269. /// <param name="accountCode"></param>
  3270. /// <param name="userCode"></param>
  3271. /// <param name="userPassword"></param>
  3272. /// <param name="sessionKey"></param>
  3273. /// <param name="scrapProductID">报废产品ID</param>
  3274. /// <returns></returns>
  3275. public ActionResult GetResponProcedureBySPId(string accountCode, string userCode, string userPassword, string sessionKey, int scrapProductID)
  3276. {
  3277. ActionResult actionResult = new ActionResult();
  3278. try
  3279. {
  3280. // 验证请求头信息
  3281. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3282. // 验证失败
  3283. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3284. {
  3285. return actionResult;
  3286. }
  3287. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3288. () => PMModuleLogic.GetResponProcedureBySPId(scrapProductID));
  3289. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3290. {
  3291. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3292. actionResult.Status = (int)Constant.PDAResult.Success;
  3293. }
  3294. else
  3295. {
  3296. actionResult.Status = (int)Constant.PDAResult.Fail;
  3297. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3298. }
  3299. }
  3300. catch (Exception ex)
  3301. {
  3302. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3303. OutputLog.TraceLog(LogPriority.Error,
  3304. this.ToString(),
  3305. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3306. ex.ToString(),
  3307. LocalPath.LogExePath);
  3308. actionResult.Status = (int)Constant.PDAResult.Exception;
  3309. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3310. }
  3311. return actionResult;
  3312. }
  3313. /// <summary>
  3314. /// 根据废弃产品ID获取责任人列表
  3315. /// </summary>
  3316. /// <param name="accountCode"></param>
  3317. /// <param name="userCode"></param>
  3318. /// <param name="userPassword"></param>
  3319. /// <param name="sessionKey"></param>
  3320. /// <param name="scrapProductID">报废产品ID</param>
  3321. /// <returns></returns>
  3322. public ActionResult GetScrapResponsibleBySPId(string accountCode, string userCode, string userPassword, string sessionKey, int scrapProductID)
  3323. {
  3324. ActionResult actionResult = new ActionResult();
  3325. try
  3326. {
  3327. // 验证请求头信息
  3328. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3329. // 验证失败
  3330. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3331. {
  3332. return actionResult;
  3333. }
  3334. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3335. () => PMModuleLogic.GetScrapResponsibleBySPId(scrapProductID));
  3336. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3337. {
  3338. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3339. actionResult.Status = (int)Constant.PDAResult.Success;
  3340. }
  3341. else
  3342. {
  3343. actionResult.Status = (int)Constant.PDAResult.Fail;
  3344. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3345. }
  3346. }
  3347. catch (Exception ex)
  3348. {
  3349. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3350. OutputLog.TraceLog(LogPriority.Error,
  3351. this.ToString(),
  3352. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3353. ex.ToString(),
  3354. LocalPath.LogExePath);
  3355. actionResult.Status = (int)Constant.PDAResult.Exception;
  3356. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3357. }
  3358. return actionResult;
  3359. }
  3360. /// <summary>
  3361. /// 添加废弃产品记录
  3362. /// </summary>
  3363. /// <param name="SProductEntity">废弃产品实体</param>
  3364. /// <param name="RProcedureEntity">废弃责任工序实体</param>
  3365. /// <param name="SResponsibleList">责任者集合</param>
  3366. /// <param name="userInfo">用户基本信息</param>
  3367. /// <returns>int结果返回值</returns>
  3368. /// <remarks>
  3369. /// 庄天威 2014.09.24 新建
  3370. /// </remarks>
  3371. public ActionResult UpdateScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, ScrapProductEntity UpdateSProductEntity,
  3372. ResponProcedureEntity UpdateRProcedureEntity,
  3373. ScrapResponsibleEntity[] UpdateSResponsibleList, ScrapResponsibleEntity[] YSResponsibleList)
  3374. {
  3375. ActionResult actionResult = new ActionResult();
  3376. try
  3377. {
  3378. // 验证请求头信息
  3379. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3380. // 验证失败
  3381. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3382. {
  3383. return actionResult;
  3384. }
  3385. int addRow = ServiceInvoker.Invoke<int>(this,
  3386. () => PDAModuleLogic.UpdateScrapProduct(UpdateSProductEntity, UpdateRProcedureEntity, UpdateSResponsibleList, YSResponsibleList, sUserInfo));
  3387. actionResult.Result = JsonHelper.ToJson(addRow);
  3388. actionResult.Status = (int)Constant.PDAResult.Success;
  3389. }
  3390. catch (Exception ex)
  3391. {
  3392. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3393. OutputLog.TraceLog(LogPriority.Error,
  3394. this.ToString(),
  3395. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3396. ex.ToString(),
  3397. LocalPath.LogExePath);
  3398. actionResult.Status = (int)Constant.PDAResult.Exception;
  3399. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3400. }
  3401. return actionResult;
  3402. }
  3403. /// <summary>
  3404. /// 获取产品窑炉
  3405. /// </summary>
  3406. /// <param name="accountCode"></param>
  3407. /// <param name="userCode"></param>
  3408. /// <param name="userPassword"></param>
  3409. /// <param name="sessionKey"></param>
  3410. /// <returns>Datase</returns>
  3411. public ActionResult GetAllKilntInfo(string accountCode, string userCode, string userPassword, string sessionKey)
  3412. {
  3413. ActionResult actionResult = new ActionResult();
  3414. try
  3415. {
  3416. // 验证请求头信息
  3417. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3418. // 验证失败
  3419. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3420. {
  3421. return actionResult;
  3422. }
  3423. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3424. () => PDAModuleLogic.GetAllKilntInfo(sUserInfo));
  3425. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3426. {
  3427. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3428. actionResult.Status = (int)Constant.PDAResult.Success;
  3429. }
  3430. else
  3431. {
  3432. actionResult.Status = (int)Constant.PDAResult.Fail;
  3433. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3434. }
  3435. }
  3436. catch (Exception ex)
  3437. {
  3438. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3439. OutputLog.TraceLog(LogPriority.Error,
  3440. this.ToString(),
  3441. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3442. ex.ToString(),
  3443. LocalPath.LogExePath);
  3444. actionResult.Status = (int)Constant.PDAResult.Exception;
  3445. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3446. }
  3447. return actionResult;
  3448. }
  3449. /// <summary>
  3450. /// 获取次品产品条码允许编辑
  3451. /// </summary>
  3452. /// <param name="accountCode"></param>
  3453. /// <param name="userCode"></param>
  3454. /// <param name="userPassword"></param>
  3455. /// <param name="sessionKey"></param>
  3456. /// <param name="barcode">产品条码</param>
  3457. /// <returns>Datase</returns>
  3458. public ActionResult GetSubstandardInfo(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3459. {
  3460. ActionResult actionResult = new ActionResult();
  3461. try
  3462. {
  3463. // 验证请求头信息
  3464. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3465. // 验证失败
  3466. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3467. {
  3468. return actionResult;
  3469. }
  3470. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3471. () => PDAModuleLogic.GetSubstandardInfo(barcode));
  3472. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3473. {
  3474. actionResult.Result = JsonHelper.ToJson(1);
  3475. actionResult.Status = (int)Constant.PDAResult.Success;
  3476. }
  3477. else
  3478. {
  3479. actionResult.Result = JsonHelper.ToJson(0);
  3480. actionResult.Status = (int)Constant.PDAResult.Fail;
  3481. actionResult.Message = "次品条码:" + barcode + "不允许修改";
  3482. }
  3483. }
  3484. catch (Exception ex)
  3485. {
  3486. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3487. OutputLog.TraceLog(LogPriority.Error,
  3488. this.ToString(),
  3489. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3490. ex.ToString(),
  3491. LocalPath.LogExePath);
  3492. actionResult.Status = (int)Constant.PDAResult.Exception;
  3493. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3494. }
  3495. return actionResult;
  3496. }
  3497. /// <summary>
  3498. /// 获取产品条码是否重烧
  3499. /// </summary>
  3500. /// <param name="accountCode"></param>
  3501. /// <param name="userCode"></param>
  3502. /// <param name="userPassword"></param>
  3503. /// <param name="sessionKey"></param>
  3504. /// <param name="barcode">产品条码</param>
  3505. /// <returns>Datase</returns>
  3506. public ActionResult GetReFine(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3507. {
  3508. ActionResult actionResult = new ActionResult();
  3509. try
  3510. {
  3511. // 验证请求头信息
  3512. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3513. // 验证失败
  3514. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3515. {
  3516. return actionResult;
  3517. }
  3518. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3519. () => PDAModuleLogic.GetReFine(barcode));
  3520. if (reworkDs != null && reworkDs.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  3521. {
  3522. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(reworkDs.Tables[0].Rows[0]["IsReFire"]));
  3523. }
  3524. else
  3525. {
  3526. actionResult.Result = JsonHelper.ToJson(0);
  3527. }
  3528. actionResult.Status = (int)Constant.PDAResult.Success;
  3529. }
  3530. catch (Exception ex)
  3531. {
  3532. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3533. OutputLog.TraceLog(LogPriority.Error,
  3534. this.ToString(),
  3535. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3536. ex.ToString(),
  3537. LocalPath.LogExePath);
  3538. actionResult.Status = (int)Constant.PDAResult.Exception;
  3539. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3540. }
  3541. return actionResult;
  3542. }
  3543. /// <summary>
  3544. /// 获取登陆帐户有无成检编辑权限
  3545. /// </summary>
  3546. /// <param name="accountCode"></param>
  3547. /// <param name="userCode"></param>
  3548. /// <param name="userPassword"></param>
  3549. /// <param name="sessionKey"></param>
  3550. /// <param name="usercode">工号编码</param>
  3551. /// <returns></returns>
  3552. public ActionResult GetFinishedProductEditFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  3553. {
  3554. ActionResult actionResult = new ActionResult();
  3555. try
  3556. {
  3557. // 验证请求头信息
  3558. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3559. // 验证失败
  3560. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3561. {
  3562. return actionResult;
  3563. }
  3564. int returnValue = ServiceInvoker.Invoke<int>(this,
  3565. () => PDAModuleLogic.GetFinishedProductEditFuntion(sUserInfo));
  3566. actionResult.Result = JsonHelper.ToJson(returnValue);
  3567. actionResult.Status = (int)Constant.PDAResult.Success;
  3568. }
  3569. catch (Exception ex)
  3570. {
  3571. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3572. OutputLog.TraceLog(LogPriority.Error,
  3573. this.ToString(),
  3574. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3575. ex.ToString(),
  3576. LocalPath.LogExePath);
  3577. actionResult.Status = (int)Constant.PDAResult.Exception;
  3578. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3579. }
  3580. return actionResult;
  3581. }
  3582. /// <summary>
  3583. /// 根据条码及工序判断是否漏扫
  3584. /// </summary>
  3585. /// <param name="accountCode"></param>
  3586. /// <param name="userCode"></param>
  3587. /// <param name="userPassword"></param>
  3588. /// <param name="sessionKey"></param>
  3589. /// <param name="usercode">工号编码</param>
  3590. /// <param name="barcode">产品条码</param>
  3591. /// <param name="produceid">工序ID</param>
  3592. /// <returns></returns>
  3593. public ActionResult AddBarCodeMissing(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int produceid)
  3594. {
  3595. ActionResult actionResult = new ActionResult();
  3596. try
  3597. {
  3598. // 验证请求头信息
  3599. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3600. // 验证失败
  3601. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3602. {
  3603. return actionResult;
  3604. }
  3605. int returnValue = 1;
  3606. //int returnValue = ServiceInvoker.Invoke<int>(this,
  3607. // () => PMModuleLogicDAL.AddBarCodeMissing(barcode, produceid, sUserInfo));
  3608. actionResult.Result = JsonHelper.ToJson(returnValue);
  3609. actionResult.Status = (int)Constant.PDAResult.Success;
  3610. }
  3611. catch (Exception ex)
  3612. {
  3613. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3614. OutputLog.TraceLog(LogPriority.Error,
  3615. this.ToString(),
  3616. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3617. ex.ToString(),
  3618. LocalPath.LogExePath);
  3619. actionResult.Status = (int)Constant.PDAResult.Exception;
  3620. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3621. }
  3622. return actionResult;
  3623. }
  3624. /// <summary>
  3625. /// 获取登陆帐户有无报损审批权限
  3626. /// </summary>
  3627. /// <param name="accountCode"></param>
  3628. /// <param name="userCode"></param>
  3629. /// <param name="userPassword"></param>
  3630. /// <param name="sessionKey"></param>
  3631. /// <param name="usercode">工号编码</param>
  3632. /// <returns></returns>
  3633. public ActionResult GetScrapProductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  3634. {
  3635. ActionResult actionResult = new ActionResult();
  3636. try
  3637. {
  3638. // 验证请求头信息
  3639. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3640. // 验证失败
  3641. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3642. {
  3643. return actionResult;
  3644. }
  3645. int returnValue = ServiceInvoker.Invoke<int>(this,
  3646. () => PDAModuleLogic.GetScrapProductFuntion(sUserInfo));
  3647. actionResult.Result = JsonHelper.ToJson(returnValue);
  3648. actionResult.Status = (int)Constant.PDAResult.Success;
  3649. }
  3650. catch (Exception ex)
  3651. {
  3652. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3653. OutputLog.TraceLog(LogPriority.Error,
  3654. this.ToString(),
  3655. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3656. ex.ToString(),
  3657. LocalPath.LogExePath);
  3658. actionResult.Status = (int)Constant.PDAResult.Exception;
  3659. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3660. }
  3661. return actionResult;
  3662. }
  3663. /// <summary>
  3664. /// 获取登陆帐户有无报损审批权限
  3665. /// </summary>
  3666. /// <param name="accountCode"></param>
  3667. /// <param name="userCode"></param>
  3668. /// <param name="userPassword"></param>
  3669. /// <param name="sessionKey"></param>
  3670. /// <param name="usercode">工号编码</param>
  3671. /// <returns></returns>
  3672. public ActionResult GetSpecialRepairflagByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3673. {
  3674. ActionResult actionResult = new ActionResult();
  3675. try
  3676. {
  3677. // 验证请求头信息
  3678. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3679. // 验证失败
  3680. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3681. {
  3682. return actionResult;
  3683. }
  3684. int returnValue = ServiceInvoker.Invoke<int>(this,
  3685. () => PMModuleLogic.GetSpecialRepairflagByBarcode(barcode, sUserInfo));
  3686. actionResult.Result = JsonHelper.ToJson(returnValue);
  3687. actionResult.Status = (int)Constant.PDAResult.Success;
  3688. }
  3689. catch (Exception ex)
  3690. {
  3691. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3692. OutputLog.TraceLog(LogPriority.Error,
  3693. this.ToString(),
  3694. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3695. ex.ToString(),
  3696. LocalPath.LogExePath);
  3697. actionResult.Status = (int)Constant.PDAResult.Exception;
  3698. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3699. }
  3700. return actionResult;
  3701. }
  3702. /// <summary>
  3703. /// 获取窑车对应产品列表
  3704. /// </summary>
  3705. /// <param name="accountCode"></param>
  3706. /// <param name="userCode"></param>
  3707. /// <param name="userPassword"></param>
  3708. /// <param name="sessionKey"></param>
  3709. /// <param name="KilnCarID">窑车ID</param>
  3710. /// <returns>Dataset</returns>
  3711. public ActionResult GetKilnCarGoodsByKilnCarID(string accountCode, string userCode, string userPassword, string sessionKey, int KilnCarID)
  3712. {
  3713. ActionResult actionResult = new ActionResult();
  3714. try
  3715. {
  3716. // 验证请求头信息
  3717. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3718. // 验证失败
  3719. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3720. {
  3721. return actionResult;
  3722. }
  3723. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3724. () => PMModuleLogic.GetKilnCarGoodsByKilnCarID(KilnCarID));
  3725. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3726. {
  3727. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3728. actionResult.Status = (int)Constant.PDAResult.Success;
  3729. }
  3730. else
  3731. {
  3732. actionResult.Status = (int)Constant.PDAResult.Fail;
  3733. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3734. }
  3735. }
  3736. catch (Exception ex)
  3737. {
  3738. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3739. OutputLog.TraceLog(LogPriority.Error,
  3740. this.ToString(),
  3741. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3742. ex.ToString(),
  3743. LocalPath.LogExePath);
  3744. actionResult.Status = (int)Constant.PDAResult.Exception;
  3745. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3746. }
  3747. return actionResult;
  3748. }
  3749. /// <summary>
  3750. /// 更换条码
  3751. /// </summary>
  3752. /// <param name="accountCode"></param>
  3753. /// <param name="userCode"></param>
  3754. /// <param name="userPassword"></param>
  3755. /// <param name="sessionKey"></param>
  3756. ///<param name="barcode">原条码</param>
  3757. /// <param name="newBarcode">新条码</param>
  3758. /// <param name="remarks">备注</param>
  3759. /// <returns>操作结果</returns>
  3760. public ActionResult SaveBarCodeChange(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, string newBarcode, string remarks, string groutingUserCode, string goodsCode)
  3761. {
  3762. ActionResult actionResult = new ActionResult();
  3763. try
  3764. {
  3765. // 验证请求头信息
  3766. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3767. // 验证失败
  3768. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3769. {
  3770. return actionResult;
  3771. }
  3772. ServiceResultEntity serviceResultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  3773. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SetFPM0201Data(sUserInfo, barcode, newBarcode, remarks, groutingUserCode, goodsCode));
  3774. if (serviceResultEntity.Status == Constant.ServiceResultStatus.Success)
  3775. {
  3776. actionResult.Result = 1;
  3777. actionResult.Status = (int)Constant.PDAResult.Success;
  3778. }
  3779. else
  3780. {
  3781. actionResult.Status = (int)Constant.PDAResult.Fail;
  3782. actionResult.Message = serviceResultEntity.Message;
  3783. }
  3784. }
  3785. catch (Exception ex)
  3786. {
  3787. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3788. OutputLog.TraceLog(LogPriority.Error,
  3789. this.ToString(),
  3790. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3791. ex.ToString(),
  3792. LocalPath.LogExePath);
  3793. actionResult.Status = (int)Constant.PDAResult.Exception;
  3794. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3795. }
  3796. return actionResult;
  3797. }
  3798. /// <summary>
  3799. /// 获取(注浆登记)的查询数据
  3800. /// </summary>
  3801. /// <param name="accountCode"></param>
  3802. /// <param name="userCode"></param>
  3803. /// <param name="userPassword"></param>
  3804. /// <param name="sessionKey"></param>
  3805. /// <param name="se">查询条件</param>
  3806. /// <returns>Dataset</returns>
  3807. public ActionResult GetGroutingList(string accountCode, string userCode, string userPassword, string sessionKey, FPM0202_SE se)
  3808. {
  3809. ActionResult actionResult = new ActionResult();
  3810. try
  3811. {
  3812. // 验证请求头信息
  3813. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3814. // 验证失败
  3815. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3816. {
  3817. return actionResult;
  3818. }
  3819. ServiceResultEntity serviceResultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  3820. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetFPM0202SData(sUserInfo, se));
  3821. if (serviceResultEntity.Status != Constant.ServiceResultStatus.NoSearchResults)
  3822. {
  3823. // PDA不显示的列删除掉
  3824. //serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingDailyDetailID");
  3825. //serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingDailyID");
  3826. serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingLineName");
  3827. serviceResultEntity.Data.Tables[0].Columns.Remove("UserCode");
  3828. serviceResultEntity.Data.Tables[0].Columns.Remove("GoodsName");
  3829. serviceResultEntity.Data.Tables[0].Columns.Remove("GMouldStatusName");
  3830. serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingCount");
  3831. serviceResultEntity.Data.Tables[0].Columns.Remove("Remarks");
  3832. serviceResultEntity.Data.Tables[0].Columns.Remove("GMouldTypeName");
  3833. //serviceResultEntity.Data.Tables[0].Columns.Remove("DMUserCode");
  3834. serviceResultEntity.Data.Tables[0].Columns.Remove("IsPublicBody");
  3835. actionResult.Result = JsonHelper.ToJson(serviceResultEntity.Data.Tables[0]);
  3836. actionResult.Status = (int)Constant.PDAResult.Success;
  3837. }
  3838. else
  3839. {
  3840. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3841. actionResult.Message = "无查询数据";
  3842. }
  3843. }
  3844. catch (Exception ex)
  3845. {
  3846. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3847. OutputLog.TraceLog(LogPriority.Error,
  3848. this.ToString(),
  3849. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3850. ex.ToString(),
  3851. LocalPath.LogExePath);
  3852. actionResult.Status = (int)Constant.PDAResult.Exception;
  3853. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3854. }
  3855. return actionResult;
  3856. }
  3857. /// <summary>
  3858. /// 获取(注浆登记)的查询数据
  3859. /// </summary>
  3860. /// <param name="accountCode"></param>
  3861. /// <param name="userCode"></param>
  3862. /// <param name="userPassword"></param>
  3863. /// <param name="sessionKey"></param>
  3864. /// <param name="se">查询条件</param>
  3865. /// <returns>Dataset</returns>
  3866. public ActionResult GetGroutingListByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3867. {
  3868. ActionResult actionResult = new ActionResult();
  3869. try
  3870. {
  3871. // 验证请求头信息
  3872. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3873. // 验证失败
  3874. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3875. {
  3876. return actionResult;
  3877. }
  3878. ServiceResultEntity serviceResultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  3879. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetFPM0203SData(sUserInfo, barcode));
  3880. if (serviceResultEntity.Status != Constant.ServiceResultStatus.NoSearchResults)
  3881. {
  3882. actionResult.Result = JsonHelper.ToJson(serviceResultEntity.Data.Tables[0]);
  3883. actionResult.Status = (int)Constant.PDAResult.Success;
  3884. }
  3885. else
  3886. {
  3887. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3888. actionResult.Message = "无查询数据";
  3889. }
  3890. }
  3891. catch (Exception ex)
  3892. {
  3893. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3894. OutputLog.TraceLog(LogPriority.Error,
  3895. this.ToString(),
  3896. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3897. ex.ToString(),
  3898. LocalPath.LogExePath);
  3899. actionResult.Status = (int)Constant.PDAResult.Exception;
  3900. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3901. }
  3902. return actionResult;
  3903. }
  3904. /// <summary>
  3905. ///获得成型线信息
  3906. /// </summary>
  3907. /// <param name="accountCode"></param>
  3908. /// <param name="userCode"></param>
  3909. /// <param name="userPassword"></param>
  3910. /// <param name="sessionKey"></param>
  3911. /// <param name="se">查询条件</param>
  3912. /// <returns>Dataset</returns>
  3913. public ActionResult GetGroutingLine(string accountCode, string userCode, string userPassword, string sessionKey, GroutingLineEntity groutingLineEntity)
  3914. {
  3915. ActionResult actionResult = new ActionResult();
  3916. try
  3917. {
  3918. // 验证请求头信息
  3919. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3920. // 验证失败
  3921. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3922. {
  3923. return actionResult;
  3924. }
  3925. DataSet dsReturn = ServiceInvoker.Invoke<DataSet>(this,
  3926. () => Dongke.IBOSS.PRD.Service.PCModuleLogic.PCModuleLogic.GetGroutingLine(groutingLineEntity, sUserInfo));
  3927. if (dsReturn != null && dsReturn.Tables[0].Rows.Count > 0)
  3928. {
  3929. actionResult.Result = JsonHelper.ToJson(dsReturn.Tables[0]);
  3930. actionResult.Status = (int)Constant.PDAResult.Success;
  3931. }
  3932. else
  3933. {
  3934. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3935. actionResult.Message = "无查询数据";
  3936. }
  3937. }
  3938. catch (Exception ex)
  3939. {
  3940. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3941. OutputLog.TraceLog(LogPriority.Error,
  3942. this.ToString(),
  3943. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3944. ex.ToString(),
  3945. LocalPath.LogExePath);
  3946. actionResult.Status = (int)Constant.PDAResult.Exception;
  3947. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3948. }
  3949. return actionResult;
  3950. }
  3951. /// <summary>
  3952. ///获取在产产品的信息标识列表
  3953. /// </summary>
  3954. /// <param name="accountCode"></param>
  3955. /// <param name="userCode"></param>
  3956. /// <param name="userPassword"></param>
  3957. /// <param name="sessionKey"></param>
  3958. /// <param name="barcode">查询条件</param>
  3959. /// <returns>Dataset</returns>
  3960. public ActionResult GetInProductionDataList(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3961. {
  3962. ActionResult actionResult = new ActionResult();
  3963. try
  3964. {
  3965. // 验证请求头信息
  3966. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3967. // 验证失败
  3968. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3969. {
  3970. return actionResult;
  3971. }
  3972. DataSet dsReturn = ServiceInvoker.Invoke<DataSet>(this,
  3973. () => PMModuleLogic.GetInProductionDataList(barcode));
  3974. if (dsReturn != null && dsReturn.Tables[0].Rows.Count > 0)
  3975. {
  3976. actionResult.Result = JsonHelper.ToJson(dsReturn.Tables[0]);
  3977. actionResult.Status = (int)Constant.PDAResult.Success;
  3978. }
  3979. else
  3980. {
  3981. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3982. actionResult.Message = "无查询数据";
  3983. }
  3984. }
  3985. catch (Exception ex)
  3986. {
  3987. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3988. OutputLog.TraceLog(LogPriority.Error,
  3989. this.ToString(),
  3990. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3991. ex.ToString(),
  3992. LocalPath.LogExePath);
  3993. actionResult.Status = (int)Constant.PDAResult.Exception;
  3994. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3995. }
  3996. return actionResult;
  3997. }
  3998. /// <summary>
  3999. ///获取条码是否注浆登记过,0行无效
  4000. /// </summary>
  4001. /// <param name="accountCode"></param>
  4002. /// <param name="userCode"></param>
  4003. /// <param name="userPassword"></param>
  4004. /// <param name="sessionKey"></param>
  4005. /// <param name="barcode">查询条件</param>
  4006. /// <returns>Dataset</returns>
  4007. public ActionResult GetBarCodeInGroutingDailyDetail(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  4008. {
  4009. ActionResult actionResult = new ActionResult();
  4010. try
  4011. {
  4012. // 验证请求头信息
  4013. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4014. // 验证失败
  4015. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4016. {
  4017. return actionResult;
  4018. }
  4019. DataSet dsReturn = ServiceInvoker.Invoke<DataSet>(this,
  4020. () => PMModuleLogic.GetBarCodeInGroutingDailyDetail(barcode));
  4021. if (dsReturn != null && dsReturn.Tables[0].Rows.Count > 0)
  4022. {
  4023. actionResult.Result = JsonHelper.ToJson(dsReturn.Tables[0]);
  4024. actionResult.Status = (int)Constant.PDAResult.Success;
  4025. }
  4026. else
  4027. {
  4028. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  4029. actionResult.Message = "该产品条码无效,无法报损!";
  4030. }
  4031. }
  4032. catch (Exception ex)
  4033. {
  4034. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4035. OutputLog.TraceLog(LogPriority.Error,
  4036. this.ToString(),
  4037. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4038. ex.ToString(),
  4039. LocalPath.LogExePath);
  4040. actionResult.Status = (int)Constant.PDAResult.Exception;
  4041. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4042. }
  4043. return actionResult;
  4044. }
  4045. /// <summary>
  4046. /// 获取登陆帐户有变更条码权限
  4047. /// </summary>
  4048. /// <param name="accountCode"></param>
  4049. /// <param name="userCode"></param>
  4050. /// <param name="userPassword"></param>
  4051. /// <param name="sessionKey"></param>
  4052. /// <returns></returns>
  4053. public ActionResult GetBarCodeRecordFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  4054. {
  4055. ActionResult actionResult = new ActionResult();
  4056. try
  4057. {
  4058. // 验证请求头信息
  4059. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4060. // 验证失败
  4061. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4062. {
  4063. return actionResult;
  4064. }
  4065. int returnValue = ServiceInvoker.Invoke<int>(this,
  4066. () => PDAModuleLogic.GetBarCodeRecordFuntion(sUserInfo));
  4067. actionResult.Result = JsonHelper.ToJson(returnValue);
  4068. actionResult.Status = (int)Constant.PDAResult.Success;
  4069. }
  4070. catch (Exception ex)
  4071. {
  4072. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4073. OutputLog.TraceLog(LogPriority.Error,
  4074. this.ToString(),
  4075. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4076. ex.ToString(),
  4077. LocalPath.LogExePath);
  4078. actionResult.Status = (int)Constant.PDAResult.Exception;
  4079. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4080. }
  4081. return actionResult;
  4082. }
  4083. /// <summary>
  4084. /// 成检时获取此条码是否报损
  4085. /// </summary>
  4086. /// <param name="accountCode"></param>
  4087. /// <param name="userCode"></param>
  4088. /// <param name="userPassword"></param>
  4089. /// <param name="sessionKey"></param>
  4090. /// <param name="barcode">产品条码</param>
  4091. /// <returns></returns>
  4092. public ActionResult CheckScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  4093. {
  4094. ActionResult actionResult = new ActionResult();
  4095. try
  4096. {
  4097. // 验证请求头信息
  4098. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4099. // 验证失败
  4100. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4101. {
  4102. return actionResult;
  4103. }
  4104. int returnValue = ServiceInvoker.Invoke<int>(this,
  4105. () => PMModuleLogic.CheckScrapProduct(barcode));
  4106. if (returnValue == -100)
  4107. {
  4108. actionResult.Result = JsonHelper.ToJson(returnValue);
  4109. actionResult.Status = (int)Constant.PDAResult.Success;
  4110. }
  4111. else
  4112. {
  4113. actionResult.Status = (int)Constant.PDAResult.Fail;
  4114. if (returnValue == 0)
  4115. {
  4116. actionResult.Message = "该条码:" + barcode + "存在报损记录(待审批)";
  4117. }
  4118. else
  4119. {
  4120. actionResult.Message = "该条码:" + barcode + "存在报损记录(审批通过)";
  4121. }
  4122. }
  4123. }
  4124. catch (Exception ex)
  4125. {
  4126. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4127. OutputLog.TraceLog(LogPriority.Error,
  4128. this.ToString(),
  4129. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4130. ex.ToString(),
  4131. LocalPath.LogExePath);
  4132. actionResult.Status = (int)Constant.PDAResult.Exception;
  4133. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4134. }
  4135. return actionResult;
  4136. }
  4137. /// <summary>
  4138. /// 获取产品完成工序的ID(PDA)
  4139. /// </summary>
  4140. /// <param name="barcode">产品条码</param>
  4141. /// <returns>int</returns>
  4142. public ActionResult GetCompleteProcedureIDPDA(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  4143. {
  4144. ActionResult actionResult = new ActionResult();
  4145. try
  4146. {
  4147. // 验证请求头信息
  4148. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4149. // 验证失败
  4150. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4151. {
  4152. return actionResult;
  4153. }
  4154. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4155. () => PMModuleLogic.GetCompleteProcedureIDPDA(barcode));
  4156. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  4157. actionResult.Status = (int)Constant.PDAResult.Success;
  4158. }
  4159. catch (Exception ex)
  4160. {
  4161. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4162. OutputLog.TraceLog(LogPriority.Error,
  4163. this.ToString(),
  4164. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4165. ex.ToString(),
  4166. LocalPath.LogExePath);
  4167. actionResult.Status = (int)Constant.PDAResult.Exception;
  4168. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4169. }
  4170. return actionResult;
  4171. }
  4172. /// <summary>
  4173. /// 获取产品完成工序的ID(PDA)
  4174. /// </summary>
  4175. /// <param name="barcode">产品条码</param>
  4176. /// <returns>int</returns>
  4177. public ActionResult GetGoodsInfoBybarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  4178. {
  4179. ActionResult actionResult = new ActionResult();
  4180. try
  4181. {
  4182. // 验证请求头信息
  4183. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4184. // 验证失败
  4185. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4186. {
  4187. return actionResult;
  4188. }
  4189. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4190. () => PMModuleLogic.GetGoodsInfoBybarcode(barcode));
  4191. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  4192. actionResult.Status = (int)Constant.PDAResult.Success;
  4193. }
  4194. catch (Exception ex)
  4195. {
  4196. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4197. OutputLog.TraceLog(LogPriority.Error,
  4198. this.ToString(),
  4199. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4200. ex.ToString(),
  4201. LocalPath.LogExePath);
  4202. actionResult.Status = (int)Constant.PDAResult.Exception;
  4203. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4204. }
  4205. return actionResult;
  4206. }
  4207. /// <summary>
  4208. /// 成检-校验生产工号
  4209. /// </summary>
  4210. /// <param name="usercode">生产工号</param>
  4211. /// <returns>int</returns>
  4212. public ActionResult GetUserCode(string accountCode, string userCode, string userPassword, string sessionKey, string usercode)
  4213. {
  4214. ActionResult actionResult = new ActionResult();
  4215. try
  4216. {
  4217. // 验证请求头信息
  4218. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4219. // 验证失败
  4220. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4221. {
  4222. return actionResult;
  4223. }
  4224. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4225. () => PDAModuleLogic.GetUserCode(usercode, sUserInfo));
  4226. actionResult.Result = JsonHelper.ToJson(ds);
  4227. actionResult.Status = (int)Constant.PDAResult.Success;
  4228. }
  4229. catch (Exception ex)
  4230. {
  4231. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4232. OutputLog.TraceLog(LogPriority.Error,
  4233. this.ToString(),
  4234. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4235. ex.ToString(),
  4236. LocalPath.LogExePath);
  4237. actionResult.Status = (int)Constant.PDAResult.Exception;
  4238. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4239. }
  4240. return actionResult;
  4241. }
  4242. /// <summary>
  4243. /// 更新漏扫的成型工号
  4244. /// </summary>
  4245. /// <param name="accountCode"></param>
  4246. /// <param name="userCode"></param>
  4247. /// <param name="userPassword"></param>
  4248. /// <param name="sessionKey"></param>
  4249. /// <param name="groutingUserCode">成型工号</param>
  4250. /// <param name="missingID">漏扫ID</param>
  4251. /// <returns></returns>
  4252. public ActionResult UpdateGroutingUserCodeByMissingID(string accountCode, string userCode, string userPassword, string sessionKey, string groutingUserCode, int missingID)
  4253. {
  4254. ActionResult actionResult = new ActionResult();
  4255. try
  4256. {
  4257. // 验证请求头信息
  4258. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4259. // 验证失败
  4260. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4261. {
  4262. return actionResult;
  4263. }
  4264. int returnValue = ServiceInvoker.Invoke<int>(this,
  4265. () => PMModuleLogicDAL.UpdateGroutingUserCodeByMissingID(groutingUserCode, missingID, sUserInfo));
  4266. if (returnValue != -1)
  4267. {
  4268. actionResult.Result = JsonHelper.ToJson(returnValue);
  4269. actionResult.Status = (int)Constant.PDAResult.Success;
  4270. }
  4271. else
  4272. {
  4273. actionResult.Status = (int)Constant.PDAResult.Fail;
  4274. actionResult.Message = "存在无效的漏扫工号";
  4275. }
  4276. }
  4277. catch (Exception ex)
  4278. {
  4279. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4280. OutputLog.TraceLog(LogPriority.Error,
  4281. this.ToString(),
  4282. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4283. ex.ToString(),
  4284. LocalPath.LogExePath);
  4285. actionResult.Status = (int)Constant.PDAResult.Exception;
  4286. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4287. }
  4288. return actionResult;
  4289. }
  4290. /// <summary>
  4291. /// 在入窑工序检验窑车号是否存在
  4292. /// </summary>
  4293. /// <param name="accountCode"></param>
  4294. /// <param name="userCode"></param>
  4295. /// <param name="userPassword"></param>
  4296. /// <param name="sessionKey"></param>
  4297. /// <param name="kilncarcode">窑车编码</param>
  4298. /// <param name="procedureid">工序ID</param>
  4299. /// <returns></returns>
  4300. public ActionResult CheckKilnCarByIntoCar(string accountCode, string userCode, string userPassword, string sessionKey, string kilncarcode, int procedureid)
  4301. {
  4302. ActionResult actionResult = new ActionResult();
  4303. try
  4304. {
  4305. // 验证请求头信息
  4306. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4307. // 验证失败
  4308. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4309. {
  4310. return actionResult;
  4311. }
  4312. int returnValue = ServiceInvoker.Invoke<int>(this,
  4313. () => PMModuleLogicDAL.CheckKilnCarByIntoCar(kilncarcode, procedureid, sUserInfo));
  4314. if (returnValue == 1)
  4315. {
  4316. actionResult.Result = JsonHelper.ToJson(returnValue);
  4317. actionResult.Status = (int)Constant.PDAResult.Success;
  4318. }
  4319. else
  4320. {
  4321. actionResult.Status = (int)Constant.PDAResult.Fail;
  4322. if (returnValue == -99)
  4323. actionResult.Message = "窑炉车号无效";
  4324. else if (returnValue == -98)
  4325. actionResult.Message = "窑车己无产品";
  4326. else if (returnValue == -97)
  4327. actionResult.Message = "窑车没有入窑,不可以撤销";
  4328. else if (returnValue == -1)
  4329. actionResult.Message = "保存失败";
  4330. }
  4331. }
  4332. catch (Exception ex)
  4333. {
  4334. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4335. OutputLog.TraceLog(LogPriority.Error,
  4336. this.ToString(),
  4337. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4338. ex.ToString(),
  4339. LocalPath.LogExePath);
  4340. actionResult.Status = (int)Constant.PDAResult.Exception;
  4341. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4342. }
  4343. return actionResult;
  4344. }
  4345. /// <summary>
  4346. /// 获取盘点单列表
  4347. /// </summary>
  4348. /// <param name="sUserInfo"></param>
  4349. /// <returns></returns>
  4350. public ActionResult GetInCheckedList(string accountCode, string userCode, string userPassword, string sessionKey)
  4351. {
  4352. ActionResult actionResult = new ActionResult();
  4353. try
  4354. {
  4355. // 验证请求头信息
  4356. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4357. // 验证失败
  4358. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4359. {
  4360. return actionResult;
  4361. }
  4362. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4363. () => PMModuleLogic.GetInCheckedList(sUserInfo));
  4364. actionResult.Result = JsonHelper.ToJson(ds);
  4365. actionResult.Status = (int)Constant.PDAResult.Success;
  4366. }
  4367. catch (Exception ex)
  4368. {
  4369. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4370. OutputLog.TraceLog(LogPriority.Error,
  4371. this.ToString(),
  4372. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4373. ex.ToString(),
  4374. LocalPath.LogExePath);
  4375. actionResult.Status = (int)Constant.PDAResult.Exception;
  4376. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4377. }
  4378. return actionResult;
  4379. }
  4380. /// <summary>
  4381. /// 进行盘点操作
  4382. /// </summary>
  4383. /// <param name="accountCode"></param>
  4384. /// <param name="userCode"></param>
  4385. /// <param name="userPassword"></param>
  4386. /// <param name="sessionKey"></param>
  4387. /// <param name="InCheckedID">盘点单ID</param>
  4388. /// <param name="BarCode">产品条码</param>
  4389. /// <returns></returns>
  4390. public ActionResult UpdateInChecked(string accountCode, string userCode, string userPassword, string sessionKey, int InCheckedID, string BarCode)
  4391. {
  4392. ActionResult actionResult = new ActionResult();
  4393. try
  4394. {
  4395. // 验证请求头信息
  4396. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4397. // 验证失败
  4398. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4399. {
  4400. return actionResult;
  4401. }
  4402. int returnValue = ServiceInvoker.Invoke<int>(this,
  4403. () => PMModuleLogicDAL.UpdateInChecked(InCheckedID, BarCode, sUserInfo));
  4404. if (returnValue > 0)
  4405. {
  4406. actionResult.Result = JsonHelper.ToJson(returnValue);
  4407. actionResult.Status = (int)Constant.PDAResult.Success;
  4408. actionResult.Message = "产品" + BarCode + "盘点成功";
  4409. }
  4410. else if (returnValue == 10)
  4411. {
  4412. actionResult.Result = JsonHelper.ToJson(returnValue);
  4413. actionResult.Status = (int)Constant.PDAResult.Success;
  4414. actionResult.Message = "产品" + BarCode + "盘盈成功";
  4415. }
  4416. else
  4417. {
  4418. actionResult.Status = (int)Constant.PDAResult.Fail;
  4419. if (returnValue == -2)
  4420. actionResult.Message = "产品" + BarCode + "不是在产产品";
  4421. //if (returnValue == 10)
  4422. // actionResult.Message = "产品" + BarCode + "盘盈成功";
  4423. //if (returnValue > 0)
  4424. // actionResult.Message = "产品" + BarCode + "盘点成功";
  4425. if (returnValue == -22)
  4426. actionResult.Message = "产品" + BarCode + "己被其他工号盘点";
  4427. if (returnValue == -23)
  4428. actionResult.Message = "产品" + BarCode + "己被其他工号盘盈";
  4429. if (returnValue == -24)
  4430. actionResult.Message = "产品" + BarCode + "己被此工号盘点";
  4431. if (returnValue == -25)
  4432. actionResult.Message = "产品" + BarCode + "己被此工号盘盈";
  4433. else if (returnValue == 0)
  4434. actionResult.Message = "盘点失败";
  4435. }
  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. #region 班次配置
  4451. /// <summary>
  4452. /// 班次配置-通过工号获取工种列表
  4453. /// </summary>
  4454. /// <param name="userId">工号ID</param>
  4455. /// <returns></returns>
  4456. public ActionResult BindUserJobs(string accountCode, string userCode, string userPassword, string sessionKey, int userId)
  4457. {
  4458. ActionResult actionResult = new ActionResult();
  4459. try
  4460. {
  4461. // 验证请求头信息
  4462. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4463. // 验证失败
  4464. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4465. {
  4466. return actionResult;
  4467. }
  4468. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4469. () => SystemModuleLogic.GetJobByUserId(userId));
  4470. actionResult.Result = JsonHelper.ToJson(ds);
  4471. actionResult.Status = (int)Constant.PDAResult.Success;
  4472. }
  4473. catch (Exception ex)
  4474. {
  4475. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4476. OutputLog.TraceLog(LogPriority.Error,
  4477. this.ToString(),
  4478. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4479. ex.ToString(),
  4480. LocalPath.LogExePath);
  4481. actionResult.Status = (int)Constant.PDAResult.Exception;
  4482. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4483. }
  4484. return actionResult;
  4485. }
  4486. ///// <summary>
  4487. ///// 班次配置-根据工号查询员工档案信息
  4488. ///// </summary>
  4489. ///// <param name="userId">工号ID</param>
  4490. ///// <returns></returns>
  4491. //public ActionResult SearchHrStaffInfo(string accountCode, string userCode, string userPassword, string sessionKey, int userId)
  4492. //{
  4493. // ActionResult actionResult = new ActionResult();
  4494. // try
  4495. // {
  4496. // // 验证请求头信息
  4497. // actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4498. // // 验证失败
  4499. // if (actionResult.Status != (int)Constant.PDAResult.Success)
  4500. // {
  4501. // return actionResult;
  4502. // }
  4503. // DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4504. // () => HRModuleLogic.SearchHrStaffInfo(userId,sUserInfo));
  4505. // actionResult.Result = JsonHelper.ToJson(ds);
  4506. // actionResult.Status = (int)Constant.PDAResult.Success;
  4507. // }
  4508. // catch (Exception ex)
  4509. // {
  4510. // //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4511. // OutputLog.TraceLog(LogPriority.Error,
  4512. // this.ToString(),
  4513. // System.Reflection.MethodBase.GetCurrentMethod().Name,
  4514. // ex.ToString(),
  4515. // LocalPath.LogExePath);
  4516. // actionResult.Status = (int)Constant.PDAResult.Exception;
  4517. // actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4518. // }
  4519. // return actionResult;
  4520. //}
  4521. /// <summary>
  4522. /// 班次配置-根据员工姓名查员工信息
  4523. /// </summary>
  4524. /// <param name="searchStaffEntity"></param>
  4525. /// <returns></returns>
  4526. public ActionResult SearchStaffInfo(string accountCode, string userCode, string userPassword, string sessionKey, SearchStaffEntity searchStaffEntity)
  4527. {
  4528. ActionResult actionResult = new ActionResult();
  4529. try
  4530. {
  4531. // 验证请求头信息
  4532. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4533. // 验证失败
  4534. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4535. {
  4536. return actionResult;
  4537. }
  4538. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4539. () => PDAModuleLogic.SearchStaffInfo(searchStaffEntity, sUserInfo));
  4540. actionResult.Result = JsonHelper.ToJson(ds);
  4541. actionResult.Status = (int)Constant.PDAResult.Success;
  4542. }
  4543. catch (Exception ex)
  4544. {
  4545. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4546. OutputLog.TraceLog(LogPriority.Error,
  4547. this.ToString(),
  4548. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4549. ex.ToString(),
  4550. LocalPath.LogExePath);
  4551. actionResult.Status = (int)Constant.PDAResult.Exception;
  4552. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4553. }
  4554. return actionResult;
  4555. }
  4556. /// <summary>
  4557. /// 获取班次配置信息
  4558. /// </summary>
  4559. /// <param name="searchEntity"></param>
  4560. /// <returns></returns>
  4561. public ActionResult SearchClassesSetting(string accountCode, string userCode, string userPassword, string sessionKey, SearchClassesSettingEntity searchEntity)
  4562. {
  4563. ActionResult actionResult = new ActionResult();
  4564. try
  4565. {
  4566. // 验证请求头信息
  4567. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4568. // 验证失败
  4569. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4570. {
  4571. return actionResult;
  4572. }
  4573. searchEntity.StartAccountDate = Convert.ToDateTime(searchEntity.StartAccountDatePDA);
  4574. searchEntity.EndAccountDate = Convert.ToDateTime(searchEntity.EndAccountDatePDA).AddDays(1).AddMinutes(-1);
  4575. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4576. () => PCModuleLogic.SearchClassesSetting(searchEntity, sUserInfo));
  4577. actionResult.Result = JsonHelper.ToJson(ds);
  4578. actionResult.Status = (int)Constant.PDAResult.Success;
  4579. }
  4580. catch (Exception ex)
  4581. {
  4582. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4583. OutputLog.TraceLog(LogPriority.Error,
  4584. this.ToString(),
  4585. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4586. ex.ToString(),
  4587. LocalPath.LogExePath);
  4588. actionResult.Status = (int)Constant.PDAResult.Exception;
  4589. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4590. }
  4591. return actionResult;
  4592. }
  4593. public ActionResult SaveClassesSetting(string accountCode, string userCode, string userPassword, string sessionKey, ClassesSettingEntity setEntity, ClassesDetailSettingEntity[] setDetailEntity)
  4594. {
  4595. ActionResult actionResult = new ActionResult();
  4596. try
  4597. {
  4598. // 验证请求头信息
  4599. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4600. // 验证失败
  4601. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4602. {
  4603. return actionResult;
  4604. }
  4605. int returnValue = ServiceInvoker.Invoke<int>(this,
  4606. () => PDAModuleLogic.SaveClassesSetting(setEntity, setDetailEntity, sUserInfo));
  4607. if (returnValue > 0)
  4608. {
  4609. actionResult.Result = JsonHelper.ToJson(returnValue);
  4610. actionResult.Status = (int)Constant.PDAResult.Success;
  4611. }
  4612. else
  4613. {
  4614. actionResult.Status = (int)Constant.PDAResult.Fail;
  4615. actionResult.Message = "保存失败";
  4616. }
  4617. }
  4618. catch (Exception ex)
  4619. {
  4620. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4621. OutputLog.TraceLog(LogPriority.Error,
  4622. this.ToString(),
  4623. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4624. ex.ToString(),
  4625. LocalPath.LogExePath);
  4626. actionResult.Status = (int)Constant.PDAResult.Exception;
  4627. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4628. }
  4629. return actionResult;
  4630. }
  4631. /// <summary>
  4632. /// 班次配置--获取详细信息
  4633. /// </summary>
  4634. /// <param name="searchEntity"></param>
  4635. /// <returns></returns>
  4636. public ActionResult SearchClassesDetail(string accountCode, string userCode, string userPassword, string sessionKey, int classesSettingID)
  4637. {
  4638. ActionResult actionResult = new ActionResult();
  4639. try
  4640. {
  4641. // 验证请求头信息
  4642. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4643. // 验证失败
  4644. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4645. {
  4646. return actionResult;
  4647. }
  4648. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4649. () => PCModuleLogic.SearchClassesDetail(classesSettingID, sUserInfo));
  4650. actionResult.Result = JsonHelper.ToJson(ds);
  4651. actionResult.Status = (int)Constant.PDAResult.Success;
  4652. }
  4653. catch (Exception ex)
  4654. {
  4655. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4656. OutputLog.TraceLog(LogPriority.Error,
  4657. this.ToString(),
  4658. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4659. ex.ToString(),
  4660. LocalPath.LogExePath);
  4661. actionResult.Status = (int)Constant.PDAResult.Exception;
  4662. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4663. }
  4664. return actionResult;
  4665. }
  4666. /// <summary>
  4667. /// 获取用户是否有班次配置权限
  4668. /// </summary>
  4669. /// <param name="accountCode"></param>
  4670. /// <param name="userCode"></param>
  4671. /// <param name="userPassword"></param>
  4672. /// <param name="sessionKey"></param>
  4673. /// <returns></returns>
  4674. public ActionResult GetClassesSettingFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  4675. {
  4676. ActionResult actionResult = new ActionResult();
  4677. try
  4678. {
  4679. // 验证请求头信息
  4680. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4681. // 验证失败
  4682. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4683. {
  4684. return actionResult;
  4685. }
  4686. int returnValue = ServiceInvoker.Invoke<int>(this,
  4687. () => PDAModuleLogic.GetClassesSettingFuntion(sUserInfo));
  4688. actionResult.Result = JsonHelper.ToJson(returnValue);
  4689. actionResult.Status = (int)Constant.PDAResult.Success;
  4690. }
  4691. catch (Exception ex)
  4692. {
  4693. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4694. OutputLog.TraceLog(LogPriority.Error,
  4695. this.ToString(),
  4696. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4697. ex.ToString(),
  4698. LocalPath.LogExePath);
  4699. actionResult.Status = (int)Constant.PDAResult.Exception;
  4700. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4701. }
  4702. return actionResult;
  4703. }
  4704. /// <summary>
  4705. /// 获取盘点单列表
  4706. /// </summary>
  4707. /// <param name="sUserInfo"></param>
  4708. /// <returns></returns>
  4709. public ActionResult GetAllInChecked(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity)
  4710. {
  4711. ActionResult actionResult = new ActionResult();
  4712. try
  4713. {
  4714. // 验证请求头信息
  4715. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4716. // 验证失败
  4717. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4718. {
  4719. return actionResult;
  4720. }
  4721. entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA);
  4722. entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1);
  4723. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4724. () => PDAModuleLogic.GetAllInChecked(entity, sUserInfo));
  4725. actionResult.Result = JsonHelper.ToJson(ds);
  4726. actionResult.Status = (int)Constant.PDAResult.Success;
  4727. }
  4728. catch (Exception ex)
  4729. {
  4730. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4731. OutputLog.TraceLog(LogPriority.Error,
  4732. this.ToString(),
  4733. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4734. ex.ToString(),
  4735. LocalPath.LogExePath);
  4736. actionResult.Status = (int)Constant.PDAResult.Exception;
  4737. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4738. }
  4739. return actionResult;
  4740. }
  4741. #endregion
  4742. #region PDA报表
  4743. /// <summary>
  4744. /// 产品质量跟踪
  4745. /// </summary>
  4746. /// <param name="accountCode"></param>
  4747. /// <param name="userCode"></param>
  4748. /// <param name="userPassword"></param>
  4749. /// <param name="sessionKey"></param>
  4750. /// <param name="se"></param>
  4751. /// <returns></returns>
  4752. public ActionResult GetRPT040104SData(string accountCode, string userCode, string userPassword, string sessionKey, RPT040104_SE se)
  4753. {
  4754. ActionResult actionResult = new ActionResult();
  4755. try
  4756. {
  4757. // 验证请求头信息
  4758. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4759. // 验证失败
  4760. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4761. {
  4762. return actionResult;
  4763. }
  4764. se.CreateTimeStart = Convert.ToDateTime(se.CreateTimeStartPDA);
  4765. se.CreateTimeEnd = Convert.ToDateTime(se.CreateTimeEndPDA).AddDays(1);
  4766. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4767. () => PDAModuleLogic.GetRPT040104SData(sUserInfo, se));
  4768. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4769. {
  4770. actionResult.Status = (int)Constant.PDAResult.Fail;
  4771. actionResult.Message = Messages.MSG_CMN_I002;
  4772. }
  4773. else
  4774. {
  4775. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4776. actionResult.Status = (int)Constant.PDAResult.Success;
  4777. }
  4778. }
  4779. catch (Exception ex)
  4780. {
  4781. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4782. OutputLog.TraceLog(LogPriority.Error,
  4783. this.ToString(),
  4784. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4785. ex.ToString(),
  4786. LocalPath.LogExePath);
  4787. actionResult.Status = (int)Constant.PDAResult.Exception;
  4788. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4789. }
  4790. return actionResult;
  4791. }
  4792. /// <summary>
  4793. /// 工号产量质量分析表
  4794. /// </summary>
  4795. /// <param name="accountCode"></param>
  4796. /// <param name="userCode"></param>
  4797. /// <param name="userPassword"></param>
  4798. /// <param name="sessionKey"></param>
  4799. /// <param name="se"></param>
  4800. /// <returns></returns>
  4801. public ActionResult GetFP00002Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4802. int rptSProcedureID, string workcode, string date)
  4803. {
  4804. ActionResult actionResult = new ActionResult();
  4805. try
  4806. {
  4807. // 验证请求头信息
  4808. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4809. // 验证失败
  4810. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4811. {
  4812. return actionResult;
  4813. }
  4814. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4815. () => PDAModuleLogic.GetFP00002Data(sUserInfo, rptSProcedureID, workcode, Convert.ToDateTime(date)));
  4816. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4817. {
  4818. actionResult.Status = (int)Constant.PDAResult.Fail;
  4819. actionResult.Message = Messages.MSG_CMN_I002;
  4820. }
  4821. else
  4822. {
  4823. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4824. actionResult.Status = (int)Constant.PDAResult.Success;
  4825. }
  4826. }
  4827. catch (Exception ex)
  4828. {
  4829. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4830. OutputLog.TraceLog(LogPriority.Error,
  4831. this.ToString(),
  4832. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4833. ex.ToString(),
  4834. LocalPath.LogExePath);
  4835. actionResult.Status = (int)Constant.PDAResult.Exception;
  4836. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4837. }
  4838. return actionResult;
  4839. }
  4840. /// <summary>
  4841. /// 工号产量质量分析表(中陶)
  4842. /// </summary>
  4843. /// <param name="accountCode"></param>
  4844. /// <param name="userCode"></param>
  4845. /// <param name="userPassword"></param>
  4846. /// <param name="sessionKey"></param>
  4847. /// <param name="se"></param>
  4848. /// <returns></returns>
  4849. public ActionResult GetFP00002_1Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4850. int rptSProcedureID, string workcode, string date, string goodscode)
  4851. {
  4852. ActionResult actionResult = new ActionResult();
  4853. try
  4854. {
  4855. // 验证请求头信息
  4856. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4857. // 验证失败
  4858. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4859. {
  4860. return actionResult;
  4861. }
  4862. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4863. () => PDAModuleLogic.GetFP00002_1Data(sUserInfo, rptSProcedureID, workcode,
  4864. Convert.ToDateTime(date), goodscode));
  4865. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4866. {
  4867. actionResult.Status = (int)Constant.PDAResult.Fail;
  4868. actionResult.Message = Messages.MSG_CMN_I002;
  4869. }
  4870. else
  4871. {
  4872. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4873. actionResult.Status = (int)Constant.PDAResult.Success;
  4874. }
  4875. }
  4876. catch (Exception ex)
  4877. {
  4878. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4879. OutputLog.TraceLog(LogPriority.Error,
  4880. this.ToString(),
  4881. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4882. ex.ToString(),
  4883. LocalPath.LogExePath);
  4884. actionResult.Status = (int)Constant.PDAResult.Exception;
  4885. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4886. }
  4887. return actionResult;
  4888. }
  4889. /// <summary>
  4890. /// 半检数据统计表
  4891. /// </summary>
  4892. /// <param name="accountCode"></param>
  4893. /// <param name="userCode"></param>
  4894. /// <param name="userPassword"></param>
  4895. /// <param name="sessionKey"></param>
  4896. /// <param name="se"></param>
  4897. /// <returns></returns>
  4898. public ActionResult GetPDARPT000001Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4899. string workcode, string datebegin, string dateend)
  4900. {
  4901. ActionResult actionResult = new ActionResult();
  4902. try
  4903. {
  4904. // 验证请求头信息
  4905. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4906. // 验证失败
  4907. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4908. {
  4909. return actionResult;
  4910. }
  4911. DateTime datetimebegin = Convert.ToDateTime(datebegin);
  4912. DateTime datetimeend = Convert.ToDateTime(dateend);
  4913. datetimebegin = datetimebegin.Date;
  4914. datetimeend = datetimeend.Date.AddDays(1).AddSeconds(-1);
  4915. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4916. () => PDAModuleLogic.GetPDARPT000001Data(sUserInfo, workcode, datetimebegin, datetimeend));
  4917. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4918. {
  4919. actionResult.Status = (int)Constant.PDAResult.Fail;
  4920. actionResult.Message = Messages.MSG_CMN_I002;
  4921. }
  4922. else
  4923. {
  4924. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4925. actionResult.Status = (int)Constant.PDAResult.Success;
  4926. }
  4927. }
  4928. catch (Exception ex)
  4929. {
  4930. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4931. OutputLog.TraceLog(LogPriority.Error,
  4932. this.ToString(),
  4933. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4934. ex.ToString(),
  4935. LocalPath.LogExePath);
  4936. actionResult.Status = (int)Constant.PDAResult.Exception;
  4937. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4938. }
  4939. return actionResult;
  4940. }
  4941. /// <summary>
  4942. /// 工号质量统计表
  4943. /// </summary>
  4944. /// <param name="accountCode"></param>
  4945. /// <param name="userCode"></param>
  4946. /// <param name="userPassword"></param>
  4947. /// <param name="sessionKey"></param>
  4948. /// <param name="se"></param>
  4949. /// <returns></returns>
  4950. public ActionResult GetPDARPT000002Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4951. int rptSProcedureID, string workcode, string datebegin, string dateend)
  4952. {
  4953. ActionResult actionResult = new ActionResult();
  4954. try
  4955. {
  4956. // 验证请求头信息
  4957. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4958. // 验证失败
  4959. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4960. {
  4961. return actionResult;
  4962. }
  4963. DateTime datetimebegin = Convert.ToDateTime(datebegin);
  4964. DateTime datetimeend = Convert.ToDateTime(dateend);
  4965. datetimebegin = datetimebegin.Date;
  4966. datetimeend = datetimeend.Date.AddDays(1).AddSeconds(-1);
  4967. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4968. () => PDAModuleLogic.GetPDARPT000002Data(sUserInfo, rptSProcedureID, workcode, datetimebegin, datetimeend));
  4969. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4970. {
  4971. actionResult.Status = (int)Constant.PDAResult.Fail;
  4972. actionResult.Message = Messages.MSG_CMN_I002;
  4973. }
  4974. else
  4975. {
  4976. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4977. actionResult.Status = (int)Constant.PDAResult.Success;
  4978. }
  4979. }
  4980. catch (Exception ex)
  4981. {
  4982. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4983. OutputLog.TraceLog(LogPriority.Error,
  4984. this.ToString(),
  4985. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4986. ex.ToString(),
  4987. LocalPath.LogExePath);
  4988. actionResult.Status = (int)Constant.PDAResult.Exception;
  4989. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4990. }
  4991. return actionResult;
  4992. }
  4993. /// <summary>
  4994. /// 损坯数据统计表
  4995. /// </summary>
  4996. /// <param name="accountCode"></param>
  4997. /// <param name="userCode"></param>
  4998. /// <param name="userPassword"></param>
  4999. /// <param name="sessionKey"></param>
  5000. /// <param name="se"></param>
  5001. /// <returns></returns>
  5002. public ActionResult GetPDARPT000003Data(string accountCode, string userCode, string userPassword, string sessionKey,
  5003. string workcode, string datebegin, string dateend)
  5004. {
  5005. ActionResult actionResult = new ActionResult();
  5006. try
  5007. {
  5008. // 验证请求头信息
  5009. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5010. // 验证失败
  5011. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5012. {
  5013. return actionResult;
  5014. }
  5015. DateTime datetimebegin = Convert.ToDateTime(datebegin);
  5016. DateTime datetimeend = Convert.ToDateTime(dateend);
  5017. datetimebegin = datetimebegin.Date;
  5018. datetimeend = datetimeend.Date.AddDays(1).AddSeconds(-1);
  5019. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5020. () => PDAModuleLogic.GetPDARPT000003Data(sUserInfo, workcode, datetimebegin, datetimeend));
  5021. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  5022. {
  5023. actionResult.Status = (int)Constant.PDAResult.Fail;
  5024. actionResult.Message = Messages.MSG_CMN_I002;
  5025. }
  5026. else
  5027. {
  5028. actionResult.Result = JsonHelper.ToJson(sre.Data);
  5029. actionResult.Status = (int)Constant.PDAResult.Success;
  5030. }
  5031. }
  5032. catch (Exception ex)
  5033. {
  5034. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5035. OutputLog.TraceLog(LogPriority.Error,
  5036. this.ToString(),
  5037. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5038. ex.ToString(),
  5039. LocalPath.LogExePath);
  5040. actionResult.Status = (int)Constant.PDAResult.Exception;
  5041. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5042. }
  5043. return actionResult;
  5044. }
  5045. #endregion
  5046. /// <summary>
  5047. /// 取得报表数据源数据
  5048. /// </summary>
  5049. /// <param name="accountCode"></param>
  5050. /// <param name="userCode"></param>
  5051. /// <param name="userPassword"></param>
  5052. /// <param name="sessionKey"></param>
  5053. /// <returns></returns>
  5054. public ActionResult GetRptProcedureModule(string accountCode, string userCode, string userPassword, string sessionKey)
  5055. {
  5056. ActionResult actionResult = new ActionResult();
  5057. try
  5058. {
  5059. // 验证请求头信息
  5060. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5061. // 验证失败
  5062. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5063. {
  5064. return actionResult;
  5065. }
  5066. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5067. () => ReportModuleLogic.GetRptProcedureModule(sUserInfo));
  5068. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  5069. {
  5070. actionResult.Status = (int)Constant.PDAResult.Fail;
  5071. actionResult.Message = Messages.MSG_CMN_I002;
  5072. }
  5073. else
  5074. {
  5075. actionResult.Result = JsonHelper.ToJson(sre.Data);
  5076. actionResult.Status = (int)Constant.PDAResult.Success;
  5077. }
  5078. }
  5079. catch (Exception ex)
  5080. {
  5081. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5082. OutputLog.TraceLog(LogPriority.Error,
  5083. this.ToString(),
  5084. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5085. ex.ToString(),
  5086. LocalPath.LogExePath);
  5087. actionResult.Status = (int)Constant.PDAResult.Exception;
  5088. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5089. }
  5090. return actionResult;
  5091. }
  5092. /// <summary>
  5093. /// 取得报表的查询数据源统计工序数据
  5094. /// </summary>
  5095. /// <param name="accountCode"></param>
  5096. /// <param name="userCode"></param>
  5097. /// <param name="userPassword"></param>
  5098. /// <param name="sessionKey"></param>
  5099. /// <param name="RptProcedureID"></param>
  5100. /// <returns></returns>
  5101. public ActionResult GetRptSourceProcedureModule(string accountCode, string userCode, string userPassword, string sessionKey, int? RptProcedureID)
  5102. {
  5103. ActionResult actionResult = new ActionResult();
  5104. try
  5105. {
  5106. // 验证请求头信息
  5107. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5108. // 验证失败
  5109. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5110. {
  5111. return actionResult;
  5112. }
  5113. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5114. () => ReportModuleLogic.GetRptSourceProcedureModule(sUserInfo, RptProcedureID));
  5115. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  5116. {
  5117. actionResult.Status = (int)Constant.PDAResult.Fail;
  5118. actionResult.Message = Messages.MSG_CMN_I002;
  5119. }
  5120. else
  5121. {
  5122. actionResult.Result = JsonHelper.ToJson(sre.Data);
  5123. actionResult.Status = (int)Constant.PDAResult.Success;
  5124. }
  5125. }
  5126. catch (Exception ex)
  5127. {
  5128. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5129. OutputLog.TraceLog(LogPriority.Error,
  5130. this.ToString(),
  5131. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5132. ex.ToString(),
  5133. LocalPath.LogExePath);
  5134. actionResult.Status = (int)Constant.PDAResult.Exception;
  5135. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5136. }
  5137. return actionResult;
  5138. }
  5139. /// <summary>
  5140. /// 获取用户是否有统计产成品权限
  5141. /// </summary>
  5142. /// <param name="accountCode"></param>
  5143. /// <param name="userCode"></param>
  5144. /// <param name="userPassword"></param>
  5145. /// <param name="sessionKey"></param>
  5146. /// <returns></returns>
  5147. public ActionResult GetStatisticsFinishedProductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5148. {
  5149. ActionResult actionResult = new ActionResult();
  5150. try
  5151. {
  5152. // 验证请求头信息
  5153. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5154. // 验证失败
  5155. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5156. {
  5157. return actionResult;
  5158. }
  5159. int returnValue = ServiceInvoker.Invoke<int>(this,
  5160. () => PDAModuleLogic.GetStatisticsFinishedProductFuntion(sUserInfo));
  5161. actionResult.Result = JsonHelper.ToJson(returnValue);
  5162. actionResult.Status = (int)Constant.PDAResult.Success;
  5163. }
  5164. catch (Exception ex)
  5165. {
  5166. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5167. OutputLog.TraceLog(LogPriority.Error,
  5168. this.ToString(),
  5169. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5170. ex.ToString(),
  5171. LocalPath.LogExePath);
  5172. actionResult.Status = (int)Constant.PDAResult.Exception;
  5173. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5174. }
  5175. return actionResult;
  5176. }
  5177. /// <summary>
  5178. /// 获取用户是否有盘点权限
  5179. /// </summary>
  5180. /// <param name="accountCode"></param>
  5181. /// <param name="userCode"></param>
  5182. /// <param name="userPassword"></param>
  5183. /// <param name="sessionKey"></param>
  5184. /// <returns></returns>
  5185. public ActionResult GetInCheckedFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5186. {
  5187. ActionResult actionResult = new ActionResult();
  5188. try
  5189. {
  5190. // 验证请求头信息
  5191. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5192. // 验证失败
  5193. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5194. {
  5195. return actionResult;
  5196. }
  5197. int returnValue = ServiceInvoker.Invoke<int>(this,
  5198. () => PDAModuleLogic.GetInCheckedFuntion(sUserInfo));
  5199. actionResult.Result = JsonHelper.ToJson(returnValue);
  5200. actionResult.Status = (int)Constant.PDAResult.Success;
  5201. }
  5202. catch (Exception ex)
  5203. {
  5204. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5205. OutputLog.TraceLog(LogPriority.Error,
  5206. this.ToString(),
  5207. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5208. ex.ToString(),
  5209. LocalPath.LogExePath);
  5210. actionResult.Status = (int)Constant.PDAResult.Exception;
  5211. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5212. }
  5213. return actionResult;
  5214. }
  5215. /// <summary>
  5216. /// 根据条件查询是否存在班次配置
  5217. /// </summary>
  5218. /// <param name="accountCode"></param>
  5219. /// <param name="userCode"></param>
  5220. /// <param name="userPassword"></param>
  5221. /// <param name="sessionKey"></param>
  5222. /// <param name="userCode">工号编码</param>
  5223. /// <returns></returns>
  5224. public ActionResult GetClassesSetting(string accountCode, string userCode, string userPassword, string sessionKey, string uCode)
  5225. {
  5226. ActionResult actionResult = new ActionResult();
  5227. try
  5228. {
  5229. // 验证请求头信息
  5230. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5231. // 验证失败
  5232. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5233. {
  5234. return actionResult;
  5235. }
  5236. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  5237. () => PDAModuleLogic.GetClassesSetting(uCode, sUserInfo));
  5238. actionResult.Result = JsonHelper.ToJson(ds);
  5239. actionResult.Status = (int)Constant.PDAResult.Success;
  5240. }
  5241. catch (Exception ex)
  5242. {
  5243. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5244. OutputLog.TraceLog(LogPriority.Error,
  5245. this.ToString(),
  5246. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5247. ex.ToString(),
  5248. LocalPath.LogExePath);
  5249. actionResult.Status = (int)Constant.PDAResult.Exception;
  5250. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5251. }
  5252. return actionResult;
  5253. }
  5254. /// <summary>
  5255. /// 报损工序查出工号根据生产数据ID
  5256. /// </summary>
  5257. /// <param name="accountCode"></param>
  5258. /// <param name="userCode"></param>
  5259. /// <param name="userPassword"></param>
  5260. /// <param name="sessionKey"></param>
  5261. /// <param name="ProductionDataID">生产数据ID</param>
  5262. /// <returns></returns>
  5263. public ActionResult GetScrapProductUserCodeByProductionDataID(string accountCode, string userCode, string userPassword, string sessionKey, int ProductionDataID)
  5264. {
  5265. ActionResult actionResult = new ActionResult();
  5266. try
  5267. {
  5268. // 验证请求头信息
  5269. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5270. // 验证失败
  5271. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5272. {
  5273. return actionResult;
  5274. }
  5275. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  5276. () => PMModuleLogic.GetScrapProductUserCodeByProductionDataID(ProductionDataID));
  5277. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  5278. {
  5279. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  5280. actionResult.Status = (int)Constant.PDAResult.Success;
  5281. }
  5282. else
  5283. {
  5284. actionResult.Status = (int)Constant.PDAResult.Fail;
  5285. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5286. }
  5287. }
  5288. catch (Exception ex)
  5289. {
  5290. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5291. OutputLog.TraceLog(LogPriority.Error,
  5292. this.ToString(),
  5293. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5294. ex.ToString(),
  5295. LocalPath.LogExePath);
  5296. actionResult.Status = (int)Constant.PDAResult.Exception;
  5297. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5298. }
  5299. return actionResult;
  5300. }
  5301. /// <summary>
  5302. /// 在入窑工序检验窑车号是否存在
  5303. /// </summary>
  5304. /// <param name="accountCode"></param>
  5305. /// <param name="userCode"></param>
  5306. /// <param name="userPassword"></param>
  5307. /// <param name="sessionKey"></param>
  5308. /// <param name="kilncarcode">窑车编码</param>
  5309. /// <param name="procedureid">工序ID</param>
  5310. /// <returns></returns>
  5311. public ActionResult CheckKilnCarByIntoCar2(string accountCode, string userCode, string userPassword, string sessionKey, string kilncarcode, int procedureid)
  5312. {
  5313. ActionResult actionResult = new ActionResult();
  5314. try
  5315. {
  5316. // 验证请求头信息
  5317. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5318. // 验证失败
  5319. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5320. {
  5321. return actionResult;
  5322. }
  5323. int returnValue = ServiceInvoker.Invoke<int>(this,
  5324. () => PMModuleLogicDAL.CheckKilnCarByIntoCar2(kilncarcode, procedureid, sUserInfo));
  5325. if (returnValue == 1)
  5326. {
  5327. actionResult.Result = JsonHelper.ToJson(returnValue);
  5328. actionResult.Status = (int)Constant.PDAResult.Success;
  5329. }
  5330. else
  5331. {
  5332. actionResult.Status = (int)Constant.PDAResult.Fail;
  5333. if (returnValue == -99)
  5334. actionResult.Message = "窑炉车号无效";
  5335. else if (returnValue == -98)
  5336. actionResult.Message = "窑车己无产品";
  5337. else if (returnValue == -97)
  5338. actionResult.Message = "窑车没有入窑,不可以撤销";
  5339. else if (returnValue == -1)
  5340. actionResult.Message = "保存失败";
  5341. }
  5342. }
  5343. catch (Exception ex)
  5344. {
  5345. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5346. OutputLog.TraceLog(LogPriority.Error,
  5347. this.ToString(),
  5348. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5349. ex.ToString(),
  5350. LocalPath.LogExePath);
  5351. actionResult.Status = (int)Constant.PDAResult.Exception;
  5352. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5353. }
  5354. return actionResult;
  5355. }
  5356. /// <summary>
  5357. /// 撤销包装
  5358. /// </summary>
  5359. /// <param name="accountCode"></param>
  5360. /// <param name="userCode"></param>
  5361. /// <param name="userPassword"></param>
  5362. /// <param name="sessionKey"></param>
  5363. /// <param name="barcode"></param>
  5364. /// <returns></returns>
  5365. public ActionResult AddChancelFinishedproduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5366. {
  5367. ActionResult actionResult = new ActionResult();
  5368. try
  5369. {
  5370. // 验证请求头信息
  5371. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5372. // 验证失败
  5373. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5374. {
  5375. return actionResult;
  5376. }
  5377. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5378. () => PMModuleLogicDAL.AddChancelFinishedproduct(barcode, sUserInfo));
  5379. if (Convert.ToInt32(returnValue.Result) > 0)
  5380. {
  5381. actionResult.Result = JsonHelper.ToJson(returnValue);
  5382. actionResult.Status = (int)Constant.PDAResult.Success;
  5383. }
  5384. else
  5385. {
  5386. actionResult.Status = (int)Constant.PDAResult.Fail;
  5387. if (Convert.ToInt32(returnValue.Result) == -1)
  5388. actionResult.Message = "产品条码不存在包装记录";
  5389. else if (Convert.ToInt32(returnValue.Result) == -200)
  5390. actionResult.Message = returnValue.Message;
  5391. else
  5392. actionResult.Message = "成品撤销失败";
  5393. }
  5394. }
  5395. catch (Exception ex)
  5396. {
  5397. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5398. OutputLog.TraceLog(LogPriority.Error,
  5399. this.ToString(),
  5400. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5401. ex.ToString(),
  5402. LocalPath.LogExePath);
  5403. actionResult.Status = (int)Constant.PDAResult.Exception;
  5404. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5405. }
  5406. return actionResult;
  5407. }
  5408. /*
  5409. /// <summary>
  5410. /// 获取用户是否有撤销包装权限
  5411. /// </summary>
  5412. /// <param name="accountCode"></param>
  5413. /// <param name="userCode"></param>
  5414. /// <param name="userPassword"></param>
  5415. /// <param name="sessionKey"></param>
  5416. /// <returns></returns>
  5417. public ActionResult GetChancelFinishedproductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5418. {
  5419. ActionResult actionResult = new ActionResult();
  5420. try
  5421. {
  5422. // 验证请求头信息
  5423. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5424. // 验证失败
  5425. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5426. {
  5427. return actionResult;
  5428. }
  5429. int returnValue = ServiceInvoker.Invoke<int>(this,
  5430. () => PDAModuleLogic.GetChancelFinishedproductFuntion(sUserInfo));
  5431. actionResult.Result = JsonHelper.ToJson(returnValue);
  5432. actionResult.Status = (int)Constant.PDAResult.Success;
  5433. }
  5434. catch (Exception ex)
  5435. {
  5436. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5437. OutputLog.TraceLog(LogPriority.Error,
  5438. this.ToString(),
  5439. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5440. ex.ToString(),
  5441. LocalPath.LogExePath);
  5442. actionResult.Status = (int)Constant.PDAResult.Exception;
  5443. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5444. }
  5445. return actionResult;
  5446. }
  5447. */
  5448. /// <summary>
  5449. /// 窑车状态明细表查询
  5450. /// </summary>
  5451. /// <param name="accountCode"></param>
  5452. /// <param name="userCode"></param>
  5453. /// <param name="userPassword"></param>
  5454. /// <param name="sessionKey"></param>
  5455. /// <param name="kilnCarCode"></param>
  5456. /// <returns></returns>
  5457. public ActionResult GetKilnCarStatusDetailByCode(string accountCode, string userCode, string userPassword, string sessionKey, string kilnCarCode)
  5458. {
  5459. ActionResult actionResult = new ActionResult();
  5460. try
  5461. {
  5462. // 验证请求头信息
  5463. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5464. // 验证失败
  5465. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5466. {
  5467. return actionResult;
  5468. }
  5469. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5470. () => ReportModuleLogic.GetKilnCarStatusDetailByCode(kilnCarCode, sUserInfo));
  5471. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  5472. {
  5473. actionResult.Status = (int)Constant.PDAResult.Fail;
  5474. actionResult.Message = Messages.MSG_CMN_I002;
  5475. }
  5476. else
  5477. {
  5478. actionResult.Result = JsonHelper.ToJson(sre.Data);
  5479. actionResult.Status = (int)Constant.PDAResult.Success;
  5480. }
  5481. }
  5482. catch (Exception ex)
  5483. {
  5484. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5485. OutputLog.TraceLog(LogPriority.Error,
  5486. this.ToString(),
  5487. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5488. ex.ToString(),
  5489. LocalPath.LogExePath);
  5490. actionResult.Status = (int)Constant.PDAResult.Exception;
  5491. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5492. }
  5493. return actionResult;
  5494. }
  5495. /// <summary>
  5496. /// 损坯撤销
  5497. /// </summary>
  5498. /// <param name="accountCode"></param>
  5499. /// <param name="userCode"></param>
  5500. /// <param name="userPassword"></param>
  5501. /// <param name="sessionKey"></param>
  5502. /// <param name="barcode"></param>
  5503. /// <returns></returns>
  5504. public ActionResult AddCancelScrapProduction(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5505. {
  5506. ActionResult actionResult = new ActionResult();
  5507. try
  5508. {
  5509. // 验证请求头信息
  5510. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5511. // 验证失败
  5512. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5513. {
  5514. return actionResult;
  5515. }
  5516. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5517. () => PMModuleLogicDAL.AddCancelScrapProduction(barcode, sUserInfo));
  5518. if (Convert.ToInt32(returnValue.Result) > 0)
  5519. {
  5520. actionResult.Result = JsonHelper.ToJson(returnValue);
  5521. actionResult.Status = (int)Constant.PDAResult.Success;
  5522. }
  5523. else
  5524. {
  5525. actionResult.Status = (int)Constant.PDAResult.Fail;
  5526. if (Convert.ToInt32(returnValue.Result) == -1)
  5527. actionResult.Message = "此产品没有损坯,不能撤销";
  5528. else if (Convert.ToInt32(returnValue.Result) == -200)
  5529. actionResult.Message = returnValue.Message;
  5530. else
  5531. actionResult.Message = "损坯撤销失败";
  5532. }
  5533. }
  5534. catch (Exception ex)
  5535. {
  5536. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5537. OutputLog.TraceLog(LogPriority.Error,
  5538. this.ToString(),
  5539. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5540. ex.ToString(),
  5541. LocalPath.LogExePath);
  5542. actionResult.Status = (int)Constant.PDAResult.Exception;
  5543. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5544. }
  5545. return actionResult;
  5546. }
  5547. /*
  5548. /// <summary>
  5549. /// 获取用户是否有损坯撤销权限
  5550. /// </summary>
  5551. /// <param name="accountCode"></param>
  5552. /// <param name="userCode"></param>
  5553. /// <param name="userPassword"></param>
  5554. /// <param name="sessionKey"></param>
  5555. /// <returns></returns>
  5556. public ActionResult GetCancelScrapProductionFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5557. {
  5558. ActionResult actionResult = new ActionResult();
  5559. try
  5560. {
  5561. // 验证请求头信息
  5562. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5563. // 验证失败
  5564. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5565. {
  5566. return actionResult;
  5567. }
  5568. int returnValue = ServiceInvoker.Invoke<int>(this,
  5569. () => PDAModuleLogic.GetCancelScrapProductionFuntion(sUserInfo));
  5570. actionResult.Result = JsonHelper.ToJson(returnValue);
  5571. actionResult.Status = (int)Constant.PDAResult.Success;
  5572. }
  5573. catch (Exception ex)
  5574. {
  5575. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5576. OutputLog.TraceLog(LogPriority.Error,
  5577. this.ToString(),
  5578. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5579. ex.ToString(),
  5580. LocalPath.LogExePath);
  5581. actionResult.Status = (int)Constant.PDAResult.Exception;
  5582. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5583. }
  5584. return actionResult;
  5585. }
  5586. */
  5587. /// <summary>
  5588. /// 获取条码注浆信息
  5589. /// </summary>
  5590. /// <param name="accountCode"></param>
  5591. /// <param name="userCode"></param>
  5592. /// <param name="userPassword"></param>
  5593. /// <param name="sessionKey"></param>
  5594. /// <returns></returns>
  5595. public ActionResult GetGroutingInfoBybarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5596. {
  5597. ActionResult actionResult = new ActionResult();
  5598. try
  5599. {
  5600. // 验证请求头信息
  5601. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5602. // 验证失败
  5603. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5604. {
  5605. return actionResult;
  5606. }
  5607. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  5608. () => PMModuleLogic.GetGroutingInfoBybarcode(barcode, sUserInfo));
  5609. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  5610. {
  5611. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  5612. actionResult.Status = (int)Constant.PDAResult.Success;
  5613. }
  5614. else
  5615. {
  5616. actionResult.Status = (int)Constant.PDAResult.Fail;
  5617. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5618. }
  5619. }
  5620. catch (Exception ex)
  5621. {
  5622. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5623. OutputLog.TraceLog(LogPriority.Error,
  5624. this.ToString(),
  5625. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5626. ex.ToString(),
  5627. LocalPath.LogExePath);
  5628. actionResult.Status = (int)Constant.PDAResult.Exception;
  5629. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5630. }
  5631. return actionResult;
  5632. }
  5633. /// <summary>
  5634. /// 获取条码注浆信息
  5635. /// </summary>
  5636. /// <param name="accountCode"></param>
  5637. /// <param name="userCode"></param>
  5638. /// <param name="userPassword"></param>
  5639. /// <param name="sessionKey"></param>
  5640. /// <returns></returns>
  5641. public ActionResult GetFinishedProductGroutingInfoBybarcode(string accountCode, string userCode, string userPassword, string sessionKey, 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 dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  5654. () => PMModuleLogic.GetFinishedProductGroutingInfoBybarcode(barcode, sUserInfo));
  5655. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  5656. {
  5657. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.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. /// <param name="barcode"></param>
  5687. /// <returns></returns>
  5688. public ActionResult AddPublicBodyProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5689. {
  5690. ActionResult actionResult = new ActionResult();
  5691. try
  5692. {
  5693. // 验证请求头信息
  5694. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5695. // 验证失败
  5696. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5697. {
  5698. return actionResult;
  5699. }
  5700. int returnValue = ServiceInvoker.Invoke<int>(this,
  5701. () => PMModuleLogicDAL.AddPublicBodyProduct(barcode, sUserInfo));
  5702. if (returnValue > 0)
  5703. {
  5704. actionResult.Result = JsonHelper.ToJson(returnValue);
  5705. actionResult.Status = (int)Constant.PDAResult.Success;
  5706. }
  5707. else
  5708. {
  5709. actionResult.Status = (int)Constant.PDAResult.Fail;
  5710. if (returnValue == -1)
  5711. actionResult.Message = "此产品不在生产线上";
  5712. else if (returnValue == -2)
  5713. actionResult.Message = "该产品已经标识为公坯";
  5714. else
  5715. actionResult.Message = "公坯设定失败";
  5716. }
  5717. }
  5718. catch (Exception ex)
  5719. {
  5720. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5721. OutputLog.TraceLog(LogPriority.Error,
  5722. this.ToString(),
  5723. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5724. ex.ToString(),
  5725. LocalPath.LogExePath);
  5726. actionResult.Status = (int)Constant.PDAResult.Exception;
  5727. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5728. }
  5729. return actionResult;
  5730. }
  5731. /*
  5732. /// <summary>
  5733. /// 获取用户是否有公坯设定
  5734. /// </summary>
  5735. /// <param name="accountCode"></param>
  5736. /// <param name="userCode"></param>
  5737. /// <param name="userPassword"></param>
  5738. /// <param name="sessionKey"></param>
  5739. /// <returns></returns>
  5740. public ActionResult GetPublicBodyProductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5741. {
  5742. ActionResult actionResult = new ActionResult();
  5743. try
  5744. {
  5745. // 验证请求头信息
  5746. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5747. // 验证失败
  5748. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5749. {
  5750. return actionResult;
  5751. }
  5752. int returnValue = ServiceInvoker.Invoke<int>(this,
  5753. () => PDAModuleLogic.GetPublicBodyProductFuntion(sUserInfo));
  5754. actionResult.Result = JsonHelper.ToJson(returnValue);
  5755. actionResult.Status = (int)Constant.PDAResult.Success;
  5756. }
  5757. catch (Exception ex)
  5758. {
  5759. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5760. OutputLog.TraceLog(LogPriority.Error,
  5761. this.ToString(),
  5762. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5763. ex.ToString(),
  5764. LocalPath.LogExePath);
  5765. actionResult.Status = (int)Constant.PDAResult.Exception;
  5766. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5767. }
  5768. return actionResult;
  5769. }
  5770. */
  5771. /// <summary>
  5772. /// 校验产品条码是否可以走到该工序
  5773. /// </summary>
  5774. /// <param name="accountCode">帐套code</param>
  5775. /// <param name="userCode">用户code</param>
  5776. /// <param name="userPassword">用户密码</param>
  5777. /// <param name="sessionKey">本次登陆密钥</param>
  5778. /// <param name="procedureID">工序ID</param>
  5779. /// <param name="barcode">条码</param>
  5780. /// <returns></returns>
  5781. /// <remarks>
  5782. /// 陈冰 2014.09.18 新建
  5783. /// </remarks>
  5784. public ActionResult CheckBarcodeDeliverMud(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  5785. {
  5786. ActionResult actionResult = new ActionResult();
  5787. try
  5788. {
  5789. // 验证请求头信息
  5790. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5791. // 验证失败
  5792. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5793. {
  5794. return actionResult;
  5795. }
  5796. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  5797. () => PMModuleLogic.CheckBarcodeDeliverMud(procedureID, barcode, sUserInfo));
  5798. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  5799. {
  5800. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  5801. actionResult.Status = (int)Constant.PDAResult.Success;
  5802. }
  5803. else
  5804. {
  5805. actionResult.Status = (int)Constant.PDAResult.Fail;
  5806. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5807. }
  5808. }
  5809. catch (Exception ex)
  5810. {
  5811. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5812. OutputLog.TraceLog(LogPriority.Error,
  5813. this.ToString(),
  5814. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5815. ex.ToString(),
  5816. LocalPath.LogExePath);
  5817. actionResult.Status = (int)Constant.PDAResult.Exception;
  5818. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5819. }
  5820. return actionResult;
  5821. }
  5822. /// <summary>
  5823. /// 获取用户所有菜单权限
  5824. /// </summary>
  5825. /// <param name="accountCode"></param>
  5826. /// <param name="userCode"></param>
  5827. /// <param name="userPassword"></param>
  5828. /// <param name="sessionKey"></param>
  5829. /// <returns></returns>
  5830. public ActionResult GetUserAllFunction(string accountCode, string userCode, string userPassword, string sessionKey)
  5831. {
  5832. ActionResult actionResult = new ActionResult();
  5833. try
  5834. {
  5835. // 验证请求头信息
  5836. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5837. // 验证失败
  5838. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5839. {
  5840. return actionResult;
  5841. }
  5842. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  5843. () => PDAModuleLogic.GetUserAllFunction(sUserInfo));
  5844. actionResult.Result = JsonHelper.ToJson(returnValue);
  5845. actionResult.Status = (int)Constant.PDAResult.Success;
  5846. }
  5847. catch (Exception ex)
  5848. {
  5849. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5850. OutputLog.TraceLog(LogPriority.Error,
  5851. this.ToString(),
  5852. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5853. ex.ToString(),
  5854. LocalPath.LogExePath);
  5855. actionResult.Status = (int)Constant.PDAResult.Exception;
  5856. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5857. }
  5858. return actionResult;
  5859. }
  5860. public ActionResult AddChancelBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5861. {
  5862. ActionResult actionResult = new ActionResult();
  5863. try
  5864. {
  5865. // 验证请求头信息
  5866. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5867. // 验证失败
  5868. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5869. {
  5870. return actionResult;
  5871. }
  5872. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5873. () => PMModuleLogicDAL.AddChancelBarCode(barcode, sUserInfo));
  5874. if (Convert.ToInt32(returnValue.Result) > 0)
  5875. {
  5876. actionResult.Result = JsonHelper.ToJson(returnValue);
  5877. actionResult.Status = (int)Constant.PDAResult.Success;
  5878. }
  5879. else
  5880. {
  5881. actionResult.Status = (int)Constant.PDAResult.Fail;
  5882. if (Convert.ToInt32(returnValue.Result) == -1)
  5883. actionResult.Message = "无效条码";
  5884. else if (Convert.ToInt32(returnValue.Result) == -2)
  5885. actionResult.Message = "已经生产完成";
  5886. else if (Convert.ToInt32(returnValue.Result) == -3)
  5887. actionResult.Message = "条码已经申请报废";
  5888. else if (Convert.ToInt32(returnValue.Result) == -4)
  5889. actionResult.Message = "此条码当前工序不允许进行撤销";
  5890. else if (Convert.ToInt32(returnValue.Result) == -5)
  5891. actionResult.Message = "此条码没有生产数据";
  5892. else if (Convert.ToInt32(returnValue.Result) == -6)
  5893. actionResult.Message = "没有当前工序权限";
  5894. else if (Convert.ToInt32(returnValue.Result) == -7)
  5895. actionResult.Message = "条码不在生产线上";
  5896. else if (Convert.ToInt32(returnValue.Result) == -8)
  5897. actionResult.Message = "操作用户无此工序的撤销范围权限";
  5898. else if (Convert.ToInt32(returnValue.Result) == -9)
  5899. actionResult.Message = "条码已经是返工状态";
  5900. else if (Convert.ToInt32(returnValue.Result) == -200)
  5901. actionResult.Message = returnValue.Message;
  5902. }
  5903. }
  5904. catch (Exception ex)
  5905. {
  5906. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5907. OutputLog.TraceLog(LogPriority.Error,
  5908. this.ToString(),
  5909. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5910. ex.ToString(),
  5911. LocalPath.LogExePath);
  5912. actionResult.Status = (int)Constant.PDAResult.Exception;
  5913. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5914. }
  5915. return actionResult;
  5916. }
  5917. public ActionResult AddChancelDeliverMudBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5918. {
  5919. ActionResult actionResult = new ActionResult();
  5920. try
  5921. {
  5922. // 验证请求头信息
  5923. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5924. // 验证失败
  5925. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5926. {
  5927. return actionResult;
  5928. }
  5929. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5930. () => PMModuleLogicDAL.AddChancelDeliverMudBarCode(barcode, sUserInfo));
  5931. if (Convert.ToInt32(returnValue.Result) > 0)
  5932. {
  5933. actionResult.Result = JsonHelper.ToJson(returnValue);
  5934. actionResult.Status = (int)Constant.PDAResult.Success;
  5935. }
  5936. else
  5937. {
  5938. actionResult.Status = (int)Constant.PDAResult.Fail;
  5939. if (Convert.ToInt32(returnValue.Result) == -1)
  5940. actionResult.Message = "无效条码";
  5941. else if (Convert.ToInt32(returnValue.Result) == -2)
  5942. actionResult.Message = "已经生产完成";
  5943. else if (Convert.ToInt32(returnValue.Result) == -3)
  5944. actionResult.Message = "条码已经申请报废";
  5945. else if (Convert.ToInt32(returnValue.Result) == -4)
  5946. actionResult.Message = "此条码当前工序不允许进行撤销";
  5947. else if (Convert.ToInt32(returnValue.Result) == -5)
  5948. actionResult.Message = "此条码没有生产数据";
  5949. else if (Convert.ToInt32(returnValue.Result) == -55)
  5950. actionResult.Message = "条码已经不在交坯工序,不允许撤销";
  5951. else if (Convert.ToInt32(returnValue.Result) == -6)
  5952. actionResult.Message = "没有任何影响行";
  5953. else if (Convert.ToInt32(returnValue.Result) == -7)
  5954. actionResult.Message = "条码不在生产线上";
  5955. else if (Convert.ToInt32(returnValue.Result) == -8)
  5956. actionResult.Message = "条码已经是返工状态";
  5957. else if (Convert.ToInt32(returnValue.Result) == -200)
  5958. actionResult.Message = returnValue.Message;
  5959. }
  5960. }
  5961. catch (Exception ex)
  5962. {
  5963. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5964. OutputLog.TraceLog(LogPriority.Error,
  5965. this.ToString(),
  5966. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5967. ex.ToString(),
  5968. LocalPath.LogExePath);
  5969. actionResult.Status = (int)Constant.PDAResult.Exception;
  5970. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5971. }
  5972. return actionResult;
  5973. }
  5974. public ActionResult GetAllLogoInfo(string accountCode, string userCode, string userPassword, string sessionKey)
  5975. {
  5976. ActionResult actionResult = new ActionResult();
  5977. try
  5978. {
  5979. // 验证请求头信息
  5980. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5981. // 验证失败
  5982. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5983. {
  5984. return actionResult;
  5985. }
  5986. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  5987. //() => SystemModuleLogic.GetAllLogoInfo(sUserInfo));
  5988. () => SystemModuleLogic.GetLogoInfo(sUserInfo));
  5989. if (returnValue != null && returnValue.Tables[0].Rows.Count > 0)
  5990. {
  5991. //DataView dv = returnValue.Tables[0].DefaultView;
  5992. //dv.RowFilter = "ValueFlag=1";
  5993. //actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  5994. actionResult.Result = JsonHelper.ToJson(returnValue.Tables[0]);
  5995. actionResult.Status = (int)Constant.PDAResult.Success;
  5996. }
  5997. }
  5998. catch (Exception ex)
  5999. {
  6000. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6001. OutputLog.TraceLog(LogPriority.Error,
  6002. this.ToString(),
  6003. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6004. ex.ToString(),
  6005. LocalPath.LogExePath);
  6006. actionResult.Status = (int)Constant.PDAResult.Exception;
  6007. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6008. }
  6009. return actionResult;
  6010. }
  6011. /// <summary>
  6012. /// 变更产品商标用
  6013. /// </summary>
  6014. /// <param name="accountCode"></param>
  6015. /// <param name="userCode"></param>
  6016. /// <param name="userPassword"></param>
  6017. /// <param name="sessionKey"></param>
  6018. /// <param name="goodsid"></param>
  6019. /// <returns></returns>
  6020. public ActionResult GetLogoInfoForChange(string accountCode, string userCode, string userPassword, string sessionKey
  6021. , int goodsid)
  6022. {
  6023. ActionResult actionResult = new ActionResult();
  6024. try
  6025. {
  6026. // 验证请求头信息
  6027. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6028. // 验证失败
  6029. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6030. {
  6031. return actionResult;
  6032. }
  6033. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  6034. //() => SystemModuleLogic.GetAllLogoInfo(sUserInfo));
  6035. //() => SystemModuleLogic.GetLogoInfo(sUserInfo));
  6036. () => SystemModuleLogic.GetLogoInfoForChange(sUserInfo, goodsid));
  6037. if (returnValue != null && returnValue.Tables[0].Rows.Count > 0)
  6038. {
  6039. //DataView dv = returnValue.Tables[0].DefaultView;
  6040. //dv.RowFilter = "ValueFlag=1";
  6041. //actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  6042. actionResult.Result = JsonHelper.ToJson(returnValue.Tables[0]);
  6043. actionResult.Status = (int)Constant.PDAResult.Success;
  6044. }
  6045. }
  6046. catch (Exception ex)
  6047. {
  6048. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6049. OutputLog.TraceLog(LogPriority.Error,
  6050. this.ToString(),
  6051. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6052. ex.ToString(),
  6053. LocalPath.LogExePath);
  6054. actionResult.Status = (int)Constant.PDAResult.Exception;
  6055. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6056. }
  6057. return actionResult;
  6058. }
  6059. public ActionResult GetLogoID(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  6060. {
  6061. ActionResult actionResult = new ActionResult();
  6062. try
  6063. {
  6064. // 验证请求头信息
  6065. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6066. // 验证失败
  6067. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6068. {
  6069. return actionResult;
  6070. }
  6071. int returnValue = ServiceInvoker.Invoke<int>(this,
  6072. () => PMModuleLogic.GetLogoID(procedureID, sUserInfo));
  6073. actionResult.Result = JsonHelper.ToJson(returnValue);
  6074. actionResult.Status = (int)Constant.PDAResult.Success;
  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 SaveBarCodeLogo(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int logoid)
  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. int returnValue = ServiceInvoker.Invoke<int>(this,
  6102. () => PMModuleLogicDAL.SaveBarCodeLogo(barcode, logoid, sUserInfo));
  6103. actionResult.Result = JsonHelper.ToJson(returnValue);
  6104. // actionResult.Status = (int)Constant.PDAResult.Success;
  6105. if (returnValue > 0)
  6106. {
  6107. actionResult.Status = (int)Constant.PDAResult.Success;
  6108. }
  6109. else if (returnValue == -2)
  6110. {
  6111. //lsq 20210723 已注浆非产成品没有商标可以变更商标
  6112. //begin
  6113. //actionResult.Message = "条码不存在";
  6114. actionResult.Message = "该条码未注浆";
  6115. //end
  6116. actionResult.Status = (int)Constant.PDAResult.Fail;
  6117. }
  6118. else if (returnValue == -3)
  6119. {
  6120. actionResult.Message = "产成品不能变更商标";
  6121. actionResult.Status = (int)Constant.PDAResult.Fail;
  6122. }
  6123. else if (returnValue == -5)
  6124. {
  6125. actionResult.Message = "该商标已超过生产计划允许变更数量,不能变更商标";
  6126. actionResult.Status = (int)Constant.PDAResult.Fail;
  6127. }
  6128. else if (returnValue == -6)
  6129. {
  6130. actionResult.Message = "该商标无计划,不允许变更商标";
  6131. actionResult.Status = (int)Constant.PDAResult.Fail;
  6132. }
  6133. else
  6134. {
  6135. actionResult.Message = "保存失败";
  6136. actionResult.Status = (int)Constant.PDAResult.Fail;
  6137. }
  6138. }
  6139. catch (Exception ex)
  6140. {
  6141. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6142. OutputLog.TraceLog(LogPriority.Error,
  6143. this.ToString(),
  6144. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6145. ex.ToString(),
  6146. LocalPath.LogExePath);
  6147. actionResult.Status = (int)Constant.PDAResult.Exception;
  6148. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6149. }
  6150. return actionResult;
  6151. }
  6152. public ActionResult SaveBarCodeLogoAndGlazetype(string accountCode, string userCode, string userPassword, string sessionKey,
  6153. string barcode, int logoid, int glazetypeid)
  6154. {
  6155. ActionResult actionResult = new ActionResult();
  6156. try
  6157. {
  6158. // 验证请求头信息
  6159. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6160. // 验证失败
  6161. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6162. {
  6163. return actionResult;
  6164. }
  6165. int returnValue = ServiceInvoker.Invoke<int>(this,
  6166. () => PMModuleLogicDAL.SaveBarCodeLogoAndGlazetype(barcode, logoid, glazetypeid, sUserInfo));
  6167. actionResult.Result = JsonHelper.ToJson(returnValue);
  6168. if (returnValue > 0)
  6169. {
  6170. actionResult.Status = (int)Constant.PDAResult.Success;
  6171. }
  6172. else if (returnValue == -3)
  6173. {
  6174. actionResult.Message = "产成品不能变更商标";
  6175. actionResult.Status = (int)Constant.PDAResult.Fail;
  6176. }
  6177. else
  6178. {
  6179. actionResult.Status = (int)Constant.PDAResult.Fail;
  6180. actionResult.Message = "条码不存在";
  6181. }
  6182. }
  6183. catch (Exception ex)
  6184. {
  6185. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6186. OutputLog.TraceLog(LogPriority.Error,
  6187. this.ToString(),
  6188. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6189. ex.ToString(),
  6190. LocalPath.LogExePath);
  6191. actionResult.Status = (int)Constant.PDAResult.Exception;
  6192. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6193. }
  6194. return actionResult;
  6195. }
  6196. public ActionResult SaveBarCodesLogoAndGlazetype(string accountCode, string userCode, string userPassword, string sessionKey,
  6197. string barcodes, int logoid, int glazetypeid, int procedureID)
  6198. {
  6199. ActionResult actionResult = new ActionResult();
  6200. try
  6201. {
  6202. // 验证请求头信息
  6203. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6204. // 验证失败
  6205. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6206. {
  6207. return actionResult;
  6208. }
  6209. int returnValue = ServiceInvoker.Invoke<int>(this,
  6210. () => PMModuleLogicDAL.SaveBarCodesLogoAndGlazetype(barcodes, logoid, glazetypeid, procedureID, sUserInfo));
  6211. actionResult.Result = JsonHelper.ToJson(returnValue);
  6212. if (returnValue > 0)
  6213. {
  6214. actionResult.Status = (int)Constant.PDAResult.Success;
  6215. }
  6216. else
  6217. {
  6218. actionResult.Status = (int)Constant.PDAResult.Fail;
  6219. actionResult.Message = "条码不存在";
  6220. }
  6221. }
  6222. catch (Exception ex)
  6223. {
  6224. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6225. OutputLog.TraceLog(LogPriority.Error,
  6226. this.ToString(),
  6227. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6228. ex.ToString(),
  6229. LocalPath.LogExePath);
  6230. actionResult.Status = (int)Constant.PDAResult.Exception;
  6231. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6232. }
  6233. return actionResult;
  6234. }
  6235. public ActionResult GetBarCodeLogoID(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6236. {
  6237. ActionResult actionResult = new ActionResult();
  6238. try
  6239. {
  6240. // 验证请求头信息
  6241. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6242. // 验证失败
  6243. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6244. {
  6245. return actionResult;
  6246. }
  6247. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  6248. () => PMModuleLogic.GetBarCodeLogoID(barcode, sUserInfo));
  6249. if (returnValue != null && returnValue.Tables[0].Rows.Count > 0)
  6250. {
  6251. actionResult.Result = JsonHelper.ToJson(returnValue.Tables[0]);
  6252. actionResult.Status = (int)Constant.PDAResult.Success;
  6253. }
  6254. }
  6255. catch (Exception ex)
  6256. {
  6257. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6258. OutputLog.TraceLog(LogPriority.Error,
  6259. this.ToString(),
  6260. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6261. ex.ToString(),
  6262. LocalPath.LogExePath);
  6263. actionResult.Status = (int)Constant.PDAResult.Exception;
  6264. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6265. }
  6266. return actionResult;
  6267. }
  6268. /// <summary>
  6269. /// 半检时,入窑前检验获取此条码是否报损为废品
  6270. /// </summary>
  6271. /// <param name="accountCode"></param>
  6272. /// <param name="userCode"></param>
  6273. /// <param name="userPassword"></param>
  6274. /// <param name="sessionKey"></param>
  6275. /// <param name="barcode">产品条码</param>
  6276. /// <returns></returns>
  6277. public ActionResult CheckWasteScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6278. {
  6279. ActionResult actionResult = new ActionResult();
  6280. try
  6281. {
  6282. // 验证请求头信息
  6283. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6284. // 验证失败
  6285. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6286. {
  6287. return actionResult;
  6288. }
  6289. int returnValue = ServiceInvoker.Invoke<int>(this,
  6290. () => PMModuleLogic.CheckWasteScrapProduct(barcode));
  6291. if (returnValue != -100)
  6292. {
  6293. actionResult.Result = JsonHelper.ToJson(returnValue);
  6294. actionResult.Status = (int)Constant.PDAResult.Success;
  6295. }
  6296. else
  6297. {
  6298. actionResult.Status = (int)Constant.PDAResult.Fail;
  6299. actionResult.Message = "条码[" + barcode + "]不是废品,不能进行编辑";
  6300. }
  6301. }
  6302. catch (Exception ex)
  6303. {
  6304. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6305. OutputLog.TraceLog(LogPriority.Error,
  6306. this.ToString(),
  6307. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6308. ex.ToString(),
  6309. LocalPath.LogExePath);
  6310. actionResult.Status = (int)Constant.PDAResult.Exception;
  6311. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6312. }
  6313. return actionResult;
  6314. }
  6315. /// <summary>
  6316. /// 获取登陆帐户有无入窑前检验数据编辑权限
  6317. /// </summary>
  6318. /// <param name="accountCode"></param>
  6319. /// <param name="userCode"></param>
  6320. /// <param name="userPassword"></param>
  6321. /// <param name="sessionKey"></param>
  6322. /// <param name="usercode">工号编码</param>
  6323. /// <returns></returns>
  6324. public ActionResult GetIntoKilnCheckEditFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  6325. {
  6326. ActionResult actionResult = new ActionResult();
  6327. try
  6328. {
  6329. // 验证请求头信息
  6330. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6331. // 验证失败
  6332. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6333. {
  6334. return actionResult;
  6335. }
  6336. int returnValue = ServiceInvoker.Invoke<int>(this,
  6337. () => PDAModuleLogic.GetIntoKilnCheckEditFuntion(sUserInfo));
  6338. actionResult.Result = JsonHelper.ToJson(returnValue);
  6339. actionResult.Status = (int)Constant.PDAResult.Success;
  6340. }
  6341. catch (Exception ex)
  6342. {
  6343. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6344. OutputLog.TraceLog(LogPriority.Error,
  6345. this.ToString(),
  6346. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6347. ex.ToString(),
  6348. LocalPath.LogExePath);
  6349. actionResult.Status = (int)Constant.PDAResult.Exception;
  6350. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6351. }
  6352. return actionResult;
  6353. }
  6354. /// <summary>
  6355. /// 获取登陆帐户有无半检验数据编辑权限
  6356. /// </summary>
  6357. /// <param name="accountCode"></param>
  6358. /// <param name="userCode"></param>
  6359. /// <param name="userPassword"></param>
  6360. /// <param name="sessionKey"></param>
  6361. /// <param name="usercode">工号编码</param>
  6362. /// <returns></returns>
  6363. public ActionResult GetNormalCheckEditFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  6364. {
  6365. ActionResult actionResult = new ActionResult();
  6366. try
  6367. {
  6368. // 验证请求头信息
  6369. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6370. // 验证失败
  6371. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6372. {
  6373. return actionResult;
  6374. }
  6375. int returnValue = ServiceInvoker.Invoke<int>(this,
  6376. () => PDAModuleLogic.GetNormalCheckEditFuntion(sUserInfo));
  6377. actionResult.Result = JsonHelper.ToJson(returnValue);
  6378. actionResult.Status = (int)Constant.PDAResult.Success;
  6379. }
  6380. catch (Exception ex)
  6381. {
  6382. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6383. OutputLog.TraceLog(LogPriority.Error,
  6384. this.ToString(),
  6385. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6386. ex.ToString(),
  6387. LocalPath.LogExePath);
  6388. actionResult.Status = (int)Constant.PDAResult.Exception;
  6389. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6390. }
  6391. return actionResult;
  6392. }
  6393. /// <summary>
  6394. /// 获取缺陷扣罚管理的全部数据
  6395. /// </summary>
  6396. /// <param name="accountCode"></param>
  6397. /// <param name="userCode"></param>
  6398. /// <param name="userPassword"></param>
  6399. /// <param name="sessionKey"></param>
  6400. /// <returns></returns>
  6401. public ActionResult GetAllDefectFine(string accountCode, string userCode, string userPassword, string sessionKey)
  6402. {
  6403. ActionResult actionResult = new ActionResult();
  6404. try
  6405. {
  6406. // 验证请求头信息
  6407. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6408. // 验证失败
  6409. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6410. {
  6411. return actionResult;
  6412. }
  6413. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6414. () => SystemModuleLogic.GetAllDefectFine(sUserInfo));
  6415. if (ds != null && ds.Tables[0].Rows.Count > 0)
  6416. {
  6417. DataView dv = ds.Tables[0].DefaultView;
  6418. dv.RowFilter = "valueflag=1";
  6419. actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  6420. actionResult.Status = (int)Constant.PDAResult.Success;
  6421. }
  6422. else
  6423. {
  6424. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  6425. actionResult.Status = (int)Constant.PDAResult.Success;
  6426. }
  6427. }
  6428. catch (Exception ex)
  6429. {
  6430. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6431. OutputLog.TraceLog(LogPriority.Error,
  6432. this.ToString(),
  6433. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6434. ex.ToString(),
  6435. LocalPath.LogExePath);
  6436. actionResult.Status = (int)Constant.PDAResult.Exception;
  6437. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6438. }
  6439. return actionResult;
  6440. }
  6441. /// <summary>
  6442. /// 获取缺陷扣除数管理的全部数据
  6443. /// </summary>
  6444. /// <param name="accountCode"></param>
  6445. /// <param name="userCode"></param>
  6446. /// <param name="userPassword"></param>
  6447. /// <param name="sessionKey"></param>
  6448. /// <returns></returns>
  6449. public ActionResult GetAllDefectDeduction(string accountCode, string userCode, string userPassword, string sessionKey)
  6450. {
  6451. ActionResult actionResult = new ActionResult();
  6452. try
  6453. {
  6454. // 验证请求头信息
  6455. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6456. // 验证失败
  6457. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6458. {
  6459. return actionResult;
  6460. }
  6461. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6462. () => SystemModuleLogic.GetAllDefectDeduction(sUserInfo));
  6463. if (ds != null && ds.Tables[0].Rows.Count > 0)
  6464. {
  6465. DataView dv = ds.Tables[0].DefaultView;
  6466. dv.RowFilter = "valueflag=1";
  6467. actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  6468. actionResult.Status = (int)Constant.PDAResult.Success;
  6469. }
  6470. else
  6471. {
  6472. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  6473. actionResult.Status = (int)Constant.PDAResult.Success;
  6474. }
  6475. }
  6476. catch (Exception ex)
  6477. {
  6478. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6479. OutputLog.TraceLog(LogPriority.Error,
  6480. this.ToString(),
  6481. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6482. ex.ToString(),
  6483. LocalPath.LogExePath);
  6484. actionResult.Status = (int)Constant.PDAResult.Exception;
  6485. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6486. }
  6487. return actionResult;
  6488. }
  6489. /// <summary>
  6490. /// 获取缺陷扣罚关系管理的全部数据
  6491. /// </summary>
  6492. /// <param name="accountCode"></param>
  6493. /// <param name="userCode"></param>
  6494. /// <param name="userPassword"></param>
  6495. /// <param name="sessionKey"></param>
  6496. /// <returns></returns>
  6497. public ActionResult GetAllDefectFineRelation(string accountCode, string userCode, string userPassword, string sessionKey)
  6498. {
  6499. ActionResult actionResult = new ActionResult();
  6500. try
  6501. {
  6502. // 验证请求头信息
  6503. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6504. // 验证失败
  6505. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6506. {
  6507. return actionResult;
  6508. }
  6509. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6510. () => SystemModuleLogic.GetAllDefectFineRelation(sUserInfo));
  6511. DataTable dt = new DataTable();
  6512. dt.Columns.Add("DefectID");
  6513. dt.Columns.Add("DefectFineID");
  6514. DataView dv = ds.Tables[0].DefaultView;
  6515. DataTable dtFor = dv.ToTable("defectid", true);
  6516. for (int i = 0; i < dtFor.Rows.Count; i++)
  6517. {
  6518. DataRow[] r = ds.Tables[0].Select("defectid=" + dtFor.Rows[i]["defectid"]);
  6519. string substring = "";
  6520. foreach (DataRow r1 in r)
  6521. {
  6522. substring += r1["DefectFineID"].ToString() + "-" + r1["DEFECTFINECODE"].ToString() + ",";
  6523. }
  6524. if (substring != "")
  6525. {
  6526. DataRow drnew = dt.NewRow();
  6527. drnew["DefectID"] = dtFor.Rows[i]["defectid"];
  6528. drnew["DefectFineID"] = substring.TrimEnd(',');
  6529. dt.Rows.Add(drnew);
  6530. }
  6531. }
  6532. actionResult.Result = JsonHelper.ToJson(dt);//ds.Tables[0]
  6533. actionResult.Status = (int)Constant.PDAResult.Success;
  6534. }
  6535. catch (Exception ex)
  6536. {
  6537. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6538. OutputLog.TraceLog(LogPriority.Error,
  6539. this.ToString(),
  6540. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6541. ex.ToString(),
  6542. LocalPath.LogExePath);
  6543. actionResult.Status = (int)Constant.PDAResult.Exception;
  6544. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6545. }
  6546. return actionResult;
  6547. }
  6548. /// <summary>
  6549. /// 获取缺陷扣除数关系管理的全部数据
  6550. /// </summary>
  6551. /// <param name="accountCode"></param>
  6552. /// <param name="userCode"></param>
  6553. /// <param name="userPassword"></param>
  6554. /// <param name="sessionKey"></param>
  6555. /// <returns></returns>
  6556. public ActionResult GetAllDefectDeductionRelation(string accountCode, string userCode, string userPassword, string sessionKey)
  6557. {
  6558. ActionResult actionResult = new ActionResult();
  6559. try
  6560. {
  6561. // 验证请求头信息
  6562. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6563. // 验证失败
  6564. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6565. {
  6566. return actionResult;
  6567. }
  6568. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6569. () => SystemModuleLogic.GetAllDefectDeductionRelation(sUserInfo));
  6570. DataTable dt = new DataTable();
  6571. dt.Columns.Add("DefectID");
  6572. dt.Columns.Add("DefectDeductionNum");
  6573. DataView dv = ds.Tables[0].DefaultView;
  6574. DataTable dtFor = dv.ToTable("defectid", true);
  6575. for (int i = 0; i < dtFor.Rows.Count; i++)
  6576. {
  6577. DataRow[] r = ds.Tables[0].Select("defectid=" + dtFor.Rows[i]["defectid"]);
  6578. string substring = "";
  6579. foreach (DataRow r1 in r)
  6580. {
  6581. substring += r1["DefectDeductionID"].ToString() + "-" + r1["DefectDeductionNum"].ToString() + ",";
  6582. }
  6583. if (substring != "")
  6584. {
  6585. DataRow drnew = dt.NewRow();
  6586. drnew["DefectID"] = dtFor.Rows[i]["defectid"];
  6587. drnew["DefectDeductionNum"] = substring.TrimEnd(',');
  6588. dt.Rows.Add(drnew);
  6589. }
  6590. }
  6591. actionResult.Result = JsonHelper.ToJson(dt);//ds.Tables[0]
  6592. actionResult.Status = (int)Constant.PDAResult.Success;
  6593. }
  6594. catch (Exception ex)
  6595. {
  6596. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6597. OutputLog.TraceLog(LogPriority.Error,
  6598. this.ToString(),
  6599. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6600. ex.ToString(),
  6601. LocalPath.LogExePath);
  6602. actionResult.Status = (int)Constant.PDAResult.Exception;
  6603. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6604. }
  6605. return actionResult;
  6606. }
  6607. /// <summary>
  6608. /// 获取盘点单明细
  6609. /// </summary>
  6610. /// <param name="sUserInfo"></param>
  6611. /// <returns></returns>
  6612. public ActionResult GetUpdateInCheckedInfo(string accountCode, string userCode, string userPassword, string sessionKey, string incheckedno)
  6613. {
  6614. ActionResult actionResult = new ActionResult();
  6615. try
  6616. {
  6617. // 验证请求头信息
  6618. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6619. // 验证失败
  6620. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6621. {
  6622. return actionResult;
  6623. }
  6624. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6625. () => PMModuleLogic.GetUpdateInCheckedInfo(incheckedno, sUserInfo));
  6626. actionResult.Result = JsonHelper.ToJson(ds);
  6627. actionResult.Status = (int)Constant.PDAResult.Success;
  6628. }
  6629. catch (Exception ex)
  6630. {
  6631. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6632. OutputLog.TraceLog(LogPriority.Error,
  6633. this.ToString(),
  6634. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6635. ex.ToString(),
  6636. LocalPath.LogExePath);
  6637. actionResult.Status = (int)Constant.PDAResult.Exception;
  6638. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6639. }
  6640. return actionResult;
  6641. }
  6642. /// <summary>
  6643. /// 半检检验条码
  6644. /// </summary>
  6645. /// <param name="sUserInfo"></param>
  6646. /// <returns></returns>
  6647. public ActionResult SemiCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6648. {
  6649. ActionResult actionResult = new ActionResult();
  6650. try
  6651. {
  6652. // 验证请求头信息
  6653. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6654. // 验证失败
  6655. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6656. {
  6657. return actionResult;
  6658. }
  6659. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6660. () => PMModuleLogic.SemiCheckBarcode(barcode, sUserInfo));
  6661. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6662. if (Convert.ToInt32(resultEntity.Result) < 0)
  6663. {
  6664. actionResult.Status = (int)Constant.PDAResult.Fail;
  6665. }
  6666. else
  6667. {
  6668. actionResult.Status = (int)Constant.PDAResult.Success;
  6669. }
  6670. actionResult.Message = resultEntity.Message;
  6671. }
  6672. catch (Exception ex)
  6673. {
  6674. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6675. OutputLog.TraceLog(LogPriority.Error,
  6676. this.ToString(),
  6677. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6678. ex.ToString(),
  6679. LocalPath.LogExePath);
  6680. actionResult.Status = (int)Constant.PDAResult.Exception;
  6681. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6682. }
  6683. return actionResult;
  6684. }
  6685. /// <summary>
  6686. /// 根据条码获取经过的工序,用于绑定返工工序
  6687. /// </summary>
  6688. /// <param name="sUserInfo"></param>
  6689. /// <returns></returns>
  6690. public ActionResult GetSemiCheckPassProcedure(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6691. {
  6692. ActionResult actionResult = new ActionResult();
  6693. try
  6694. {
  6695. // 验证请求头信息
  6696. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6697. // 验证失败
  6698. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6699. {
  6700. return actionResult;
  6701. }
  6702. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6703. () => PMModuleLogic.GetSemiCheckPassProcedure(barcode));
  6704. actionResult.Result = JsonHelper.ToJson(resultEntity);
  6705. actionResult.Status = (int)Constant.PDAResult.Success;
  6706. }
  6707. catch (Exception ex)
  6708. {
  6709. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6710. OutputLog.TraceLog(LogPriority.Error,
  6711. this.ToString(),
  6712. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6713. ex.ToString(),
  6714. LocalPath.LogExePath);
  6715. actionResult.Status = (int)Constant.PDAResult.Exception;
  6716. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6717. }
  6718. return actionResult;
  6719. }
  6720. /// <summary>
  6721. /// 获取登陆帐户有无半检状态权限
  6722. /// </summary>
  6723. /// <param name="sUserInfo"></param>
  6724. /// <returns></returns>
  6725. public ActionResult GetSemiCheckStatusFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  6726. {
  6727. ActionResult actionResult = new ActionResult();
  6728. try
  6729. {
  6730. // 验证请求头信息
  6731. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6732. // 验证失败
  6733. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6734. {
  6735. return actionResult;
  6736. }
  6737. int resultEntity = ServiceInvoker.Invoke<int>(this,
  6738. () => PMModuleLogic.GetSemiCheckStatusFuntion(sUserInfo));
  6739. actionResult.Result = JsonHelper.ToJson(resultEntity);
  6740. actionResult.Status = (int)Constant.PDAResult.Success;
  6741. }
  6742. catch (Exception ex)
  6743. {
  6744. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6745. OutputLog.TraceLog(LogPriority.Error,
  6746. this.ToString(),
  6747. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6748. ex.ToString(),
  6749. LocalPath.LogExePath);
  6750. actionResult.Status = (int)Constant.PDAResult.Exception;
  6751. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6752. }
  6753. return actionResult;
  6754. }
  6755. /// <summary>
  6756. /// 复检状态数据源
  6757. /// </summary>
  6758. /// <param name="sUserInfo"></param>
  6759. /// <returns></returns>
  6760. public ActionResult GetSemiCheckType(string accountCode, string userCode, string userPassword, string sessionKey)
  6761. {
  6762. ActionResult actionResult = new ActionResult();
  6763. try
  6764. {
  6765. // 验证请求头信息
  6766. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6767. // 验证失败
  6768. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6769. {
  6770. return actionResult;
  6771. }
  6772. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6773. () => SystemModuleLogic.GetSemiCheckType());
  6774. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6775. actionResult.Status = (int)Constant.PDAResult.Success;
  6776. }
  6777. catch (Exception ex)
  6778. {
  6779. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6780. OutputLog.TraceLog(LogPriority.Error,
  6781. this.ToString(),
  6782. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6783. ex.ToString(),
  6784. LocalPath.LogExePath);
  6785. actionResult.Status = (int)Constant.PDAResult.Exception;
  6786. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6787. }
  6788. return actionResult;
  6789. }
  6790. /// <summary>
  6791. /// 根据半成品检验数据ID,显示半成品数据信息
  6792. /// </summary>
  6793. /// <param name="sUserInfo"></param>
  6794. /// <returns></returns>
  6795. public ActionResult GetSemiCheckByID(string accountCode, string userCode, string userPassword, string sessionKey, int semiCheckID)
  6796. {
  6797. ActionResult actionResult = new ActionResult();
  6798. try
  6799. {
  6800. // 验证请求头信息
  6801. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6802. // 验证失败
  6803. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6804. {
  6805. return actionResult;
  6806. }
  6807. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  6808. () => PMModuleLogic.GetSemiCheckByID(semiCheckID));
  6809. SemiCheckEntity[] productionDatas = new SemiCheckEntity[1];
  6810. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  6811. {
  6812. if (reworkDs != null && reworkDs.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  6813. {
  6814. for (int i = 0; i < reworkDs.Tables[0].Rows.Count; i++)
  6815. {
  6816. SemiCheckEntity productionData = new SemiCheckEntity();
  6817. productionData.BarCode = reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
  6818. if (reworkDs.Tables[0].Rows[i]["GoodsID"].ToString() != "")
  6819. {
  6820. productionData.GoodsID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsID"].ToString());
  6821. }
  6822. productionData.SemiCheckID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["SemiCheckID"].ToString());
  6823. productionData.GoodsCode = reworkDs.Tables[0].Rows[i]["GoodsCode"].ToString();
  6824. productionData.GoodsName = reworkDs.Tables[0].Rows[i]["GoodsName"].ToString();
  6825. productionData.SemiCheckType = reworkDs.Tables[0].Rows[i]["SemiCheckType"].ToString();
  6826. productionData.ReFine = 0;
  6827. if (reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString() != "")
  6828. {
  6829. productionData.ReworkProcedureID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString());
  6830. }
  6831. productionData.ReSemiCheckType = reworkDs.Tables[0].Rows[i]["ReSemiCheckType"].ToString();
  6832. productionData.ReworkProcedureCode = reworkDs.Tables[0].Rows[i]["ReworkProcedureCode"].ToString();
  6833. productionData.ReworkProcedureName = reworkDs.Tables[0].Rows[i]["ReworkProcedureName"].ToString();
  6834. productionData.Remarks = reworkDs.Tables[0].Rows[i]["Remarks"].ToString();
  6835. if (reworkDs.Tables[0].Rows[i]["UserID"].ToString() != "")
  6836. {
  6837. productionData.SemiCheckUserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["UserID"].ToString());
  6838. productionData.SemiCheckUserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
  6839. }
  6840. if (reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString() != "")
  6841. {
  6842. productionData.GoodsLevelTypeID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString());
  6843. }
  6844. //productionData.UserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
  6845. //productionData.UserName = reworkDs.Tables[0].Rows[i]["UserName"].ToString();
  6846. productionData.SpecialRepairFlag = reworkDs.Tables[0].Rows[i]["SpecialRepairFlag"].ToString();
  6847. productionData.GroutingUserCode = reworkDs.Tables[0].Rows[i]["GroutingUserCode"].ToString();
  6848. productionData.GroutingNum = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GroutingNum"]);
  6849. productionData.IsPublicBody = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["IsPublicBody"]);
  6850. productionData.MouldCode = reworkDs.Tables[0].Rows[i]["MouldCode"].ToString();
  6851. productionData.GroutingDate = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["GroutingDate"]);
  6852. if (reworkDs.Tables[0].Rows[i]["ReworkUserID"].ToString() != "")
  6853. {
  6854. productionData.ReworkUserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkUserID"].ToString());
  6855. productionData.ReworkUserCode = reworkDs.Tables[0].Rows[i]["ReworkUserCode"].ToString();
  6856. }
  6857. productionData.ReSemiCheckUserCode = reworkDs.Tables[0].Rows[i]["ReSemiCheckUserCode"].ToString();
  6858. if (reworkDs.Tables[0].Rows[i]["logoid"].ToString() != "")
  6859. {
  6860. productionData.Logoid = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["Logoid"]);
  6861. productionData.LogoCode = reworkDs.Tables[0].Rows[i]["LogoCode"].ToString();
  6862. productionData.LogoName = reworkDs.Tables[0].Rows[i]["LogoName"].ToString();
  6863. }
  6864. productionData.SemiCheckTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["SemiCheckTime"]);
  6865. if (reworkDs.Tables[0].Rows[i]["ReSemiCheckTime"] != DBNull.Value)
  6866. {
  6867. productionData.ReSemiCheckDateTimeStart = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["ReSemiCheckTime"]);
  6868. }
  6869. DataView dvDefect = reworkDs.Tables[1].DefaultView;
  6870. dvDefect.RowFilter = "SemiCheckID=" + reworkDs.Tables[0].Rows[i]["SemiCheckID"].ToString();
  6871. DataTable dtDefect = dvDefect.ToTable();
  6872. for (int row = 0; row < dtDefect.Rows.Count; row++)
  6873. {
  6874. // 产品缺陷
  6875. SemiCheckDefectEntity defect = new SemiCheckDefectEntity();
  6876. //defect.SpecialDefect = dtDefect.Rows[row]["SpecialDefect"].ToString();
  6877. //defect.DefectDeductionNum = Convert.ToDecimal(dtDefect.Rows[row]["DefectDeductionNum"].ToString());
  6878. //if (dtDefect.Rows[row]["ProductionDefectID"].ToString() != "")
  6879. //{
  6880. // defect.ProductionDefectID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDefectID"].ToString());
  6881. //}
  6882. //defect.BarCode = dtDefect.Rows[row]["BarCode"].ToString();
  6883. if (dtDefect.Rows[row]["DefectID"].ToString() != "")
  6884. {
  6885. defect.DefectID = Convert.ToInt32(dtDefect.Rows[row]["DefectID"].ToString());
  6886. }
  6887. defect.DefectName = dtDefect.Rows[row]["DefectName"].ToString();
  6888. defect.DefectCode = dtDefect.Rows[row]["DefectCode"].ToString();
  6889. if (dtDefect.Rows[row]["DefectPositionID"].ToString() != "")
  6890. {
  6891. defect.DefectPositionID = Convert.ToInt32(dtDefect.Rows[row]["DefectPositionID"].ToString());
  6892. }
  6893. defect.DefectPositionName = dtDefect.Rows[row]["DefectPositionName"].ToString();
  6894. defect.DefectPositionCode = dtDefect.Rows[row]["DefectPositionCode"].ToString();
  6895. if (dtDefect.Rows[row]["DefectProcedureID"].ToString() != "")
  6896. {
  6897. defect.DefectProcedureID = Convert.ToInt32(dtDefect.Rows[row]["DefectProcedureID"].ToString());
  6898. }
  6899. defect.DefectProcedureName = dtDefect.Rows[row]["DefectProcedureName"].ToString();
  6900. defect.DefectProcedureCode = dtDefect.Rows[row]["DefectProcedureCode"].ToString();
  6901. if (dtDefect.Rows[row]["DefectUserID"].ToString() != "")
  6902. {
  6903. defect.DefectUserID = Convert.ToInt32(dtDefect.Rows[row]["DefectUserID"].ToString());
  6904. }
  6905. defect.DefectUserName = dtDefect.Rows[row]["DefectUserName"].ToString();
  6906. defect.DefectUserCode = dtDefect.Rows[row]["DefectUserCode"].ToString();
  6907. //if (dtDefect.Rows[row]["Jobs"].ToString() != "")
  6908. //{
  6909. // defect.Jobs = Convert.ToInt32(dtDefect.Rows[row]["Jobs"].ToString());
  6910. //}
  6911. //if (dtDefect.Rows[row]["MissedUserID"].ToString() != "")
  6912. //{
  6913. // defect.MissedUserID = Convert.ToInt32(dtDefect.Rows[row]["MissedUserID"].ToString());
  6914. //}
  6915. //defect.MissedUserCode = dtDefect.Rows[row]["MissedUserCode"].ToString();
  6916. //defect.MissedUserName = dtDefect.Rows[row]["MissedUserName"].ToString();
  6917. //defect.JobsText = dtDefect.Rows[row]["JobsText"].ToString();
  6918. defect.Remarks = dtDefect.Rows[row]["remarks"].ToString();
  6919. if (dtDefect.Rows[row]["semicheckid"].ToString() != "")
  6920. {
  6921. defect.SemiCheckID = Convert.ToInt32(dtDefect.Rows[row]["semicheckid"].ToString());
  6922. }
  6923. if (dtDefect.Rows[row]["DefectProductionDataID"].ToString() != "")
  6924. {
  6925. defect.DefectProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["DefectProductionDataID"].ToString());
  6926. }
  6927. //if (dtDefect.Rows[row]["DefectFineID"].ToString() != "")
  6928. //{
  6929. // defect.DefectFineID = Convert.ToInt32(dtDefect.Rows[row]["DefectFineID"].ToString());
  6930. //}
  6931. //defect.DefectFineValue = dtDefect.Rows[row]["DefectFineValue"].ToString();
  6932. //--------责任员工-------------------
  6933. DataRow[] drRow = reworkDs.Tables[2].Select("SemiCheckDefectID=" + reworkDs.Tables[1].Rows[row]["SemiCheckDefectID"]);
  6934. if (drRow.Length > Constant.INT_IS_ZERO)
  6935. {
  6936. if (defect.DefectResponsibles == null)
  6937. {
  6938. defect.DefectResponsibles = new List<SemiCheckResponsibleEntity>();
  6939. }
  6940. foreach (DataRow r in drRow)
  6941. {
  6942. SemiCheckResponsibleEntity defectResponsible = new SemiCheckResponsibleEntity();
  6943. if (r["SemiCheckDefectID"].ToString() != "")
  6944. {
  6945. defectResponsible.SemiCheckDefectID = Convert.ToInt32(r["SemiCheckDefectID"]);
  6946. }
  6947. if (r["StaffID"].ToString() != "")
  6948. {
  6949. defectResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
  6950. }
  6951. defectResponsible.StaffCode = r["StaffCode"].ToString();
  6952. defectResponsible.StaffName = r["StaffName"].ToString();
  6953. if (r["StaffStatus"].ToString() != "")
  6954. {
  6955. defectResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
  6956. }
  6957. if (r["UJobsID"].ToString() != "")
  6958. {
  6959. defectResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
  6960. }
  6961. if (r["SJobsID"].ToString() != "")
  6962. {
  6963. defectResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
  6964. }
  6965. defect.DefectResponsibles.Add(defectResponsible);
  6966. }
  6967. }
  6968. //------------------------------
  6969. if (productionData.SemiCheckDefects == null)
  6970. {
  6971. productionData.SemiCheckDefects = new List<SemiCheckDefectEntity>();
  6972. }
  6973. productionData.SemiCheckDefects.Add(defect);
  6974. }
  6975. //if (productionDatas.PDAProductionData == null)
  6976. //{
  6977. // productionDatas.PDAProductionData = new System.Collections.Generic.List<PDAProductionDataResult>();
  6978. //}
  6979. productionDatas[0] = productionData;
  6980. //---------------------------------------------------------------------------------
  6981. }
  6982. }
  6983. }
  6984. actionResult.Result = JsonHelper.ToJson(productionDatas);
  6985. actionResult.Status = (int)Constant.PDAResult.Success;
  6986. }
  6987. catch (Exception ex)
  6988. {
  6989. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6990. OutputLog.TraceLog(LogPriority.Error,
  6991. this.ToString(),
  6992. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6993. ex.ToString(),
  6994. LocalPath.LogExePath);
  6995. actionResult.Status = (int)Constant.PDAResult.Exception;
  6996. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6997. }
  6998. return actionResult;
  6999. }
  7000. /// <summary>
  7001. /// 保存半检登记
  7002. /// </summary>
  7003. /// <param name="accountCode">帐套code</param>
  7004. /// <param name="userCode">用户code</param>
  7005. /// <param name="userPassword">用户密码</param>
  7006. /// <param name="sessionKey">本次登陆密钥</param>
  7007. /// <param name="entity">半检实体类</param>
  7008. /// <param name="sUserInfo">用户基本信息</param>
  7009. /// <returns></returns>
  7010. public ActionResult AddSemiCheck(string accountCode, string userCode, string userPassword, string sessionKey, SemiCheckEntity[] entityobj)
  7011. {
  7012. ActionResult actionResult = new ActionResult();
  7013. try
  7014. {
  7015. // 验证请求头信息
  7016. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7017. // 验证失败
  7018. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7019. {
  7020. return actionResult;
  7021. }
  7022. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7023. () => PMModuleLogicDAL.AddSemiCheck(entityobj, sUserInfo));
  7024. string err = string.Empty;
  7025. err = resultEntity.Message;
  7026. if (err == null)
  7027. {
  7028. err = "";
  7029. }
  7030. SemiCheckEntity entity = entityobj[0];
  7031. if (entity.SemiCheckCategory == 1) // 半检登记
  7032. {
  7033. }
  7034. else if (entity.SemiCheckCategory == 2)// 复检登记
  7035. {
  7036. err = JsonHelper.ToJson(err);
  7037. }
  7038. else if (entity.SemiCheckCategory == 3)// 撤销复检
  7039. {
  7040. err = JsonHelper.ToJson(err);
  7041. }
  7042. //actionResult.Result = JsonHelper.ToJson(err);
  7043. actionResult.Result = err;//JsonHelper.ToJson(err);
  7044. actionResult.Status = (int)Constant.PDAResult.Success;
  7045. }
  7046. catch (Exception ex)
  7047. {
  7048. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7049. OutputLog.TraceLog(LogPriority.Error,
  7050. this.ToString(),
  7051. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7052. ex.ToString(),
  7053. LocalPath.LogExePath);
  7054. actionResult.Status = (int)Constant.PDAResult.Exception;
  7055. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7056. }
  7057. return actionResult;
  7058. }
  7059. /// <summary>
  7060. /// 根据所选工号,查出缺陷责任员工
  7061. /// </summary>
  7062. /// <param name="sUserInfo"></param>
  7063. /// <returns></returns>
  7064. public ActionResult GetSemiCheckDefectStaffByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int userid)
  7065. {
  7066. ActionResult actionResult = new ActionResult();
  7067. try
  7068. {
  7069. // 验证请求头信息
  7070. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7071. // 验证失败
  7072. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7073. {
  7074. return actionResult;
  7075. }
  7076. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  7077. () => PMModuleLogic.GetSemiCheckDefectStaffByUserID(sUserInfo, userid));
  7078. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7079. actionResult.Status = (int)Constant.PDAResult.Success;
  7080. }
  7081. catch (Exception ex)
  7082. {
  7083. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7084. OutputLog.TraceLog(LogPriority.Error,
  7085. this.ToString(),
  7086. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7087. ex.ToString(),
  7088. LocalPath.LogExePath);
  7089. actionResult.Status = (int)Constant.PDAResult.Exception;
  7090. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7091. }
  7092. return actionResult;
  7093. }
  7094. /// <summary>
  7095. /// 获取半成品缺陷管理的全部数据
  7096. /// </summary>
  7097. /// <param name="sUserInfo"></param>
  7098. /// <returns></returns>
  7099. public ActionResult GetAllSemicheckDefect(string accountCode, string userCode, string userPassword, string sessionKey)
  7100. {
  7101. ActionResult actionResult = new ActionResult();
  7102. try
  7103. {
  7104. // 验证请求头信息
  7105. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7106. // 验证失败
  7107. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7108. {
  7109. return actionResult;
  7110. }
  7111. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  7112. () => SystemModuleLogic.GetAllSemicheckDefect(sUserInfo));
  7113. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7114. actionResult.Status = (int)Constant.PDAResult.Success;
  7115. }
  7116. catch (Exception ex)
  7117. {
  7118. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7119. OutputLog.TraceLog(LogPriority.Error,
  7120. this.ToString(),
  7121. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7122. ex.ToString(),
  7123. LocalPath.LogExePath);
  7124. actionResult.Status = (int)Constant.PDAResult.Exception;
  7125. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7126. }
  7127. return actionResult;
  7128. }
  7129. /// <summary>
  7130. /// 获取半成品缺陷位置管理的全部数据
  7131. /// </summary>
  7132. /// <param name="sUserInfo"></param>
  7133. /// <returns></returns>
  7134. public ActionResult GetAllScdefectPosition(string accountCode, string userCode, string userPassword, string sessionKey)
  7135. {
  7136. ActionResult actionResult = new ActionResult();
  7137. try
  7138. {
  7139. // 验证请求头信息
  7140. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7141. // 验证失败
  7142. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7143. {
  7144. return actionResult;
  7145. }
  7146. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  7147. () => SystemModuleLogic.GetAllScdefectPosition(sUserInfo));
  7148. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7149. actionResult.Status = (int)Constant.PDAResult.Success;
  7150. }
  7151. catch (Exception ex)
  7152. {
  7153. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7154. OutputLog.TraceLog(LogPriority.Error,
  7155. this.ToString(),
  7156. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7157. ex.ToString(),
  7158. LocalPath.LogExePath);
  7159. actionResult.Status = (int)Constant.PDAResult.Exception;
  7160. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7161. }
  7162. return actionResult;
  7163. }
  7164. /// <summary>
  7165. /// 复检验条码
  7166. /// </summary>
  7167. /// <param name="sUserInfo"></param>
  7168. /// <returns></returns>
  7169. public ActionResult ReSemiCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7170. {
  7171. ActionResult actionResult = new ActionResult();
  7172. try
  7173. {
  7174. // 验证请求头信息
  7175. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7176. // 验证失败
  7177. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7178. {
  7179. return actionResult;
  7180. }
  7181. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7182. () => PMModuleLogic.ReSemiCheckBarcode(barcode, sUserInfo));
  7183. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7184. if (Convert.ToInt32(resultEntity.Result) < 0)
  7185. {
  7186. actionResult.Status = (int)Constant.PDAResult.Fail;
  7187. }
  7188. else
  7189. {
  7190. actionResult.Status = (int)Constant.PDAResult.Success;
  7191. }
  7192. actionResult.Message = resultEntity.Message;
  7193. }
  7194. catch (Exception ex)
  7195. {
  7196. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7197. OutputLog.TraceLog(LogPriority.Error,
  7198. this.ToString(),
  7199. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7200. ex.ToString(),
  7201. LocalPath.LogExePath);
  7202. actionResult.Status = (int)Constant.PDAResult.Exception;
  7203. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7204. }
  7205. return actionResult;
  7206. }
  7207. /// <summary>
  7208. /// 撤销复检验条码
  7209. /// </summary>
  7210. /// <param name="sUserInfo"></param>
  7211. /// <returns></returns>
  7212. public ActionResult CancelSemiCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7213. {
  7214. ActionResult actionResult = new ActionResult();
  7215. try
  7216. {
  7217. // 验证请求头信息
  7218. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7219. // 验证失败
  7220. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7221. {
  7222. return actionResult;
  7223. }
  7224. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7225. () => PMModuleLogic.CancelSemiCheckBarcode(barcode, sUserInfo));
  7226. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7227. if (Convert.ToInt32(resultEntity.Result) < 0)
  7228. {
  7229. actionResult.Status = (int)Constant.PDAResult.Fail;
  7230. }
  7231. else
  7232. {
  7233. actionResult.Status = (int)Constant.PDAResult.Success;
  7234. }
  7235. actionResult.Message = resultEntity.Message;
  7236. }
  7237. catch (Exception ex)
  7238. {
  7239. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7240. OutputLog.TraceLog(LogPriority.Error,
  7241. this.ToString(),
  7242. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7243. ex.ToString(),
  7244. LocalPath.LogExePath);
  7245. actionResult.Status = (int)Constant.PDAResult.Exception;
  7246. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7247. }
  7248. return actionResult;
  7249. }
  7250. /// <summary>
  7251. /// 恢复数据
  7252. /// </summary>
  7253. /// <param name="sUserInfo"></param>
  7254. /// <returns></returns>
  7255. public ActionResult ResetBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7256. {
  7257. ActionResult actionResult = new ActionResult();
  7258. try
  7259. {
  7260. // 验证请求头信息
  7261. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7262. // 验证失败
  7263. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7264. {
  7265. return actionResult;
  7266. }
  7267. int resultEntity = ServiceInvoker.Invoke<int>(this,
  7268. () => PMModuleLogicDAL.ResetBarCode(barcode));
  7269. if (resultEntity > 0)
  7270. {
  7271. actionResult.Status = (int)Constant.PDAResult.Success;
  7272. actionResult.Message = "恢复数据成功";
  7273. }
  7274. else
  7275. {
  7276. actionResult.Status = (int)Constant.PDAResult.Fail;
  7277. if (resultEntity == -1)
  7278. {
  7279. actionResult.Message = "此条码没有清除,不能恢复";
  7280. }
  7281. else if (resultEntity == 0)
  7282. {
  7283. actionResult.Message = "没有可恢复的数据";
  7284. }
  7285. }
  7286. }
  7287. catch (Exception ex)
  7288. {
  7289. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7290. OutputLog.TraceLog(LogPriority.Error,
  7291. this.ToString(),
  7292. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7293. ex.ToString(),
  7294. LocalPath.LogExePath);
  7295. actionResult.Status = (int)Constant.PDAResult.Exception;
  7296. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7297. }
  7298. return actionResult;
  7299. }
  7300. /// <summary>
  7301. /// 通过SettingCode获取系统参数管理的数据
  7302. /// </summary>
  7303. /// <param name="accountCode"></param>
  7304. /// <param name="userCode"></param>
  7305. /// <param name="userPassword"></param>
  7306. /// <param name="sessionKey"></param>
  7307. /// <param name="settingcode">设置编码</param>
  7308. /// <returns></returns>
  7309. public ActionResult GetSystemSettingDataByCode(string accountCode, string userCode, string userPassword, string sessionKey, string settingcode)
  7310. {
  7311. ActionResult actionResult = new ActionResult();
  7312. try
  7313. {
  7314. // 验证请求头信息
  7315. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7316. // 验证失败
  7317. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7318. {
  7319. return actionResult;
  7320. }
  7321. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  7322. () => SystemModuleLogic.GetSystemSettingDataByCode(settingcode, sUserInfo));
  7323. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7324. actionResult.Status = (int)Constant.PDAResult.Success;
  7325. }
  7326. catch (Exception ex)
  7327. {
  7328. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7329. OutputLog.TraceLog(LogPriority.Error,
  7330. this.ToString(),
  7331. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7332. ex.ToString(),
  7333. LocalPath.LogExePath);
  7334. actionResult.Status = (int)Constant.PDAResult.Exception;
  7335. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7336. }
  7337. return actionResult;
  7338. }
  7339. /// <summary>
  7340. /// 校验条码是否允许撤销,如果不允许提示错误消息
  7341. /// </summary>
  7342. /// <param name="accountCode"></param>
  7343. /// <param name="userCode"></param>
  7344. /// <param name="userPassword"></param>
  7345. /// <param name="sessionKey"></param>
  7346. /// <param name="orgTime">原时间</param>
  7347. /// <param name="days">允许撤销天数</param>
  7348. /// <param name="settingCode">设置code,用于返回不同错误消息</param>
  7349. /// <returns></returns>
  7350. public ActionResult BarcodeAllowCancel(string accountCode, string userCode, string userPassword, string sessionKey, string orgTime, int days, string settingCode)
  7351. {
  7352. ActionResult actionResult = new ActionResult();
  7353. try
  7354. {
  7355. // 验证请求头信息
  7356. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7357. // 验证失败
  7358. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7359. {
  7360. return actionResult;
  7361. }
  7362. string[] subOrgTime = orgTime.Split('-');
  7363. DateTime newOrgTime = new DateTime(Convert.ToInt32(subOrgTime[0]), Convert.ToInt32(subOrgTime[1]), Convert.ToInt32(subOrgTime[2]));
  7364. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7365. () => PMModuleLogic.BarcodeAllowCancel(newOrgTime, days, settingCode, sUserInfo));
  7366. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7367. if (Convert.ToInt32(resultEntity.Result) < 0)
  7368. {
  7369. actionResult.Status = (int)Constant.PDAResult.Fail;
  7370. }
  7371. else
  7372. {
  7373. actionResult.Status = (int)Constant.PDAResult.Success;
  7374. }
  7375. actionResult.Message = resultEntity.Message;
  7376. }
  7377. catch (Exception ex)
  7378. {
  7379. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7380. OutputLog.TraceLog(LogPriority.Error,
  7381. this.ToString(),
  7382. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7383. ex.ToString(),
  7384. LocalPath.LogExePath);
  7385. actionResult.Status = (int)Constant.PDAResult.Exception;
  7386. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7387. }
  7388. return actionResult;
  7389. }
  7390. /// <summary>
  7391. /// 获取生产订单管理的全部数据
  7392. /// </summary>
  7393. /// <param name="sUserInfo"></param>
  7394. /// <returns></returns>
  7395. public ActionResult GetOrderList(string accountCode, string userCode, string userPassword, string sessionKey, OrderEntity order)
  7396. {
  7397. ActionResult actionResult = new ActionResult();
  7398. try
  7399. {
  7400. // 验证请求头信息
  7401. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7402. // 验证失败
  7403. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7404. {
  7405. return actionResult;
  7406. }
  7407. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  7408. () => PMModuleLogic.GetOrderList(order, sUserInfo));
  7409. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7410. actionResult.Status = (int)Constant.PDAResult.Success;
  7411. }
  7412. catch (Exception ex)
  7413. {
  7414. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7415. OutputLog.TraceLog(LogPriority.Error,
  7416. this.ToString(),
  7417. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7418. ex.ToString(),
  7419. LocalPath.LogExePath);
  7420. actionResult.Status = (int)Constant.PDAResult.Exception;
  7421. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7422. }
  7423. return actionResult;
  7424. }
  7425. public ActionResult FinishedHandoverBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7426. {
  7427. ActionResult actionResult = new ActionResult();
  7428. try
  7429. {
  7430. // 验证请求头信息
  7431. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7432. // 验证失败
  7433. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7434. {
  7435. return actionResult;
  7436. }
  7437. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7438. () => PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo));
  7439. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7440. if (Convert.ToInt32(resultEntity.Result) < 0)
  7441. {
  7442. actionResult.Status = (int)Constant.PDAResult.Fail;
  7443. actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
  7444. }
  7445. else
  7446. {
  7447. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  7448. actionResult.Status = (int)Constant.PDAResult.Success;
  7449. }
  7450. actionResult.Message = resultEntity.Message;
  7451. }
  7452. catch (Exception ex)
  7453. {
  7454. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7455. OutputLog.TraceLog(LogPriority.Error,
  7456. this.ToString(),
  7457. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7458. ex.ToString(),
  7459. LocalPath.LogExePath);
  7460. actionResult.Status = (int)Constant.PDAResult.Exception;
  7461. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7462. }
  7463. return actionResult;
  7464. }
  7465. public ActionResult GetSystemData(string accountCode, string userCode, string userPassword, string sessionKey)
  7466. {
  7467. ActionResult actionResult = new ActionResult();
  7468. try
  7469. {
  7470. // 验证请求头信息
  7471. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7472. // 验证失败
  7473. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7474. {
  7475. return actionResult;
  7476. }
  7477. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  7478. () => SystemModuleLogic.GetSystemData(sUserInfo));
  7479. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7480. actionResult.Status = (int)Constant.PDAResult.Success;
  7481. }
  7482. catch (Exception ex)
  7483. {
  7484. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7485. OutputLog.TraceLog(LogPriority.Error,
  7486. this.ToString(),
  7487. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7488. ex.ToString(),
  7489. LocalPath.LogExePath);
  7490. actionResult.Status = (int)Constant.PDAResult.Exception;
  7491. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7492. }
  7493. return actionResult;
  7494. }
  7495. public ActionResult SaveFinishedHandover(string accountCode, string userCode, string userPassword, string sessionKey, int orderid, OrderEntity[] orderEntity)
  7496. {
  7497. ActionResult actionResult = new ActionResult();
  7498. try
  7499. {
  7500. // 验证请求头信息
  7501. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7502. // 验证失败
  7503. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7504. {
  7505. return actionResult;
  7506. }
  7507. DataTable dtOrderData = DataConvert.ObjectConvertToTable<OrderEntity>(orderEntity);
  7508. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7509. () => PMModuleLogicDAL.SaveFinishedHandover(orderid, dtOrderData, sUserInfo));
  7510. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7511. if (Convert.ToInt32(resultEntity.Result) < 0)
  7512. {
  7513. actionResult.Status = (int)Constant.PDAResult.Fail;
  7514. }
  7515. else
  7516. {
  7517. actionResult.Status = (int)Constant.PDAResult.Success;
  7518. }
  7519. actionResult.Message = resultEntity.Message;
  7520. }
  7521. catch (Exception ex)
  7522. {
  7523. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7524. OutputLog.TraceLog(LogPriority.Error,
  7525. this.ToString(),
  7526. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7527. ex.ToString(),
  7528. LocalPath.LogExePath);
  7529. actionResult.Status = (int)Constant.PDAResult.Exception;
  7530. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7531. }
  7532. return actionResult;
  7533. }
  7534. public ActionResult CancelFinishedHandoverBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7535. {
  7536. ActionResult actionResult = new ActionResult();
  7537. try
  7538. {
  7539. // 验证请求头信息
  7540. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7541. // 验证失败
  7542. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7543. {
  7544. return actionResult;
  7545. }
  7546. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7547. () => PMModuleLogic.CancelFinishedHandoverBarcode(barcode, sUserInfo));
  7548. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7549. if (Convert.ToInt32(resultEntity.Result) < 0)
  7550. {
  7551. actionResult.Status = (int)Constant.PDAResult.Fail;
  7552. }
  7553. else
  7554. {
  7555. actionResult.Result = JsonHelper.ToJson(resultEntity.Data.Tables[0]);
  7556. actionResult.Status = (int)Constant.PDAResult.Success;
  7557. }
  7558. actionResult.Message = resultEntity.Message;
  7559. }
  7560. catch (Exception ex)
  7561. {
  7562. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7563. OutputLog.TraceLog(LogPriority.Error,
  7564. this.ToString(),
  7565. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7566. ex.ToString(),
  7567. LocalPath.LogExePath);
  7568. actionResult.Status = (int)Constant.PDAResult.Exception;
  7569. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7570. }
  7571. return actionResult;
  7572. }
  7573. public ActionResult SaveCancelFinishedHandoverByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7574. {
  7575. ActionResult actionResult = new ActionResult();
  7576. try
  7577. {
  7578. // 验证请求头信息
  7579. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7580. // 验证失败
  7581. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7582. {
  7583. return actionResult;
  7584. }
  7585. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7586. () => PMModuleLogicDAL.SaveCancelFinishedHandoverByBarcode(barcode, sUserInfo));
  7587. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7588. if (Convert.ToInt32(resultEntity.Result) < 0)
  7589. {
  7590. actionResult.Status = (int)Constant.PDAResult.Fail;
  7591. }
  7592. else
  7593. {
  7594. actionResult.Status = (int)Constant.PDAResult.Success;
  7595. }
  7596. actionResult.Message = resultEntity.Message;
  7597. }
  7598. catch (Exception ex)
  7599. {
  7600. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7601. OutputLog.TraceLog(LogPriority.Error,
  7602. this.ToString(),
  7603. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7604. ex.ToString(),
  7605. LocalPath.LogExePath);
  7606. actionResult.Status = (int)Constant.PDAResult.Exception;
  7607. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7608. }
  7609. return actionResult;
  7610. }
  7611. public ActionResult SaveChangeFinishedHandoverByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int orderid)
  7612. {
  7613. ActionResult actionResult = new ActionResult();
  7614. try
  7615. {
  7616. // 验证请求头信息
  7617. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7618. // 验证失败
  7619. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7620. {
  7621. return actionResult;
  7622. }
  7623. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7624. () => PMModuleLogicDAL.SaveChangeFinishedHandoverByBarcode(barcode, orderid, sUserInfo));
  7625. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7626. if (Convert.ToInt32(resultEntity.Result) < 0)
  7627. {
  7628. actionResult.Status = (int)Constant.PDAResult.Fail;
  7629. }
  7630. else
  7631. {
  7632. actionResult.Status = (int)Constant.PDAResult.Success;
  7633. }
  7634. actionResult.Message = resultEntity.Message;
  7635. }
  7636. catch (Exception ex)
  7637. {
  7638. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7639. OutputLog.TraceLog(LogPriority.Error,
  7640. this.ToString(),
  7641. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7642. ex.ToString(),
  7643. LocalPath.LogExePath);
  7644. actionResult.Status = (int)Constant.PDAResult.Exception;
  7645. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7646. }
  7647. return actionResult;
  7648. }
  7649. #region PDA条码打印
  7650. /// <summary>
  7651. /// 获取条码打印机
  7652. /// </summary>
  7653. /// <param name="accountCode"></param>
  7654. /// <param name="userCode"></param>
  7655. /// <param name="userPassword"></param>
  7656. /// <param name="sessionKey"></param>
  7657. /// <returns></returns>
  7658. public ActionResult GetBarcodePrinter(string accountCode, string userCode, string userPassword, string sessionKey, int printType=0)
  7659. {
  7660. ActionResult actionResult = new ActionResult();
  7661. try
  7662. {
  7663. // 验证请求头信息
  7664. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7665. // 验证失败
  7666. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7667. {
  7668. return actionResult;
  7669. }
  7670. DataSet resultEntity = BarcodePrintLogic.GetBarcodePrinter(sUserInfo, printType);
  7671. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7672. actionResult.Status = (int)Constant.PDAResult.Success;
  7673. }
  7674. catch (Exception ex)
  7675. {
  7676. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7677. OutputLog.TraceLog(LogPriority.Error,
  7678. this.ToString(),
  7679. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7680. ex.ToString(),
  7681. LocalPath.LogExePath);
  7682. actionResult.Status = (int)Constant.PDAResult.Exception;
  7683. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7684. }
  7685. return actionResult;
  7686. }
  7687. /// <summary>
  7688. /// 打印条码样式(补打)
  7689. /// </summary>
  7690. /// <param name="accountCode"></param>
  7691. /// <param name="userCode"></param>
  7692. /// <param name="userPassword"></param>
  7693. /// <param name="sessionKey"></param>
  7694. /// <returns></returns>
  7695. public ActionResult PrintBarcodeLayout(string accountCode, string userCode, string userPassword, string sessionKey,
  7696. string barcode, int copies, int printerID, int printWay=2)
  7697. {
  7698. ActionResult actionResult = new ActionResult();
  7699. try
  7700. {
  7701. // 验证请求头信息
  7702. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7703. // 验证失败
  7704. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7705. {
  7706. return actionResult;
  7707. }
  7708. //ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode(barcode,
  7709. // copies, printerID, sUserInfo);
  7710. ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode_3C(barcode,
  7711. copies, printerID, sUserInfo, printWay);
  7712. if (sre.Status != Constant.ServiceResultStatus.Success)
  7713. {
  7714. actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  7715. actionResult.Message = sre.Message;
  7716. return actionResult;
  7717. }
  7718. actionResult.Result = JsonHelper.ToJson(sre.Result as DataTable);
  7719. actionResult.Status = (int)Constant.PDAResult.Success;
  7720. }
  7721. catch (Exception ex)
  7722. {
  7723. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7724. OutputLog.TraceLog(LogPriority.Error,
  7725. this.ToString(),
  7726. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7727. ex.ToString(),
  7728. LocalPath.LogExePath);
  7729. actionResult.Status = (int)Constant.PDAResult.Exception;
  7730. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7731. }
  7732. return actionResult;
  7733. }
  7734. #endregion PDA条码打印
  7735. #region 统计报表
  7736. /// <summary>
  7737. /// 成型结算报表
  7738. /// </summary>
  7739. /// <param name="accountCode"></param>
  7740. /// <param name="userCode"></param>
  7741. /// <param name="userPassword"></param>
  7742. /// <param name="sessionKey"></param>
  7743. /// <returns></returns>
  7744. public ActionResult GetGroutingSettlementInfo(string accountCode, string userCode, string userPassword, string sessionKey,
  7745. int currentMonth)
  7746. {
  7747. ActionResult actionResult = new ActionResult();
  7748. try
  7749. {
  7750. // 验证请求头信息
  7751. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7752. // 验证失败
  7753. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7754. {
  7755. return actionResult;
  7756. }
  7757. DateTime date = DateTime.Now;
  7758. if (currentMonth != 1)
  7759. {
  7760. date = date.AddMonths(-1);
  7761. }
  7762. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7763. () => PublicModuleLogic.GetFP00002Data(sUserInfo.AccountID, userCode, date));
  7764. if (resultEntity == null || resultEntity.Data == null)
  7765. {
  7766. actionResult.Status = (int)Constant.PDAResult.Fail;
  7767. actionResult.Message = "查询失败";
  7768. return actionResult;
  7769. }
  7770. if (resultEntity.Status == Constant.ServiceResultStatus.Other)
  7771. {
  7772. actionResult.Status = (int)Constant.PDAResult.Fail;
  7773. actionResult.Message = resultEntity.Message;
  7774. return actionResult;
  7775. }
  7776. actionResult.Result = JsonHelper.ToJson(resultEntity.Data.Tables["DataM"]);
  7777. actionResult.Status = (int)Constant.PDAResult.Success;
  7778. }
  7779. catch (Exception ex)
  7780. {
  7781. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7782. OutputLog.TraceLog(LogPriority.Error,
  7783. this.ToString(),
  7784. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7785. ex.ToString(),
  7786. LocalPath.LogExePath);
  7787. actionResult.Status = (int)Constant.PDAResult.Exception;
  7788. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7789. }
  7790. return actionResult;
  7791. }
  7792. #endregion
  7793. #region 设置当期用户默认打印机配置
  7794. /// <summary>
  7795. /// 设置当期用户默认打印机配置
  7796. /// </summary>
  7797. /// <param name="accountCode"></param>
  7798. /// <param name="userCode"></param>
  7799. /// <param name="userPassword"></param>
  7800. /// <param name="sessionKey"></param>
  7801. /// <param name="printerID"></param>
  7802. /// <returns></returns>
  7803. public ActionResult SetCurrentUserPrinter(string accountCode, string userCode, string userPassword, string sessionKey,
  7804. int printerID)
  7805. {
  7806. ActionResult actionResult = new ActionResult();
  7807. try
  7808. {
  7809. // 验证请求头信息
  7810. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7811. // 验证失败
  7812. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7813. {
  7814. return actionResult;
  7815. }
  7816. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7817. () => BarcodePrintLogic.SetCurrentUserPrinter(printerID, sUserInfo));
  7818. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7819. if (resultEntity.Status == Constant.ServiceResultStatus.Other || Convert.ToInt32(resultEntity.Result) < 0)
  7820. {
  7821. actionResult.Status = (int)Constant.PDAResult.Fail;
  7822. }
  7823. else
  7824. {
  7825. actionResult.Status = (int)Constant.PDAResult.Success;
  7826. }
  7827. actionResult.Message = resultEntity.Message;
  7828. }
  7829. catch (Exception ex)
  7830. {
  7831. OutputLog.TraceLog(LogPriority.Error,
  7832. this.ToString(),
  7833. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7834. ex.ToString(),
  7835. LocalPath.LogExePath);
  7836. actionResult.Status = (int)Constant.PDAResult.Exception;
  7837. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7838. }
  7839. return actionResult;
  7840. }
  7841. /// <summary>
  7842. /// 校验产品条码是否可以进行回收
  7843. /// </summary>
  7844. /// <param name="accountCode">帐套code</param>
  7845. /// <param name="userCode">用户code</param>
  7846. /// <param name="userPassword">用户密码</param>
  7847. /// <param name="sessionKey">本次登陆密钥</param>
  7848. /// <param name="procedureID">工序ID</param>
  7849. /// <param name="barcode">条码</param>
  7850. /// <returns></returns>
  7851. /// <remarks>
  7852. /// 王鑫 2017.7.21 新建
  7853. /// </remarks>
  7854. public ActionResult CheckRecydingFlagBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  7855. {
  7856. ActionResult actionResult = new ActionResult();
  7857. try
  7858. {
  7859. // 验证请求头信息
  7860. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7861. // 验证失败
  7862. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7863. {
  7864. return actionResult;
  7865. }
  7866. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  7867. () => PMModuleLogic.CheckRecydingFlagBarcode(procedureID, barcode, sUserInfo));
  7868. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  7869. {
  7870. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  7871. actionResult.Status = (int)Constant.PDAResult.Success;
  7872. }
  7873. else
  7874. {
  7875. actionResult.Status = (int)Constant.PDAResult.Fail;
  7876. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  7877. }
  7878. }
  7879. catch (Exception ex)
  7880. {
  7881. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7882. OutputLog.TraceLog(LogPriority.Error,
  7883. this.ToString(),
  7884. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7885. ex.ToString(),
  7886. LocalPath.LogExePath);
  7887. actionResult.Status = (int)Constant.PDAResult.Exception;
  7888. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7889. }
  7890. return actionResult;
  7891. }
  7892. /// <summary>
  7893. /// 获取回收标识
  7894. /// </summary>
  7895. /// <param name="accountCode"></param>
  7896. /// <param name="userCode"></param>
  7897. /// <param name="userPassword"></param>
  7898. /// <param name="sessionKey"></param>
  7899. /// <param name="usercode">工号编码</param>
  7900. /// <returns></returns>
  7901. public ActionResult GetRecyclingflagByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7902. {
  7903. ActionResult actionResult = new ActionResult();
  7904. try
  7905. {
  7906. // 验证请求头信息
  7907. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7908. // 验证失败
  7909. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7910. {
  7911. return actionResult;
  7912. }
  7913. int returnValue = ServiceInvoker.Invoke<int>(this,
  7914. () => PMModuleLogic.GetRecyclingflagByBarcode(barcode, sUserInfo));
  7915. actionResult.Result = JsonHelper.ToJson(returnValue);
  7916. actionResult.Status = (int)Constant.PDAResult.Success;
  7917. }
  7918. catch (Exception ex)
  7919. {
  7920. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7921. OutputLog.TraceLog(LogPriority.Error,
  7922. this.ToString(),
  7923. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7924. ex.ToString(),
  7925. LocalPath.LogExePath);
  7926. actionResult.Status = (int)Constant.PDAResult.Exception;
  7927. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7928. }
  7929. return actionResult;
  7930. }
  7931. #endregion
  7932. #region 注浆盘点
  7933. /// <summary>
  7934. /// 获取注浆盘点单列表
  7935. /// </summary>
  7936. /// <param name="sUserInfo"></param>
  7937. /// <returns></returns>
  7938. public ActionResult GetAllGBChecked(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity)
  7939. {
  7940. ActionResult actionResult = new ActionResult();
  7941. try
  7942. {
  7943. // 验证请求头信息
  7944. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7945. // 验证失败
  7946. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7947. {
  7948. return actionResult;
  7949. }
  7950. entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA);
  7951. entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1);
  7952. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  7953. () => PDAModuleLogic.GetAllGBChecked(entity, sUserInfo));
  7954. actionResult.Result = JsonHelper.ToJson(ds);
  7955. actionResult.Status = (int)Constant.PDAResult.Success;
  7956. }
  7957. catch (Exception ex)
  7958. {
  7959. string json = JsonHelper.ToJson(entity);
  7960. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7961. OutputLog.TraceLog(LogPriority.Error,
  7962. this.ToString(),
  7963. System.Reflection.MethodBase.GetCurrentMethod().Name + "\r\n" + json,
  7964. ex.ToString(),
  7965. LocalPath.LogExePath);
  7966. actionResult.Status = (int)Constant.PDAResult.Exception;
  7967. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7968. }
  7969. return actionResult;
  7970. }
  7971. /// <summary>
  7972. /// 进行盘点操作
  7973. /// </summary>
  7974. /// <param name="accountCode"></param>
  7975. /// <param name="userCode"></param>
  7976. /// <param name="userPassword"></param>
  7977. /// <param name="sessionKey"></param>
  7978. /// <param name="InCheckedID">盘点单ID</param>
  7979. /// <param name="BarCode">产品条码</param>
  7980. /// <returns></returns>
  7981. public ActionResult UpdateGBChecked(string accountCode, string userCode, string userPassword, string sessionKey, int CheckedID, string BarCode)
  7982. {
  7983. ActionResult actionResult = new ActionResult();
  7984. try
  7985. {
  7986. // 验证请求头信息
  7987. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7988. // 验证失败
  7989. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7990. {
  7991. return actionResult;
  7992. }
  7993. ClientRequestEntity cre = new ClientRequestEntity();
  7994. cre.Properties["CheckedID"] = CheckedID;
  7995. cre.Properties["Barcode"] = BarCode;
  7996. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7997. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.UpdateGBChecked(sUserInfo, cre));
  7998. if (returnValue.Status == Constant.ServiceResultStatus.Success)
  7999. {
  8000. //actionResult.Result = JsonHelper.ToJson(returnValue);
  8001. actionResult.Status = (int)Constant.PDAResult.Success;
  8002. actionResult.Message = "产品【" + BarCode + "】盘点成功";
  8003. }
  8004. else
  8005. {
  8006. //actionResult.Result = JsonHelper.ToJson(returnValue);
  8007. actionResult.Status = (int)Constant.PDAResult.Fail;
  8008. actionResult.Message = returnValue.Message;
  8009. }
  8010. }
  8011. catch (Exception ex)
  8012. {
  8013. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  8014. OutputLog.TraceLog(LogPriority.Error,
  8015. this.ToString(),
  8016. System.Reflection.MethodBase.GetCurrentMethod().Name,
  8017. ex.ToString(),
  8018. LocalPath.LogExePath);
  8019. actionResult.Status = (int)Constant.PDAResult.Exception;
  8020. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  8021. }
  8022. return actionResult;
  8023. }
  8024. /// <summary>
  8025. /// 获取盘点单明细
  8026. /// </summary>
  8027. /// <param name="sUserInfo"></param>
  8028. /// <returns></returns>
  8029. public ActionResult GetUpdateGBCheckedInfo(string accountCode, string userCode, string userPassword, string sessionKey, int checkedID)
  8030. {
  8031. ActionResult actionResult = new ActionResult();
  8032. try
  8033. {
  8034. // 验证请求头信息
  8035. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  8036. // 验证失败
  8037. if (actionResult.Status != (int)Constant.PDAResult.Success)
  8038. {
  8039. return actionResult;
  8040. }
  8041. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  8042. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.
  8043. GetUpdateGBCheckedInfo(checkedID, sUserInfo));
  8044. actionResult.Result = JsonHelper.ToJson(ds);
  8045. actionResult.Status = (int)Constant.PDAResult.Success;
  8046. }
  8047. catch (Exception ex)
  8048. {
  8049. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  8050. OutputLog.TraceLog(LogPriority.Error,
  8051. this.ToString(),
  8052. System.Reflection.MethodBase.GetCurrentMethod().Name,
  8053. ex.ToString(),
  8054. LocalPath.LogExePath);
  8055. actionResult.Status = (int)Constant.PDAResult.Exception;
  8056. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  8057. }
  8058. return actionResult;
  8059. }
  8060. #endregion
  8061. #region 模具盘点
  8062. /// <summary>
  8063. /// 获取模具盘点单列表
  8064. /// </summary>
  8065. /// <param name="sUserInfo"></param>
  8066. /// <returns></returns>
  8067. public ActionResult GetAllMouldChecked(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity)
  8068. {
  8069. ActionResult actionResult = new ActionResult();
  8070. try
  8071. {
  8072. // 验证请求头信息
  8073. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  8074. // 验证失败
  8075. if (actionResult.Status != (int)Constant.PDAResult.Success)
  8076. {
  8077. return actionResult;
  8078. }
  8079. entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA);
  8080. entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1);
  8081. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  8082. () => PDAModuleLogic.GetAllMouldChecked(entity, sUserInfo));
  8083. actionResult.Result = JsonHelper.ToJson(ds);
  8084. actionResult.Status = (int)Constant.PDAResult.Success;
  8085. }
  8086. catch (Exception ex)
  8087. {
  8088. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  8089. OutputLog.TraceLog(LogPriority.Error,
  8090. this.ToString(),
  8091. System.Reflection.MethodBase.GetCurrentMethod().Name,
  8092. ex.ToString(),
  8093. LocalPath.LogExePath);
  8094. actionResult.Status = (int)Constant.PDAResult.Exception;
  8095. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  8096. }
  8097. return actionResult;
  8098. }
  8099. /// <summary>
  8100. /// 进行盘点操作
  8101. /// </summary>
  8102. /// <param name="accountCode"></param>
  8103. /// <param name="userCode"></param>
  8104. /// <param name="userPassword"></param>
  8105. /// <param name="sessionKey"></param>
  8106. /// <param name="InCheckedID">盘点单ID</param>
  8107. /// <param name="BarCode">产品条码</param>
  8108. /// <returns></returns>
  8109. public ActionResult UpdateMouldChecked(string accountCode, string userCode, string userPassword, string sessionKey, int CheckedID, string BarCode)
  8110. {
  8111. ActionResult actionResult = new ActionResult();
  8112. try
  8113. {
  8114. // 验证请求头信息
  8115. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  8116. // 验证失败
  8117. if (actionResult.Status != (int)Constant.PDAResult.Success)
  8118. {
  8119. return actionResult;
  8120. }
  8121. ClientRequestEntity cre = new ClientRequestEntity();
  8122. cre.Properties["CheckedID"] = CheckedID;
  8123. cre.Properties["Barcode"] = BarCode;
  8124. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  8125. () => Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.UpdateMouldChecked(sUserInfo, cre));
  8126. if (returnValue.Status == Constant.ServiceResultStatus.Success)
  8127. {
  8128. //actionResult.Result = JsonHelper.ToJson(returnValue);
  8129. actionResult.Status = (int)Constant.PDAResult.Success;
  8130. actionResult.Message = "产品【" + BarCode + "】盘点成功";
  8131. }
  8132. else
  8133. {
  8134. //actionResult.Result = JsonHelper.ToJson(returnValue);
  8135. actionResult.Status = (int)Constant.PDAResult.Fail;
  8136. actionResult.Message = returnValue.Message;
  8137. }
  8138. }
  8139. catch (Exception ex)
  8140. {
  8141. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  8142. OutputLog.TraceLog(LogPriority.Error,
  8143. this.ToString(),
  8144. System.Reflection.MethodBase.GetCurrentMethod().Name,
  8145. ex.ToString(),
  8146. LocalPath.LogExePath);
  8147. actionResult.Status = (int)Constant.PDAResult.Exception;
  8148. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  8149. }
  8150. return actionResult;
  8151. }
  8152. /// <summary>
  8153. /// 获取盘点单明细
  8154. /// </summary>
  8155. /// <param name="sUserInfo"></param>
  8156. /// <returns></returns>
  8157. public ActionResult GetUpdateMouldCheckedInfo(string accountCode, string userCode, string userPassword, string sessionKey, int checkedID)
  8158. {
  8159. ActionResult actionResult = new ActionResult();
  8160. try
  8161. {
  8162. // 验证请求头信息
  8163. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  8164. // 验证失败
  8165. if (actionResult.Status != (int)Constant.PDAResult.Success)
  8166. {
  8167. return actionResult;
  8168. }
  8169. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  8170. () => Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.
  8171. GetUpdateMouldCheckedInfo(checkedID, sUserInfo));
  8172. actionResult.Result = JsonHelper.ToJson(ds);
  8173. actionResult.Status = (int)Constant.PDAResult.Success;
  8174. }
  8175. catch (Exception ex)
  8176. {
  8177. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  8178. OutputLog.TraceLog(LogPriority.Error,
  8179. this.ToString(),
  8180. System.Reflection.MethodBase.GetCurrentMethod().Name,
  8181. ex.ToString(),
  8182. LocalPath.LogExePath);
  8183. actionResult.Status = (int)Constant.PDAResult.Exception;
  8184. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  8185. }
  8186. return actionResult;
  8187. }
  8188. #endregion
  8189. #region 通用接口
  8190. /// <summary>
  8191. /// PDA调用通用接口
  8192. /// </summary>
  8193. /// <param name="accountCode"></param>
  8194. /// <param name="userCode"></param>
  8195. /// <param name="userPassword"></param>
  8196. /// <param name="sessionKey"></param>
  8197. /// <param name="module"></param>
  8198. /// <param name="action"></param>
  8199. /// <param name="data"></param>
  8200. /// <returns></returns>
  8201. public ActionResult DoAction(string accountCode, string userCode, string userPassword, string sessionKey,
  8202. string module, string action, string jsonData)
  8203. {
  8204. ActionResult actionResult = null;
  8205. try
  8206. {
  8207. // 验证请求头信息
  8208. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  8209. // 验证失败
  8210. if (actionResult.Status != (int)Constant.PDAResult.Success)
  8211. {
  8212. return actionResult;
  8213. }
  8214. actionResult.Status = (int)Constant.PDAResult.Fail;
  8215. Dictionary<string, object> data = null;
  8216. if (!string.IsNullOrEmpty(jsonData) && jsonData[0] == '{')
  8217. {
  8218. data = JsonHelper.FromJson<Dictionary<string, object>>(jsonData);
  8219. }
  8220. #region PDA报表
  8221. if (module == "Report")
  8222. {
  8223. // 成型月度结算
  8224. if (action == "GetGroutingSettlementInfo")
  8225. {
  8226. DateTime month = DateTime.Now;
  8227. month = new DateTime(month.Year, month.Month, 1);
  8228. //month = new DateTime(2017, 6, 1);
  8229. int currentMonth = Convert.ToInt32(data["CurrentMonth"]);
  8230. if (currentMonth != 1)
  8231. {
  8232. month = month.AddMonths(-1);
  8233. }
  8234. ServiceResultEntity sre = PDAModuleLogic.GetGroutingSettlementInfo(sUserInfo, month);
  8235. if (sre.Status == Constant.ServiceResultStatus.Success)
  8236. {
  8237. actionResult.Status = (int)Constant.PDAResult.Success;
  8238. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8239. }
  8240. else
  8241. {
  8242. actionResult.Status = (int)Constant.PDAResult.Fail;
  8243. actionResult.Message = sre.Message;
  8244. }
  8245. return actionResult;
  8246. }
  8247. // 成型月度结算-明细
  8248. if (action == "GetGroutingSettlementDetail")
  8249. {
  8250. DateTime month = DateTime.Now;
  8251. month = new DateTime(month.Year, month.Month, 1);
  8252. //month = new DateTime(2017, 6, 1);
  8253. int currentMonth = Convert.ToInt32(data["CurrentMonth"]);
  8254. if (currentMonth != 1)
  8255. {
  8256. month = month.AddMonths(-1);
  8257. }
  8258. string goodsCode = data["GoodsCode"].ToString();
  8259. string detailDate = data["DetailDate"].ToString();
  8260. DateTime? date = null;
  8261. if (detailDate != "合计")
  8262. {
  8263. date = DateTime.Parse(detailDate);
  8264. }
  8265. ServiceResultEntity sre = PDAModuleLogic.GetGroutingSettlementDetail(sUserInfo, month, goodsCode, date);
  8266. if (sre.Status == Constant.ServiceResultStatus.Success)
  8267. {
  8268. actionResult.Status = (int)Constant.PDAResult.Success;
  8269. actionResult.Result = JsonHelper.ToJson(sre.Data);
  8270. }
  8271. else
  8272. {
  8273. actionResult.Status = (int)Constant.PDAResult.Fail;
  8274. actionResult.Message = sre.Message;
  8275. }
  8276. return actionResult;
  8277. }
  8278. // 产成品交接汇总
  8279. if (action == "GetFinishedProductHandoverSum")
  8280. {
  8281. DateTime date = DateTime.Parse(data["date"].ToString());
  8282. ServiceResultEntity sre = ReportModuleLogic.GetRPT0030112NPDAData(date,
  8283. data["goodscode"] as string, sUserInfo);
  8284. if (sre.Status == Constant.ServiceResultStatus.Success)
  8285. {
  8286. actionResult.Status = (int)Constant.PDAResult.Success;
  8287. actionResult.Result = JsonHelper.ToJson(sre.Data);
  8288. }
  8289. else if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  8290. {
  8291. actionResult.Status = (int)Constant.PDAResult.Success;
  8292. }
  8293. else
  8294. {
  8295. actionResult.Status = (int)Constant.PDAResult.Fail;
  8296. actionResult.Message = sre.Message;
  8297. }
  8298. return actionResult;
  8299. }
  8300. //xuwei add 2019-10-21
  8301. //统计当前工号,当日,按产品编码分组统计半检返修数据数量
  8302. if (action == "GetSemiReworkDayCount")
  8303. {
  8304. //不指定参数查询当天
  8305. string dateStr = DateTime.Now.ToString("yyyy-MM-dd");
  8306. //dateStr = "2019-10-17";
  8307. //指定参数查询特定日期
  8308. if(data.ContainsKey("SemiReworkDate")) dateStr = data["SemiReworkDate"].ToString();
  8309. ServiceResultEntity sre = ReportModuleLogic.GetSemiReworkDayCount(sUserInfo, dateStr);
  8310. if (sre.Status == Constant.ServiceResultStatus.Success)
  8311. {
  8312. actionResult.Status = (int)Constant.PDAResult.Success;
  8313. actionResult.Result = JsonHelper.ToJson(sre.Data);
  8314. }
  8315. else
  8316. {
  8317. actionResult.Status = (int)Constant.PDAResult.Fail;
  8318. actionResult.Message = sre.Message;
  8319. }
  8320. return actionResult;
  8321. }
  8322. //xuwe end
  8323. return actionResult;
  8324. }
  8325. #endregion
  8326. #region 模具管理
  8327. if (module == "PC_Mould")
  8328. {
  8329. #region 模具新建画面数据初始化
  8330. if (action == "GetMouldAddInit")
  8331. {
  8332. ClientRequestEntity cre = new ClientRequestEntity();
  8333. cre.Properties["MouldID"] = 0;
  8334. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1002LoadData(sUserInfo, cre);
  8335. if (sre.Status == Constant.ServiceResultStatus.Success)
  8336. {
  8337. actionResult.Status = (int)Constant.PDAResult.Success;
  8338. actionResult.Result = JsonHelper.ToJson(sre.Data);
  8339. }
  8340. else
  8341. {
  8342. actionResult.Status = (int)Constant.PDAResult.Fail;
  8343. actionResult.Message = sre.Message;
  8344. }
  8345. return actionResult;
  8346. }
  8347. #endregion
  8348. #region 验证模具产品型号
  8349. if (action == "CheckGoodsCodeOnMould")
  8350. {
  8351. ClientRequestEntity cre = new ClientRequestEntity();
  8352. cre.Properties["GoodsCode"] = data["GoodsCode"];
  8353. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1002GoodsData(sUserInfo, cre);
  8354. if (sre.Status == Constant.ServiceResultStatus.Success &&
  8355. sre.Data.Tables[0].Rows.Count > 0)
  8356. {
  8357. actionResult.Status = (int)Constant.PDAResult.Success;
  8358. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8359. }
  8360. else
  8361. {
  8362. actionResult.Status = (int)Constant.PDAResult.Fail;
  8363. actionResult.Message = "无效产品型号";
  8364. }
  8365. return actionResult;
  8366. }
  8367. #endregion
  8368. #region 验证模具生产工号
  8369. if (action == "CheckUserCodeOnMould")
  8370. {
  8371. DataTable sre = PDAModuleLogic.GetUserCodeOnMould(sUserInfo, data["UserCode"].ToString());
  8372. if (sre != null && sre.Rows.Count > 0)
  8373. {
  8374. actionResult.Status = (int)Constant.PDAResult.Success;
  8375. actionResult.Result = JsonHelper.ToJson(sre);
  8376. }
  8377. else
  8378. {
  8379. actionResult.Status = (int)Constant.PDAResult.Fail;
  8380. actionResult.Message = "无效生产工号";
  8381. }
  8382. return actionResult;
  8383. }
  8384. #endregion
  8385. #region 新建保存
  8386. if (action == "SetMouldAdd" || action == "SetMouldEdit")
  8387. {
  8388. ClientRequestEntity cre = new ClientRequestEntity();
  8389. foreach (string item in data.Keys)
  8390. {
  8391. if (item == "ProductionDate")
  8392. {
  8393. cre.Properties.Add(item, Convert.ToDateTime(data[item]));
  8394. }
  8395. else
  8396. {
  8397. cre.Properties.Add(item, data[item]);
  8398. }
  8399. }
  8400. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1002Data(sUserInfo, cre);
  8401. if (sre.Status == Constant.ServiceResultStatus.Success)
  8402. {
  8403. actionResult.Status = (int)Constant.PDAResult.Success;
  8404. }
  8405. else
  8406. {
  8407. actionResult.Status = (int)Constant.PDAResult.Fail;
  8408. actionResult.Result = sre.OtherStatus;
  8409. actionResult.Message = sre.Message;
  8410. }
  8411. return actionResult;
  8412. }
  8413. #endregion
  8414. #region 模具编辑画面数据初始化
  8415. if (action == "GetMouldEditInfo")
  8416. {
  8417. DataTable sre = PDAModuleLogic.GetMouldEditInfo(sUserInfo, data["MouldBarcode"].ToString());
  8418. if (sre != null && sre.Rows.Count > 0)
  8419. {
  8420. actionResult.Status = (int)Constant.PDAResult.Success;
  8421. actionResult.Result = JsonHelper.ToJson(sre);
  8422. }
  8423. else
  8424. {
  8425. actionResult.Status = (int)Constant.PDAResult.Fail;
  8426. actionResult.Message = "无效模具条码";
  8427. }
  8428. return actionResult;
  8429. }
  8430. #endregion
  8431. #region 模具操作-画面初始化
  8432. if (action == "GetMouldOperationInit")
  8433. {
  8434. ClientRequestEntity cre = new ClientRequestEntity();
  8435. cre.Properties["MouldOperationType"] = data["MouldOperationType"];
  8436. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1004LoadData(sUserInfo, cre);
  8437. if (sre.Status == Constant.ServiceResultStatus.Success)
  8438. {
  8439. actionResult.Status = (int)Constant.PDAResult.Success;
  8440. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8441. }
  8442. else
  8443. {
  8444. actionResult.Status = (int)Constant.PDAResult.Fail;
  8445. actionResult.Result = sre.OtherStatus;
  8446. actionResult.Message = sre.Message;
  8447. }
  8448. return actionResult;
  8449. }
  8450. #endregion
  8451. #region 模具操作-验证模具条码
  8452. if (action == "CheckMouldBarcode")
  8453. {
  8454. ClientRequestEntity cre = new ClientRequestEntity();
  8455. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8456. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetMouldData(sUserInfo, cre);
  8457. if (sre.Status == Constant.ServiceResultStatus.Success)
  8458. {
  8459. if (sre.Data.Tables[0].Rows.Count == 0)
  8460. {
  8461. actionResult.Status = (int)Constant.PDAResult.Fail;
  8462. actionResult.Result = -1;
  8463. actionResult.Message = "模具【" + data["MouldBarcode"] + "】不存在";
  8464. return actionResult;
  8465. }
  8466. int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
  8467. int mouldStatusID = Convert.ToInt32(sre.Data.Tables[0].Rows[0]["MouldStatus"]);
  8468. string mouldStatusName = sre.Data.Tables[0].Rows[0]["MouldStatusName"].ToString();
  8469. #region 报损
  8470. if (mouldOperationType == 2)
  8471. {
  8472. if (mouldStatusID == 1 || mouldStatusID == 3)
  8473. {
  8474. actionResult.Status = (int)Constant.PDAResult.Success;
  8475. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8476. }
  8477. else
  8478. {
  8479. actionResult.Status = (int)Constant.PDAResult.Fail;
  8480. actionResult.Result = -2;
  8481. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行报损操作";
  8482. }
  8483. return actionResult;
  8484. }
  8485. #endregion
  8486. #region 撤销
  8487. if (mouldOperationType == 3)
  8488. {
  8489. if (mouldStatusID == 4)
  8490. {
  8491. actionResult.Status = (int)Constant.PDAResult.Success;
  8492. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8493. }
  8494. else
  8495. {
  8496. actionResult.Status = (int)Constant.PDAResult.Fail;
  8497. actionResult.Result = -2;
  8498. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行撤销报损操作";
  8499. }
  8500. return actionResult;
  8501. }
  8502. #endregion
  8503. #region 领用
  8504. if (mouldOperationType == 4)
  8505. {
  8506. if (mouldStatusID == 1)
  8507. {
  8508. actionResult.Status = (int)Constant.PDAResult.Success;
  8509. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8510. }
  8511. else
  8512. {
  8513. actionResult.Status = (int)Constant.PDAResult.Fail;
  8514. actionResult.Result = -2;
  8515. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行领用操作";
  8516. }
  8517. return actionResult;
  8518. }
  8519. #endregion
  8520. #region 回收
  8521. if (mouldOperationType == 5)
  8522. {
  8523. if (mouldStatusID == 3)
  8524. {
  8525. actionResult.Status = (int)Constant.PDAResult.Success;
  8526. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8527. }
  8528. else
  8529. {
  8530. actionResult.Status = (int)Constant.PDAResult.Fail;
  8531. actionResult.Result = -2;
  8532. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行回收操作";
  8533. }
  8534. return actionResult;
  8535. }
  8536. #endregion
  8537. #region 变更型号
  8538. if (mouldOperationType == -1)
  8539. {
  8540. if (mouldStatusID != 4)
  8541. {
  8542. actionResult.Status = (int)Constant.PDAResult.Success;
  8543. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8544. }
  8545. else
  8546. {
  8547. actionResult.Status = (int)Constant.PDAResult.Fail;
  8548. actionResult.Result = -2;
  8549. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行变更型号操作";
  8550. }
  8551. return actionResult;
  8552. }
  8553. #endregion
  8554. #region 替换条码
  8555. if (mouldOperationType == -2)
  8556. {
  8557. actionResult.Status = (int)Constant.PDAResult.Success;
  8558. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8559. return actionResult;
  8560. }
  8561. #endregion
  8562. return actionResult;
  8563. }
  8564. }
  8565. #endregion
  8566. #region 模具操作-保存
  8567. if (action == "SetMouldOperation")
  8568. {
  8569. ClientRequestEntity cre = new ClientRequestEntity();
  8570. cre.Properties["MouldIDs"] = string.Join(",", JsonHelper.FromJson<int[]>(data["MouldIDs"].ToString()));
  8571. cre.Properties["MouldOperationType"] = data["MouldOperationType"];
  8572. cre.Properties["Remarks"] = data["Remarks"];
  8573. int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
  8574. if (mouldOperationType == (int)Constant.MouldOperationType.ChangeGoodsCode)
  8575. {
  8576. cre.Properties["GoodsID"] = data["GoodsID"];
  8577. cre.Properties["GoodsCode"] = data["GoodsCode"];
  8578. }
  8579. else if (mouldOperationType == (int)Constant.MouldOperationType.InvToScrap)
  8580. {
  8581. cre.Properties["ScrapReason"] = data["ScrapReason"];
  8582. cre.Properties["ScrapResponsibility"] = data["ScrapRemarks"];
  8583. }
  8584. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1004Data(sUserInfo, cre);
  8585. if (sre.Status == Constant.ServiceResultStatus.Success)
  8586. {
  8587. actionResult.Status = (int)Constant.PDAResult.Success;
  8588. }
  8589. else
  8590. {
  8591. actionResult.Status = (int)Constant.PDAResult.Fail;
  8592. }
  8593. return actionResult;
  8594. }
  8595. #endregion
  8596. #region 模具操作-替换条码
  8597. if (action == "ChangedMouldBarcode")
  8598. {
  8599. ClientRequestEntity cre = new ClientRequestEntity();
  8600. cre.Properties["MouldID"] = data["MouldID"];
  8601. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8602. cre.Properties["NewMouldBarcode"] = data["NewMouldBarcode"];
  8603. cre.Properties["Remarks"] = data["Remarks"];
  8604. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1003Data(sUserInfo, cre);
  8605. if (sre.Status == Constant.ServiceResultStatus.Success)
  8606. {
  8607. actionResult.Status = (int)Constant.PDAResult.Success;
  8608. }
  8609. else
  8610. {
  8611. actionResult.Status = (int)Constant.PDAResult.Fail;
  8612. actionResult.Result = sre.OtherStatus;
  8613. actionResult.Message = sre.Message;
  8614. }
  8615. return actionResult;
  8616. }
  8617. #endregion
  8618. #region 模具跟踪表
  8619. if (action == "GetMoldTracking")
  8620. {
  8621. ClientRequestEntity cre = new ClientRequestEntity();
  8622. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8623. ServiceResultEntity sre = ReportModuleLogic.GetRPT020105Data(cre, sUserInfo);
  8624. if (sre.Status == Constant.ServiceResultStatus.Success)
  8625. {
  8626. actionResult.Status = (int)Constant.PDAResult.Success;
  8627. actionResult.Result = JsonHelper.ToJson(sre.Data);
  8628. }
  8629. else
  8630. {
  8631. actionResult.Status = (int)Constant.PDAResult.Fail;
  8632. actionResult.Message = "此模具条码不存在";
  8633. }
  8634. return actionResult;
  8635. }
  8636. #endregion
  8637. return actionResult;
  8638. }
  8639. #endregion
  8640. #region 成型线模具管理
  8641. if (module == "PC_GroutingLineMould")
  8642. {
  8643. #region 获取当前用户成型线模具管理权限
  8644. if (action == "GetGMouldStatusRight")
  8645. {
  8646. DataTable right = PDAModuleLogic.GetGMouldStatusRight(sUserInfo);
  8647. actionResult.Status = (int)Constant.PDAResult.Success;
  8648. if (right != null && right.Rows.Count > 0)
  8649. {
  8650. actionResult.Result = JsonHelper.ToJson(right);
  8651. }
  8652. return actionResult;
  8653. }
  8654. #endregion
  8655. #region 获取成型线状态等信息,和成型模具信息
  8656. if (action == "GetGroutingLineMould")
  8657. {
  8658. int? groutingLineID = null;
  8659. string groutingLineCode = null;
  8660. if (data.ContainsKey("GroutingLineID"))
  8661. {
  8662. groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8663. }
  8664. else
  8665. {
  8666. groutingLineCode = data["GroutingLineCode"] + "";
  8667. }
  8668. DataSet lineInfo = PDAModuleLogic.GetGroutingLineMould(sUserInfo, groutingLineCode, groutingLineID);
  8669. if (lineInfo == null)
  8670. {
  8671. actionResult.Status = (int)Constant.PDAResult.Fail;
  8672. actionResult.Message = "成型线【" + groutingLineCode + "】不存在或是停用状态";
  8673. }
  8674. else
  8675. {
  8676. actionResult.Status = (int)Constant.PDAResult.Success;
  8677. actionResult.Result = JsonHelper.ToJson(lineInfo);
  8678. }
  8679. return actionResult;
  8680. }
  8681. #endregion
  8682. #region 模具操作-画面初始化
  8683. if (action == "GetMouldOperationInit")
  8684. {
  8685. ClientRequestEntity cre = new ClientRequestEntity();
  8686. cre.Properties["MouldOperationType"] = 2;
  8687. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1004LoadData(sUserInfo, cre);
  8688. if (sre.Status == Constant.ServiceResultStatus.Success)
  8689. {
  8690. actionResult.Status = (int)Constant.PDAResult.Success;
  8691. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8692. }
  8693. else
  8694. {
  8695. actionResult.Status = (int)Constant.PDAResult.Fail;
  8696. actionResult.Result = sre.OtherStatus;
  8697. actionResult.Message = sre.Message;
  8698. }
  8699. return actionResult;
  8700. }
  8701. #endregion
  8702. #region 成型模具操作-画面初始化
  8703. if (action == "GetGroutingMouldOperationInit")
  8704. {
  8705. DataTable initData = PDAModuleLogic.GetGroutingMouldOperationInit(sUserInfo, 6);
  8706. if (initData != null && initData.Rows.Count > 0)
  8707. {
  8708. actionResult.Status = (int)Constant.PDAResult.Success;
  8709. Dictionary<string, string> syssetting = new Dictionary<string, string>();
  8710. foreach (DataRow item in initData.Rows)
  8711. {
  8712. syssetting.Add(item["settingcode"].ToString(), item["settingvalue"].ToString());
  8713. }
  8714. actionResult.Result = JsonHelper.ToJson(syssetting);
  8715. }
  8716. else
  8717. {
  8718. actionResult.Status = (int)Constant.PDAResult.Fail;
  8719. }
  8720. return actionResult;
  8721. }
  8722. #endregion
  8723. #region 模具操作-验证模具条码
  8724. if (action == "CheckMouldBarcode")
  8725. {
  8726. ClientRequestEntity cre = new ClientRequestEntity();
  8727. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8728. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetMouldData(sUserInfo, cre);
  8729. if (sre.Status == Constant.ServiceResultStatus.Success)
  8730. {
  8731. if (sre.Data.Tables[0].Rows.Count == 0)
  8732. {
  8733. actionResult.Status = (int)Constant.PDAResult.Fail;
  8734. actionResult.Result = -1;
  8735. actionResult.Message = "模具【" + data["MouldBarcode"] + "】不存在";
  8736. return actionResult;
  8737. }
  8738. int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
  8739. int mouldStatusID = Convert.ToInt32(sre.Data.Tables[0].Rows[0]["MouldStatus"]);
  8740. string mouldStatusName = sre.Data.Tables[0].Rows[0]["MouldStatusName"].ToString();
  8741. #region 上线
  8742. if (mouldOperationType == 6)
  8743. {
  8744. if (mouldStatusID == 1 || mouldStatusID == 3)
  8745. {
  8746. if (data.ContainsKey("GoodsID"))
  8747. {
  8748. if (sre.Data.Tables[0].Rows[0]["GoodsID"] + "" != data["GoodsID"] + "")
  8749. {
  8750. actionResult.Status = (int)Constant.PDAResult.Fail;
  8751. actionResult.Result = -3;
  8752. actionResult.Message =
  8753. "模具【" + data["MouldBarcode"] + "】的产品型号为【" +
  8754. sre.Data.Tables[0].Rows[0]["GoodsCode"] +
  8755. "】与当前不一致";
  8756. return actionResult;
  8757. }
  8758. }
  8759. actionResult.Status = (int)Constant.PDAResult.Success;
  8760. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8761. }
  8762. else
  8763. {
  8764. actionResult.Status = (int)Constant.PDAResult.Fail;
  8765. actionResult.Result = -2;
  8766. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行报损操作";
  8767. }
  8768. return actionResult;
  8769. }
  8770. #endregion
  8771. return actionResult;
  8772. }
  8773. }
  8774. #endregion
  8775. #region 停用
  8776. if (action == "StopGroutingLineDetail")
  8777. {
  8778. if (data == null || !data.ContainsKey("Details"))
  8779. {
  8780. actionResult.Status = (int)Constant.PDAResult.Fail;
  8781. actionResult.Message = "参数错误";
  8782. return actionResult;
  8783. }
  8784. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8785. DataTable gTable = new DataTable();
  8786. gTable.Columns.Add("GroutingLineID", typeof(int));
  8787. gTable.Columns.Add("GroutingLineCode");
  8788. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8789. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8790. gTable.Columns.Add("GroutingMouldCode");
  8791. gTable.Columns.Add("RecordRemarks");
  8792. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8793. gTable.Columns.Add("MouldID", typeof(int));
  8794. gTable.Columns.Add("MouldCode");
  8795. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8796. string groutingLineCode = data["GroutingLineCode"] + "";
  8797. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8798. foreach (Dictionary<string, object> item in details)
  8799. {
  8800. int? mouldID = null;
  8801. if (item.ContainsKey("MouldID"))
  8802. {
  8803. mouldID = Convert.ToInt32(item["MouldID"]);
  8804. if (mouldID == 0)
  8805. {
  8806. mouldID = null;
  8807. }
  8808. }
  8809. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8810. item["GLineDetailID"], item["GLineDetailCode"],
  8811. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8812. mouldID, item["MouldCode"]);
  8813. }
  8814. int result = PCModuleLogicDAL.StopGroutingLineDetail(gTable, sUserInfo);
  8815. if (result > 0)
  8816. {
  8817. actionResult.Status = (int)Constant.PDAResult.Success;
  8818. }
  8819. else
  8820. {
  8821. actionResult.Status = (int)Constant.PDAResult.Fail;
  8822. actionResult.Result = result;
  8823. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8824. return actionResult;
  8825. }
  8826. return actionResult;
  8827. }
  8828. #endregion
  8829. #region 启用
  8830. if (action == "StartGroutingLineDetail")
  8831. {
  8832. if (data == null || !data.ContainsKey("Details"))
  8833. {
  8834. actionResult.Status = (int)Constant.PDAResult.Fail;
  8835. actionResult.Message = "参数错误";
  8836. return actionResult;
  8837. }
  8838. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8839. DataTable gTable = new DataTable();
  8840. gTable.Columns.Add("GroutingLineID", typeof(int));
  8841. gTable.Columns.Add("GroutingLineCode");
  8842. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8843. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8844. gTable.Columns.Add("GroutingMouldCode");
  8845. gTable.Columns.Add("RecordRemarks");
  8846. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8847. gTable.Columns.Add("MouldID", typeof(int));
  8848. gTable.Columns.Add("MouldCode");
  8849. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8850. string groutingLineCode = data["GroutingLineCode"] + "";
  8851. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8852. foreach (Dictionary<string, object> item in details)
  8853. {
  8854. int? mouldID = null;
  8855. if (item.ContainsKey("MouldID"))
  8856. {
  8857. mouldID = Convert.ToInt32(item["MouldID"]);
  8858. if (mouldID == 0)
  8859. {
  8860. mouldID = null;
  8861. }
  8862. }
  8863. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8864. item["GLineDetailID"], item["GLineDetailCode"],
  8865. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8866. mouldID, item["MouldCode"]);
  8867. }
  8868. int result = PCModuleLogicDAL.StartGroutingLineDetail(gTable, sUserInfo);
  8869. if (result > 0)
  8870. {
  8871. actionResult.Status = (int)Constant.PDAResult.Success;
  8872. }
  8873. else
  8874. {
  8875. actionResult.Status = (int)Constant.PDAResult.Fail;
  8876. actionResult.Result = result;
  8877. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8878. return actionResult;
  8879. }
  8880. return actionResult;
  8881. }
  8882. #endregion
  8883. #region 维修
  8884. if (action == "RepairStartGroutingLineDetail")
  8885. {
  8886. if (data == null || !data.ContainsKey("Details"))
  8887. {
  8888. actionResult.Status = (int)Constant.PDAResult.Fail;
  8889. actionResult.Message = "参数错误";
  8890. return actionResult;
  8891. }
  8892. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8893. DataTable gTable = new DataTable();
  8894. gTable.Columns.Add("GroutingLineID", typeof(int));
  8895. gTable.Columns.Add("GroutingLineCode");
  8896. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8897. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8898. gTable.Columns.Add("GroutingMouldCode");
  8899. gTable.Columns.Add("RecordRemarks");
  8900. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8901. gTable.Columns.Add("MouldID", typeof(int));
  8902. gTable.Columns.Add("MouldCode");
  8903. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8904. string groutingLineCode = data["GroutingLineCode"] + "";
  8905. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8906. foreach (Dictionary<string, object> item in details)
  8907. {
  8908. int? mouldID = null;
  8909. if (item.ContainsKey("MouldID"))
  8910. {
  8911. mouldID = Convert.ToInt32(item["MouldID"]);
  8912. if (mouldID == 0)
  8913. {
  8914. mouldID = null;
  8915. }
  8916. }
  8917. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8918. item["GLineDetailID"], item["GLineDetailCode"],
  8919. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8920. mouldID, item["MouldCode"]);
  8921. }
  8922. int result = PCModuleLogicDAL.RepairStartGroutingLineDetail(gTable, sUserInfo);
  8923. if (result > 0)
  8924. {
  8925. actionResult.Status = (int)Constant.PDAResult.Success;
  8926. }
  8927. else
  8928. {
  8929. actionResult.Status = (int)Constant.PDAResult.Fail;
  8930. actionResult.Result = result;
  8931. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8932. return actionResult;
  8933. }
  8934. return actionResult;
  8935. }
  8936. #endregion
  8937. #region 结束维修
  8938. if (action == "RepairEndGroutingLineDetail")
  8939. {
  8940. if (data == null || !data.ContainsKey("Details"))
  8941. {
  8942. actionResult.Status = (int)Constant.PDAResult.Fail;
  8943. actionResult.Message = "参数错误";
  8944. return actionResult;
  8945. }
  8946. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8947. DataTable gTable = new DataTable();
  8948. gTable.Columns.Add("GroutingLineID", typeof(int));
  8949. gTable.Columns.Add("GroutingLineCode");
  8950. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8951. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8952. gTable.Columns.Add("GroutingMouldCode");
  8953. gTable.Columns.Add("RecordRemarks");
  8954. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8955. gTable.Columns.Add("MouldID", typeof(int));
  8956. gTable.Columns.Add("MouldCode");
  8957. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8958. string groutingLineCode = data["GroutingLineCode"] + "";
  8959. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8960. foreach (Dictionary<string, object> item in details)
  8961. {
  8962. int? mouldID = null;
  8963. if (item.ContainsKey("MouldID"))
  8964. {
  8965. mouldID = Convert.ToInt32(item["MouldID"]);
  8966. if (mouldID == 0)
  8967. {
  8968. mouldID = null;
  8969. }
  8970. }
  8971. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8972. item["GLineDetailID"], item["GLineDetailCode"],
  8973. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8974. mouldID, item["MouldCode"]);
  8975. }
  8976. int result = PCModuleLogicDAL.RepairEndGroutingLineDetail(gTable, sUserInfo);
  8977. if (result > 0)
  8978. {
  8979. actionResult.Status = (int)Constant.PDAResult.Success;
  8980. }
  8981. else
  8982. {
  8983. actionResult.Status = (int)Constant.PDAResult.Fail;
  8984. actionResult.Result = result;
  8985. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8986. return actionResult;
  8987. }
  8988. return actionResult;
  8989. }
  8990. #endregion
  8991. #region 换模
  8992. if (action == "ChangeGMouldStartGroutingLineDetail")
  8993. {
  8994. if (data == null || !data.ContainsKey("Details"))
  8995. {
  8996. actionResult.Status = (int)Constant.PDAResult.Fail;
  8997. actionResult.Message = "参数错误";
  8998. return actionResult;
  8999. }
  9000. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9001. DataTable gTable = new DataTable();
  9002. gTable.Columns.Add("GroutingLineID", typeof(int));
  9003. gTable.Columns.Add("GroutingLineCode");
  9004. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9005. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9006. gTable.Columns.Add("GroutingMouldCode");
  9007. gTable.Columns.Add("RecordRemarks");
  9008. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9009. gTable.Columns.Add("MouldID", typeof(int));
  9010. gTable.Columns.Add("MouldCode");
  9011. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9012. gTable.Columns.Add("MouldStatus", typeof(int));
  9013. gTable.Columns.Add("ScrapReason", typeof(int));
  9014. gTable.Columns.Add("ScrapResponsibility");
  9015. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9016. string groutingLineCode = data["GroutingLineCode"] + "";
  9017. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9018. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  9019. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  9020. string scrapResponsibility = data["ScrapRemarks"] + "";
  9021. foreach (Dictionary<string, object> item in details)
  9022. {
  9023. int? mouldID = null;
  9024. if (item.ContainsKey("MouldID"))
  9025. {
  9026. mouldID = Convert.ToInt32(item["MouldID"]);
  9027. if (mouldID == 0)
  9028. {
  9029. mouldID = null;
  9030. }
  9031. }
  9032. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9033. item["GLineDetailID"], item["GLineDetailCode"],
  9034. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  9035. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  9036. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  9037. }
  9038. int result = PCModuleLogicDAL.ChangeGMouldStartGroutingLineDetail(gTable, sUserInfo);
  9039. if (result > 0)
  9040. {
  9041. actionResult.Status = (int)Constant.PDAResult.Success;
  9042. }
  9043. else
  9044. {
  9045. actionResult.Status = (int)Constant.PDAResult.Fail;
  9046. actionResult.Result = result;
  9047. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9048. return actionResult;
  9049. }
  9050. return actionResult;
  9051. }
  9052. #endregion
  9053. #region 变产
  9054. if (action == "UpdateLineStartGroutingLineDetail")
  9055. {
  9056. if (data == null || !data.ContainsKey("Details"))
  9057. {
  9058. actionResult.Status = (int)Constant.PDAResult.Fail;
  9059. actionResult.Message = "参数错误";
  9060. return actionResult;
  9061. }
  9062. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9063. DataTable gTable = new DataTable();
  9064. gTable.Columns.Add("GroutingLineID", typeof(int));
  9065. gTable.Columns.Add("GroutingLineCode");
  9066. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9067. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9068. gTable.Columns.Add("GroutingMouldCode");
  9069. gTable.Columns.Add("RecordRemarks");
  9070. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9071. gTable.Columns.Add("MouldID", typeof(int));
  9072. gTable.Columns.Add("MouldCode");
  9073. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9074. gTable.Columns.Add("MouldStatus", typeof(int));
  9075. gTable.Columns.Add("ScrapReason", typeof(int));
  9076. gTable.Columns.Add("ScrapResponsibility");
  9077. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9078. string groutingLineCode = data["GroutingLineCode"] + "";
  9079. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9080. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  9081. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  9082. string scrapResponsibility = data["ScrapRemarks"] + "";
  9083. foreach (Dictionary<string, object> item in details)
  9084. {
  9085. int? mouldID = null;
  9086. if (item.ContainsKey("MouldID"))
  9087. {
  9088. mouldID = Convert.ToInt32(item["MouldID"]);
  9089. if (mouldID == 0)
  9090. {
  9091. mouldID = null;
  9092. }
  9093. }
  9094. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9095. item["GLineDetailID"], item["GLineDetailCode"],
  9096. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  9097. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  9098. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  9099. }
  9100. int result = PCModuleLogicDAL.UpdateLineStartGroutingLineDetail(gTable, sUserInfo);
  9101. if (result > 0)
  9102. {
  9103. actionResult.Status = (int)Constant.PDAResult.Success;
  9104. }
  9105. else
  9106. {
  9107. actionResult.Status = (int)Constant.PDAResult.Fail;
  9108. actionResult.Result = result;
  9109. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9110. return actionResult;
  9111. }
  9112. return actionResult;
  9113. }
  9114. #endregion
  9115. #region 整线变产
  9116. if (action == "UpdateAllLineStartGroutingLineDetail")
  9117. {
  9118. if (data == null || !data.ContainsKey("Details"))
  9119. {
  9120. actionResult.Status = (int)Constant.PDAResult.Fail;
  9121. actionResult.Message = "参数错误";
  9122. return actionResult;
  9123. }
  9124. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9125. DataTable gTable = new DataTable();
  9126. gTable.Columns.Add("GroutingLineID", typeof(int));
  9127. gTable.Columns.Add("GroutingLineCode");
  9128. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9129. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9130. gTable.Columns.Add("GroutingMouldCode");
  9131. gTable.Columns.Add("RecordRemarks");
  9132. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9133. gTable.Columns.Add("MouldID", typeof(int));
  9134. gTable.Columns.Add("MouldCode");
  9135. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9136. gTable.Columns.Add("MouldStatus", typeof(int));
  9137. gTable.Columns.Add("ScrapReason", typeof(int));
  9138. gTable.Columns.Add("ScrapResponsibility");
  9139. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9140. string groutingLineCode = data["GroutingLineCode"] + "";
  9141. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9142. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  9143. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  9144. string scrapResponsibility = data["ScrapRemarks"] + "";
  9145. foreach (Dictionary<string, object> item in details)
  9146. {
  9147. int? mouldID = null;
  9148. if (item.ContainsKey("MouldID"))
  9149. {
  9150. mouldID = Convert.ToInt32(item["MouldID"]);
  9151. if (mouldID == 0)
  9152. {
  9153. mouldID = null;
  9154. }
  9155. }
  9156. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9157. item["GLineDetailID"], item["GLineDetailCode"],
  9158. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  9159. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  9160. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  9161. }
  9162. int result = PCModuleLogicDAL.UpdateAllLineStartGroutingLineDetail(gTable, groutingLineID, lineOPTimeStamp, sUserInfo);
  9163. if (result > 0)
  9164. {
  9165. actionResult.Status = (int)Constant.PDAResult.Success;
  9166. }
  9167. else
  9168. {
  9169. actionResult.Status = (int)Constant.PDAResult.Fail;
  9170. actionResult.Result = result;
  9171. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9172. return actionResult;
  9173. }
  9174. return actionResult;
  9175. }
  9176. #endregion
  9177. #region 卸模
  9178. if (action == "UnloadGroutingLineDetail")
  9179. {
  9180. if (data == null || !data.ContainsKey("Details"))
  9181. {
  9182. actionResult.Status = (int)Constant.PDAResult.Fail;
  9183. actionResult.Message = "参数错误";
  9184. return actionResult;
  9185. }
  9186. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9187. DataTable gTable = new DataTable();
  9188. gTable.Columns.Add("GroutingLineID", typeof(int));
  9189. gTable.Columns.Add("GroutingLineCode");
  9190. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9191. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9192. gTable.Columns.Add("GroutingMouldCode");
  9193. gTable.Columns.Add("RecordRemarks");
  9194. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9195. gTable.Columns.Add("MouldID", typeof(int));
  9196. gTable.Columns.Add("MouldCode");
  9197. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9198. gTable.Columns.Add("MouldStatus", typeof(int));
  9199. gTable.Columns.Add("ScrapReason", typeof(int));
  9200. gTable.Columns.Add("ScrapResponsibility");
  9201. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9202. string groutingLineCode = data["GroutingLineCode"] + "";
  9203. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9204. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  9205. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  9206. string scrapResponsibility = data["ScrapRemarks"] + "";
  9207. foreach (Dictionary<string, object> item in details)
  9208. {
  9209. int? mouldID = null;
  9210. if (item.ContainsKey("MouldID"))
  9211. {
  9212. mouldID = Convert.ToInt32(item["MouldID"]);
  9213. if (mouldID == 0)
  9214. {
  9215. mouldID = null;
  9216. }
  9217. }
  9218. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9219. item["GLineDetailID"], item["GLineDetailCode"],
  9220. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  9221. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  9222. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  9223. }
  9224. int result = PCModuleLogicDAL.UnloadGroutingLineDetail(gTable, sUserInfo);
  9225. if (result > 0)
  9226. {
  9227. actionResult.Status = (int)Constant.PDAResult.Success;
  9228. }
  9229. else
  9230. {
  9231. actionResult.Status = (int)Constant.PDAResult.Fail;
  9232. actionResult.Result = result;
  9233. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9234. return actionResult;
  9235. }
  9236. return actionResult;
  9237. }
  9238. #endregion
  9239. #region 结束换模
  9240. if (action == "ChangeGMouldEndGroutingLineDetail")
  9241. {
  9242. if (data == null || !data.ContainsKey("Details"))
  9243. {
  9244. actionResult.Status = (int)Constant.PDAResult.Fail;
  9245. actionResult.Message = "参数错误";
  9246. return actionResult;
  9247. }
  9248. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9249. DataTable gTable = new DataTable();
  9250. gTable.Columns.Add("GroutingLineID", typeof(int));
  9251. gTable.Columns.Add("GroutingLineCode");
  9252. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9253. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9254. gTable.Columns.Add("GroutingMouldCode");
  9255. gTable.Columns.Add("RreasonRemarks");
  9256. gTable.Columns.Add("RecordRemarks");
  9257. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9258. gTable.Columns.Add("MouldID", typeof(int));
  9259. gTable.Columns.Add("MouldCode");
  9260. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9261. gTable.Columns.Add("GoodsID", typeof(int));
  9262. gTable.Columns.Add("GoodsCode");
  9263. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  9264. gTable.Columns.Add("GroutingCount", typeof(int));
  9265. gTable.Columns.Add("MouldSource");
  9266. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9267. string groutingLineCode = data["GroutingLineCode"] + "";
  9268. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9269. foreach (Dictionary<string, object> item in details)
  9270. {
  9271. int? mouldID = null;
  9272. if (item.ContainsKey("MouldID"))
  9273. {
  9274. mouldID = Convert.ToInt32(item["MouldID"]);
  9275. if (mouldID == 0)
  9276. {
  9277. mouldID = null;
  9278. }
  9279. }
  9280. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9281. item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"],
  9282. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  9283. mouldID, item["MouldCode"], item["MouldOutputNo"],
  9284. item["GoodsID"], item["GoodsCode"],
  9285. item["StandardGroutingCount"], item["GroutingCount"],
  9286. (mouldID == null ? "0" : "1"));
  9287. }
  9288. ServiceResultEntity result = PCModuleLogicDAL.ChangeGMouldEndGroutingLineDetail(gTable, sUserInfo);
  9289. if (result.Status == Constant.ServiceResultStatus.Success)
  9290. {
  9291. actionResult.Status = (int)Constant.PDAResult.Success;
  9292. }
  9293. else if (result.OtherStatus == -100)
  9294. {
  9295. actionResult.Status = (int)Constant.PDAResult.Fail;
  9296. actionResult.Result = -100;
  9297. actionResult.Message = result.Message;
  9298. return actionResult;
  9299. }
  9300. else
  9301. {
  9302. actionResult.Status = (int)Constant.PDAResult.Fail;
  9303. actionResult.Result = -500;
  9304. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9305. return actionResult;
  9306. }
  9307. return actionResult;
  9308. }
  9309. #endregion
  9310. #region 结束变产
  9311. if (action == "UpdateLineEndGroutingLineDetail")
  9312. {
  9313. if (data == null || !data.ContainsKey("Details"))
  9314. {
  9315. actionResult.Status = (int)Constant.PDAResult.Fail;
  9316. actionResult.Message = "参数错误";
  9317. return actionResult;
  9318. }
  9319. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9320. DataTable gTable = new DataTable();
  9321. gTable.Columns.Add("GroutingLineID", typeof(int));
  9322. gTable.Columns.Add("GroutingLineCode");
  9323. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9324. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9325. gTable.Columns.Add("GroutingMouldCode");
  9326. gTable.Columns.Add("RreasonRemarks");
  9327. gTable.Columns.Add("RecordRemarks");
  9328. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9329. gTable.Columns.Add("MouldID", typeof(int));
  9330. gTable.Columns.Add("MouldCode");
  9331. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9332. gTable.Columns.Add("GoodsID", typeof(int));
  9333. gTable.Columns.Add("GoodsCode");
  9334. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  9335. gTable.Columns.Add("GroutingCount", typeof(int));
  9336. gTable.Columns.Add("MouldSource");
  9337. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9338. string groutingLineCode = data["GroutingLineCode"] + "";
  9339. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9340. foreach (Dictionary<string, object> item in details)
  9341. {
  9342. int? mouldID = null;
  9343. if (item.ContainsKey("MouldID"))
  9344. {
  9345. mouldID = Convert.ToInt32(item["MouldID"]);
  9346. if (mouldID == 0)
  9347. {
  9348. mouldID = null;
  9349. }
  9350. }
  9351. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9352. item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"],
  9353. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  9354. mouldID, item["MouldCode"], item["MouldOutputNo"],
  9355. item["GoodsID"], item["GoodsCode"],
  9356. item["StandardGroutingCount"], item["GroutingCount"],
  9357. (mouldID == null ? "0" : "1"));
  9358. }
  9359. ServiceResultEntity result = PCModuleLogicDAL.UpdateLineEndGroutingLineDetail(gTable, 0, sUserInfo);
  9360. if (result.Status == Constant.ServiceResultStatus.Success)
  9361. {
  9362. actionResult.Status = (int)Constant.PDAResult.Success;
  9363. }
  9364. else if (result.OtherStatus == -100)
  9365. {
  9366. actionResult.Status = (int)Constant.PDAResult.Fail;
  9367. actionResult.Result = -100;
  9368. actionResult.Message = result.Message;
  9369. return actionResult;
  9370. }
  9371. else
  9372. {
  9373. actionResult.Status = (int)Constant.PDAResult.Fail;
  9374. actionResult.Result = -500;
  9375. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9376. return actionResult;
  9377. }
  9378. return actionResult;
  9379. }
  9380. #endregion
  9381. #region 结束整线变产
  9382. if (action == "UpdateAllLineEndGroutingLineDetail")
  9383. {
  9384. if (data == null || !data.ContainsKey("Details"))
  9385. {
  9386. actionResult.Status = (int)Constant.PDAResult.Fail;
  9387. actionResult.Message = "参数错误";
  9388. return actionResult;
  9389. }
  9390. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9391. DataTable gTable = new DataTable();
  9392. gTable.Columns.Add("GroutingLineID", typeof(int));
  9393. gTable.Columns.Add("GroutingLineCode");
  9394. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9395. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9396. gTable.Columns.Add("GroutingMouldCode");
  9397. gTable.Columns.Add("Remarks");
  9398. gTable.Columns.Add("RecordRemarks");
  9399. //gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9400. gTable.Columns.Add("MouldID", typeof(int));
  9401. gTable.Columns.Add("MouldCode");
  9402. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9403. gTable.Columns.Add("GoodsID", typeof(int));
  9404. gTable.Columns.Add("GoodsCode");
  9405. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  9406. gTable.Columns.Add("GroutingCount", typeof(int));
  9407. gTable.Columns.Add("MouldSource");
  9408. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9409. string groutingLineCode = data["GroutingLineCode"] + "";
  9410. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9411. foreach (Dictionary<string, object> item in details)
  9412. {
  9413. int? mouldID = null;
  9414. if (item.ContainsKey("MouldID"))
  9415. {
  9416. mouldID = Convert.ToInt32(item["MouldID"]);
  9417. if (mouldID == 0)
  9418. {
  9419. mouldID = null;
  9420. }
  9421. }
  9422. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9423. item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"],
  9424. item["RecordRemarks"], //Convert.ToDateTime(item["OPTimeStamp"]),
  9425. mouldID, item["MouldCode"], item["MouldOutputNo"],
  9426. item["GoodsID"], item["GoodsCode"],
  9427. item["StandardGroutingCount"], item["GroutingCount"],
  9428. (mouldID == null ? "0" : "1"));
  9429. }
  9430. ServiceResultEntity result = PCModuleLogicDAL.UpdateAllLineEndGroutingLineDetail(gTable, null, groutingLineID, lineOPTimeStamp, sUserInfo);
  9431. if (result.Status == Constant.ServiceResultStatus.Success)
  9432. {
  9433. actionResult.Status = (int)Constant.PDAResult.Success;
  9434. }
  9435. else if (result.OtherStatus == -100)
  9436. {
  9437. actionResult.Status = (int)Constant.PDAResult.Fail;
  9438. actionResult.Result = -100;
  9439. actionResult.Message = result.Message;
  9440. return actionResult;
  9441. }
  9442. else
  9443. {
  9444. actionResult.Status = (int)Constant.PDAResult.Fail;
  9445. actionResult.Result = -500;
  9446. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9447. return actionResult;
  9448. }
  9449. return actionResult;
  9450. }
  9451. #endregion
  9452. #region 上模
  9453. if (action == "UpdateGroutingLine_AddMould")
  9454. {
  9455. if (data == null || !data.ContainsKey("Details"))
  9456. {
  9457. actionResult.Status = (int)Constant.PDAResult.Fail;
  9458. actionResult.Message = "参数错误";
  9459. return actionResult;
  9460. }
  9461. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9462. DataTable gTable = new DataTable();
  9463. gTable.Columns.Add("GroutingLineID", typeof(int));
  9464. gTable.Columns.Add("GroutingLineCode");
  9465. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9466. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9467. gTable.Columns.Add("GroutingMouldCode");
  9468. gTable.Columns.Add("Remarks");
  9469. gTable.Columns.Add("RecordRemarks");
  9470. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9471. gTable.Columns.Add("MouldID", typeof(int));
  9472. gTable.Columns.Add("MouldCode");
  9473. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9474. gTable.Columns.Add("GoodsID", typeof(int));
  9475. gTable.Columns.Add("GoodsCode");
  9476. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  9477. gTable.Columns.Add("GroutingCount", typeof(int));
  9478. gTable.Columns.Add("MouldSource");
  9479. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9480. string groutingLineCode = data["GroutingLineCode"] + "";
  9481. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9482. foreach (Dictionary<string, object> item in details)
  9483. {
  9484. int? mouldID = null;
  9485. if (item.ContainsKey("MouldID"))
  9486. {
  9487. mouldID = Convert.ToInt32(item["MouldID"]);
  9488. if (mouldID == 0)
  9489. {
  9490. mouldID = null;
  9491. }
  9492. }
  9493. int gldID = Convert.ToInt32(item["GLineDetailID"]);
  9494. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9495. gldID, item["GLineDetailCode"],
  9496. item["DetailRemarks"], item["RecordRemarks"],
  9497. (gldID > 0 ? (object)Convert.ToDateTime(item["OPTimeStamp"]) : null),
  9498. mouldID, item["MouldCode"], item["MouldOutputNo"],
  9499. item["GoodsID"], item["GoodsCode"],
  9500. item["StandardGroutingCount"], item["GroutingCount"],
  9501. (mouldID == null ? "0" : "1"));
  9502. }
  9503. ServiceResultEntity result = PCModuleLogicDAL.UpdateGroutingLine_AddMould(groutingLineID, groutingLineCode, lineOPTimeStamp, gTable, sUserInfo);
  9504. if (result.Status == Constant.ServiceResultStatus.Success)
  9505. {
  9506. actionResult.Status = (int)Constant.PDAResult.Success;
  9507. }
  9508. else if (result.OtherStatus == -2 || result.OtherStatus == -100)
  9509. {
  9510. actionResult.Status = (int)Constant.PDAResult.Fail;
  9511. actionResult.Result = result.OtherStatus;
  9512. actionResult.Message = result.Message;
  9513. return actionResult;
  9514. }
  9515. else
  9516. {
  9517. actionResult.Status = (int)Constant.PDAResult.Fail;
  9518. actionResult.Result = -500;
  9519. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9520. return actionResult;
  9521. }
  9522. return actionResult;
  9523. }
  9524. #endregion
  9525. return actionResult;
  9526. }
  9527. #endregion
  9528. #region 包装装板限制
  9529. if (module == "FinishedLoadingCar")
  9530. {
  9531. if (action == "GetSetting")
  9532. {
  9533. ClientRequestEntity cre = new ClientRequestEntity();
  9534. cre.Properties["GoodsID"] = data["GoodsID"];
  9535. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetFinishedLoadingCarSetting(sUserInfo, cre);
  9536. if (sre.Status == Constant.ServiceResultStatus.Success)
  9537. {
  9538. actionResult.Status = (int)Constant.PDAResult.Success;
  9539. foreach (DataRow item in sre.Data.Tables[0].Rows)
  9540. {
  9541. if (item["settingcode"].ToString() == "S_PM_011")
  9542. {
  9543. cre.Properties["S_PM_011"] = item["settingvalue"];
  9544. }
  9545. else if (item["settingcode"].ToString() == "S_PM_012")
  9546. {
  9547. cre.Properties["S_PM_012"] = item["settingvalue"];
  9548. }
  9549. else if (item["settingcode"].ToString() == "S_PM_013")
  9550. {
  9551. cre.Properties["S_PM_013"] = item["settingvalue"];
  9552. }
  9553. }
  9554. cre.Properties["PlatelitNum"] = sre.Result;
  9555. actionResult.Result = JsonHelper.ToJson(cre.Properties);
  9556. }
  9557. else
  9558. {
  9559. actionResult.Status = (int)Constant.PDAResult.Fail;
  9560. actionResult.Message = "";
  9561. }
  9562. return actionResult;
  9563. }
  9564. }
  9565. #endregion
  9566. #region 成型报损
  9567. if (module == "GroutingScrapProduct")
  9568. {
  9569. // 查询注浆日报明细表
  9570. if ("GetGroutingDailyDetail" == action)
  9571. {
  9572. ClientRequestEntity cre = new ClientRequestEntity();
  9573. cre.NameSpace = module;
  9574. cre.Name = action;
  9575. if (!string.IsNullOrEmpty(jsonData))
  9576. {
  9577. cre.Properties["BarCode"] = data["BarCode"];
  9578. }
  9579. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetGroutingDailyDetail(cre, sUserInfo);
  9580. //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9581. actionResult.Status = (int)Constant.PDAResult.Success;
  9582. if (sre == null || sre.Data == null || sre.Data.Tables.Count == 0
  9583. || sre.Data.Tables[0].Rows.Count == 0)
  9584. {
  9585. actionResult.Message = "未查询到该产品信息,请确认该产品是否已经进行注浆!";
  9586. actionResult.Status = (int)Constant.PDAResult.Fail;
  9587. }
  9588. else
  9589. {
  9590. DataRow _barCodeRow = sre.Data.Tables[0].Rows[0];
  9591. // 判断是否进行了注浆
  9592. if ("0".Equals(_barCodeRow["GroutingFlag"]))
  9593. {
  9594. actionResult.Message = "该产品还未进行注浆!";
  9595. actionResult.Status = (int)Constant.PDAResult.Fail;
  9596. }
  9597. // 判断是否进行了交坯
  9598. if ("1".Equals(_barCodeRow["DeliverFlag"]))
  9599. {
  9600. actionResult.Message = "该产品已经交坯!";
  9601. actionResult.Status = (int)Constant.PDAResult.Fail;
  9602. }
  9603. // 判断是否已经报损
  9604. if ("1".Equals(_barCodeRow["ScrapFlag"]))
  9605. {
  9606. actionResult.Message = "该产品已经报损!";
  9607. actionResult.Status = (int)Constant.PDAResult.Fail;
  9608. }
  9609. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9610. }
  9611. }
  9612. // 获取成型报损原因
  9613. else if ("GetScrapReasonData" == action)
  9614. {
  9615. ClientRequestEntity cre = new ClientRequestEntity();
  9616. cre.NameSpace = module;
  9617. cre.Name = action;
  9618. ServiceResultEntity sre = SystemModuleLogic.GetScrapReasonData(cre, sUserInfo);
  9619. actionResult.Status = (int)Constant.PDAResult.Success;
  9620. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9621. }
  9622. // 保存成型报损
  9623. else if ("SaveGroutingScrapProduct" == action)
  9624. {
  9625. ClientRequestEntity cre = new ClientRequestEntity();
  9626. cre.NameSpace = module;
  9627. cre.Name = action;
  9628. if (!string.IsNullOrEmpty(jsonData))
  9629. {
  9630. // DataSet returnData = JsonHelper.FromJson<DataSet>(jsonData);
  9631. DataTable dt = JsonHelper.FromJson<DataTable>(data["Table"] + "");
  9632. DataTable dtResponsible = JsonHelper.FromJson<DataTable>(data["Table1"] + "");
  9633. if (dt != null && dt.Rows.Count > 0)
  9634. {
  9635. // 总单信息
  9636. DataRow properties = dt.Rows[0];
  9637. cre.Properties["BarCode"] = properties["BarCode"]; // 产品条码
  9638. cre.Properties["GoodsID"] = properties["GoodsID"]; // 产品ID
  9639. cre.Properties["GoodsCode"] = properties["GoodsCode"]; // 产品编码
  9640. cre.Properties["GoodsName"] = properties["GoodsName"]; // 产品名称
  9641. cre.Properties["GroutingDailyID"] = properties["GroutingDailyID"]; // 注浆日报ID
  9642. cre.Properties["GroutingDailyDetailID"] = properties["GroutingDailyDetailID"]; // 注浆日报明细ID
  9643. cre.Properties["GroutingDate"] = properties["GroutingDate"]; // 注浆日期
  9644. cre.Properties["GroutingLineID"] = properties["GroutingLineID"]; // 成型生产线ID
  9645. cre.Properties["GroutingLineCode"] = properties["GroutingLineCode"]; // 成型生产线编码
  9646. cre.Properties["GroutingLineName"] = properties["GroutingLineName"]; // 成型生产线名称
  9647. cre.Properties["GMouldTypeID"] = properties["GMouldTypeID"]; // 成型线类型ID
  9648. cre.Properties["GroutingLineDetailID"] = properties["GroutingLineDetailID"]; // 成型生产线明细ID
  9649. cre.Properties["GroutingMouldCode"] = properties["GroutingMouldCode"]; // 注浆模具编号
  9650. cre.Properties["MouldCode"] = properties["MouldCode"]; // 模具编号
  9651. cre.Properties["GroutingUserID"] = properties["GroutingUserID"]; // 注浆工号ID
  9652. cre.Properties["GroutingUserCode"] = properties["GroutingUserCode"]; // 注浆工号编码
  9653. cre.Properties["GroutingNum"] = properties["GroutingNum"]; // 注浆次数
  9654. cre.Properties["ScrapType"] = properties["ScrapType"]; // 损坯类型
  9655. cre.Properties["ScrapDate"] = properties["ScrapDate"]; // 报损日期
  9656. cre.Properties["ScrapRreasonID"] = properties["ScrapRreasonID"]; // 报损日期
  9657. cre.Properties["ResponUserID"] = properties["ResponUserID"]; // 损坯工号
  9658. cre.Properties["ResponUserCode"] = properties["ResponUserCode"];
  9659. cre.Properties["Remarks"] = properties["Remarks"]; // 备注
  9660. cre.Properties["AuditStatus"] = properties["AuditStatus"]; // 审批状态
  9661. // 责任员工
  9662. cre.Data = new DataSet();
  9663. //DataTable returnTable = returnData.Tables[1].Copy();
  9664. cre.Data.Tables.Add(dtResponsible);
  9665. }
  9666. }
  9667. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveGroutingScrapProduct(cre, sUserInfo);
  9668. if (sre.Status == Constant.ServiceResultStatus.Success)
  9669. {
  9670. actionResult.Status = (int)Constant.PDAResult.Success;
  9671. actionResult.Result = sre.Result;
  9672. }
  9673. else
  9674. {
  9675. actionResult.Status = (int)Constant.PDAResult.Fail;
  9676. actionResult.Result = sre.OtherStatus;
  9677. actionResult.Message = sre.Message;
  9678. }
  9679. }
  9680. // 获取成型报损信息 用于撤销使用
  9681. else if ("GetGroutingScrapProduct" == action)
  9682. {
  9683. ClientRequestEntity cre = new ClientRequestEntity();
  9684. cre.NameSpace = module;
  9685. cre.Name = action;
  9686. if (!string.IsNullOrEmpty(jsonData))
  9687. {
  9688. cre.Properties["BarCode"] = data["BarCode"];
  9689. }
  9690. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetGroutingScrapProduct(cre, sUserInfo);
  9691. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9692. actionResult.Status = (int)Constant.PDAResult.Success;
  9693. }
  9694. //xuwei add 2020-03-23
  9695. //获取成型报损信息 用于撤销使用 支持 浆日报直接报损
  9696. else if ("GetGroutingScrap" == action)
  9697. {
  9698. ClientRequestEntity cre = new ClientRequestEntity();
  9699. cre.NameSpace = module;
  9700. cre.Name = action;
  9701. if (!string.IsNullOrEmpty(jsonData))
  9702. {
  9703. cre.Properties["BarCode"] = data["BarCode"];
  9704. }
  9705. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetGroutingScrap(cre, sUserInfo);
  9706. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9707. actionResult.Status = (int)Constant.PDAResult.Success;
  9708. }
  9709. // 撤销成型报损
  9710. else if ("ReverseGroutingScrapProduct" == action)
  9711. {
  9712. ClientRequestEntity cre = new ClientRequestEntity();
  9713. cre.NameSpace = module;
  9714. cre.Name = action;
  9715. if (!string.IsNullOrEmpty(jsonData))
  9716. {
  9717. cre.Properties["BarCode"] = data["BarCode"];
  9718. }
  9719. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.ReverseGroutingScrapProduct(cre, sUserInfo);
  9720. if (sre.Status == Constant.ServiceResultStatus.Success)
  9721. {
  9722. actionResult.Status = (int)Constant.PDAResult.Success;
  9723. actionResult.Result = sre.Result;
  9724. }
  9725. else
  9726. {
  9727. actionResult.Status = (int)Constant.PDAResult.Fail;
  9728. actionResult.Result = sre.OtherStatus;
  9729. actionResult.Message = sre.Message;
  9730. }
  9731. }
  9732. }
  9733. #endregion
  9734. #region 产品挂起
  9735. if (module == "ProductSuspend")
  9736. {
  9737. // 获取可以挂起的工序(干补、装车、入窑、出窑)工序不能挂起
  9738. if (action == "GetSuspendProcedure")
  9739. {
  9740. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetSuspendProcedure(sUserInfo);
  9741. if (sre.Status == Constant.ServiceResultStatus.Success)
  9742. {
  9743. actionResult.Status = (int)Constant.PDAResult.Success;
  9744. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9745. }
  9746. else
  9747. {
  9748. actionResult.Status = (int)Constant.PDAResult.Fail;
  9749. actionResult.Message = sre.Message;
  9750. }
  9751. return actionResult;
  9752. }
  9753. // 验证挂起条码
  9754. if (action == "CheckSuspendBarcode")
  9755. {
  9756. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.CheckSuspendBarcode(sUserInfo, data["barcode"] + "");
  9757. if (sre.Status == Constant.ServiceResultStatus.Success)
  9758. {
  9759. actionResult.Status = (int)Constant.PDAResult.Success;
  9760. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9761. }
  9762. else
  9763. {
  9764. actionResult.Status = (int)Constant.PDAResult.Fail;
  9765. actionResult.Message = sre.Message;
  9766. }
  9767. return actionResult;
  9768. }
  9769. // 挂起条码
  9770. if (action == "SaveSuspendProduct")
  9771. {
  9772. int[] gids = JsonHelper.FromJson<int[]>(data["groutingdailydetailids"] + "");
  9773. int[] pids = JsonHelper.FromJson<int[]>(data["procedureids"] + "");
  9774. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveSuspendProduct(sUserInfo, pids, gids, data["remarks"] + "");
  9775. if (sre.Status == Constant.ServiceResultStatus.Success)
  9776. {
  9777. actionResult.Status = (int)Constant.PDAResult.Success;
  9778. //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9779. }
  9780. else
  9781. {
  9782. actionResult.Status = (int)Constant.PDAResult.Fail;
  9783. actionResult.Message = sre.Message;
  9784. }
  9785. return actionResult;
  9786. }
  9787. // 撤销挂起条码
  9788. if (action == "DeleteSuspendProduct")
  9789. {
  9790. int[] gids = JsonHelper.FromJson<int[]>(data["groutingdailydetailids"] + "");
  9791. int[] pids = JsonHelper.FromJson<int[]>(data["procedureids"] + "");
  9792. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.DeleteSuspendProduct(sUserInfo, pids, gids);
  9793. if (sre.Status == Constant.ServiceResultStatus.Success)
  9794. {
  9795. actionResult.Status = (int)Constant.PDAResult.Success;
  9796. //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9797. }
  9798. else
  9799. {
  9800. actionResult.Status = (int)Constant.PDAResult.Fail;
  9801. actionResult.Message = sre.Message;
  9802. }
  9803. return actionResult;
  9804. }
  9805. // 查询挂起条码
  9806. if (action == "GetSuspendProduct")
  9807. {
  9808. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetSuspendProduct(sUserInfo, data["barcode"] + "");
  9809. if (sre.Status == Constant.ServiceResultStatus.Success)
  9810. {
  9811. if (sre.Data.Tables[0].Rows.Count == 0)
  9812. {
  9813. actionResult.Status = (int)Constant.PDAResult.Fail;
  9814. actionResult.Message = "此条码没有可撤销的挂起信息";
  9815. }
  9816. else
  9817. {
  9818. actionResult.Status = (int)Constant.PDAResult.Success;
  9819. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9820. }
  9821. }
  9822. else
  9823. {
  9824. actionResult.Status = (int)Constant.PDAResult.Fail;
  9825. actionResult.Message = sre.Message;
  9826. }
  9827. return actionResult;
  9828. }
  9829. }
  9830. #endregion
  9831. #region 品保抽查
  9832. if (module == "QASpotCheck")
  9833. {
  9834. if (action == "GetAllQASpotCheck")
  9835. {
  9836. ClientRequestEntity cre = new ClientRequestEntity();
  9837. cre.NameSpace = module;
  9838. cre.Name = action;
  9839. if (data != null && data.Count > 0)
  9840. {
  9841. foreach (string item in data.Keys)
  9842. {
  9843. if (item.StartsWith("checktime"))
  9844. {
  9845. cre.Properties.Add(item, DateTime.ParseExact(data[item] + "", "yyyy-MM-dd", null));
  9846. }
  9847. else
  9848. {
  9849. cre.Properties.Add(item, data[item]);
  9850. }
  9851. }
  9852. }
  9853. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetAllQASpotCheck(sUserInfo, cre));
  9854. if (sre.Status == Constant.ServiceResultStatus.Success)
  9855. {
  9856. actionResult.Status = (int)Constant.PDAResult.Success;
  9857. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9858. }
  9859. else if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  9860. {
  9861. actionResult.Status = (int)Constant.PDAResult.Success;
  9862. }
  9863. else
  9864. {
  9865. actionResult.Status = (int)Constant.PDAResult.Fail;
  9866. actionResult.Message = sre.Message;
  9867. }
  9868. return actionResult;
  9869. }
  9870. if (action == "AutoSaveQASpotCheck")
  9871. {
  9872. string barcode = data["barcode"] + "";
  9873. string remarks = data["remarks"] + "";
  9874. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.AutoSaveQASpotCheck(sUserInfo, barcode, remarks));
  9875. if (sre.Status == Constant.ServiceResultStatus.Success)
  9876. {
  9877. actionResult.Status = (int)Constant.PDAResult.Success;
  9878. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9879. }
  9880. else
  9881. {
  9882. actionResult.Status = (int)Constant.PDAResult.Fail;
  9883. actionResult.Message = sre.Message;
  9884. }
  9885. return actionResult;
  9886. }
  9887. if (action == "CheckQASpotCheck")
  9888. {
  9889. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.CheckQASpotCheck(sUserInfo, jsonData));
  9890. if (sre.Status == Constant.ServiceResultStatus.Success)
  9891. {
  9892. actionResult.Status = (int)Constant.PDAResult.Success;
  9893. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9894. }
  9895. else
  9896. {
  9897. actionResult.Status = (int)Constant.PDAResult.Fail;
  9898. actionResult.Message = sre.Message;
  9899. }
  9900. return actionResult;
  9901. }
  9902. if (action == "SaveQASpotCheck")
  9903. {
  9904. data["CheckTime"] = DateTime.ParseExact(data["CheckTime"] + "", "yyyy-MM-dd HH:mm:ss", null);
  9905. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveQASpotCheck(sUserInfo, data));
  9906. if (sre.Status == Constant.ServiceResultStatus.Success)
  9907. {
  9908. actionResult.Status = (int)Constant.PDAResult.Success;
  9909. }
  9910. else
  9911. {
  9912. actionResult.Status = (int)Constant.PDAResult.Fail;
  9913. actionResult.Message = sre.Message;
  9914. }
  9915. return actionResult;
  9916. }
  9917. return null;
  9918. }
  9919. #endregion
  9920. #region 产成品交接
  9921. if (module == "FinishedProduct")
  9922. {
  9923. // 设定商标
  9924. if (action == "GetFinishedBarcode")
  9925. {
  9926. string barcode = data["barcode"].ToString();
  9927. ServiceResultEntity resultEntity = PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo, 2);
  9928. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9929. if (Convert.ToInt32(resultEntity.Result) < 0)
  9930. {
  9931. actionResult.Status = (int)Constant.PDAResult.Fail;
  9932. actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
  9933. actionResult.Message = resultEntity.Message;
  9934. }
  9935. else
  9936. {
  9937. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9938. actionResult.Status = (int)Constant.PDAResult.Success;
  9939. actionResult.Message = resultEntity.Message;
  9940. }
  9941. return actionResult;
  9942. }
  9943. if (action == "GetHandoveredBarcode")
  9944. {
  9945. string barcode = data["barcode"].ToString();
  9946. ServiceResultEntity resultEntity = PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo, 1);
  9947. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9948. if (Convert.ToInt32(resultEntity.Result) < 0)
  9949. {
  9950. actionResult.Status = (int)Constant.PDAResult.Fail;
  9951. actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
  9952. actionResult.Message = resultEntity.Message;
  9953. }
  9954. else
  9955. {
  9956. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9957. actionResult.Status = (int)Constant.PDAResult.Success;
  9958. actionResult.Message = resultEntity.Message;
  9959. }
  9960. return actionResult;
  9961. }
  9962. if (action == "SetFinishedLogo")
  9963. {
  9964. int logoid = Convert.ToInt32(data["logoid"]);
  9965. string[] barcodes = data["barcodes"].ToString().Split(',');
  9966. int result = PMModuleLogicDAL.SetFinishedLogo(barcodes, logoid, sUserInfo);
  9967. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9968. if (result < 0)
  9969. {
  9970. actionResult.Status = (int)Constant.PDAResult.Fail;
  9971. }
  9972. else
  9973. {
  9974. actionResult.Status = (int)Constant.PDAResult.Success;
  9975. }
  9976. return actionResult;
  9977. }
  9978. if (action == "SetHandoveredOrder")
  9979. {
  9980. int orderID = Convert.ToInt32(data["orderID"]);
  9981. string[] barcodes = data["barcodes"].ToString().Split(',');
  9982. int result = PMModuleLogicDAL.SetHandoveredOrder(barcodes, orderID, sUserInfo);
  9983. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9984. if (result < 0)
  9985. {
  9986. actionResult.Status = (int)Constant.PDAResult.Fail;
  9987. }
  9988. else
  9989. {
  9990. actionResult.Status = (int)Constant.PDAResult.Success;
  9991. }
  9992. return actionResult;
  9993. }
  9994. }
  9995. #endregion
  9996. #region 产成品装车
  9997. /*
  9998. if (module == "FinishedLoading")
  9999. {
  10000. // 设定商标
  10001. if (action == "GetMaxLoadingNo")
  10002. {
  10003. int no = Service.PMModuleService.PMModuleLogic.GetMaxLoadingNo(sUserInfo);
  10004. actionResult.Status = (int)Constant.PDAResult.Success;
  10005. actionResult.Result = no;
  10006. return actionResult;
  10007. }
  10008. if (action == "CheckFinishedLaodingBarcode")
  10009. {
  10010. string barcode = data["barcode"].ToString();
  10011. ServiceResultEntity resultEntity = Service.PMModuleService.PMModuleLogic.CheckFinishedLaodingBarcode(sUserInfo, barcode);
  10012. if (resultEntity.Status == Constant.ServiceResultStatus.Success)
  10013. {
  10014. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  10015. actionResult.Status = (int)Constant.PDAResult.Success;
  10016. actionResult.Message = resultEntity.Message;
  10017. }
  10018. else
  10019. {
  10020. actionResult.Status = (int)Constant.PDAResult.Fail;
  10021. actionResult.Result = resultEntity.OtherStatus;
  10022. actionResult.Message = resultEntity.Message;
  10023. }
  10024. return actionResult;
  10025. }
  10026. if (action == "SaveFinishedLoading")
  10027. {
  10028. int loadingNo = Convert.ToInt32(data["loadingNo"]);
  10029. string carLicense = data["carLicense"] + "";
  10030. int palletNum = Convert.ToInt32(data["palletNum"]);
  10031. int goodsNum = Convert.ToInt32(data["goodsNum"]);
  10032. string remarks = data["remarks"] + "";
  10033. Dictionary<string, object>[] details =
  10034. JsonHelper.FromJson<Dictionary<string, object>[]>(data["details"] + "");
  10035. //"[{\"A\":1,\"B\":\"V\"},{\"A\":2,\"B\":\"V1\"}]"
  10036. ServiceResultEntity result = Service.PMModuleService.PMModuleLogic.SaveFinishedLoading(sUserInfo,
  10037. loadingNo, carLicense, palletNum, goodsNum, remarks, details);
  10038. if (result.Status == Constant.ServiceResultStatus.Success)
  10039. {
  10040. actionResult.Status = (int)Constant.PDAResult.Success;
  10041. actionResult.Message = result.Message;
  10042. }
  10043. else
  10044. {
  10045. actionResult.Status = (int)Constant.PDAResult.Fail;
  10046. actionResult.Result = result.OtherStatus;
  10047. actionResult.Message = result.Message;
  10048. }
  10049. return actionResult;
  10050. }
  10051. }
  10052. */
  10053. #endregion
  10054. #region 产成品质量改判
  10055. if (module == "FinishedProductTamper")
  10056. {
  10057. // 获取产成品信息及缺陷数据
  10058. if (action == "GetDefectData")
  10059. {
  10060. string barcode = data["barcode"].ToString();
  10061. ServiceResultEntity sre = PDAModuleLogic.GetDefectData(barcode, sUserInfo);
  10062. if (sre.Status == Constant.ServiceResultStatus.Success)
  10063. {
  10064. actionResult.Status = (int)Constant.PDAResult.Success;
  10065. actionResult.Result = JsonHelper.ToJson(sre.Result);
  10066. actionResult.Message = sre.Message;
  10067. }
  10068. else
  10069. {
  10070. actionResult.Status = (int)Constant.PDAResult.Fail;
  10071. actionResult.Result = sre.OtherStatus;
  10072. actionResult.Message = sre.Message;
  10073. }
  10074. return actionResult;
  10075. }
  10076. // 获取产成品信息及缺陷数据
  10077. if (action == "SaveDefectData")
  10078. {
  10079. ProductionDataEntity productionDataEntity = JsonHelper.FromJson<ProductionDataEntity>(data["ProductionDataEntity"] + "");
  10080. ServiceResultEntity sre = PDAModuleLogic.SaveDefectData(productionDataEntity, sUserInfo);
  10081. if (sre.Status == Constant.ServiceResultStatus.Success)
  10082. {
  10083. actionResult.Status = (int)Constant.PDAResult.Success;
  10084. actionResult.Message = sre.Message;
  10085. }
  10086. else
  10087. {
  10088. actionResult.Status = (int)Constant.PDAResult.Fail;
  10089. actionResult.Message = sre.Message;
  10090. }
  10091. return actionResult;
  10092. }
  10093. // 通过条码查出责任工序(成品改判用)
  10094. if (action == "GetDutyProcedureByBarCodeForTamper")
  10095. {
  10096. string barcode = data["barcode"] + "";
  10097. int defectid = int.Parse(data["defectid"] + "");
  10098. ServiceResultEntity sre = PDAModuleLogic.GetDutyProcedureByBarCodeForTamper(barcode, defectid, sUserInfo.AccountID);
  10099. if (sre.Status == Constant.ServiceResultStatus.Success)
  10100. {
  10101. actionResult.Status = (int)Constant.PDAResult.Success;
  10102. actionResult.Result = JsonHelper.ToJson(sre.Data);
  10103. actionResult.Message = sre.Message;
  10104. }
  10105. else
  10106. {
  10107. actionResult.Status = (int)Constant.PDAResult.Fail;
  10108. actionResult.Result = sre.OtherStatus;
  10109. actionResult.Message = sre.Message;
  10110. }
  10111. return actionResult;
  10112. }
  10113. }
  10114. #endregion
  10115. #region PDA独立功能
  10116. #region 水效标识
  10117. if (module == "WaterEffect")
  10118. {
  10119. // 获取产成品信息及水效标识
  10120. if (action == "GetGoodsByBarCode")
  10121. {
  10122. string barcode = data["barcode"].ToString();
  10123. ServiceResultEntity sre = PDAModuleLogic.GetGoodsByBarCode(barcode, sUserInfo);
  10124. if (sre.Status == Constant.ServiceResultStatus.Success)
  10125. {
  10126. actionResult.Status = (int)Constant.PDAResult.Success;
  10127. actionResult.Result = JsonHelper.ToJson(sre.Result);
  10128. actionResult.Message = sre.Message;
  10129. }
  10130. else
  10131. {
  10132. actionResult.Status = (int)Constant.PDAResult.Fail;
  10133. actionResult.Result = sre.OtherStatus;
  10134. actionResult.Message = sre.Message;
  10135. }
  10136. return actionResult;
  10137. }
  10138. }
  10139. #endregion
  10140. #region 盖板型号
  10141. if (module == "SeatCoverType")
  10142. {
  10143. // 获取产成品信息及水效标识
  10144. if (action == "SendGoodsCodeToPLC")
  10145. {
  10146. string barcode = data["barcode"].ToString();
  10147. int sre = PLCModuleLogic.SendGoodsCodeToPLCBySeatCover(barcode, sUserInfo);
  10148. if (sre == 0)
  10149. {
  10150. actionResult.Status = (int)Constant.PDAResult.Success;
  10151. }
  10152. else
  10153. {
  10154. actionResult.Status = (int)Constant.PDAResult.Fail;
  10155. actionResult.Result = sre;
  10156. switch (sre)
  10157. {
  10158. case 1:
  10159. case 2:
  10160. actionResult.Message = "无效条码";
  10161. break;
  10162. case 3:
  10163. actionResult.Message = "此产品型号没有设置盖板标识码";
  10164. break;
  10165. case 4:
  10166. actionResult.Message = "当前用户没有设置PLC参数";
  10167. break;
  10168. case 5:
  10169. actionResult.Message = "PLC参数设置不全";
  10170. break;
  10171. default:
  10172. actionResult.Message = "PLC通信异常";
  10173. break;
  10174. }
  10175. }
  10176. return actionResult;
  10177. }
  10178. }
  10179. #endregion
  10180. #region PDA PLC 相关功能
  10181. if (module == "PDA_FUN_PLC")
  10182. {
  10183. // PDA扫码发送到PLCServer
  10184. if (action == "SendBarcodeToPLCServer")
  10185. {
  10186. string barcode = data["barcode"].ToString();
  10187. int sre = PLCModuleLogic.SendBarcodeToPLCServer(barcode, sUserInfo);
  10188. if (sre == 0)
  10189. {
  10190. actionResult.Status = (int)Constant.PDAResult.Success;
  10191. }
  10192. else
  10193. {
  10194. actionResult.Status = (int)Constant.PDAResult.Fail;
  10195. actionResult.Result = sre;
  10196. switch (sre)
  10197. {
  10198. case 1:
  10199. case 2:
  10200. actionResult.Message = "无效条码";
  10201. break;
  10202. case 3:
  10203. actionResult.Message = "PLC通信异常";
  10204. break;
  10205. case 4:
  10206. actionResult.Message = "当前用户没有设置PLC参数";
  10207. break;
  10208. case 5:
  10209. actionResult.Message = "PLC参数设置不全";
  10210. break;
  10211. default:
  10212. actionResult.Message = "PLC通信异常";
  10213. break;
  10214. }
  10215. }
  10216. return actionResult;
  10217. }
  10218. }
  10219. #endregion
  10220. #endregion
  10221. #region 半检返修
  10222. if (module == "SemiRework")
  10223. {
  10224. // 验证半检返修条码
  10225. if (action == "CheckSemiReworkBarcode")
  10226. {
  10227. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10228. PMModuleLogic.CheckSemiReworkBarcode(jsonData);
  10229. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  10230. if (Convert.ToInt32(resultEntity.Result) < 0)
  10231. {
  10232. actionResult.Status = (int)Constant.PDAResult.Fail;
  10233. }
  10234. else
  10235. {
  10236. actionResult.Status = (int)Constant.PDAResult.Success;
  10237. }
  10238. actionResult.Message = resultEntity.Message;
  10239. return actionResult;
  10240. }
  10241. // 可以返修的工序
  10242. if (action == "GetSemiReworkProcedure")
  10243. {
  10244. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10245. PMModuleLogic.GetSemiReworkProcedure(jsonData, sUserInfo);
  10246. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  10247. actionResult.Status = (int)Constant.PDAResult.Success;
  10248. return actionResult;
  10249. }
  10250. // 根据条码获取经过的工序,用于责任工序
  10251. if (action == "GetSemiReworkPassProcedure")
  10252. {
  10253. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10254. PMModuleLogic.GetSemiReworkPassProcedure(jsonData);
  10255. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  10256. actionResult.Status = (int)Constant.PDAResult.Success;
  10257. return actionResult;
  10258. }
  10259. // 根据所选生产工序(生产数据ID)查询责任员工
  10260. if (action == "GetSemiReworkDefectStaffByProductionDataID")
  10261. {
  10262. int productionDataID = Convert.ToInt32(jsonData);
  10263. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10264. PMModuleLogic.GetSemiReworkDefectStaffByProductionDataID(productionDataID);
  10265. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  10266. actionResult.Status = (int)Constant.PDAResult.Success;
  10267. return actionResult;
  10268. }
  10269. // 根据所选工号,查出缺陷责任员工
  10270. if (action == "GetSemiReworkDefectStaffByUserID")
  10271. {
  10272. int userID = Convert.ToInt32(jsonData);
  10273. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10274. PMModuleLogic.GetSemiReworkDefectStaffByUserID(userID);
  10275. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  10276. actionResult.Status = (int)Constant.PDAResult.Success;
  10277. return actionResult;
  10278. }
  10279. // 新建半检返修
  10280. if (action == "AddSemiRework")
  10281. {
  10282. SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"]+"");
  10283. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10284. PMModuleLogic.AddSemiRework(entity, sUserInfo);
  10285. actionResult.Result = resultEntity.Result;
  10286. actionResult.Message = resultEntity.Message;
  10287. if (Convert.ToInt32(resultEntity.Result) > 0)
  10288. {
  10289. actionResult.Status = (int)Constant.PDAResult.Success;
  10290. }
  10291. else
  10292. {
  10293. actionResult.Status = (int)Constant.PDAResult.Fail;
  10294. }
  10295. return actionResult;
  10296. }
  10297. // 编辑半检返修
  10298. if (action == "EditSemiRework")
  10299. {
  10300. SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"] + "");
  10301. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10302. PMModuleLogic.EditSemiRework(entity, sUserInfo);
  10303. actionResult.Result = resultEntity.Result;
  10304. actionResult.Message = resultEntity.Message;
  10305. if (Convert.ToInt32(resultEntity.Result) > 0)
  10306. {
  10307. actionResult.Status = (int)Constant.PDAResult.Success;
  10308. }
  10309. else
  10310. {
  10311. actionResult.Status = (int)Constant.PDAResult.Fail;
  10312. }
  10313. return actionResult;
  10314. }
  10315. // 撤销半检返修
  10316. if (action == "CancelSemiRework")
  10317. {
  10318. SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"] + "");
  10319. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10320. PMModuleLogic.CancelSemiRework(entity, sUserInfo);
  10321. actionResult.Result = resultEntity.Result;
  10322. actionResult.Message = resultEntity.Message;
  10323. if (Convert.ToInt32(resultEntity.Result) > 0)
  10324. {
  10325. actionResult.Status = (int)Constant.PDAResult.Success;
  10326. }
  10327. else
  10328. {
  10329. actionResult.Status = (int)Constant.PDAResult.Fail;
  10330. }
  10331. return actionResult;
  10332. }
  10333. // 获取半检返修数据(PDA编辑用)
  10334. if (action == "GetSemiReworkByID")
  10335. {
  10336. int id = Convert.ToInt32(jsonData);
  10337. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10338. PMModuleLogic.GetSemiReworkByID(id,sUserInfo.UserCode);
  10339. DataTable data1 = resultEntity.Data.Tables[0];
  10340. DataTable data2 = resultEntity.Data.Tables[1];
  10341. DataTable data3 = resultEntity.Data.Tables[2];
  10342. if (data1.Rows.Count == 0)
  10343. {
  10344. actionResult.Status = (int)Constant.PDAResult.Fail;
  10345. actionResult.Message = "半检返修信息不存在";
  10346. return actionResult;
  10347. }
  10348. SemiReworkEntity srEntity = new SemiReworkEntity();
  10349. srEntity.SemiReworkID = id;
  10350. srEntity.BarCode = data1.Rows[0]["BarCode"] + "";
  10351. srEntity.ReworkProcedureID = Convert.ToInt32(data1.Rows[0]["ReworkProcedureID"]);
  10352. srEntity.Remarks = data1.Rows[0]["Remarks"] + "";
  10353. srEntity.SemiReworkDefects = new List<SemiReworkDefectEntity>();
  10354. foreach (DataRow row2 in data2.Rows)
  10355. {
  10356. SemiReworkDefectEntity defectEntity = new SemiReworkDefectEntity();
  10357. srEntity.SemiReworkDefects.Add(defectEntity);
  10358. defectEntity.SemiReworkDefectID = Convert.ToInt32(row2["SemiReworkDefectID"]);
  10359. defectEntity.SemiReworkID = id;
  10360. defectEntity.DefectID = Convert.ToInt32(row2["DefectID"]);
  10361. defectEntity.DefectCode = row2["DefectCode"] + "";
  10362. defectEntity.DefectName = row2["DefectName"] + "";
  10363. defectEntity.DefectPositionID = Convert.ToInt32(row2["DefectPositionID"]);
  10364. defectEntity.DefectPositionCode = row2["DefectPositionCode"] + "";
  10365. defectEntity.DefectPositionName = row2["DefectPositionName"] + "";
  10366. defectEntity.ScrapResponFlag = row2["ScrapResponFlag"] + "";
  10367. defectEntity.DefectProductionDataID = row2["DefectProductionDataID"].ToNullableInt32();
  10368. defectEntity.DefectProcedureID = row2["DefectProcedureID"].ToNullableInt32();
  10369. defectEntity.DefectProcedureCode = row2["DefectProcedureCode"] + "";
  10370. defectEntity.DefectProcedureName = row2["DefectProcedureName"] + "";
  10371. defectEntity.Remarks = row2["Remarks"] + "";
  10372. defectEntity.DefectUserID = Convert.ToInt32(row2["DefectUserID"]);
  10373. defectEntity.DefectUserCode = row2["DefectUserCode"] + "";
  10374. defectEntity.DefectUserName = row2["DefectUserName"] + "";
  10375. defectEntity.DefectResponsibles = new List<SemiReworkRPSEntity>();
  10376. defectEntity.ValueFlag = Convert.ToInt32(row2["ValueFlag"]);
  10377. DataRow[] row3s = data3.Select("SemiReworkDefectID=" + defectEntity.SemiReworkDefectID);
  10378. if (row3s.Length == 0)
  10379. {
  10380. continue;
  10381. }
  10382. foreach (DataRow row3 in row3s)
  10383. {
  10384. SemiReworkRPSEntity semiReworkRPS = new SemiReworkRPSEntity();
  10385. defectEntity.DefectResponsibles.Add(semiReworkRPS);
  10386. semiReworkRPS.SemiReworkDefectID = Convert.ToInt32(row3["SemiReworkDefectID"]);
  10387. semiReworkRPS.StaffID = Convert.ToInt32(row3["StaffID"]);
  10388. semiReworkRPS.StaffName = row3["StaffName"] + "";
  10389. semiReworkRPS.StaffCode = row3["StaffCode"] + "";
  10390. semiReworkRPS.SemiReworkID = Convert.ToInt32(row3["SemiReworkID"]);
  10391. semiReworkRPS.UserID = Convert.ToInt32(row3["UserID"]);
  10392. semiReworkRPS.UserCode = row3["UserCode"] + "";
  10393. semiReworkRPS.UJobsID = Convert.ToInt32(row3["UJobsID"]);
  10394. semiReworkRPS.SJobsID = Convert.ToInt32(row3["SJobsID"]);
  10395. }
  10396. }
  10397. //xuwei note 总单用于显示,信息较全
  10398. actionResult.Message = JsonHelper.ToJson(data1);
  10399. //xuwei note 总单信息不全,但有明细,用于回传保存
  10400. actionResult.Result = JsonHelper.ToJson(srEntity);
  10401. actionResult.Status = (int)Constant.PDAResult.Success;
  10402. }
  10403. }
  10404. #endregion
  10405. #region 窑车漏扫补件
  10406. if (module == "F_PM_0504")
  10407. {
  10408. // 验证窑车编码是否存在
  10409. if (action == "CheckKilnCar")
  10410. {
  10411. ClientRequestEntity cre = new ClientRequestEntity();
  10412. cre.Properties["kilncarcode"] = data["KilnCarCode"];
  10413. cre.Properties["procedureID"] = data["ProcedureID"];
  10414. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.CheckKilnCar(cre, sUserInfo);
  10415. if (sre.Status == Constant.ServiceResultStatus.Success)
  10416. {
  10417. actionResult.Status = (int)Constant.PDAResult.Success;
  10418. actionResult.Result = sre.Result;
  10419. }
  10420. else
  10421. {
  10422. actionResult.Status = (int)Constant.PDAResult.Fail;
  10423. actionResult.Message = sre.Message;
  10424. }
  10425. return actionResult;
  10426. }
  10427. // 验证窑车烧成批次号是否存在 和 是否能补漏扫
  10428. if (action == "CheckKilnCarBatchNo")
  10429. {
  10430. ClientRequestEntity cre = new ClientRequestEntity();
  10431. cre.Properties["KilnID"] = data["KilnID"];
  10432. cre.Properties["KilnCarID"] = data["KilnCarID"];
  10433. cre.Properties["ProcedureID"] = data["ProcedureID"];
  10434. cre.Properties["KilnCarBatchNo"] = data["KilnCarBatchNo"];
  10435. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.CheckKilnCarBatchNo(cre, sUserInfo);
  10436. if (sre.Status == Constant.ServiceResultStatus.Success)
  10437. {
  10438. actionResult.Status = (int)Constant.PDAResult.Success;
  10439. }
  10440. else
  10441. {
  10442. actionResult.Status = (int)Constant.PDAResult.Fail;
  10443. actionResult.Message = sre.Message;
  10444. }
  10445. return actionResult;
  10446. }
  10447. // 窑车漏扫补件
  10448. if (action == "SetKilnCarMissing")
  10449. {
  10450. ClientRequestEntity cre = new ClientRequestEntity();
  10451. cre.Properties["KilnCarBatchNo"] = data["KilnCarBatchNo"];
  10452. string carData = data["CarData"] + "";
  10453. DataTable dataTable = JsonHelper.FromJson<DataTable>(carData);
  10454. cre.Data = new DataSet();
  10455. cre.Data.Tables.Add(dataTable);
  10456. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.SetKilnCarMissing(cre, sUserInfo);
  10457. if (sre.Status == Constant.ServiceResultStatus.Success)
  10458. {
  10459. actionResult.Status = (int)Constant.PDAResult.Success;
  10460. }
  10461. else
  10462. {
  10463. actionResult.Status = (int)Constant.PDAResult.Fail;
  10464. actionResult.Message = sre.Message;
  10465. }
  10466. return actionResult;
  10467. }
  10468. }
  10469. #endregion
  10470. #region 试验留瓷标记
  10471. if (module == "RetainBarcode")
  10472. {
  10473. #region 留瓷
  10474. if (action == "CheckRetainBarcode")
  10475. {
  10476. string barcode = data["Barcode"] + "";
  10477. ServiceResultEntity sre = PDAModuleLogic.CheckRetainBarcode(barcode, sUserInfo, "1");
  10478. if (sre.OtherStatus >= 0)
  10479. {
  10480. actionResult.Status = (int)Constant.PDAResult.Success;
  10481. actionResult.Result = JsonHelper.ToJson(sre.Data);
  10482. }
  10483. else
  10484. {
  10485. actionResult.Status = (int)Constant.PDAResult.Fail;
  10486. actionResult.Result = sre.OtherStatus;
  10487. actionResult.Message = sre.Message;
  10488. }
  10489. return actionResult;
  10490. }
  10491. else if (action == "SaveRetainFlag")
  10492. {
  10493. string[] barcodes = JsonHelper.FromJson<string[]>(data["Barcodes"] + "");
  10494. ServiceResultEntity sre = PDAModuleLogic.SaveRetainFlag(barcodes, "1");
  10495. if (sre.OtherStatus > 0)
  10496. {
  10497. actionResult.Status = (int)Constant.PDAResult.Success;
  10498. }
  10499. else
  10500. {
  10501. actionResult.Status = (int)Constant.PDAResult.Fail;
  10502. actionResult.Message = sre.Message;
  10503. }
  10504. return actionResult;
  10505. }
  10506. #endregion
  10507. #region 撤销留瓷
  10508. if (action == "CheckBackRetainBarcode")
  10509. {
  10510. string barcode = data["Barcode"] + "";
  10511. ServiceResultEntity sre = PDAModuleLogic.CheckRetainBarcode(barcode, sUserInfo, "0");
  10512. if (sre.OtherStatus >= 0)
  10513. {
  10514. actionResult.Status = (int)Constant.PDAResult.Success;
  10515. actionResult.Result = JsonHelper.ToJson(sre.Data);
  10516. }
  10517. else
  10518. {
  10519. actionResult.Status = (int)Constant.PDAResult.Fail;
  10520. actionResult.Result = sre.OtherStatus;
  10521. actionResult.Message = sre.Message;
  10522. }
  10523. return actionResult;
  10524. }
  10525. else if (action == "SaveBackRetainFlag")
  10526. {
  10527. string[] barcodes = JsonHelper.FromJson<string[]>(data["Barcodes"] + "");
  10528. ServiceResultEntity sre = PDAModuleLogic.SaveRetainFlag(barcodes, "0");
  10529. if (sre.OtherStatus > 0)
  10530. {
  10531. actionResult.Status = (int)Constant.PDAResult.Success;
  10532. }
  10533. else
  10534. {
  10535. actionResult.Status = (int)Constant.PDAResult.Fail;
  10536. actionResult.Message = sre.Message;
  10537. }
  10538. return actionResult;
  10539. }
  10540. #endregion
  10541. }
  10542. #endregion
  10543. return actionResult;
  10544. }
  10545. catch (Exception ex)
  10546. {
  10547. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  10548. OutputLog.TraceLog(LogPriority.Error,
  10549. this.ToString(),
  10550. System.Reflection.MethodBase.GetCurrentMethod().Name + System.Environment.NewLine +
  10551. JsonHelper.ToJson(sUserInfo) + System.Environment.NewLine +
  10552. " module:" + module + " action:" + action + " json:" + jsonData,
  10553. ex.ToString(),
  10554. LocalPath.LogExePath);
  10555. actionResult.Status = (int)Constant.PDAResult.Exception;
  10556. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  10557. }
  10558. return actionResult;
  10559. }
  10560. #endregion
  10561. }
  10562. }